@nadicodeai/ui 12.1.199 → 12.1.201
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/agent-card.d.ts +54 -22
- package/dist/components/agent-card.d.ts.map +1 -1
- package/dist/components/agent-card.js +47 -20
- package/dist/components/agent-orb.d.ts +2 -2
- package/dist/components/agent-orb.js +2 -2
- package/dist/components/catalog-card.d.ts +27 -0
- package/dist/components/catalog-card.d.ts.map +1 -0
- package/dist/components/catalog-card.js +19 -0
- package/dist/components/drawer-steps.d.ts +31 -0
- package/dist/components/drawer-steps.d.ts.map +1 -0
- package/dist/components/drawer-steps.js +27 -0
- package/dist/components/form-drawer.d.ts +11 -6
- package/dist/components/form-drawer.d.ts.map +1 -1
- package/dist/components/form-drawer.js +2 -2
- package/dist/components/library-shelf.d.ts +20 -4
- package/dist/components/library-shelf.d.ts.map +1 -1
- package/dist/components/library-shelf.js +28 -8
- package/dist/components/object-workspace.d.ts.map +1 -1
- package/dist/components/object-workspace.js +3 -1
- package/dist/components/record-sheet.d.ts +19 -6
- package/dist/components/record-sheet.d.ts.map +1 -1
- package/dist/components/record-sheet.js +11 -6
- package/dist/components/sheet.d.ts +4 -2
- package/dist/components/sheet.d.ts.map +1 -1
- package/dist/components/sheet.js +5 -3
- package/dist/components/sidebar-sections.d.ts +3 -1
- package/dist/components/sidebar-sections.d.ts.map +1 -1
- package/dist/components/sidebar-sections.js +3 -3
- package/dist/components/step-cards.d.ts +28 -0
- package/dist/components/step-cards.d.ts.map +1 -0
- package/dist/components/step-cards.js +21 -0
- package/dist/internal/form-drawer-frame.d.ts +2 -0
- package/dist/internal/form-drawer-frame.d.ts.map +1 -1
- package/dist/internal/form-drawer-frame.js +3 -1
- package/dist/showcase/specimens/compositions.d.ts +6 -0
- package/dist/showcase/specimens/compositions.d.ts.map +1 -1
- package/dist/showcase/specimens/compositions.js +39 -1
- package/dist/showcase/specimens/data.d.ts +1 -0
- package/dist/showcase/specimens/data.d.ts.map +1 -1
- package/dist/showcase/specimens/data.js +4 -3
- package/dist/showcase/specimens/index.d.ts +4 -0
- package/dist/showcase/specimens/index.d.ts.map +1 -1
- package/dist/showcase/usage.generated.d.ts +1 -1
- package/dist/showcase/usage.generated.d.ts.map +1 -1
- package/dist/showcase/usage.generated.js +61 -17
- package/package.json +2 -2
|
@@ -1,38 +1,70 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
2
|
import { Card } from "./card.js";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
/** What a pressable card's top corner glows with on hover: an app's logo or her orb's colour. */
|
|
4
|
+
export type AgentCardGlow = {
|
|
5
|
+
image: string;
|
|
6
|
+
} | {
|
|
7
|
+
color: string;
|
|
8
|
+
};
|
|
9
|
+
type AgentCardContent = {
|
|
5
10
|
job: ReactNode;
|
|
6
11
|
meta?: ReactNode;
|
|
7
12
|
name: ReactNode;
|
|
8
13
|
status?: ReactNode;
|
|
9
|
-
/** The object's picture: an Agent's orb,
|
|
14
|
+
/** The object's picture: an Agent's orb, at 64 on a card and at 40 in a row. */
|
|
10
15
|
visual?: ReactNode;
|
|
11
16
|
};
|
|
17
|
+
export type AgentCardProps = AgentCardContent & Omit<React.ComponentProps<typeof Card>, "children" | "onClick" | "render"> & ({
|
|
18
|
+
action?: ReactNode;
|
|
19
|
+
glow?: never;
|
|
20
|
+
onOpen?: never;
|
|
21
|
+
}
|
|
22
|
+
/** The whole card is the one target, so it holds no control of its own. */
|
|
23
|
+
| {
|
|
24
|
+
action?: never;
|
|
25
|
+
glow?: AgentCardGlow;
|
|
26
|
+
onOpen: () => void;
|
|
27
|
+
});
|
|
12
28
|
/**
|
|
13
|
-
* One Agent, or another pictured object, as a card in a gallery
|
|
14
|
-
* Templates gallery draws a template.
|
|
29
|
+
* One Agent, or another pictured object, as a card in a gallery.
|
|
15
30
|
*
|
|
16
31
|
* @family Data
|
|
17
32
|
* @when A gallery of Agents or templates where each one is chosen by its picture and its job: the
|
|
18
33
|
* Agents to create from, the templates of a hub. An Agent shown as an object is this one card
|
|
19
34
|
* shape wherever it appears, in the Portal's Library and in Nadia's gallery alike.
|
|
20
|
-
* @instead
|
|
21
|
-
* `
|
|
22
|
-
* collection (`CollectionPage`).
|
|
23
|
-
* @behaviour Vercel's
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
35
|
+
* @instead The same gallery read as a list is `AgentRow`. A list of Agents to open is
|
|
36
|
+
* `AgentListRow`. An Agent's own page opens with `AgentProfileCard`, where the name is the page
|
|
37
|
+
* heading. A Library skill or plugin is a row of its collection (`CollectionPage`).
|
|
38
|
+
* @behaviour As Vercel's Connect cards: every card has the same slots, so what one holds never moves
|
|
39
|
+
* another's. The picture stands top left, her orb at 64 with its empty edge outside the card's
|
|
40
|
+
* padding, and the status (her apps) top right; at the card's foot her name on one line, her job in
|
|
41
|
+
* a slot of two lines cut after the second, and the meta, with the one action at its end. With
|
|
42
|
+
* `onOpen` the whole card is one button and holds no action; on hover its ground lifts and, with
|
|
43
|
+
* `glow`, the corner behind the status fades up in a blurred 112 px of that logo or colour over
|
|
44
|
+
* 500 ms. A text object, with no picture, keeps the same foot.
|
|
30
45
|
* @words The name as the Agent calls herself; the job in one line (*Writes quotes from the price
|
|
31
|
-
* list*); the meta as short facts joined by a middle dot (*6 skills ·
|
|
32
|
-
* and noun (*
|
|
33
|
-
* @access
|
|
34
|
-
* real button or link.
|
|
46
|
+
* list*); the meta as short facts joined by a middle dot (*6 skills · 2 tasks*); the action verb
|
|
47
|
+
* and noun (*Start*).
|
|
48
|
+
* @access With `onOpen` the name, the job and the meta name the button, in that order, and the
|
|
49
|
+
* status and the orb stay out of its name; the glow is hidden; an action is a real button or link.
|
|
50
|
+
*/
|
|
51
|
+
declare function AgentCard({ action, className, glow, job, meta, name, onOpen, status, visual, ...props }: AgentCardProps): import("react").JSX.Element;
|
|
52
|
+
export type AgentRowProps = AgentCardContent & {
|
|
53
|
+
onOpen: () => void;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* One Agent of a gallery as a row: the same object as `AgentCard`, read as a list.
|
|
57
|
+
*
|
|
58
|
+
* @family Data
|
|
59
|
+
* @when A shelf's rows view, inside `LibraryShelf` with `view="rows"`: the Portal's Agent templates.
|
|
60
|
+
* @instead The gallery's default is `AgentCard`. A list of Agents to open as records is a
|
|
61
|
+
* `RecordList` row; Nadia's sidebar is `AgentListRow`.
|
|
62
|
+
* @behaviour The whole row is one button, 64 px high at every width: her orb at 40, her name over her
|
|
63
|
+
* job, each on one line, the status and the meta in columns of 128 px that line up down the shelf,
|
|
64
|
+
* then a chevron. Below `md` the columns go, and the card or the surface it opens holds them.
|
|
65
|
+
* @words As `AgentCard`.
|
|
66
|
+
* @access The row's text names the button; the orb and the chevron are decorative.
|
|
35
67
|
*/
|
|
36
|
-
declare function
|
|
37
|
-
export { AgentCard,
|
|
68
|
+
declare function AgentRow({ job, meta, name, onOpen, status, visual }: AgentRowProps): import("react").JSX.Element;
|
|
69
|
+
export { AgentCard, AgentRow };
|
|
38
70
|
//# sourceMappingURL=agent-card.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-card.d.ts","sourceRoot":"","sources":["../../src/components/agent-card.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agent-card.d.ts","sourceRoot":"","sources":["../../src/components/agent-card.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAS,MAAM,OAAO,CAAC;AAE9C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAGzC,iGAAiG;AACjG,MAAM,MAAM,aAAa,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAElE,KAAK,gBAAgB,GAAG;IACtB,GAAG,EAAE,SAAS,CAAC;I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from "react";
|
|
4
|
+
import { Card } from "./card.js";
|
|
3
5
|
import { cn } from "../lib/utils.js";
|
|
4
6
|
function hasSlotContent(value) {
|
|
5
7
|
return value !== null && value !== undefined && value !== false;
|
|
6
8
|
}
|
|
9
|
+
const PRESSABLE = "cursor-pointer text-left outline-ring transition-colors duration-150 hover:bg-accent focus-visible:outline-2 focus-visible:outline-offset-2";
|
|
10
|
+
function CornerGlow({ glow }) {
|
|
11
|
+
return (_jsx("span", { "aria-hidden": "true", className: "pointer-events-none absolute -top-6 -right-6 size-28 rounded-full bg-contain bg-center bg-no-repeat opacity-0 blur-[40px] saturate-150 transition-opacity duration-500 group-hover/card:opacity-70 group-focus-visible/card:opacity-70", "data-slot": "agent-card-glow", style: "image" in glow
|
|
12
|
+
? { backgroundImage: `url("${glow.image}")` }
|
|
13
|
+
: { backgroundColor: glow.color } }));
|
|
14
|
+
}
|
|
7
15
|
/**
|
|
8
|
-
* One Agent, or another pictured object, as a card in a gallery
|
|
9
|
-
* Templates gallery draws a template.
|
|
16
|
+
* One Agent, or another pictured object, as a card in a gallery.
|
|
10
17
|
*
|
|
11
18
|
* @family Data
|
|
12
19
|
* @when A gallery of Agents or templates where each one is chosen by its picture and its job: the
|
|
13
20
|
* Agents to create from, the templates of a hub. An Agent shown as an object is this one card
|
|
14
21
|
* shape wherever it appears, in the Portal's Library and in Nadia's gallery alike.
|
|
15
|
-
* @instead
|
|
16
|
-
* `
|
|
17
|
-
* collection (`CollectionPage`).
|
|
18
|
-
* @behaviour Vercel's
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
22
|
+
* @instead The same gallery read as a list is `AgentRow`. A list of Agents to open is
|
|
23
|
+
* `AgentListRow`. An Agent's own page opens with `AgentProfileCard`, where the name is the page
|
|
24
|
+
* heading. A Library skill or plugin is a row of its collection (`CollectionPage`).
|
|
25
|
+
* @behaviour As Vercel's Connect cards: every card has the same slots, so what one holds never moves
|
|
26
|
+
* another's. The picture stands top left, her orb at 64 with its empty edge outside the card's
|
|
27
|
+
* padding, and the status (her apps) top right; at the card's foot her name on one line, her job in
|
|
28
|
+
* a slot of two lines cut after the second, and the meta, with the one action at its end. With
|
|
29
|
+
* `onOpen` the whole card is one button and holds no action; on hover its ground lifts and, with
|
|
30
|
+
* `glow`, the corner behind the status fades up in a blurred 112 px of that logo or colour over
|
|
31
|
+
* 500 ms. A text object, with no picture, keeps the same foot.
|
|
25
32
|
* @words The name as the Agent calls herself; the job in one line (*Writes quotes from the price
|
|
26
|
-
* list*); the meta as short facts joined by a middle dot (*6 skills ·
|
|
27
|
-
* and noun (*
|
|
28
|
-
* @access
|
|
29
|
-
* real button or link.
|
|
33
|
+
* list*); the meta as short facts joined by a middle dot (*6 skills · 2 tasks*); the action verb
|
|
34
|
+
* and noun (*Start*).
|
|
35
|
+
* @access With `onOpen` the name, the job and the meta name the button, in that order, and the
|
|
36
|
+
* status and the orb stay out of its name; the glow is hidden; an action is a real button or link.
|
|
30
37
|
*/
|
|
31
|
-
function AgentCard({ action, className, job, meta, name, status, visual, ...props }) {
|
|
38
|
+
function AgentCard({ action, className, glow, job, meta, name, onOpen, status, visual, ...props }) {
|
|
32
39
|
const hasStatus = hasSlotContent(status);
|
|
33
40
|
const hasMeta = hasSlotContent(meta);
|
|
34
41
|
const hasAction = hasSlotContent(action);
|
|
35
42
|
const hasVisual = hasSlotContent(visual);
|
|
36
|
-
|
|
43
|
+
const id = useId();
|
|
44
|
+
const words = hasMeta ? `${id}-name ${id}-job ${id}-meta` : `${id}-name ${id}-job`;
|
|
45
|
+
return (_jsxs(Card, { className: cn("relative h-full min-h-48 min-w-0 gap-0 p-4", onOpen && PRESSABLE, className), ...(onOpen
|
|
46
|
+
? { render: _jsx("button", { "aria-labelledby": words, onClick: onOpen, type: "button" }) }
|
|
47
|
+
: {}), ...props, children: [glow ? _jsx(CornerGlow, { glow: glow }) : null, hasVisual || hasStatus ? (_jsxs("span", { className: "relative flex min-h-12 w-full shrink-0 items-start justify-between gap-3", children: [hasVisual ? (_jsx("span", { className: "-mt-2 -ml-2 shrink-0", "data-slot": "agent-card-visual", children: visual })) : (_jsx("span", {})), hasStatus ? (_jsx("span", { className: "flex min-w-0 flex-wrap items-center justify-end gap-nadicode-xxs", "data-slot": "agent-card-status", children: status })) : null] })) : null, _jsxs("span", { className: "relative mt-auto grid w-full min-w-0 gap-1 pt-nadicode-md", children: [_jsx("span", { className: "truncate text-heading-xs text-foreground", "data-slot": "agent-card-name", id: `${id}-name`, children: name }), _jsx("span", { className: "line-clamp-2 h-10 text-sm text-muted-foreground", "data-slot": "agent-card-job", id: `${id}-job`, children: job }), hasMeta || hasAction ? (_jsxs("span", { className: "flex min-h-5 min-w-0 items-center justify-between gap-3 pt-1", children: [_jsx("span", { className: "min-w-0 truncate text-xs text-muted-foreground", "data-slot": "agent-card-meta", id: `${id}-meta`, children: hasMeta ? meta : null }), hasAction ? (_jsx("span", { className: "shrink-0", "data-slot": "agent-card-action", children: action })) : null] })) : null] })] }));
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* One Agent of a gallery as a row: the same object as `AgentCard`, read as a list.
|
|
51
|
+
*
|
|
52
|
+
* @family Data
|
|
53
|
+
* @when A shelf's rows view, inside `LibraryShelf` with `view="rows"`: the Portal's Agent templates.
|
|
54
|
+
* @instead The gallery's default is `AgentCard`. A list of Agents to open as records is a
|
|
55
|
+
* `RecordList` row; Nadia's sidebar is `AgentListRow`.
|
|
56
|
+
* @behaviour The whole row is one button, 64 px high at every width: her orb at 40, her name over her
|
|
57
|
+
* job, each on one line, the status and the meta in columns of 128 px that line up down the shelf,
|
|
58
|
+
* then a chevron. Below `md` the columns go, and the card or the surface it opens holds them.
|
|
59
|
+
* @words As `AgentCard`.
|
|
60
|
+
* @access The row's text names the button; the orb and the chevron are decorative.
|
|
61
|
+
*/
|
|
62
|
+
function AgentRow({ job, meta, name, onOpen, status, visual }) {
|
|
63
|
+
return (_jsxs("button", { className: cn("grid h-16 w-full grid-cols-[2.5rem_minmax(0,1fr)_1rem] items-center gap-4 px-4 md:grid-cols-[2.5rem_minmax(0,1fr)_8rem_8rem_1rem]", PRESSABLE, "focus-visible:-outline-offset-2"), "data-slot": "agent-row", onClick: onOpen, type: "button", children: [_jsx("span", { className: "size-10", children: visual }), _jsxs("span", { className: "grid min-w-0 gap-0.5", children: [_jsx("span", { className: "truncate text-sm font-semibold text-foreground", children: name }), _jsx("span", { className: "truncate text-sm text-muted-foreground", children: job })] }), _jsx("span", { className: "hidden min-w-0 md:block", children: status }), _jsx("span", { className: "hidden truncate text-sm text-muted-foreground md:block", children: meta }), _jsx(ChevronRight, { "aria-hidden": "true", className: "size-4 text-muted-foreground" })] }));
|
|
37
64
|
}
|
|
38
|
-
export { AgentCard };
|
|
65
|
+
export { AgentCard, AgentRow };
|
|
@@ -33,8 +33,8 @@ export type AgentOrbProps = AgentOrbBaseProps & ({
|
|
|
33
33
|
* An Agent, anywhere: her orb, the only thing that moves on its own.
|
|
34
34
|
*
|
|
35
35
|
* @family Status
|
|
36
|
-
* @when An Agent, anywhere: 20 in the sidebar, 32 in a row,
|
|
37
|
-
* card, 160 on entry. There is no other Agent picture. The sizes are 20, 24, 32, 40, 64, 96 and
|
|
36
|
+
* @when An Agent, anywhere: 20 in the sidebar, 32 in a row, 40 in a gallery's row, 64 on her Profile
|
|
37
|
+
* card and an Agent card, 160 on entry. There is no other Agent picture. The sizes are 20, 24, 32, 40, 64, 96 and
|
|
38
38
|
* 160 px, and no other. Detail follows the size the orb is drawn at: up to 32 px it draws the
|
|
39
39
|
* engine's lightest dot profile, at 40 px the middle one and from 64 px the full one, since a small
|
|
40
40
|
* orb cannot show the full profile's dots apart. On a photograph the orb takes the stronger `presence="over-picture"`
|
|
@@ -7,8 +7,8 @@ import { cn } from "../lib/utils.js";
|
|
|
7
7
|
* An Agent, anywhere: her orb, the only thing that moves on its own.
|
|
8
8
|
*
|
|
9
9
|
* @family Status
|
|
10
|
-
* @when An Agent, anywhere: 20 in the sidebar, 32 in a row,
|
|
11
|
-
* card, 160 on entry. There is no other Agent picture. The sizes are 20, 24, 32, 40, 64, 96 and
|
|
10
|
+
* @when An Agent, anywhere: 20 in the sidebar, 32 in a row, 40 in a gallery's row, 64 on her Profile
|
|
11
|
+
* card and an Agent card, 160 on entry. There is no other Agent picture. The sizes are 20, 24, 32, 40, 64, 96 and
|
|
12
12
|
* 160 px, and no other. Detail follows the size the orb is drawn at: up to 32 px it draws the
|
|
13
13
|
* engine's lightest dot profile, at 40 px the middle one and from 64 px the full one, since a small
|
|
14
14
|
* orb cannot show the full profile's dots apart. On a photograph the orb takes the stronger `presence="over-picture"`
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { type IdentityMarkProps } from "./identity-mark.js";
|
|
3
|
+
export type CatalogCardProps = {
|
|
4
|
+
mark: IdentityMarkProps;
|
|
5
|
+
name: string;
|
|
6
|
+
/** One line on what it does; a longer one is cut after two lines. */
|
|
7
|
+
description?: ReactNode;
|
|
8
|
+
/** The card's tags at its foot: its category, how many accounts it holds. */
|
|
9
|
+
tags?: ReactNode;
|
|
10
|
+
/** The whole card opens the thing, in the drawer that sets it up. */
|
|
11
|
+
onOpen: () => void;
|
|
12
|
+
/** The name read aloud, when the name alone does not say what opening does. */
|
|
13
|
+
accessibleName?: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* One thing a person can connect, as a card in a catalogue that opens its drawer, as Vercel's
|
|
17
|
+
* Browse Connectors draws a connector.
|
|
18
|
+
*
|
|
19
|
+
* @family Data
|
|
20
|
+
* @when A catalogue a person browses by picture and name, where opening one sets it up in a drawer: Nadia's Browse apps. On a `LibraryShelf` through its `galleries`.
|
|
21
|
+
* @instead A thing added with one press, with no setup, is a `CatalogEntry`. An Agent or template chosen by its preview is an `AgentCard`. What a person already holds is a row of its `CollectionPage`.
|
|
22
|
+
* @behaviour A hairline card with the mark at 40 at its top, and at its foot the name, the line cut after two lines and the tags, so names line up along a row of cards. The whole card is one target and takes the `accent` hover, with no button of its own: the drawer holds the commands. On hover or focus an app's own logo fades in behind the card's top right corner, 112 px, blurred 40 px and more saturated, so the card glows in the app's colours, as Vercel's Featured connectors do at their top left, ruled by the owner at the top right; a mark with no logo has no glow.
|
|
23
|
+
* @words The name as the catalogue gives it. The line says what it does. Tags are short facts: a category, "2 accounts".
|
|
24
|
+
* @access The name is a real button whose target covers the card, so the tab order holds one stop a card. The mark is decorative beside it.
|
|
25
|
+
*/
|
|
26
|
+
export declare function CatalogCard({ mark, name, description, tags, onOpen, accessibleName, }: CatalogCardProps): import("react").JSX.Element;
|
|
27
|
+
//# sourceMappingURL=catalog-card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog-card.d.ts","sourceRoot":"","sources":["../../src/components/catalog-card.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAElF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,iBAAiB,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,qEAAqE;IACrE,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,6EAA6E;IAC7E,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,qEAAqE;IACrE,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,+EAA+E;IAC/E,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,IAAI,EACJ,WAAW,EACX,IAAI,EACJ,MAAM,EACN,cAAc,GACf,EAAE,gBAAgB,+BAuClB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Card } from "./card.js";
|
|
4
|
+
import { IdentityMark } from "./identity-mark.js";
|
|
5
|
+
/**
|
|
6
|
+
* One thing a person can connect, as a card in a catalogue that opens its drawer, as Vercel's
|
|
7
|
+
* Browse Connectors draws a connector.
|
|
8
|
+
*
|
|
9
|
+
* @family Data
|
|
10
|
+
* @when A catalogue a person browses by picture and name, where opening one sets it up in a drawer: Nadia's Browse apps. On a `LibraryShelf` through its `galleries`.
|
|
11
|
+
* @instead A thing added with one press, with no setup, is a `CatalogEntry`. An Agent or template chosen by its preview is an `AgentCard`. What a person already holds is a row of its `CollectionPage`.
|
|
12
|
+
* @behaviour A hairline card with the mark at 40 at its top, and at its foot the name, the line cut after two lines and the tags, so names line up along a row of cards. The whole card is one target and takes the `accent` hover, with no button of its own: the drawer holds the commands. On hover or focus an app's own logo fades in behind the card's top right corner, 112 px, blurred 40 px and more saturated, so the card glows in the app's colours, as Vercel's Featured connectors do at their top left, ruled by the owner at the top right; a mark with no logo has no glow.
|
|
13
|
+
* @words The name as the catalogue gives it. The line says what it does. Tags are short facts: a category, "2 accounts".
|
|
14
|
+
* @access The name is a real button whose target covers the card, so the tab order holds one stop a card. The mark is decorative beside it.
|
|
15
|
+
*/
|
|
16
|
+
export function CatalogCard({ mark, name, description, tags, onOpen, accessibleName, }) {
|
|
17
|
+
const glow = mark.kind === "app" ? mark.logo?.light : undefined;
|
|
18
|
+
return (_jsxs(Card, { className: "relative isolate h-full min-h-48 gap-0 px-(--card-spacing) nc-transition-paint hover:bg-accent focus-within:nc-focus-outline focus-within:outline-ring", surface: "outlined", variant: "interactive", children: [glow ? (_jsx("div", { "aria-hidden": "true", className: "pointer-events-none absolute -top-6 -right-6 -z-10 size-28 opacity-0 blur-2xl saturate-150 transition-opacity duration-500 group-focus-within/card:opacity-70 group-hover/card:opacity-70 motion-reduce:transition-none", "data-slot": "catalog-card-glow", children: _jsx("img", { alt: "", className: "size-full", src: glow }) })) : null, _jsx("div", { className: "w-fit", children: _jsx(IdentityMark, { ...mark, size: 40 }) }), _jsxs("div", { className: "mt-auto grid min-w-0 gap-1 pt-nadicode-md", children: [_jsx("button", { "aria-label": accessibleName, className: "w-fit max-w-full cursor-pointer text-left text-body-lg font-medium text-foreground outline-none after:absolute after:inset-0 after:content-['']", onClick: onOpen, type: "button", children: name }), description ? (_jsx("p", { className: "line-clamp-2 text-body-sm text-muted-foreground", children: description })) : null, tags ? (_jsx("div", { className: "flex flex-wrap items-center gap-nadicode-xxs pt-nadicode-xxs", children: tags })) : null] })] }));
|
|
19
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
+
export type DrawerStep = {
|
|
3
|
+
id: string;
|
|
4
|
+
/** The step's name; for what was already chosen, the thing's own name. */
|
|
5
|
+
title: ReactNode;
|
|
6
|
+
state: "chosen" | "current";
|
|
7
|
+
/** What was chosen stands with this in place of a number, such as an Agent's orb. */
|
|
8
|
+
mark?: ReactNode;
|
|
9
|
+
/** A `DrawerStepBody` and a `DrawerStepFooter`, with the step's form around them if it has one. */
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* A job in a drawer as a stack of cards, one per step, every step in sight from the start.
|
|
14
|
+
*
|
|
15
|
+
* @family Compositions
|
|
16
|
+
* @when Inside a `FormDrawer` with `job="stack"`: a job a person starts from a card and finishes in the drawer, as Vercel's Add Connection: what they chose, then the steps that remain.
|
|
17
|
+
* @instead Steps a person follows on a page are `NumberedSteps`; a setup whose steps replace each other around a wait is `FormDrawer` with `job="steps"`.
|
|
18
|
+
* @behaviour One card per step, 16 px apart. Each card's first row is 20 px of mark and its title, 24 px in from its sides. What was chosen stands first with its own mark, and what the person should know about it under that; the current step has its number in ink, its content and its actions in a band under it. The orb may overhang its 20 px, since its drawn edge is inside its box.
|
|
19
|
+
* @words A step's title is one or two words: *Review*, *Configure*.
|
|
20
|
+
* @access An ordered list; the current step carries `aria-current="step"`; the drawn numbers are hidden, since the list reads the position.
|
|
21
|
+
*/
|
|
22
|
+
export declare function DrawerSteps({ steps }: {
|
|
23
|
+
steps: readonly DrawerStep[];
|
|
24
|
+
}): import("react").JSX.Element;
|
|
25
|
+
/** What the current step holds, under its row. */
|
|
26
|
+
export declare function DrawerStepBody({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
|
|
27
|
+
/** The band under the current step, its primary at the end. */
|
|
28
|
+
export declare function DrawerStepFooter({ children }: {
|
|
29
|
+
children: ReactNode;
|
|
30
|
+
}): import("react").JSX.Element;
|
|
31
|
+
//# sourceMappingURL=drawer-steps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer-steps.d.ts","sourceRoot":"","sources":["../../src/components/drawer-steps.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvD,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,0EAA0E;IAC1E,KAAK,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC5B,qFAAqF;IACrF,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,mGAAmG;IACnG,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAaF;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,SAAS,UAAU,EAAE,CAAA;CAAE,+BAoBtE;AAED,kDAAkD;AAClD,wBAAgB,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,KAAK,CAAC,+BAQ5E;AAED,+DAA+D;AAC/D,wBAAgB,gBAAgB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,+BAMrE"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Card, CardFooter } from "./card.js";
|
|
3
|
+
import { cn } from "../lib/utils.js";
|
|
4
|
+
function StepNumber({ index }) {
|
|
5
|
+
return (_jsx("span", { "aria-hidden": "true", className: "flex size-5 items-center justify-center rounded-full bg-foreground text-xs font-medium tabular-nums text-background", children: index + 1 }));
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* A job in a drawer as a stack of cards, one per step, every step in sight from the start.
|
|
9
|
+
*
|
|
10
|
+
* @family Compositions
|
|
11
|
+
* @when Inside a `FormDrawer` with `job="stack"`: a job a person starts from a card and finishes in the drawer, as Vercel's Add Connection: what they chose, then the steps that remain.
|
|
12
|
+
* @instead Steps a person follows on a page are `NumberedSteps`; a setup whose steps replace each other around a wait is `FormDrawer` with `job="steps"`.
|
|
13
|
+
* @behaviour One card per step, 16 px apart. Each card's first row is 20 px of mark and its title, 24 px in from its sides. What was chosen stands first with its own mark, and what the person should know about it under that; the current step has its number in ink, its content and its actions in a band under it. The orb may overhang its 20 px, since its drawn edge is inside its box.
|
|
14
|
+
* @words A step's title is one or two words: *Review*, *Configure*.
|
|
15
|
+
* @access An ordered list; the current step carries `aria-current="step"`; the drawn numbers are hidden, since the list reads the position.
|
|
16
|
+
*/
|
|
17
|
+
export function DrawerSteps({ steps }) {
|
|
18
|
+
return (_jsx("ol", { className: "grid grid-cols-[minmax(0,1fr)] gap-4", "data-slot": "drawer-steps", children: steps.map((step, index) => (_jsx("li", { "aria-current": step.state === "current" ? "step" : undefined, children: _jsxs(Card, { className: "gap-0 py-0", "data-state": step.state, children: [_jsxs("div", { className: "flex min-w-0 items-center gap-3 px-6 py-5", children: [_jsx("span", { className: "flex size-5 shrink-0 items-center justify-center", children: step.mark ?? _jsx(StepNumber, { index: index }) }), _jsx("span", { className: "min-w-0 text-heading-xs wrap-break-word text-foreground", children: step.title })] }), step.children] }) }, step.id))) }));
|
|
19
|
+
}
|
|
20
|
+
/** What the current step holds, under its row. */
|
|
21
|
+
export function DrawerStepBody({ className, ...props }) {
|
|
22
|
+
return (_jsx("div", { className: cn("grid min-w-0 gap-5 px-6 pb-6", className), "data-slot": "drawer-step-body", ...props }));
|
|
23
|
+
}
|
|
24
|
+
/** The band under the current step, its primary at the end. */
|
|
25
|
+
export function DrawerStepFooter({ children }) {
|
|
26
|
+
return (_jsx(CardFooter, { className: "justify-end px-6", "data-slot": "drawer-step-footer", children: children }));
|
|
27
|
+
}
|
|
@@ -25,22 +25,27 @@ export type FormSurfaceProps = {
|
|
|
25
25
|
};
|
|
26
26
|
/**
|
|
27
27
|
* Why this is a drawer and not a dialog: it sets something up over several
|
|
28
|
-
* steps, with a wait
|
|
29
|
-
*
|
|
28
|
+
* steps, with a wait, or it shows what was chosen from a shelf above the few
|
|
29
|
+
* fields that make it; a list too long for a dialog is a `CatalogDrawer`. A form
|
|
30
|
+
* of a few fields alone is a `FormDialog`, and a record already on screen edits
|
|
30
31
|
* inside its row.
|
|
31
32
|
*/
|
|
32
|
-
export type FormDrawerProps = FormSurfaceProps & {
|
|
33
|
+
export type FormDrawerProps = FormSurfaceProps & ({
|
|
33
34
|
job: "steps";
|
|
34
35
|
/** "Step 2 of 3", worded by the product, drawn over the title, which stays the job's name. */
|
|
35
36
|
progress: string;
|
|
36
|
-
}
|
|
37
|
+
}
|
|
38
|
+
/** Every step in sight: a `DrawerSteps` in a `FormDrawerBody`, each step with its own actions, wider than the other drawers and with no footer of its own. */
|
|
39
|
+
| {
|
|
40
|
+
job: "stack";
|
|
41
|
+
});
|
|
37
42
|
/**
|
|
38
43
|
* The right-side sheet for a catalogue or a setup in steps, at one width.
|
|
39
44
|
*
|
|
40
45
|
* @family Compositions
|
|
41
|
-
* @when Ours: choosing from a catalogue too long for a dialog (through `CatalogDrawer`), or setting something up in several steps with a wait: connect a messaging channel, Telegram's code.
|
|
46
|
+
* @when Ours: choosing from a catalogue too long for a dialog (through `CatalogDrawer`), or setting something up in several steps with a wait: connect a messaging channel, Telegram's code; or, with `job="stack"` and a `DrawerSteps`, making something from a shelf's card with what it holds in sight, as Vercel's Add Connection: an Agent from an Agent template.
|
|
42
47
|
* @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: a new record from a few fields is a `FormDialog`; a record already in a list edits in its row with `RowEditForm`; a fact on the record's own page changes in place in its section; a consequence is confirmed in a `ConfirmDialog`; a phone's short job is a `Drawer`.
|
|
43
|
-
* @behaviour "Sheet defaults to `modal=false` so toasts and other high-z elements stay reachable. Keep that default unless the sheet owns the screen." (https://vercel.com/geist/sheet) "Pick `side` from the trigger location: a row inspector slides from `right`, a global filter from `left`. Don’t change sides mid-session." (https://vercel.com/geist/sheet) "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 edge over the scrim, because the drawer owns the screen, at the Sheet's one width that no caller sets. The header holds the step ("Step 2 of 3", in mono) over the title, which stays the job's name, then the description and Close; the body scrolls between the header and a footer that stays, with no fill or rule of its own, Cancel then the primary at its trailing edge. A press outside does not close it; Escape does, unless `unsaved.dirty` holds it back. Cancel holds while a save runs. How long it stays open while work goes on follows the product-design skill's rule/wait-shows-where-it-lives and living-elements.md "System waits".
|
|
48
|
+
* @behaviour "Sheet defaults to `modal=false` so toasts and other high-z elements stay reachable. Keep that default unless the sheet owns the screen." (https://vercel.com/geist/sheet) "Pick `side` from the trigger location: a row inspector slides from `right`, a global filter from `left`. Don’t change sides mid-session." (https://vercel.com/geist/sheet) "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 edge over the scrim, because the drawer owns the screen, at the Sheet's one width that no caller sets. The header holds the step ("Step 2 of 3", in mono) over the title, which stays the job's name, then the description and Close; the body scrolls between the header and a footer that stays, with no fill or rule of its own, Cancel then the primary at its trailing edge. A press outside does not close it; Escape does, unless `unsaved.dirty` holds it back. Cancel holds while a save runs. With `job="stack"` it is 658 px wide from `lg`, for the cards it holds, with no step line over the title and no footer: each card has its own actions. How long it stays open while work goes on follows the product-design skill's rule/wait-shows-where-it-lives and living-elements.md "System waits".
|
|
44
49
|
* @words "Title is Title Case and names the entity (`Deployment Details`, `Member Profile`), not the page action." (https://vercel.com/geist/sheet) "Body is read-mostly: sentence case prose with Title Case sub-headings. Action buttons are optional; when present, follow `Verb + Noun`." (https://vercel.com/geist/sheet) Ours: the title is sentence case and names the job and its object: "Connect Telegram", "Add a skill". The step reads "Step N of M". The primary says what it does: "Connect", "Continue", never "OK".
|
|
45
50
|
* @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) "Announce the sheet with `aria-labelledby` pointing at the title; pair it with `aria-describedby` only when the body is short and load-bearing." (https://vercel.com/geist/sheet) Ours: a modal dialog named by its title; focus returns to the opener on close, or to `finalFocus` when the opener is gone. The step is read before the title.
|
|
46
51
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-drawer.d.ts","sourceRoot":"","sources":["../../src/components/form-drawer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvD,OAAO,EAAc,YAAY,EAAe,MAAM,oBAAoB,CAAC;AAG3E,OAAO,EAAE,KAAK,SAAS,EAAoB,MAAM,wBAAwB,CAAC;AAC1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAG7D,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpE,wFAAwF;AACxF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,OAAO,CAAC;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|
@@ -11,9 +11,9 @@ import { cn } from "../lib/utils.js";
|
|
|
11
11
|
* The right-side sheet for a catalogue or a setup in steps, at one width.
|
|
12
12
|
*
|
|
13
13
|
* @family Compositions
|
|
14
|
-
* @when Ours: choosing from a catalogue too long for a dialog (through `CatalogDrawer`), or setting something up in several steps with a wait: connect a messaging channel, Telegram's code.
|
|
14
|
+
* @when Ours: choosing from a catalogue too long for a dialog (through `CatalogDrawer`), or setting something up in several steps with a wait: connect a messaging channel, Telegram's code; or, with `job="stack"` and a `DrawerSteps`, making something from a shelf's card with what it holds in sight, as Vercel's Add Connection: an Agent from an Agent template.
|
|
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: a new record from a few fields is a `FormDialog`; a record already in a list edits in its row with `RowEditForm`; a fact on the record's own page changes in place in its section; a consequence is confirmed in a `ConfirmDialog`; a phone's short job is a `Drawer`.
|
|
16
|
-
* @behaviour "Sheet defaults to `modal=false` so toasts and other high-z elements stay reachable. Keep that default unless the sheet owns the screen." (https://vercel.com/geist/sheet) "Pick `side` from the trigger location: a row inspector slides from `right`, a global filter from `left`. Don’t change sides mid-session." (https://vercel.com/geist/sheet) "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 edge over the scrim, because the drawer owns the screen, at the Sheet's one width that no caller sets. The header holds the step ("Step 2 of 3", in mono) over the title, which stays the job's name, then the description and Close; the body scrolls between the header and a footer that stays, with no fill or rule of its own, Cancel then the primary at its trailing edge. A press outside does not close it; Escape does, unless `unsaved.dirty` holds it back. Cancel holds while a save runs. How long it stays open while work goes on follows the product-design skill's rule/wait-shows-where-it-lives and living-elements.md "System waits".
|
|
16
|
+
* @behaviour "Sheet defaults to `modal=false` so toasts and other high-z elements stay reachable. Keep that default unless the sheet owns the screen." (https://vercel.com/geist/sheet) "Pick `side` from the trigger location: a row inspector slides from `right`, a global filter from `left`. Don’t change sides mid-session." (https://vercel.com/geist/sheet) "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 edge over the scrim, because the drawer owns the screen, at the Sheet's one width that no caller sets. The header holds the step ("Step 2 of 3", in mono) over the title, which stays the job's name, then the description and Close; the body scrolls between the header and a footer that stays, with no fill or rule of its own, Cancel then the primary at its trailing edge. A press outside does not close it; Escape does, unless `unsaved.dirty` holds it back. Cancel holds while a save runs. With `job="stack"` it is 658 px wide from `lg`, for the cards it holds, with no step line over the title and no footer: each card has its own actions. How long it stays open while work goes on follows the product-design skill's rule/wait-shows-where-it-lives and living-elements.md "System waits".
|
|
17
17
|
* @words "Title is Title Case and names the entity (`Deployment Details`, `Member Profile`), not the page action." (https://vercel.com/geist/sheet) "Body is read-mostly: sentence case prose with Title Case sub-headings. Action buttons are optional; when present, follow `Verb + Noun`." (https://vercel.com/geist/sheet) Ours: the title is sentence case and names the job and its object: "Connect Telegram", "Add a skill". The step reads "Step N of M". The primary says what it does: "Connect", "Continue", never "OK".
|
|
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) "Announce the sheet with `aria-labelledby` pointing at the title; pair it with `aria-describedby` only when the body is short and load-bearing." (https://vercel.com/geist/sheet) Ours: a modal dialog named by its title; focus returns to the opener on close, or to `finalFocus` when the opener is gone. The step is read before the title.
|
|
19
19
|
*/
|
|
@@ -2,12 +2,21 @@ import type { ReactElement, ReactNode } from "react";
|
|
|
2
2
|
import type { CatalogSection } from "./catalog-entry.js";
|
|
3
3
|
import { type CollectionSearchProps } from "./collection-search.js";
|
|
4
4
|
import { type EmptyStateKind } from "./empty-state.js";
|
|
5
|
+
export type ShelfGallery = {
|
|
6
|
+
id: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
cards: readonly ReactElement[];
|
|
9
|
+
/** Under the cards, for a shelf that shows only its first ones: a `LoadMoreButton`. */
|
|
10
|
+
more?: ReactNode;
|
|
11
|
+
};
|
|
5
12
|
export type LibraryShelfProps = {
|
|
6
13
|
/** One line saying what the shelf holds, for a shelf whose page has no title of its own to carry it, such as Nadia's gallery. */
|
|
7
14
|
definition?: string;
|
|
8
15
|
/** Above the search, for the people who keep the shelf: the hub's sync. */
|
|
9
16
|
notice?: ReactNode;
|
|
10
17
|
search?: CollectionSearchProps;
|
|
18
|
+
/** At the end of the search's row: the switch between a shelf's two views. */
|
|
19
|
+
searchEnd?: ReactNode;
|
|
11
20
|
loadingLabel: string;
|
|
12
21
|
empty: EmptyStateKind<"firstUse"> | EmptyStateKind<"nothingYet">;
|
|
13
22
|
/** Offered only while the search holds text; otherwise a shelf with nothing in it is `empty`. */
|
|
@@ -16,18 +25,25 @@ export type LibraryShelfProps = {
|
|
|
16
25
|
} & ({
|
|
17
26
|
sections: readonly CatalogSection[] | undefined;
|
|
18
27
|
}
|
|
19
|
-
/** The Agent templates shelf: AgentCard elements,
|
|
28
|
+
/** The Agent templates shelf: AgentCard elements, or AgentRow elements with `view="rows"`. */
|
|
20
29
|
| {
|
|
21
30
|
templates: readonly ReactElement[] | undefined;
|
|
31
|
+
/** Cards to a row from md: three by default. */
|
|
32
|
+
columns?: 2 | 3;
|
|
33
|
+
view?: "cards" | "rows";
|
|
34
|
+
}
|
|
35
|
+
/** A shelf of cards under section titles, three to a row: `CatalogCard` elements. */
|
|
36
|
+
| {
|
|
37
|
+
galleries: readonly ShelfGallery[] | undefined;
|
|
22
38
|
});
|
|
23
39
|
/**
|
|
24
40
|
* A Library shelf: the one line saying what it holds, the search, then the
|
|
25
|
-
* reusable things a person adds, as two-column entries or Agent template cards.
|
|
41
|
+
* reusable things a person adds, as two-column entries, or Agent template cards or rows.
|
|
26
42
|
*
|
|
27
43
|
* @family Compositions
|
|
28
|
-
* @when A gallery of reusable things a person adds, as Vercel's Templates gallery: the Portal's Agent templates, Nadia's New Agent gallery.
|
|
44
|
+
* @when A gallery of reusable things a person adds, as Vercel's Templates gallery: the Portal's Agent templates, Nadia's New Agent gallery; or a catalogue of cards under section titles, as Vercel's Browse Connectors: Nadia's Browse apps (`galleries`).
|
|
29
45
|
* @instead The Portal's Skills and Plugins are entity rows a person finds, opens and adds, a CollectionPage; records a person already has and acts on are a CollectionPage too; choosing from a catalogue without leaving the page is a CatalogDrawer.
|
|
30
|
-
* @behaviour The definition line only where the page has no title row to stand under (a titled page follows the title with the search, as every collection does). Shows, the first that holds: the failure; still entries while the shelf loads; noMatch while the search finds nothing; empty when the shelf holds nothing; then each section's title over its entries, two to a row from md, or the templates three to a row
|
|
46
|
+
* @behaviour The definition line only where the page has no title row to stand under (a titled page follows the title with the search, as every collection does). Shows, the first that holds: the failure; still entries while the shelf loads; noMatch while the search finds nothing; empty when the shelf holds nothing; then each section's title over its entries, two to a row from md, or the templates as cards, three to a row or as `columns` says, or as one list of rows with `view="rows"`. Each entry has its kind's tile, its name (the link to its page), one line, one fact, one Add control or the word saying it is already added, then its menu. A failed add puts its message in the entry's line and its next steps beside its controls. The search shows unless the shelf is empty, with `searchEnd` at the end of its row.
|
|
31
47
|
* @words The product words every string: the optional definition (one sentence on what the shelf holds), the search's label ("Search skills"), the loading label, each entry's name, line, Add label and added word, the empty, noMatch and failed messages.
|
|
32
48
|
* @access Each section is a region named by its h2; entries are list items; loading is a status named by loadingLabel and aria-busy; a failed add is announced as an alert; each entry's menu is named by its label.
|
|
33
49
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"library-shelf.d.ts","sourceRoot":"","sources":["../../src/components/library-shelf.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":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AAE,OAAO,GAAG,MAAM,CAAC;CACzB;AACH,qFAAqF;GACnF;IAAE,SAAS,EAAE,SAAS,YAAY,EAAE,GAAG,SAAS,CAAA;CAAE,CACrD,CAAC;AAoEF;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,+BAgCpD"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Card } from "./card.js";
|
|
3
4
|
import { CardRow } from "./card-row.js";
|
|
4
5
|
import { CollectionSearch } from "./collection-search.js";
|
|
5
6
|
import { EmptyState } from "./empty-state.js";
|
|
@@ -7,34 +8,53 @@ import { CatalogList, CatalogSkeleton, catalogIsEmpty } from "../internal/catalo
|
|
|
7
8
|
function loadedShelf(props) {
|
|
8
9
|
if ("sections" in props)
|
|
9
10
|
return props.sections && { sections: props.sections };
|
|
10
|
-
|
|
11
|
+
if ("galleries" in props)
|
|
12
|
+
return props.galleries && { galleries: props.galleries };
|
|
13
|
+
return (props.templates && {
|
|
14
|
+
templates: props.templates,
|
|
15
|
+
columns: props.columns ?? 3,
|
|
16
|
+
view: props.view ?? "cards",
|
|
17
|
+
});
|
|
11
18
|
}
|
|
12
19
|
function holdsNothing(shelf) {
|
|
13
|
-
|
|
20
|
+
if ("sections" in shelf)
|
|
21
|
+
return catalogIsEmpty(shelf.sections);
|
|
22
|
+
if ("galleries" in shelf)
|
|
23
|
+
return shelf.galleries.every(({ cards }) => cards.length === 0);
|
|
24
|
+
return shelf.templates.length === 0;
|
|
25
|
+
}
|
|
26
|
+
function ShelfCards({ cards, columns }) {
|
|
27
|
+
return (_jsx(CardRow, { className: "gap-4", columns: columns, render: _jsx("ul", {}), children: cards.map((card, index) => (_jsx("li", { children: card }, card.key ?? index))) }));
|
|
14
28
|
}
|
|
15
29
|
function ShelfContents({ shelf }) {
|
|
16
30
|
if ("sections" in shelf) {
|
|
17
31
|
return _jsx(CatalogList, { columns: 2, headingLevel: 2, sections: shelf.sections });
|
|
18
32
|
}
|
|
19
|
-
|
|
33
|
+
if ("galleries" in shelf) {
|
|
34
|
+
return (_jsx("div", { className: "grid min-w-0 gap-8", children: shelf.galleries.map(({ id, title, cards, more }) => cards.length === 0 ? null : (_jsxs("section", { className: "grid min-w-0 gap-3", children: [title ? _jsx("h2", { className: "text-heading-sm text-foreground", children: title }) : null, _jsx(ShelfCards, { cards: cards, columns: 3 }), more] }, id))) }));
|
|
35
|
+
}
|
|
36
|
+
if (shelf.view === "rows") {
|
|
37
|
+
return (_jsx(Card, { className: "gap-0 overflow-hidden py-0", render: _jsx("ul", {}), children: shelf.templates.map((template, index) => (_jsx("li", { className: "not-last:border-b not-last:border-border", children: template }, template.key ?? index))) }));
|
|
38
|
+
}
|
|
39
|
+
return _jsx(ShelfCards, { cards: shelf.templates, columns: shelf.columns });
|
|
20
40
|
}
|
|
21
41
|
/**
|
|
22
42
|
* A Library shelf: the one line saying what it holds, the search, then the
|
|
23
|
-
* reusable things a person adds, as two-column entries or Agent template cards.
|
|
43
|
+
* reusable things a person adds, as two-column entries, or Agent template cards or rows.
|
|
24
44
|
*
|
|
25
45
|
* @family Compositions
|
|
26
|
-
* @when A gallery of reusable things a person adds, as Vercel's Templates gallery: the Portal's Agent templates, Nadia's New Agent gallery.
|
|
46
|
+
* @when A gallery of reusable things a person adds, as Vercel's Templates gallery: the Portal's Agent templates, Nadia's New Agent gallery; or a catalogue of cards under section titles, as Vercel's Browse Connectors: Nadia's Browse apps (`galleries`).
|
|
27
47
|
* @instead The Portal's Skills and Plugins are entity rows a person finds, opens and adds, a CollectionPage; records a person already has and acts on are a CollectionPage too; choosing from a catalogue without leaving the page is a CatalogDrawer.
|
|
28
|
-
* @behaviour The definition line only where the page has no title row to stand under (a titled page follows the title with the search, as every collection does). Shows, the first that holds: the failure; still entries while the shelf loads; noMatch while the search finds nothing; empty when the shelf holds nothing; then each section's title over its entries, two to a row from md, or the templates three to a row
|
|
48
|
+
* @behaviour The definition line only where the page has no title row to stand under (a titled page follows the title with the search, as every collection does). Shows, the first that holds: the failure; still entries while the shelf loads; noMatch while the search finds nothing; empty when the shelf holds nothing; then each section's title over its entries, two to a row from md, or the templates as cards, three to a row or as `columns` says, or as one list of rows with `view="rows"`. Each entry has its kind's tile, its name (the link to its page), one line, one fact, one Add control or the word saying it is already added, then its menu. A failed add puts its message in the entry's line and its next steps beside its controls. The search shows unless the shelf is empty, with `searchEnd` at the end of its row.
|
|
29
49
|
* @words The product words every string: the optional definition (one sentence on what the shelf holds), the search's label ("Search skills"), the loading label, each entry's name, line, Add label and added word, the empty, noMatch and failed messages.
|
|
30
50
|
* @access Each section is a region named by its h2; entries are list items; loading is a status named by loadingLabel and aria-busy; a failed add is announced as an alert; each entry's menu is named by its label.
|
|
31
51
|
*/
|
|
32
52
|
export function LibraryShelf(props) {
|
|
33
|
-
const { definition, empty, failed, loadingLabel, notice, search } = props;
|
|
53
|
+
const { definition, empty, failed, loadingLabel, notice, search, searchEnd } = props;
|
|
34
54
|
const noMatch = search?.value ? props.noMatch : undefined;
|
|
35
55
|
const shelf = loadedShelf(props);
|
|
36
56
|
const nothing = shelf !== undefined && holdsNothing(shelf);
|
|
37
57
|
const body = failed ? (_jsx(EmptyState, { ...failed, scope: "page" })) : !shelf ? (_jsx(CatalogSkeleton, { columns: 2, label: loadingLabel })) : nothing && noMatch ? (_jsx(EmptyState, { kind: "noResults", ...noMatch, scope: "page" })) : nothing ? (_jsx(EmptyState, { ...empty, scope: "page" })) : (_jsx(ShelfContents, { shelf: shelf }));
|
|
38
58
|
const showsEmpty = !failed && nothing && !noMatch;
|
|
39
|
-
return (_jsxs("div", { className: "grid min-w-0 gap-6", "data-slot": "library-shelf", children: [definition ? _jsx("p", { className: "text-body-md text-muted-foreground", children: definition }) : null, notice, search && !showsEmpty ? _jsx(CollectionSearch, { ...search }) : null, body] }));
|
|
59
|
+
return (_jsxs("div", { className: "grid min-w-0 gap-6", "data-slot": "library-shelf", children: [definition ? _jsx("p", { className: "text-body-md text-muted-foreground", children: definition }) : null, notice, search && !showsEmpty ? (_jsxs("div", { className: "flex min-w-0 items-center gap-2", "data-slot": "library-shelf-search", children: [_jsx("div", { className: "min-w-0 flex-1", children: _jsx(CollectionSearch, { ...search }) }), searchEnd] })) : null, body] }));
|
|
40
60
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"object-workspace.d.ts","sourceRoot":"","sources":["../../src/components/object-workspace.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAS,MAAM,OAAO,CAAC;AAK9C,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,WAAW,EAEjB,MAAM,gBAAgB,CAAC;AAGxB,KAAK,eAAe,GAAG;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,CAAC;IACjB,gGAAgG;IAChG,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,eAAe,GACtC,CACI;IACE;;;OAGG;IACH,KAAK,EAAE,IAAI,CAAC;IACZ,QAAQ,CAAC,EAAE,KAAK,CAAC;CAClB,GACD;IACE,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,oJAAoJ;IACpJ,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CACJ,CAAC;AAEJ,8FAA8F;AAC9F,MAAM,MAAM,cAAc,GACtB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,WAAW,CAAA;CAAE,GACvC;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,WAAW,CAAA;CAAE,CAAC;AAE5C;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,WAAW,EACX,OAAO,EACP,MAAM,EACN,QAAQ,EACR,YAAgB,GACjB,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,oFAAoF;IACpF,WAAW,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACpC,8FAA8F;IAC9F,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,mGAAmG;IACnG,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,QAAQ,EAAE,SAAS,CAAC;IACpB,sFAAsF;IACtF,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CAC1B,+BAsBA;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,OAAmB,GACpB,EAAE;IACD,KAAK,EAAE,SAAS,UAAU,EAAE,CAAC;IAC7B,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACjC,+
|
|
1
|
+
{"version":3,"file":"object-workspace.d.ts","sourceRoot":"","sources":["../../src/components/object-workspace.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAS,MAAM,OAAO,CAAC;AAK9C,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,WAAW,EAEjB,MAAM,gBAAgB,CAAC;AAGxB,KAAK,eAAe,GAAG;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,CAAC;IACjB,gGAAgG;IAChG,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,eAAe,GACtC,CACI;IACE;;;OAGG;IACH,KAAK,EAAE,IAAI,CAAC;IACZ,QAAQ,CAAC,EAAE,KAAK,CAAC;CAClB,GACD;IACE,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,oJAAoJ;IACpJ,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CACJ,CAAC;AAEJ,8FAA8F;AAC9F,MAAM,MAAM,cAAc,GACtB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,WAAW,CAAA;CAAE,GACvC;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,WAAW,CAAA;CAAE,CAAC;AAE5C;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,WAAW,EACX,OAAO,EACP,MAAM,EACN,QAAQ,EACR,YAAgB,GACjB,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,oFAAoF;IACpF,WAAW,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACpC,8FAA8F;IAC9F,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,mGAAmG;IACnG,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,QAAQ,EAAE,SAAS,CAAC;IACpB,sFAAsF;IACtF,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CAC1B,+BAsBA;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,OAAmB,GACpB,EAAE;IACD,KAAK,EAAE,SAAS,UAAU,EAAE,CAAC;IAC7B,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACjC,+BAyDA"}
|
|
@@ -39,5 +39,7 @@ export function ObjectFacts({ facts, density = "default", }) {
|
|
|
39
39
|
const termId = useId();
|
|
40
40
|
return (_jsx("dl", { "data-density": density, "data-slot": "object-facts", className: density === "compact"
|
|
41
41
|
? "grid min-w-0 grid-cols-2 gap-x-6 gap-y-2"
|
|
42
|
-
: "grid min-w-0 gap-x-6 gap-y-5 sm:grid-cols-2", children: facts.map((fact, index) => (_jsxs("div", { className: cn(density === "compact"
|
|
42
|
+
: "grid min-w-0 gap-x-6 gap-y-5 sm:grid-cols-2", children: facts.map((fact, index) => (_jsxs("div", { className: cn(density === "compact"
|
|
43
|
+
? "grid min-w-0 content-start gap-0.5"
|
|
44
|
+
: "grid min-w-0 content-start gap-2", fact.block && "col-span-full", fact.right && "text-right"), children: [_jsxs("dt", { className: cn("min-h-4 text-sm/3.5 text-muted-foreground", fact.ellipsis && "truncate"), children: [_jsx("span", { id: `${termId}-${index}`, children: fact.label }), fact.tooltip ? (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { "aria-label": fact.label, className: "ml-1 inline-flex size-3.5 cursor-help align-text-bottom", children: _jsx(Info, { "aria-hidden": "true", className: "size-3.5" }) }), _jsx(TooltipContent, { children: fact.tooltip })] })) : null] }), _jsx("dd", { "aria-labelledby": `${termId}-${index}`, className: cn("min-w-0 text-sm", fact.block ? "font-normal leading-5 whitespace-pre-wrap" : "font-medium leading-4", fact.ellipsis ? "truncate" : "wrap-break-word"), title: fact.ellipsis && typeof fact.value === "string" ? fact.value : undefined, children: fact.value })] }, fact.label))) }));
|
|
43
45
|
}
|