@aacpc/components 0.0.0 → 0.1.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/LICENSE +21 -0
- package/README.md +21 -1
- package/dist/components/acp/agent-card.d.ts +26 -0
- package/dist/components/acp/agent-card.d.ts.map +1 -0
- package/dist/components/acp/agent-card.js +9 -0
- package/dist/components/acp/agent-card.js.map +1 -0
- package/dist/components/acp/agent-form.d.ts +19 -0
- package/dist/components/acp/agent-form.d.ts.map +1 -0
- package/dist/components/acp/agent-form.js +40 -0
- package/dist/components/acp/agent-form.js.map +1 -0
- package/dist/components/acp/chat-view.d.ts +11 -0
- package/dist/components/acp/chat-view.d.ts.map +1 -0
- package/dist/components/acp/chat-view.js +147 -0
- package/dist/components/acp/chat-view.js.map +1 -0
- package/dist/components/acp/composer.d.ts +11 -0
- package/dist/components/acp/composer.d.ts.map +1 -0
- package/dist/components/acp/composer.js +16 -0
- package/dist/components/acp/composer.js.map +1 -0
- package/dist/components/acp/cwd-picker.d.ts +18 -0
- package/dist/components/acp/cwd-picker.d.ts.map +1 -0
- package/dist/components/acp/cwd-picker.js +42 -0
- package/dist/components/acp/cwd-picker.js.map +1 -0
- package/dist/components/acp/elicitation.d.ts +27 -0
- package/dist/components/acp/elicitation.d.ts.map +1 -0
- package/dist/components/acp/elicitation.js +39 -0
- package/dist/components/acp/elicitation.js.map +1 -0
- package/dist/components/acp/index.d.ts +10 -0
- package/dist/components/acp/index.d.ts.map +1 -0
- package/dist/components/acp/index.js +10 -0
- package/dist/components/acp/index.js.map +1 -0
- package/dist/components/acp/markdown.d.ts +7 -0
- package/dist/components/acp/markdown.d.ts.map +1 -0
- package/dist/components/acp/markdown.js +10 -0
- package/dist/components/acp/markdown.js.map +1 -0
- package/dist/components/acp/session-config.d.ts +23 -0
- package/dist/components/acp/session-config.d.ts.map +1 -0
- package/dist/components/acp/session-config.js +14 -0
- package/dist/components/acp/session-config.js.map +1 -0
- package/dist/components/acp/types.d.ts +82 -0
- package/dist/components/acp/types.d.ts.map +1 -0
- package/dist/components/acp/types.js +2 -0
- package/dist/components/acp/types.js.map +1 -0
- package/dist/components/acp/use-typewriter.d.ts +10 -0
- package/dist/components/acp/use-typewriter.d.ts.map +1 -0
- package/dist/components/acp/use-typewriter.js +43 -0
- package/dist/components/acp/use-typewriter.js.map +1 -0
- package/dist/components/ui/alert-dialog.d.ts +23 -0
- package/dist/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/components/ui/alert-dialog.js +39 -0
- package/dist/components/ui/alert-dialog.js.map +1 -0
- package/dist/components/ui/alert.d.ts +11 -0
- package/dist/components/ui/alert.d.ts.map +1 -0
- package/dist/components/ui/alert.js +28 -0
- package/dist/components/ui/alert.js.map +1 -0
- package/dist/components/ui/attachment.d.ts +25 -0
- package/dist/components/ui/attachment.d.ts.map +1 -0
- package/dist/components/ui/attachment.js +67 -0
- package/dist/components/ui/attachment.js.map +1 -0
- package/dist/components/ui/avatar.d.ts +11 -0
- package/dist/components/ui/avatar.d.ts.map +1 -0
- package/dist/components/ui/avatar.js +25 -0
- package/dist/components/ui/avatar.js.map +1 -0
- package/dist/components/ui/badge.d.ts +9 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/badge.js +32 -0
- package/dist/components/ui/badge.js.map +1 -0
- package/dist/components/ui/bubble.d.ts +18 -0
- package/dist/components/ui/bubble.d.ts.map +1 -0
- package/dist/components/ui/bubble.js +58 -0
- package/dist/components/ui/bubble.js.map +1 -0
- package/dist/components/ui/button.d.ts +15 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.js +38 -0
- package/dist/components/ui/button.js.map +1 -0
- package/dist/components/ui/card.d.ts +12 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/card.js +25 -0
- package/dist/components/ui/card.js.map +1 -0
- package/dist/components/ui/checkbox.d.ts +4 -0
- package/dist/components/ui/checkbox.d.ts.map +1 -0
- package/dist/components/ui/checkbox.js +9 -0
- package/dist/components/ui/checkbox.js.map +1 -0
- package/dist/components/ui/code-block.d.ts +27 -0
- package/dist/components/ui/code-block.d.ts.map +1 -0
- package/dist/components/ui/code-block.js +80 -0
- package/dist/components/ui/code-block.js.map +1 -0
- package/dist/components/ui/collapsible.d.ts +6 -0
- package/dist/components/ui/collapsible.d.ts.map +1 -0
- package/dist/components/ui/collapsible.js +14 -0
- package/dist/components/ui/collapsible.js.map +1 -0
- package/dist/components/ui/command.d.ts +28 -0
- package/dist/components/ui/command.d.ts.map +1 -0
- package/dist/components/ui/command.js +36 -0
- package/dist/components/ui/command.js.map +1 -0
- package/dist/components/ui/dialog.d.ts +22 -0
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/dialog.js +32 -0
- package/dist/components/ui/dialog.js.map +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +27 -0
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu.js +49 -0
- package/dist/components/ui/dropdown-menu.js.map +1 -0
- package/dist/components/ui/empty.d.ts +12 -0
- package/dist/components/ui/empty.d.ts.map +1 -0
- package/dist/components/ui/empty.js +34 -0
- package/dist/components/ui/empty.js.map +1 -0
- package/dist/components/ui/field.d.ts +25 -0
- package/dist/components/ui/field.d.ts.map +1 -0
- package/dist/components/ui/field.js +68 -0
- package/dist/components/ui/field.js.map +1 -0
- package/dist/components/ui/input-group.d.ts +20 -0
- package/dist/components/ui/input-group.d.ts.map +1 -0
- package/dist/components/ui/input-group.js +59 -0
- package/dist/components/ui/input-group.js.map +1 -0
- package/dist/components/ui/input.d.ts +5 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/input.js +9 -0
- package/dist/components/ui/input.js.map +1 -0
- package/dist/components/ui/item.d.ts +23 -0
- package/dist/components/ui/item.d.ts.map +1 -0
- package/dist/components/ui/item.js +69 -0
- package/dist/components/ui/item.js.map +1 -0
- package/dist/components/ui/kbd.d.ts +4 -0
- package/dist/components/ui/kbd.d.ts.map +1 -0
- package/dist/components/ui/kbd.js +11 -0
- package/dist/components/ui/kbd.js.map +1 -0
- package/dist/components/ui/label.d.ts +5 -0
- package/dist/components/ui/label.d.ts.map +1 -0
- package/dist/components/ui/label.js +13 -0
- package/dist/components/ui/label.js.map +1 -0
- package/dist/components/ui/marker.d.ts +12 -0
- package/dist/components/ui/marker.d.ts.map +1 -0
- package/dist/components/ui/marker.js +33 -0
- package/dist/components/ui/marker.js.map +1 -0
- package/dist/components/ui/message-scroller.d.ts +11 -0
- package/dist/components/ui/message-scroller.d.ts.map +1 -0
- package/dist/components/ui/message-scroller.js +25 -0
- package/dist/components/ui/message-scroller.js.map +1 -0
- package/dist/components/ui/message.d.ts +11 -0
- package/dist/components/ui/message.d.ts.map +1 -0
- package/dist/components/ui/message.js +22 -0
- package/dist/components/ui/message.js.map +1 -0
- package/dist/components/ui/popover.d.ts +11 -0
- package/dist/components/ui/popover.d.ts.map +1 -0
- package/dist/components/ui/popover.js +20 -0
- package/dist/components/ui/popover.js.map +1 -0
- package/dist/components/ui/progress.d.ts +14 -0
- package/dist/components/ui/progress.d.ts.map +1 -0
- package/dist/components/ui/progress.js +38 -0
- package/dist/components/ui/progress.js.map +1 -0
- package/dist/components/ui/scroll-area.d.ts +4 -0
- package/dist/components/ui/scroll-area.d.ts.map +1 -0
- package/dist/components/ui/scroll-area.js +8 -0
- package/dist/components/ui/scroll-area.js.map +1 -0
- package/dist/components/ui/select.d.ts +25 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/components/ui/select.js +46 -0
- package/dist/components/ui/select.js.map +1 -0
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/ui/separator.js +9 -0
- package/dist/components/ui/separator.js.map +1 -0
- package/dist/components/ui/sheet.d.ts +21 -0
- package/dist/components/ui/sheet.d.ts.map +1 -0
- package/dist/components/ui/sheet.js +35 -0
- package/dist/components/ui/sheet.js.map +1 -0
- package/dist/components/ui/skeleton.d.ts +3 -0
- package/dist/components/ui/skeleton.d.ts.map +1 -0
- package/dist/components/ui/skeleton.js +7 -0
- package/dist/components/ui/skeleton.js.map +1 -0
- package/dist/components/ui/sonner.d.ts +4 -0
- package/dist/components/ui/sonner.d.ts.map +1 -0
- package/dist/components/ui/sonner.js +26 -0
- package/dist/components/ui/sonner.js.map +1 -0
- package/dist/components/ui/spinner.d.ts +3 -0
- package/dist/components/ui/spinner.d.ts.map +1 -0
- package/dist/components/ui/spinner.js +8 -0
- package/dist/components/ui/spinner.js.map +1 -0
- package/dist/components/ui/switch.d.ts +6 -0
- package/dist/components/ui/switch.d.ts.map +1 -0
- package/dist/components/ui/switch.js +9 -0
- package/dist/components/ui/switch.js.map +1 -0
- package/dist/components/ui/table.d.ts +12 -0
- package/dist/components/ui/table.d.ts.map +1 -0
- package/dist/components/ui/table.js +29 -0
- package/dist/components/ui/table.js.map +1 -0
- package/dist/components/ui/tabs.d.ts +12 -0
- package/dist/components/ui/tabs.d.ts.map +1 -0
- package/dist/components/ui/tabs.js +29 -0
- package/dist/components/ui/tabs.js.map +1 -0
- package/dist/components/ui/textarea.d.ts +5 -0
- package/dist/components/ui/textarea.d.ts.map +1 -0
- package/dist/components/ui/textarea.js +8 -0
- package/dist/components/ui/textarea.js.map +1 -0
- package/dist/components/ui/toggle-group.d.ts +12 -0
- package/dist/components/ui/toggle-group.d.ts.map +1 -0
- package/dist/components/ui/toggle-group.js +24 -0
- package/dist/components/ui/toggle-group.js.map +1 -0
- package/dist/components/ui/toggle.d.ts +9 -0
- package/dist/components/ui/toggle.d.ts.map +1 -0
- package/dist/components/ui/toggle.js +26 -0
- package/dist/components/ui/toggle.js.map +1 -0
- package/dist/components/ui/tooltip.d.ts +9 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/components/ui/tooltip.js +25 -0
- package/dist/components/ui/tooltip.js.map +1 -0
- package/dist/components/ui/trace.d.ts +28 -0
- package/dist/components/ui/trace.d.ts.map +1 -0
- package/dist/components/ui/trace.js +31 -0
- package/dist/components/ui/trace.js.map +1 -0
- package/dist/hooks/use-highlighted-code.d.ts +3 -0
- package/dist/hooks/use-highlighted-code.d.ts.map +1 -0
- package/dist/hooks/use-highlighted-code.js +50 -0
- package/dist/hooks/use-highlighted-code.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/highlighter.d.ts +10 -0
- package/dist/lib/highlighter.d.ts.map +1 -0
- package/dist/lib/highlighter.js +91 -0
- package/dist/lib/highlighter.js.map +1 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +2 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/styles.css +161 -0
- package/package.json +81 -3
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from "./types.js";
|
|
2
|
+
export * from "./markdown.js";
|
|
3
|
+
export * from "./chat-view.js";
|
|
4
|
+
export * from "./composer.js";
|
|
5
|
+
export * from "./agent-card.js";
|
|
6
|
+
export * from "./agent-form.js";
|
|
7
|
+
export * from "./cwd-picker.js";
|
|
8
|
+
export * from "./session-config.js";
|
|
9
|
+
export * from "./elicitation.js";
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/acp/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAAA,cAAc,kBAAkB,CAAC;AAAA,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../../src/components/acp/markdown.tsx"],"names":[],"mappings":"AAKA,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,SAAiB,EACjB,OAAe,EACf,SAAS,GACV,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BAcA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Streamdown } from "streamdown";
|
|
3
|
+
import { cn } from "../../lib/utils.js";
|
|
4
|
+
import { useTypewriter } from "./use-typewriter.js";
|
|
5
|
+
export function AcpMarkdown({ children, streaming = false, animate = false, className, }) {
|
|
6
|
+
const { text, typing } = useTypewriter(children, animate);
|
|
7
|
+
const active = streaming || typing;
|
|
8
|
+
return (_jsx(Streamdown, { mode: active ? "streaming" : "static", caret: typing ? "block" : undefined, isAnimating: active, className: cn("min-w-0 text-sm leading-relaxed", className), children: text }));
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=markdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.js","sourceRoot":"","sources":["../../../src/components/acp/markdown.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,UAAU,WAAW,CAAC,EAC1B,QAAQ,EACR,SAAS,GAAG,KAAK,EACjB,OAAO,GAAG,KAAK,EACf,SAAS,GAMV;IACC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC1D,MAAM,MAAM,GAAG,SAAS,IAAI,MAAM,CAAC;IAEnC,OAAO,CACL,KAAC,UAAU,IACT,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,EACrC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EACnC,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,EAAE,CAAC,iCAAiC,EAAE,SAAS,CAAC,YAE1D,IAAI,GACM,CACd,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface SessionConfigChoiceView {
|
|
2
|
+
value: string;
|
|
3
|
+
name: string;
|
|
4
|
+
}
|
|
5
|
+
export interface SessionConfigOptionView {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
description?: string | null;
|
|
9
|
+
type: "select" | "boolean";
|
|
10
|
+
currentValue: string | boolean;
|
|
11
|
+
options?: SessionConfigChoiceView[] | {
|
|
12
|
+
group: string;
|
|
13
|
+
name: string;
|
|
14
|
+
options: SessionConfigChoiceView[];
|
|
15
|
+
}[];
|
|
16
|
+
}
|
|
17
|
+
export interface AcpSessionConfigProps {
|
|
18
|
+
options: SessionConfigOptionView[] | undefined;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
onChange: (configId: string, value: string | boolean) => void;
|
|
21
|
+
}
|
|
22
|
+
export declare function AcpSessionConfig({ options, disabled, onChange, }: AcpSessionConfigProps): import("react").JSX.Element | null;
|
|
23
|
+
//# sourceMappingURL=session-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-config.d.ts","sourceRoot":"","sources":["../../../src/components/acp/session-config.tsx"],"names":[],"mappings":"AAQA,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,IAAI,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC3B,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC;IAC/B,OAAO,CAAC,EACJ,uBAAuB,EAAE,GACzB;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,uBAAuB,EAAE,CAAA;KAAE,EAAE,CAAC;CAC3E;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,uBAAuB,EAAE,GAAG,SAAS,CAAC;IAC/C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,KAAK,IAAI,CAAC;CAC/D;AAWD,wBAAgB,gBAAgB,CAAC,EAC/B,OAAO,EACP,QAAgB,EAChB,QAAQ,GACT,EAAE,qBAAqB,sCAiCvB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "../ui/select.js";
|
|
3
|
+
function flatten(options) {
|
|
4
|
+
if (!options)
|
|
5
|
+
return [];
|
|
6
|
+
return options.flatMap((option) => "group" in option ? option.options : [option]);
|
|
7
|
+
}
|
|
8
|
+
export function AcpSessionConfig({ options, disabled = false, onChange, }) {
|
|
9
|
+
const selects = (options ?? []).filter((option) => option.type === "select" && flatten(option.options).length > 0);
|
|
10
|
+
if (selects.length === 0)
|
|
11
|
+
return null;
|
|
12
|
+
return (_jsx("div", { className: "flex flex-wrap items-center gap-1.5", children: selects.map((option) => (_jsxs(Select, { selectedKey: String(option.currentValue), onSelectionChange: (key) => onChange(option.id, String(key)), isDisabled: disabled, children: [_jsx(SelectTrigger, { size: "sm", className: "w-auto min-w-36 max-w-56", "aria-label": option.name, children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: flatten(option.options).map((choice) => (_jsx(SelectItem, { id: choice.value, children: choice.name }, choice.value))) })] }, option.id))) }));
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=session-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-config.js","sourceRoot":"","sources":["../../../src/components/acp/session-config.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,MAAM,EACN,aAAa,EACb,UAAU,EACV,aAAa,EACb,WAAW,GACZ,MAAM,cAAc,CAAC;AAwBtB,SAAS,OAAO,CACd,OAA2C;IAE3C,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,CAAC;IACxB,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAChC,OAAO,IAAI,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAiC,CAAC,CACzE,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,EAC/B,OAAO,EACP,QAAQ,GAAG,KAAK,EAChB,QAAQ,GACc;IACtB,MAAM,OAAO,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,MAAM,CACpC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,CAC3E,CAAC;IACF,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAEtC,OAAO,CACL,cAAK,SAAS,EAAC,qCAAqC,YACjD,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CACvB,MAAC,MAAM,IAEL,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,EACxC,iBAAiB,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,EAC5D,UAAU,EAAE,QAAQ,aAEpB,KAAC,aAAa,IACZ,IAAI,EAAC,IAAI,EACT,SAAS,EAAC,0BAA0B,gBACxB,MAAM,CAAC,IAAI,YAEvB,KAAC,WAAW,KAAG,GACD,EAChB,KAAC,aAAa,cACX,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CACvC,KAAC,UAAU,IAAoB,EAAE,EAAE,MAAM,CAAC,KAAK,YAC5C,MAAM,CAAC,IAAI,IADG,MAAM,CAAC,KAAK,CAEhB,CACd,CAAC,GACY,KAlBX,MAAM,CAAC,EAAE,CAmBP,CACV,CAAC,GACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export interface ToolContent {
|
|
2
|
+
type: string;
|
|
3
|
+
[key: string]: unknown;
|
|
4
|
+
}
|
|
5
|
+
export interface ToolCallView {
|
|
6
|
+
toolCallId: string;
|
|
7
|
+
title: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
kind: string;
|
|
10
|
+
status: "pending" | "in_progress" | "completed" | "failed";
|
|
11
|
+
content: unknown[];
|
|
12
|
+
locations?: {
|
|
13
|
+
path: string;
|
|
14
|
+
line?: number | null;
|
|
15
|
+
}[];
|
|
16
|
+
rawInput?: unknown;
|
|
17
|
+
rawOutput?: unknown;
|
|
18
|
+
}
|
|
19
|
+
export interface PlanEntryView {
|
|
20
|
+
content: string;
|
|
21
|
+
priority: string;
|
|
22
|
+
status: string;
|
|
23
|
+
}
|
|
24
|
+
type TimelineItemBase = {
|
|
25
|
+
kind: "user";
|
|
26
|
+
id: string;
|
|
27
|
+
text: string;
|
|
28
|
+
} | {
|
|
29
|
+
kind: "agent";
|
|
30
|
+
id: string;
|
|
31
|
+
text: string;
|
|
32
|
+
streaming: boolean;
|
|
33
|
+
} | {
|
|
34
|
+
kind: "thought";
|
|
35
|
+
id: string;
|
|
36
|
+
text: string;
|
|
37
|
+
streaming: boolean;
|
|
38
|
+
} | {
|
|
39
|
+
kind: "tool";
|
|
40
|
+
id: string;
|
|
41
|
+
tool: ToolCallView;
|
|
42
|
+
} | {
|
|
43
|
+
kind: "plan";
|
|
44
|
+
id: string;
|
|
45
|
+
planId: string;
|
|
46
|
+
entries: PlanEntryView[];
|
|
47
|
+
} | {
|
|
48
|
+
kind: "planMarkdown";
|
|
49
|
+
id: string;
|
|
50
|
+
planId: string;
|
|
51
|
+
text: string;
|
|
52
|
+
} | {
|
|
53
|
+
kind: "notice";
|
|
54
|
+
id: string;
|
|
55
|
+
message: string;
|
|
56
|
+
severity?: string;
|
|
57
|
+
} | {
|
|
58
|
+
kind: "error";
|
|
59
|
+
id: string;
|
|
60
|
+
message: string;
|
|
61
|
+
detail?: string;
|
|
62
|
+
};
|
|
63
|
+
export interface PermissionOptionView {
|
|
64
|
+
optionId: string;
|
|
65
|
+
name: string;
|
|
66
|
+
kind: string;
|
|
67
|
+
}
|
|
68
|
+
export interface PendingPermissionView {
|
|
69
|
+
id: string;
|
|
70
|
+
sessionId: string;
|
|
71
|
+
toolCall: {
|
|
72
|
+
title?: string | null;
|
|
73
|
+
kind?: string | null;
|
|
74
|
+
};
|
|
75
|
+
options: PermissionOptionView[];
|
|
76
|
+
createdAt: string;
|
|
77
|
+
}
|
|
78
|
+
export type TimelineItem = TimelineItemBase & {
|
|
79
|
+
live?: boolean;
|
|
80
|
+
};
|
|
81
|
+
export {};
|
|
82
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/acp/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,YAAY;IA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AAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAClE;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAClE;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AACpE,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;IAC1D,OAAO,EAAE,oBAAoB,EAAE,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;CACnB;AACD,MAAM,MAAM,YAAY,GAAG,gBAAgB,GAAG;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/acp/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reveals text at a readable pace even when the agent delivers a long answer
|
|
3
|
+
* in a single chunk. The interval keeps running while the message is live, so
|
|
4
|
+
* appended chunks continue from the current cursor instead of restarting.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useTypewriter(text: string, animate: boolean): {
|
|
7
|
+
text: string;
|
|
8
|
+
typing: boolean;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=use-typewriter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-typewriter.d.ts","sourceRoot":"","sources":["../../../src/components/acp/use-typewriter.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO;IAkCxD,IAAI;IACJ,MAAM;EAET"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Reveals text at a readable pace even when the agent delivers a long answer
|
|
4
|
+
* in a single chunk. The interval keeps running while the message is live, so
|
|
5
|
+
* appended chunks continue from the current cursor instead of restarting.
|
|
6
|
+
*/
|
|
7
|
+
export function useTypewriter(text, animate) {
|
|
8
|
+
const [visible, setVisible] = useState(() => (animate ? 0 : text.length));
|
|
9
|
+
const visibleRef = useRef(visible);
|
|
10
|
+
const textRef = useRef(text);
|
|
11
|
+
textRef.current = text;
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
if (!animate) {
|
|
14
|
+
visibleRef.current = text.length;
|
|
15
|
+
setVisible(text.length);
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
if (visibleRef.current > text.length) {
|
|
19
|
+
visibleRef.current = text.length;
|
|
20
|
+
setVisible(text.length);
|
|
21
|
+
}
|
|
22
|
+
}, [animate, text]);
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
if (!animate)
|
|
25
|
+
return;
|
|
26
|
+
const timer = setInterval(() => {
|
|
27
|
+
const target = textRef.current.length;
|
|
28
|
+
if (visibleRef.current >= target)
|
|
29
|
+
return;
|
|
30
|
+
// Finish a long answer in roughly 3 seconds at 32ms per tick (90 ticks).
|
|
31
|
+
const step = Math.max(1, Math.ceil(target / 90));
|
|
32
|
+
const next = Math.min(target, visibleRef.current + step);
|
|
33
|
+
visibleRef.current = next;
|
|
34
|
+
setVisible(next);
|
|
35
|
+
}, 32);
|
|
36
|
+
return () => clearInterval(timer);
|
|
37
|
+
}, [animate]);
|
|
38
|
+
return {
|
|
39
|
+
text: text.slice(0, visible),
|
|
40
|
+
typing: visible < text.length,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=use-typewriter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-typewriter.js","sourceRoot":"","sources":["../../../src/components/acp/use-typewriter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEpD;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,IAAY,EAAE,OAAgB;IAC1D,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC1E,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IACnC,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IAE7B,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAEvB,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,UAAU,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC;YACjC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACxB,OAAO;QACT,CAAC;QACD,IAAI,UAAU,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;YACrC,UAAU,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC;YACjC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;IAEpB,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,OAAO;YAAE,OAAO;QACrB,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE;YAC7B,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC;YACtC,IAAI,UAAU,CAAC,OAAO,IAAI,MAAM;gBAAE,OAAO;YACzC,yEAAyE;YACzE,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC;YACjD,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;YACzD,UAAU,CAAC,OAAO,GAAG,IAAI,CAAC;YAC1B,UAAU,CAAC,IAAI,CAAC,CAAC;QACnB,CAAC,EAAE,EAAE,CAAC,CAAC;QACP,OAAO,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,OAAO;QACL,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC;QAC5B,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC,MAAM;KAC9B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Heading, Modal as ModalPrimitive, type DialogTriggerProps as AlertDialogTriggerPrimitiveProps, type ModalOverlayProps as ModalOverlayPrimitiveProps } from "react-aria-components";
|
|
3
|
+
import { Button } from "@aacpc/components/components/ui/button";
|
|
4
|
+
declare function AlertDialogTrigger({ ...props }: AlertDialogTriggerPrimitiveProps): React.JSX.Element;
|
|
5
|
+
declare function AlertDialogOverlay({ className, children, ...props }: Omit<ModalOverlayPrimitiveProps, "className" | "children"> & {
|
|
6
|
+
className?: string;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
}): React.JSX.Element;
|
|
9
|
+
declare function AlertDialog({ className, size, children, ...props }: Omit<ModalOverlayPrimitiveProps, "className" | "children"> & Pick<React.ComponentProps<typeof ModalPrimitive>, "isDismissable"> & {
|
|
10
|
+
className?: string;
|
|
11
|
+
size?: "default" | "sm";
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
}): React.JSX.Element;
|
|
14
|
+
declare function AlertDialogContent({ className, size, children, ...props }: React.ComponentProps<typeof AlertDialog>): React.JSX.Element;
|
|
15
|
+
declare function AlertDialogHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
16
|
+
declare function AlertDialogFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
17
|
+
declare function AlertDialogMedia({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
18
|
+
declare function AlertDialogTitle({ className, ...props }: Omit<React.ComponentProps<typeof Heading>, "slot">): React.JSX.Element;
|
|
19
|
+
declare function AlertDialogDescription({ className, ...props }: Omit<React.ComponentProps<"div">, "slot">): React.JSX.Element;
|
|
20
|
+
declare function AlertDialogAction({ className, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
|
|
21
|
+
declare function AlertDialogCancel({ className, variant, size, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
|
|
22
|
+
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogTitle, AlertDialogTrigger, };
|
|
23
|
+
//# sourceMappingURL=alert-dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-dialog.d.ts","sourceRoot":"","sources":["../../../src/components/ui/alert-dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAGL,OAAO,EAEP,KAAK,IAAI,cAAc,EAEvB,KAAK,kBAAkB,IAAI,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K,CAAC,cAAc,CAAC,KAAK,CAAC,qBAW7B;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,OAAO,CAAC,EAAE,MAAM,CAAC,qBAYpD;AAED,iBAAS,sBAAsB,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,qBAW3C;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,qBASrC;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,OAAmB,EACnB,IAAgB,EAChB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,qBAWrC;AAED,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,GACnB,CAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "cn";
|
|
3
|
+
import { Dialog as AlertDialogPrimitive, DialogTrigger as AlertDialogTriggerPrimitive, Heading, ModalOverlay as ModalOverlayPrimitive, Modal as ModalPrimitive, } from "react-aria-components";
|
|
4
|
+
import { Button } from "@aacpc/components/components/ui/button";
|
|
5
|
+
function AlertDialogTrigger({ ...props }) {
|
|
6
|
+
return (_jsx(AlertDialogTriggerPrimitive, { "data-slot": "alert-dialog-trigger", ...props }));
|
|
7
|
+
}
|
|
8
|
+
function AlertDialogOverlay({ className, children, ...props }) {
|
|
9
|
+
return (_jsx(ModalOverlayPrimitive, { "data-slot": "alert-dialog-overlay", className: cn("fixed inset-0 isolate z-50 bg-black/80 duration-100 data-entering:animate-in data-entering:fade-in-0 data-exiting:animate-out data-exiting:fade-out-0 supports-backdrop-filter:backdrop-blur-xs", className), ...props, children: children }));
|
|
10
|
+
}
|
|
11
|
+
function AlertDialog({ className, size = "default", children, ...props }) {
|
|
12
|
+
return (_jsx(AlertDialogOverlay, { ...props, children: _jsx(ModalPrimitive, { "data-slot": "alert-dialog-content", "data-size": size, className: cn("group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-6 rounded-4xl bg-popover p-6 text-popover-foreground ring-1 ring-foreground/5 duration-100 outline-none data-entering:animate-in data-entering:fade-in-0 data-entering:zoom-in-95 data-exiting:animate-out data-exiting:fade-out-0 data-exiting:zoom-out-95 data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-md", className), children: _jsx(AlertDialogPrimitive, { "data-slot": "alert-dialog", role: "alertdialog", className: "[display:inherit] [gap:inherit] outline-none", children: children }) }) }));
|
|
13
|
+
}
|
|
14
|
+
function AlertDialogContent({ className, size = "default", children, ...props }) {
|
|
15
|
+
return (_jsx(AlertDialog, { className: className, size: size, ...props, children: children }));
|
|
16
|
+
}
|
|
17
|
+
function AlertDialogHeader({ className, ...props }) {
|
|
18
|
+
return (_jsx("div", { "data-slot": "alert-dialog-header", className: cn("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]", className), ...props }));
|
|
19
|
+
}
|
|
20
|
+
function AlertDialogFooter({ className, ...props }) {
|
|
21
|
+
return (_jsx("div", { "data-slot": "alert-dialog-footer", className: cn("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end", className), ...props }));
|
|
22
|
+
}
|
|
23
|
+
function AlertDialogMedia({ className, ...props }) {
|
|
24
|
+
return (_jsx("div", { "data-slot": "alert-dialog-media", className: cn("mb-2 inline-flex size-16 items-center justify-center rounded-full bg-muted sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-8", className), ...props }));
|
|
25
|
+
}
|
|
26
|
+
function AlertDialogTitle({ className, ...props }) {
|
|
27
|
+
return (_jsx(Heading, { slot: "title", "data-slot": "alert-dialog-title", className: cn("font-heading text-lg font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2", className), ...props }));
|
|
28
|
+
}
|
|
29
|
+
function AlertDialogDescription({ className, ...props }) {
|
|
30
|
+
return (_jsx("div", { "data-slot": "alert-dialog-description", className: cn("text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground", className), ...props }));
|
|
31
|
+
}
|
|
32
|
+
function AlertDialogAction({ className, ...props }) {
|
|
33
|
+
return (_jsx(Button, { slot: "close", "data-slot": "alert-dialog-action", className: cn(className), ...props }));
|
|
34
|
+
}
|
|
35
|
+
function AlertDialogCancel({ className, variant = "outline", size = "default", ...props }) {
|
|
36
|
+
return (_jsx(Button, { slot: "close", "data-slot": "alert-dialog-cancel", className: cn(className), variant: variant, size: size, ...props }));
|
|
37
|
+
}
|
|
38
|
+
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogTitle, AlertDialogTrigger, };
|
|
39
|
+
//# sourceMappingURL=alert-dialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-dialog.js","sourceRoot":"","sources":["../../../src/components/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AO,GAAG,SAAS,EACnB,IAAI,GAAG,SAAS,EAChB,GAAG,KAAK,EAC4B;IACpC,OAAO,CACL,KAAC,MAAM,IACL,IAAI,EAAC,OAAO,eACF,qBAAqB,EAC/B,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,EACxB,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,KACN,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,GACnB,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const alertVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "destructive" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
declare function Alert({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>): React.JSX.Element;
|
|
7
|
+
declare function AlertTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
8
|
+
declare function AlertDescription({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
9
|
+
declare function AlertAction({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
10
|
+
export { Alert, AlertTitle, AlertDescription, AlertAction };
|
|
11
|
+
//# sourceMappingURL=alert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../src/components/ui/alert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAGjE,QAAA,MAAM,aAAa;;8EAclB,CAAA;AAED,iBAAS,KAAK,CAAC,EACb,SAAS,EACT,OAAO,EACP,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,qBASlE;AAED,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAWvE;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAW7B;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAQxE;AAED,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { cn } from "cn";
|
|
4
|
+
const alertVariants = cva("group/alert relative grid w-full gap-0.5 rounded-lg border px-4 py-3 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2.5 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4", {
|
|
5
|
+
variants: {
|
|
6
|
+
variant: {
|
|
7
|
+
default: "bg-card text-card-foreground",
|
|
8
|
+
destructive: "bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current",
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
defaultVariants: {
|
|
12
|
+
variant: "default",
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
function Alert({ className, variant, ...props }) {
|
|
16
|
+
return (_jsx("div", { "data-slot": "alert", role: "alert", className: cn(alertVariants({ variant }), className), ...props }));
|
|
17
|
+
}
|
|
18
|
+
function AlertTitle({ className, ...props }) {
|
|
19
|
+
return (_jsx("div", { "data-slot": "alert-title", className: cn("font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground", className), ...props }));
|
|
20
|
+
}
|
|
21
|
+
function AlertDescription({ className, ...props }) {
|
|
22
|
+
return (_jsx("div", { "data-slot": "alert-description", className: cn("text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4", className), ...props }));
|
|
23
|
+
}
|
|
24
|
+
function AlertAction({ className, ...props }) {
|
|
25
|
+
return (_jsx("div", { "data-slot": "alert-action", className: cn("absolute top-2.5 right-3", className), ...props }));
|
|
26
|
+
}
|
|
27
|
+
export { Alert, AlertTitle, AlertDescription, AlertAction };
|
|
28
|
+
//# sourceMappingURL=alert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert.js","sourceRoot":"","sources":["../../../src/components/ui/alert.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,EAAE,EAAE,MAAM,IAAI,CAAA;AAEvB,MAAM,aAAa,GAAG,GAAG,CACvB,2TAA2T,EAC3T;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,8BAA8B;YACvC,WAAW,EACT,mGAAmG;SACtG;KACF;IACD,eAAe,EAAE;QACf,OAAO,EAAE,SAAS;KACnB;CACF,CACF,CAAA;AAED,SAAS,KAAK,CAAC,EACb,SAAS,EACT,OAAO,EACP,GAAG,KAAK,EACyD;IACjE,OAAO,CACL,2BACY,OAAO,EACjB,IAAI,EAAC,OAAO,EACZ,SAAS,EAAE,EAAE,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,CAAC,KAChD,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,SAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA+B;IACtE,OAAO,CACL,2BACY,aAAa,EACvB,SAAS,EAAE,EAAE,CACX,qHAAqH,EACrH,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,SAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACoB;IAC5B,OAAO,CACL,2BACY,mBAAmB,EAC7B,SAAS,EAAE,EAAE,CACX,4JAA4J,EAC5J,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,SAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA+B;IACvE,OAAO,CACL,2BACY,cAAc,EACxB,SAAS,EAAE,EAAE,CAAC,0BAA0B,EAAE,SAAS,CAAC,KAChD,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
import { Button } from "@aacpc/components/components/ui/button";
|
|
4
|
+
declare const attachmentVariants: (props?: ({
|
|
5
|
+
size?: "default" | "sm" | "xs" | null | undefined;
|
|
6
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
declare function Attachment({ className, state, size, orientation, ...props }: React.ComponentProps<"div"> & VariantProps<typeof attachmentVariants> & {
|
|
9
|
+
state?: "idle" | "uploading" | "processing" | "error" | "done";
|
|
10
|
+
}): React.JSX.Element;
|
|
11
|
+
declare const attachmentMediaVariants: (props?: ({
|
|
12
|
+
variant?: "icon" | "image" | null | undefined;
|
|
13
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
14
|
+
declare function AttachmentMedia({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof attachmentMediaVariants>): React.JSX.Element;
|
|
15
|
+
declare function AttachmentContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
16
|
+
declare function AttachmentTitle({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
17
|
+
declare function AttachmentDescription({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
18
|
+
declare function AttachmentActions({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
19
|
+
declare function AttachmentAction({ className, variant, size, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
|
|
20
|
+
declare function AttachmentTrigger({ className, render, type, children, ...props }: React.ComponentProps<"button"> & {
|
|
21
|
+
render?: (props: React.HTMLAttributes<HTMLElement>) => React.ReactNode;
|
|
22
|
+
}): string | number | bigint | boolean | React.JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | Iterable<React.ReactNode> | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | React.ReactPortal | null | undefined> | null | undefined;
|
|
23
|
+
declare function AttachmentGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
24
|
+
export { Attachment, AttachmentGroup, AttachmentMedia, AttachmentContent, AttachmentTitle, AttachmentDescription, AttachmentActions, AttachmentAction, AttachmentTrigger, };
|
|
25
|
+
//# sourceMappingURL=attachment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachment.d.ts","sourceRoot":"","sources":["../../../src/components/ui/attachment.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAGjE,OAAO,EAAE,MAAM,EAAE,MAAM,wCAAwC,CAAA;AAE/D,QAAA,MAAM,kBAAkB;;;8EAgBvB,CAAA;AAED,iBAAS,UAAU,CAAC,EA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CAAC,cAAc,CAAC,WAAW,CAAC,KAAK,KAAK,CAAC,SAAS,CAAA;CACvE,mSAsBA;AAED,iBAAS,eAAe,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAW5E;AAED,OAAO,EACL,UAAU,EACV,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,GAClB,CAAA"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { cn } from "cn";
|
|
4
|
+
import { Button } from "@aacpc/components/components/ui/button";
|
|
5
|
+
const attachmentVariants = cva("group/attachment relative flex w-fit max-w-full min-w-0 shrink-0 flex-wrap rounded-2xl border bg-card text-card-foreground transition-colors focus-within:ring-1 focus-within:ring-ring/50 has-[>a,>button]:hover:bg-muted/50 data-[state=error]:border-destructive/30 data-[state=idle]:border-dashed", {
|
|
6
|
+
variants: {
|
|
7
|
+
size: {
|
|
8
|
+
default: "gap-2 text-sm has-data-[slot=attachment-content]:px-2.5 has-data-[slot=attachment-content]:py-2 has-data-[slot=attachment-media]:p-2",
|
|
9
|
+
sm: "gap-2.5 text-xs has-data-[slot=attachment-content]:px-2 has-data-[slot=attachment-content]:py-1.5 has-data-[slot=attachment-media]:p-1.5",
|
|
10
|
+
xs: "gap-1.5 rounded-xl text-xs has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1",
|
|
11
|
+
},
|
|
12
|
+
orientation: {
|
|
13
|
+
horizontal: "min-w-40 items-center",
|
|
14
|
+
vertical: "w-24 flex-col has-data-[slot=attachment-content]:w-30",
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
function Attachment({ className, state = "done", size = "default", orientation = "horizontal", ...props }) {
|
|
19
|
+
const resolvedOrientation = orientation ?? "horizontal";
|
|
20
|
+
return (_jsx("div", { "data-slot": "attachment", "data-state": state, "data-size": size, "data-orientation": resolvedOrientation, className: cn(attachmentVariants({ size, orientation }), className), ...props }));
|
|
21
|
+
}
|
|
22
|
+
const attachmentMediaVariants = cva("relative flex aspect-square w-10 shrink-0 items-center justify-center overflow-hidden rounded-xl bg-muted text-foreground group-data-[orientation=vertical]/attachment:w-full group-data-[size=sm]/attachment:w-8 group-data-[size=xs]/attachment:w-7 group-data-[size=xs]/attachment:rounded-lg group-data-[state=error]/attachment:bg-destructive/10 group-data-[state=error]/attachment:text-destructive group-data-[orientation=vertical]/attachment:*:data-[slot=spinner]:size-6! [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 group-data-[orientation=vertical]/attachment:[&_svg:not([class*='size-'])]:size-6 group-data-[size=xs]/attachment:[&_svg:not([class*='size-'])]:size-3.5", {
|
|
23
|
+
variants: {
|
|
24
|
+
variant: {
|
|
25
|
+
icon: "",
|
|
26
|
+
image: "opacity-60 group-data-[state=done]/attachment:opacity-100 group-data-[state=idle]/attachment:opacity-100 *:[img]:aspect-square *:[img]:w-full *:[img]:object-cover",
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
defaultVariants: {
|
|
30
|
+
variant: "icon",
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
function AttachmentMedia({ className, variant = "icon", ...props }) {
|
|
34
|
+
return (_jsx("div", { "data-slot": "attachment-media", "data-variant": variant, className: cn(attachmentMediaVariants({ variant }), className), ...props }));
|
|
35
|
+
}
|
|
36
|
+
function AttachmentContent({ className, ...props }) {
|
|
37
|
+
return (_jsx("div", { "data-slot": "attachment-content", className: cn("max-w-full min-w-0 flex-1 leading-tight group-data-[orientation=vertical]/attachment:px-1", className), ...props }));
|
|
38
|
+
}
|
|
39
|
+
function AttachmentTitle({ className, ...props }) {
|
|
40
|
+
return (_jsx("span", { "data-slot": "attachment-title", className: cn("block max-w-full min-w-0 truncate font-medium group-data-[state=processing]/attachment:shimmer group-data-[state=uploading]/attachment:shimmer", className), ...props }));
|
|
41
|
+
}
|
|
42
|
+
function AttachmentDescription({ className, ...props }) {
|
|
43
|
+
return (_jsx("span", { "data-slot": "attachment-description", className: cn("mt-0.5 block min-w-0 truncate text-xs text-muted-foreground group-data-[state=error]/attachment:text-destructive/80", "max-w-full", className), ...props }));
|
|
44
|
+
}
|
|
45
|
+
function AttachmentActions({ className, ...props }) {
|
|
46
|
+
return (_jsx("div", { "data-slot": "attachment-actions", className: cn("relative z-20 flex shrink-0 items-center group-data-[orientation=vertical]/attachment:absolute group-data-[orientation=vertical]/attachment:top-3 group-data-[orientation=vertical]/attachment:right-3 group-data-[orientation=vertical]/attachment:gap-1", className), ...props }));
|
|
47
|
+
}
|
|
48
|
+
function AttachmentAction({ className, variant, size = "icon-xs", ...props }) {
|
|
49
|
+
return (_jsx(Button, { "data-slot": "attachment-action", variant: variant ?? "ghost", size: size, className: cn(className), ...props }));
|
|
50
|
+
}
|
|
51
|
+
function AttachmentTrigger({ className, render, type, children, ...props }) {
|
|
52
|
+
if (render) {
|
|
53
|
+
const renderProps = {
|
|
54
|
+
...props,
|
|
55
|
+
"data-slot": "attachment-trigger",
|
|
56
|
+
className: cn("absolute inset-0 z-10 outline-none", className),
|
|
57
|
+
children,
|
|
58
|
+
};
|
|
59
|
+
return render(renderProps);
|
|
60
|
+
}
|
|
61
|
+
return (_jsx("button", { ...props, type: type ?? "button", "data-slot": "attachment-trigger", className: cn("absolute inset-0 z-10 outline-none", className), children: children }));
|
|
62
|
+
}
|
|
63
|
+
function AttachmentGroup({ className, ...props }) {
|
|
64
|
+
return (_jsx("div", { "data-slot": "attachment-group", className: cn("flex min-w-0 scroll-fade-x snap-x snap-mandatory scroll-px-1 scrollbar-none gap-3 overflow-x-auto overscroll-x-contain py-1 *:data-[slot=attachment]:flex-none *:data-[slot=attachment]:snap-start", className), ...props }));
|
|
65
|
+
}
|
|
66
|
+
export { Attachment, AttachmentGroup, AttachmentMedia, AttachmentContent, AttachmentTitle, AttachmentDescription, AttachmentActions, AttachmentAction, AttachmentTrigger, };
|
|
67
|
+
//# sourceMappingURL=attachment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachment.js","sourceRoot":"","sources":["../../../src/components/ui/attachment.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,EAAE,EAAE,MAAM,IAAI,CAAA;AAEvB,OAAO,EAAE,MAAM,EAAE,MAAM,wCAAwC,CAAA;AAE/D,MAAM,kBAAkB,GAAG,GAAG,CAC5B,wSAAwS,EACxS;IACE,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,OAAO,EACL,sIAAsI;YACxI,EAAE,EAAE,0IAA0I;YAC9I,EAAE,EAAE,mJAAmJ;SACxJ;QACD,WAAW,EAAE;YACX,UAAU,EAAE,uBAAuB;YACnC,QAAQ,EAAE,uDAAuD;SAClE;KACF;CACF,CACF,CAAA;AAED,SAAS,UAAU,CAAC,EAClB,SAAS,EACT,KAAK,GAAG,MAAM,EACd,IAAI,GAAG,SAAS,EAChB,WAAW,GAAG,YAAY,EAC1B,GAAG,KAAK,EAIP;IACD,MAAM,mBAAmB,GAAG,WAAW,IAAI,YAAY,CAAA;IAEvD,OAAO,CACL,2BACY,YAAY,gBACV,KAAK,eACN,IAAI,sBACG,mBAAmB,EACrC,SAAS,EAAE,EAAE,CAAC,kBAAkB,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,EAAE,SAAS,CAAC,KAC/D,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,MAAM,uBAAuB,GAAG,GAAG,CACjC,krBAAkrB,EAClrB;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,IAAI,EAAE,EAAE;YACR,KAAK,EACH,oKAAoK;SACvK;KACF;IACD,eAAe,EAAE;QACf,OAA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I,EAAE,IAAI,EACV,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,KACpB,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,SAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,GAAG,KAAK,EAGT;IACC,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,WAAW,GAAG;YAClB,GAAG,KAAK;YACR,WAAW,EAAE,oBAAoB;YACjC,SAAS,EAAE,EAAE,CAAC,oCAAoC,EAAE,SAAS,CAAC;YAC9D,QAAQ;SACT,CAAA;QAED,OAAO,MAAM,CAAC,WAAW,CAAC,CAAA;IAC5B,CAAC;IAED,OAAO,CACL,oBACM,KAAK,EACT,IAAI,EAAE,IAAI,IAAI,QAAQ,eACZ,oBAAoB,EAC9B,SAAS,EAAE,EAAE,CAAC,oCAAoC,EAAE,SAAS,CAAC,YAE7D,QAAQ,GACF,CACV,CAAA;AACH,CAAC;AAED,SAAS,eAAe,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA+B;IAC3E,OAAO,CACL,2BACY,kBAAkB,EAC5B,SAAS,EAAE,EAAE,CACX,oMAAoM,EACpM,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,OAAO,EACL,UAAU,EACV,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,GAClB,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare function Avatar({ className, size, ...props }: React.ComponentProps<"div"> & {
|
|
3
|
+
size?: "default" | "sm" | "lg";
|
|
4
|
+
}): React.JSX.Element;
|
|
5
|
+
declare function AvatarImage({ className, ...props }: React.ComponentProps<"img">): React.JSX.Element;
|
|
6
|
+
declare function AvatarFallback({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
7
|
+
declare function AvatarBadge({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
8
|
+
declare function AvatarGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
9
|
+
declare function AvatarGroupCount({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
10
|
+
export { Avatar, AvatarImage, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarBadge, };
|
|
11
|
+
//# sourceMappingURL=avatar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../../src/components/ui/avatar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,IAAgB,EAChB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IAC/B,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,GAAG,IAAI,CAAA;CAC/B,qBAYA;AAID,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAkBxE;AAED,iBAAS,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAW3E;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,qBAczE;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAWxE;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAW7B;AAED,OAAO,EACL,MAAM,EACN,WAAW,EACX,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,WAAW,GACZ,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "cn";
|
|
5
|
+
function Avatar({ className, size = "default", ...props }) {
|
|
6
|
+
return (_jsx("div", { "data-slot": "avatar", "data-size": size, className: cn("group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten", className), ...props }));
|
|
7
|
+
}
|
|
8
|
+
function AvatarImage({ className, ...props }) {
|
|
9
|
+
const [state, setState] = React.useState(props.src ? "loading" : "error");
|
|
10
|
+
return (_jsx("img", { "data-slot": "avatar-image", alt: props.alt || "", "data-state": state, onLoad: () => setState("loaded"), onError: () => setState("error"), className: cn("peer aspect-square size-full rounded-full object-cover data-[state=error]:hidden", className), ...props }));
|
|
11
|
+
}
|
|
12
|
+
function AvatarFallback({ className, ...props }) {
|
|
13
|
+
return (_jsx("div", { "data-slot": "avatar-fallback", className: cn("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs peer-data-[state=error]:flex peer-[*]:hidden", className), ...props }));
|
|
14
|
+
}
|
|
15
|
+
function AvatarBadge({ className, ...props }) {
|
|
16
|
+
return (_jsx("span", { "data-slot": "avatar-badge", className: cn("absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground bg-blend-color ring-2 ring-background select-none", "group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden", "group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2", "group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2", className), ...props }));
|
|
17
|
+
}
|
|
18
|
+
function AvatarGroup({ className, ...props }) {
|
|
19
|
+
return (_jsx("div", { "data-slot": "avatar-group", className: cn("group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-background", className), ...props }));
|
|
20
|
+
}
|
|
21
|
+
function AvatarGroupCount({ className, ...props }) {
|
|
22
|
+
return (_jsx("div", { "data-slot": "avatar-group-count", className: cn("relative flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-sm text-muted-foreground ring-2 ring-background group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3", className), ...props }));
|
|
23
|
+
}
|
|
24
|
+
export { Avatar, AvatarImage, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarBadge, };
|
|
25
|
+
//# sourceMappingURL=avatar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"avatar.js","sourceRoot":"","sources":["../../../src/components/ui/avatar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,EAAE,EAAE,MAAM,IAAI,CAAA;AAEvB,SAAS,MAAM,CAAC,EACd,SAAS,EACT,IAAI,GAAG,SAAS,EAChB,GAAG,KAAK,EAGT;IACC,OAAO,CACL,2BACY,QAAQ,eACP,IAAI,EACf,SAAS,EAAE,EAAE,CACX,uPAAuP,EACvP,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAID,SAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA+B;IACvE,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAC,QAAQ,CACtC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAChC,CAAA;IACD,OAAO,CACL,2BACY,cAAc,EACxB,GAAG,EAAE,KAAK,CAAC,GAAG,IAAI,EAAE,gBACR,KAAK,EACjB,MAAM,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAChC,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,EAChC,SAAS,EAAE,EAAE,CACX,kFAAkF,EAClF,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,SAAS,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA+B;IAC1E,OAAO,CACL,2BACY,iBAAiB,EAC3B,SAAS,EAAE,EAAE,CACX,iLAAiL,EACjL,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,SAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAgC;IACxE,OAAO,CACL,4BACY,cAAc,EACxB,SAAS,EAAE,EAAE,CACX,0KAA0K,EAC1K,+EAA+E,EAC/E,2FAA2F,EAC3F,+EAA+E,EAC/E,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,SAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA+B;IACvE,OAAO,CACL,2BACY,cAAc,EACxB,SAAS,EAAE,EAAE,CACX,qGAAqG,EACrG,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,SAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACoB;IAC5B,OAAO,CACL,2BACY,oBAAoB,EAC9B,SAAS,EAAE,EAAE,CACX,0VAA0V,EAC1V,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,OAAO,EACL,MAAM,EACN,WAAW,EACX,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,WAAW,GACZ,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
declare const badgeVariants: (props?: ({
|
|
3
|
+
variant?: "default" | "destructive" | "ghost" | "link" | "outline" | "secondary" | null | undefined;
|
|
4
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
5
|
+
declare function Badge({ className, variant, render, ...props }: React.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
|
|
6
|
+
render?: (props: React.HTMLAttributes<HTMLElement>) => React.ReactNode;
|
|
7
|
+
}): string | number | bigint | boolean | import("react").JSX.Element | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | Iterable<import("react").ReactNode> | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | import("react").ReactPortal | null | undefined> | null | undefined;
|
|
8
|
+
export { Badge, badgeVariants };
|
|
9
|
+
//# sourceMappingURL=badge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../src/components/ui/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAGjE,QAAA,MAAM,aAAa;;8EAqBlB,CAAA;AAED,iBAAS,KAAK,CAAC,EACb,SAAS,EACT,OAAmB,EACnB,MAAM,EACN,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,GAC7B,YAAY,CAAC,OAAO,aAAa,CAAC,GAAG;IACnC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,KAAK,KAAK,CAAC,SAAS,CAAA;CACvE,+VAoBF;AAED,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { cn } from "cn";
|
|
4
|
+
const badgeVariants = cva("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!", {
|
|
5
|
+
variants: {
|
|
6
|
+
variant: {
|
|
7
|
+
default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
|
|
8
|
+
secondary: "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
|
|
9
|
+
destructive: "bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",
|
|
10
|
+
outline: "border-border bg-input/30 text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",
|
|
11
|
+
ghost: "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
|
|
12
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
defaultVariants: {
|
|
16
|
+
variant: "default",
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
function Badge({ className, variant = "default", render, ...props }) {
|
|
20
|
+
if (render) {
|
|
21
|
+
const renderProps = {
|
|
22
|
+
"data-slot": "badge",
|
|
23
|
+
"data-variant": variant,
|
|
24
|
+
className: cn(badgeVariants({ variant }), className),
|
|
25
|
+
...props,
|
|
26
|
+
};
|
|
27
|
+
return render(renderProps);
|
|
28
|
+
}
|
|
29
|
+
return (_jsx("span", { "data-slot": "badge", "data-variant": variant, className: cn(badgeVariants({ variant }), className), ...props }));
|
|
30
|
+
}
|
|
31
|
+
export { Badge, badgeVariants };
|
|
32
|
+
//# sourceMappingURL=badge.js.map
|