@nadicodeai/ui 12.1.237 → 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.
|
@@ -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
|
|
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,C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AAc,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 };
|
|
@@ -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.
|
|
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.
|
|
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",
|