@gentiq/ui 1.0.0-alpha.3 → 1.0.0-alpha.5

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.
@@ -12,7 +12,6 @@ import { FC } from 'react';
12
12
  import { GentiqUIMessage } from '@gentiq/core';
13
13
  import { HTMLAttributes } from 'react';
14
14
  import { JSX } from 'react/jsx-runtime';
15
- import { LoaderVariant } from '@gentiq/react';
16
15
  import { MaintenanceStatus } from '@gentiq/core';
17
16
  import { MessagePartComponents } from '@gentiq/react';
18
17
  import { PlanDuration } from '@gentiq/core';
@@ -32,7 +31,7 @@ export declare function Badge({ className, variant, asChild, ...props }: React_2
32
31
  }): JSX.Element;
33
32
 
34
33
  declare const badgeVariants: (props?: ({
35
- variant?: "default" | "destructive" | "secondary" | "outline" | null | undefined;
34
+ variant?: "default" | "destructive" | "outline" | "secondary" | null | undefined;
36
35
  } & ClassProp) | undefined) => string;
37
36
 
38
37
  /** Meters gentiq counts itself. Anything else is app-defined and shown by its key. */
@@ -43,7 +42,7 @@ export declare function Button({ className, variant, size, asChild, ...props }:
43
42
  }): JSX.Element;
44
43
 
45
44
  declare const buttonVariants: (props?: ({
46
- variant?: "default" | "destructive" | "link" | "secondary" | "outline" | "ghost" | null | undefined;
45
+ variant?: "default" | "destructive" | "link" | "outline" | "secondary" | "ghost" | null | undefined;
47
46
  size?: "default" | "icon" | "sm" | "lg" | null | undefined;
48
47
  } & ClassProp) | undefined) => string;
49
48
 
@@ -196,9 +195,9 @@ export declare function describeWindow(t: TFunction, window: {
196
195
  anchor?: QuotaAnchor;
197
196
  }): string;
198
197
 
199
- export declare function Dialog({ ...props }: React_2.ComponentProps<typeof DialogPrimitive.Root>): JSX.Element;
198
+ export declare function Dialog(props: React_2.ComponentProps<typeof DialogPrimitive.Root>): JSX.Element;
200
199
 
201
- export declare function DialogClose({ ...props }: React_2.ComponentProps<typeof DialogPrimitive.Close>): JSX.Element;
200
+ export declare function DialogClose(props: React_2.ComponentProps<typeof DialogPrimitive.Close>): JSX.Element;
202
201
 
203
202
  export declare function DialogContent({ className, children, showCloseButton, ...props }: React_2.ComponentProps<typeof DialogPrimitive.Content> & {
204
203
  showCloseButton?: boolean;
@@ -212,9 +211,9 @@ export declare function DialogHeader({ className, ...props }: React_2.ComponentP
212
211
 
213
212
  export declare function DialogTitle({ className, ...props }: React_2.ComponentProps<typeof DialogPrimitive.Title>): JSX.Element;
214
213
 
215
- export declare function DialogTrigger({ ...props }: React_2.ComponentProps<typeof DialogPrimitive.Trigger>): JSX.Element;
214
+ export declare function DialogTrigger(props: React_2.ComponentProps<typeof DialogPrimitive.Trigger>): JSX.Element;
216
215
 
217
- export declare function DropdownMenu({ ...props }: React_2.ComponentProps<typeof DropdownMenuPrimitive.Root>): JSX.Element;
216
+ export declare function DropdownMenu(props: React_2.ComponentProps<typeof DropdownMenuPrimitive.Root>): JSX.Element;
218
217
 
219
218
  export declare function DropdownMenuContent({ className, sideOffset, ...props }: React_2.ComponentProps<typeof DropdownMenuPrimitive.Content>): JSX.Element;
220
219
 
@@ -223,7 +222,7 @@ export declare function DropdownMenuItem({ className, inset, variant, ...props }
223
222
  variant?: 'default' | 'destructive';
224
223
  }): JSX.Element;
225
224
 
226
- export declare function DropdownMenuTrigger({ ...props }: React_2.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): JSX.Element;
225
+ export declare function DropdownMenuTrigger(props: React_2.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): JSX.Element;
227
226
 
228
227
  /** The slots that always have a component: Gentiq's own unless the host replaced it. */
229
228
  declare type FilledSlots = 'MessageList' | 'MessageActions' | 'PromptInput' | 'WelcomeScreen' | 'parts' | 'ChoiceQuestionPart' | 'ChoiceQuestionDock' | 'FollowUpSuggestions' | 'ChatError' | 'UsageMeter' | 'MaintenanceBanner' | 'MaintenanceScreen';
@@ -277,6 +276,10 @@ declare interface GentiqComponents {
277
276
  PromptInput?: ComponentType<PromptInputProps>;
278
277
  /** Replaces the welcome / empty-state screen */
279
278
  WelcomeScreen?: ComponentType<WelcomeScreenProps>;
279
+ /**
280
+ * Replaces the pending-reply and thread-loading indicator with a custom loader component.
281
+ */
282
+ Loader?: ComponentType<LoaderProps>;
280
283
  /**
281
284
  * The component for each part type, over Gentiq's: `text`, `reasoning`, `file`, `tool` (any tool
282
285
  * call without its own), `tool-<name>` (one tool's calls), `data-<name>` (a part the backend
@@ -452,8 +455,7 @@ declare interface HeaderActionConfig {
452
455
  */
453
456
  declare interface HeaderActionsProps {
454
457
  /**
455
- * Whether the viewport is phone-sized. The logo sits in the middle of the bar, so on a
456
- * phone there is room for about one icon-sized button before it is covered.
458
+ * Whether the viewport is phone-sized.
457
459
  */
458
460
  isMobile: boolean;
459
461
  }
@@ -467,12 +469,10 @@ export declare const Loader: ({ className, variant, ...props }: LoaderProps) =>
467
469
  declare type LoaderProps = HTMLAttributes<HTMLDivElement> & {
468
470
  size?: number;
469
471
  /**
470
- * Which indicator to draw. Defaults to the deployment's `theme.loader`
471
- * (admin settings, then `GentiqProvider`), and to `dots` when neither is set.
472
- * Every variant but `dots` draws only when the app loads `gentiq/loaders.css`;
473
- * without it, the dots show.
472
+ * Indicator variant. Retained for compatibility with custom renderers;
473
+ * Gentiq's built-in loader renders the clean 3-dot pulse.
474
474
  */
475
- variant?: LoaderVariant;
475
+ variant?: string;
476
476
  };
477
477
 
478
478
  /**
@@ -542,7 +542,7 @@ export declare const QUOTA_PERIODS: QuotaPeriod[];
542
542
  /** The slot map in force: every filled slot has a component (or `null` for a notice). */
543
543
  declare type ResolvedSlots = Required<Pick<GentiqComponents, FilledSlots>> & Omit<GentiqComponents, FilledSlots>;
544
544
 
545
- export declare function Select({ ...props }: React_2.ComponentProps<typeof SelectPrimitive.Root>): JSX.Element;
545
+ export declare function Select(props: React_2.ComponentProps<typeof SelectPrimitive.Root>): JSX.Element;
546
546
 
547
547
  export declare function SelectContent({ className, children, position, ...props }: React_2.ComponentProps<typeof SelectPrimitive.Content>): JSX.Element;
548
548
 
@@ -552,9 +552,9 @@ export declare function SelectTrigger({ className, size, children, ...props }: R
552
552
  size?: 'sm' | 'default';
553
553
  }): JSX.Element;
554
554
 
555
- export declare function SelectValue({ ...props }: React_2.ComponentProps<typeof SelectPrimitive.Value>): JSX.Element;
555
+ export declare function SelectValue(props: React_2.ComponentProps<typeof SelectPrimitive.Value>): JSX.Element;
556
556
 
557
- export declare function Sheet({ ...props }: React_2.ComponentProps<typeof DialogPrimitive.Root>): JSX.Element;
557
+ export declare function Sheet(props: React_2.ComponentProps<typeof DialogPrimitive.Root>): JSX.Element;
558
558
 
559
559
  export declare function SheetContent({ className, children, side, ...props }: React_2.ComponentProps<typeof DialogPrimitive.Content> & {
560
560
  side?: 'top' | 'end' | 'bottom' | 'start';
@@ -1,61 +1,68 @@
1
1
  "use client";
2
- import { t as g, v as m, B as h, w as p, c as o } from "./shared-BNCHeyvj.js";
3
- import { ak as L, al as q, k as B, am as Q, an as j, ao as z, G as A, ap as E, J as H, Q as O, V as R, N as _, O as G, H as P, W as U, Y as V, Z as W, X as F, I as J, L as K, M as X, aq as Y, f as Z, i as $, j as ee, g as ae, h as te, n as re, o as se, s as oe, p as ie, q as ne, ar as le, D as de, y as ce, A as ue, K as ge, x as me, u as he } from "./shared-BNCHeyvj.js";
4
- import { jsxs as i, jsx as e } from "react/jsx-runtime";
5
- import { Monitor as n, Moon as b, Sun as f } from "lucide-react";
6
- import { useGentiqTranslation as k, useTheme as w } from "@gentiq/react";
2
+ import { T as g, i as b, B as h, j as m, c as r } from "./shared-BPpDLW8N.js";
3
+ import { a1 as H, h as B, C as R, b as j, a as O, D as P, a2 as Q, e as q, _ as A, $ as F, f as G, g as U, d as V, l as W, n as X, o as J, m as K, N as Y, G as Z, L as $, a3 as ee, H as ae, K as te, M as re, I as ie, J as oe, V as se, W as ne, Z as de, X as le, Y as ce, a4 as ue, x as ge, F as be, w as he, a0 as me, y as pe, u as fe } from "./shared-BPpDLW8N.js";
4
+ import { jsxs as s, jsx as e } from "react/jsx-runtime";
5
+ import { Monitor as l, Moon as p, Sun as f, CheckIcon as k } from "lucide-react";
6
+ import { useGentiqTranslation as x, useTheme as v } from "@gentiq/react";
7
7
  import "react";
8
- import * as l from "@radix-ui/react-switch";
9
- const C = ({ className: t }) => {
10
- const { t: a } = k(["theme"]), { theme: r, setTheme: s } = w(), d = () => {
11
- s(r === "system" ? "light" : r === "light" ? "dark" : "system");
12
- }, c = () => {
13
- switch (r) {
14
- case "light":
15
- return /* @__PURE__ */ e(f, { className: "h-[1.2rem] w-[1.2rem]" });
16
- case "dark":
17
- return /* @__PURE__ */ e(b, { className: "h-[1.2rem] w-[1.2rem]" });
18
- case "system":
19
- return /* @__PURE__ */ e(n, { className: "h-[1.2rem] w-[1.2rem]" });
20
- default:
21
- return /* @__PURE__ */ e(n, { className: "h-[1.2rem] w-[1.2rem]" });
22
- }
23
- }, u = () => {
24
- switch (r) {
25
- case "light":
26
- return a("dark");
27
- case "dark":
28
- return a("system");
29
- case "system":
30
- return a("light");
31
- default:
32
- return a("toggle");
33
- }
34
- };
35
- return /* @__PURE__ */ i(g, { children: [
36
- /* @__PURE__ */ e(m, { asChild: !0, children: /* @__PURE__ */ i(h, { variant: "ghost", size: "icon", onClick: d, className: t, children: [
37
- c(),
38
- /* @__PURE__ */ e("span", { className: "sr-only", children: a("toggle") })
39
- ] }) }),
40
- /* @__PURE__ */ e(p, { children: u() })
8
+ import * as n from "@radix-ui/react-checkbox";
9
+ import * as d from "@radix-ui/react-switch";
10
+ const T = { system: "light", light: "dark", dark: "system" }, w = { light: f, dark: p, system: l }, I = ({ className: t }) => {
11
+ const { t: a } = x(["theme"]), { theme: i, setTheme: c } = v(), u = w[i] ?? l, o = T[i];
12
+ return /* @__PURE__ */ s(g, { children: [
13
+ /* @__PURE__ */ e(b, { asChild: !0, children: /* @__PURE__ */ s(
14
+ h,
15
+ {
16
+ variant: "ghost",
17
+ size: "icon",
18
+ onClick: () => c(o ?? "system"),
19
+ className: t,
20
+ children: [
21
+ /* @__PURE__ */ e(u, { className: "h-[1.2rem] w-[1.2rem]" }),
22
+ /* @__PURE__ */ e("span", { className: "sr-only", children: a("toggle") })
23
+ ]
24
+ }
25
+ ) }),
26
+ /* @__PURE__ */ e(m, { children: a(o ?? "toggle") })
41
27
  ] });
42
28
  };
43
- function y({ className: t, ...a }) {
29
+ function M({ className: t, ...a }) {
30
+ return /* @__PURE__ */ e(
31
+ n.Root,
32
+ {
33
+ "data-slot": "checkbox",
34
+ className: r(
35
+ "peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
36
+ t
37
+ ),
38
+ ...a,
39
+ children: /* @__PURE__ */ e(
40
+ n.Indicator,
41
+ {
42
+ "data-slot": "checkbox-indicator",
43
+ className: "grid place-content-center text-current transition-none",
44
+ children: /* @__PURE__ */ e(k, { className: "size-3.5" })
45
+ }
46
+ )
47
+ }
48
+ );
49
+ }
50
+ function E({ className: t, ...a }) {
44
51
  return /* @__PURE__ */ e(
45
- l.Root,
52
+ d.Root,
46
53
  {
47
54
  "data-slot": "switch",
48
55
  dir: "ltr",
49
- className: o(
56
+ className: r(
50
57
  "peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-5 w-9 shrink-0 items-center rounded-full border-2 border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
51
58
  t
52
59
  ),
53
60
  ...a,
54
61
  children: /* @__PURE__ */ e(
55
- l.Thumb,
62
+ d.Thumb,
56
63
  {
57
64
  "data-slot": "switch-thumb",
58
- className: o(
65
+ className: r(
59
66
  "bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"
60
67
  )
61
68
  }
@@ -63,12 +70,12 @@ function y({ className: t, ...a }) {
63
70
  }
64
71
  );
65
72
  }
66
- function N({ className: t, ...a }) {
73
+ function L({ className: t, ...a }) {
67
74
  return /* @__PURE__ */ e(
68
75
  "textarea",
69
76
  {
70
77
  "data-slot": "textarea",
71
- className: o(
78
+ className: r(
72
79
  "border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
73
80
  t
74
81
  ),
@@ -77,48 +84,48 @@ function N({ className: t, ...a }) {
77
84
  );
78
85
  }
79
86
  export {
80
- L as BUILT_IN_METERS,
81
- q as Badge,
87
+ H as BUILT_IN_METERS,
88
+ B as Badge,
82
89
  h as Button,
83
- B as Checkbox,
84
- Q as Collapsible,
90
+ M as Checkbox,
91
+ R as Collapsible,
85
92
  j as CollapsibleContent,
86
- z as CollapsibleTrigger,
87
- A as Dialog,
88
- E as DialogClose,
89
- H as DialogContent,
90
- O as DialogDescription,
91
- R as DialogFooter,
92
- _ as DialogHeader,
93
- G as DialogTitle,
94
- P as DialogTrigger,
95
- U as DropdownMenu,
96
- V as DropdownMenuContent,
97
- W as DropdownMenuItem,
98
- F as DropdownMenuTrigger,
99
- J as Input,
100
- K as Label,
101
- X as Loader,
102
- C as ModeToggle,
103
- Y as QUOTA_PERIODS,
104
- Z as Select,
105
- $ as SelectContent,
106
- ee as SelectItem,
107
- ae as SelectTrigger,
108
- te as SelectValue,
109
- re as Sheet,
110
- se as SheetContent,
111
- oe as SheetDescription,
112
- ie as SheetHeader,
113
- ne as SheetTitle,
114
- y as Switch,
115
- N as Textarea,
116
- o as cn,
117
- le as describeDuration,
118
- de as describeWindow,
119
- ce as formatQuotaAmount,
120
- ue as formatQuotaDate,
121
- ge as gentiqLogo,
122
- me as meterLabel,
123
- he as useSlots
93
+ O as CollapsibleTrigger,
94
+ P as Dialog,
95
+ Q as DialogClose,
96
+ q as DialogContent,
97
+ A as DialogDescription,
98
+ F as DialogFooter,
99
+ G as DialogHeader,
100
+ U as DialogTitle,
101
+ V as DialogTrigger,
102
+ W as DropdownMenu,
103
+ X as DropdownMenuContent,
104
+ J as DropdownMenuItem,
105
+ K as DropdownMenuTrigger,
106
+ Y as Input,
107
+ Z as Label,
108
+ $ as Loader,
109
+ I as ModeToggle,
110
+ ee as QUOTA_PERIODS,
111
+ ae as Select,
112
+ te as SelectContent,
113
+ re as SelectItem,
114
+ ie as SelectTrigger,
115
+ oe as SelectValue,
116
+ se as Sheet,
117
+ ne as SheetContent,
118
+ de as SheetDescription,
119
+ le as SheetHeader,
120
+ ce as SheetTitle,
121
+ E as Switch,
122
+ L as Textarea,
123
+ r as cn,
124
+ ue as describeDuration,
125
+ ge as describeWindow,
126
+ be as formatQuotaAmount,
127
+ he as formatQuotaDate,
128
+ me as gentiqLogo,
129
+ pe as meterLabel,
130
+ fe as useSlots
124
131
  };