@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.
- package/README.md +23 -23
- package/dist/chunk-PWBG6CGF.js +1400 -0
- package/dist/{permission-gate-DVmY42oz.d.ts → client-CIx8_tmv.d.ts} +617 -2
- package/dist/client.d.ts +4 -617
- package/dist/client.js +6 -8
- package/dist/index.d.ts +52 -5
- package/dist/index.js +17 -13
- package/llms.txt +159 -0
- package/package.json +25 -41
- package/LICENSE +0 -21
- package/dist/chunk-755IRYDN.js +0 -941
- package/dist/chunk-7SNK37GF.js +0 -418
- package/dist/chunk-ASMYTWTR.js +0 -356
- package/dist/chunk-B2XXH5V4.js +0 -66
- package/dist/chunk-BQMXYYEV.js +0 -348
- package/dist/chunk-DTKBXCTU.js +0 -211
- package/dist/chunk-EYIBATYR.js +0 -33
- package/dist/chunk-FPZAQ2YQ.js +0 -474
- package/dist/chunk-G2OU4BYC.js +0 -205
- package/dist/chunk-JEGEIQ3R.js +0 -925
- package/dist/chunk-JUNLQJ6H.js +0 -1013
- package/dist/chunk-NRGMW3JA.js +0 -906
- package/dist/chunk-Q6FPL2OJ.js +0 -1086
- package/dist/chunk-QHWAGKNW.js +0 -456
- package/dist/chunk-QZT62CGJ.js +0 -924
- package/dist/chunk-RDTUEOLK.js +0 -486
- package/dist/chunk-RESL4IJJ.js +0 -112
- package/dist/chunk-UDCWQUTR.js +0 -221
- package/dist/chunk-UE7PZOIJ.js +0 -11
- package/dist/chunk-UTZTHGNE.js +0 -84
- package/dist/chunk-UVRXMOX5.js +0 -439
- package/dist/chunk-XFD3N2D4.js +0 -161
- package/dist/client-CXIHCQtA.d.ts +0 -274
- package/dist/joy.d.ts +0 -199
- package/dist/joy.js +0 -1150
- package/dist/permission-gate-apt9T9Mu.d.ts +0 -1256
- package/dist/types-1bAiH2uK.d.ts +0 -392
- package/dist/types-BX6u5sAd.d.ts +0 -403
- package/dist/types-BpdY7w5l.d.ts +0 -403
- package/dist/types-BrepeVp8.d.ts +0 -403
- package/dist/types-BvAqMZhn.d.ts +0 -403
- package/dist/types-C74nSscq.d.ts +0 -403
- package/dist/types-DD1Cpx8F.d.ts +0 -403
- package/dist/types-DHUhQwJn.d.ts +0 -403
- package/dist/types-DZSJNt_M.d.ts +0 -392
- package/dist/types-DaaJiIjW.d.ts +0 -391
- package/dist/types-LUpWJwps.d.ts +0 -403
- package/dist/types-a7zVU6WE.d.ts +0 -394
- package/dist/types-biJTHMcH.d.ts +0 -403
- package/dist/types-ow_qSEYJ.d.ts +0 -392
- package/dist/types-wnLasZaB.d.ts +0 -1234
|
@@ -1,274 +0,0 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
|
-
import { ReactNode, ComponentType } from 'react';
|
|
3
|
-
import { a5 as UIPlugin, a6 as UIPluginComponents, h as ActionStatusResult, r as ConfirmOptions, a0 as ToastApi, S as PermissionGateProps, g as ActionButtonProps, n as ButtonSlotProps, L as FormStatusProps, j as AvatarWithInitialsProps, V as RoleBadgeProps, C as ChipSlotProps, O as ImpersonationBannerProps, i as AlertSlotProps, s as DataTableProps, $ as TableSlotProps, y as FilterBarProps, m as BulkAction, o as ColumnDef, u as DropZoneProps, M as ImagePreviewProps, x as FileListProps, k as BreadcrumbItem, X as TabItem, P as ListViewProps, t as DetailViewProps } from './types-LUpWJwps.js';
|
|
4
|
-
import { ClientDescriptor, Serializable } from '@cfast/actions';
|
|
5
|
-
|
|
6
|
-
declare function createUIPlugin(config: {
|
|
7
|
-
components: Partial<UIPluginComponents>;
|
|
8
|
-
}): UIPlugin;
|
|
9
|
-
declare function UIPluginProvider({ plugin, children, }: {
|
|
10
|
-
plugin: UIPlugin;
|
|
11
|
-
children: React.ReactNode;
|
|
12
|
-
}): react.FunctionComponentElement<react.ProviderProps<UIPlugin | null>>;
|
|
13
|
-
declare function useUIPlugin(): UIPlugin | null;
|
|
14
|
-
declare function useComponent<K extends keyof UIPluginComponents>(slot: K): UIPluginComponents[K];
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Returns the permission status and submit function for a single action
|
|
18
|
-
* from a composed action descriptor.
|
|
19
|
-
*
|
|
20
|
-
* If `actionName` is omitted, uses the first (or only) action in the descriptor.
|
|
21
|
-
*/
|
|
22
|
-
declare function useActionStatus(descriptor: ClientDescriptor, actionName?: string, input?: Record<string, Serializable>): ActionStatusResult;
|
|
23
|
-
|
|
24
|
-
type ConfirmFn = (options: ConfirmOptions) => Promise<boolean>;
|
|
25
|
-
/**
|
|
26
|
-
* Returns an imperative `confirm(options)` function that resolves to
|
|
27
|
-
* `true` (confirmed) or `false` (cancelled).
|
|
28
|
-
*
|
|
29
|
-
* Must be used within a `ConfirmProvider`.
|
|
30
|
-
*/
|
|
31
|
-
declare function useConfirm(): ConfirmFn;
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Returns an imperative toast API.
|
|
35
|
-
*
|
|
36
|
-
* Must be used within a `ToastProvider`.
|
|
37
|
-
*/
|
|
38
|
-
declare function useToast(): ToastApi;
|
|
39
|
-
|
|
40
|
-
type ActionToastConfig = Record<string, {
|
|
41
|
-
success?: string;
|
|
42
|
-
error?: string;
|
|
43
|
-
}>;
|
|
44
|
-
/**
|
|
45
|
-
* Auto-shows toasts when action results come back.
|
|
46
|
-
*
|
|
47
|
-
* ```ts
|
|
48
|
-
* useActionToast(composed.client, {
|
|
49
|
-
* deletePost: { success: "Post deleted", error: "Failed to delete" },
|
|
50
|
-
* publishPost: { success: "Post published" },
|
|
51
|
-
* });
|
|
52
|
-
* ```
|
|
53
|
-
*/
|
|
54
|
-
declare function useActionToast(descriptor: ClientDescriptor, config: ActionToastConfig): void;
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Conditionally renders children based on action permission status.
|
|
58
|
-
*
|
|
59
|
-
* - When permitted: renders children
|
|
60
|
-
* - When forbidden (not permitted, not invisible): renders fallback
|
|
61
|
-
* - When invisible: renders nothing
|
|
62
|
-
*/
|
|
63
|
-
declare function PermissionGate({ action, actionName, input, children, fallback, }: PermissionGateProps): react.FunctionComponentElement<react.FragmentProps> | null;
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Permission-aware button that submits an action.
|
|
67
|
-
*
|
|
68
|
-
* - whenForbidden="hide": hidden when not permitted
|
|
69
|
-
* - whenForbidden="disable": shown but disabled when not permitted
|
|
70
|
-
* - whenForbidden="show": shown and clickable regardless of permission
|
|
71
|
-
*
|
|
72
|
-
* Supports a `confirmation` prop that, when set, will be used by
|
|
73
|
-
* the confirm system (wired in the Feedback PR).
|
|
74
|
-
*/
|
|
75
|
-
declare function ActionButton({ action, actionName, input, children, whenForbidden, confirmation: _confirmation, variant, color, size, startDecorator, }: ActionButtonProps): react.ReactElement<ButtonSlotProps, string | react.JSXElementConstructor<any>> | null;
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Provides the `useConfirm()` context and renders the confirm dialog.
|
|
79
|
-
* Uses the plugin's `confirmDialog` slot for rendering.
|
|
80
|
-
*/
|
|
81
|
-
declare function ConfirmProvider({ children }: {
|
|
82
|
-
children: ReactNode;
|
|
83
|
-
}): react.FunctionComponentElement<react.ProviderProps<{
|
|
84
|
-
confirm: ConfirmFn;
|
|
85
|
-
} | null>>;
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Displays action result feedback (success/error messages) using the
|
|
89
|
-
* plugin's `alert` slot.
|
|
90
|
-
*/
|
|
91
|
-
declare function FormStatus({ data }: FormStatusProps): react.DetailedReactHTMLElement<{
|
|
92
|
-
style: {
|
|
93
|
-
display: "flex";
|
|
94
|
-
flexDirection: "column";
|
|
95
|
-
gap: string;
|
|
96
|
-
};
|
|
97
|
-
}, HTMLElement> | null;
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Extracts up to 2 initials from a name.
|
|
101
|
-
*/
|
|
102
|
-
declare function getInitials(name: string): string;
|
|
103
|
-
/**
|
|
104
|
-
* Headless AvatarWithInitials — renders an img or initials span.
|
|
105
|
-
*/
|
|
106
|
-
declare function AvatarWithInitials({ src, name, size, }: AvatarWithInitialsProps): react.DetailedReactHTMLElement<{
|
|
107
|
-
src: string;
|
|
108
|
-
alt: string;
|
|
109
|
-
style: {
|
|
110
|
-
width: 32 | 40 | 56;
|
|
111
|
-
height: 32 | 40 | 56;
|
|
112
|
-
borderRadius: string;
|
|
113
|
-
objectFit: "cover";
|
|
114
|
-
};
|
|
115
|
-
}, HTMLElement> | react.DetailedReactHTMLElement<{
|
|
116
|
-
"aria-label": string;
|
|
117
|
-
style: {
|
|
118
|
-
display: "inline-flex";
|
|
119
|
-
alignItems: "center";
|
|
120
|
-
justifyContent: "center";
|
|
121
|
-
width: 32 | 40 | 56;
|
|
122
|
-
height: 32 | 40 | 56;
|
|
123
|
-
borderRadius: string;
|
|
124
|
-
backgroundColor: "#ddd";
|
|
125
|
-
fontSize: number;
|
|
126
|
-
fontWeight: "bold";
|
|
127
|
-
};
|
|
128
|
-
}, HTMLElement>;
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Colored badge displaying a user's role.
|
|
132
|
-
* Uses the plugin's `chip` slot for rendering.
|
|
133
|
-
*/
|
|
134
|
-
declare function RoleBadge({ role, colors }: RoleBadgeProps): react.ReactElement<ChipSlotProps, string | react.JSXElementConstructor<any>>;
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* Persistent banner shown when an admin is impersonating another user.
|
|
138
|
-
* Hidden when not impersonating.
|
|
139
|
-
*/
|
|
140
|
-
declare function ImpersonationBanner({ stopAction, }: ImpersonationBannerProps): react.ReactElement<AlertSlotProps, string | react.JSXElementConstructor<any>> | null;
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Headless DataTable — renders a table with sorting, selection, and row actions.
|
|
144
|
-
*/
|
|
145
|
-
declare function DataTable<T = unknown>({ data, columns: columnsProp, selectable, selectedRows: externalSelectedRows, onSelectionChange, onRowClick, getRowId, emptyMessage, }: DataTableProps<T>): react.DetailedReactHTMLElement<{
|
|
146
|
-
style: {
|
|
147
|
-
textAlign: "center";
|
|
148
|
-
padding: string;
|
|
149
|
-
color: "#666";
|
|
150
|
-
};
|
|
151
|
-
}, HTMLElement> | react.ReactElement<TableSlotProps, string | react.JSXElementConstructor<any>>;
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* Headless FilterBar — URL-synced filter controls.
|
|
155
|
-
* Each filter serializes to URL search params.
|
|
156
|
-
*/
|
|
157
|
-
declare function FilterBar({ filters, searchable, }: FilterBarProps): react.DetailedReactHTMLElement<{
|
|
158
|
-
style: {
|
|
159
|
-
display: "flex";
|
|
160
|
-
gap: string;
|
|
161
|
-
flexWrap: "wrap";
|
|
162
|
-
alignItems: "center";
|
|
163
|
-
marginBottom: string;
|
|
164
|
-
};
|
|
165
|
-
}, HTMLElement>;
|
|
166
|
-
|
|
167
|
-
type BulkActionBarProps = {
|
|
168
|
-
selectedCount: number;
|
|
169
|
-
actions: BulkAction[];
|
|
170
|
-
onAction: (action: BulkAction) => void;
|
|
171
|
-
onClearSelection: () => void;
|
|
172
|
-
};
|
|
173
|
-
/**
|
|
174
|
-
* Headless BulkActionBar — shown when rows are selected.
|
|
175
|
-
* Displays count + action buttons + clear selection.
|
|
176
|
-
*/
|
|
177
|
-
declare function BulkActionBar({ selectedCount, actions, onAction, onClearSelection, }: BulkActionBarProps): react.DetailedReactHTMLElement<{
|
|
178
|
-
style: {
|
|
179
|
-
display: "flex";
|
|
180
|
-
alignItems: "center";
|
|
181
|
-
gap: string;
|
|
182
|
-
padding: string;
|
|
183
|
-
backgroundColor: "#f0f4ff";
|
|
184
|
-
borderRadius: string;
|
|
185
|
-
marginBottom: string;
|
|
186
|
-
};
|
|
187
|
-
}, HTMLElement> | null;
|
|
188
|
-
|
|
189
|
-
type InferredColumn = ColumnDef & {
|
|
190
|
-
field: ComponentType<{
|
|
191
|
-
value: unknown;
|
|
192
|
-
}>;
|
|
193
|
-
};
|
|
194
|
-
/**
|
|
195
|
-
* Inspects a Drizzle table's columns and returns inferred column definitions
|
|
196
|
-
* with appropriate TypedField components.
|
|
197
|
-
*
|
|
198
|
-
* @param table - A Drizzle table object (columns accessible via iteration)
|
|
199
|
-
* @param columns - Optional subset of column names to include
|
|
200
|
-
*/
|
|
201
|
-
declare function useColumnInference(table: Record<string, unknown> | undefined, columns?: string[]): InferredColumn[];
|
|
202
|
-
|
|
203
|
-
/**
|
|
204
|
-
* Headless DropZone — drag-and-drop file upload area.
|
|
205
|
-
* Integrates with `useUpload()` from `@cfast/storage/client`.
|
|
206
|
-
*/
|
|
207
|
-
declare function DropZone({ upload, multiple, children, }: DropZoneProps): react.DetailedReactHTMLElement<react.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* Headless ImagePreview — displays an image from storage or direct src.
|
|
211
|
-
*/
|
|
212
|
-
declare function ImagePreview({ fileKey, src, getUrl, width, height, fallback, alt, }: ImagePreviewProps): react.DetailedReactHTMLElement<react.HTMLAttributes<HTMLElement>, HTMLElement> | react.DetailedReactHTMLElement<{
|
|
213
|
-
style: {
|
|
214
|
-
width: number;
|
|
215
|
-
height: number;
|
|
216
|
-
backgroundColor: "#f5f5f5";
|
|
217
|
-
display: "flex";
|
|
218
|
-
alignItems: "center";
|
|
219
|
-
justifyContent: "center";
|
|
220
|
-
borderRadius: string;
|
|
221
|
-
color: "#999";
|
|
222
|
-
};
|
|
223
|
-
}, HTMLElement> | react.DetailedReactHTMLElement<{
|
|
224
|
-
src: string;
|
|
225
|
-
alt: string;
|
|
226
|
-
style: {
|
|
227
|
-
width: number;
|
|
228
|
-
height: number;
|
|
229
|
-
objectFit: "cover";
|
|
230
|
-
borderRadius: string;
|
|
231
|
-
};
|
|
232
|
-
}, HTMLElement>;
|
|
233
|
-
|
|
234
|
-
/**
|
|
235
|
-
* Headless FileList — displays a list of files with download links.
|
|
236
|
-
*/
|
|
237
|
-
declare function FileList({ files, onDownload, }: FileListProps): react.DetailedReactHTMLElement<{
|
|
238
|
-
style: {
|
|
239
|
-
color: "#999";
|
|
240
|
-
};
|
|
241
|
-
}, HTMLElement> | react.DetailedReactHTMLElement<{
|
|
242
|
-
style: {
|
|
243
|
-
listStyle: "none";
|
|
244
|
-
padding: number;
|
|
245
|
-
margin: number;
|
|
246
|
-
};
|
|
247
|
-
"data-testid": string;
|
|
248
|
-
}, HTMLElement>;
|
|
249
|
-
|
|
250
|
-
type PageContainerProps = {
|
|
251
|
-
title?: string;
|
|
252
|
-
breadcrumb?: BreadcrumbItem[];
|
|
253
|
-
actions?: ReactNode;
|
|
254
|
-
tabs?: TabItem[];
|
|
255
|
-
children: ReactNode;
|
|
256
|
-
};
|
|
257
|
-
/**
|
|
258
|
-
* Page wrapper with title, breadcrumb, tabs, and action toolbar.
|
|
259
|
-
*/
|
|
260
|
-
declare function PageContainer({ title, breadcrumb, actions, tabs: _tabs, children, }: PageContainerProps): react.FunctionComponentElement<react.FragmentProps>;
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
* Composite ListView — composes PageContainer, FilterBar, DataTable,
|
|
264
|
-
* EmptyState, BulkActionBar, and pagination controls.
|
|
265
|
-
*/
|
|
266
|
-
declare function ListView<T = unknown>({ title, data, table: _table, columns, actions: _actions, filters, searchable, createAction, createLabel, selectable, bulkActions, breadcrumb, }: ListViewProps<T>): react.FunctionComponentElement<PageContainerProps>;
|
|
267
|
-
|
|
268
|
-
/**
|
|
269
|
-
* Composite DetailView — displays a single record's fields in a two-column grid.
|
|
270
|
-
* Composes PageContainer + TypedField rendering.
|
|
271
|
-
*/
|
|
272
|
-
declare function DetailView<T = unknown>({ title, table, record, fields: fieldsProp, exclude, breadcrumb, }: DetailViewProps<T>): react.FunctionComponentElement<PageContainerProps>;
|
|
273
|
-
|
|
274
|
-
export { ActionButton as A, BulkActionBar as B, ConfirmProvider as C, DataTable as D, FileList as F, ImagePreview as I, ListView as L, PageContainer as P, RoleBadge as R, UIPluginProvider as U, AvatarWithInitials as a, DetailView as b, DropZone as c, FilterBar as d, FormStatus as e, ImpersonationBanner as f, PermissionGate as g, createUIPlugin as h, getInitials as i, useActionStatus as j, useActionToast as k, useColumnInference as l, useConfirm as m, useToast as n, useUIPlugin as o, useComponent as u };
|
package/dist/joy.d.ts
DELETED
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
import { ReactNode, ReactElement } from 'react';
|
|
2
|
-
import { ButtonProps } from '@mui/joy/Button';
|
|
3
|
-
import { ActionHookResult } from '@cfast/actions/client';
|
|
4
|
-
import { a9 as WhenForbidden, s as ConfirmOptions, r as ConfirmDialogSlotProps, M as FormStatusProps, b as EmptyStateProps, d as BreadcrumbItem, e as TabItem, A as AppShellProps, f as NavigationItem, g as UserMenuProps, t as DataTableProps, z as FilterBarProps, n as BulkAction, v as DropZoneProps, O as ImagePreviewProps, y as FileListProps, Q as ListViewProps, u as DetailViewProps, k as AvatarWithInitialsProps, X as RoleBadgeProps, P as ImpersonationBannerProps } from './permission-gate-DVmY42oz.js';
|
|
5
|
-
export { V as PermissionGate } from './permission-gate-DVmY42oz.js';
|
|
6
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
|
-
|
|
8
|
-
type JoyActionButtonProps = {
|
|
9
|
-
action: ActionHookResult;
|
|
10
|
-
children: ReactNode;
|
|
11
|
-
whenForbidden?: WhenForbidden;
|
|
12
|
-
confirmation?: string | ConfirmOptions;
|
|
13
|
-
} & Omit<ButtonProps, "children" | "onClick" | "disabled" | "loading" | "action">;
|
|
14
|
-
/**
|
|
15
|
-
* Joy UI styled ActionButton.
|
|
16
|
-
*
|
|
17
|
-
* Takes an `ActionHookResult` from `useActions()` — no hooks inside,
|
|
18
|
-
* pure presentation component. All Joy Button props (sx, fullWidth, etc.)
|
|
19
|
-
* are forwarded to the underlying Button.
|
|
20
|
-
*/
|
|
21
|
-
declare function ActionButton({ action, children, whenForbidden, confirmation: _confirmation, variant, color, size, ...buttonProps }: JoyActionButtonProps): ReactElement | null;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Joy UI ConfirmDialog — Modal + ModalDialog based on the example app pattern.
|
|
25
|
-
*/
|
|
26
|
-
declare function ConfirmDialog({ open, onClose, onConfirm, title, description, confirmLabel, cancelLabel, variant, }: ConfirmDialogSlotProps): ReactElement;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Joy UI ToastProvider backed by Sonner.
|
|
30
|
-
*/
|
|
31
|
-
declare function ToastProvider({ children }: {
|
|
32
|
-
children: ReactNode;
|
|
33
|
-
}): ReactElement;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Joy UI FormStatus — displays action result feedback as Joy Alerts.
|
|
37
|
-
*/
|
|
38
|
-
declare function FormStatus({ data }: FormStatusProps): ReactElement | null;
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Joy UI EmptyState — centered layout with optional CTA.
|
|
42
|
-
*/
|
|
43
|
-
declare function EmptyState({ title, description, createAction, createLabel, icon: Icon, }: EmptyStateProps): ReactElement;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Joy UI NavigationProgress — LinearProgress with absolute positioning.
|
|
47
|
-
*/
|
|
48
|
-
declare function NavigationProgress(): ReactElement | null;
|
|
49
|
-
|
|
50
|
-
type PageContainerProps = {
|
|
51
|
-
title?: string;
|
|
52
|
-
breadcrumb?: BreadcrumbItem[];
|
|
53
|
-
actions?: ReactNode;
|
|
54
|
-
tabs?: TabItem[];
|
|
55
|
-
children: ReactNode;
|
|
56
|
-
};
|
|
57
|
-
/**
|
|
58
|
-
* Joy UI PageContainer — title + breadcrumb + action toolbar.
|
|
59
|
-
*/
|
|
60
|
-
declare function PageContainer({ title, breadcrumb, actions, tabs: _tabs, children, }: PageContainerProps): ReactElement;
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Joy UI AppShell — sidebar + header + content layout.
|
|
64
|
-
*/
|
|
65
|
-
declare function AppShell({ children, sidebar, header, }: AppShellProps): ReactElement;
|
|
66
|
-
declare namespace AppShell {
|
|
67
|
-
var Sidebar: typeof AppShellSidebar;
|
|
68
|
-
var Header: typeof AppShellHeader;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Joy UI Sidebar — Sheet with List navigation items.
|
|
72
|
-
*/
|
|
73
|
-
declare function AppShellSidebar({ items }: {
|
|
74
|
-
items: NavigationItem[];
|
|
75
|
-
}): ReactElement;
|
|
76
|
-
/**
|
|
77
|
-
* Joy UI AppShell Header — Sheet with flex layout.
|
|
78
|
-
*/
|
|
79
|
-
declare function AppShellHeader({ children, userMenu, }: {
|
|
80
|
-
children?: ReactNode;
|
|
81
|
-
userMenu?: ReactNode;
|
|
82
|
-
}): ReactElement;
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Joy UI UserMenu — Dropdown with Avatar trigger, user info, and links.
|
|
86
|
-
*/
|
|
87
|
-
declare function UserMenu({ links, onSignOut, }: UserMenuProps): ReactElement | null;
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Joy UI styled DataTable.
|
|
91
|
-
* Renders a MUI Joy Table with sorting, selection, and row actions.
|
|
92
|
-
*/
|
|
93
|
-
declare function DataTable<T = unknown>({ data, columns: columnsProp, selectable, selectedRows: externalSelectedRows, onSelectionChange, onRowClick, getRowId, emptyMessage, }: DataTableProps<T>): ReactElement;
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Joy UI styled FilterBar — URL-synced filter controls.
|
|
97
|
-
*/
|
|
98
|
-
declare function FilterBar({ filters, searchable, }: FilterBarProps): ReactElement;
|
|
99
|
-
|
|
100
|
-
type BulkActionBarProps = {
|
|
101
|
-
selectedCount: number;
|
|
102
|
-
actions: BulkAction[];
|
|
103
|
-
onAction: (action: BulkAction) => void;
|
|
104
|
-
onClearSelection: () => void;
|
|
105
|
-
};
|
|
106
|
-
/**
|
|
107
|
-
* Joy UI styled BulkActionBar.
|
|
108
|
-
* Shown when rows are selected in a DataTable.
|
|
109
|
-
*/
|
|
110
|
-
declare function BulkActionBar({ selectedCount, actions, onAction, onClearSelection, }: BulkActionBarProps): ReactElement | null;
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Joy UI styled DropZone — drag-and-drop file upload area.
|
|
114
|
-
*/
|
|
115
|
-
declare function DropZone({ upload, multiple, children, }: DropZoneProps): ReactElement;
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Joy UI styled ImagePreview.
|
|
119
|
-
*/
|
|
120
|
-
declare function ImagePreview({ fileKey, src, getUrl, width, height, fallback, alt, }: ImagePreviewProps): ReactElement;
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Joy UI styled FileList.
|
|
124
|
-
*/
|
|
125
|
-
declare function FileList({ files, onDownload, }: FileListProps): ReactElement;
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Joy UI styled ListView — full page list with filters, table, and pagination.
|
|
129
|
-
*/
|
|
130
|
-
declare function ListView<T = unknown>({ title, data, table: _table, columns, actions: _actions, filters, searchable, createAction, createLabel, selectable, bulkActions, breadcrumb, }: ListViewProps<T>): ReactElement;
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Joy UI styled DetailView — two-column grid of record fields.
|
|
134
|
-
*/
|
|
135
|
-
declare function DetailView<T = unknown>({ title, table, record, fields: fieldsProp, exclude, breadcrumb, }: DetailViewProps<T>): ReactElement;
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Joy UI AvatarWithInitials — MUI Joy Avatar with initials fallback.
|
|
139
|
-
*/
|
|
140
|
-
declare function AvatarWithInitials({ src, name, size, }: AvatarWithInitialsProps): ReactElement;
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Joy UI RoleBadge — MUI Joy Chip with configurable color per role.
|
|
144
|
-
*/
|
|
145
|
-
declare function RoleBadge({ role, colors }: RoleBadgeProps): ReactElement;
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Joy UI ImpersonationBanner — sticky warning sheet when impersonating.
|
|
149
|
-
*/
|
|
150
|
-
declare function ImpersonationBanner({ stopAction, }: ImpersonationBannerProps): ReactElement | null;
|
|
151
|
-
|
|
152
|
-
declare function Layout({ children }: {
|
|
153
|
-
children: ReactNode;
|
|
154
|
-
}): react_jsx_runtime.JSX.Element;
|
|
155
|
-
declare function EmailInput({ value, onChange, }: {
|
|
156
|
-
value: string;
|
|
157
|
-
onChange: (value: string) => void;
|
|
158
|
-
error?: string;
|
|
159
|
-
}): react_jsx_runtime.JSX.Element;
|
|
160
|
-
declare function MagicLinkButton({ onClick, loading, }: {
|
|
161
|
-
onClick: () => void;
|
|
162
|
-
loading: boolean;
|
|
163
|
-
}): react_jsx_runtime.JSX.Element;
|
|
164
|
-
declare function PasskeyButton({ onClick, loading, }: {
|
|
165
|
-
onClick: () => void;
|
|
166
|
-
loading: boolean;
|
|
167
|
-
}): react_jsx_runtime.JSX.Element;
|
|
168
|
-
declare function SuccessMessage({ email }: {
|
|
169
|
-
email: string;
|
|
170
|
-
}): react_jsx_runtime.JSX.Element;
|
|
171
|
-
declare function ErrorMessage({ error }: {
|
|
172
|
-
error: string;
|
|
173
|
-
}): react_jsx_runtime.JSX.Element;
|
|
174
|
-
/**
|
|
175
|
-
* Joy UI slot components for `<LoginPage>` from `@cfast/auth/client`.
|
|
176
|
-
*
|
|
177
|
-
* Usage:
|
|
178
|
-
* ```tsx
|
|
179
|
-
* import { LoginPage } from "@cfast/auth/client";
|
|
180
|
-
* import { joyLoginComponents } from "@cfast/ui/joy";
|
|
181
|
-
*
|
|
182
|
-
* <LoginPage authClient={authClient} components={joyLoginComponents} />
|
|
183
|
-
* ```
|
|
184
|
-
*
|
|
185
|
-
* Override individual slots while keeping the rest:
|
|
186
|
-
* ```tsx
|
|
187
|
-
* <LoginPage components={{ ...joyLoginComponents, Layout: MyLayout }} />
|
|
188
|
-
* ```
|
|
189
|
-
*/
|
|
190
|
-
declare const joyLoginComponents: {
|
|
191
|
-
Layout: typeof Layout;
|
|
192
|
-
EmailInput: typeof EmailInput;
|
|
193
|
-
MagicLinkButton: typeof MagicLinkButton;
|
|
194
|
-
PasskeyButton: typeof PasskeyButton;
|
|
195
|
-
SuccessMessage: typeof SuccessMessage;
|
|
196
|
-
ErrorMessage: typeof ErrorMessage;
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
export { ActionButton, AppShell, AppShellHeader, AppShellSidebar, AvatarWithInitials, BulkActionBar, ConfirmDialog, DataTable, DetailView, DropZone, EmptyState, FileList, FilterBar, FormStatus, ImagePreview, ImpersonationBanner, ListView, NavigationProgress, PageContainer, RoleBadge, ToastProvider, UserMenu, joyLoginComponents };
|