@nadicodeai/ui 12.1.23 → 12.1.25
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/app-mark.d.ts +3 -1
- package/dist/components/app-mark.d.ts.map +1 -1
- package/dist/components/app-mark.js +2 -1
- package/dist/components/button.js +1 -1
- package/dist/components/collection-filters.js +1 -1
- package/dist/components/dashboard-shell.d.ts +5 -1
- package/dist/components/dashboard-shell.d.ts.map +1 -1
- package/dist/components/dashboard-shell.js +4 -4
- package/dist/components/desktop-shell.js +1 -1
- package/dist/components/scope-switcher.js +1 -1
- package/dist/components/sidebar.d.ts +3 -3
- package/dist/components/sidebar.d.ts.map +1 -1
- package/dist/components/sidebar.js +15 -5
- package/dist/components/theme-mode-switcher.js +1 -1
- package/dist/components/toggle.js +3 -3
- package/dist/internal/assistant-ui/attachment.js +3 -3
- package/dist/internal/assistant-ui/thread.js +3 -3
- package/dist/internal/assistant-ui/tooltip-icon-button.js +1 -1
- package/dist/lib/merge-tokens.generated.d.ts +6 -0
- package/dist/lib/merge-tokens.generated.d.ts.map +1 -0
- package/dist/lib/merge-tokens.generated.js +7 -0
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +11 -1
- package/package.json +4 -3
|
@@ -6,6 +6,8 @@ type BrandMark = React.ComponentType<BrandIconProps>;
|
|
|
6
6
|
* `undefined` when the set has none.
|
|
7
7
|
*/
|
|
8
8
|
declare function appMarkFor(app: string): BrandMark | undefined;
|
|
9
|
+
/** The letter an app outside the set is drawn with: its first letter or digit, or a question mark. */
|
|
10
|
+
declare function appInitial(app: string): string;
|
|
9
11
|
type AppMarkProps = Omit<React.ComponentProps<"span">, "children"> & {
|
|
10
12
|
/** The connector's slug, id or display name, e.g. `"google-calendar"`. */
|
|
11
13
|
app: string;
|
|
@@ -23,6 +25,6 @@ type AppMarkProps = Omit<React.ComponentProps<"span">, "children"> & {
|
|
|
23
25
|
* has no mark for it. Never an invented logo and never a fetched favicon.
|
|
24
26
|
*/
|
|
25
27
|
declare function AppMark({ app, size, label, className, style, ...props }: AppMarkProps): React.JSX.Element;
|
|
26
|
-
export { AppMark, appMarkFor };
|
|
28
|
+
export { AppMark, appInitial, appMarkFor };
|
|
27
29
|
export type { AppMarkProps };
|
|
28
30
|
//# sourceMappingURL=app-mark.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-mark.d.ts","sourceRoot":"","sources":["../../src/components/app-mark.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EA0CL,KAAK,cAAc,EACpB,MAAM,0BAA0B,CAAC;AAElC,KAAK,SAAS,GAAG,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;AAoDrD;;;GAGG;AACH,iBAAS,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAGtD;
|
|
1
|
+
{"version":3,"file":"app-mark.d.ts","sourceRoot":"","sources":["../../src/components/app-mark.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EA0CL,KAAK,cAAc,EACpB,MAAM,0BAA0B,CAAC;AAElC,KAAK,SAAS,GAAG,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;AAoDrD;;;GAGG;AACH,iBAAS,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAGtD;AAED,sGAAsG;AACtG,iBAAS,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAOvC;AAOD,KAAK,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,GAAG;IACnE,0EAA0E;IAC1E,GAAG,EAAE,MAAM,CAAC;IACZ,8EAA8E;IAC9E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;GAIG;AACH,iBAAS,OAAO,CAAC,EAAE,GAAG,EAAE,IAAoB,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,YAAY,qBAuC9F;AAED,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC;AAC3C,YAAY,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -59,6 +59,7 @@ function appMarkFor(app) {
|
|
|
59
59
|
const slug = appMarkSlug(app);
|
|
60
60
|
return slug ? MARKS_BY_SLUG[slug] : undefined;
|
|
61
61
|
}
|
|
62
|
+
/** The letter an app outside the set is drawn with: its first letter or digit, or a question mark. */
|
|
62
63
|
function appInitial(app) {
|
|
63
64
|
return (app
|
|
64
65
|
.trim()
|
|
@@ -84,4 +85,4 @@ function AppMark({ app, size = APP_MARK_SIZE, label, className, style, ...props
|
|
|
84
85
|
: {};
|
|
85
86
|
return (_jsx("span", { "data-slot": "app-mark", "data-app": app, "data-mark": Mark ? "brand" : "monogram", className: cn("inline-flex shrink-0 items-center justify-center rounded-md border border-border bg-background text-foreground", className), style: { width: size, height: size, ...style }, ...props, ...labelling, children: Mark ? (_jsx(Mark, { size: Math.round(size * APP_MARK_GLYPH_RATIO) })) : (_jsx("span", { "aria-hidden": "true", className: "font-semibold leading-none text-muted-foreground", "data-slot": "app-mark-monogram", style: { fontSize: Math.max(8, Math.round(size * 0.4)) }, children: appInitial(app) })) }));
|
|
86
87
|
}
|
|
87
|
-
export { AppMark, appMarkFor };
|
|
88
|
+
export { AppMark, appInitial, appMarkFor };
|
|
@@ -15,7 +15,7 @@ const buttonVariants = cva("group/button inline-flex min-h-touch-target min-w-to
|
|
|
15
15
|
link: "text-primary underline-offset-4 hover:underline",
|
|
16
16
|
},
|
|
17
17
|
size: {
|
|
18
|
-
default: "h-control-height gap-1.5 px-control-padding-inline has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
18
|
+
default: "h-control-height gap-1.5 px-control-padding-inline has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [@media(hover:hover)_and_(pointer:fine)]:min-h-control-height",
|
|
19
19
|
xs: "h-6 gap-1 px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
20
20
|
sm: "h-7 gap-1 px-control-padding-inline text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
21
21
|
lg: "h-9 gap-1.5 px-control-padding-inline has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
@@ -46,7 +46,7 @@ export function CollectionFilters({ facets, copy, }) {
|
|
|
46
46
|
.filter((facet) => facet.value)
|
|
47
47
|
.map((facet) => {
|
|
48
48
|
const selected = facet.options.find((option) => option.value === facet.value);
|
|
49
|
-
return (_jsxs(ButtonGroup, { "aria-label": facet.label, className: "min-w-0 max-w-full", children: [_jsx(FilterPicker, { facets: facets, copy: copy, initialField: facet.label, returnFocus: addTrigger, children: _jsxs(Button, { variant: "outline", className: "
|
|
49
|
+
return (_jsxs(ButtonGroup, { "aria-label": facet.label, className: "min-w-0 max-w-full", children: [_jsx(FilterPicker, { facets: facets, copy: copy, initialField: facet.label, returnFocus: addTrigger, children: _jsxs(Button, { variant: "outline", className: "max-w-64", children: [facet.selectedIcon ?? selected?.icon, _jsxs("span", { className: "truncate", children: [facet.label, ":", " ", _jsx("span", { className: selected?.mono ? "nc-type-label-mono" : undefined, children: selected?.label ?? facet.value })] })] }) }), _jsx(Button, { variant: "outline", size: "icon", "aria-label": `${copy.remove}: ${facet.label}`, onClick: () => {
|
|
50
50
|
facet.onValueChange("");
|
|
51
51
|
addTrigger.current?.focus();
|
|
52
52
|
}, children: _jsx(X, { "aria-hidden": "true" }) })] }, facet.label));
|
|
@@ -20,6 +20,10 @@ type DashboardShellProps = Omit<React.ComponentProps<typeof SidebarProvider>, "c
|
|
|
20
20
|
sidebarVariant?: React.ComponentProps<typeof Sidebar>["variant"];
|
|
21
21
|
sidebarCollapsible?: React.ComponentProps<typeof Sidebar>["collapsible"];
|
|
22
22
|
mobileNavigationLabel?: string;
|
|
23
|
+
mobileTitle?: React.ComponentProps<typeof Sidebar>["mobileTitle"];
|
|
24
|
+
mobileDescription?: React.ComponentProps<typeof Sidebar>["mobileDescription"];
|
|
25
|
+
mobileCloseLabel?: React.ComponentProps<typeof Sidebar>["mobileCloseLabel"];
|
|
26
|
+
sidebarRailLabel?: string;
|
|
23
27
|
contentLabel?: string;
|
|
24
28
|
inspectorLabel?: string;
|
|
25
29
|
headerClassName?: string;
|
|
@@ -27,7 +31,7 @@ type DashboardShellProps = Omit<React.ComponentProps<typeof SidebarProvider>, "c
|
|
|
27
31
|
inspectorClassName?: string;
|
|
28
32
|
sidebarResize?: DashboardShellSidebarResize;
|
|
29
33
|
};
|
|
30
|
-
declare function DashboardShell({ sidebar, header, headerActions, inspector, children, sidebarHeader, sidebarFooter, sidebarSide, sidebarVariant, sidebarCollapsible, mobileNavigationLabel, contentLabel, inspectorLabel, className, headerClassName, contentClassName, inspectorClassName, sidebarResize, ...props }: DashboardShellProps): React.JSX.Element;
|
|
34
|
+
declare function DashboardShell({ sidebar, header, headerActions, inspector, children, sidebarHeader, sidebarFooter, sidebarSide, sidebarVariant, sidebarCollapsible, mobileNavigationLabel, mobileTitle, mobileDescription, mobileCloseLabel, sidebarRailLabel, contentLabel, inspectorLabel, className, headerClassName, contentClassName, inspectorClassName, sidebarResize, ...props }: DashboardShellProps): React.JSX.Element;
|
|
31
35
|
export { DashboardShell };
|
|
32
36
|
export type { DashboardShellProps, DashboardShellSidebarResize };
|
|
33
37
|
//# sourceMappingURL=dashboard-shell.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":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, ResizablePanel, ResizablePanelGroup } from "./resizable.js";
|
|
7
7
|
import { Sidebar, SidebarContent, SidebarFooter, SidebarHeader, SidebarInset, SidebarProvider, SidebarRail, SidebarTrigger, useSidebar, } from "./sidebar.js";
|
|
8
8
|
const oneYearInSeconds = 60 * 60 * 24 * 365;
|
|
9
|
-
function EmbeddedResizableSidebar({ children, collapsible, includeRail, side, variant, }) {
|
|
9
|
+
function EmbeddedResizableSidebar({ children, collapsible, includeRail, railLabel, side, variant, }) {
|
|
10
10
|
const { state } = useSidebar();
|
|
11
|
-
return (_jsxs("div", { className: "group peer relative h-full text-sidebar-foreground", "data-collapsible": state === "collapsed" ? collapsible : "", "data-side": side, "data-slot": "sidebar", "data-state": state, "data-variant": variant, children: [_jsx("div", { "data-side": side, "data-slot": "sidebar-container", className: "flex size-full text-sidebar-foreground", children: _jsx("div", { "data-sidebar": "sidebar", "data-slot": "sidebar-inner", className: "flex size-full flex-col bg-sidebar", children: children }) }), includeRail ? _jsx(SidebarRail, {}) : null] }));
|
|
11
|
+
return (_jsxs("div", { className: "group peer relative h-full text-sidebar-foreground", "data-collapsible": state === "collapsed" ? collapsible : "", "data-side": side, "data-slot": "sidebar", "data-state": state, "data-variant": variant, children: [_jsx("div", { "data-side": side, "data-slot": "sidebar-container", className: "flex size-full text-sidebar-foreground", children: _jsx("div", { "data-sidebar": "sidebar", "data-slot": "sidebar-inner", className: "flex size-full flex-col bg-sidebar", children: children }) }), includeRail ? _jsx(SidebarRail, { "aria-label": railLabel }) : null] }));
|
|
12
12
|
}
|
|
13
13
|
function DashboardResizablePanelGroup({ bodySlot, contentPanelMinSize, handleLayoutChanged, resizableGroupId, sidebarCollapsible, sidebarPanelDefaultSize, sidebarPanelMaxSize, sidebarPanelMinSize, sidebarSlot, }) {
|
|
14
14
|
const { state } = useSidebar();
|
|
@@ -25,7 +25,7 @@ function DashboardResizablePanelGroup({ bodySlot, contentPanelMinSize, handleLay
|
|
|
25
25
|
}, [sidebarCollapsible, state]);
|
|
26
26
|
return (_jsxs(ResizablePanelGroup, { className: "min-h-svh", id: resizableGroupId, onLayoutChanged: (layout) => handleLayoutChanged(layout, state), orientation: "horizontal", children: [_jsx(ResizablePanel, { collapsedSize: "3rem", collapsible: sidebarCollapsible !== "none", defaultSize: `${sidebarPanelDefaultSize}%`, id: "dashboard-sidebar", maxSize: `${sidebarPanelMaxSize}%`, minSize: `${sidebarPanelMinSize}%`, panelRef: sidebarPanelRef, children: sidebarSlot(sidebarCollapsible, true, true) }), _jsx(ResizableHandle, { withHandle: true }), _jsx(ResizablePanel, { id: "dashboard-content", minSize: `${contentPanelMinSize}%`, children: bodySlot })] }));
|
|
27
27
|
}
|
|
28
|
-
function DashboardShell({ sidebar, header, headerActions, inspector, children, sidebarHeader, sidebarFooter, sidebarSide = "left", sidebarVariant = "sidebar", sidebarCollapsible = "icon", mobileNavigationLabel = "Open navigation", contentLabel = "Dashboard content", inspectorLabel = "Inspector", className, headerClassName, contentClassName, inspectorClassName, sidebarResize, ...props }) {
|
|
28
|
+
function DashboardShell({ sidebar, header, headerActions, inspector, children, sidebarHeader, sidebarFooter, sidebarSide = "left", sidebarVariant = "sidebar", sidebarCollapsible = "icon", mobileNavigationLabel = "Open navigation", mobileTitle, mobileDescription, mobileCloseLabel, sidebarRailLabel, contentLabel = "Dashboard content", inspectorLabel = "Inspector", className, headerClassName, contentClassName, inspectorClassName, sidebarResize, ...props }) {
|
|
29
29
|
const isMobile = useIsMobile();
|
|
30
30
|
const [hasMeasuredViewport, setHasMeasuredViewport] = React.useState(false);
|
|
31
31
|
const sidebarWidthCookieTimeoutRef = React.useRef(undefined);
|
|
@@ -68,7 +68,7 @@ function DashboardShell({ sidebar, header, headerActions, inspector, children, s
|
|
|
68
68
|
}
|
|
69
69
|
}, [persistSidebarSize, resolvedSidebarPanelCookieName, sidebarPanelMinSize]);
|
|
70
70
|
const canResizeSidebar = !!sidebarResize && hasMeasuredViewport && !isMobile && sidebarSide === "left";
|
|
71
|
-
const sidebarSlot = (collapsible, includeRail, embedded = false) => embedded ? (_jsxs(EmbeddedResizableSidebar, { collapsible: collapsible, includeRail: includeRail, side: sidebarSide, variant: sidebarVariant, children: [sidebarHeader && _jsx(SidebarHeader, { children: sidebarHeader }), _jsx(SidebarContent, { children: sidebar }), sidebarFooter && _jsx(SidebarFooter, { children: sidebarFooter })] })) : (_jsxs(Sidebar, { side: sidebarSide, variant: sidebarVariant, collapsible: collapsible, children: [sidebarHeader && _jsx(SidebarHeader, { children: sidebarHeader }), _jsx(SidebarContent, { children: sidebar }), sidebarFooter && _jsx(SidebarFooter, { children: sidebarFooter }), includeRail ? _jsx(SidebarRail, {}) : null] }));
|
|
71
|
+
const sidebarSlot = (collapsible, includeRail, embedded = false) => embedded ? (_jsxs(EmbeddedResizableSidebar, { collapsible: collapsible, includeRail: includeRail, railLabel: sidebarRailLabel, side: sidebarSide, variant: sidebarVariant, children: [sidebarHeader && _jsx(SidebarHeader, { children: sidebarHeader }), _jsx(SidebarContent, { children: sidebar }), sidebarFooter && _jsx(SidebarFooter, { children: sidebarFooter })] })) : (_jsxs(Sidebar, { side: sidebarSide, variant: sidebarVariant, collapsible: collapsible, mobileTitle: mobileTitle, mobileDescription: mobileDescription, mobileCloseLabel: mobileCloseLabel, children: [sidebarHeader && _jsx(SidebarHeader, { children: sidebarHeader }), _jsx(SidebarContent, { children: sidebar }), sidebarFooter && _jsx(SidebarFooter, { children: sidebarFooter }), includeRail ? _jsx(SidebarRail, { "aria-label": sidebarRailLabel }) : null] }));
|
|
72
72
|
const bodySlot = (_jsxs(SidebarInset, { className: "size-full min-w-0 overflow-hidden", children: [_jsxs("header", { "data-slot": "dashboard-shell-header", className: cn("flex h-14 shrink-0 items-center justify-between gap-3 border-b bg-background px-3 md:px-4", headerClassName), children: [_jsxs("div", { "data-slot": "dashboard-shell-header-content", className: "flex min-w-0 flex-1 items-center gap-2", children: [_jsx(SidebarTrigger, { "data-slot": "dashboard-shell-mobile-trigger", "aria-label": mobileNavigationLabel, className: "md:hidden" }), _jsx("div", { className: "min-w-0 flex-1", children: header })] }), headerActions && (_jsx("div", { "data-slot": "dashboard-shell-header-actions", className: "flex shrink-0 items-center gap-2", children: headerActions }))] }), _jsxs("div", { "data-slot": "dashboard-shell-body", className: "flex min-h-0 flex-1 flex-col lg:flex-row", children: [_jsx("main", { "data-slot": "dashboard-shell-content", "aria-label": contentLabel, className: cn("min-h-0 min-w-0 flex-1 overflow-auto p-4 md:p-6", contentClassName), children: children }), inspector && (_jsx("aside", { "data-slot": "dashboard-shell-inspector", "aria-label": inspectorLabel, className: cn("min-h-0 border-t bg-background lg:w-80 lg:border-t-0 lg:border-l", inspectorClassName), children: _jsx("div", { "data-slot": "dashboard-shell-inspector-content", className: "max-h-96 overflow-auto p-4 lg:h-full lg:max-h-none", children: inspector }) }))] })] }));
|
|
73
73
|
return (_jsx(SidebarProvider, { "data-slot": "dashboard-shell", className: cn("min-h-svh bg-background", className), ...props, children: canResizeSidebar ? (_jsx(DashboardResizablePanelGroup, { bodySlot: bodySlot, contentPanelMinSize: contentPanelMinSize, handleLayoutChanged: handleLayoutChanged, resizableGroupId: resizableGroupId, sidebarCollapsible: sidebarCollapsible, sidebarPanelDefaultSize: sidebarPanelDefaultSize, sidebarPanelMaxSize: sidebarPanelMaxSize, sidebarPanelMinSize: sidebarPanelMinSize, sidebarSlot: sidebarSlot })) : (_jsxs(_Fragment, { children: [sidebarSlot(sidebarCollapsible, true), bodySlot] })) }));
|
|
74
74
|
}
|
|
@@ -3,6 +3,6 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
3
3
|
import { cn } from "../lib/utils.js";
|
|
4
4
|
import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from "./resizable.js";
|
|
5
5
|
function DesktopAppShell({ title, titlebar, titlebarActions, activityRail, inspectorRail, secondaryPane, statusbar, children, activityRailLabel = "Activity", primaryPaneLabel = "Primary workspace", secondaryPaneLabel = "Secondary workspace", inspectorRailLabel = "Inspector", primaryPaneSize = secondaryPane || inspectorRail ? 58 : 100, secondaryPaneSize = inspectorRail ? 24 : 36, inspectorPaneSize = 18, className, titlebarClassName, bodyClassName, primaryPaneClassName, secondaryPaneClassName, inspectorRailClassName, statusbarClassName, ...props }) {
|
|
6
|
-
return (_jsxs("section", { "data-slot": "desktop-app-shell", className: cn("flex h-svh min-h-0 flex-col overflow-hidden border bg-background text-foreground", className), ...props, children: [_jsxs("header", { "data-slot": "desktop-app-titlebar", className: cn("flex h-11 shrink-0 items-center justify-between gap-3 border-b bg-background px-3", titlebarClassName), children: [titlebar ?? (_jsx("div", { "data-slot": "desktop-app-titlebar-content", className: "flex min-w-0 flex-1 items-center gap-2", children: title && _jsx("h1", { className: "truncate text-sm font-medium", children: title }) })), titlebarActions && (_jsx("div", { "data-slot": "desktop-app-titlebar-actions", className: "flex shrink-0 items-center gap-2", children: titlebarActions }))] }), _jsxs("div", { "data-slot": "desktop-app-body", className: cn("flex min-h-0 flex-1", bodyClassName), children: [activityRail && (_jsx("nav", { "data-slot": "desktop-app-activity-rail", "aria-label": activityRailLabel, className: "flex w-14 shrink-0 flex-col items-center gap-2 border-r bg-sidebar p-2 text-sidebar-foreground", children: activityRail })), _jsx("div", { "data-slot": "desktop-app-panes", className: "min-w-0 flex-1", children: _jsxs(ResizablePanelGroup, { orientation: "horizontal", className: "min-w-0 flex-1", children: [_jsx(ResizablePanel, { defaultSize: primaryPaneSize, minSize: 30, children: _jsx("
|
|
6
|
+
return (_jsxs("section", { "data-slot": "desktop-app-shell", className: cn("flex h-svh min-h-0 flex-col overflow-hidden border bg-background text-foreground", className), ...props, children: [_jsxs("header", { "data-slot": "desktop-app-titlebar", className: cn("flex h-11 shrink-0 items-center justify-between gap-3 border-b bg-background px-3", titlebarClassName), children: [titlebar ?? (_jsx("div", { "data-slot": "desktop-app-titlebar-content", className: "flex min-w-0 flex-1 items-center gap-2", children: title && _jsx("h1", { className: "truncate text-sm font-medium", children: title }) })), titlebarActions && (_jsx("div", { "data-slot": "desktop-app-titlebar-actions", className: "flex shrink-0 items-center gap-2", children: titlebarActions }))] }), _jsxs("div", { "data-slot": "desktop-app-body", className: cn("flex min-h-0 flex-1", bodyClassName), children: [activityRail && (_jsx("nav", { "data-slot": "desktop-app-activity-rail", "aria-label": activityRailLabel, className: "flex w-14 shrink-0 flex-col items-center gap-2 border-r bg-sidebar p-2 text-sidebar-foreground", children: activityRail })), _jsx("div", { "data-slot": "desktop-app-panes", className: "min-w-0 flex-1", children: _jsxs(ResizablePanelGroup, { orientation: "horizontal", className: "min-w-0 flex-1", children: [_jsx(ResizablePanel, { defaultSize: primaryPaneSize, minSize: 30, children: _jsx("section", { "data-slot": "desktop-app-primary-pane", "aria-label": primaryPaneLabel, className: cn("h-full min-w-0 overflow-auto bg-background", primaryPaneClassName), children: children }) }), secondaryPane && (_jsxs(_Fragment, { children: [_jsx(ResizableHandle, { withHandle: true }), _jsx(ResizablePanel, { defaultSize: secondaryPaneSize, minSize: 18, children: _jsx("section", { "data-slot": "desktop-app-secondary-pane", "aria-label": secondaryPaneLabel, className: cn("h-full min-w-0 overflow-auto bg-background", secondaryPaneClassName), children: secondaryPane }) })] })), inspectorRail && (_jsxs(_Fragment, { children: [_jsx(ResizableHandle, { withHandle: true }), _jsx(ResizablePanel, { defaultSize: inspectorPaneSize, minSize: 16, maxSize: 36, children: _jsx("aside", { "data-slot": "desktop-app-inspector-rail", "aria-label": inspectorRailLabel, className: cn("h-full min-w-0 overflow-auto bg-background", inspectorRailClassName), children: inspectorRail }) })] }))] }) })] }), statusbar && (_jsx("footer", { "data-slot": "desktop-app-statusbar", className: cn("flex min-h-8 shrink-0 items-center justify-between gap-3 border-t bg-background px-3 text-xs text-muted-foreground", statusbarClassName), children: statusbar }))] }));
|
|
7
7
|
}
|
|
8
8
|
export { DesktopAppShell };
|
|
@@ -23,7 +23,7 @@ export function ScopeSwitcher({ value, options, onValueChange, copy, create }) {
|
|
|
23
23
|
if (next !== value)
|
|
24
24
|
onValueChange(next);
|
|
25
25
|
};
|
|
26
|
-
return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsxs(PopoverTrigger, { render: _jsx(Button, { variant: "ghost", "aria-label": `${copy.label}: ${current?.label ?? value}`, className: "
|
|
26
|
+
return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsxs(PopoverTrigger, { render: _jsx(Button, { variant: "ghost", "aria-label": `${copy.label}: ${current?.label ?? value}`, className: "max-w-64" }), children: [_jsx("span", { className: "truncate", children: current?.label ?? value }), _jsx(ChevronsUpDown, { "data-icon": "inline-end", "aria-hidden": "true" })] }), _jsxs(PopoverContent, { align: "start", className: "w-72 p-0", initialFocus: search, children: [_jsx(PopoverTitle, { className: "sr-only", children: copy.label }), _jsxs(Command, { label: copy.search, children: [_jsx(CommandInput, { ref: search, "aria-label": copy.search, placeholder: copy.search }), _jsxs(CommandList, { label: copy.label, children: [_jsx(CommandEmpty, { children: copy.empty }), groups.map(([group, items]) => (_jsx(CommandGroup, { heading: group, children: items.map((option) => (_jsx(CommandItem, { value: option.value, keywords: [
|
|
27
27
|
option.label,
|
|
28
28
|
...(option.group ? [option.group] : []),
|
|
29
29
|
...(option.keywords ?? []),
|
|
@@ -37,11 +37,11 @@ type SidebarProps = React.ComponentProps<"div"> & {
|
|
|
37
37
|
mobileFinalFocus?: React.ComponentProps<typeof SheetContent>["finalFocus"];
|
|
38
38
|
};
|
|
39
39
|
declare function Sidebar({ side, variant, collapsible, mobileTitle, mobileDescription, mobileCloseLabel, mobileFinalFocus, className, children, dir, ...props }: SidebarProps): React.JSX.Element;
|
|
40
|
-
declare function SidebarTrigger({ className, onClick, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
|
|
40
|
+
declare function SidebarTrigger({ className, onClick, "aria-label": ariaLabel, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
|
|
41
41
|
declare function SidebarRail({ className, "aria-label": ariaLabel, title, ...props }: React.ComponentProps<"button">): React.JSX.Element;
|
|
42
|
-
declare function SidebarInset({ className, focusTarget, ...props }: React.ComponentProps<"
|
|
42
|
+
declare function SidebarInset({ className, focusTarget, render, ...props }: useRender.ComponentProps<"div"> & React.ComponentProps<"div"> & {
|
|
43
43
|
focusTarget?: boolean;
|
|
44
|
-
}): React.
|
|
44
|
+
}): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
45
45
|
declare function SidebarInput({ className, ...props }: React.ComponentProps<typeof Input>): React.JSX.Element;
|
|
46
46
|
declare function SidebarHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
47
47
|
declare function SidebarFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../src/components/sidebar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAS,YAAY,EAA6C,MAAM,oBAAoB,CAAC;AAEpG,OAAO,EAAW,cAAc,EAAmC,MAAM,sBAAsB,CAAC;AAUhG,KAAK,mBAAmB,GAAG;IACzB,KAAK,EAAE,UAAU,GAAG,WAAW,CAAC;IAChC,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACjC,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,EAAE,M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IAAI,CAAC,qBAS9E;AAED,iBAAS,oBAAoB,CAAC,EAC5B,MAAM,EACN,IAAW,EACX,QAAgB,EAChB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,SAAS,CAAC,cAAc,CAAC,GAAG,CAAC,GAC9B,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG;IAC1B,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,0EAoBF;AAED,OAAO,EACL,OAAO,EACP,cAAc,EACd,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,UAAU,GACX,CAAC"}
|
|
@@ -100,19 +100,29 @@ function Sidebar({ side = "left", variant = "sidebar", collapsible = "offcanvas"
|
|
|
100
100
|
? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+var(--nc-rounded-xs))]"
|
|
101
101
|
: "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l", className), ...props, children: _jsx("div", { "data-sidebar": "sidebar", "data-slot": "sidebar-inner", className: "flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-md group-data-[variant=floating]:border-0 group-data-[variant=floating]:bg-popover group-data-[variant=floating]:nc-elevation-floating", children: children }) })] }));
|
|
102
102
|
}
|
|
103
|
-
function SidebarTrigger({ className, onClick, ...props }) {
|
|
103
|
+
function SidebarTrigger({ className, onClick, "aria-label": ariaLabel, ...props }) {
|
|
104
104
|
const { toggleSidebar } = useSidebar();
|
|
105
|
-
|
|
105
|
+
const named = ariaLabel !== undefined || props["aria-labelledby"] !== undefined;
|
|
106
|
+
return (_jsxs(Button, { "data-sidebar": "trigger", "data-slot": "sidebar-trigger", variant: "ghost", size: "icon-sm", className: cn(className), "aria-label": ariaLabel, onClick: (event) => {
|
|
106
107
|
onClick?.(event);
|
|
107
108
|
toggleSidebar();
|
|
108
|
-
}, ...props, children: [_jsx(PanelLeftIcon, {}), _jsx("span", { className: "sr-only", children: "Toggle Sidebar" })] }));
|
|
109
|
+
}, ...props, children: [_jsx(PanelLeftIcon, {}), named ? null : _jsx("span", { className: "sr-only", children: "Toggle Sidebar" })] }));
|
|
109
110
|
}
|
|
110
111
|
function SidebarRail({ className, "aria-label": ariaLabel = "Toggle Sidebar", title, ...props }) {
|
|
111
112
|
const { toggleSidebar } = useSidebar();
|
|
112
113
|
return (_jsx("button", { "data-sidebar": "rail", "data-slot": "sidebar-rail", "aria-label": ariaLabel, title: title ?? ariaLabel, tabIndex: -1, onClick: toggleSidebar, className: cn("absolute inset-y-0 z-20 hidden w-11 group-data-[side=left]:-right-11 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-0.5 hover:after:bg-sidebar-border sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2 [@media(hover:hover)_and_(pointer:fine)]:w-4 [@media(hover:hover)_and_(pointer:fine)]:group-data-[side=left]:-right-4", "in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize", "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize", "group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar", "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2", "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2", className), ...props }));
|
|
113
114
|
}
|
|
114
|
-
function SidebarInset({ className, focusTarget = false, ...props }) {
|
|
115
|
-
return (
|
|
115
|
+
function SidebarInset({ className, focusTarget = false, render, ...props }) {
|
|
116
|
+
return useRender({
|
|
117
|
+
defaultTagName: "div",
|
|
118
|
+
props: mergeProps({
|
|
119
|
+
className: cn("relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-md md:peer-data-[variant=inset]:border md:peer-data-[variant=inset]:border-border md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2", focusTarget && "focus-visible:-outline-offset-[var(--outline-offset-focus)]", className),
|
|
120
|
+
}, props),
|
|
121
|
+
render,
|
|
122
|
+
state: {
|
|
123
|
+
slot: "sidebar-inset",
|
|
124
|
+
},
|
|
125
|
+
});
|
|
116
126
|
}
|
|
117
127
|
function SidebarInput({ className, ...props }) {
|
|
118
128
|
return (_jsx(Input, { "data-slot": "sidebar-input", "data-sidebar": "input", className: cn("h-control-height w-full bg-background shadow-none", className), ...props }));
|
|
@@ -27,7 +27,7 @@ function ThemeModeSwitcher({ "aria-label": ariaLabel, className, compact = false
|
|
|
27
27
|
// foreground with it. Left on the radio primitive's on-primary
|
|
28
28
|
// foreground, the selected label reads white on near-white in
|
|
29
29
|
// light and black on black in dark.
|
|
30
|
-
"aspect-auto w-auto
|
|
30
|
+
"aspect-auto w-auto gap-1.5 data-checked:bg-muted data-checked:text-foreground", compact && "text-xs", itemClassName), disabled: disabled, value: mode, children: renderItem ? (renderItem({ Icon, label, mode, selected })) : (_jsxs(_Fragment, { children: [_jsx(Icon, { "aria-hidden": "true", "data-icon": true }), _jsx("span", { className: "min-w-0 truncate", children: label })] })) }, mode));
|
|
31
31
|
}) }));
|
|
32
32
|
}
|
|
33
33
|
export { ThemeModeSwitcher };
|
|
@@ -10,9 +10,9 @@ const toggleVariants = cva("group/toggle inline-flex min-h-touch-target min-w-to
|
|
|
10
10
|
outline: "border-input bg-transparent hover:bg-muted",
|
|
11
11
|
},
|
|
12
12
|
size: {
|
|
13
|
-
default: "h-control-height
|
|
14
|
-
sm: "h-7
|
|
15
|
-
lg: "h-9
|
|
13
|
+
default: "h-control-height px-control-padding-inline has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
14
|
+
sm: "h-7 px-control-padding-inline text-xs has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
15
|
+
lg: "h-9 px-control-padding-inline has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
16
16
|
},
|
|
17
17
|
},
|
|
18
18
|
defaultVariants: {
|
|
@@ -45,7 +45,7 @@ const AttachmentPreviewDialog = ({ children }) => {
|
|
|
45
45
|
const src = useAttachmentSrc();
|
|
46
46
|
if (!src)
|
|
47
47
|
return children;
|
|
48
|
-
return (_jsxs(Dialog, { children: [_jsx(DialogTrigger, { nativeButton: false, className: "aui-attachment-preview-trigger", render: isValidElement(children) ? children : _jsx("button", { type: "button" }) }), _jsxs(DialogContent, { className: "aui-attachment-preview-dialog-content
|
|
48
|
+
return (_jsxs(Dialog, { children: [_jsx(DialogTrigger, { nativeButton: false, className: "aui-attachment-preview-trigger", render: isValidElement(children) ? children : _jsx("button", { type: "button" }) }), _jsxs(DialogContent, { className: "aui-attachment-preview-dialog-content sm:max-w-3xl", children: [_jsx(DialogTitle, { className: "aui-sr-only sr-only", children: "Image Attachment Preview" }), _jsx("div", { className: "aui-attachment-preview bg-background relative mx-auto flex max-h-[80dvh] w-full items-center justify-center overflow-hidden rounded-sm", children: _jsx(AttachmentPreview, { src: src }) })] })] }));
|
|
49
49
|
};
|
|
50
50
|
const AttachmentThumb = () => {
|
|
51
51
|
const src = useAttachmentSrc();
|
|
@@ -81,7 +81,7 @@ const AttachmentUI = () => {
|
|
|
81
81
|
return (_jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsxs(AttachmentPrimitive.Root, { className: cn("aui-attachment-root relative", isComposer && "nc-transition-opacity", isImage && !isComposer && "aui-attachment-root-message only:*:first:size-24"), children: [_jsx(AttachmentPreviewDialog, { children: _jsxs(TooltipTrigger, { render: _jsx("div", { className: cn("aui-attachment-tile nc-transition-transform relative size-14 cursor-pointer overflow-hidden rounded-[calc(var(--composer-radius)-var(--composer-padding))] bg-muted after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:ring-1 after:ring-border after:ring-inset hover:after:bg-foreground/10", isError && "after:ring-destructive/60"), role: "button", tabIndex: 0, "aria-label": `${typeLabel} attachment${isError ? ", upload failed" : isUploading ? ", uploading" : ""}` }), children: [_jsx(AttachmentThumb, {}), isUploading && (_jsx("div", { "aria-hidden": "true", className: "aui-attachment-tile-uploading nc-transition-opacity absolute inset-0 flex items-center justify-center bg-muted", children: _jsx(WaitingLine, { className: "w-8", decorative: true }) })), isError && (_jsx("div", { "aria-hidden": "true", className: "aui-attachment-tile-error nc-transition-opacity absolute inset-0 flex items-center justify-center bg-muted", children: _jsx(AlertCircleIcon, { className: "text-destructive size-4" }) }))] }) }), isComposer && _jsx(AttachmentRemove, {})] }), _jsxs(TooltipContent, { side: "top", children: [_jsx(AttachmentPrimitive.Name, {}), errorMessage && _jsx("p", { className: "aui-attachment-error-message", children: errorMessage })] })] }) }));
|
|
82
82
|
};
|
|
83
83
|
const AttachmentRemove = () => {
|
|
84
|
-
return (_jsx(AttachmentPrimitive.Remove, { render: _jsx(TooltipIconButton, { tooltip: "Remove file", className: "aui-attachment-tile-remove absolute end-1 top-1
|
|
84
|
+
return (_jsx(AttachmentPrimitive.Remove, { render: _jsx(TooltipIconButton, { tooltip: "Remove file", className: "aui-attachment-tile-remove absolute end-1 top-1 rounded-md bg-background nc-elevation-floating after:absolute after:-inset-1.5", side: "top" }), children: _jsx(XIcon, { className: "aui-attachment-remove-icon size-3 stroke-[2.5]" }) }));
|
|
85
85
|
};
|
|
86
86
|
export const UserMessageAttachments = () => {
|
|
87
87
|
return (_jsx("div", { className: "aui-user-message-attachments-end col-span-full col-start-1 row-start-1 flex w-full flex-row justify-end gap-2", children: _jsx(MessagePrimitive.Attachments, { children: () => _jsx(AttachmentUI, {}) }) }));
|
|
@@ -90,5 +90,5 @@ export const ComposerAttachments = () => {
|
|
|
90
90
|
return (_jsx("div", { className: "aui-composer-attachments flex w-full flex-row items-center gap-2 overflow-x-auto empty:hidden", children: _jsx(ComposerPrimitive.Attachments, { children: () => _jsx(AttachmentUI, {}) }) }));
|
|
91
91
|
};
|
|
92
92
|
export const ComposerAddAttachment = () => {
|
|
93
|
-
return (_jsx(ComposerPrimitive.AddAttachment, { render: _jsx(TooltipIconButton, { tooltip: "Add Attachment", side: "bottom", variant: "ghost", size: "icon", className: "aui-composer-add-attachment
|
|
93
|
+
return (_jsx(ComposerPrimitive.AddAttachment, { render: _jsx(TooltipIconButton, { tooltip: "Add Attachment", side: "bottom", variant: "ghost", size: "icon", className: "aui-composer-add-attachment rounded-md p-1 text-xs font-semibold", "aria-label": "Add Attachment" }), children: _jsx(PlusIcon, { className: "aui-attachment-add-icon size-4.5 stroke-[1.5px]" }) }));
|
|
94
94
|
};
|
|
@@ -52,13 +52,13 @@ const ThreadSuggestions = () => {
|
|
|
52
52
|
return (_jsx("div", { className: "aui-thread-welcome-suggestions flex w-full flex-wrap items-center justify-center gap-2 px-4", children: _jsx(ThreadPrimitive.Suggestions, { children: () => _jsx(ThreadSuggestionItem, {}) }) }));
|
|
53
53
|
};
|
|
54
54
|
const ThreadSuggestionItem = () => {
|
|
55
|
-
return (_jsx("div", { className: "aui-thread-welcome-suggestion-display", children: _jsxs(SuggestionPrimitive.Trigger, { send: true, render: _jsx(Button, { variant: "ghost", className: "aui-thread-welcome-suggestion text-foreground hover:bg-muted border-border
|
|
55
|
+
return (_jsx("div", { className: "aui-thread-welcome-suggestion-display", children: _jsxs(SuggestionPrimitive.Trigger, { send: true, render: _jsx(Button, { variant: "ghost", className: "aui-thread-welcome-suggestion text-foreground hover:bg-muted border-border gap-1.5 rounded-md border py-1.5 text-sm font-normal whitespace-nowrap transition-colors" }), children: [_jsx(SuggestionPrimitive.Title, { className: "aui-thread-welcome-suggestion-text-1" }), _jsx(SuggestionPrimitive.Description, { className: "aui-thread-welcome-suggestion-text-2 empty:hidden" })] }) }));
|
|
56
56
|
};
|
|
57
57
|
const Composer = () => {
|
|
58
58
|
return (_jsx(ComposerPrimitive.Root, { className: "aui-composer-root relative flex w-full flex-col", children: _jsxs(ComposerPrimitive.AttachmentDropzone, { render: _jsx("div", { "data-slot": "aui_composer-shell", className: "nc-transition-paint flex w-full flex-col gap-2 rounded-(--composer-radius) border border-border bg-(--composer-bg) p-(--composer-padding) focus-within:border-ring data-[dragging=true]:border-dashed data-[dragging=true]:border-ring data-[dragging=true]:bg-accent" }), children: [_jsx(ComposerAttachments, {}), _jsx(ComposerPrimitive.Input, { placeholder: "Send a message...", className: "aui-composer-input caret-primary placeholder:text-muted-foreground/80 max-h-32 min-h-10 w-full resize-none bg-transparent px-2.5 py-1 text-base outline-none", rows: 1, autoFocus: true, enterKeyHint: "send", "aria-label": "Message input" }), _jsx(ComposerAction, {})] }) }));
|
|
59
59
|
};
|
|
60
60
|
const ComposerAction = () => {
|
|
61
|
-
return (_jsxs("div", { className: "aui-composer-action-wrapper relative flex items-center justify-between", children: [_jsx(ComposerAddAttachment, {}), _jsxs("div", { className: "flex items-center gap-1.5", children: [_jsxs(AuiIf, { condition: (s) => s.thread.capabilities.dictation, children: [_jsx(AuiIf, { condition: (s) => s.composer.dictation == null, children: _jsx(ComposerPrimitive.Dictate, { render: _jsx(TooltipIconButton, { tooltip: "Voice input", side: "bottom", type: "button", variant: "ghost", size: "icon", className: "aui-composer-dictate
|
|
61
|
+
return (_jsxs("div", { className: "aui-composer-action-wrapper relative flex items-center justify-between", children: [_jsx(ComposerAddAttachment, {}), _jsxs("div", { className: "flex items-center gap-1.5", children: [_jsxs(AuiIf, { condition: (s) => s.thread.capabilities.dictation, children: [_jsx(AuiIf, { condition: (s) => s.composer.dictation == null, children: _jsx(ComposerPrimitive.Dictate, { render: _jsx(TooltipIconButton, { tooltip: "Voice input", side: "bottom", type: "button", variant: "ghost", size: "icon", className: "aui-composer-dictate rounded-md", "aria-label": "Start voice input" }), children: _jsx(MicIcon, { className: "aui-composer-dictate-icon size-4" }) }) }), _jsx(AuiIf, { condition: (s) => s.composer.dictation != null, children: _jsx(ComposerPrimitive.StopDictation, { render: _jsx(TooltipIconButton, { tooltip: "Stop dictation", side: "bottom", type: "button", variant: "ghost", size: "icon", className: "aui-composer-stop-dictation text-destructive rounded-md", "aria-label": "Stop voice input" }), children: _jsx(SquareIcon, { className: "aui-composer-stop-dictation-icon size-3.5 fill-current" }) }) })] }), _jsx(AuiIf, { condition: (s) => !s.thread.isRunning, children: _jsx(ComposerPrimitive.Send, { render: _jsx(TooltipIconButton, { tooltip: "Send message", side: "bottom", type: "button", variant: "default", size: "icon", className: "aui-composer-send rounded-md", "aria-label": "Send message" }), children: _jsx(ArrowUpIcon, { className: "aui-composer-send-icon size-4.5" }) }) }), _jsx(AuiIf, { condition: (s) => s.thread.isRunning, children: _jsx(ComposerPrimitive.Cancel, { render: _jsx(Button, { type: "button", variant: "default", size: "icon", className: "aui-composer-cancel rounded-md", "aria-label": "Stop generating" }), children: _jsx(SquareIcon, { className: "aui-composer-cancel-icon size-3.5 fill-current" }) }) })] })] }));
|
|
62
62
|
};
|
|
63
63
|
const MessageError = () => {
|
|
64
64
|
return (_jsx(MessagePrimitive.Error, { children: _jsx(ErrorPrimitive.Root, { render: _jsx(Alert, { className: "aui-message-error-root mt-2", variant: "destructive" }), children: _jsx(ErrorPrimitive.Message, { className: "aui-message-error-message line-clamp-2" }) }) }));
|
|
@@ -113,7 +113,7 @@ const UserActionBar = () => {
|
|
|
113
113
|
return (_jsx(ActionBarPrimitive.Root, { hideWhenRunning: true, autohide: "not-last", className: "aui-user-action-bar-root flex flex-col items-end", children: _jsx(ActionBarPrimitive.Edit, { render: _jsx(TooltipIconButton, { tooltip: "Edit", className: "aui-user-action-edit" }), children: _jsx(PencilIcon, {}) }) }));
|
|
114
114
|
};
|
|
115
115
|
const EditComposer = () => {
|
|
116
|
-
return (_jsx(MessagePrimitive.Root, { "data-slot": "aui_edit-composer-wrapper", className: "flex flex-col px-2 [contain-intrinsic-size:auto_200px] [content-visibility:auto]", children: _jsxs(ComposerPrimitive.Root, { className: "aui-edit-composer-root ms-auto flex w-full max-w-[85%] flex-col rounded-(--composer-radius) border border-border bg-(--composer-bg)", children: [_jsx(ComposerPrimitive.Input, { className: "aui-edit-composer-input text-foreground min-h-14 w-full resize-none bg-transparent px-4 pt-3 pb-1 text-base outline-none", autoFocus: true }), _jsxs("div", { className: "aui-edit-composer-footer mx-2.5 mb-2.5 flex items-center gap-1.5 self-end", children: [_jsx(ComposerPrimitive.Cancel, { render: _jsx(Button, { variant: "ghost", size: "sm", className: "h-8
|
|
116
|
+
return (_jsx(MessagePrimitive.Root, { "data-slot": "aui_edit-composer-wrapper", className: "flex flex-col px-2 [contain-intrinsic-size:auto_200px] [content-visibility:auto]", children: _jsxs(ComposerPrimitive.Root, { className: "aui-edit-composer-root ms-auto flex w-full max-w-[85%] flex-col rounded-(--composer-radius) border border-border bg-(--composer-bg)", children: [_jsx(ComposerPrimitive.Input, { className: "aui-edit-composer-input text-foreground min-h-14 w-full resize-none bg-transparent px-4 pt-3 pb-1 text-base outline-none", autoFocus: true }), _jsxs("div", { className: "aui-edit-composer-footer mx-2.5 mb-2.5 flex items-center gap-1.5 self-end", children: [_jsx(ComposerPrimitive.Cancel, { render: _jsx(Button, { variant: "ghost", size: "sm", className: "h-8" }), children: "Cancel" }), _jsx(ComposerPrimitive.Send, { render: _jsx(Button, { size: "sm", className: "h-8" }), children: "Update" })] })] }) }));
|
|
117
117
|
};
|
|
118
118
|
const BranchPicker = ({ className, ...rest }) => {
|
|
119
119
|
return (_jsxs(BranchPickerPrimitive.Root, { hideWhenSingleBranch: true, className: cn("aui-branch-picker-root text-muted-foreground -ms-2 me-2 inline-flex items-center text-xs", className), ...rest, children: [_jsx(BranchPickerPrimitive.Previous, { render: _jsx(TooltipIconButton, { tooltip: "Previous" }), children: _jsx(ChevronLeftIcon, {}) }), _jsxs("span", { className: "aui-branch-picker-state font-medium", children: [_jsx(BranchPickerPrimitive.Number, {}), " / ", _jsx(BranchPickerPrimitive.Count, {})] }), _jsx(BranchPickerPrimitive.Next, { render: _jsx(TooltipIconButton, { tooltip: "Next" }), children: _jsx(ChevronRightIcon, {}) })] }));
|
|
@@ -5,6 +5,6 @@ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../../
|
|
|
5
5
|
import { Button } from "../../components/button.js";
|
|
6
6
|
import { cn } from "../../lib/utils.js";
|
|
7
7
|
export const TooltipIconButton = forwardRef(({ children, tooltip, side = "bottom", className, ...rest }, ref) => {
|
|
8
|
-
return (_jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsxs(TooltipTrigger, { render: _jsx(Button, { variant: "ghost", size: "icon", ...rest, className: cn("aui-button-icon
|
|
8
|
+
return (_jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsxs(TooltipTrigger, { render: _jsx(Button, { variant: "ghost", size: "icon", ...rest, className: cn("aui-button-icon p-1", className), ref: ref }), children: [children, _jsx("span", { className: "aui-sr-only sr-only", children: tooltip })] }), _jsx(TooltipContent, { side: side, children: tooltip })] }) }));
|
|
9
9
|
});
|
|
10
10
|
TooltipIconButton.displayName = "TooltipIconButton";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-tokens.generated.d.ts","sourceRoot":"","sources":["../../src/lib/merge-tokens.generated.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB;;;;CAI5B,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Generated by scripts/generate-merge-tokens.mjs from @nadicodeai/design-system/css.
|
|
2
|
+
// Do not edit: `npm run generate:merge-tokens -w @nadicodeai/ui` rewrites it.
|
|
3
|
+
export const themeMergeTokens = {
|
|
4
|
+
spacing: "control-height control-padding-inline nadicode-2xl nadicode-3xl nadicode-4xl nadicode-5xl nadicode-6xl nadicode-content-max nadicode-control-height nadicode-control-padding-inline nadicode-focus-outline-offset nadicode-focus-outline-width nadicode-guide nadicode-gutter-desktop nadicode-gutter-mobile nadicode-gutter-tablet nadicode-icon-stroke nadicode-icon-stroke-sm nadicode-lg nadicode-md nadicode-section-step-desktop nadicode-section-step-mobile nadicode-sm nadicode-touch-target nadicode-xl nadicode-xs nadicode-xxs touch-target".split(" "),
|
|
5
|
+
radius: "2xl 3xl full lg md none sm xl xs".split(" "),
|
|
6
|
+
text: "body-lg body-md body-sm caption code display-lg display-md display-xl heading-lg heading-md heading-sm label-mono".split(" "),
|
|
7
|
+
};
|
package/dist/lib/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;AAe7C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC"}
|
package/dist/lib/utils.js
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { clsx } from "clsx";
|
|
2
|
-
import {
|
|
2
|
+
import { extendTailwindMerge } from "tailwind-merge";
|
|
3
|
+
import { themeMergeTokens } from "./merge-tokens.generated.js";
|
|
4
|
+
const twMerge = extendTailwindMerge({
|
|
5
|
+
extend: {
|
|
6
|
+
theme: {
|
|
7
|
+
spacing: themeMergeTokens.spacing,
|
|
8
|
+
radius: themeMergeTokens.radius,
|
|
9
|
+
text: themeMergeTokens.text,
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
});
|
|
3
13
|
export function cn(...inputs) {
|
|
4
14
|
return twMerge(clsx(inputs));
|
|
5
15
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nadicodeai/ui",
|
|
3
|
-
"version": "12.1.
|
|
3
|
+
"version": "12.1.25",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -59,8 +59,9 @@
|
|
|
59
59
|
"build": "node scripts/build.mjs",
|
|
60
60
|
"build:dev": "node scripts/dev-build.mjs",
|
|
61
61
|
"generate:brand-icons": "node scripts/build-brand-icons.mjs",
|
|
62
|
+
"generate:merge-tokens": "node scripts/generate-merge-tokens.mjs",
|
|
62
63
|
"prepack": "npm run build",
|
|
63
|
-
"lint": "eslint --max-warnings=0",
|
|
64
|
+
"lint": "node scripts/generate-merge-tokens.mjs --check && eslint --max-warnings=0",
|
|
64
65
|
"typecheck": "tsc --noEmit",
|
|
65
66
|
"check": "npm run lint && npm run typecheck",
|
|
66
67
|
"check:static": "npm run check",
|
|
@@ -71,7 +72,7 @@
|
|
|
71
72
|
"@assistant-ui/react": "0.15.21",
|
|
72
73
|
"@assistant-ui/react-markdown": "0.14.16",
|
|
73
74
|
"@base-ui/react": "^1.8.0",
|
|
74
|
-
"@nadicodeai/design-system": "12.1.
|
|
75
|
+
"@nadicodeai/design-system": "12.1.25",
|
|
75
76
|
"class-variance-authority": "^0.7.1",
|
|
76
77
|
"clsx": "^2.1.1",
|
|
77
78
|
"cmdk": "^1.1.1",
|