@nadicodeai/ui 12.1.204 → 12.1.205
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.
|
@@ -11,19 +11,23 @@ declare function Command({ className, children, resultCount, ...props }: React.C
|
|
|
11
11
|
* Find anything across the product and go there.
|
|
12
12
|
*
|
|
13
13
|
* @family Navigation
|
|
14
|
-
* @when "Use CommandMenu for a global, keyboard-first command palette that finds resources and runs actions across the app." (https://vercel.com/geist/command-menu) Ours: finding anything across the product and going there: an Agent, a customer, a page, a creation page (*New Agent*). Opened by ⌘K or the sidebar's Find. It names every place the sidebar names, every chat and every settings page; it goes to places and never runs a command.
|
|
14
|
+
* @when "Use CommandMenu for a global, keyboard-first command palette that finds resources and runs actions across the app." (https://vercel.com/geist/command-menu) Ours: finding anything across the product and going there: an Agent, a customer, a page, a creation page (*New Agent*). Opened by ⌘K or the sidebar's Find. It names every place the sidebar names, every chat and every settings page; it goes to places and never runs a command. Nadia's model picker (⌘⇧M) is the same dialog choosing the chat's model, each model's reasoning levels in a `CommandSubmenu` beside it.
|
|
15
15
|
* @instead "For a menu opened from a visible trigger on a single resource, use `Menu`; for right-click on a row, use `ContextMenu`." (https://vercel.com/geist/command-menu) "Group items into pages (`Projects`, `Team Settings`) when a single flat list would exceed roughly 30 items or span multiple resource types." (https://vercel.com/geist/command-menu) Ours: one record's commands are its `ActionMenu` and, on right-click, its mirror `ActionContextMenu`; a page's are `PageActions`' `menu`. Search inside one collection is `CollectionSearch`. Choosing the page's scope is `ScopeSwitcher`. `CommandDialog` has no pages: its list is groups.
|
|
16
|
-
* @behaviour "Bind `⌘K` on macOS and `Ctrl+K` elsewhere. Don’t reuse the binding for any in-page filter input; it’s a global shortcut." (https://vercel.com/geist/command-menu) "Open into the root page; preserve the search query when navigating back from a sub-page so the user’s typing isn’t lost." (https://vercel.com/geist/command-menu) "Trap focus inside the overlay while it’s open and return focus to the previously active element on close." (https://vercel.com/geist/command-menu) "Show a recent or default item set when the input is empty so the menu is useful before typing." (https://vercel.com/geist/command-menu) Ours: a solid surface, never glass; opens instantly, 640 px wide and 15% down the window; on a phone it is a bottom sheet, 640 px high with 8 px top corners and the list filling it. The input row stands above the list with a line under it, the field in large type with no icon and an *Esc* key at its end that closes the dialog and is the next stop after the field on Tab; the list scrolls past 436 px. The first row is highlighted on open. No match says so. Every row is 36 px with the pointer cursor, a group's heading is a muted 36 px row, a divider bleeds across the list. A row's shortcut is a `CommandShortcut` and a word or icon at its end is a `CommandSuffix`. Colour carries nothing: the highlighted row is a faint neutral wash with its text unchanged, group headings, suffixes and the empty line are muted, and no row, key or divider takes a hue. `CommandDialog` draws `Command` itself, so a product never mounts one; its parts are `CommandInput`, `CommandList`, `CommandEmpty`, `CommandGroup`, `CommandItem` and `CommandShortcut` (a `Kbd`).
|
|
16
|
+
* @behaviour "Bind `⌘K` on macOS and `Ctrl+K` elsewhere. Don’t reuse the binding for any in-page filter input; it’s a global shortcut." (https://vercel.com/geist/command-menu) "Open into the root page; preserve the search query when navigating back from a sub-page so the user’s typing isn’t lost." (https://vercel.com/geist/command-menu) "Trap focus inside the overlay while it’s open and return focus to the previously active element on close." (https://vercel.com/geist/command-menu) "Show a recent or default item set when the input is empty so the menu is useful before typing." (https://vercel.com/geist/command-menu) Ours: a solid surface, never glass; opens instantly, 640 px wide and 15% down the window; on a phone it is a bottom sheet, 640 px high with 8 px top corners and the list filling it. The input row stands above the list with a line under it, the field in large type with no icon and an *Esc* key at its end that closes the dialog and is the next stop after the field on Tab; the list scrolls past 436 px. The first row is highlighted on open. No match says so. Every row is 36 px with the pointer cursor, a group's heading is a muted 36 px row, a divider bleeds across the list. A row's shortcut is a `CommandShortcut` and a word or icon at its end is a `CommandSuffix`. Colour carries nothing: the highlighted row is a faint neutral wash with its text unchanged, group headings, suffixes and the empty line are muted, and no row, key or divider takes a hue. `CommandDialog` draws `Command` itself, so a product never mounts one; its parts are `CommandInput`, `CommandList`, `CommandEmpty`, `CommandGroup`, `CommandItem` and `CommandShortcut` (a `Kbd`). A row with choices of its own, as a model has its reasoning levels, shows them in `CommandSubmenu` beside it, with a `CommandSubmenuItem` each; the dialog follows its highlighted row through `value` and `onValueChange`.
|
|
17
17
|
* @words "`<CommandMenu.Item>` children are Title Case verb phrases (`Deploy Project`, `Invite Team Member`). Avoid navigation phrasing like `Go to project page`; CommandMenu commands act, not browse." (https://vercel.com/geist/command-menu) "`CommandMenuPage.label` is Title Case and names the scope (`Projects`, `Team Settings`)." (https://vercel.com/geist/command-menu) "`CommandMenuPage.placeholder` is sentence case, action-oriented, and ends with `…` (`Search projects…`, `Type a command or search…`). Bare `Search…` is wrong because it doesn’t name the scope." (https://vercel.com/geist/command-menu) "`<CommandMenu.Group heading>` is Title Case, 1–2 words (`Actions`, `Recent`)." (https://vercel.com/geist/command-menu) Ours: groups are plural nouns in sentence case (*Agents*, *Go to*), one or two words. Items are names, or verb and noun for a creation page (*New Agent*), because the dialog goes to places. The placeholder names what is searched, never a bare "Search". No match quotes the query.
|
|
18
18
|
* @access "Use `aria-live="polite"` on the result count so screen readers hear how the list narrows as the user types." (https://vercel.com/geist/command-menu) "Up/Down arrows move highlight, Enter activates, Escape closes. Backspace at an empty input pops the page stack." (https://vercel.com/geist/command-menu) "Display each item’s `keybind` as a `Kbd` slot so the shortcut is discoverable to sighted users and announced as a label to screen readers." (https://vercel.com/geist/command-menu) Ours: a dialog with a screen-reader `title` and `description`, both required; the *Esc* key is a button named by `closeLabel`, which is required; the field is a combobox over a listbox; the highlighted item is `aria-selected`. A polite live region reads `resultCount` as the list narrows, and it is required. `CommandInput` requires its `placeholder`, `CommandGroup` its `heading` and `CommandItem` its `onSelect`, so no field, group or row is left unnamed or inert; a row with no group stands outside a `CommandGroup`. A shortcut is a `CommandShortcut`, drawn as `kbd` elements. With no pages there is no stack for Backspace to pop.
|
|
19
19
|
*/
|
|
20
|
-
declare function CommandDialog({ title, description, children, className, closeLabel, resultCount, filter, ...props }: Omit<React.ComponentProps<typeof Dialog>, "children"> & ResultCount & {
|
|
20
|
+
declare function CommandDialog({ title, description, children, className, closeLabel, resultCount, filter, value, onValueChange, ...props }: Omit<React.ComponentProps<typeof Dialog>, "children"> & ResultCount & {
|
|
21
21
|
title: string;
|
|
22
22
|
description: string;
|
|
23
23
|
/** The *Esc* key's name, from the catalogue: "Close". */
|
|
24
24
|
closeLabel: string;
|
|
25
25
|
/** How a row matches the typed words, where the product matches on more than the row's text. */
|
|
26
26
|
filter?: React.ComponentProps<typeof CommandPrimitive>["filter"];
|
|
27
|
+
/** The highlighted row's value, for a row whose own choices open beside it. */
|
|
28
|
+
value?: string;
|
|
29
|
+
/** Called as the highlight moves, by the keys or the pointer. */
|
|
30
|
+
onValueChange?: (value: string) => void;
|
|
27
31
|
className?: string;
|
|
28
32
|
children: React.ReactNode;
|
|
29
33
|
}): React.JSX.Element;
|
|
@@ -42,8 +46,24 @@ declare function CommandItem({ className, children, ...props }: Omit<React.Compo
|
|
|
42
46
|
/** What choosing the row does: Enter and a click both run it. */
|
|
43
47
|
onSelect: NonNullable<React.ComponentProps<typeof CommandPrimitive.Item>["onSelect"]>;
|
|
44
48
|
}): React.JSX.Element;
|
|
49
|
+
/** The highlighted row's own choices, such as a model's reasoning levels, in a small menu beside that row, sliding over the list's edge when the window has no room beside it: open while the pointer is on the row or after the right arrow, closed by the left arrow, by moving on with the keys, or with the dialog. It takes no focus, so the field keeps it and the keys keep working; a click on one of its `CommandSubmenuItem`s stays inside the dialog. */
|
|
50
|
+
declare function CommandSubmenu({ anchor, heading, open, children, }: {
|
|
51
|
+
/** The row the menu opens beside. */
|
|
52
|
+
anchor: Element | null;
|
|
53
|
+
/** The menu's name, a muted 36 px row above its items, and the radio group's name. */
|
|
54
|
+
heading: string;
|
|
55
|
+
open: boolean;
|
|
56
|
+
children: React.ReactNode;
|
|
57
|
+
}): React.JSX.Element;
|
|
58
|
+
/** One choice of a `CommandSubmenu`, drawn as a `CommandItem`: highlighted from the keyboard as a row is, checked when it is the one in use, with an optional `note` at its end, such as *Default*, drawn as a small outline `Badge` before the check. It takes no focus. */
|
|
59
|
+
declare function CommandSubmenuItem({ className, children, checked, highlighted, note, ...props }: Omit<React.ComponentProps<"button">, "role" | "type" | "tabIndex"> & {
|
|
60
|
+
checked: boolean;
|
|
61
|
+
highlighted: boolean;
|
|
62
|
+
/** A word about this choice, a small outline badge at the row's end, before the check: "Default". */
|
|
63
|
+
note?: string | null;
|
|
64
|
+
}): React.JSX.Element;
|
|
45
65
|
type CommandShortcutProps = KbdProps extends infer P ? P extends unknown ? Omit<P, "size"> : never : never;
|
|
46
66
|
declare function CommandShortcut({ className, ...props }: CommandShortcutProps): React.JSX.Element;
|
|
47
67
|
declare function CommandSuffix({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
48
|
-
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSuffix, CommandSeparator, };
|
|
68
|
+
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSuffix, CommandSeparator, CommandSubmenu, CommandSubmenuItem, };
|
|
49
69
|
//# sourceMappingURL=command.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/components/command.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/components/command.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAmB,MAAM,MAAM,CAAC;AAGpE,OAAO,EACL,MAAM,EAMP,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAKtD,KAAK,WAAW,GAAG;IACjB,+FAA+F;IAC/F,WAAW,EAAE,CA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AE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,CAAC,GAAG;IACtE,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,qGAAqG;IACrG,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB,qBAyBA;AAED,KAAK,oBAAoB,GAAG,QAAQ,SAAS,MAAM,CAAC,GAChD,CAAC,SAAS,OAAO,GACf,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,GACf,KAAK,GACP,KAAK,CAAC;AAEV,iBAAS,eAAe,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,oBAAoB,qBAIrE;AAED,iBAAS,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,qBAQ3E;AAED,OAAO,EACL,OAAO,EACP,aAAa,EACb,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,kBAAkB,GACnB,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
|
+
import { Popover as PopoverPrimitive } from "@base-ui/react/popover";
|
|
4
5
|
import { Command as CommandPrimitive, useCommandState } from "cmdk";
|
|
5
6
|
import { cn } from "../lib/utils.js";
|
|
6
7
|
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogHeader, DialogTitle, } from "./dialog.js";
|
|
7
8
|
import { InputGroup, InputGroupAddon } from "./input-group.js";
|
|
9
|
+
import { Badge } from "./badge.js";
|
|
8
10
|
import { Kbd } from "./kbd.js";
|
|
9
11
|
import { SearchIcon, CheckIcon } from "lucide-react";
|
|
10
12
|
const CommandDialogCloseLabel = React.createContext(null);
|
|
@@ -19,14 +21,14 @@ function Command({ className, children, resultCount, ...props }) {
|
|
|
19
21
|
* Find anything across the product and go there.
|
|
20
22
|
*
|
|
21
23
|
* @family Navigation
|
|
22
|
-
* @when "Use CommandMenu for a global, keyboard-first command palette that finds resources and runs actions across the app." (https://vercel.com/geist/command-menu) Ours: finding anything across the product and going there: an Agent, a customer, a page, a creation page (*New Agent*). Opened by ⌘K or the sidebar's Find. It names every place the sidebar names, every chat and every settings page; it goes to places and never runs a command.
|
|
24
|
+
* @when "Use CommandMenu for a global, keyboard-first command palette that finds resources and runs actions across the app." (https://vercel.com/geist/command-menu) Ours: finding anything across the product and going there: an Agent, a customer, a page, a creation page (*New Agent*). Opened by ⌘K or the sidebar's Find. It names every place the sidebar names, every chat and every settings page; it goes to places and never runs a command. Nadia's model picker (⌘⇧M) is the same dialog choosing the chat's model, each model's reasoning levels in a `CommandSubmenu` beside it.
|
|
23
25
|
* @instead "For a menu opened from a visible trigger on a single resource, use `Menu`; for right-click on a row, use `ContextMenu`." (https://vercel.com/geist/command-menu) "Group items into pages (`Projects`, `Team Settings`) when a single flat list would exceed roughly 30 items or span multiple resource types." (https://vercel.com/geist/command-menu) Ours: one record's commands are its `ActionMenu` and, on right-click, its mirror `ActionContextMenu`; a page's are `PageActions`' `menu`. Search inside one collection is `CollectionSearch`. Choosing the page's scope is `ScopeSwitcher`. `CommandDialog` has no pages: its list is groups.
|
|
24
|
-
* @behaviour "Bind `⌘K` on macOS and `Ctrl+K` elsewhere. Don’t reuse the binding for any in-page filter input; it’s a global shortcut." (https://vercel.com/geist/command-menu) "Open into the root page; preserve the search query when navigating back from a sub-page so the user’s typing isn’t lost." (https://vercel.com/geist/command-menu) "Trap focus inside the overlay while it’s open and return focus to the previously active element on close." (https://vercel.com/geist/command-menu) "Show a recent or default item set when the input is empty so the menu is useful before typing." (https://vercel.com/geist/command-menu) Ours: a solid surface, never glass; opens instantly, 640 px wide and 15% down the window; on a phone it is a bottom sheet, 640 px high with 8 px top corners and the list filling it. The input row stands above the list with a line under it, the field in large type with no icon and an *Esc* key at its end that closes the dialog and is the next stop after the field on Tab; the list scrolls past 436 px. The first row is highlighted on open. No match says so. Every row is 36 px with the pointer cursor, a group's heading is a muted 36 px row, a divider bleeds across the list. A row's shortcut is a `CommandShortcut` and a word or icon at its end is a `CommandSuffix`. Colour carries nothing: the highlighted row is a faint neutral wash with its text unchanged, group headings, suffixes and the empty line are muted, and no row, key or divider takes a hue. `CommandDialog` draws `Command` itself, so a product never mounts one; its parts are `CommandInput`, `CommandList`, `CommandEmpty`, `CommandGroup`, `CommandItem` and `CommandShortcut` (a `Kbd`).
|
|
26
|
+
* @behaviour "Bind `⌘K` on macOS and `Ctrl+K` elsewhere. Don’t reuse the binding for any in-page filter input; it’s a global shortcut." (https://vercel.com/geist/command-menu) "Open into the root page; preserve the search query when navigating back from a sub-page so the user’s typing isn’t lost." (https://vercel.com/geist/command-menu) "Trap focus inside the overlay while it’s open and return focus to the previously active element on close." (https://vercel.com/geist/command-menu) "Show a recent or default item set when the input is empty so the menu is useful before typing." (https://vercel.com/geist/command-menu) Ours: a solid surface, never glass; opens instantly, 640 px wide and 15% down the window; on a phone it is a bottom sheet, 640 px high with 8 px top corners and the list filling it. The input row stands above the list with a line under it, the field in large type with no icon and an *Esc* key at its end that closes the dialog and is the next stop after the field on Tab; the list scrolls past 436 px. The first row is highlighted on open. No match says so. Every row is 36 px with the pointer cursor, a group's heading is a muted 36 px row, a divider bleeds across the list. A row's shortcut is a `CommandShortcut` and a word or icon at its end is a `CommandSuffix`. Colour carries nothing: the highlighted row is a faint neutral wash with its text unchanged, group headings, suffixes and the empty line are muted, and no row, key or divider takes a hue. `CommandDialog` draws `Command` itself, so a product never mounts one; its parts are `CommandInput`, `CommandList`, `CommandEmpty`, `CommandGroup`, `CommandItem` and `CommandShortcut` (a `Kbd`). A row with choices of its own, as a model has its reasoning levels, shows them in `CommandSubmenu` beside it, with a `CommandSubmenuItem` each; the dialog follows its highlighted row through `value` and `onValueChange`.
|
|
25
27
|
* @words "`<CommandMenu.Item>` children are Title Case verb phrases (`Deploy Project`, `Invite Team Member`). Avoid navigation phrasing like `Go to project page`; CommandMenu commands act, not browse." (https://vercel.com/geist/command-menu) "`CommandMenuPage.label` is Title Case and names the scope (`Projects`, `Team Settings`)." (https://vercel.com/geist/command-menu) "`CommandMenuPage.placeholder` is sentence case, action-oriented, and ends with `…` (`Search projects…`, `Type a command or search…`). Bare `Search…` is wrong because it doesn’t name the scope." (https://vercel.com/geist/command-menu) "`<CommandMenu.Group heading>` is Title Case, 1–2 words (`Actions`, `Recent`)." (https://vercel.com/geist/command-menu) Ours: groups are plural nouns in sentence case (*Agents*, *Go to*), one or two words. Items are names, or verb and noun for a creation page (*New Agent*), because the dialog goes to places. The placeholder names what is searched, never a bare "Search". No match quotes the query.
|
|
26
28
|
* @access "Use `aria-live="polite"` on the result count so screen readers hear how the list narrows as the user types." (https://vercel.com/geist/command-menu) "Up/Down arrows move highlight, Enter activates, Escape closes. Backspace at an empty input pops the page stack." (https://vercel.com/geist/command-menu) "Display each item’s `keybind` as a `Kbd` slot so the shortcut is discoverable to sighted users and announced as a label to screen readers." (https://vercel.com/geist/command-menu) Ours: a dialog with a screen-reader `title` and `description`, both required; the *Esc* key is a button named by `closeLabel`, which is required; the field is a combobox over a listbox; the highlighted item is `aria-selected`. A polite live region reads `resultCount` as the list narrows, and it is required. `CommandInput` requires its `placeholder`, `CommandGroup` its `heading` and `CommandItem` its `onSelect`, so no field, group or row is left unnamed or inert; a row with no group stands outside a `CommandGroup`. A shortcut is a `CommandShortcut`, drawn as `kbd` elements. With no pages there is no stack for Backspace to pop.
|
|
27
29
|
*/
|
|
28
|
-
function CommandDialog({ title, description, children, className, closeLabel, resultCount, filter, ...props }) {
|
|
29
|
-
return (_jsxs(Dialog, { ...props, children: [_jsxs(DialogHeader, { className: "sr-only", children: [_jsx(DialogTitle, { children: title }), _jsx(DialogDescription, { children: description })] }), _jsx(DialogContent, { className: cn("top-[15%] translate-y-0 overflow-hidden p-0! max-sm:h-160 max-sm:rounded-t-md sm:max-w-160", className), motion: "instant", showCloseButton: false, children: _jsx(CommandDialogCloseLabel.Provider, { value: closeLabel, children: _jsx(Command, { className: "bg-transparent max-sm:rounded-t-md! max-sm:rounded-b-none! **:data-[slot=command-list]:max-h-109 max-sm:**:data-[slot=command-list]:max-h-none max-sm:**:data-[slot=command-list]:flex-1", filter: filter, label: title, resultCount: resultCount, children: children }) }) })] }));
|
|
30
|
+
function CommandDialog({ title, description, children, className, closeLabel, resultCount, filter, value, onValueChange, ...props }) {
|
|
31
|
+
return (_jsxs(Dialog, { ...props, children: [_jsxs(DialogHeader, { className: "sr-only", children: [_jsx(DialogTitle, { children: title }), _jsx(DialogDescription, { children: description })] }), _jsx(DialogContent, { className: cn("top-[15%] translate-y-0 overflow-hidden p-0! max-sm:h-160 max-sm:rounded-t-md sm:max-w-160", className), motion: "instant", showCloseButton: false, children: _jsx(CommandDialogCloseLabel.Provider, { value: closeLabel, children: _jsx(Command, { className: "bg-transparent max-sm:rounded-t-md! max-sm:rounded-b-none! **:data-[slot=command-list]:max-h-109 max-sm:**:data-[slot=command-list]:max-h-none max-sm:**:data-[slot=command-list]:flex-1", filter: filter, label: title, onValueChange: onValueChange, value: value, resultCount: resultCount, children: children }) }) })] }));
|
|
30
32
|
}
|
|
31
33
|
function CommandInput({ className, ...props }) {
|
|
32
34
|
const closeLabel = React.useContext(CommandDialogCloseLabel);
|
|
@@ -50,10 +52,18 @@ function CommandSeparator({ className, ...props }) {
|
|
|
50
52
|
function CommandItem({ className, children, ...props }) {
|
|
51
53
|
return (_jsxs(CommandPrimitive.Item, { "data-slot": "command-item", "data-nc-ui": "", className: cn("group/command-item relative flex min-h-touch-target cursor-pointer items-center gap-3 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:cursor-default data-[disabled=true]:text-muted-foreground data-[selected=true]:bg-accent data-[selected=true]:text-foreground [@media(hover:hover)_and_(pointer:fine)]:min-h-control-height [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[selected=true]:*:[svg]:text-foreground", className), ...props, children: [children, _jsx(CheckIcon, { className: "ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-has-data-[slot=command-suffix]/command-item:hidden group-data-[checked=true]/command-item:opacity-100" })] }));
|
|
52
54
|
}
|
|
55
|
+
/** The highlighted row's own choices, such as a model's reasoning levels, in a small menu beside that row, sliding over the list's edge when the window has no room beside it: open while the pointer is on the row or after the right arrow, closed by the left arrow, by moving on with the keys, or with the dialog. It takes no focus, so the field keeps it and the keys keep working; a click on one of its `CommandSubmenuItem`s stays inside the dialog. */
|
|
56
|
+
function CommandSubmenu({ anchor, heading, open, children, }) {
|
|
57
|
+
return (_jsx(PopoverPrimitive.Root, { modal: false, open: open && anchor !== null, children: _jsx(PopoverPrimitive.Portal, { children: _jsx(PopoverPrimitive.Positioner, { align: "start", alignOffset: -8, anchor: anchor, className: "isolate z-50", collisionAvoidance: { side: "shift", align: "shift", fallbackAxisSide: "none" }, side: "right", sideOffset: 12, children: _jsxs(PopoverPrimitive.Popup, { "data-slot": "command-submenu", "data-nc-ui": "", className: "pointer-events-auto flex w-56 flex-col rounded-lg bg-popover p-2 text-popover-foreground nc-elevation-floating outline-hidden", finalFocus: false, initialFocus: false, children: [_jsx("div", { "aria-hidden": "true", className: "flex h-9 shrink-0 items-center px-2 text-label-sm text-muted-foreground", children: heading }), _jsx("div", { "aria-label": heading, className: "flex flex-col", role: "radiogroup", children: children })] }) }) }) }));
|
|
58
|
+
}
|
|
59
|
+
/** One choice of a `CommandSubmenu`, drawn as a `CommandItem`: highlighted from the keyboard as a row is, checked when it is the one in use, with an optional `note` at its end, such as *Default*, drawn as a small outline `Badge` before the check. It takes no focus. */
|
|
60
|
+
function CommandSubmenuItem({ className, children, checked, highlighted, note, ...props }) {
|
|
61
|
+
return (_jsxs("button", { "aria-checked": checked, "data-slot": "command-submenu-item", "data-nc-ui": "", "data-highlighted": highlighted ? "true" : undefined, className: cn("relative flex min-h-touch-target w-full cursor-pointer items-center gap-3 rounded-sm px-2 py-1.5 text-left text-sm outline-hidden select-none hover:bg-accent data-[highlighted=true]:bg-accent [@media(hover:hover)_and_(pointer:fine)]:min-h-control-height", className), role: "radio", tabIndex: -1, type: "button", ...props, children: [_jsx("span", { className: "min-w-0 flex-1 truncate", children: children }), note ? (_jsx(Badge, { className: "shrink-0", size: "sm", variant: "outline", children: note })) : null, _jsx(CheckIcon, { className: cn("size-4 shrink-0", checked ? "opacity-100" : "opacity-0") })] }));
|
|
62
|
+
}
|
|
53
63
|
function CommandShortcut({ className, ...props }) {
|
|
54
64
|
return (_jsx(Kbd, { "data-slot": "command-shortcut", ...props, className: cn("ml-auto", className), size: "sm" }));
|
|
55
65
|
}
|
|
56
66
|
function CommandSuffix({ className, ...props }) {
|
|
57
67
|
return (_jsx("span", { "data-slot": "command-suffix", className: cn("ml-auto flex items-center gap-1 text-sm text-muted-foreground", className), ...props }));
|
|
58
68
|
}
|
|
59
|
-
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSuffix, CommandSeparator, };
|
|
69
|
+
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSuffix, CommandSeparator, CommandSubmenu, CommandSubmenuItem, };
|
|
@@ -255,7 +255,7 @@ function SidebarGroupAction({ className, render, ...props }) {
|
|
|
255
255
|
return useRender({
|
|
256
256
|
defaultTagName: "button",
|
|
257
257
|
props: mergeProps({
|
|
258
|
-
className: cn("absolute top-
|
|
258
|
+
className: cn("absolute top-[calc(--spacing(2)+(var(--nc-control-height)-1.25rem)/2)] right-3 flex aspect-square w-5 items-center justify-center rounded-sm p-0 text-sidebar-foreground group-data-[collapsible=icon]:hidden after:absolute after:top-1/2 after:left-1/2 after:size-touch-target after:-translate-1/2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground [@media(hover:hover)_and_(pointer:fine)]:after:hidden [&>svg]:size-4 [&>svg]:shrink-0", className),
|
|
259
259
|
}, props),
|
|
260
260
|
render,
|
|
261
261
|
state: {
|
|
@@ -943,9 +943,9 @@ export const USAGE = [
|
|
|
943
943
|
module: "command",
|
|
944
944
|
family: "Navigation",
|
|
945
945
|
summary: "Find anything across the product and go there.",
|
|
946
|
-
when:
|
|
946
|
+
when: "\"Use CommandMenu for a global, keyboard-first command palette that finds resources and runs actions across the app.\" (https://vercel.com/geist/command-menu) Ours: finding anything across the product and going there: an Agent, a customer, a page, a creation page (*New Agent*). Opened by ⌘K or the sidebar's Find. It names every place the sidebar names, every chat and every settings page; it goes to places and never runs a command. Nadia's model picker (⌘⇧M) is the same dialog choosing the chat's model, each model's reasoning levels in a `CommandSubmenu` beside it.",
|
|
947
947
|
instead: "\"For a menu opened from a visible trigger on a single resource, use `Menu`; for right-click on a row, use `ContextMenu`.\" (https://vercel.com/geist/command-menu) \"Group items into pages (`Projects`, `Team Settings`) when a single flat list would exceed roughly 30 items or span multiple resource types.\" (https://vercel.com/geist/command-menu) Ours: one record's commands are its `ActionMenu` and, on right-click, its mirror `ActionContextMenu`; a page's are `PageActions`' `menu`. Search inside one collection is `CollectionSearch`. Choosing the page's scope is `ScopeSwitcher`. `CommandDialog` has no pages: its list is groups.",
|
|
948
|
-
behaviour: '"Bind `⌘K` on macOS and `Ctrl+K` elsewhere. Don’t reuse the binding for any in-page filter input; it’s a global shortcut." (https://vercel.com/geist/command-menu) "Open into the root page; preserve the search query when navigating back from a sub-page so the user’s typing isn’t lost." (https://vercel.com/geist/command-menu) "Trap focus inside the overlay while it’s open and return focus to the previously active element on close." (https://vercel.com/geist/command-menu) "Show a recent or default item set when the input is empty so the menu is useful before typing." (https://vercel.com/geist/command-menu) Ours: a solid surface, never glass; opens instantly, 640 px wide and 15% down the window; on a phone it is a bottom sheet, 640 px high with 8 px top corners and the list filling it. The input row stands above the list with a line under it, the field in large type with no icon and an *Esc* key at its end that closes the dialog and is the next stop after the field on Tab; the list scrolls past 436 px. The first row is highlighted on open. No match says so. Every row is 36 px with the pointer cursor, a group\'s heading is a muted 36 px row, a divider bleeds across the list. A row\'s shortcut is a `CommandShortcut` and a word or icon at its end is a `CommandSuffix`. Colour carries nothing: the highlighted row is a faint neutral wash with its text unchanged, group headings, suffixes and the empty line are muted, and no row, key or divider takes a hue. `CommandDialog` draws `Command` itself, so a product never mounts one; its parts are `CommandInput`, `CommandList`, `CommandEmpty`, `CommandGroup`, `CommandItem` and `CommandShortcut` (a `Kbd`).',
|
|
948
|
+
behaviour: '"Bind `⌘K` on macOS and `Ctrl+K` elsewhere. Don’t reuse the binding for any in-page filter input; it’s a global shortcut." (https://vercel.com/geist/command-menu) "Open into the root page; preserve the search query when navigating back from a sub-page so the user’s typing isn’t lost." (https://vercel.com/geist/command-menu) "Trap focus inside the overlay while it’s open and return focus to the previously active element on close." (https://vercel.com/geist/command-menu) "Show a recent or default item set when the input is empty so the menu is useful before typing." (https://vercel.com/geist/command-menu) Ours: a solid surface, never glass; opens instantly, 640 px wide and 15% down the window; on a phone it is a bottom sheet, 640 px high with 8 px top corners and the list filling it. The input row stands above the list with a line under it, the field in large type with no icon and an *Esc* key at its end that closes the dialog and is the next stop after the field on Tab; the list scrolls past 436 px. The first row is highlighted on open. No match says so. Every row is 36 px with the pointer cursor, a group\'s heading is a muted 36 px row, a divider bleeds across the list. A row\'s shortcut is a `CommandShortcut` and a word or icon at its end is a `CommandSuffix`. Colour carries nothing: the highlighted row is a faint neutral wash with its text unchanged, group headings, suffixes and the empty line are muted, and no row, key or divider takes a hue. `CommandDialog` draws `Command` itself, so a product never mounts one; its parts are `CommandInput`, `CommandList`, `CommandEmpty`, `CommandGroup`, `CommandItem` and `CommandShortcut` (a `Kbd`). A row with choices of its own, as a model has its reasoning levels, shows them in `CommandSubmenu` beside it, with a `CommandSubmenuItem` each; the dialog follows its highlighted row through `value` and `onValueChange`.',
|
|
949
949
|
words: '"`<CommandMenu.Item>` children are Title Case verb phrases (`Deploy Project`, `Invite Team Member`). Avoid navigation phrasing like `Go to project page`; CommandMenu commands act, not browse." (https://vercel.com/geist/command-menu) "`CommandMenuPage.label` is Title Case and names the scope (`Projects`, `Team Settings`)." (https://vercel.com/geist/command-menu) "`CommandMenuPage.placeholder` is sentence case, action-oriented, and ends with `…` (`Search projects…`, `Type a command or search…`). Bare `Search…` is wrong because it doesn’t name the scope." (https://vercel.com/geist/command-menu) "`<CommandMenu.Group heading>` is Title Case, 1–2 words (`Actions`, `Recent`)." (https://vercel.com/geist/command-menu) Ours: groups are plural nouns in sentence case (*Agents*, *Go to*), one or two words. Items are names, or verb and noun for a creation page (*New Agent*), because the dialog goes to places. The placeholder names what is searched, never a bare "Search". No match quotes the query.',
|
|
950
950
|
access: '"Use `aria-live="polite"` on the result count so screen readers hear how the list narrows as the user types." (https://vercel.com/geist/command-menu) "Up/Down arrows move highlight, Enter activates, Escape closes. Backspace at an empty input pops the page stack." (https://vercel.com/geist/command-menu) "Display each item’s `keybind` as a `Kbd` slot so the shortcut is discoverable to sighted users and announced as a label to screen readers." (https://vercel.com/geist/command-menu) Ours: a dialog with a screen-reader `title` and `description`, both required; the *Esc* key is a button named by `closeLabel`, which is required; the field is a combobox over a listbox; the highlighted item is `aria-selected`. A polite live region reads `resultCount` as the list narrows, and it is required. `CommandInput` requires its `placeholder`, `CommandGroup` its `heading` and `CommandItem` its `onSelect`, so no field, group or row is left unnamed or inert; a row with no group stands outside a `CommandGroup`. A shortcut is a `CommandShortcut`, drawn as `kbd` elements. With no pages there is no stack for Backspace to pop.',
|
|
951
951
|
},
|
|
@@ -516,6 +516,73 @@
|
|
|
516
516
|
color: var(--nc-dark-ink);
|
|
517
517
|
}
|
|
518
518
|
|
|
519
|
+
/*
|
|
520
|
+
* A sign-in form on the scene, for a page that asks for a name and a password
|
|
521
|
+
* before anything else loads, such as Nadia's Webapp: the fields stack under
|
|
522
|
+
* the message, each with its label above, and the action fills the column.
|
|
523
|
+
*/
|
|
524
|
+
|
|
525
|
+
.nc-entry-form {
|
|
526
|
+
display: grid;
|
|
527
|
+
gap: var(--nc-sm);
|
|
528
|
+
width: 100%;
|
|
529
|
+
text-align: start;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
.nc-entry-field {
|
|
533
|
+
display: grid;
|
|
534
|
+
gap: var(--nc-xxs);
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
.nc-entry-field-label {
|
|
538
|
+
font-family: var(--nc-type-label-md-font-family);
|
|
539
|
+
font-size: var(--nc-type-label-md-font-size);
|
|
540
|
+
font-weight: var(--nc-type-label-md-font-weight);
|
|
541
|
+
line-height: var(--nc-type-label-md-line-height);
|
|
542
|
+
letter-spacing: var(--nc-type-label-md-letter-spacing);
|
|
543
|
+
color: var(--nc-dark-body);
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
.nc-entry-input {
|
|
547
|
+
min-height: var(--nc-control-height);
|
|
548
|
+
padding: var(--nc-xs) var(--nc-sm);
|
|
549
|
+
border: var(--nc-guide) solid var(--nc-dark-input);
|
|
550
|
+
border-radius: var(--nc-rounded-md);
|
|
551
|
+
background: var(--nc-dark-canvas-soft);
|
|
552
|
+
color: var(--nc-dark-ink);
|
|
553
|
+
font-family: var(--nc-type-body-sm-font-family);
|
|
554
|
+
font-size: var(--nc-type-body-sm-font-size);
|
|
555
|
+
line-height: var(--nc-type-body-sm-line-height);
|
|
556
|
+
transition: border-color var(--nc-duration-control) var(--nc-ease-out-strong);
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
.nc-entry-input:hover {
|
|
560
|
+
border-color: var(--nc-dark-muted);
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
.nc-entry-input:focus-visible {
|
|
564
|
+
outline: 2px solid var(--nc-dark-focus-ring);
|
|
565
|
+
outline-offset: 2px;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
.nc-entry-form .nc-entry-action {
|
|
569
|
+
width: 100%;
|
|
570
|
+
margin-top: var(--nc-xs);
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
.nc-entry-error {
|
|
574
|
+
margin: 0;
|
|
575
|
+
font-family: var(--nc-type-body-sm-font-family);
|
|
576
|
+
font-size: var(--nc-type-body-sm-font-size);
|
|
577
|
+
line-height: var(--nc-type-body-sm-line-height);
|
|
578
|
+
color: var(--nc-dark-error);
|
|
579
|
+
text-align: center;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
.nc-entry-error:empty {
|
|
583
|
+
display: none;
|
|
584
|
+
}
|
|
585
|
+
|
|
519
586
|
/* Measured work ----------------------------------------------------------- */
|
|
520
587
|
|
|
521
588
|
.nc-entry-progress {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nadicodeai/ui",
|
|
3
|
-
"version": "12.1.
|
|
3
|
+
"version": "12.1.205",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#jsx": "./src/jsx/index.ts",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"@headless-tree/react": "1.8.0",
|
|
79
79
|
"@iconify-icons/logos": "^2.0.3",
|
|
80
80
|
"@iconify/react": "^6.0.2",
|
|
81
|
-
"@nadicodeai/design-system": "12.1.
|
|
81
|
+
"@nadicodeai/design-system": "12.1.205",
|
|
82
82
|
"@tanstack/react-table": "^9.3.1",
|
|
83
83
|
"@vgpu/wgsl": "0.6.0",
|
|
84
84
|
"class-variance-authority": "^0.7.1",
|