@tomny-dev/uzi 0.19.0 → 0.20.0-pr.133.460.1.b643269
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ai-chat/AIChat.d.ts +2 -25
- package/dist/components/ai-chat/AIChat.d.ts.map +1 -1
- package/dist/components/ai-chat/AIChatParts.d.ts +32 -0
- package/dist/components/ai-chat/AIChatParts.d.ts.map +1 -0
- package/dist/components/ai-chat/activityLabel.d.ts +20 -0
- package/dist/components/ai-chat/activityLabel.d.ts.map +1 -0
- package/dist/components/ai-chat/activityLabel.test.d.ts +2 -0
- package/dist/components/ai-chat/activityLabel.test.d.ts.map +1 -0
- package/dist/components/pill/Pill.d.ts +8 -5
- package/dist/components/pill/Pill.d.ts.map +1 -1
- package/dist/components/pill/Pill.test.d.ts +2 -0
- package/dist/components/pill/Pill.test.d.ts.map +1 -0
- package/dist/index.cjs +6 -5
- package/dist/index.js +4 -3
- package/dist/index12.js +4 -2
- package/dist/index12.js.map +1 -1
- package/dist/index13.cjs +4 -1
- package/dist/index13.cjs.map +1 -1
- package/dist/index13.js +20 -11
- package/dist/index13.js.map +1 -1
- package/dist/index14.cjs +19 -10
- package/dist/index14.cjs.map +1 -1
- package/dist/index83.js +3 -3
- package/dist/index83.js.map +1 -1
- package/dist/index84.cjs +3 -3
- package/dist/index84.cjs.map +1 -1
- package/dist/index84.js +5 -559
- package/dist/index84.js.map +1 -1
- package/dist/index85.cjs +8 -559
- package/dist/index85.cjs.map +1 -1
- package/dist/index85.js +11 -34
- package/dist/index85.js.map +1 -1
- package/dist/index86.cjs +11 -49
- package/dist/index86.cjs.map +1 -1
- package/dist/index86.js +539 -227
- package/dist/index86.js.map +1 -1
- package/dist/index87.cjs +541 -226
- package/dist/index87.cjs.map +1 -1
- package/dist/index87.js +33 -15
- package/dist/index87.js.map +1 -1
- package/dist/index88.cjs +48 -21
- package/dist/index88.cjs.map +1 -1
- package/dist/index88.js +250 -29
- package/dist/index88.js.map +1 -1
- package/dist/index89.cjs +250 -30
- package/dist/index89.cjs.map +1 -1
- package/dist/index89.js +19 -0
- package/dist/index89.js.map +1 -0
- package/dist/index90.cjs +25 -0
- package/dist/index90.cjs.map +1 -0
- package/dist/index90.js +36 -0
- package/dist/index90.js.map +1 -0
- package/dist/index91.cjs +37 -0
- package/dist/index91.cjs.map +1 -0
- package/dist/style.css +38 -17
- package/package.json +1 -1
package/dist/index88.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index88.js","names":[],"sources":["../src/components/floating-action-stack/FloatingActionStack.tsx"],"sourcesContent":["'use client';\n\nimport type { ButtonHTMLAttributes, ReactNode } from 'react';\n\nimport styles from './floating-action-stack.module.css';\n\n/** A single screen-edge action rail shared by unrelated application features. */\nexport interface FloatingActionStackProps {\n readonly children: ReactNode;\n readonly className?: string;\n readonly label?: string;\n}\n\nexport function FloatingActionStack({ children, className, label = 'Quick actions' }: FloatingActionStackProps) {\n return (\n <nav\n aria-label={label}\n className={[styles.stack, className].filter(Boolean).join(' ')}\n >\n {children}\n </nav>\n );\n}\n\nexport interface FloatingActionButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {\n /** Stable accessible name, including when the mobile label is hidden. */\n readonly label: string;\n readonly icon: ReactNode;\n readonly children?: ReactNode;\n /** Use secondary styling for contextual actions above the primary launcher. */\n readonly variant?: 'primary' | 'secondary';\n}\n\n/** A directly accessible action, not a speed-dial menu or nested overlay. */\nexport function FloatingActionButton({\n label,\n icon,\n children,\n variant = 'primary',\n className,\n ...buttonProps\n}: FloatingActionButtonProps) {\n return (\n <button\n {...buttonProps}\n type=\"button\"\n aria-label={label}\n className={[styles.action, variant === 'secondary' ? styles.secondary : styles.primary, className]\n .filter(Boolean).join(' ')}\n >\n <span className={styles.icon} aria-hidden=\"true\">{icon}</span>\n <span className={styles.label}>{children ?? label}</span>\n </button>\n );\n}\n"],"mappings":";;;;AAaA,SAAgB,oBAAoB,EAAE,UAAU,WAAW,QAAQ,mBAA6C;CAC9G,OACE,oBAAC,OAAD;EACE,cAAY;EACZ,WAAW,CAAC,qCAAO,OAAO,SAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAE5D;CACE,CAAA;AAET;;AAYA,SAAgB,qBAAqB,EACnC,OACA,MACA,UACA,UAAU,WACV,WACA,GAAG,eACyB;CAC5B,OACE,qBAAC,UAAD;EACE,GAAI;EACJ,MAAK;EACL,cAAY;EACZ,WAAW;GAAC,qCAAO;GAAQ,YAAY,cAAc,qCAAO,YAAY,qCAAO;GAAS;EAAS,CAAC,CAC/F,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;YAL7B,CAOE,oBAAC,QAAD;GAAM,WAAW,qCAAO;GAAM,eAAY;aAAQ;EAAW,CAAA,GAC7D,oBAAC,QAAD;GAAM,WAAW,qCAAO;aAAQ,YAAY;EAAY,CAAA,CAClD;;AAEZ"}
|
|
1
|
+
{"version":3,"file":"index88.js","names":[],"sources":["../src/components/ai-chat/AIChatDock.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect, useId, useRef, useState, type ReactNode } from 'react';\n\nimport styles from './ai-chat-dock.module.css';\n\nexport interface AIChatDockProps {\n /** Visible assistant name, e.g. \"Betty\" or \"Ask Tultr\". */\n readonly title: string;\n readonly description?: string;\n /** Accessible name for the floating action button. Defaults to \"Open {title}\". */\n readonly launcherLabel?: string;\n /** Turn off the built-in FAB when a parent FloatingActionStack owns the launcher. */\n readonly showLauncher?: boolean;\n /** Optional stable panel ID for an external button's aria-controls. */\n readonly panelId?: string;\n /** ID of the external launch button to restore keyboard focus after close. */\n readonly externalLauncherId?: string;\n readonly children: ReactNode;\n /** Consumer-owned conversation reset; shown in the dock header beside expand/close. */\n readonly onNewChat?: () => void;\n readonly newChatDisabled?: boolean;\n /** Controlled visibility; when omitted, the dock manages its own state. */\n readonly open?: boolean;\n readonly defaultOpen?: boolean;\n readonly onOpenChange?: (open: boolean) => void;\n /** Controlled expansion; apps may synchronize this with a dedicated route. */\n readonly expanded?: boolean;\n readonly defaultExpanded?: boolean;\n readonly onExpandedChange?: (expanded: boolean) => void;\n readonly className?: string;\n}\n\n/**\n * Shared chat navigation chrome. Children remain mounted while closed to retain\n * the consumer's active AI SDK conversation, pending approvals and attachments.\n * The dock never creates a second chat runtime or reads application messages.\n * Desktop is deliberately non-modal: Tab can move back into the page.\n * On mobile the full-screen modal sheet traps sequential keyboard focus.\n */\nexport function AIChatDock({\n title,\n description,\n launcherLabel,\n showLauncher = true,\n panelId: controlledPanelId,\n externalLauncherId,\n children,\n onNewChat,\n newChatDisabled = false,\n open,\n defaultOpen = false,\n onOpenChange,\n expanded,\n defaultExpanded = false,\n onExpandedChange,\n className,\n}: AIChatDockProps) {\n const autoId = useId();\n const panelId = controlledPanelId ?? `uzi-ai-dock-${autoId}`;\n const [internalOpen, setInternalOpen] = useState(defaultOpen);\n const [internalExpanded, setInternalExpanded] = useState(defaultExpanded);\n const isOpen = open ?? internalOpen;\n const isExpanded = expanded ?? internalExpanded;\n const [mobile, setMobile] = useState(false);\n const launcherRef = useRef<HTMLButtonElement>(null);\n const panelRef = useRef<HTMLElement>(null);\n const openerRef = useRef<HTMLElement | null>(null);\n const wasOpen = useRef(false);\n\n const changeOpen = (next: boolean) => {\n if (open === undefined) setInternalOpen(next);\n onOpenChange?.(next);\n };\n\n const changeExpanded = (next: boolean) => {\n if (expanded === undefined) setInternalExpanded(next);\n onExpandedChange?.(next);\n if (next && !isOpen) changeOpen(true);\n };\n\n useEffect(() => {\n if (typeof window.matchMedia !== 'function') return;\n const media = window.matchMedia('(max-width: 640px)');\n const update = () => setMobile(media.matches);\n update();\n media.addEventListener('change', update);\n return () => media.removeEventListener('change', update);\n }, []);\n\n useEffect(() => {\n if (isOpen && !wasOpen.current) {\n openerRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;\n panelRef.current?.focus();\n } else if (!isOpen && wasOpen.current) {\n const previous = openerRef.current;\n if (previous?.isConnected && previous !== panelRef.current) previous.focus();\n else if (externalLauncherId) document.getElementById(externalLauncherId)?.focus();\n else launcherRef.current?.focus();\n }\n wasOpen.current = isOpen;\n }, [isOpen, externalLauncherId]);\n\n useEffect(() => {\n if (!isOpen || !mobile) return;\n const previous = document.body.style.overflow;\n document.body.style.overflow = 'hidden';\n return () => { document.body.style.overflow = previous; };\n }, [isOpen, mobile]);\n\n useEffect(() => {\n if (!isOpen) return;\n const keydown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n event.preventDefault();\n changeOpen(false);\n return;\n }\n // On desktop the panel is non-modal; only the mobile sheet traps focus.\n if (event.key !== 'Tab' || !mobile) return;\n const focusable = Array.from(panelRef.current?.querySelectorAll<HTMLElement>(\n 'a[href], button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex=\"-1\"])',\n ) ?? []).filter((item) => item.tabIndex >= 0 && item.getClientRects().length > 0);\n if (!focusable.length) { event.preventDefault(); panelRef.current?.focus(); return; }\n const first = focusable[0], last = focusable[focusable.length - 1];\n if (event.shiftKey && (document.activeElement === first || !panelRef.current?.contains(document.activeElement))) {\n event.preventDefault();\n last?.focus();\n } else if (!event.shiftKey && (document.activeElement === last || !panelRef.current?.contains(document.activeElement))) {\n event.preventDefault();\n first?.focus();\n }\n };\n document.addEventListener('keydown', keydown);\n return () => document.removeEventListener('keydown', keydown);\n }, [isOpen, mobile, onOpenChange, open]);\n\n return (\n <div className={[styles.dock, className].filter(Boolean).join(' ')}>\n {showLauncher && !isOpen && (\n <button\n ref={launcherRef}\n type=\"button\"\n className={styles.launcher}\n aria-controls={panelId}\n aria-expanded={false}\n aria-label={launcherLabel ?? `Open ${title}`}\n onClick={() => changeOpen(true)}\n >\n <svg aria-hidden=\"true\" width=\"23\" height=\"23\" viewBox=\"0 0 24 24\" fill=\"none\"\n stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M21 11.5a8.5 8.5 0 0 1-8.5 8.5 9.1 9.1 0 0 1-4-.9L3 21l1.9-5.5a9.1 9.1 0 0 1-.9-4 8.5 8.5 0 0 1 8.5-8.5h.5A8.5 8.5 0 0 1 21 11.5Z\" />\n </svg>\n <span className={styles.launcherText}>{title}</span>\n </button>\n )}\n {isOpen && mobile && <div className={styles.backdrop} aria-hidden=\"true\" onClick={() => changeOpen(false)} />}\n <section\n ref={panelRef}\n id={panelId}\n role=\"dialog\"\n aria-modal={mobile && isOpen}\n aria-label={title}\n tabIndex={-1}\n className={styles.panel}\n data-expanded={isExpanded}\n hidden={!isOpen}\n >\n <header className={styles.header}>\n <div className={styles.identity}>\n <div className={styles.avatar} aria-hidden=\"true\">\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\"\n strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <rect x=\"4\" y=\"6\" width=\"16\" height=\"14\" rx=\"4\" />\n <path d=\"M12 3v3M9 13h.01M15 13h.01M9 17h6\" />\n </svg>\n </div>\n <div className={styles.titles}>\n <strong className={styles.title}>{title}</strong>\n {description && <span className={styles.description}>{description}</span>}\n </div>\n </div>\n <div className={styles.actions}>\n {onNewChat && (\n <button type=\"button\" className={styles.iconButton}\n aria-label=\"New chat\" title=\"New chat\"\n disabled={newChatDisabled}\n onClick={onNewChat}>\n <svg aria-hidden=\"true\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\"\n stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M12 5H6a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2v-6\" />\n <path d=\"m15 5 4 4M13 11l7-7a2.12 2.12 0 0 1 3 3l-7 7-4 1 1-4Z\" transform=\"translate(-2 -2)\" />\n </svg>\n </button>\n )}\n <button type=\"button\" className={`${styles.iconButton} ${styles.expandButton}`}\n aria-label={isExpanded ? `Collapse ${title}` : `Expand ${title}`}\n title={isExpanded ? 'Collapse' : 'Expand'}\n onClick={() => changeExpanded(!isExpanded)}>\n {isExpanded ? (\n <svg width=\"17\" height=\"17\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\"\n strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\"><path d=\"M9 3v6H3M15 21v-6h6M3 9l6-6M21 15l-6 6\" /></svg>\n ) : (\n <svg width=\"17\" height=\"17\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\"\n strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\"><path d=\"M8 3H3v5M16 21h5v-5M3 3l7 7M21 21l-7-7\" /></svg>\n )}\n </button>\n <button type=\"button\" className={styles.iconButton}\n aria-label={`Close ${title}`} title=\"Close\"\n onClick={() => changeOpen(false)}>\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\"\n strokeWidth=\"2\" strokeLinecap=\"round\" aria-hidden=\"true\"><path d=\"M18 6 6 18M6 6l12 12\" /></svg>\n </button>\n </div>\n </header>\n <div className={styles.content}>{children}</div>\n </section>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAwCA,SAAgB,WAAW,EACzB,OACA,aACA,eACA,eAAe,MACf,SAAS,mBACT,oBACA,UACA,WACA,kBAAkB,OAClB,MACA,cAAc,OACd,cACA,UACA,kBAAkB,OAClB,kBACA,aACkB;CAClB,MAAM,SAAS,MAAM;CACrB,MAAM,UAAU,qBAAqB,eAAe;CACpD,MAAM,CAAC,cAAc,mBAAmB,SAAS,WAAW;CAC5D,MAAM,CAAC,kBAAkB,uBAAuB,SAAS,eAAe;CACxE,MAAM,SAAS,QAAQ;CACvB,MAAM,aAAa,YAAY;CAC/B,MAAM,CAAC,QAAQ,aAAa,SAAS,KAAK;CAC1C,MAAM,cAAc,OAA0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.cjs");
|
|
3
|
+
let react = require("react");
|
|
3
4
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
|
-
//#region src/components/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
5
|
+
//#region src/components/ai-chat/AIChatDock.tsx
|
|
6
|
+
/**
|
|
7
|
+
* Shared chat navigation chrome. Children remain mounted while closed to retain
|
|
8
|
+
* the consumer's active AI SDK conversation, pending approvals and attachments.
|
|
9
|
+
* The dock never creates a second chat runtime or reads application messages.
|
|
10
|
+
* Desktop is deliberately non-modal: Tab can move back into the page.
|
|
11
|
+
* On mobile the full-screen modal sheet traps sequential keyboard focus.
|
|
12
|
+
*/
|
|
13
|
+
function AIChatDock({ title, description, launcherLabel, showLauncher = true, panelId: controlledPanelId, externalLauncherId, children, onNewChat, newChatDisabled = false, open, defaultOpen = false, onOpenChange, expanded, defaultExpanded = false, onExpandedChange, className }) {
|
|
14
|
+
const autoId = (0, react.useId)();
|
|
15
|
+
const panelId = controlledPanelId ?? `uzi-ai-dock-${autoId}`;
|
|
16
|
+
const [internalOpen, setInternalOpen] = (0, react.useState)(defaultOpen);
|
|
17
|
+
const [internalExpanded, setInternalExpanded] = (0, react.useState)(defaultExpanded);
|
|
18
|
+
const isOpen = open ?? internalOpen;
|
|
19
|
+
const isExpanded = expanded ?? internalExpanded;
|
|
20
|
+
const [mobile, setMobile] = (0, react.useState)(false);
|
|
21
|
+
const launcherRef = (0, react.useRef)(null);
|
|
22
|
+
const panelRef = (0, react.useRef)(null);
|
|
23
|
+
const openerRef = (0, react.useRef)(null);
|
|
24
|
+
const wasOpen = (0, react.useRef)(false);
|
|
25
|
+
const changeOpen = (next) => {
|
|
26
|
+
if (open === void 0) setInternalOpen(next);
|
|
27
|
+
onOpenChange?.(next);
|
|
28
|
+
};
|
|
29
|
+
const changeExpanded = (next) => {
|
|
30
|
+
if (expanded === void 0) setInternalExpanded(next);
|
|
31
|
+
onExpandedChange?.(next);
|
|
32
|
+
if (next && !isOpen) changeOpen(true);
|
|
33
|
+
};
|
|
34
|
+
(0, react.useEffect)(() => {
|
|
35
|
+
if (typeof window.matchMedia !== "function") return;
|
|
36
|
+
const media = window.matchMedia("(max-width: 640px)");
|
|
37
|
+
const update = () => setMobile(media.matches);
|
|
38
|
+
update();
|
|
39
|
+
media.addEventListener("change", update);
|
|
40
|
+
return () => media.removeEventListener("change", update);
|
|
41
|
+
}, []);
|
|
42
|
+
(0, react.useEffect)(() => {
|
|
43
|
+
if (isOpen && !wasOpen.current) {
|
|
44
|
+
openerRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
45
|
+
panelRef.current?.focus();
|
|
46
|
+
} else if (!isOpen && wasOpen.current) {
|
|
47
|
+
const previous = openerRef.current;
|
|
48
|
+
if (previous?.isConnected && previous !== panelRef.current) previous.focus();
|
|
49
|
+
else if (externalLauncherId) document.getElementById(externalLauncherId)?.focus();
|
|
50
|
+
else launcherRef.current?.focus();
|
|
51
|
+
}
|
|
52
|
+
wasOpen.current = isOpen;
|
|
53
|
+
}, [isOpen, externalLauncherId]);
|
|
54
|
+
(0, react.useEffect)(() => {
|
|
55
|
+
if (!isOpen || !mobile) return;
|
|
56
|
+
const previous = document.body.style.overflow;
|
|
57
|
+
document.body.style.overflow = "hidden";
|
|
58
|
+
return () => {
|
|
59
|
+
document.body.style.overflow = previous;
|
|
60
|
+
};
|
|
61
|
+
}, [isOpen, mobile]);
|
|
62
|
+
(0, react.useEffect)(() => {
|
|
63
|
+
if (!isOpen) return;
|
|
64
|
+
const keydown = (event) => {
|
|
65
|
+
if (event.key === "Escape") {
|
|
66
|
+
event.preventDefault();
|
|
67
|
+
changeOpen(false);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (event.key !== "Tab" || !mobile) return;
|
|
71
|
+
const focusable = Array.from(panelRef.current?.querySelectorAll("a[href], button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex=\"-1\"])") ?? []).filter((item) => item.tabIndex >= 0 && item.getClientRects().length > 0);
|
|
72
|
+
if (!focusable.length) {
|
|
73
|
+
event.preventDefault();
|
|
74
|
+
panelRef.current?.focus();
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const first = focusable[0], last = focusable[focusable.length - 1];
|
|
78
|
+
if (event.shiftKey && (document.activeElement === first || !panelRef.current?.contains(document.activeElement))) {
|
|
79
|
+
event.preventDefault();
|
|
80
|
+
last?.focus();
|
|
81
|
+
} else if (!event.shiftKey && (document.activeElement === last || !panelRef.current?.contains(document.activeElement))) {
|
|
82
|
+
event.preventDefault();
|
|
83
|
+
first?.focus();
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
document.addEventListener("keydown", keydown);
|
|
87
|
+
return () => document.removeEventListener("keydown", keydown);
|
|
88
|
+
}, [
|
|
89
|
+
isOpen,
|
|
90
|
+
mobile,
|
|
91
|
+
onOpenChange,
|
|
92
|
+
open
|
|
93
|
+
]);
|
|
94
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
95
|
+
className: [require_ai_chat_dock_module.default.dock, className].filter(Boolean).join(" "),
|
|
96
|
+
children: [
|
|
97
|
+
showLauncher && !isOpen && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
98
|
+
ref: launcherRef,
|
|
99
|
+
type: "button",
|
|
100
|
+
className: require_ai_chat_dock_module.default.launcher,
|
|
101
|
+
"aria-controls": panelId,
|
|
102
|
+
"aria-expanded": false,
|
|
103
|
+
"aria-label": launcherLabel ?? `Open ${title}`,
|
|
104
|
+
onClick: () => changeOpen(true),
|
|
105
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
106
|
+
"aria-hidden": "true",
|
|
107
|
+
width: "23",
|
|
108
|
+
height: "23",
|
|
109
|
+
viewBox: "0 0 24 24",
|
|
110
|
+
fill: "none",
|
|
111
|
+
stroke: "currentColor",
|
|
112
|
+
strokeWidth: "1.8",
|
|
113
|
+
strokeLinecap: "round",
|
|
114
|
+
strokeLinejoin: "round",
|
|
115
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M21 11.5a8.5 8.5 0 0 1-8.5 8.5 9.1 9.1 0 0 1-4-.9L3 21l1.9-5.5a9.1 9.1 0 0 1-.9-4 8.5 8.5 0 0 1 8.5-8.5h.5A8.5 8.5 0 0 1 21 11.5Z" })
|
|
116
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
117
|
+
className: require_ai_chat_dock_module.default.launcherText,
|
|
118
|
+
children: title
|
|
119
|
+
})]
|
|
120
|
+
}),
|
|
121
|
+
isOpen && mobile && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
122
|
+
className: require_ai_chat_dock_module.default.backdrop,
|
|
123
|
+
"aria-hidden": "true",
|
|
124
|
+
onClick: () => changeOpen(false)
|
|
125
|
+
}),
|
|
126
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
127
|
+
ref: panelRef,
|
|
128
|
+
id: panelId,
|
|
129
|
+
role: "dialog",
|
|
130
|
+
"aria-modal": mobile && isOpen,
|
|
131
|
+
"aria-label": title,
|
|
132
|
+
tabIndex: -1,
|
|
133
|
+
className: require_ai_chat_dock_module.default.panel,
|
|
134
|
+
"data-expanded": isExpanded,
|
|
135
|
+
hidden: !isOpen,
|
|
136
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("header", {
|
|
137
|
+
className: require_ai_chat_dock_module.default.header,
|
|
138
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
139
|
+
className: require_ai_chat_dock_module.default.identity,
|
|
140
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
141
|
+
className: require_ai_chat_dock_module.default.avatar,
|
|
142
|
+
"aria-hidden": "true",
|
|
143
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
144
|
+
width: "18",
|
|
145
|
+
height: "18",
|
|
146
|
+
viewBox: "0 0 24 24",
|
|
147
|
+
fill: "none",
|
|
148
|
+
stroke: "currentColor",
|
|
149
|
+
strokeWidth: "1.8",
|
|
150
|
+
strokeLinecap: "round",
|
|
151
|
+
strokeLinejoin: "round",
|
|
152
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("rect", {
|
|
153
|
+
x: "4",
|
|
154
|
+
y: "6",
|
|
155
|
+
width: "16",
|
|
156
|
+
height: "14",
|
|
157
|
+
rx: "4"
|
|
158
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M12 3v3M9 13h.01M15 13h.01M9 17h6" })]
|
|
159
|
+
})
|
|
160
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
161
|
+
className: require_ai_chat_dock_module.default.titles,
|
|
162
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", {
|
|
163
|
+
className: require_ai_chat_dock_module.default.title,
|
|
164
|
+
children: title
|
|
165
|
+
}), description && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
166
|
+
className: require_ai_chat_dock_module.default.description,
|
|
167
|
+
children: description
|
|
168
|
+
})]
|
|
169
|
+
})]
|
|
170
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
171
|
+
className: require_ai_chat_dock_module.default.actions,
|
|
172
|
+
children: [
|
|
173
|
+
onNewChat && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
174
|
+
type: "button",
|
|
175
|
+
className: require_ai_chat_dock_module.default.iconButton,
|
|
176
|
+
"aria-label": "New chat",
|
|
177
|
+
title: "New chat",
|
|
178
|
+
disabled: newChatDisabled,
|
|
179
|
+
onClick: onNewChat,
|
|
180
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
181
|
+
"aria-hidden": "true",
|
|
182
|
+
width: "18",
|
|
183
|
+
height: "18",
|
|
184
|
+
viewBox: "0 0 24 24",
|
|
185
|
+
fill: "none",
|
|
186
|
+
stroke: "currentColor",
|
|
187
|
+
strokeWidth: "1.8",
|
|
188
|
+
strokeLinecap: "round",
|
|
189
|
+
strokeLinejoin: "round",
|
|
190
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M12 5H6a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2v-6" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
191
|
+
d: "m15 5 4 4M13 11l7-7a2.12 2.12 0 0 1 3 3l-7 7-4 1 1-4Z",
|
|
192
|
+
transform: "translate(-2 -2)"
|
|
193
|
+
})]
|
|
194
|
+
})
|
|
195
|
+
}),
|
|
196
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
197
|
+
type: "button",
|
|
198
|
+
className: `${require_ai_chat_dock_module.default.iconButton} ${require_ai_chat_dock_module.default.expandButton}`,
|
|
199
|
+
"aria-label": isExpanded ? `Collapse ${title}` : `Expand ${title}`,
|
|
200
|
+
title: isExpanded ? "Collapse" : "Expand",
|
|
201
|
+
onClick: () => changeExpanded(!isExpanded),
|
|
202
|
+
children: isExpanded ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
203
|
+
width: "17",
|
|
204
|
+
height: "17",
|
|
205
|
+
viewBox: "0 0 24 24",
|
|
206
|
+
fill: "none",
|
|
207
|
+
stroke: "currentColor",
|
|
208
|
+
strokeWidth: "2",
|
|
209
|
+
strokeLinecap: "round",
|
|
210
|
+
strokeLinejoin: "round",
|
|
211
|
+
"aria-hidden": "true",
|
|
212
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M9 3v6H3M15 21v-6h6M3 9l6-6M21 15l-6 6" })
|
|
213
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
214
|
+
width: "17",
|
|
215
|
+
height: "17",
|
|
216
|
+
viewBox: "0 0 24 24",
|
|
217
|
+
fill: "none",
|
|
218
|
+
stroke: "currentColor",
|
|
219
|
+
strokeWidth: "2",
|
|
220
|
+
strokeLinecap: "round",
|
|
221
|
+
strokeLinejoin: "round",
|
|
222
|
+
"aria-hidden": "true",
|
|
223
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M8 3H3v5M16 21h5v-5M3 3l7 7M21 21l-7-7" })
|
|
224
|
+
})
|
|
225
|
+
}),
|
|
226
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
227
|
+
type: "button",
|
|
228
|
+
className: require_ai_chat_dock_module.default.iconButton,
|
|
229
|
+
"aria-label": `Close ${title}`,
|
|
230
|
+
title: "Close",
|
|
231
|
+
onClick: () => changeOpen(false),
|
|
232
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
233
|
+
width: "18",
|
|
234
|
+
height: "18",
|
|
235
|
+
viewBox: "0 0 24 24",
|
|
236
|
+
fill: "none",
|
|
237
|
+
stroke: "currentColor",
|
|
238
|
+
strokeWidth: "2",
|
|
239
|
+
strokeLinecap: "round",
|
|
240
|
+
"aria-hidden": "true",
|
|
241
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
242
|
+
})
|
|
243
|
+
})
|
|
244
|
+
]
|
|
245
|
+
})]
|
|
246
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
247
|
+
className: require_ai_chat_dock_module.default.content,
|
|
248
|
+
children
|
|
249
|
+
})]
|
|
250
|
+
})
|
|
251
|
+
]
|
|
31
252
|
});
|
|
32
253
|
}
|
|
33
254
|
//#endregion
|
|
34
|
-
exports.
|
|
35
|
-
exports.FloatingActionStack = FloatingActionStack;
|
|
255
|
+
exports.AIChatDock = AIChatDock;
|
|
36
256
|
|
|
37
257
|
//# sourceMappingURL=index89.cjs.map
|
package/dist/index89.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index89.cjs","names":[],"sources":["../src/components/floating-action-stack/FloatingActionStack.tsx"],"sourcesContent":["'use client';\n\nimport type { ButtonHTMLAttributes, ReactNode } from 'react';\n\nimport styles from './floating-action-stack.module.css';\n\n/** A single screen-edge action rail shared by unrelated application features. */\nexport interface FloatingActionStackProps {\n readonly children: ReactNode;\n readonly className?: string;\n readonly label?: string;\n}\n\nexport function FloatingActionStack({ children, className, label = 'Quick actions' }: FloatingActionStackProps) {\n return (\n <nav\n aria-label={label}\n className={[styles.stack, className].filter(Boolean).join(' ')}\n >\n {children}\n </nav>\n );\n}\n\nexport interface FloatingActionButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {\n /** Stable accessible name, including when the mobile label is hidden. */\n readonly label: string;\n readonly icon: ReactNode;\n readonly children?: ReactNode;\n /** Use secondary styling for contextual actions above the primary launcher. */\n readonly variant?: 'primary' | 'secondary';\n}\n\n/** A directly accessible action, not a speed-dial menu or nested overlay. */\nexport function FloatingActionButton({\n label,\n icon,\n children,\n variant = 'primary',\n className,\n ...buttonProps\n}: FloatingActionButtonProps) {\n return (\n <button\n {...buttonProps}\n type=\"button\"\n aria-label={label}\n className={[styles.action, variant === 'secondary' ? styles.secondary : styles.primary, className]\n .filter(Boolean).join(' ')}\n >\n <span className={styles.icon} aria-hidden=\"true\">{icon}</span>\n <span className={styles.label}>{children ?? label}</span>\n </button>\n );\n}\n"],"mappings":";;;;AAaA,SAAgB,oBAAoB,EAAE,UAAU,WAAW,QAAQ,mBAA6C;CAC9G,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,cAAY;EACZ,WAAW,CAAC,qCAAA,QAAO,OAAO,SAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAE5D;CACE,CAAA;AAET;;AAYA,SAAgB,qBAAqB,EACnC,OACA,MACA,UACA,UAAU,WACV,WACA,GAAG,eACyB;CAC5B,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,UAAD;EACE,GAAI;EACJ,MAAK;EACL,cAAY;EACZ,WAAW;GAAC,qCAAA,QAAO;GAAQ,YAAY,cAAc,qCAAA,QAAO,YAAY,qCAAA,QAAO;GAAS;EAAS,CAAC,CAC/F,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;YAL7B,CAOE,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;GAAM,WAAW,qCAAA,QAAO;GAAM,eAAY;aAAQ;EAAW,CAAA,GAC7D,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;GAAM,WAAW,qCAAA,QAAO;aAAQ,YAAY;EAAY,CAAA,CAClD;;AAEZ"}
|
|
1
|
+
{"version":3,"file":"index89.cjs","names":[],"sources":["../src/components/ai-chat/AIChatDock.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect, useId, useRef, useState, type ReactNode } from 'react';\n\nimport styles from './ai-chat-dock.module.css';\n\nexport interface AIChatDockProps {\n /** Visible assistant name, e.g. \"Betty\" or \"Ask Tultr\". */\n readonly title: string;\n readonly description?: string;\n /** Accessible name for the floating action button. Defaults to \"Open {title}\". */\n readonly launcherLabel?: string;\n /** Turn off the built-in FAB when a parent FloatingActionStack owns the launcher. */\n readonly showLauncher?: boolean;\n /** Optional stable panel ID for an external button's aria-controls. */\n readonly panelId?: string;\n /** ID of the external launch button to restore keyboard focus after close. */\n readonly externalLauncherId?: string;\n readonly children: ReactNode;\n /** Consumer-owned conversation reset; shown in the dock header beside expand/close. */\n readonly onNewChat?: () => void;\n readonly newChatDisabled?: boolean;\n /** Controlled visibility; when omitted, the dock manages its own state. */\n readonly open?: boolean;\n readonly defaultOpen?: boolean;\n readonly onOpenChange?: (open: boolean) => void;\n /** Controlled expansion; apps may synchronize this with a dedicated route. */\n readonly expanded?: boolean;\n readonly defaultExpanded?: boolean;\n readonly onExpandedChange?: (expanded: boolean) => void;\n readonly className?: string;\n}\n\n/**\n * Shared chat navigation chrome. Children remain mounted while closed to retain\n * the consumer's active AI SDK conversation, pending approvals and attachments.\n * The dock never creates a second chat runtime or reads application messages.\n * Desktop is deliberately non-modal: Tab can move back into the page.\n * On mobile the full-screen modal sheet traps sequential keyboard focus.\n */\nexport function AIChatDock({\n title,\n description,\n launcherLabel,\n showLauncher = true,\n panelId: controlledPanelId,\n externalLauncherId,\n children,\n onNewChat,\n newChatDisabled = false,\n open,\n defaultOpen = false,\n onOpenChange,\n expanded,\n defaultExpanded = false,\n onExpandedChange,\n className,\n}: AIChatDockProps) {\n const autoId = useId();\n const panelId = controlledPanelId ?? `uzi-ai-dock-${autoId}`;\n const [internalOpen, setInternalOpen] = useState(defaultOpen);\n const [internalExpanded, setInternalExpanded] = useState(defaultExpanded);\n const isOpen = open ?? internalOpen;\n const isExpanded = expanded ?? internalExpanded;\n const [mobile, setMobile] = useState(false);\n const launcherRef = useRef<HTMLButtonElement>(null);\n const panelRef = useRef<HTMLElement>(null);\n const openerRef = useRef<HTMLElement | null>(null);\n const wasOpen = useRef(false);\n\n const changeOpen = (next: boolean) => {\n if (open === undefined) setInternalOpen(next);\n onOpenChange?.(next);\n };\n\n const changeExpanded = (next: boolean) => {\n if (expanded === undefined) setInternalExpanded(next);\n onExpandedChange?.(next);\n if (next && !isOpen) changeOpen(true);\n };\n\n useEffect(() => {\n if (typeof window.matchMedia !== 'function') return;\n const media = window.matchMedia('(max-width: 640px)');\n const update = () => setMobile(media.matches);\n update();\n media.addEventListener('change', update);\n return () => media.removeEventListener('change', update);\n }, []);\n\n useEffect(() => {\n if (isOpen && !wasOpen.current) {\n openerRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;\n panelRef.current?.focus();\n } else if (!isOpen && wasOpen.current) {\n const previous = openerRef.current;\n if (previous?.isConnected && previous !== panelRef.current) previous.focus();\n else if (externalLauncherId) document.getElementById(externalLauncherId)?.focus();\n else launcherRef.current?.focus();\n }\n wasOpen.current = isOpen;\n }, [isOpen, externalLauncherId]);\n\n useEffect(() => {\n if (!isOpen || !mobile) return;\n const previous = document.body.style.overflow;\n document.body.style.overflow = 'hidden';\n return () => { document.body.style.overflow = previous; };\n }, [isOpen, mobile]);\n\n useEffect(() => {\n if (!isOpen) return;\n const keydown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n event.preventDefault();\n changeOpen(false);\n return;\n }\n // On desktop the panel is non-modal; only the mobile sheet traps focus.\n if (event.key !== 'Tab' || !mobile) return;\n const focusable = Array.from(panelRef.current?.querySelectorAll<HTMLElement>(\n 'a[href], button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex=\"-1\"])',\n ) ?? []).filter((item) => item.tabIndex >= 0 && item.getClientRects().length > 0);\n if (!focusable.length) { event.preventDefault(); panelRef.current?.focus(); return; }\n const first = focusable[0], last = focusable[focusable.length - 1];\n if (event.shiftKey && (document.activeElement === first || !panelRef.current?.contains(document.activeElement))) {\n event.preventDefault();\n last?.focus();\n } else if (!event.shiftKey && (document.activeElement === last || !panelRef.current?.contains(document.activeElement))) {\n event.preventDefault();\n first?.focus();\n }\n };\n document.addEventListener('keydown', keydown);\n return () => document.removeEventListener('keydown', keydown);\n }, [isOpen, mobile, onOpenChange, open]);\n\n return (\n <div className={[styles.dock, className].filter(Boolean).join(' ')}>\n {showLauncher && !isOpen && (\n <button\n ref={launcherRef}\n type=\"button\"\n className={styles.launcher}\n aria-controls={panelId}\n aria-expanded={false}\n aria-label={launcherLabel ?? `Open ${title}`}\n onClick={() => changeOpen(true)}\n >\n <svg aria-hidden=\"true\" width=\"23\" height=\"23\" viewBox=\"0 0 24 24\" fill=\"none\"\n stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M21 11.5a8.5 8.5 0 0 1-8.5 8.5 9.1 9.1 0 0 1-4-.9L3 21l1.9-5.5a9.1 9.1 0 0 1-.9-4 8.5 8.5 0 0 1 8.5-8.5h.5A8.5 8.5 0 0 1 21 11.5Z\" />\n </svg>\n <span className={styles.launcherText}>{title}</span>\n </button>\n )}\n {isOpen && mobile && <div className={styles.backdrop} aria-hidden=\"true\" onClick={() => changeOpen(false)} />}\n <section\n ref={panelRef}\n id={panelId}\n role=\"dialog\"\n aria-modal={mobile && isOpen}\n aria-label={title}\n tabIndex={-1}\n className={styles.panel}\n data-expanded={isExpanded}\n hidden={!isOpen}\n >\n <header className={styles.header}>\n <div className={styles.identity}>\n <div className={styles.avatar} aria-hidden=\"true\">\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\"\n strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <rect x=\"4\" y=\"6\" width=\"16\" height=\"14\" rx=\"4\" />\n <path d=\"M12 3v3M9 13h.01M15 13h.01M9 17h6\" />\n </svg>\n </div>\n <div className={styles.titles}>\n <strong className={styles.title}>{title}</strong>\n {description && <span className={styles.description}>{description}</span>}\n </div>\n </div>\n <div className={styles.actions}>\n {onNewChat && (\n <button type=\"button\" className={styles.iconButton}\n aria-label=\"New chat\" title=\"New chat\"\n disabled={newChatDisabled}\n onClick={onNewChat}>\n <svg aria-hidden=\"true\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\"\n stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M12 5H6a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2v-6\" />\n <path d=\"m15 5 4 4M13 11l7-7a2.12 2.12 0 0 1 3 3l-7 7-4 1 1-4Z\" transform=\"translate(-2 -2)\" />\n </svg>\n </button>\n )}\n <button type=\"button\" className={`${styles.iconButton} ${styles.expandButton}`}\n aria-label={isExpanded ? `Collapse ${title}` : `Expand ${title}`}\n title={isExpanded ? 'Collapse' : 'Expand'}\n onClick={() => changeExpanded(!isExpanded)}>\n {isExpanded ? (\n <svg width=\"17\" height=\"17\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\"\n strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\"><path d=\"M9 3v6H3M15 21v-6h6M3 9l6-6M21 15l-6 6\" /></svg>\n ) : (\n <svg width=\"17\" height=\"17\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\"\n strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\"><path d=\"M8 3H3v5M16 21h5v-5M3 3l7 7M21 21l-7-7\" /></svg>\n )}\n </button>\n <button type=\"button\" className={styles.iconButton}\n aria-label={`Close ${title}`} title=\"Close\"\n onClick={() => changeOpen(false)}>\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\"\n strokeWidth=\"2\" strokeLinecap=\"round\" aria-hidden=\"true\"><path d=\"M18 6 6 18M6 6l12 12\" /></svg>\n </button>\n </div>\n </header>\n <div className={styles.content}>{children}</div>\n </section>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAwCA,SAAgB,WAAW,EACzB,OACA,aACA,eACA,eAAe,MACf,SAAS,mBACT,oBACA,UACA,WACA,kBAAkB,OAClB,MACA,cAAc,OACd,cACA,UACA,kBAAkB,OAClB,kBACA,aACkB;CAClB,MAAM,UAAA,GAAA,MAAA,MAAA,CAAe;CACrB,MAAM,UAAU,qBAAqB,eAAe;CACpD,MAAM,CAAC,cAAc,oBAAA,GAA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|
2
|
+
var stack = "uzi-floating-action-stack-module__stack__5UH0U";
|
|
3
|
+
var action = "uzi-floating-action-stack-module__action__07atd";
|
|
4
|
+
var primary = "uzi-floating-action-stack-module__primary__xoV0q";
|
|
5
|
+
var secondary = "uzi-floating-action-stack-module__secondary__g5tf3";
|
|
6
|
+
var icon = "uzi-floating-action-stack-module__icon__XZoM5";
|
|
7
|
+
var label = "uzi-floating-action-stack-module__label__Rb4A0";
|
|
8
|
+
var floating_action_stack_module_default = {
|
|
9
|
+
stack,
|
|
10
|
+
action,
|
|
11
|
+
primary,
|
|
12
|
+
secondary,
|
|
13
|
+
icon,
|
|
14
|
+
label
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { action, floating_action_stack_module_default as default, icon, label, primary, secondary, stack };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=index89.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index89.js","names":[],"sources":["../src/components/floating-action-stack/floating-action-stack.module.css"],"sourcesContent":["/* One fixed positioning and safe-area system for any number of actions. */\n.stack {\n position: fixed;\n z-index: 60;\n right: max(1.25rem, env(safe-area-inset-right));\n bottom: calc(1.25rem + env(safe-area-inset-bottom));\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n gap: 0.625rem;\n pointer-events: none;\n}\n.stack > * { pointer-events: auto; }\n\n.action {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 0.625rem;\n min-height: 3.5rem;\n padding: 0.7rem 1.1rem;\n border: 1px solid var(--border);\n border-radius: 999px;\n box-shadow: 0 6px 24px color-mix(in srgb, var(--foreground) 20%, transparent);\n font: inherit;\n font-weight: 600;\n cursor: pointer;\n}\n.primary { color: var(--primary-foreground); background: var(--primary); }\n.secondary { color: var(--foreground); background: var(--background); }\n.action:hover { filter: brightness(0.95); }\n.action:focus-visible { outline: 2px solid var(--ring, var(--primary)); outline-offset: 2px; }\n.action:disabled { opacity: 0.5; cursor: not-allowed; }\n.icon { display: flex; flex: none; align-items: center; justify-content: center; }\n.label { white-space: nowrap; }\n\n@media (max-width: 640px) {\n .stack {\n right: max(1rem, env(safe-area-inset-right));\n bottom: calc(1rem + env(safe-area-inset-bottom));\n }\n .action { width: 3.5rem; height: 3.5rem; min-width: 3.5rem; padding: 0; }\n .label { display: none; }\n}\n"],"mappings":""}
|
package/dist/index90.cjs
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//#region src/components/floating-action-stack/floating-action-stack.module.css
|
|
2
|
+
var stack = "uzi-floating-action-stack-module__stack__5UH0U";
|
|
3
|
+
var action = "uzi-floating-action-stack-module__action__07atd";
|
|
4
|
+
var primary = "uzi-floating-action-stack-module__primary__xoV0q";
|
|
5
|
+
var secondary = "uzi-floating-action-stack-module__secondary__g5tf3";
|
|
6
|
+
var icon = "uzi-floating-action-stack-module__icon__XZoM5";
|
|
7
|
+
var label = "uzi-floating-action-stack-module__label__Rb4A0";
|
|
8
|
+
var floating_action_stack_module_default = {
|
|
9
|
+
stack,
|
|
10
|
+
action,
|
|
11
|
+
primary,
|
|
12
|
+
secondary,
|
|
13
|
+
icon,
|
|
14
|
+
label
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
exports.action = action;
|
|
18
|
+
exports.default = floating_action_stack_module_default;
|
|
19
|
+
exports.icon = icon;
|
|
20
|
+
exports.label = label;
|
|
21
|
+
exports.primary = primary;
|
|
22
|
+
exports.secondary = secondary;
|
|
23
|
+
exports.stack = stack;
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=index90.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index90.cjs","names":[],"sources":["../src/components/floating-action-stack/floating-action-stack.module.css"],"sourcesContent":["/* One fixed positioning and safe-area system for any number of actions. */\n.stack {\n position: fixed;\n z-index: 60;\n right: max(1.25rem, env(safe-area-inset-right));\n bottom: calc(1.25rem + env(safe-area-inset-bottom));\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n gap: 0.625rem;\n pointer-events: none;\n}\n.stack > * { pointer-events: auto; }\n\n.action {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 0.625rem;\n min-height: 3.5rem;\n padding: 0.7rem 1.1rem;\n border: 1px solid var(--border);\n border-radius: 999px;\n box-shadow: 0 6px 24px color-mix(in srgb, var(--foreground) 20%, transparent);\n font: inherit;\n font-weight: 600;\n cursor: pointer;\n}\n.primary { color: var(--primary-foreground); background: var(--primary); }\n.secondary { color: var(--foreground); background: var(--background); }\n.action:hover { filter: brightness(0.95); }\n.action:focus-visible { outline: 2px solid var(--ring, var(--primary)); outline-offset: 2px; }\n.action:disabled { opacity: 0.5; cursor: not-allowed; }\n.icon { display: flex; flex: none; align-items: center; justify-content: center; }\n.label { white-space: nowrap; }\n\n@media (max-width: 640px) {\n .stack {\n right: max(1rem, env(safe-area-inset-right));\n bottom: calc(1rem + env(safe-area-inset-bottom));\n }\n .action { width: 3.5rem; height: 3.5rem; min-width: 3.5rem; padding: 0; }\n .label { display: none; }\n}\n"],"mappings":""}
|
package/dist/index90.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import floating_action_stack_module_default from "./index89.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/floating-action-stack/FloatingActionStack.tsx
|
|
5
|
+
function FloatingActionStack({ children, className, label = "Quick actions" }) {
|
|
6
|
+
return /* @__PURE__ */ jsx("nav", {
|
|
7
|
+
"aria-label": label,
|
|
8
|
+
className: [floating_action_stack_module_default.stack, className].filter(Boolean).join(" "),
|
|
9
|
+
children
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
/** A directly accessible action, not a speed-dial menu or nested overlay. */
|
|
13
|
+
function FloatingActionButton({ label, icon, children, variant = "primary", className, ...buttonProps }) {
|
|
14
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
15
|
+
...buttonProps,
|
|
16
|
+
type: "button",
|
|
17
|
+
"aria-label": label,
|
|
18
|
+
className: [
|
|
19
|
+
floating_action_stack_module_default.action,
|
|
20
|
+
variant === "secondary" ? floating_action_stack_module_default.secondary : floating_action_stack_module_default.primary,
|
|
21
|
+
className
|
|
22
|
+
].filter(Boolean).join(" "),
|
|
23
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
24
|
+
className: floating_action_stack_module_default.icon,
|
|
25
|
+
"aria-hidden": "true",
|
|
26
|
+
children: icon
|
|
27
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
28
|
+
className: floating_action_stack_module_default.label,
|
|
29
|
+
children: children ?? label
|
|
30
|
+
})]
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
export { FloatingActionButton, FloatingActionStack };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=index90.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index90.js","names":[],"sources":["../src/components/floating-action-stack/FloatingActionStack.tsx"],"sourcesContent":["'use client';\n\nimport type { ButtonHTMLAttributes, ReactNode } from 'react';\n\nimport styles from './floating-action-stack.module.css';\n\n/** A single screen-edge action rail shared by unrelated application features. */\nexport interface FloatingActionStackProps {\n readonly children: ReactNode;\n readonly className?: string;\n readonly label?: string;\n}\n\nexport function FloatingActionStack({ children, className, label = 'Quick actions' }: FloatingActionStackProps) {\n return (\n <nav\n aria-label={label}\n className={[styles.stack, className].filter(Boolean).join(' ')}\n >\n {children}\n </nav>\n );\n}\n\nexport interface FloatingActionButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {\n /** Stable accessible name, including when the mobile label is hidden. */\n readonly label: string;\n readonly icon: ReactNode;\n readonly children?: ReactNode;\n /** Use secondary styling for contextual actions above the primary launcher. */\n readonly variant?: 'primary' | 'secondary';\n}\n\n/** A directly accessible action, not a speed-dial menu or nested overlay. */\nexport function FloatingActionButton({\n label,\n icon,\n children,\n variant = 'primary',\n className,\n ...buttonProps\n}: FloatingActionButtonProps) {\n return (\n <button\n {...buttonProps}\n type=\"button\"\n aria-label={label}\n className={[styles.action, variant === 'secondary' ? styles.secondary : styles.primary, className]\n .filter(Boolean).join(' ')}\n >\n <span className={styles.icon} aria-hidden=\"true\">{icon}</span>\n <span className={styles.label}>{children ?? label}</span>\n </button>\n );\n}\n"],"mappings":";;;;AAaA,SAAgB,oBAAoB,EAAE,UAAU,WAAW,QAAQ,mBAA6C;CAC9G,OACE,oBAAC,OAAD;EACE,cAAY;EACZ,WAAW,CAAC,qCAAO,OAAO,SAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAE5D;CACE,CAAA;AAET;;AAYA,SAAgB,qBAAqB,EACnC,OACA,MACA,UACA,UAAU,WACV,WACA,GAAG,eACyB;CAC5B,OACE,qBAAC,UAAD;EACE,GAAI;EACJ,MAAK;EACL,cAAY;EACZ,WAAW;GAAC,qCAAO;GAAQ,YAAY,cAAc,qCAAO,YAAY,qCAAO;GAAS;EAAS,CAAC,CAC/F,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;YAL7B,CAOE,oBAAC,QAAD;GAAM,WAAW,qCAAO;GAAM,eAAY;aAAQ;EAAW,CAAA,GAC7D,oBAAC,QAAD;GAAM,WAAW,qCAAO;aAAQ,YAAY;EAAY,CAAA,CAClD;;AAEZ"}
|
package/dist/index91.cjs
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const require_floating_action_stack_module = require("./index90.cjs");
|
|
3
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
|
+
//#region src/components/floating-action-stack/FloatingActionStack.tsx
|
|
5
|
+
function FloatingActionStack({ children, className, label = "Quick actions" }) {
|
|
6
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("nav", {
|
|
7
|
+
"aria-label": label,
|
|
8
|
+
className: [require_floating_action_stack_module.default.stack, className].filter(Boolean).join(" "),
|
|
9
|
+
children
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
/** A directly accessible action, not a speed-dial menu or nested overlay. */
|
|
13
|
+
function FloatingActionButton({ label, icon, children, variant = "primary", className, ...buttonProps }) {
|
|
14
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
15
|
+
...buttonProps,
|
|
16
|
+
type: "button",
|
|
17
|
+
"aria-label": label,
|
|
18
|
+
className: [
|
|
19
|
+
require_floating_action_stack_module.default.action,
|
|
20
|
+
variant === "secondary" ? require_floating_action_stack_module.default.secondary : require_floating_action_stack_module.default.primary,
|
|
21
|
+
className
|
|
22
|
+
].filter(Boolean).join(" "),
|
|
23
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
24
|
+
className: require_floating_action_stack_module.default.icon,
|
|
25
|
+
"aria-hidden": "true",
|
|
26
|
+
children: icon
|
|
27
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
28
|
+
className: require_floating_action_stack_module.default.label,
|
|
29
|
+
children: children ?? label
|
|
30
|
+
})]
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
exports.FloatingActionButton = FloatingActionButton;
|
|
35
|
+
exports.FloatingActionStack = FloatingActionStack;
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=index91.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index91.cjs","names":[],"sources":["../src/components/floating-action-stack/FloatingActionStack.tsx"],"sourcesContent":["'use client';\n\nimport type { ButtonHTMLAttributes, ReactNode } from 'react';\n\nimport styles from './floating-action-stack.module.css';\n\n/** A single screen-edge action rail shared by unrelated application features. */\nexport interface FloatingActionStackProps {\n readonly children: ReactNode;\n readonly className?: string;\n readonly label?: string;\n}\n\nexport function FloatingActionStack({ children, className, label = 'Quick actions' }: FloatingActionStackProps) {\n return (\n <nav\n aria-label={label}\n className={[styles.stack, className].filter(Boolean).join(' ')}\n >\n {children}\n </nav>\n );\n}\n\nexport interface FloatingActionButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {\n /** Stable accessible name, including when the mobile label is hidden. */\n readonly label: string;\n readonly icon: ReactNode;\n readonly children?: ReactNode;\n /** Use secondary styling for contextual actions above the primary launcher. */\n readonly variant?: 'primary' | 'secondary';\n}\n\n/** A directly accessible action, not a speed-dial menu or nested overlay. */\nexport function FloatingActionButton({\n label,\n icon,\n children,\n variant = 'primary',\n className,\n ...buttonProps\n}: FloatingActionButtonProps) {\n return (\n <button\n {...buttonProps}\n type=\"button\"\n aria-label={label}\n className={[styles.action, variant === 'secondary' ? styles.secondary : styles.primary, className]\n .filter(Boolean).join(' ')}\n >\n <span className={styles.icon} aria-hidden=\"true\">{icon}</span>\n <span className={styles.label}>{children ?? label}</span>\n </button>\n );\n}\n"],"mappings":";;;;AAaA,SAAgB,oBAAoB,EAAE,UAAU,WAAW,QAAQ,mBAA6C;CAC9G,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,cAAY;EACZ,WAAW,CAAC,qCAAA,QAAO,OAAO,SAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAE5D;CACE,CAAA;AAET;;AAYA,SAAgB,qBAAqB,EACnC,OACA,MACA,UACA,UAAU,WACV,WACA,GAAG,eACyB;CAC5B,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,UAAD;EACE,GAAI;EACJ,MAAK;EACL,cAAY;EACZ,WAAW;GAAC,qCAAA,QAAO;GAAQ,YAAY,cAAc,qCAAA,QAAO,YAAY,qCAAA,QAAO;GAAS;EAAS,CAAC,CAC/F,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;YAL7B,CAOE,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;GAAM,WAAW,qCAAA,QAAO;GAAM,eAAY;aAAQ;EAAW,CAAA,GAC7D,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;GAAM,WAAW,qCAAA,QAAO;aAAQ,YAAY;EAAY,CAAA,CAClD;;AAEZ"}
|
package/dist/style.css
CHANGED
|
@@ -534,6 +534,31 @@ body {
|
|
|
534
534
|
align-items: center;
|
|
535
535
|
gap: 4px;
|
|
536
536
|
}
|
|
537
|
+
|
|
538
|
+
.uzi-pill-module__interactive__CkNyV {
|
|
539
|
+
font-family: inherit;
|
|
540
|
+
appearance: none;
|
|
541
|
+
cursor: pointer;
|
|
542
|
+
transition: filter 120ms ease, transform 120ms ease;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
.uzi-pill-module__interactive__CkNyV:hover:not(:disabled) {
|
|
546
|
+
filter: brightness(1.15);
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
.uzi-pill-module__interactive__CkNyV:active:not(:disabled) {
|
|
550
|
+
transform: translateY(1px);
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
.uzi-pill-module__interactive__CkNyV:focus-visible {
|
|
554
|
+
outline: 2px solid var(--primary);
|
|
555
|
+
outline-offset: 2px;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
.uzi-pill-module__interactive__CkNyV:disabled {
|
|
559
|
+
cursor: not-allowed;
|
|
560
|
+
opacity: 0.5;
|
|
561
|
+
}
|
|
537
562
|
.uzi-modal-module__portalLayer__t7blc {
|
|
538
563
|
--uzi-modal-viewport-margin: 32px;
|
|
539
564
|
|
|
@@ -3872,10 +3897,7 @@ button.uzi-sidebar-nav-module__item__uMHkJ {
|
|
|
3872
3897
|
gap: 0.625rem;
|
|
3873
3898
|
width: fit-content;
|
|
3874
3899
|
max-width: 100%;
|
|
3875
|
-
padding: 0.
|
|
3876
|
-
border: 1px solid var(--border);
|
|
3877
|
-
border-radius: 0.875rem;
|
|
3878
|
-
background: var(--muted);
|
|
3900
|
+
padding: 0.375rem 0.5rem;
|
|
3879
3901
|
color: var(--muted-foreground);
|
|
3880
3902
|
font-size: 0.8125rem;
|
|
3881
3903
|
line-height: 1.4;
|
|
@@ -3915,7 +3937,9 @@ button.uzi-sidebar-nav-module__item__uMHkJ {
|
|
|
3915
3937
|
padding: 0.75rem 1rem;
|
|
3916
3938
|
border: 1px solid var(--destructive);
|
|
3917
3939
|
border-radius: 0.5rem;
|
|
3918
|
-
|
|
3940
|
+
align-self: flex-start;
|
|
3941
|
+
max-width: min(100%, 42rem);
|
|
3942
|
+
margin: 0;
|
|
3919
3943
|
background: color-mix(in srgb, var(--destructive) 10%, transparent);
|
|
3920
3944
|
}
|
|
3921
3945
|
|
|
@@ -4077,7 +4101,12 @@ button.uzi-sidebar-nav-module__item__uMHkJ {
|
|
|
4077
4101
|
.uzi-ai-chat-module__stagedFileAttachment__hZfVm { width: min(15rem, 75vw); }
|
|
4078
4102
|
.uzi-ai-chat-module__sentAttachment__PP-fs {
|
|
4079
4103
|
width: fit-content;
|
|
4080
|
-
max-width: min(
|
|
4104
|
+
max-width: min(20rem, 100%);
|
|
4105
|
+
}
|
|
4106
|
+
/* Sent images are part of the message, not nested file cards. */
|
|
4107
|
+
.uzi-ai-chat-module__sentImageAttachment__M9wpx {
|
|
4108
|
+
border: 0;
|
|
4109
|
+
background: transparent;
|
|
4081
4110
|
}
|
|
4082
4111
|
.uzi-ai-chat-module__imageAttachmentButton__PM2cf {
|
|
4083
4112
|
display: block;
|
|
@@ -4097,18 +4126,10 @@ button.uzi-sidebar-nav-module__item__uMHkJ {
|
|
|
4097
4126
|
.uzi-ai-chat-module__stagedAttachment__5axXj .uzi-ai-chat-module__attachmentThumbnail__OzmIc { width: 100%; height: 100%; object-fit: cover; }
|
|
4098
4127
|
.uzi-ai-chat-module__sentAttachment__PP-fs .uzi-ai-chat-module__attachmentThumbnail__OzmIc {
|
|
4099
4128
|
width: auto;
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
}
|
|
4103
|
-
.uzi-ai-chat-module__sentAttachmentName__rGevY {
|
|
4104
|
-
display: block;
|
|
4129
|
+
height: auto;
|
|
4130
|
+
min-width: 8rem;
|
|
4105
4131
|
max-width: 100%;
|
|
4106
|
-
|
|
4107
|
-
overflow: hidden;
|
|
4108
|
-
text-overflow: ellipsis;
|
|
4109
|
-
white-space: nowrap;
|
|
4110
|
-
color: var(--muted-foreground);
|
|
4111
|
-
font-size: 0.6875rem;
|
|
4132
|
+
max-height: min(26rem, 60dvh);
|
|
4112
4133
|
}
|
|
4113
4134
|
.uzi-ai-chat-module__fileAttachment__lVB09 {
|
|
4114
4135
|
display: flex;
|