reifyui 0.1.0 → 0.3.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.d.ts CHANGED
@@ -81,6 +81,59 @@ export function useResizablePane(options?: Record<string, unknown>): {
81
81
  };
82
82
  export const PaneResizer: ComponentType<Record<string, unknown>>;
83
83
 
84
+ // ── task list ───────────────────────────────────────────────────────────────
85
+ export interface TaskListPage { items: unknown[]; cursor?: string; }
86
+ export interface TaskListProps {
87
+ fetchPage: (cursor: string) => Promise<TaskListPage> | TaskListPage;
88
+ selected?: string | null;
89
+ onSelect?: (id: string) => void;
90
+ onNew?: () => void;
91
+ onDelete?: (item: any) => void;
92
+ header?: ReactNode;
93
+ renderMeta?: (item: any) => ReactNode;
94
+ refreshNonce?: number;
95
+ emptyLabel?: string;
96
+ newLabel?: string;
97
+ idKey?: string; titleKey?: string; statusKey?: string; timeKey?: string;
98
+ }
99
+ export const TaskList: ComponentType<TaskListProps>;
100
+ export function taskStatusGroup(status: string): 'working' | 'done' | 'failed' | 'idle';
101
+
102
+ // ── dialogs (alert / confirm / prompt, in-app) ───────────────────────────────
103
+ export type DialogVariant = 'destructive' | 'error' | 'warning' | 'success';
104
+ export interface DialogLabels {
105
+ confirm?: string; cancel?: string; ok?: string; create?: string; required?: string;
106
+ }
107
+ export interface AlertOptions {
108
+ title?: string; message?: ReactNode; variant?: DialogVariant; confirmLabel?: string;
109
+ }
110
+ export interface ConfirmOptions extends AlertOptions {
111
+ destructive?: boolean; cancelLabel?: string;
112
+ }
113
+ export interface PromptOptions extends ConfirmOptions {
114
+ label?: string; placeholder?: string; help?: ReactNode;
115
+ defaultValue?: string; inputType?: string;
116
+ multiline?: boolean; rows?: number; required?: boolean;
117
+ /** Return an error message to reject, or null/undefined to accept. */
118
+ validate?: (value: string) => string | null | undefined;
119
+ }
120
+ export interface CreateType { kind: string; label: string; color?: string; icon?: ReactNode; }
121
+ export interface CreateOptions extends PromptOptions {
122
+ types?: CreateType[]; defaultKind?: string;
123
+ }
124
+ export interface DialogApi {
125
+ alert(opts: AlertOptions): Promise<boolean>;
126
+ confirm(opts: ConfirmOptions): Promise<boolean>;
127
+ /** Resolves to the entered string, or null when cancelled. */
128
+ prompt(opts: PromptOptions): Promise<string | null>;
129
+ create(opts: CreateOptions): Promise<{ kind: string; name: string } | null>;
130
+ labels: Required<DialogLabels>;
131
+ }
132
+ export const DialogHost: ComponentType<{
133
+ children?: ReactNode; locale?: 'en' | 'zh'; labels?: DialogLabels;
134
+ }>;
135
+ export function useDialog(): DialogApi;
136
+
84
137
  // ── auth client (optional; couples to a /v1/auth-style backend) ──────────────
85
138
  export interface AuthConfig { engine: string; product: string; loginHash?: string; }
86
139
  export function configureAuth(cfg: Partial<AuthConfig> & { product: string; engine: string }): void;