@nadicodeai/ui 12.1.236 → 12.1.238

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.
@@ -1,9 +1,12 @@
1
+ import type { ReactNode } from "react";
1
2
  import type { CatalogSection } from "./catalog-entry.js";
2
3
  import { type CollectionSearchProps } from "./collection-search.js";
3
4
  import { type EmptyStateKind } from "./empty-state.js";
4
5
  import { type FormSurfaceProps } from "./form-drawer.js";
5
6
  export type CatalogDrawerProps = Omit<FormSurfaceProps, "children" | "unsaved"> & {
6
7
  search: CollectionSearchProps;
8
+ /** Under the search, above the entries: a lasting condition of part of the catalogue, such as a source it could not read. */
9
+ notice?: ReactNode;
7
10
  /** Already searched; undefined while the catalogue loads. */
8
11
  sections: readonly CatalogSection[] | undefined;
9
12
  loadingLabel: string;
@@ -21,9 +24,9 @@ export type CatalogDrawerProps = Omit<FormSurfaceProps, "children" | "unsaved">
21
24
  * @family Compositions
22
25
  * @when Ours: a person picks one or more things from a list too long for a dialog, the page still behind it: add a skill, add an app to a new Agent.
23
26
  * @instead "Don’t use Sheet to confirm destructive actions. The default `modal=false` keeps the page interactive, which weakens severity for a delete or revoke." (https://vercel.com/geist/sheet) Ours: the shelf of everything the company holds, on its own page, is a `LibraryShelf`; a setup in steps is a `FormDrawer` with `job="steps"`; a new record from a few fields is a `FormDialog`.
24
- * @behaviour "Outside-click does not auto-close, so always render an explicit close affordance and honor Escape." (https://vercel.com/geist/sheet) Ours: a modal sheet from the right, as `FormDrawer`. The header holds the title, the description and Close; below it sits the search, which stays in place, and then the body, which scrolls and holds the entries in one column under their section titles. It draws one state at a time: the failure with its retry, three still entries while the catalogue loads, no match with a way to clear the search, nothing at all, or the entries. An entry already held shows a muted check and its word in place of Add. The footer's one button closes the drawer.
25
- * @words "Title is Title Case and names the entity (`Deployment Details`, `Member Profile`), not the page action." (https://vercel.com/geist/sheet) "Cancel literal stays `Cancel`. Acknowledgment-only Modals (after a key reveal, after a one-time-show) use `Done`, never `OK` or `Close`." (https://vercel.com/geist/modal) Ours: the title is sentence case and names the job: "Add a skill". The search names what it finds: "Search the hub". Each entry's button is "Add"; the held word is "Added"; the footer's is "Done".
27
+ * @behaviour "Outside-click does not auto-close, so always render an explicit close affordance and honor Escape." (https://vercel.com/geist/sheet) Ours: a modal sheet from the right, as `FormDrawer`. The header holds the title, the description and Close; below it sits the search, which stays in place, and then the body, which scrolls and holds the entries in one column under their section titles. A `notice`, a `MessageNotice` with `placement="section"`, stands first in the body for a lasting condition of part of the catalogue, such as a source it could not read, with its one action, and the entries it could read stay beside it. It draws one state at a time: the failure with its retry, three still entries while the catalogue loads, no match with a way to clear the search, nothing at all, or the entries. An entry already held shows a muted check and its word in place of Add. The footer's one button closes the drawer.
28
+ * @words "Title is Title Case and names the entity (`Deployment Details`, `Member Profile`), not the page action." (https://vercel.com/geist/sheet) "Cancel literal stays `Cancel`. Acknowledgment-only Modals (after a key reveal, after a one-time-show) use `Done`, never `OK` or `Close`." (https://vercel.com/geist/modal) Ours: the title is sentence case and names the job: "Add a skill". The search names what it finds: "Search the hub". Each entry's button is "Add"; the held word is "Added"; the footer's is "Done". A notice is a message from the product's catalogue: "The Library's plugins can't be shown right now".
26
29
  * @access "Trap focus inside the sheet while it’s open and return focus to the trigger row on close so keyboard users keep their place in the list." (https://vercel.com/geist/sheet) "Provide a visible close button labeled `Close` (or an icon button with `aria-label="Close"`) since clicking outside doesn’t dismiss." (https://vercel.com/geist/sheet) Ours: a modal dialog named by its title; focus starts in the search. The loading entries are one status named by `loadingLabel`.
27
30
  */
28
- export declare function CatalogDrawer({ search, sections, loadingLabel, failed, empty, noMatch, done, ...surface }: CatalogDrawerProps): import("react").JSX.Element;
31
+ export declare function CatalogDrawer({ search, notice, sections, loadingLabel, failed, empty, noMatch, done, ...surface }: CatalogDrawerProps): import("react").JSX.Element;
29
32
  //# sourceMappingURL=catalog-drawer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"catalog-drawer.d.ts","sourceRoot":"","sources":["../../src/components/catalog-drawer.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAoB,KAAK,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC9F,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAoC,KAAK,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAKnG,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,gBAAgB,EAAE,UAAU,GAAG,SAAS,CAAC,GAAG;IAChF,MAAM,EAAE,qBAAqB,CAAC;IAC9B,6DAA6D;IAC7D,QAAQ,EAAE,SAAS,cAAc,EAAE,GAAG,SAAS,CAAC;IAChD,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC;IAClC,0CAA0C;IAC1C,KAAK,EAAE,cAAc,CAAC,YAAY,CAAC,CAAC;IACpC,qGAAqG;IACrG,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,CAAC;IACpD,gEAAgE;IAChE,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,KAAK,EACL,OAAO,EACP,IAAI,EACJ,GAAG,OAAO,EACX,EAAE,kBAAkB,+BAoBpB"}
1
+ {"version":3,"file":"catalog-drawer.d.ts","sourceRoot":"","sources":["../../src/components/catalog-drawer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAoB,KAAK,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC9F,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAoC,KAAK,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAKnG,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,gBAAgB,EAAE,UAAU,GAAG,SAAS,CAAC,GAAG;IAChF,MAAM,EAAE,qBAAqB,CAAC;IAC9B,6HAA6H;IAC7H,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,6DAA6D;IAC7D,QAAQ,EAAE,SAAS,cAAc,EAAE,GAAG,SAAS,CAAC;IAChD,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC;IAClC,0CAA0C;IAC1C,KAAK,EAAE,cAAc,CAAC,YAAY,CAAC,CAAC;IACpC,qGAAqG;IACrG,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,CAAC;IACpD,gEAAgE;IAChE,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,MAAM,EACN,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,KAAK,EACL,OAAO,EACP,IAAI,EACJ,GAAG,OAAO,EACX,EAAE,kBAAkB,+BAqBpB"}
@@ -13,12 +13,12 @@ import { CatalogList, CatalogSkeleton, catalogIsEmpty } from "../internal/catalo
13
13
  * @family Compositions
14
14
  * @when Ours: a person picks one or more things from a list too long for a dialog, the page still behind it: add a skill, add an app to a new Agent.
15
15
  * @instead "Don’t use Sheet to confirm destructive actions. The default `modal=false` keeps the page interactive, which weakens severity for a delete or revoke." (https://vercel.com/geist/sheet) Ours: the shelf of everything the company holds, on its own page, is a `LibraryShelf`; a setup in steps is a `FormDrawer` with `job="steps"`; a new record from a few fields is a `FormDialog`.
16
- * @behaviour "Outside-click does not auto-close, so always render an explicit close affordance and honor Escape." (https://vercel.com/geist/sheet) Ours: a modal sheet from the right, as `FormDrawer`. The header holds the title, the description and Close; below it sits the search, which stays in place, and then the body, which scrolls and holds the entries in one column under their section titles. It draws one state at a time: the failure with its retry, three still entries while the catalogue loads, no match with a way to clear the search, nothing at all, or the entries. An entry already held shows a muted check and its word in place of Add. The footer's one button closes the drawer.
17
- * @words "Title is Title Case and names the entity (`Deployment Details`, `Member Profile`), not the page action." (https://vercel.com/geist/sheet) "Cancel literal stays `Cancel`. Acknowledgment-only Modals (after a key reveal, after a one-time-show) use `Done`, never `OK` or `Close`." (https://vercel.com/geist/modal) Ours: the title is sentence case and names the job: "Add a skill". The search names what it finds: "Search the hub". Each entry's button is "Add"; the held word is "Added"; the footer's is "Done".
16
+ * @behaviour "Outside-click does not auto-close, so always render an explicit close affordance and honor Escape." (https://vercel.com/geist/sheet) Ours: a modal sheet from the right, as `FormDrawer`. The header holds the title, the description and Close; below it sits the search, which stays in place, and then the body, which scrolls and holds the entries in one column under their section titles. A `notice`, a `MessageNotice` with `placement="section"`, stands first in the body for a lasting condition of part of the catalogue, such as a source it could not read, with its one action, and the entries it could read stay beside it. It draws one state at a time: the failure with its retry, three still entries while the catalogue loads, no match with a way to clear the search, nothing at all, or the entries. An entry already held shows a muted check and its word in place of Add. The footer's one button closes the drawer.
17
+ * @words "Title is Title Case and names the entity (`Deployment Details`, `Member Profile`), not the page action." (https://vercel.com/geist/sheet) "Cancel literal stays `Cancel`. Acknowledgment-only Modals (after a key reveal, after a one-time-show) use `Done`, never `OK` or `Close`." (https://vercel.com/geist/modal) Ours: the title is sentence case and names the job: "Add a skill". The search names what it finds: "Search the hub". Each entry's button is "Add"; the held word is "Added"; the footer's is "Done". A notice is a message from the product's catalogue: "The Library's plugins can't be shown right now".
18
18
  * @access "Trap focus inside the sheet while it’s open and return focus to the trigger row on close so keyboard users keep their place in the list." (https://vercel.com/geist/sheet) "Provide a visible close button labeled `Close` (or an icon button with `aria-label="Close"`) since clicking outside doesn’t dismiss." (https://vercel.com/geist/sheet) Ours: a modal dialog named by its title; focus starts in the search. The loading entries are one status named by `loadingLabel`.
19
19
  */
20
- export function CatalogDrawer({ search, sections, loadingLabel, failed, empty, noMatch, done, ...surface }) {
21
- return (_jsxs(FormDrawerFrame, { ...surface, job: "catalog", children: [_jsx("div", { className: "px-nadicode-lg", "data-slot": "catalog-drawer-search", children: _jsx(CollectionSearch, { ...search }) }), _jsx(FormDrawerBody, { className: "pb-nadicode-lg", children: _jsx(CatalogBody, { empty: empty, failed: failed, loadingLabel: loadingLabel, noMatch: search.value ? noMatch : undefined, sections: sections }) }), _jsx(FormDrawerFooter, { children: _jsx(SheetClose, { render: _jsx(Button, { type: "button" }), children: done }) })] }));
20
+ export function CatalogDrawer({ search, notice, sections, loadingLabel, failed, empty, noMatch, done, ...surface }) {
21
+ return (_jsxs(FormDrawerFrame, { ...surface, job: "catalog", children: [_jsx("div", { className: "px-nadicode-lg", "data-slot": "catalog-drawer-search", children: _jsx(CollectionSearch, { ...search }) }), _jsxs(FormDrawerBody, { className: "auto-rows-max pt-0.5 pb-nadicode-lg", children: [notice, _jsx(CatalogBody, { empty: empty, failed: failed, loadingLabel: loadingLabel, noMatch: search.value ? noMatch : undefined, sections: sections })] }), _jsx(FormDrawerFooter, { children: _jsx(SheetClose, { render: _jsx(Button, { type: "button" }), children: done }) })] }));
22
22
  }
23
23
  function CatalogBody({ sections, loadingLabel, failed, empty, noMatch, }) {
24
24
  if (failed)
@@ -24,7 +24,7 @@ export type CatalogEntryAdd = PageCommand & {
24
24
  * @family Data
25
25
  * @when A reusable thing a person can add: a skill, a plugin or an app, on a Library shelf (`LibraryShelf`) or in the drawer that adds one to an Agent (`CatalogDrawer`).
26
26
  * @instead A record the person already holds is a row of its collection (`CollectionPage`). An Agent template is its `AgentCard`. Figures compared across entries are a `DataTable`.
27
- * @behaviour The kind's tile at 40: a skill's or a plugin's own icon on the neutral ringed tile, an app's own logo. The name is the link to its own page. One Add control, outline with a leading plus; once held, a muted check and `added`'s word take its place. A menu of one command that is not destructive, with no Add, is that command's outline button; otherwise the three dots. A failed or refused add puts its message in the line's place, with its retry before the entry's own controls.
27
+ * @behaviour The kind's tile at 40: a skill's or a plugin's own icon on the neutral ringed tile, an app's own logo. The name is the link to its own page. One Add control, outline with a leading plus; once held, a muted check and `added`'s word take its place. A menu of one command that is not destructive, with no Add, is that command's outline button; otherwise the three dots. A failed or refused add puts its message in the line's place, with its retry before the entry's own controls. From 24rem inside its padding the entry is one row, tile, words and controls, its name and its line one line each, ending in an ellipsis. Narrower, as in Nadia's window at its narrowest, the controls stand under the words, from the name's edge: the name wraps whole, the line holds two lines and a failure's message all of it, so no name is squeezed to a few letters.
28
28
  * @words The name as the catalogue gives it; one line saying what it does, a sentence: "Classifies incoming requests and prepares the next step." The control is a verb: "Add".
29
29
  * @access The tile is decorative; the name is the link's text. A failed add's message is announced as an alert.
30
30
  */
@@ -335,7 +335,7 @@ function SidebarMenuAction({ className, render, showOnHover = false, ...props })
335
335
  });
336
336
  }
337
337
  function SidebarMenuBadge({ className, tone = "default", ...props }) {
338
- return (_jsx("div", { "data-slot": "sidebar-menu-badge", "data-sidebar": "menu-badge", "data-tone": tone, className: cn("pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-sm px-1 text-xs font-medium text-sidebar-foreground tabular-nums select-none column-collapsed:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 peer-data-active/menu-button:text-sidebar-primary-foreground", tone === "attention" &&
338
+ return (_jsx("div", { "data-slot": "sidebar-menu-badge", "data-sidebar": "menu-badge", "data-tone": tone, className: cn("pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-sm px-1 text-xs font-medium text-sidebar-foreground tabular-nums select-none column-collapsed:hidden peer-hover/menu-button:text-sidebar-accent-foreground top-1/2 -translate-y-1/2 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=lg]/menu-button:translate-y-0 peer-data-active/menu-button:text-sidebar-primary-foreground", tone === "attention" &&
339
339
  "h-4.5 min-w-4.5 rounded-full bg-destructive font-semibold text-destructive-foreground peer-hover/menu-button:text-destructive-foreground peer-data-active/menu-button:text-destructive-foreground", className), ...props }));
340
340
  }
341
341
  function SidebarMenuSub({ className, ...props }) {
@@ -17,6 +17,8 @@ type SnippetVariant = "default" | "inverted" | "info" | "warning" | "destructive
17
17
  type SnippetProps = SnippetContent & {
18
18
  variant?: SnippetVariant | undefined;
19
19
  prompt?: boolean | undefined;
20
+ /** A command too long for its column, such as one carrying a URL, wraps instead of scrolling out of sight. */
21
+ wrap?: boolean | undefined;
20
22
  copied?: boolean | undefined;
21
23
  onCopy?: (() => void) | undefined;
22
24
  className?: string | undefined;
@@ -33,6 +35,8 @@ type SnippetProps = SnippetContent & {
33
35
  * @behaviour “Pass the command as `text`. Authors never type a leading `$`; the component renders the prompt, so `text="$ vercel deploy"` displays as `$ $ vercel deploy`.” (https://vercel.com/geist/snippet)
34
36
  * Ours: a leading `$ `, a lone `$` or a leading `> ` typed into a string line is dropped while the
35
37
  * prompt is on, so the prompt shows once and is never copied.
38
+ * Ours: `wrap` breaks a command too long for its column, such as one that carries a URL, at any
39
+ * character, so none of it scrolls out of sight; the copy button still copies it on one line.
36
40
  * “Set `prompt={false}` for non-shell content (URLs, JSON, output you want copied verbatim) so the rendered string matches what gets copied.” (https://vercel.com/geist/snippet)
37
41
  * “Keep one command per Snippet. Pass an array to `text` for a short multi-line block; for longer scripts, switch to `CodeBlock` so users can read before they copy.” (https://vercel.com/geist/snippet)
38
42
  * “Use `copyText` only when `text` contains rich nodes (`<span>` highlights, conditional fragments) and the clipboard payload should be plain text. For a string `text`, `copyText` is redundant.” (https://vercel.com/geist/snippet)
@@ -1 +1 @@
1
- {"version":3,"file":"snippet.d.ts","sourceRoot":"","sources":["../../src/components/snippet.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAG5E,KAAK,cAAc,GACf;IACE,IAAI,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,WAAW,CAAC,EAAE,SAAS,CAAC;CACzB,GACD;IACE,IAAI,EAAE,YAAY,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,SAAS,CAAC;CACzB,GACD;IACE,IAAI,EAAE,EAAE,CAAC;IACT,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEN,KAAK,cAAc,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,aAAa,CAAC;AAElF,KAAK,YAAY,GAAG,cAAc,GAAG;IACnC,OAAO,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;IACrC,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,MAAM,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC,GAAG,IAAI,CAAC,eAAe,EAAE,WAAW,GAAG,aAAa,GAAG,iBAAiB,CAAC,CAAC;AAiC3E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,iBAAS,OAAO,CAAC,KAAK,EAAE,YAAY,+BA8DnC;AAED,OAAO,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"snippet.d.ts","sourceRoot":"","sources":["../../src/components/snippet.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAG5E,KAAK,cAAc,GACf;IACE,IAAI,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,WAAW,CAAC,EAAE,SAAS,CAAC;CACzB,GACD;IACE,IAAI,EAAE,YAAY,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,SAAS,CAAC;CACzB,GACD;IACE,IAAI,EAAE,EAAE,CAAC;IACT,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEN,KAAK,cAAc,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,aAAa,CAAC;AAElF,KAAK,YAAY,GAAG,cAAc,GAAG;IACnC,OAAO,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;IACrC,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,8GAA8G;IAC9G,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,MAAM,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC,GAAG,IAAI,CAAC,eAAe,EAAE,WAAW,GAAG,aAAa,GAAG,iBAAiB,CAAC,CAAC;AAiC3E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,iBAAS,OAAO,CAAC,KAAK,EAAE,YAAY,+BA0EnC;AAED,OAAO,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,CAAC"}
@@ -37,6 +37,8 @@ function linesOf(content, prompt) {
37
37
  * @behaviour “Pass the command as `text`. Authors never type a leading `$`; the component renders the prompt, so `text="$ vercel deploy"` displays as `$ $ vercel deploy`.” (https://vercel.com/geist/snippet)
38
38
  * Ours: a leading `$ `, a lone `$` or a leading `> ` typed into a string line is dropped while the
39
39
  * prompt is on, so the prompt shows once and is never copied.
40
+ * Ours: `wrap` breaks a command too long for its column, such as one that carries a URL, at any
41
+ * character, so none of it scrolls out of sight; the copy button still copies it on one line.
40
42
  * “Set `prompt={false}` for non-shell content (URLs, JSON, output you want copied verbatim) so the rendered string matches what gets copied.” (https://vercel.com/geist/snippet)
41
43
  * “Keep one command per Snippet. Pass an array to `text` for a short multi-line block; for longer scripts, switch to `CodeBlock` so users can read before they copy.” (https://vercel.com/geist/snippet)
42
44
  * “Use `copyText` only when `text` contains rich nodes (`<span>` highlights, conditional fragments) and the clipboard payload should be plain text. For a string `text`, `copyText` is redundant.” (https://vercel.com/geist/snippet)
@@ -61,9 +63,9 @@ function linesOf(content, prompt) {
61
63
  * named by `copyLabel`, and the result is read once from its status.
62
64
  */
63
65
  function Snippet(props) {
64
- const { className, copied, copiedLabel, copyFailedLabel, copyLabel, onCopy, prompt = true, variant = "default", } = props;
66
+ const { className, copied, copiedLabel, copyFailedLabel, copyLabel, onCopy, prompt = true, variant = "default", wrap = false, } = props;
65
67
  const value = copiedValue(props, prompt);
66
68
  const empty = props.placeholder !== undefined;
67
- return (_jsxs("div", { "data-slot": "snippet", "data-variant": variant, className: cn("relative flex w-fit max-w-full min-w-0 flex-col rounded-sm border py-2.5 pl-3 font-label-mono-md text-label-mono-md", empty ? "pr-3" : "pr-12", SHELL[variant], className), children: [_jsx("div", { className: "min-w-0 overflow-x-auto scrollbar-none [&::-webkit-scrollbar]:hidden", children: empty ? (_jsx("span", { className: variant === "default" ? "text-placeholder" : "opacity-70", children: props.placeholder })) : (linesOf(props, prompt).map((line, index) => (_jsxs("div", { className: "flex gap-2 whitespace-pre", children: [prompt ? (_jsx("span", { "aria-hidden": "true", className: "select-none", children: "$" })) : null, _jsx("span", { children: line })] }, index)))) }), empty ? null : (_jsx("div", { className: cn("nc-transition-opacity absolute top-1/2 right-1 -translate-y-1/2 rounded-sm hover:opacity-80 hover:ring-1 hover:ring-border", COPY_KEEPS_SHELL_COLOUR), children: _jsx(CopyButton, { value: value, copyLabel: copyLabel, copiedLabel: copiedLabel, copyFailedLabel: copyFailedLabel, copied: copied, onCopy: onCopy, size: "icon-sm" }) }))] }));
69
+ return (_jsxs("div", { "data-slot": "snippet", "data-variant": variant, className: cn("relative flex w-fit max-w-full min-w-0 flex-col rounded-sm border py-2.5 pl-3 font-label-mono-md text-label-mono-md", empty ? "pr-3" : "pr-12", SHELL[variant], className), children: [_jsx("div", { className: cn("min-w-0", !wrap && "overflow-x-auto scrollbar-none [&::-webkit-scrollbar]:hidden"), children: empty ? (_jsx("span", { className: variant === "default" ? "text-placeholder" : "opacity-70", children: props.placeholder })) : (linesOf(props, prompt).map((line, index) => (_jsxs("div", { className: cn("flex gap-2", wrap ? "break-all whitespace-pre-wrap" : "whitespace-pre"), children: [prompt ? (_jsx("span", { "aria-hidden": "true", className: "select-none", children: "$" })) : null, _jsx("span", { children: line })] }, index)))) }), empty ? null : (_jsx("div", { className: cn("nc-transition-opacity absolute top-1/2 right-1 -translate-y-1/2 rounded-sm hover:opacity-80 hover:ring-1 hover:ring-border", COPY_KEEPS_SHELL_COLOUR), children: _jsx(CopyButton, { value: value, copyLabel: copyLabel, copiedLabel: copiedLabel, copyFailedLabel: copyFailedLabel, copied: copied, onCopy: onCopy, size: "icon-sm" }) }))] }));
68
70
  }
69
71
  export { Snippet };
@@ -1 +1 @@
1
- {"version":3,"file":"catalog-list.d.ts","sourceRoot":"","sources":["../../src/internal/catalog-list.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAqB,cAAc,EAAE,MAAM,4BAA4B,CAAC;AASpF,KAAK,cAAc,GAAG,CAAC,GAAG,CAAC,CAAC;AAwG5B,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,YAAgB,EAChB,QAAQ,GACT,EAAE;IACD,OAAO,EAAE,cAAc,CAAC;IACxB,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IACrB,QAAQ,EAAE,SAAS,cAAc,EAAE,CAAC;CACrC,+BAsBA;AAED,wBAAgB,eAAe,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE;IAAE,OAAO,EAAE,cAAc,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,+BAoB7F;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,SAAS,cAAc,EAAE,GAAG,OAAO,CAE3E"}
1
+ {"version":3,"file":"catalog-list.d.ts","sourceRoot":"","sources":["../../src/internal/catalog-list.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAqB,cAAc,EAAE,MAAM,4BAA4B,CAAC;AASpF,KAAK,cAAc,GAAG,CAAC,GAAG,CAAC,CAAC;AA0H5B,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,YAAgB,EAChB,QAAQ,GACT,EAAE;IACD,OAAO,EAAE,cAAc,CAAC;IACxB,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IACrB,QAAQ,EAAE,SAAS,cAAc,EAAE,CAAC;CACrC,+BAsBA;AAED,wBAAgB,eAAe,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE;IAAE,OAAO,EAAE,cAAc,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,+BAsB7F;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,SAAS,cAAc,EAAE,GAAG,OAAO,CAE3E"}
@@ -9,7 +9,10 @@ import { Skeleton, SkeletonRegion } from "../components/skeleton.js";
9
9
  import { textLinkVariants } from "../components/text-link.js";
10
10
  import { RowMessageActions, RowMessageLine } from "./row-message.js";
11
11
  import { cn } from "../lib/utils.js";
12
- const ENTRY_FRAME = "flex min-w-0 items-start gap-3.5 rounded-sm bg-card p-4 nc-elevation-resting";
12
+ const ENTRY_FRAME = "@container/catalog-entry min-w-0 rounded-sm bg-card p-4 nc-elevation-resting";
13
+ // One row from 24rem inside the entry's padding; narrower, the controls go under the words.
14
+ const ENTRY_LAYOUT = "grid grid-cols-[auto_minmax(0,1fr)] items-start gap-x-3.5 gap-y-3 @sm/catalog-entry:grid-cols-[auto_minmax(0,1fr)_auto]";
15
+ const ENTRY_CONTROLS_PLACE = "col-start-2 @sm/catalog-entry:col-start-3";
13
16
  function EntryName({ link, name }) {
14
17
  if (!link)
15
18
  return name;
@@ -23,12 +26,12 @@ function EntryName({ link, name }) {
23
26
  function EntryAdd({ add }) {
24
27
  const { added, ...command } = add;
25
28
  if (added) {
26
- return (_jsxs("span", { className: "flex h-control-height items-center gap-1.5 px-1 text-sm text-muted-foreground", children: [_jsx(CheckIcon, { "aria-hidden": "true", className: "size-4" }), added.label] }));
29
+ return (_jsxs("span", { className: "flex h-control-height items-center gap-1.5 text-sm text-muted-foreground", children: [_jsx(CheckIcon, { "aria-hidden": "true", className: "size-4" }), added.label] }));
27
30
  }
28
31
  return (_jsx(PageCommandButton, { command: { ...command, icon: _jsx(PlusIcon, { "aria-hidden": "true" }) }, variant: "outline" }));
29
32
  }
30
33
  function CatalogEntry({ add, description, fact, link, mark, menu, name, state, }) {
31
- return (_jsxs("li", { className: ENTRY_FRAME, "data-slot": "catalog-entry", children: [_jsx(IdentityMark, { ...mark, size: 40 }), _jsxs("div", { className: "grid min-w-0 flex-1 gap-0.5", children: [_jsx("span", { className: "truncate text-sm font-medium text-foreground", children: _jsx(EntryName, { link: link, name: name }) }), _jsx("p", { className: cn("text-body-sm text-muted-foreground", !state && "line-clamp-1"), children: state ? _jsx(RowMessageLine, { state: state }) : description })] }), _jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [fact, state ? _jsx(RowMessageActions, { state: state }) : null, add ? _jsx(EntryAdd, { add: add }) : null, menu ? (_jsx(RecordCommands, { placement: "row", commands: menu.commands, moreLabel: menu.label, record: name })) : null] })] }));
34
+ return (_jsx("li", { className: ENTRY_FRAME, "data-slot": "catalog-entry", children: _jsxs("div", { className: ENTRY_LAYOUT, children: [_jsx(IdentityMark, { ...mark, size: 40 }), _jsxs("div", { className: "grid min-w-0 grid-cols-[minmax(0,1fr)] gap-0.5 wrap-break-word", children: [_jsx("span", { className: "text-sm font-medium text-foreground @sm/catalog-entry:truncate", children: _jsx(EntryName, { link: link, name: name }) }), _jsx("p", { className: cn("text-body-sm text-muted-foreground", !state && "line-clamp-2 @sm/catalog-entry:line-clamp-1"), children: state ? _jsx(RowMessageLine, { state: state }) : description })] }), _jsxs("div", { className: cn("flex flex-wrap items-center gap-2 @sm/catalog-entry:flex-nowrap", ENTRY_CONTROLS_PLACE), children: [fact, state ? _jsx(RowMessageActions, { state: state }) : null, add ? _jsx(EntryAdd, { add: add }) : null, menu ? (_jsx(RecordCommands, { placement: "row", commands: menu.commands, moreLabel: menu.label, record: name })) : null] })] }) }));
32
35
  }
33
36
  function EntryList({ columns, entries, }) {
34
37
  return (_jsx("ul", { className: cn("grid gap-3", columns === 2 && "md:grid-cols-2"), children: entries.map((entry) => (_jsx(CatalogEntry, { ...entry }, entry.id))) }));
@@ -48,7 +51,7 @@ export function CatalogList({ columns, headingLevel = 3, sections, }) {
48
51
  }) }));
49
52
  }
50
53
  export function CatalogSkeleton({ columns, label }) {
51
- return (_jsx(SkeletonRegion, { "aria-label": label, busy: true, className: cn("grid gap-3", columns === 2 && "md:grid-cols-2"), role: "status", children: Array.from({ length: columns * 3 }, (_, index) => (_jsxs("div", { "aria-hidden": "true", className: ENTRY_FRAME, children: [_jsx(Skeleton, { className: "size-10 shrink-0" }), _jsxs("div", { className: "grid flex-1 gap-1.5 pt-0.5", children: [_jsx(Skeleton, { className: "h-4 w-32" }), _jsx(Skeleton, { className: "h-3.5 w-full" })] }), _jsx(Skeleton, { className: "h-control-height w-16 shrink-0" })] }, index))) }));
54
+ return (_jsx(SkeletonRegion, { "aria-label": label, busy: true, className: cn("grid gap-3", columns === 2 && "md:grid-cols-2"), role: "status", children: Array.from({ length: columns * 3 }, (_, index) => (_jsx("div", { "aria-hidden": "true", className: ENTRY_FRAME, children: _jsxs("div", { className: ENTRY_LAYOUT, children: [_jsx(Skeleton, { className: "size-10" }), _jsxs("div", { className: "grid gap-1.5 pt-0.5", children: [_jsx(Skeleton, { className: "h-4 w-32" }), _jsx(Skeleton, { className: "h-3.5 w-full" })] }), _jsx(Skeleton, { className: cn("h-control-height w-16", ENTRY_CONTROLS_PLACE) })] }) }, index))) }));
52
55
  }
53
56
  export function catalogIsEmpty(sections) {
54
57
  return sections.every((section) => section.entries.length === 0);
@@ -54,8 +54,8 @@ export const USAGE = [
54
54
  summary: "A catalogue to choose from in the right-side sheet, each entry added from its own row.",
55
55
  when: "Ours: a person picks one or more things from a list too long for a dialog, the page still behind it: add a skill, add an app to a new Agent.",
56
56
  instead: '"Don’t use Sheet to confirm destructive actions. The default `modal=false` keeps the page interactive, which weakens severity for a delete or revoke." (https://vercel.com/geist/sheet) Ours: the shelf of everything the company holds, on its own page, is a `LibraryShelf`; a setup in steps is a `FormDrawer` with `job="steps"`; a new record from a few fields is a `FormDialog`.',
57
- behaviour: '"Outside-click does not auto-close, so always render an explicit close affordance and honor Escape." (https://vercel.com/geist/sheet) Ours: a modal sheet from the right, as `FormDrawer`. The header holds the title, the description and Close; below it sits the search, which stays in place, and then the body, which scrolls and holds the entries in one column under their section titles. It draws one state at a time: the failure with its retry, three still entries while the catalogue loads, no match with a way to clear the search, nothing at all, or the entries. An entry already held shows a muted check and its word in place of Add. The footer\'s one button closes the drawer.',
58
- words: '"Title is Title Case and names the entity (`Deployment Details`, `Member Profile`), not the page action." (https://vercel.com/geist/sheet) "Cancel literal stays `Cancel`. Acknowledgment-only Modals (after a key reveal, after a one-time-show) use `Done`, never `OK` or `Close`." (https://vercel.com/geist/modal) Ours: the title is sentence case and names the job: "Add a skill". The search names what it finds: "Search the hub". Each entry\'s button is "Add"; the held word is "Added"; the footer\'s is "Done".',
57
+ behaviour: '"Outside-click does not auto-close, so always render an explicit close affordance and honor Escape." (https://vercel.com/geist/sheet) Ours: a modal sheet from the right, as `FormDrawer`. The header holds the title, the description and Close; below it sits the search, which stays in place, and then the body, which scrolls and holds the entries in one column under their section titles. A `notice`, a `MessageNotice` with `placement="section"`, stands first in the body for a lasting condition of part of the catalogue, such as a source it could not read, with its one action, and the entries it could read stay beside it. It draws one state at a time: the failure with its retry, three still entries while the catalogue loads, no match with a way to clear the search, nothing at all, or the entries. An entry already held shows a muted check and its word in place of Add. The footer\'s one button closes the drawer.',
58
+ words: '"Title is Title Case and names the entity (`Deployment Details`, `Member Profile`), not the page action." (https://vercel.com/geist/sheet) "Cancel literal stays `Cancel`. Acknowledgment-only Modals (after a key reveal, after a one-time-show) use `Done`, never `OK` or `Close`." (https://vercel.com/geist/modal) Ours: the title is sentence case and names the job: "Add a skill". The search names what it finds: "Search the hub". Each entry\'s button is "Add"; the held word is "Added"; the footer\'s is "Done". A notice is a message from the product\'s catalogue: "The Library\'s plugins can\'t be shown right now".',
59
59
  access: '"Trap focus inside the sheet while it’s open and return focus to the trigger row on close so keyboard users keep their place in the list." (https://vercel.com/geist/sheet) "Provide a visible close button labeled `Close` (or an icon button with `aria-label="Close"`) since clicking outside doesn’t dismiss." (https://vercel.com/geist/sheet) Ours: a modal dialog named by its title; focus starts in the search. The loading entries are one status named by `loadingLabel`.',
60
60
  },
61
61
  {
@@ -1517,7 +1517,7 @@ export const USAGE = [
1517
1517
  summary: "One command a person copies and runs in a terminal.",
1518
1518
  when: "“Use Snippet for a runnable shell command the user is meant to copy. For inline tokens (env var names, paths) use `InlineCode`, and for multi-line source use `CodeBlock`.” (https://vercel.com/geist/snippet) Ours: a command or a short sequence of commands to paste into a terminal: an install, a sign-in, a pairing step.",
1519
1519
  instead: "Ours: a value that is not a command (an identifier, a URL, a checksum) is `TextWithCopyButton`. A script someone reads before running is a `CodeBlock`. A token inside a sentence is inline code.",
1520
- behaviour: '“Pass the command as `text`. Authors never type a leading `$`; the component renders the prompt, so `text="$ vercel deploy"` displays as `$ $ vercel deploy`.” (https://vercel.com/geist/snippet) Ours: a leading `$ `, a lone `$` or a leading `> ` typed into a string line is dropped while the prompt is on, so the prompt shows once and is never copied. “Set `prompt={false}` for non-shell content (URLs, JSON, output you want copied verbatim) so the rendered string matches what gets copied.” (https://vercel.com/geist/snippet) “Keep one command per Snippet. Pass an array to `text` for a short multi-line block; for longer scripts, switch to `CodeBlock` so users can read before they copy.” (https://vercel.com/geist/snippet) “Use `copyText` only when `text` contains rich nodes (`<span>` highlights, conditional fragments) and the clipboard payload should be plain text. For a string `text`, `copyText` is redundant.” (https://vercel.com/geist/snippet) “Use the `copied` prop to control the copy button animation externally. This lets you copy different text (e.g. from a context card) while reusing the snippet\'s checkmark feedback.” (https://vercel.com/geist/snippet) “Use `copied` plus an `onCopy` callback when a parent surface (a card, a tooltip) needs to show the same checkmark feedback while copying different text.” (https://vercel.com/geist/snippet) Ours: Geist\'s `dark`, `type` and `width` props are not ours: `variant` sets the colour and the shell sizes itself to its text. The copy mark is a `CopyButton`; `copied` and `onCopy` let a parent show its checkmark. An array of strings is copied joined by line breaks, one row each after its own prompt; the prompt is never copied. The shell is as wide as its text, up to its row (`className="w-full"` fills the row); a longer line scrolls sideways with no scrollbar. `text=""` with a `placeholder` shows the placeholder, copies nothing and has no button. `text` that is an element needs `copyText`; a string needs none. `onCopy` reports a copy once the clipboard confirms. `variant` puts one colour on the whole shell, its text and the copy mark together: `info`, `warning` or `destructive` for a command inside a note of that kind, `inverted` for a dark block on a light page; the default is neutral, which is what almost every snippet is. Hovering the copy mark dims it and draws a 1 px ring; it never takes a fill or leaves the shell\'s text colour.',
1520
+ behaviour: '“Pass the command as `text`. Authors never type a leading `$`; the component renders the prompt, so `text="$ vercel deploy"` displays as `$ $ vercel deploy`.” (https://vercel.com/geist/snippet) Ours: a leading `$ `, a lone `$` or a leading `> ` typed into a string line is dropped while the prompt is on, so the prompt shows once and is never copied. Ours: `wrap` breaks a command too long for its column, such as one that carries a URL, at any character, so none of it scrolls out of sight; the copy button still copies it on one line. “Set `prompt={false}` for non-shell content (URLs, JSON, output you want copied verbatim) so the rendered string matches what gets copied.” (https://vercel.com/geist/snippet) “Keep one command per Snippet. Pass an array to `text` for a short multi-line block; for longer scripts, switch to `CodeBlock` so users can read before they copy.” (https://vercel.com/geist/snippet) “Use `copyText` only when `text` contains rich nodes (`<span>` highlights, conditional fragments) and the clipboard payload should be plain text. For a string `text`, `copyText` is redundant.” (https://vercel.com/geist/snippet) “Use the `copied` prop to control the copy button animation externally. This lets you copy different text (e.g. from a context card) while reusing the snippet\'s checkmark feedback.” (https://vercel.com/geist/snippet) “Use `copied` plus an `onCopy` callback when a parent surface (a card, a tooltip) needs to show the same checkmark feedback while copying different text.” (https://vercel.com/geist/snippet) Ours: Geist\'s `dark`, `type` and `width` props are not ours: `variant` sets the colour and the shell sizes itself to its text. The copy mark is a `CopyButton`; `copied` and `onCopy` let a parent show its checkmark. An array of strings is copied joined by line breaks, one row each after its own prompt; the prompt is never copied. The shell is as wide as its text, up to its row (`className="w-full"` fills the row); a longer line scrolls sideways with no scrollbar. `text=""` with a `placeholder` shows the placeholder, copies nothing and has no button. `text` that is an element needs `copyText`; a string needs none. `onCopy` reports a copy once the clipboard confirms. `variant` puts one colour on the whole shell, its text and the copy mark together: `info`, `warning` or `destructive` for a command inside a note of that kind, `inverted` for a dark block on a light page; the default is neutral, which is what almost every snippet is. Hovering the copy mark dims it and draws a 1 px ring; it never takes a fill or leaves the shell\'s text colour.',
1521
1521
  words: '“Pair `placeholder` with `text=""` for an empty state. Sentence case, no trailing period, no `Please`: `Run vercel link to fetch env vars`. The placeholder is informational, not copied.” (https://vercel.com/geist/snippet) Ours: the command as typed. The placeholder example is *Run nadia login to connect this computer*. `copyLabel` names the command (*Copy install command*); `copiedLabel` and `copyFailedLabel` are required with it.',
1522
1522
  access: "Ours: the text is read as text; the prompt is hidden from assistive technology. The button is named by `copyLabel`, and the result is read once from its status.",
1523
1523
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nadicodeai/ui",
3
- "version": "12.1.236",
3
+ "version": "12.1.238",
4
4
  "type": "module",
5
5
  "imports": {
6
6
  "#jsx": "./src/jsx/index.ts",
@@ -82,7 +82,7 @@
82
82
  "@headless-tree/react": "1.8.0",
83
83
  "@iconify-icons/logos": "^2.0.3",
84
84
  "@iconify/react": "^6.0.2",
85
- "@nadicodeai/design-system": "12.1.236",
85
+ "@nadicodeai/design-system": "12.1.238",
86
86
  "@tanstack/react-table": "^9.3.1",
87
87
  "@vgpu/wgsl": "0.6.0",
88
88
  "class-variance-authority": "^0.7.1",