@gentiq/admin 1.0.0-alpha.2 → 1.0.0-alpha.4

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
@@ -1,6 +1,13 @@
1
+ import { CalendarKind } from '@gentiq/core/internal';
1
2
  import { components } from '@gentiq/core/internal';
3
+ import { ForwardRefExoticComponent } from 'react';
4
+ import { HTMLAttributes } from 'react';
2
5
  import { JSX } from 'react/jsx-runtime';
6
+ import { LucideIcon } from 'lucide-react';
3
7
  import { ReactNode } from 'react';
8
+ import { RefAttributes } from 'react';
9
+ import { TdHTMLAttributes } from 'react';
10
+ import { ThHTMLAttributes } from 'react';
4
11
  import { UseMutationResult } from '@tanstack/react-query';
5
12
  import { UseQueryResult } from '@tanstack/react-query';
6
13
 
@@ -116,12 +123,80 @@ declare interface AdminUserQuery {
116
123
  created_to?: string;
117
124
  }
118
125
 
126
+ /** A daily bar chart: one thin bar per day, a three-step y-axis and a hover label per bar. */
127
+ export declare function BarChart({ data, days, format, tone, heightClass, axisWidth, }: BarChartProps): JSX.Element;
128
+
129
+ export declare interface BarChartProps {
130
+ data: BarPoint[];
131
+ /** How many days the chart spans; short ranges label every day. */
132
+ days: number;
133
+ /** Formats values on the y-axis and in the hover label. Defaults to a plain number. */
134
+ format?: (value: number) => string;
135
+ tone?: 'primary' | 'success';
136
+ /** Tailwind height class of the plot. */
137
+ heightClass?: string;
138
+ /** Room for the y-axis labels; money needs more than counts. */
139
+ axisWidth?: number;
140
+ }
141
+
142
+ export declare interface BarPoint {
143
+ /** `YYYY-MM-DD`. */
144
+ date: string;
145
+ value: number;
146
+ }
147
+
148
+ /** The card a chart sits in on the analytics views, with its small uppercase title. */
149
+ export declare function ChartCard({ title, className, children }: ChartCardProps): JSX.Element;
150
+
151
+ export declare interface ChartCardProps {
152
+ title: string;
153
+ className?: string;
154
+ children: ReactNode;
155
+ }
156
+
157
+ export declare function DateTimeField({ value, onChange, calendar: kind, onCalendarChange, open, onOpenChange, defaultTime, label, }: DateTimeFieldProps): JSX.Element;
158
+
159
+ /**
160
+ * A date-and-time field with its own month grid, in either the Gregorian or the Solar Hijri
161
+ * (Jalali) calendar. The browser's native picker only knows Gregorian.
162
+ *
163
+ * The value is a `datetime-local` string (`2026-10-18T14:05`, the admin's own clock), so it
164
+ * is interchangeable with a native input; only how it is picked and shown depends on the
165
+ * calendar. The grid opens in place, under the field, rather than in a popup.
166
+ */
167
+ export declare interface DateTimeFieldProps {
168
+ value: string;
169
+ onChange: (value: string) => void;
170
+ calendar: CalendarKind;
171
+ onCalendarChange: (kind: CalendarKind) => void;
172
+ open: boolean;
173
+ onOpenChange: (open: boolean) => void;
174
+ /** The time a day picked with no time set yet gets: the day's start, or its last minute. */
175
+ defaultTime: 'start' | 'end';
176
+ label: string;
177
+ }
178
+
119
179
  /**
120
180
  * The built-in pages, in tab order. Pass a list built from it as `AdminPanel`'s `pages` to add,
121
181
  * remove or replace a page.
122
182
  */
123
183
  export declare const defaultAdminPages: readonly AdminPage[];
124
184
 
185
+ /** Dismissible inline error banner shared across admin pages. */
186
+ export declare function ErrorBanner({ message, onDismiss }: ErrorBannerProps): JSX.Element;
187
+
188
+ export declare interface ErrorBannerProps {
189
+ message: string;
190
+ onDismiss: () => void;
191
+ }
192
+
193
+ /** Shows the resolved translation for a value that looks like an i18n key. */
194
+ export declare function I18nPreview({ value }: I18nPreviewProps): JSX.Element | null;
195
+
196
+ export declare interface I18nPreviewProps {
197
+ value: string;
198
+ }
199
+
125
200
  declare type Job = Schemas['BackgroundJob'];
126
201
 
127
202
  /** A maintenance job the backend has registered as runnable from the admin panel. */
@@ -136,6 +211,34 @@ declare type JobWarning = Override<Schemas['JobWarning'], {
136
211
  job_id?: string | null;
137
212
  }>;
138
213
 
214
+ /** A vertical list container, bordered and rounded by default to match admin panels. */
215
+ export declare const List: ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
216
+ variant?: "bordered" | "plain";
217
+ } & RefAttributes<HTMLDivElement>>;
218
+
219
+ /** One item in a list with optional interactive states. */
220
+ export declare const ListItem: ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
221
+ selected?: boolean;
222
+ interactive?: boolean;
223
+ } & RefAttributes<HTMLDivElement>>;
224
+
225
+ export declare type ListItemProps = HTMLAttributes<HTMLDivElement> & {
226
+ selected?: boolean;
227
+ interactive?: boolean;
228
+ };
229
+
230
+ /** Primary and secondary text labels for a list item. */
231
+ export declare function ListItemText({ primary, secondary, className, ...props }: ListItemTextProps): JSX.Element;
232
+
233
+ export declare type ListItemTextProps = HTMLAttributes<HTMLDivElement> & {
234
+ primary: ReactNode;
235
+ secondary?: ReactNode;
236
+ };
237
+
238
+ export declare type ListProps = HTMLAttributes<HTMLDivElement> & {
239
+ variant?: 'bordered' | 'plain';
240
+ };
241
+
139
242
  /**
140
243
  * `T` with the fields in `U` replaced. The backend types some fields loosely (open objects,
141
244
  * plain strings) where the panel knows their shape; the rest still follows the schema.
@@ -144,13 +247,95 @@ declare type Override<T, U> = {
144
247
  [K in keyof T as K extends keyof U ? never : K]: T[K];
145
248
  } & U;
146
249
 
250
+ /** The header of a page with sub-tabs: title, subtitle, actions, and the tab strip below. */
251
+ export declare function PageHeader({ title, subtitle, icon: Icon, badge, actions, children, }: PageHeaderProps): JSX.Element;
252
+
253
+ export declare interface PageHeaderProps {
254
+ title: ReactNode;
255
+ subtitle?: ReactNode;
256
+ icon?: LucideIcon;
257
+ /** Beside the title, e.g. the version number. */
258
+ badge?: ReactNode;
259
+ /** Buttons at the far end of the title row. */
260
+ actions?: ReactNode;
261
+ /** Usually `PageTabs`, which sit on the header's bottom border. */
262
+ children?: ReactNode;
263
+ }
264
+
265
+ export declare interface PageTab<T extends string> {
266
+ id: T;
267
+ label: string;
268
+ count?: number;
269
+ /** A tab where picking it wrongly has consequences keeps a destructive tint. */
270
+ tone?: 'danger';
271
+ }
272
+
273
+ /**
274
+ * A page's own sub-tabs, in the same underlined style as the panel's top-level nav, one
275
+ * level down. Meant to sit on the bottom border of a page header (hence `-mb-px`).
276
+ */
277
+ export declare function PageTabs<T extends string>({ items, value, onChange, className, }: PageTabsProps<T>): JSX.Element;
278
+
279
+ export declare interface PageTabsProps<T extends string> {
280
+ items: PageTab<T>[];
281
+ value: T;
282
+ onChange: (id: T) => void;
283
+ className?: string;
284
+ }
285
+
147
286
  declare type Schemas = components['schemas'];
148
287
 
288
+ /** One headline number with its label, as on the analytics views. */
289
+ export declare function StatTile({ label, value, detail }: StatTileProps): JSX.Element;
290
+
291
+ export declare interface StatTileProps {
292
+ label: string;
293
+ value: ReactNode;
294
+ /** A muted line under the value, e.g. a breakdown. */
295
+ detail?: ReactNode;
296
+ }
297
+
149
298
  declare type StatusIncident = Override<Schemas['Incident'], {
150
299
  action: 'notify' | 'maintenance';
151
300
  resolved_by?: string | null;
152
301
  }>;
153
302
 
303
+ export declare const Table: ForwardRefExoticComponent<HTMLAttributes<HTMLTableElement> & {
304
+ containerClassName?: string;
305
+ } & RefAttributes<HTMLTableElement>>;
306
+
307
+ export declare const TableBody: ForwardRefExoticComponent<TableBodyProps & RefAttributes<HTMLTableSectionElement>>;
308
+
309
+ export declare type TableBodyProps = HTMLAttributes<HTMLTableSectionElement>;
310
+
311
+ export declare const TableCaption: ForwardRefExoticComponent<TableCaptionProps & RefAttributes<HTMLTableCaptionElement>>;
312
+
313
+ export declare type TableCaptionProps = HTMLAttributes<HTMLTableCaptionElement>;
314
+
315
+ export declare const TableCell: ForwardRefExoticComponent<TableCellProps & RefAttributes<HTMLTableCellElement>>;
316
+
317
+ export declare type TableCellProps = TdHTMLAttributes<HTMLTableCellElement>;
318
+
319
+ export declare const TableFooter: ForwardRefExoticComponent<TableFooterProps & RefAttributes<HTMLTableSectionElement>>;
320
+
321
+ export declare type TableFooterProps = HTMLAttributes<HTMLTableSectionElement>;
322
+
323
+ export declare const TableHead: ForwardRefExoticComponent<TableHeadProps & RefAttributes<HTMLTableCellElement>>;
324
+
325
+ export declare const TableHeader: ForwardRefExoticComponent<TableHeaderProps & RefAttributes<HTMLTableSectionElement>>;
326
+
327
+ export declare type TableHeaderProps = HTMLAttributes<HTMLTableSectionElement>;
328
+
329
+ export declare type TableHeadProps = ThHTMLAttributes<HTMLTableCellElement>;
330
+
331
+ export declare type TableProps = HTMLAttributes<HTMLTableElement> & {
332
+ containerClassName?: string;
333
+ };
334
+
335
+ export declare const TableRow: ForwardRefExoticComponent<TableRowProps & RefAttributes<HTMLTableRowElement>>;
336
+
337
+ export declare type TableRowProps = HTMLAttributes<HTMLTableRowElement>;
338
+
154
339
  declare type Thread = Override<Schemas['AdminThread'], {
155
340
  metadata?: {
156
341
  /** Caller-supplied end-user reference for API traffic. */
@@ -456,11 +641,13 @@ updated_at: string;
456
641
 
457
642
  export declare function useJobRuns(filters?: {
458
643
  limit?: number;
644
+ skip?: number;
459
645
  kind?: string;
460
646
  status?: string;
461
647
  }, enabled?: boolean): UseQueryResult< {
462
648
  runs: JobRun[];
463
649
  count: number;
650
+ total?: number;
464
651
  }, Error>;
465
652
 
466
653
  export declare function useJobWarnings(enabled?: boolean): UseQueryResult< {