@cfast/ui 0.0.1 → 0.2.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 (51) hide show
  1. package/README.md +23 -23
  2. package/dist/chunk-PWBG6CGF.js +1400 -0
  3. package/dist/{permission-gate-DVmY42oz.d.ts → client-CIx8_tmv.d.ts} +617 -2
  4. package/dist/client.d.ts +4 -617
  5. package/dist/client.js +6 -8
  6. package/dist/index.d.ts +52 -5
  7. package/dist/index.js +17 -13
  8. package/llms.txt +159 -0
  9. package/package.json +25 -41
  10. package/LICENSE +0 -21
  11. package/dist/chunk-755IRYDN.js +0 -941
  12. package/dist/chunk-7SNK37GF.js +0 -418
  13. package/dist/chunk-ASMYTWTR.js +0 -356
  14. package/dist/chunk-B2XXH5V4.js +0 -66
  15. package/dist/chunk-BQMXYYEV.js +0 -348
  16. package/dist/chunk-DTKBXCTU.js +0 -211
  17. package/dist/chunk-EYIBATYR.js +0 -33
  18. package/dist/chunk-FPZAQ2YQ.js +0 -474
  19. package/dist/chunk-G2OU4BYC.js +0 -205
  20. package/dist/chunk-JEGEIQ3R.js +0 -925
  21. package/dist/chunk-JUNLQJ6H.js +0 -1013
  22. package/dist/chunk-NRGMW3JA.js +0 -906
  23. package/dist/chunk-Q6FPL2OJ.js +0 -1086
  24. package/dist/chunk-QHWAGKNW.js +0 -456
  25. package/dist/chunk-QZT62CGJ.js +0 -924
  26. package/dist/chunk-RDTUEOLK.js +0 -486
  27. package/dist/chunk-RESL4IJJ.js +0 -112
  28. package/dist/chunk-UDCWQUTR.js +0 -221
  29. package/dist/chunk-UE7PZOIJ.js +0 -11
  30. package/dist/chunk-UTZTHGNE.js +0 -84
  31. package/dist/chunk-UVRXMOX5.js +0 -439
  32. package/dist/chunk-XFD3N2D4.js +0 -161
  33. package/dist/client-CXIHCQtA.d.ts +0 -274
  34. package/dist/joy.d.ts +0 -199
  35. package/dist/joy.js +0 -1150
  36. package/dist/permission-gate-apt9T9Mu.d.ts +0 -1256
  37. package/dist/types-1bAiH2uK.d.ts +0 -392
  38. package/dist/types-BX6u5sAd.d.ts +0 -403
  39. package/dist/types-BpdY7w5l.d.ts +0 -403
  40. package/dist/types-BrepeVp8.d.ts +0 -403
  41. package/dist/types-BvAqMZhn.d.ts +0 -403
  42. package/dist/types-C74nSscq.d.ts +0 -403
  43. package/dist/types-DD1Cpx8F.d.ts +0 -403
  44. package/dist/types-DHUhQwJn.d.ts +0 -403
  45. package/dist/types-DZSJNt_M.d.ts +0 -392
  46. package/dist/types-DaaJiIjW.d.ts +0 -391
  47. package/dist/types-LUpWJwps.d.ts +0 -403
  48. package/dist/types-a7zVU6WE.d.ts +0 -394
  49. package/dist/types-biJTHMcH.d.ts +0 -403
  50. package/dist/types-ow_qSEYJ.d.ts +0 -392
  51. package/dist/types-wnLasZaB.d.ts +0 -1234
package/dist/client.d.ts CHANGED
@@ -1,617 +1,4 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { a6 as UIPlugin, a7 as UIPluginComponents, s as ConfirmOptions, a1 as ToastApi, h as ActionButtonProps, M as FormStatusProps, k as AvatarWithInitialsProps, X as RoleBadgeProps, P as ImpersonationBannerProps, t as DataTableProps, z as FilterBarProps, n as BulkAction, p as ColumnDef, v as DropZoneProps, O as ImagePreviewProps, y as FileListProps, Q as ListViewProps, u as DetailViewProps } from './permission-gate-DVmY42oz.js';
3
- export { V as PermissionGate } from './permission-gate-DVmY42oz.js';
4
- import { ClientDescriptor } from '@cfast/actions/client';
5
- import { ReactNode, ComponentType } from 'react';
6
-
7
- /**
8
- * Creates a {@link UIPlugin} that maps component slots to styled implementations.
9
- *
10
- * Slots not provided in the `components` map fall back to the unstyled HTML
11
- * defaults from the headless layer. This allows incremental adoption -- implement
12
- * only the slots your design system covers.
13
- *
14
- * @param config - Plugin configuration object.
15
- * @param config.components - Partial map of slot names to styled component implementations.
16
- * See {@link UIPluginComponents} for available slots.
17
- * @returns A {@link UIPlugin} instance to pass to {@link UIPluginProvider}.
18
- *
19
- * @example
20
- * ```ts
21
- * import { createUIPlugin } from "@cfast/ui";
22
- *
23
- * const joyPlugin = createUIPlugin({
24
- * components: {
25
- * button: JoyButton,
26
- * table: JoyTable,
27
- * chip: JoyChip,
28
- * },
29
- * });
30
- * ```
31
- */
32
- declare function createUIPlugin(config: {
33
- components: Partial<UIPluginComponents>;
34
- }): UIPlugin;
35
- /**
36
- * React context provider that makes a {@link UIPlugin} available to all `@cfast/ui` components.
37
- *
38
- * Place this near the root of your component tree (typically in the root layout).
39
- * All headless components use {@link useComponent} internally to resolve their
40
- * styled implementations from this context.
41
- *
42
- * @param props - Component props.
43
- * @param props.plugin - The UI plugin created by {@link createUIPlugin}.
44
- * @param props.children - Child elements that can access the plugin via
45
- * {@link useUIPlugin} or {@link useComponent}.
46
- * @returns A React element wrapping children with the UI plugin context.
47
- *
48
- * @example
49
- * ```tsx
50
- * import { UIPluginProvider, createUIPlugin } from "@cfast/ui";
51
- *
52
- * const plugin = createUIPlugin({ components: { button: MyButton } });
53
- *
54
- * function Root() {
55
- * return (
56
- * <UIPluginProvider plugin={plugin}>
57
- * <App />
58
- * </UIPluginProvider>
59
- * );
60
- * }
61
- * ```
62
- */
63
- declare function UIPluginProvider({ plugin, children, }: {
64
- plugin: UIPlugin;
65
- children: React.ReactNode;
66
- }): react_jsx_runtime.JSX.Element;
67
- /**
68
- * Returns the current {@link UIPlugin} from React context.
69
- *
70
- * Returns `null` if no {@link UIPluginProvider} is present in the component tree.
71
- * Most consumers should use {@link useComponent} instead, which handles the
72
- * fallback to headless defaults automatically.
73
- *
74
- * @returns The active {@link UIPlugin}, or `null` if no provider is mounted.
75
- *
76
- * @example
77
- * ```ts
78
- * const plugin = useUIPlugin();
79
- * if (plugin?.components.button) {
80
- * // A custom button implementation is available
81
- * }
82
- * ```
83
- */
84
- declare function useUIPlugin(): UIPlugin | null;
85
- /**
86
- * Resolves a component for a given {@link UIPluginComponents} slot.
87
- *
88
- * Looks up the slot in the current {@link UIPlugin} (via {@link useUIPlugin}).
89
- * If the plugin provides an implementation for the slot, that component is returned.
90
- * Otherwise, the headless HTML default is returned. This ensures every component
91
- * renders correctly even without a UI plugin installed.
92
- *
93
- * @typeParam K - The slot key from {@link UIPluginComponents}.
94
- * @param slot - The component slot name to resolve (e.g., `"button"`, `"table"`, `"chip"`).
95
- * @returns The component implementation for the given slot.
96
- *
97
- * @example
98
- * ```ts
99
- * function MyComponent() {
100
- * const Button = useComponent("button");
101
- * const Chip = useComponent("chip");
102
- *
103
- * return <Button onClick={handleClick}>Click me</Button>;
104
- * }
105
- * ```
106
- */
107
- declare function useComponent<K extends keyof UIPluginComponents>(slot: K): UIPluginComponents[K];
108
-
109
- /**
110
- * Function signature for the imperative confirmation dialog.
111
- *
112
- * Call with {@link ConfirmOptions} to show a dialog. Resolves to `true` if
113
- * the user confirms, or `false` if they cancel or dismiss.
114
- */
115
- type ConfirmFn = (options: ConfirmOptions) => Promise<boolean>;
116
- /**
117
- * Returns an imperative {@link ConfirmFn} that opens a confirmation dialog
118
- * and resolves to `true` (confirmed) or `false` (cancelled/dismissed).
119
- *
120
- * Must be used within a `ConfirmProvider` -- typically supplied by the
121
- * Joy UI plugin or a custom UI plugin implementation.
122
- *
123
- * @returns A {@link ConfirmFn} that accepts {@link ConfirmOptions} and returns a `Promise<boolean>`.
124
- * @throws {Error} If called outside of a `ConfirmProvider`.
125
- *
126
- * @example
127
- * ```ts
128
- * function DangerZone() {
129
- * const confirm = useConfirm();
130
- *
131
- * async function handleDelete() {
132
- * const ok = await confirm({
133
- * title: "Delete account",
134
- * description: "This action cannot be undone.",
135
- * confirmLabel: "Delete",
136
- * variant: "danger",
137
- * });
138
- * if (ok) { /* proceed *\/ }
139
- * }
140
- *
141
- * return <button onClick={handleDelete}>Delete</button>;
142
- * }
143
- * ```
144
- */
145
- declare function useConfirm(): ConfirmFn;
146
-
147
- /**
148
- * Returns an imperative {@link ToastApi} for showing toast notifications.
149
- *
150
- * Provides convenience methods (`success`, `error`, `info`, `warning`) as well
151
- * as a generic `show` method that accepts full {@link ToastOptions}.
152
- *
153
- * Must be used within a `ToastProvider` -- typically supplied by the Joy UI
154
- * plugin (backed by Sonner) or a custom UI plugin implementation.
155
- *
156
- * @returns A {@link ToastApi} object with methods for each notification type.
157
- * @throws {Error} If called outside of a `ToastProvider`.
158
- *
159
- * @example
160
- * ```ts
161
- * function PublishButton() {
162
- * const toast = useToast();
163
- *
164
- * async function handlePublish() {
165
- * try {
166
- * await publishPost();
167
- * toast.success("Post published");
168
- * } catch (err) {
169
- * toast.error("Failed to publish post");
170
- * }
171
- * }
172
- *
173
- * return <button onClick={handlePublish}>Publish</button>;
174
- * }
175
- * ```
176
- */
177
- declare function useToast(): ToastApi;
178
-
179
- /**
180
- * Maps action names to their success/error toast messages.
181
- *
182
- * Each key is an action name from a {@link ClientDescriptor}, and the value
183
- * specifies the toast messages to show when that action succeeds or fails.
184
- */
185
- type ActionToastConfig = Record<string, {
186
- success?: string;
187
- error?: string;
188
- }>;
189
- /**
190
- * Automatically shows toast notifications when `@cfast/actions` results arrive.
191
- *
192
- * Watches all configured actions via their {@link ClientDescriptor} and triggers
193
- * success or error toasts when their result data changes. Internally uses
194
- * {@link useToast} and `useActions` from `@cfast/actions/client`.
195
- *
196
- * Must be used within both a `ToastProvider` and an actions context
197
- * (i.e., inside `app.Provider`).
198
- *
199
- * @param descriptor - Client-side action descriptor from `@cfast/actions`, typically
200
- * `composed.client` from a `createActions()` call.
201
- * @param config - Map of action names to toast messages. Only actions listed here
202
- * are watched; others are ignored.
203
- * @returns void
204
- *
205
- * @example
206
- * ```ts
207
- * // In a route component:
208
- * useActionToast(composed.client, {
209
- * deletePost: { success: "Post deleted", error: "Failed to delete" },
210
- * publishPost: { success: "Post published" },
211
- * });
212
- * ```
213
- */
214
- declare function useActionToast(descriptor: ClientDescriptor, config: ActionToastConfig): void;
215
-
216
- /**
217
- * Permission-aware button that submits a `@cfast/actions` action.
218
- *
219
- * Accepts an `ActionHookResult` from `useActions()` and renders a button
220
- * via the UI plugin's `button` slot. The button's visibility and disabled
221
- * state are controlled by the action's permission status. Extra props are
222
- * forwarded to the underlying button component.
223
- *
224
- * - `whenForbidden="hide"` -- hidden when not permitted
225
- * - `whenForbidden="disable"` -- shown but disabled when not permitted (default)
226
- * - `whenForbidden="show"` -- shown and clickable regardless of permission
227
- *
228
- * @param props - See {@link ActionButtonProps}.
229
- *
230
- * @example
231
- * ```tsx
232
- * <ActionButton
233
- * action={publishPost}
234
- * whenForbidden="disable"
235
- * confirmation="Publish this post?"
236
- * >
237
- * Publish
238
- * </ActionButton>
239
- * ```
240
- */
241
- declare function ActionButton({ action, children, whenForbidden, confirmation: _confirmation, ...buttonProps }: ActionButtonProps): react_jsx_runtime.JSX.Element | null;
242
-
243
- /**
244
- * Provides the {@link useConfirm} context and renders the confirmation dialog.
245
- *
246
- * Wrap your application (or a subtree) with `ConfirmProvider` to enable the
247
- * imperative `useConfirm()` hook. The dialog is rendered using the UI plugin's
248
- * `confirmDialog` slot, so it matches your chosen component library.
249
- *
250
- * @param props.children - The React tree that can call `useConfirm()`.
251
- *
252
- * @example
253
- * ```tsx
254
- * // In your root layout:
255
- * <ConfirmProvider>
256
- * <App />
257
- * </ConfirmProvider>
258
- *
259
- * // In any descendant component:
260
- * const confirm = useConfirm();
261
- * const ok = await confirm({ title: "Delete?", variant: "danger" });
262
- * ```
263
- */
264
- declare function ConfirmProvider({ children }: {
265
- children: ReactNode;
266
- }): react_jsx_runtime.JSX.Element;
267
-
268
- /**
269
- * Displays action result feedback (success, error, and field-level validation messages).
270
- *
271
- * Renders alerts via the UI plugin's `alert` slot. Success messages are shown
272
- * in green, errors in red, and field-level validation errors as a bulleted list.
273
- * Returns `null` when there is no feedback to display.
274
- *
275
- * @param props - See {@link FormStatusProps}.
276
- *
277
- * @example
278
- * ```tsx
279
- * function EditForm() {
280
- * const actionData = useActionData();
281
- * return (
282
- * <Form method="post">
283
- * <FormStatus data={actionData} />
284
- * ...
285
- * </Form>
286
- * );
287
- * }
288
- * ```
289
- */
290
- declare function FormStatus({ data }: FormStatusProps): react_jsx_runtime.JSX.Element | null;
291
-
292
- /**
293
- * Extracts up to two uppercase initials from a full name.
294
- *
295
- * Splits the name on spaces and takes the first character of each part.
296
- *
297
- * @param name - The full name to extract initials from.
298
- * @returns A string of 1-2 uppercase characters (e.g. `"DS"` for `"Daniel Schmidt"`).
299
- *
300
- * @example
301
- * ```ts
302
- * getInitials("Daniel Schmidt"); // "DS"
303
- * getInitials("Alice"); // "A"
304
- * ```
305
- */
306
- declare function getInitials(name: string): string;
307
- /**
308
- * Avatar component with automatic initials fallback.
309
- *
310
- * Renders an `<img>` when a `src` URL is provided. When `src` is absent or null,
311
- * displays the user's initials (derived via {@link getInitials}) inside a circular
312
- * badge. This is the headless implementation; styled versions are provided by UI plugins.
313
- *
314
- * @param props - See {@link AvatarWithInitialsProps}.
315
- *
316
- * @example
317
- * ```tsx
318
- * <AvatarWithInitials
319
- * src={user.avatarUrl}
320
- * name={user.name}
321
- * size="sm"
322
- * />
323
- * ```
324
- */
325
- declare function AvatarWithInitials({ src, name, size, }: AvatarWithInitialsProps): react_jsx_runtime.JSX.Element;
326
-
327
- /**
328
- * Colored badge displaying a user's role name.
329
- *
330
- * Renders via the UI plugin's `chip` slot. Default color mapping:
331
- * admin = danger, editor = primary, author = success, reader = neutral.
332
- * Pass a custom `colors` map to override or extend the defaults.
333
- *
334
- * @param props - See {@link RoleBadgeProps}.
335
- *
336
- * @example
337
- * ```tsx
338
- * <RoleBadge role="admin" />
339
- * // Custom colors:
340
- * <RoleBadge role="moderator" colors={{ moderator: "warning" }} />
341
- * ```
342
- */
343
- declare function RoleBadge({ role, colors }: RoleBadgeProps): react_jsx_runtime.JSX.Element;
344
-
345
- /**
346
- * Persistent banner shown when an admin is impersonating another user.
347
- *
348
- * Reads the current user from `@cfast/auth` via `useCurrentUser()`. When the
349
- * user has `isImpersonating` set, renders a warning alert with the impersonated
350
- * user's name/email and a "Stop Impersonating" button that posts to `stopAction`.
351
- * Hidden when not impersonating.
352
- *
353
- * @param props - See {@link ImpersonationBannerProps}.
354
- *
355
- * @example
356
- * ```tsx
357
- * // In your root layout:
358
- * <ImpersonationBanner />
359
- *
360
- * // With custom stop action URL:
361
- * <ImpersonationBanner stopAction="/api/stop-impersonation" />
362
- * ```
363
- */
364
- declare function ImpersonationBanner({ stopAction, }: ImpersonationBannerProps): react_jsx_runtime.JSX.Element | null;
365
-
366
- /**
367
- * Data table with column sorting, row selection, and pluggable cell rendering.
368
- *
369
- * Renders via the UI plugin's table slots (`table`, `tableHead`, `tableBody`,
370
- * `tableRow`, `tableCell`). Accepts column definitions as strings (auto-labeled)
371
- * or full {@link ColumnDef} objects for custom labels, sorting, and renderers.
372
- *
373
- * Integrates with `@cfast/pagination` hook results for paginated data and with
374
- * `@cfast/actions` for row-level actions.
375
- *
376
- * @typeParam T - The row data type.
377
- * @param props - See {@link DataTableProps}.
378
- *
379
- * @example
380
- * ```tsx
381
- * const pagination = usePagination<Post>();
382
- *
383
- * <DataTable
384
- * data={pagination}
385
- * columns={["title", "author", { key: "createdAt", sortable: false }]}
386
- * selectable
387
- * onRowClick={(row) => navigate(`/posts/${row.id}`)}
388
- * />
389
- * ```
390
- */
391
- declare function DataTable<T = unknown>({ data, columns: columnsProp, selectable, selectedRows: externalSelectedRows, onSelectionChange, onRowClick, getRowId, emptyMessage, }: DataTableProps<T>): react_jsx_runtime.JSX.Element;
392
-
393
- /**
394
- * URL-synced filter controls for data tables and list views.
395
- *
396
- * Each filter serializes its state to URL search params (e.g., `?published=true`).
397
- * On filter change, React Router navigates with the updated params, resetting
398
- * pagination to page 1. In the loader, `@cfast/pagination`'s `parseParams()`
399
- * reads these params and applies them as Drizzle `where` clauses.
400
- *
401
- * Supports text, select, boolean, and other filter types via {@link FilterDef}.
402
- * An optional `searchable` prop adds a full-text search input across specified columns.
403
- *
404
- * @param props - See {@link FilterBarProps}.
405
- *
406
- * @example
407
- * ```tsx
408
- * <FilterBar
409
- * filters={[
410
- * { column: "published", type: "select", options: [
411
- * { label: "Published", value: "true" },
412
- * { label: "Draft", value: "false" },
413
- * ]},
414
- * { column: "createdAt", type: "dateRange" },
415
- * ]}
416
- * searchable={["title", "content"]}
417
- * />
418
- * ```
419
- */
420
- declare function FilterBar({ filters, searchable, }: FilterBarProps): react_jsx_runtime.JSX.Element;
421
-
422
- type BulkActionBarProps = {
423
- selectedCount: number;
424
- actions: BulkAction[];
425
- onAction: (action: BulkAction) => void;
426
- onClearSelection: () => void;
427
- };
428
- /**
429
- * Toolbar that appears when rows are selected in a {@link DataTable}.
430
- *
431
- * Displays the selected row count, action buttons for each {@link BulkAction},
432
- * and a "Clear" button to deselect all rows. Actions are rendered via the UI
433
- * plugin's `button` slot. Hidden automatically when `selectedCount` is zero.
434
- *
435
- * @param props - See {@link BulkActionBarProps}.
436
- *
437
- * @example
438
- * ```tsx
439
- * <BulkActionBar
440
- * selectedCount={selectedRows.length}
441
- * actions={[
442
- * { label: "Delete", icon: TrashIcon },
443
- * { label: "Publish" },
444
- * ]}
445
- * onAction={(action) => handleBulk(action, selectedRows)}
446
- * onClearSelection={() => clearSelection()}
447
- * />
448
- * ```
449
- */
450
- declare function BulkActionBar({ selectedCount, actions, onAction, onClearSelection, }: BulkActionBarProps): react_jsx_runtime.JSX.Element | null;
451
-
452
- /** A column definition extended with an inferred TypedField component. */
453
- type InferredColumn = ColumnDef & {
454
- /** The field component that renders the appropriate display for this column type. */
455
- field: ComponentType<{
456
- value: unknown;
457
- }>;
458
- };
459
- /**
460
- * Inspects a Drizzle table's columns and returns inferred {@link ColumnDef} entries
461
- * with appropriate TypedField components attached.
462
- *
463
- * Uses {@link fieldForColumn} internally to map each Drizzle column's `dataType`
464
- * to a display component (e.g., `DateField`, `BooleanField`, `TextField`).
465
- * Labels are auto-derived from camelCase column keys.
466
- *
467
- * Memoized -- only recomputes when the `table` reference or `columns` array changes.
468
- *
469
- * @param table - A Drizzle table object whose entries expose `dataType` and `name` metadata.
470
- * Pass `undefined` to return an empty array (safe for conditional rendering).
471
- * @param columns - Optional subset of column names to include. When provided,
472
- * only matching columns are returned and their order is preserved.
473
- * @returns Array of {@link InferredColumn} definitions, each containing a `field`
474
- * component ready for rendering.
475
- *
476
- * @example
477
- * ```ts
478
- * import { useColumnInference } from "@cfast/ui";
479
- * import { posts } from "~/db/schema";
480
- *
481
- * const cols = useColumnInference(posts, ["title", "createdAt", "published"]);
482
- * // cols[0].field === TextField
483
- * // cols[1].field === DateField
484
- * // cols[2].field === BooleanField
485
- * ```
486
- */
487
- declare function useColumnInference(table: Record<string, unknown> | undefined, columns?: string[]): InferredColumn[];
488
-
489
- /**
490
- * Drag-and-drop file upload area that integrates with `@cfast/storage`.
491
- *
492
- * Accepts an `upload` result from `useUpload()` (`@cfast/storage/client`).
493
- * File type restrictions and max size are inherited from the storage schema.
494
- * Renders via the UI plugin's `dropZone` slot and manages drag state,
495
- * file validation, and upload progress internally.
496
- *
497
- * @param props - See {@link DropZoneProps}.
498
- *
499
- * @example
500
- * ```tsx
501
- * const upload = useUpload("postCoverImage");
502
- *
503
- * <DropZone upload={upload} />
504
- *
505
- * // Allow multiple files:
506
- * <DropZone upload={upload} multiple />
507
- * ```
508
- */
509
- declare function DropZone({ upload, multiple, children, }: DropZoneProps): react_jsx_runtime.JSX.Element;
510
-
511
- /**
512
- * Displays an image from `@cfast/storage` or a direct URL.
513
- *
514
- * Resolves the display URL from either a direct `src`, or a `fileKey` + `getUrl`
515
- * resolver function (for signed URL generation). Shows a placeholder when no
516
- * image is available, or renders the `fallback` element if provided.
517
- *
518
- * @param props - See {@link ImagePreviewProps}.
519
- *
520
- * @example
521
- * ```tsx
522
- * <ImagePreview
523
- * fileKey={post.coverImageKey}
524
- * getUrl={(key) => storage.getSignedUrl(key)}
525
- * width={200}
526
- * height={150}
527
- * fallback={<PlaceholderImage />}
528
- * />
529
- * ```
530
- */
531
- declare function ImagePreview({ fileKey, src, getUrl, width, height, fallback, alt, }: ImagePreviewProps): react_jsx_runtime.JSX.Element;
532
-
533
- /**
534
- * Displays a list of uploaded files with metadata, formatted sizes, and download links.
535
- *
536
- * Each file is rendered as a row showing the file name, size (human-readable), and
537
- * a download link (either via `onDownload` callback or the file's direct `url`).
538
- * Returns a "No files" placeholder when the list is empty.
539
- *
540
- * @param props - See {@link FileListProps}.
541
- *
542
- * @example
543
- * ```tsx
544
- * <FileList
545
- * files={post.attachments}
546
- * onDownload={(file) => window.open(storage.getSignedUrl(file.key))}
547
- * />
548
- * ```
549
- */
550
- declare function FileList({ files, onDownload, }: FileListProps): react_jsx_runtime.JSX.Element;
551
-
552
- /**
553
- * Full-page list layout composing filters, data table, pagination, and empty state.
554
- *
555
- * Combines {@link PageContainer}, {@link FilterBar}, {@link DataTable},
556
- * {@link EmptyState}, {@link BulkActionBar}, and pagination controls into a
557
- * single component. This is the primary component used by `@cfast/admin` for
558
- * every table view, but it is equally useful in application code.
559
- *
560
- * Supports both offset-based pagination (page numbers) and cursor-based pagination
561
- * (load more). The `createAction` prop controls the visibility of the "Create" button
562
- * via permission checks.
563
- *
564
- * @typeParam T - The row data type.
565
- * @param props - See {@link ListViewProps}.
566
- *
567
- * @example
568
- * ```tsx
569
- * const pagination = useOffsetPagination<Post>();
570
- *
571
- * <ListView
572
- * title="Blog Posts"
573
- * data={pagination}
574
- * columns={["title", "author", "published", "createdAt"]}
575
- * filters={[{ column: "published", type: "select", options: publishedOptions }]}
576
- * searchable={["title", "content"]}
577
- * createAction={createPost.client}
578
- * selectable
579
- * bulkActions={[
580
- * { label: "Delete", handler: (rows) => bulkDelete(rows) },
581
- * ]}
582
- * />
583
- * ```
584
- */
585
- declare function ListView<T = unknown>({ title, data, table: _table, columns, actions: _actions, filters, searchable, createAction, createLabel, selectable, bulkActions, breadcrumb, }: ListViewProps<T>): react_jsx_runtime.JSX.Element;
586
-
587
- /**
588
- * Read-only detail page for a single record, rendered in a two-column grid.
589
- *
590
- * Composes {@link PageContainer} with automatic TypedField rendering. When a Drizzle
591
- * `table` is provided, field types are inferred from column metadata and rendered with
592
- * the appropriate field component (DateField, BooleanField, etc.). Fields can also be
593
- * specified manually as strings or full {@link ColumnDef} objects with custom renderers.
594
- *
595
- * If no `fields` are specified, they are inferred from the record's own keys
596
- * (minus any keys listed in `exclude`).
597
- *
598
- * @typeParam T - The record data type.
599
- * @param props - See {@link DetailViewProps}.
600
- *
601
- * @example
602
- * ```tsx
603
- * <DetailView
604
- * title={post.title}
605
- * table={posts}
606
- * record={post}
607
- * fields={["title", "content", "author", "published", "createdAt"]}
608
- * breadcrumb={[
609
- * { label: "Posts", to: "/posts" },
610
- * { label: post.title },
611
- * ]}
612
- * />
613
- * ```
614
- */
615
- declare function DetailView<T = unknown>({ title, table, record, fields: fieldsProp, exclude, breadcrumb, }: DetailViewProps<T>): react_jsx_runtime.JSX.Element;
616
-
617
- export { ActionButton, AvatarWithInitials, BulkActionBar, ConfirmProvider, DataTable, DetailView, DropZone, FileList, FilterBar, FormStatus, ImagePreview, ImpersonationBanner, ListView, RoleBadge, UIPluginProvider, createUIPlugin, getInitials, useActionToast, useColumnInference, useComponent, useConfirm, useToast, useUIPlugin };
1
+ export { h as ActionButton, l as AvatarWithInitials, q as BulkActionBar, w as ConfirmProvider, x as DataTable, z as DetailView, H as DropZone, M as FileList, Q as FilterBar, Y as FormStatus, $ as ImagePreview, a1 as ImpersonationBanner, a3 as ListView, a6 as PermissionGate, a8 as RoleBadge, an as UIPluginProvider, aq as createUIPlugin, ar as getInitials, as as useActionToast, at as useColumnInference, au as useComponent, av as useConfirm, aw as useToast, ax as useUIPlugin } from './client-CIx8_tmv.js';
2
+ import 'react/jsx-runtime';
3
+ import 'react';
4
+ import '@cfast/actions/client';
package/dist/client.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import {
2
2
  ActionButton,
3
+ AvatarWithInitials,
3
4
  BulkActionBar,
4
5
  ConfirmProvider,
5
6
  DataTable,
@@ -11,21 +12,18 @@ import {
11
12
  ImagePreview,
12
13
  ImpersonationBanner,
13
14
  ListView,
14
- RoleBadge,
15
- useActionToast,
16
- useColumnInference,
17
- useConfirm
18
- } from "./chunk-JEGEIQ3R.js";
19
- import {
20
- AvatarWithInitials,
21
15
  PermissionGate,
16
+ RoleBadge,
22
17
  UIPluginProvider,
23
18
  createUIPlugin,
24
19
  getInitials,
20
+ useActionToast,
21
+ useColumnInference,
25
22
  useComponent,
23
+ useConfirm,
26
24
  useToast,
27
25
  useUIPlugin
28
- } from "./chunk-RDTUEOLK.js";
26
+ } from "./chunk-PWBG6CGF.js";
29
27
  export {
30
28
  ActionButton,
31
29
  AvatarWithInitials,