harebear-ui 0.7.0 → 0.8.1
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/AGENTS.md +15 -12
- package/README.md +8 -7
- package/dist/components/admin/app-nav.d.ts +57 -0
- package/dist/components/admin/app-nav.js +175 -0
- package/dist/components/admin/focus-layout.d.ts +14 -0
- package/dist/components/admin/focus-layout.js +36 -0
- package/dist/components/admin/settings.d.ts +31 -0
- package/dist/components/admin/settings.js +78 -0
- package/dist/components/ai/action-receipt.d.ts +16 -0
- package/dist/components/ai/action-receipt.js +47 -0
- package/dist/components/ai/ask-box.d.ts +27 -0
- package/dist/components/ai/ask-box.js +85 -0
- package/dist/components/ai/assistant.d.ts +94 -0
- package/dist/components/ai/assistant.js +231 -0
- package/dist/components/ai/dictation.d.ts +57 -0
- package/dist/components/ai/dictation.js +148 -0
- package/dist/components/data/sectioned-list.d.ts +37 -0
- package/dist/components/data/sectioned-list.js +139 -0
- package/dist/components/data/task-row.d.ts +22 -0
- package/dist/components/data/task-row.js +60 -0
- package/dist/components/layout/collapse.d.ts +14 -0
- package/dist/components/layout/collapse.js +24 -0
- package/dist/components/ui/check-circle.d.ts +16 -0
- package/dist/components/ui/check-circle.js +39 -0
- package/dist/components/ui/sonner.d.ts +15 -2
- package/dist/components/ui/sonner.js +20 -3
- package/dist/index.d.ts +13 -2
- package/dist/index.js +13 -2
- package/dist/lib/toast-clearance.js +22 -0
- package/dist/styles.css +98 -0
- package/docs/COMPONENTS.md +136 -21
- package/docs/ROADMAP.md +95 -0
- package/docs/guides/theming.md +10 -9
- package/llms.txt +7 -4
- package/package.json +1 -1
- package/skills/harebear-ui/SKILL.md +1 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { TaskRow } from "./task-row.js";
|
|
3
|
+
import { Collapse } from "../layout/collapse.js";
|
|
4
|
+
import { cn } from "../../lib/utils.js";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { ChevronDownIcon, PlusIcon } from "lucide-react";
|
|
8
|
+
// src/components/data/sectioned-list.tsx
|
|
9
|
+
/** How long a ticked row stays in place (so the check is seen) before it folds away. */
|
|
10
|
+
const LINGER_MS = 600;
|
|
11
|
+
/**
|
|
12
|
+
* A to-do list: one add box, sections with headings, done items folded into a "Show N done" toggle, an empty
|
|
13
|
+
* state. Rows fold in and out with Collapse, so nothing jumps.
|
|
14
|
+
*/
|
|
15
|
+
function SectionedList({ sections, onToggle, onOpen, onAdd, addPlaceholder = "Add a to-do", empty, defaultShowDone = false, className, ...props }) {
|
|
16
|
+
const [showDone, setShowDone] = React.useState(defaultShowDone);
|
|
17
|
+
const [lingering, setLingering] = React.useState(/* @__PURE__ */ new Set());
|
|
18
|
+
const timers = React.useRef(/* @__PURE__ */ new Map());
|
|
19
|
+
React.useEffect(() => {
|
|
20
|
+
const map = timers.current;
|
|
21
|
+
return () => map.forEach(clearTimeout);
|
|
22
|
+
}, []);
|
|
23
|
+
const toggle = (id, done) => {
|
|
24
|
+
clearTimeout(timers.current.get(id));
|
|
25
|
+
if (done) {
|
|
26
|
+
setLingering((s) => new Set(s).add(id));
|
|
27
|
+
timers.current.set(id, setTimeout(() => {
|
|
28
|
+
timers.current.delete(id);
|
|
29
|
+
setLingering((s) => {
|
|
30
|
+
const next = new Set(s);
|
|
31
|
+
next.delete(id);
|
|
32
|
+
return next;
|
|
33
|
+
});
|
|
34
|
+
}, LINGER_MS));
|
|
35
|
+
}
|
|
36
|
+
onToggle(id, done);
|
|
37
|
+
};
|
|
38
|
+
const shown = (item) => !item.done || lingering.has(item.id);
|
|
39
|
+
const done = sections.flatMap((s) => s.items.filter((i) => i.done && !lingering.has(i.id)));
|
|
40
|
+
const anyOpen = sections.some((s) => s.items.some(shown));
|
|
41
|
+
const row = (item) => /* @__PURE__ */ jsx(TaskRow, {
|
|
42
|
+
title: item.title,
|
|
43
|
+
meta: item.meta,
|
|
44
|
+
checked: !!item.done,
|
|
45
|
+
important: item.important,
|
|
46
|
+
assignee: item.assignee,
|
|
47
|
+
onCheckedChange: (v) => toggle(item.id, v),
|
|
48
|
+
onOpen: onOpen ? () => onOpen(item.id) : void 0
|
|
49
|
+
});
|
|
50
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
51
|
+
"data-slot": "sectioned-list",
|
|
52
|
+
className: cn("flex min-w-0 flex-col gap-6", className),
|
|
53
|
+
...props,
|
|
54
|
+
children: [
|
|
55
|
+
onAdd && /* @__PURE__ */ jsx(AddBox, {
|
|
56
|
+
placeholder: addPlaceholder,
|
|
57
|
+
onAdd
|
|
58
|
+
}),
|
|
59
|
+
sections.map((section) => {
|
|
60
|
+
const visible = section.items.some(shown);
|
|
61
|
+
return /* @__PURE__ */ jsx(Collapse, {
|
|
62
|
+
open: visible,
|
|
63
|
+
children: /* @__PURE__ */ jsxs("section", {
|
|
64
|
+
"aria-label": typeof section.title === "string" ? section.title : void 0,
|
|
65
|
+
children: [section.title && /* @__PURE__ */ jsx("h2", {
|
|
66
|
+
className: "px-2 pb-1 text-[13px] font-semibold text-muted-foreground",
|
|
67
|
+
children: section.title
|
|
68
|
+
}), /* @__PURE__ */ jsx("ul", {
|
|
69
|
+
className: "flex flex-col",
|
|
70
|
+
children: section.items.map((item) => /* @__PURE__ */ jsx(Collapse, {
|
|
71
|
+
open: shown(item),
|
|
72
|
+
role: "listitem",
|
|
73
|
+
children: row(item)
|
|
74
|
+
}, item.id))
|
|
75
|
+
})]
|
|
76
|
+
})
|
|
77
|
+
}, section.id);
|
|
78
|
+
}),
|
|
79
|
+
!anyOpen && empty && /* @__PURE__ */ jsx("div", {
|
|
80
|
+
"data-slot": "sectioned-list-empty",
|
|
81
|
+
children: empty
|
|
82
|
+
}),
|
|
83
|
+
done.length > 0 && /* @__PURE__ */ jsxs("div", {
|
|
84
|
+
className: "flex flex-col gap-1",
|
|
85
|
+
children: [/* @__PURE__ */ jsxs("button", {
|
|
86
|
+
type: "button",
|
|
87
|
+
"aria-expanded": showDone,
|
|
88
|
+
onClick: () => setShowDone((v) => !v),
|
|
89
|
+
className: "flex min-h-11 items-center gap-1.5 self-start rounded-md px-2 text-[13px] font-medium text-muted-foreground outline-none hover:text-foreground focus-visible:ring-4 focus-visible:ring-ring/20",
|
|
90
|
+
children: [/* @__PURE__ */ jsx(ChevronDownIcon, {
|
|
91
|
+
"aria-hidden": "true",
|
|
92
|
+
className: cn("size-4 transition-transform motion-reduce:transition-none", !showDone && "-rotate-90")
|
|
93
|
+
}), showDone ? "Hide done" : `Show ${done.length} done`]
|
|
94
|
+
}), /* @__PURE__ */ jsx(Collapse, {
|
|
95
|
+
open: showDone,
|
|
96
|
+
children: /* @__PURE__ */ jsx("ul", {
|
|
97
|
+
className: "flex flex-col",
|
|
98
|
+
children: done.map((item) => /* @__PURE__ */ jsx("li", { children: row(item) }, item.id))
|
|
99
|
+
})
|
|
100
|
+
})]
|
|
101
|
+
})
|
|
102
|
+
]
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
function AddBox({ placeholder, onAdd }) {
|
|
106
|
+
const [value, setValue] = React.useState("");
|
|
107
|
+
const id = React.useId();
|
|
108
|
+
return /* @__PURE__ */ jsxs("form", {
|
|
109
|
+
"data-slot": "sectioned-list-add",
|
|
110
|
+
onSubmit: (e) => {
|
|
111
|
+
e.preventDefault();
|
|
112
|
+
const text = value.trim();
|
|
113
|
+
if (!text) return;
|
|
114
|
+
onAdd(text);
|
|
115
|
+
setValue("");
|
|
116
|
+
},
|
|
117
|
+
className: "focus-box flex h-12 items-center gap-2.5 rounded-xl border border-transparent bg-muted px-3.5",
|
|
118
|
+
children: [
|
|
119
|
+
/* @__PURE__ */ jsx(PlusIcon, {
|
|
120
|
+
"aria-hidden": "true",
|
|
121
|
+
className: "size-5 shrink-0 text-muted-foreground"
|
|
122
|
+
}),
|
|
123
|
+
/* @__PURE__ */ jsx("label", {
|
|
124
|
+
htmlFor: id,
|
|
125
|
+
className: "sr-only",
|
|
126
|
+
children: placeholder
|
|
127
|
+
}),
|
|
128
|
+
/* @__PURE__ */ jsx("input", {
|
|
129
|
+
id,
|
|
130
|
+
value,
|
|
131
|
+
onChange: (e) => setValue(e.target.value),
|
|
132
|
+
placeholder,
|
|
133
|
+
autoComplete: "off",
|
|
134
|
+
className: "h-full min-w-0 flex-1 bg-transparent text-[15px] text-foreground outline-none placeholder:text-muted-foreground"
|
|
135
|
+
})
|
|
136
|
+
]
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
export { SectionedList };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface TaskRowAssignee {
|
|
3
|
+
name: string;
|
|
4
|
+
avatarUrl?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface TaskRowProps extends Omit<React.ComponentProps<"div">, "title"> {
|
|
7
|
+
title: React.ReactNode;
|
|
8
|
+
/** One line under the title, e.g. "Today · Groceries". Truncates. */
|
|
9
|
+
meta?: React.ReactNode;
|
|
10
|
+
checked: boolean;
|
|
11
|
+
onCheckedChange: (checked: boolean) => void;
|
|
12
|
+
/** Avatar at the right; the name is its accessible label. */
|
|
13
|
+
assignee?: TaskRowAssignee;
|
|
14
|
+
/** Warning-tinted check. Also say it in words, e.g. meta="Important · Today". */
|
|
15
|
+
important?: boolean;
|
|
16
|
+
/** Makes the title a button, e.g. to open a DetailSheet. */
|
|
17
|
+
onOpen?: () => void;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/** One to-do: round check aligned with the first line, title, one meta line, optional assignee. */
|
|
21
|
+
declare function TaskRow({ title, meta, checked, onCheckedChange, assignee, important, onOpen, disabled, className, ...props }: TaskRowProps): React.JSX.Element;
|
|
22
|
+
export { TaskRow };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { initials } from "../admin/user-chip.js";
|
|
3
|
+
import { Avatar, AvatarFallback, AvatarImage } from "../ui/avatar.js";
|
|
4
|
+
import { CheckCircle } from "../ui/check-circle.js";
|
|
5
|
+
import { cn } from "../../lib/utils.js";
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
// src/components/data/task-row.tsx
|
|
9
|
+
/** One to-do: round check aligned with the first line, title, one meta line, optional assignee. */
|
|
10
|
+
function TaskRow({ title, meta, checked, onCheckedChange, assignee, important, onOpen, disabled, className, ...props }) {
|
|
11
|
+
const titleId = React.useId();
|
|
12
|
+
const titleClass = cn("text-[15px] leading-6 wrap-anywhere", checked ? "text-muted-foreground line-through decoration-muted-foreground/60" : "text-foreground");
|
|
13
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
14
|
+
"data-slot": "task-row",
|
|
15
|
+
"data-checked": checked || void 0,
|
|
16
|
+
className: cn("flex min-w-0 items-start gap-3 rounded-lg px-2 py-2.5", className),
|
|
17
|
+
...props,
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ jsx(CheckCircle, {
|
|
20
|
+
checked,
|
|
21
|
+
onCheckedChange: (v) => onCheckedChange(v === true),
|
|
22
|
+
tone: important && !checked ? "important" : "default",
|
|
23
|
+
"aria-labelledby": titleId,
|
|
24
|
+
disabled
|
|
25
|
+
}),
|
|
26
|
+
/* @__PURE__ */ jsxs("div", {
|
|
27
|
+
className: "flex min-w-0 flex-1 flex-col",
|
|
28
|
+
children: [onOpen ? /* @__PURE__ */ jsx("button", {
|
|
29
|
+
type: "button",
|
|
30
|
+
id: titleId,
|
|
31
|
+
onClick: onOpen,
|
|
32
|
+
className: cn(titleClass, "self-start rounded-sm text-left outline-none hover:underline hover:underline-offset-4 focus-visible:ring-4 focus-visible:ring-ring/20"),
|
|
33
|
+
children: title
|
|
34
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
35
|
+
id: titleId,
|
|
36
|
+
className: titleClass,
|
|
37
|
+
children: title
|
|
38
|
+
}), meta && /* @__PURE__ */ jsx("span", {
|
|
39
|
+
className: "truncate text-xs text-muted-foreground",
|
|
40
|
+
children: meta
|
|
41
|
+
})]
|
|
42
|
+
}),
|
|
43
|
+
assignee && /* @__PURE__ */ jsxs(Avatar, {
|
|
44
|
+
size: "sm",
|
|
45
|
+
role: "img",
|
|
46
|
+
"aria-label": assignee.name,
|
|
47
|
+
title: assignee.name,
|
|
48
|
+
children: [assignee.avatarUrl && /* @__PURE__ */ jsx(AvatarImage, {
|
|
49
|
+
src: assignee.avatarUrl,
|
|
50
|
+
alt: ""
|
|
51
|
+
}), /* @__PURE__ */ jsx(AvatarFallback, {
|
|
52
|
+
"aria-hidden": "true",
|
|
53
|
+
className: "group-data-[size=sm]/avatar:text-xs",
|
|
54
|
+
children: initials(assignee.name)
|
|
55
|
+
})]
|
|
56
|
+
})
|
|
57
|
+
]
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
export { TaskRow };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface CollapseProps extends React.ComponentProps<"div"> {
|
|
3
|
+
/** Shown at full height when true; animates to zero height when false. */
|
|
4
|
+
open: boolean;
|
|
5
|
+
/** Classes for the inner element that holds the children. */
|
|
6
|
+
contentClassName?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Animates its children's height between auto and 0 with a CSS grid-template-rows transition, so neighbours move
|
|
10
|
+
* smoothly instead of jumping. Closed content is `inert` and hidden from assistive tech. No animation under
|
|
11
|
+
* prefers-reduced-motion.
|
|
12
|
+
*/
|
|
13
|
+
declare function Collapse({ open, contentClassName, className, children, ...props }: CollapseProps): React.JSX.Element;
|
|
14
|
+
export { Collapse };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../lib/utils.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
// src/components/layout/collapse.tsx
|
|
5
|
+
/**
|
|
6
|
+
* Animates its children's height between auto and 0 with a CSS grid-template-rows transition, so neighbours move
|
|
7
|
+
* smoothly instead of jumping. Closed content is `inert` and hidden from assistive tech. No animation under
|
|
8
|
+
* prefers-reduced-motion.
|
|
9
|
+
*/
|
|
10
|
+
function Collapse({ open, contentClassName, className, children, ...props }) {
|
|
11
|
+
return /* @__PURE__ */ jsx("div", {
|
|
12
|
+
"data-slot": "collapse",
|
|
13
|
+
"data-state": open ? "open" : "closed",
|
|
14
|
+
"aria-hidden": open ? void 0 : true,
|
|
15
|
+
inert: !open,
|
|
16
|
+
className: cn("grid transition-[grid-template-rows,opacity] duration-200 ease-out motion-reduce:transition-none", open ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0", className),
|
|
17
|
+
...props,
|
|
18
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
19
|
+
className: cn("min-h-0 overflow-hidden", contentClassName),
|
|
20
|
+
children
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
export { Collapse };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Checkbox } from "radix-ui";
|
|
3
|
+
export interface CheckCircleProps extends React.ComponentProps<typeof Checkbox.Root> {
|
|
4
|
+
/**
|
|
5
|
+
* "important" tints the unticked ring with the warning color. Color alone is not enough: pair it with a word
|
|
6
|
+
* (for example "Important" in the row's meta line).
|
|
7
|
+
*/
|
|
8
|
+
tone?: "default" | "important";
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* harebear: 24px round checkbox for to-do rows, with a 44px touch target and a short pop when ticked (none under
|
|
12
|
+
* reduced motion). Radix Checkbox underneath: `checked`, `onCheckedChange`, `disabled`. Give it an accessible name
|
|
13
|
+
* (`aria-label` or `aria-labelledby` pointing at the row title). Align it with the first line of text, not the center.
|
|
14
|
+
*/
|
|
15
|
+
declare function CheckCircle({ tone, className, onCheckedChange, onAnimationEnd, ...props }: CheckCircleProps): React.JSX.Element;
|
|
16
|
+
export { CheckCircle };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../lib/utils.js";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { CheckIcon } from "lucide-react";
|
|
6
|
+
import { Checkbox } from "radix-ui";
|
|
7
|
+
// src/components/ui/check-circle.tsx
|
|
8
|
+
/**
|
|
9
|
+
* harebear: 24px round checkbox for to-do rows, with a 44px touch target and a short pop when ticked (none under
|
|
10
|
+
* reduced motion). Radix Checkbox underneath: `checked`, `onCheckedChange`, `disabled`. Give it an accessible name
|
|
11
|
+
* (`aria-label` or `aria-labelledby` pointing at the row title). Align it with the first line of text, not the center.
|
|
12
|
+
*/
|
|
13
|
+
function CheckCircle({ tone = "default", className, onCheckedChange, onAnimationEnd, ...props }) {
|
|
14
|
+
const [pop, setPop] = React.useState(false);
|
|
15
|
+
return /* @__PURE__ */ jsx(Checkbox.Root, {
|
|
16
|
+
"data-slot": "check-circle",
|
|
17
|
+
"data-tone": tone,
|
|
18
|
+
"data-pop": pop || void 0,
|
|
19
|
+
onCheckedChange: (checked) => {
|
|
20
|
+
if (checked === true) setPop(true);
|
|
21
|
+
onCheckedChange?.(checked);
|
|
22
|
+
},
|
|
23
|
+
onAnimationEnd: (e) => {
|
|
24
|
+
setPop(false);
|
|
25
|
+
onAnimationEnd?.(e);
|
|
26
|
+
},
|
|
27
|
+
className: cn("peer relative grid size-6 shrink-0 place-items-center rounded-full border-2 border-muted-foreground/45 bg-card text-primary-foreground transition-[background-color,border-color,box-shadow] outline-none after:absolute after:-inset-2.5 hover:border-primary focus-visible:border-primary focus-visible:ring-4 focus-visible:ring-primary/20 disabled:cursor-not-allowed disabled:opacity-50 data-[tone=important]:border-warning data-[tone=important]:bg-warning/10 data-checked:border-primary data-checked:bg-primary data-[pop]:animate-check-pop", className),
|
|
28
|
+
...props,
|
|
29
|
+
children: /* @__PURE__ */ jsx(Checkbox.Indicator, {
|
|
30
|
+
"data-slot": "check-circle-indicator",
|
|
31
|
+
className: "grid place-content-center",
|
|
32
|
+
children: /* @__PURE__ */ jsx(CheckIcon, {
|
|
33
|
+
className: "size-3.5",
|
|
34
|
+
strokeWidth: 3
|
|
35
|
+
})
|
|
36
|
+
})
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
export { CheckCircle };
|
|
@@ -1,3 +1,16 @@
|
|
|
1
|
-
import { ToasterProps } from "sonner";
|
|
1
|
+
import { ExternalToast, ToasterProps } from "sonner";
|
|
2
2
|
declare const Toaster: ({ ...props }: ToasterProps) => import("react").JSX.Element;
|
|
3
|
-
export
|
|
3
|
+
export interface ToastUndoOptions extends Omit<ExternalToast, "action"> {
|
|
4
|
+
/** Called when Undo is pressed. The toast closes. */
|
|
5
|
+
onUndo: () => void;
|
|
6
|
+
/** Default "Undo". */
|
|
7
|
+
undoLabel?: React.ReactNode;
|
|
8
|
+
/** Milliseconds before it closes. Default 9000. Sonner pauses the timer on hover and while the page is hidden. */
|
|
9
|
+
duration?: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* harebear: a toast with an Undo action for something that already happened ("Moved 3 to-dos to Done").
|
|
13
|
+
* Uses the mounted <Toaster />. Returns the toast id (pass it to `toast.dismiss` from sonner).
|
|
14
|
+
*/
|
|
15
|
+
declare function toastUndo(message: React.ReactNode, { onUndo, undoLabel, duration, ...options }: ToastUndoOptions): string | number;
|
|
16
|
+
export { Toaster, toastUndo };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { useTheme } from "../theme/theme-provider.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { CircleCheckIcon, InfoIcon, Loader2Icon, OctagonXIcon, TriangleAlertIcon } from "lucide-react";
|
|
5
|
-
import { Toaster as Toaster$1 } from "sonner";
|
|
5
|
+
import { Toaster as Toaster$1, toast } from "sonner";
|
|
6
6
|
// src/components/ui/sonner.tsx
|
|
7
7
|
const Toaster = ({ ...props }) => {
|
|
8
8
|
const { resolvedMode } = useTheme();
|
|
@@ -22,8 +22,25 @@ const Toaster = ({ ...props }) => {
|
|
|
22
22
|
"--normal-border": "var(--border)",
|
|
23
23
|
"--border-radius": "var(--radius)"
|
|
24
24
|
},
|
|
25
|
-
toastOptions: { classNames: {
|
|
25
|
+
toastOptions: { classNames: {
|
|
26
|
+
toast: "cn-toast",
|
|
27
|
+
actionButton: "bg-primary-soft! text-primary! font-medium! h-8! px-3! rounded-md!"
|
|
28
|
+
} },
|
|
26
29
|
...props
|
|
27
30
|
});
|
|
28
31
|
};
|
|
29
|
-
|
|
32
|
+
/**
|
|
33
|
+
* harebear: a toast with an Undo action for something that already happened ("Moved 3 to-dos to Done").
|
|
34
|
+
* Uses the mounted <Toaster />. Returns the toast id (pass it to `toast.dismiss` from sonner).
|
|
35
|
+
*/
|
|
36
|
+
function toastUndo(message, { onUndo, undoLabel = "Undo", duration = 9e3, ...options }) {
|
|
37
|
+
return toast(message, {
|
|
38
|
+
duration,
|
|
39
|
+
...options,
|
|
40
|
+
action: {
|
|
41
|
+
label: undoLabel,
|
|
42
|
+
onClick: () => onUndo()
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
export { Toaster, toastUndo };
|
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ import { Calendar, CalendarDayButton } from "./components/ui/calendar.js";
|
|
|
15
15
|
import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "./components/ui/card.js";
|
|
16
16
|
import { Carousel, CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, useCarousel } from "./components/ui/carousel.js";
|
|
17
17
|
import { ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent } from "./components/ui/chart.js";
|
|
18
|
+
import { CheckCircle, CheckCircleProps } from "./components/ui/check-circle.js";
|
|
18
19
|
import { Checkbox } from "./components/ui/checkbox.js";
|
|
19
20
|
import { CodeBlock, CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockFooter, CodeBlockHeader, CodeBlockLine, CodeBlockTitle } from "./components/ui/code-block.js";
|
|
20
21
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./components/ui/collapsible.js";
|
|
@@ -53,7 +54,7 @@ import { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHe
|
|
|
53
54
|
import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar, useSidebarOptional } from "./components/ui/sidebar.js";
|
|
54
55
|
import { Skeleton } from "./components/ui/skeleton.js";
|
|
55
56
|
import { Slider } from "./components/ui/slider.js";
|
|
56
|
-
import { Toaster } from "./components/ui/sonner.js";
|
|
57
|
+
import { ToastUndoOptions, Toaster, toastUndo } from "./components/ui/sonner.js";
|
|
57
58
|
import { Spinner } from "./components/ui/spinner.js";
|
|
58
59
|
import { Switch } from "./components/ui/switch.js";
|
|
59
60
|
import { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow } from "./components/ui/table.js";
|
|
@@ -64,14 +65,17 @@ import { Toggle, toggleVariants } from "./components/ui/toggle.js";
|
|
|
64
65
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./components/ui/tooltip.js";
|
|
65
66
|
import { Trace, TraceCollapsible, TraceCollapsibleContent, TraceCollapsibleTrigger, TraceDescription, TraceIcon, TraceLine, TraceTitle } from "./components/ui/trace.js";
|
|
66
67
|
import { ActivityFeed, ActivityItem } from "./components/admin/activity-feed.js";
|
|
68
|
+
import { AppNav, AppNavAction, AppNavGroup, AppNavPlace, AppNavProps } from "./components/admin/app-nav.js";
|
|
67
69
|
import { AppBrand, AppBrandProps, AppNavItem, AppNavSection, AppShell, AppShellProps } from "./components/admin/app-shell.js";
|
|
68
70
|
import { Callout } from "./components/admin/callout.js";
|
|
69
71
|
import { ConfirmDialog, ConfirmDialogProps } from "./components/admin/confirm-dialog.js";
|
|
70
72
|
import { CopyField, CopyFieldProps } from "./components/admin/copy-field.js";
|
|
73
|
+
import { FocusLayout, FocusLayoutProps } from "./components/admin/focus-layout.js";
|
|
71
74
|
import { KeyValueGrid, KeyValueItem } from "./components/admin/key-value-grid.js";
|
|
72
75
|
import { LinkTile, LinkTileProps } from "./components/admin/link-tile.js";
|
|
73
76
|
import { PageHeader, PageHeaderProps } from "./components/admin/page-header.js";
|
|
74
77
|
import { SearchInput, SearchInputProps } from "./components/admin/search-input.js";
|
|
78
|
+
import { SettingsRow, SettingsRowProps, SettingsSection, SettingsSectionProps } from "./components/admin/settings.js";
|
|
75
79
|
import { SidebarCollapseButton, SidebarLayout, SidebarLayoutProps } from "./components/admin/sidebar-layout.js";
|
|
76
80
|
import { StatCard, StatCardProps } from "./components/admin/stat-card.js";
|
|
77
81
|
import { StatusBadge, StatusBadgeProps, StatusDot, StatusDotProps, StatusTone } from "./components/admin/status.js";
|
|
@@ -79,6 +83,7 @@ import { Timeline, TimelineItem } from "./components/admin/timeline.js";
|
|
|
79
83
|
import { UsageMeter, UsageMeterProps } from "./components/admin/usage-meter.js";
|
|
80
84
|
import { UserChip, UserChipProps, initials } from "./components/admin/user-chip.js";
|
|
81
85
|
import { UserMenu, UserMenuProps } from "./components/admin/user-menu.js";
|
|
86
|
+
import { Collapse, CollapseProps } from "./components/layout/collapse.js";
|
|
82
87
|
import { MediaItem, MediaItemProps } from "./components/layout/media-item.js";
|
|
83
88
|
import { Metric, MetricGroup, MetricProps } from "./components/layout/metric.js";
|
|
84
89
|
import { ShowMore, ShowMoreProps } from "./components/layout/show-more.js";
|
|
@@ -86,14 +91,20 @@ import { Grid, GridCols, GridProps, ResponsiveGridCols, Row, RowProps, Stack, St
|
|
|
86
91
|
import { Heading, HeadingProps, Text, TextProps, TextTone } from "./components/layout/text.js";
|
|
87
92
|
import { BarList, BarListItem } from "./components/data/bar-list.js";
|
|
88
93
|
import { DataTable, DataTableColumnDef, DataTableFeatures, DataTableProps, createDataTableColumnHelper, dataTableFeatures } from "./components/data/data-table.js";
|
|
94
|
+
import { SectionedList, SectionedListItem, SectionedListProps, SectionedListSection } from "./components/data/sectioned-list.js";
|
|
89
95
|
import { Sparkline, SparklineProps, smoothPath } from "./components/data/sparkline.js";
|
|
90
96
|
import { StatusBarDatum, StatusBars, StatusBarsProps } from "./components/data/status-bars.js";
|
|
97
|
+
import { TaskRow, TaskRowAssignee, TaskRowProps } from "./components/data/task-row.js";
|
|
91
98
|
import { TrendChart, TrendChartProps, TrendLegend, TrendSeries } from "./components/data/trend-chart.js";
|
|
99
|
+
import { ActionReceipt, ActionReceiptProps } from "./components/ai/action-receipt.js";
|
|
92
100
|
import { ApprovalCard, ApprovalCardProps, ApprovalResult, ApprovalResultProps } from "./components/ai/approval.js";
|
|
101
|
+
import { AskBox, AskBoxProps } from "./components/ai/ask-box.js";
|
|
102
|
+
import { AssistantContextValue, AssistantDock, AssistantDockProps, AssistantMessage, AssistantPage, AssistantProvider, AssistantProviderProps, AssistantSendContext, useAssistant, useAssistantPage } from "./components/ai/assistant.js";
|
|
93
103
|
import { ChatPanel, ChatPanelProps, ChatShell, ChatShellProps } from "./components/ai/chat-shell.js";
|
|
94
104
|
import { AssistantAvatar, ChatMessage, ChatMessageProps, ChatThread, ChatThreadProps, MessageActions, MessageActionsProps, ToolCall, ToolCallProps, TypingIndicator, TypingIndicatorProps } from "./components/ai/chat.js";
|
|
95
105
|
import { CodeSnippet, CodeSnippetProps, InlineCode, InlineCodeProps, Prose } from "./components/ai/code-block.js";
|
|
96
106
|
import { Conversation, ConversationGroup, ConversationList, ConversationListProps, NewConversationButton, NewConversationButtonProps, formatWhen, groupByDate } from "./components/ai/conversation-list.js";
|
|
107
|
+
import { DictationButton, DictationButtonProps, SpeechSource, SpeechSourceHandlers, UseDictationOptions, browserSpeechSource, useDictation } from "./components/ai/dictation.js";
|
|
97
108
|
import { ModelOption, ModelPicker, ModelPickerProps } from "./components/ai/model-picker.js";
|
|
98
109
|
import { PromptInput, PromptInputChip, PromptInputChipProps, PromptInputProps, PromptInputSelect, PromptInputSelectOption, PromptInputSelectProps } from "./components/ai/prompt-input.js";
|
|
99
110
|
import { ToolGroup, ToolGroupProps, ToolStatus, ToolStatusIcon, ToolStep, ToolStepProps } from "./components/ai/tool-steps.js";
|
|
@@ -104,4 +115,4 @@ import { useMediaQuery } from "./hooks/use-media-query.js";
|
|
|
104
115
|
import { useIsMobile } from "./hooks/use-mobile.js";
|
|
105
116
|
import { highlightCode, loadHighlighter } from "./lib/highlighter.js";
|
|
106
117
|
import { cn } from "./lib/utils.js";
|
|
107
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActivityFeed, type ActivityItem, Alert, AlertAction, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AppBrand, type AppBrandProps, type AppNavItem, type AppNavSection, AppShell, type AppShellProps, AppleIcon, ApprovalCard, type ApprovalCardProps, ApprovalResult, type ApprovalResultProps, AspectRatio, AssistantAvatar, Attachment, AttachmentAction, AttachmentActions, AttachmentContent, AttachmentDescription, AttachmentGroup, AttachmentMedia, AttachmentTitle, AttachmentTrigger, AuthLayout, type AuthLayoutProps, type AuthProvider, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, BarList, type BarListItem, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Bubble, BubbleContent, BubbleGroup, BubbleReactions, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Calendar, CalendarDayButton, Callout, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, type CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, ChatMessage, type ChatMessageProps, ChatPanel, type ChatPanelProps, ChatShell, type ChatShellProps, ChatThread, type ChatThreadProps, Checkbox, CodeBlock, CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockFooter, CodeBlockHeader, CodeBlockLine, CodeBlockTitle, CodeSnippet, type CodeSnippetProps, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxTrigger, ComboboxValue, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ConfirmDialog, type ConfirmDialogProps, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, type Conversation, type ConversationGroup, ConversationList, type ConversationListProps, CopyField, type CopyFieldProps, DataTable, type DataTableColumnDef, type DataTableFeatures, type DataTableProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DirectionProvider, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, GitHubIcon, GoogleIcon, Grid, type GridCols, type GridProps, Heading, type HeadingProps, HoverCard, HoverCardContent, HoverCardTrigger, InlineCode, type InlineCodeProps, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, Kbd, KbdGroup, KeyValueGrid, type KeyValueItem, Label, LinkTile, type LinkTileProps, LoginForm, type LoginFormProps, type LoginValues, Marker, MarkerContent, MarkerIcon, MediaItem, type MediaItemProps, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Message, MessageActions, type MessageActionsProps, MessageAvatar, MessageContent, MessageFooter, MessageGroup, MessageHeader, MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, Metric, MetricGroup, type MetricProps, type ModelOption, ModelPicker, type ModelPickerProps, NativeSelect, NativeSelectOptGroup, NativeSelectOption, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, NewConversationButton, type NewConversationButtonProps, PageHeader, type PageHeaderProps, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, Progress, PromptInput, PromptInputChip, type PromptInputChipProps, type PromptInputProps, PromptInputSelect, type PromptInputSelectOption, type PromptInputSelectProps, Prose, Questionnaire, QuestionnaireActions, QuestionnaireChoice, QuestionnaireChoiceDescription, QuestionnaireChoices, QuestionnaireDescription, QuestionnaireError, QuestionnaireInput, QuestionnaireItem, QuestionnaireNext, QuestionnairePrevious, QuestionnaireProgress, QuestionnaireSkip, QuestionnaireSubmit, QuestionnaireTitle, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, type ResolvedThemeMode, type ResponsiveGridCols, Row, type RowProps, ScrollArea, ScrollBar, SearchInput, type SearchInputProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, ShowMore, type ShowMoreProps, Sidebar, SidebarCollapseButton, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarLayout, type SidebarLayoutProps, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SignupForm, type SignupFormProps, type SignupValues, Skeleton, Slider, Sparkline, type SparklineProps, Spinner, Stack, type StackAlign, type StackJustify, type StackProps, type StackSpace, StatCard, type StatCardProps, StatusBadge, type StatusBadgeProps, type StatusBarDatum, StatusBars, type StatusBarsProps, StatusDot, type StatusDotProps, type StatusTone, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Text, type TextProps, type TextTone, Textarea, type ThemeContextValue, type ThemeMode, ThemeProvider, type ThemeProviderProps, ThemeScript, ThemeToggle, Timeline, type TimelineItem, Toaster, Toggle, ToggleGroup, ToggleGroupItem, ToolCall, type ToolCallProps, ToolGroup, type ToolGroupProps, type ToolStatus, ToolStatusIcon, ToolStep, type ToolStepProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Trace, TraceCollapsible, TraceCollapsibleContent, TraceCollapsibleTrigger, TraceDescription, TraceIcon, TraceLine, TraceTitle, TrendChart, type TrendChartProps, TrendLegend, type TrendSeries, TypingIndicator, type TypingIndicatorProps, UsageMeter, type UsageMeterProps, UserChip, type UserChipProps, UserMenu, type UserMenuProps, badgeVariants, buttonGroupVariants, buttonVariants, cn, createDataTableColumnHelper, dataTableFeatures, formatWhen, groupByDate, highlightCode, initials, loadHighlighter, markerVariants, navigationMenuTriggerStyle, smoothPath, tabsListVariants, toggleVariants, useCarousel, useComboboxAnchor, useCopyToClipboard, useDirection, useHighlightedCode, useIsMobile, useMediaQuery, useMessageScroller, useMessageScrollerScrollable, useMessageScrollerVisibility, useSidebar, useSidebarOptional, useTheme };
|
|
118
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActionReceipt, type ActionReceiptProps, ActivityFeed, type ActivityItem, Alert, AlertAction, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AppBrand, type AppBrandProps, AppNav, type AppNavAction, type AppNavGroup, type AppNavItem, type AppNavPlace, type AppNavProps, type AppNavSection, AppShell, type AppShellProps, AppleIcon, ApprovalCard, type ApprovalCardProps, ApprovalResult, type ApprovalResultProps, AskBox, type AskBoxProps, AspectRatio, AssistantAvatar, type AssistantContextValue, AssistantDock, type AssistantDockProps, type AssistantMessage, type AssistantPage, AssistantProvider, type AssistantProviderProps, type AssistantSendContext, Attachment, AttachmentAction, AttachmentActions, AttachmentContent, AttachmentDescription, AttachmentGroup, AttachmentMedia, AttachmentTitle, AttachmentTrigger, AuthLayout, type AuthLayoutProps, type AuthProvider, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, BarList, type BarListItem, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Bubble, BubbleContent, BubbleGroup, BubbleReactions, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Calendar, CalendarDayButton, Callout, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, type CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, ChatMessage, type ChatMessageProps, ChatPanel, type ChatPanelProps, ChatShell, type ChatShellProps, ChatThread, type ChatThreadProps, CheckCircle, type CheckCircleProps, Checkbox, CodeBlock, CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockFooter, CodeBlockHeader, CodeBlockLine, CodeBlockTitle, CodeSnippet, type CodeSnippetProps, Collapse, type CollapseProps, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxTrigger, ComboboxValue, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ConfirmDialog, type ConfirmDialogProps, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, type Conversation, type ConversationGroup, ConversationList, type ConversationListProps, CopyField, type CopyFieldProps, DataTable, type DataTableColumnDef, type DataTableFeatures, type DataTableProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DictationButton, type DictationButtonProps, DirectionProvider, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, FocusLayout, type FocusLayoutProps, GitHubIcon, GoogleIcon, Grid, type GridCols, type GridProps, Heading, type HeadingProps, HoverCard, HoverCardContent, HoverCardTrigger, InlineCode, type InlineCodeProps, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, Kbd, KbdGroup, KeyValueGrid, type KeyValueItem, Label, LinkTile, type LinkTileProps, LoginForm, type LoginFormProps, type LoginValues, Marker, MarkerContent, MarkerIcon, MediaItem, type MediaItemProps, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Message, MessageActions, type MessageActionsProps, MessageAvatar, MessageContent, MessageFooter, MessageGroup, MessageHeader, MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, Metric, MetricGroup, type MetricProps, type ModelOption, ModelPicker, type ModelPickerProps, NativeSelect, NativeSelectOptGroup, NativeSelectOption, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, NewConversationButton, type NewConversationButtonProps, PageHeader, type PageHeaderProps, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, Progress, PromptInput, PromptInputChip, type PromptInputChipProps, type PromptInputProps, PromptInputSelect, type PromptInputSelectOption, type PromptInputSelectProps, Prose, Questionnaire, QuestionnaireActions, QuestionnaireChoice, QuestionnaireChoiceDescription, QuestionnaireChoices, QuestionnaireDescription, QuestionnaireError, QuestionnaireInput, QuestionnaireItem, QuestionnaireNext, QuestionnairePrevious, QuestionnaireProgress, QuestionnaireSkip, QuestionnaireSubmit, QuestionnaireTitle, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, type ResolvedThemeMode, type ResponsiveGridCols, Row, type RowProps, ScrollArea, ScrollBar, SearchInput, type SearchInputProps, SectionedList, type SectionedListItem, type SectionedListProps, type SectionedListSection, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SettingsRow, type SettingsRowProps, SettingsSection, type SettingsSectionProps, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, ShowMore, type ShowMoreProps, Sidebar, SidebarCollapseButton, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarLayout, type SidebarLayoutProps, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SignupForm, type SignupFormProps, type SignupValues, Skeleton, Slider, Sparkline, type SparklineProps, type SpeechSource, type SpeechSourceHandlers, Spinner, Stack, type StackAlign, type StackJustify, type StackProps, type StackSpace, StatCard, type StatCardProps, StatusBadge, type StatusBadgeProps, type StatusBarDatum, StatusBars, type StatusBarsProps, StatusDot, type StatusDotProps, type StatusTone, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TaskRow, type TaskRowAssignee, type TaskRowProps, Text, type TextProps, type TextTone, Textarea, type ThemeContextValue, type ThemeMode, ThemeProvider, type ThemeProviderProps, ThemeScript, ThemeToggle, Timeline, type TimelineItem, type ToastUndoOptions, Toaster, Toggle, ToggleGroup, ToggleGroupItem, ToolCall, type ToolCallProps, ToolGroup, type ToolGroupProps, type ToolStatus, ToolStatusIcon, ToolStep, type ToolStepProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Trace, TraceCollapsible, TraceCollapsibleContent, TraceCollapsibleTrigger, TraceDescription, TraceIcon, TraceLine, TraceTitle, TrendChart, type TrendChartProps, TrendLegend, type TrendSeries, TypingIndicator, type TypingIndicatorProps, UsageMeter, type UsageMeterProps, type UseDictationOptions, UserChip, type UserChipProps, UserMenu, type UserMenuProps, badgeVariants, browserSpeechSource, buttonGroupVariants, buttonVariants, cn, createDataTableColumnHelper, dataTableFeatures, formatWhen, groupByDate, highlightCode, initials, loadHighlighter, markerVariants, navigationMenuTriggerStyle, smoothPath, tabsListVariants, toastUndo, toggleVariants, useAssistant, useAssistantPage, useCarousel, useComboboxAnchor, useCopyToClipboard, useDictation, useDirection, useHighlightedCode, useIsMobile, useMediaQuery, useMessageScroller, useMessageScrollerScrollable, useMessageScrollerVisibility, useSidebar, useSidebarOptional, useTheme };
|
package/dist/index.js
CHANGED
|
@@ -15,6 +15,7 @@ import { Calendar, CalendarDayButton } from "./components/ui/calendar.js";
|
|
|
15
15
|
import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "./components/ui/card.js";
|
|
16
16
|
import { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, useCarousel } from "./components/ui/carousel.js";
|
|
17
17
|
import { ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent } from "./components/ui/chart.js";
|
|
18
|
+
import { CheckCircle } from "./components/ui/check-circle.js";
|
|
18
19
|
import { Checkbox } from "./components/ui/checkbox.js";
|
|
19
20
|
import { CodeBlock, CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockFooter, CodeBlockHeader, CodeBlockLine, CodeBlockTitle } from "./components/ui/code-block.js";
|
|
20
21
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./components/ui/collapsible.js";
|
|
@@ -53,7 +54,7 @@ import { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHe
|
|
|
53
54
|
import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar, useSidebarOptional } from "./components/ui/sidebar.js";
|
|
54
55
|
import { Skeleton } from "./components/ui/skeleton.js";
|
|
55
56
|
import { Slider } from "./components/ui/slider.js";
|
|
56
|
-
import { Toaster } from "./components/ui/sonner.js";
|
|
57
|
+
import { Toaster, toastUndo } from "./components/ui/sonner.js";
|
|
57
58
|
import { Spinner } from "./components/ui/spinner.js";
|
|
58
59
|
import { Switch } from "./components/ui/switch.js";
|
|
59
60
|
import { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow } from "./components/ui/table.js";
|
|
@@ -64,14 +65,17 @@ import { Toggle, toggleVariants } from "./components/ui/toggle.js";
|
|
|
64
65
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./components/ui/tooltip.js";
|
|
65
66
|
import { Trace, TraceCollapsible, TraceCollapsibleContent, TraceCollapsibleTrigger, TraceDescription, TraceIcon, TraceLine, TraceTitle } from "./components/ui/trace.js";
|
|
66
67
|
import { ActivityFeed } from "./components/admin/activity-feed.js";
|
|
68
|
+
import { AppNav } from "./components/admin/app-nav.js";
|
|
67
69
|
import { AppBrand, AppShell } from "./components/admin/app-shell.js";
|
|
68
70
|
import { Callout } from "./components/admin/callout.js";
|
|
69
71
|
import { ConfirmDialog } from "./components/admin/confirm-dialog.js";
|
|
70
72
|
import { CopyField } from "./components/admin/copy-field.js";
|
|
73
|
+
import { FocusLayout } from "./components/admin/focus-layout.js";
|
|
71
74
|
import { KeyValueGrid } from "./components/admin/key-value-grid.js";
|
|
72
75
|
import { LinkTile } from "./components/admin/link-tile.js";
|
|
73
76
|
import { PageHeader } from "./components/admin/page-header.js";
|
|
74
77
|
import { SearchInput } from "./components/admin/search-input.js";
|
|
78
|
+
import { SettingsRow, SettingsSection } from "./components/admin/settings.js";
|
|
75
79
|
import { SidebarCollapseButton, SidebarLayout } from "./components/admin/sidebar-layout.js";
|
|
76
80
|
import { StatCard } from "./components/admin/stat-card.js";
|
|
77
81
|
import { StatusBadge, StatusDot } from "./components/admin/status.js";
|
|
@@ -79,6 +83,7 @@ import { Timeline } from "./components/admin/timeline.js";
|
|
|
79
83
|
import { UsageMeter } from "./components/admin/usage-meter.js";
|
|
80
84
|
import { UserChip, initials } from "./components/admin/user-chip.js";
|
|
81
85
|
import { UserMenu } from "./components/admin/user-menu.js";
|
|
86
|
+
import { Collapse } from "./components/layout/collapse.js";
|
|
82
87
|
import { MediaItem } from "./components/layout/media-item.js";
|
|
83
88
|
import { Metric, MetricGroup } from "./components/layout/metric.js";
|
|
84
89
|
import { ShowMore } from "./components/layout/show-more.js";
|
|
@@ -86,14 +91,20 @@ import { Grid, Row, Stack } from "./components/layout/stack.js";
|
|
|
86
91
|
import { Heading, Text } from "./components/layout/text.js";
|
|
87
92
|
import { BarList } from "./components/data/bar-list.js";
|
|
88
93
|
import { DataTable, createDataTableColumnHelper, dataTableFeatures } from "./components/data/data-table.js";
|
|
94
|
+
import { SectionedList } from "./components/data/sectioned-list.js";
|
|
89
95
|
import { Sparkline, smoothPath } from "./components/data/sparkline.js";
|
|
90
96
|
import { StatusBars } from "./components/data/status-bars.js";
|
|
97
|
+
import { TaskRow } from "./components/data/task-row.js";
|
|
91
98
|
import { TrendChart, TrendLegend } from "./components/data/trend-chart.js";
|
|
99
|
+
import { ActionReceipt } from "./components/ai/action-receipt.js";
|
|
92
100
|
import { ApprovalCard, ApprovalResult } from "./components/ai/approval.js";
|
|
101
|
+
import { AskBox } from "./components/ai/ask-box.js";
|
|
102
|
+
import { AssistantDock, AssistantProvider, useAssistant, useAssistantPage } from "./components/ai/assistant.js";
|
|
93
103
|
import { ChatPanel, ChatShell } from "./components/ai/chat-shell.js";
|
|
94
104
|
import { AssistantAvatar, ChatMessage, ChatThread, MessageActions, ToolCall, TypingIndicator } from "./components/ai/chat.js";
|
|
95
105
|
import { CodeSnippet, InlineCode, Prose } from "./components/ai/code-block.js";
|
|
96
106
|
import { ConversationList, NewConversationButton, formatWhen, groupByDate } from "./components/ai/conversation-list.js";
|
|
107
|
+
import { DictationButton, browserSpeechSource, useDictation } from "./components/ai/dictation.js";
|
|
97
108
|
import { ModelPicker } from "./components/ai/model-picker.js";
|
|
98
109
|
import { PromptInput, PromptInputChip, PromptInputSelect } from "./components/ai/prompt-input.js";
|
|
99
110
|
import { ToolGroup, ToolStatusIcon, ToolStep } from "./components/ai/tool-steps.js";
|
|
@@ -104,4 +115,4 @@ import { useMediaQuery } from "./hooks/use-media-query.js";
|
|
|
104
115
|
import { useIsMobile } from "./hooks/use-mobile.js";
|
|
105
116
|
import { highlightCode, loadHighlighter } from "./lib/highlighter.js";
|
|
106
117
|
import { cn } from "./lib/utils.js";
|
|
107
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActivityFeed, Alert, AlertAction, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AppBrand, AppShell, AppleIcon, ApprovalCard, ApprovalResult, AspectRatio, AssistantAvatar, Attachment, AttachmentAction, AttachmentActions, AttachmentContent, AttachmentDescription, AttachmentGroup, AttachmentMedia, AttachmentTitle, AttachmentTrigger, AuthLayout, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, BarList, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Bubble, BubbleContent, BubbleGroup, BubbleReactions, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Calendar, CalendarDayButton, Callout, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, ChatMessage, ChatPanel, ChatShell, ChatThread, Checkbox, CodeBlock, CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockFooter, CodeBlockHeader, CodeBlockLine, CodeBlockTitle, CodeSnippet, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxTrigger, ComboboxValue, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ConfirmDialog, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, ConversationList, CopyField, DataTable, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DirectionProvider, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, GitHubIcon, GoogleIcon, Grid, Heading, HoverCard, HoverCardContent, HoverCardTrigger, InlineCode, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, Kbd, KbdGroup, KeyValueGrid, Label, LinkTile, LoginForm, Marker, MarkerContent, MarkerIcon, MediaItem, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Message, MessageActions, MessageAvatar, MessageContent, MessageFooter, MessageGroup, MessageHeader, MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, Metric, MetricGroup, ModelPicker, NativeSelect, NativeSelectOptGroup, NativeSelectOption, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, NewConversationButton, PageHeader, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, Progress, PromptInput, PromptInputChip, PromptInputSelect, Prose, Questionnaire, QuestionnaireActions, QuestionnaireChoice, QuestionnaireChoiceDescription, QuestionnaireChoices, QuestionnaireDescription, QuestionnaireError, QuestionnaireInput, QuestionnaireItem, QuestionnaireNext, QuestionnairePrevious, QuestionnaireProgress, QuestionnaireSkip, QuestionnaireSubmit, QuestionnaireTitle, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, Row, ScrollArea, ScrollBar, SearchInput, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, ShowMore, Sidebar, SidebarCollapseButton, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarLayout, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SignupForm, Skeleton, Slider, Sparkline, Spinner, Stack, StatCard, StatusBadge, StatusBars, StatusDot, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Text, Textarea, ThemeProvider, ThemeScript, ThemeToggle, Timeline, Toaster, Toggle, ToggleGroup, ToggleGroupItem, ToolCall, ToolGroup, ToolStatusIcon, ToolStep, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Trace, TraceCollapsible, TraceCollapsibleContent, TraceCollapsibleTrigger, TraceDescription, TraceIcon, TraceLine, TraceTitle, TrendChart, TrendLegend, TypingIndicator, UsageMeter, UserChip, UserMenu, badgeVariants, buttonGroupVariants, buttonVariants, cn, createDataTableColumnHelper, dataTableFeatures, formatWhen, groupByDate, highlightCode, initials, loadHighlighter, markerVariants, navigationMenuTriggerStyle, smoothPath, tabsListVariants, toggleVariants, useCarousel, useComboboxAnchor, useCopyToClipboard, useDirection, useHighlightedCode, useIsMobile, useMediaQuery, useMessageScroller, useMessageScrollerScrollable, useMessageScrollerVisibility, useSidebar, useSidebarOptional, useTheme };
|
|
118
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActionReceipt, ActivityFeed, Alert, AlertAction, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AppBrand, AppNav, AppShell, AppleIcon, ApprovalCard, ApprovalResult, AskBox, AspectRatio, AssistantAvatar, AssistantDock, AssistantProvider, Attachment, AttachmentAction, AttachmentActions, AttachmentContent, AttachmentDescription, AttachmentGroup, AttachmentMedia, AttachmentTitle, AttachmentTrigger, AuthLayout, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, BarList, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Bubble, BubbleContent, BubbleGroup, BubbleReactions, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Calendar, CalendarDayButton, Callout, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, ChatMessage, ChatPanel, ChatShell, ChatThread, CheckCircle, Checkbox, CodeBlock, CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockFooter, CodeBlockHeader, CodeBlockLine, CodeBlockTitle, CodeSnippet, Collapse, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxTrigger, ComboboxValue, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ConfirmDialog, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, ConversationList, CopyField, DataTable, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DictationButton, DirectionProvider, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, FocusLayout, GitHubIcon, GoogleIcon, Grid, Heading, HoverCard, HoverCardContent, HoverCardTrigger, InlineCode, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, Kbd, KbdGroup, KeyValueGrid, Label, LinkTile, LoginForm, Marker, MarkerContent, MarkerIcon, MediaItem, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Message, MessageActions, MessageAvatar, MessageContent, MessageFooter, MessageGroup, MessageHeader, MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, Metric, MetricGroup, ModelPicker, NativeSelect, NativeSelectOptGroup, NativeSelectOption, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, NewConversationButton, PageHeader, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, Progress, PromptInput, PromptInputChip, PromptInputSelect, Prose, Questionnaire, QuestionnaireActions, QuestionnaireChoice, QuestionnaireChoiceDescription, QuestionnaireChoices, QuestionnaireDescription, QuestionnaireError, QuestionnaireInput, QuestionnaireItem, QuestionnaireNext, QuestionnairePrevious, QuestionnaireProgress, QuestionnaireSkip, QuestionnaireSubmit, QuestionnaireTitle, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, Row, ScrollArea, ScrollBar, SearchInput, SectionedList, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SettingsRow, SettingsSection, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, ShowMore, Sidebar, SidebarCollapseButton, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarLayout, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SignupForm, Skeleton, Slider, Sparkline, Spinner, Stack, StatCard, StatusBadge, StatusBars, StatusDot, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TaskRow, Text, Textarea, ThemeProvider, ThemeScript, ThemeToggle, Timeline, Toaster, Toggle, ToggleGroup, ToggleGroupItem, ToolCall, ToolGroup, ToolStatusIcon, ToolStep, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Trace, TraceCollapsible, TraceCollapsibleContent, TraceCollapsibleTrigger, TraceDescription, TraceIcon, TraceLine, TraceTitle, TrendChart, TrendLegend, TypingIndicator, UsageMeter, UserChip, UserMenu, badgeVariants, browserSpeechSource, buttonGroupVariants, buttonVariants, cn, createDataTableColumnHelper, dataTableFeatures, formatWhen, groupByDate, highlightCode, initials, loadHighlighter, markerVariants, navigationMenuTriggerStyle, smoothPath, tabsListVariants, toastUndo, toggleVariants, useAssistant, useAssistantPage, useCarousel, useComboboxAnchor, useCopyToClipboard, useDictation, useDirection, useHighlightedCode, useIsMobile, useMediaQuery, useMessageScroller, useMessageScrollerScrollable, useMessageScrollerVisibility, useSidebar, useSidebarOptional, useTheme };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
// src/lib/toast-clearance.ts
|
|
4
|
+
const counts = /* @__PURE__ */ new Map();
|
|
5
|
+
function useToastClearance(name, value, enabled = true) {
|
|
6
|
+
React.useEffect(() => {
|
|
7
|
+
if (!enabled || typeof document === "undefined") return;
|
|
8
|
+
const root = document.documentElement;
|
|
9
|
+
counts.set(name, (counts.get(name) ?? 0) + 1);
|
|
10
|
+
root.style.setProperty(name, value);
|
|
11
|
+
return () => {
|
|
12
|
+
const left = (counts.get(name) ?? 1) - 1;
|
|
13
|
+
counts.set(name, left);
|
|
14
|
+
if (left === 0) root.style.removeProperty(name);
|
|
15
|
+
};
|
|
16
|
+
}, [
|
|
17
|
+
name,
|
|
18
|
+
value,
|
|
19
|
+
enabled
|
|
20
|
+
]);
|
|
21
|
+
}
|
|
22
|
+
export { useToastClearance };
|