@cloudgrid-io/ui 0.63.0 → 0.65.0
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/blocks/add-tile.d.ts +16 -1
- package/dist/blocks/add-tile.d.ts.map +1 -1
- package/dist/blocks/add-tile.js +20 -3
- package/dist/blocks/add-tile.js.map +1 -1
- package/dist/blocks/avatar-picker.d.ts +19 -1
- package/dist/blocks/avatar-picker.d.ts.map +1 -1
- package/dist/blocks/avatar-picker.js +16 -3
- package/dist/blocks/avatar-picker.js.map +1 -1
- package/dist/blocks/bento-card-hint.d.ts +16 -0
- package/dist/blocks/bento-card-hint.d.ts.map +1 -0
- package/dist/blocks/bento-card-hint.js +23 -0
- package/dist/blocks/bento-card-hint.js.map +1 -0
- package/dist/blocks/bento-card.d.ts +59 -0
- package/dist/blocks/bento-card.d.ts.map +1 -0
- package/dist/blocks/bento-card.js +59 -0
- package/dist/blocks/bento-card.js.map +1 -0
- package/dist/blocks/coming-soon-hint.d.ts.map +1 -1
- package/dist/blocks/coming-soon-hint.js +110 -7
- package/dist/blocks/coming-soon-hint.js.map +1 -1
- package/dist/blocks/creation-search.d.ts +147 -0
- package/dist/blocks/creation-search.d.ts.map +1 -0
- package/dist/blocks/creation-search.js +239 -0
- package/dist/blocks/creation-search.js.map +1 -0
- package/dist/blocks/entity-card.d.ts +80 -2
- package/dist/blocks/entity-card.d.ts.map +1 -1
- package/dist/blocks/entity-card.js +162 -17
- package/dist/blocks/entity-card.js.map +1 -1
- package/dist/blocks/from-your-grid.d.ts +66 -0
- package/dist/blocks/from-your-grid.d.ts.map +1 -0
- package/dist/blocks/from-your-grid.js +63 -0
- package/dist/blocks/from-your-grid.js.map +1 -0
- package/dist/blocks/grid-profile.d.ts +17 -1
- package/dist/blocks/grid-profile.d.ts.map +1 -1
- package/dist/blocks/grid-profile.js +66 -5
- package/dist/blocks/grid-profile.js.map +1 -1
- package/dist/blocks/home-bento.d.ts +86 -0
- package/dist/blocks/home-bento.d.ts.map +1 -0
- package/dist/blocks/home-bento.js +87 -0
- package/dist/blocks/home-bento.js.map +1 -0
- package/dist/blocks/home-empty-illustrations.d.ts +37 -0
- package/dist/blocks/home-empty-illustrations.d.ts.map +1 -0
- package/dist/blocks/home-empty-illustrations.js +47 -0
- package/dist/blocks/home-empty-illustrations.js.map +1 -0
- package/dist/blocks/home-pinned.d.ts +120 -0
- package/dist/blocks/home-pinned.d.ts.map +1 -0
- package/dist/blocks/home-pinned.js +58 -0
- package/dist/blocks/home-pinned.js.map +1 -0
- package/dist/blocks/icons.d.ts +39 -0
- package/dist/blocks/icons.d.ts.map +1 -1
- package/dist/blocks/icons.js +39 -0
- package/dist/blocks/icons.js.map +1 -1
- package/dist/blocks/image-adjust-dialog.d.ts +171 -0
- package/dist/blocks/image-adjust-dialog.d.ts.map +1 -0
- package/dist/blocks/image-adjust-dialog.js +396 -0
- package/dist/blocks/image-adjust-dialog.js.map +1 -0
- package/dist/blocks/inspiration-cards.d.ts +241 -0
- package/dist/blocks/inspiration-cards.d.ts.map +1 -0
- package/dist/blocks/inspiration-cards.js +234 -0
- package/dist/blocks/inspiration-cards.js.map +1 -0
- package/dist/blocks/liquid-glass.d.ts +106 -0
- package/dist/blocks/liquid-glass.d.ts.map +1 -0
- package/dist/blocks/liquid-glass.js +283 -0
- package/dist/blocks/liquid-glass.js.map +1 -0
- package/dist/blocks/meter.d.ts +5 -2
- package/dist/blocks/meter.d.ts.map +1 -1
- package/dist/blocks/meter.js +4 -0
- package/dist/blocks/meter.js.map +1 -1
- package/dist/blocks/motion.d.ts +46 -0
- package/dist/blocks/motion.d.ts.map +1 -0
- package/dist/blocks/motion.js +144 -0
- package/dist/blocks/motion.js.map +1 -0
- package/dist/blocks/needs-attention.d.ts +78 -0
- package/dist/blocks/needs-attention.d.ts.map +1 -0
- package/dist/blocks/needs-attention.js +29 -0
- package/dist/blocks/needs-attention.js.map +1 -0
- package/dist/blocks/phosphor-marks.d.ts +16 -0
- package/dist/blocks/phosphor-marks.d.ts.map +1 -1
- package/dist/blocks/phosphor-marks.js +24 -0
- package/dist/blocks/phosphor-marks.js.map +1 -1
- package/dist/blocks/ranked-list.d.ts +7 -1
- package/dist/blocks/ranked-list.d.ts.map +1 -1
- package/dist/blocks/ranked-list.js +8 -6
- package/dist/blocks/ranked-list.js.map +1 -1
- package/dist/blocks/recent-plugs.d.ts +66 -0
- package/dist/blocks/recent-plugs.d.ts.map +1 -0
- package/dist/blocks/recent-plugs.js +20 -0
- package/dist/blocks/recent-plugs.js.map +1 -0
- package/dist/blocks/shared-grid-illustration.d.ts +55 -0
- package/dist/blocks/shared-grid-illustration.d.ts.map +1 -0
- package/dist/blocks/shared-grid-illustration.js +81 -0
- package/dist/blocks/shared-grid-illustration.js.map +1 -0
- package/dist/blocks/shelf-strip.d.ts +36 -0
- package/dist/blocks/shelf-strip.d.ts.map +1 -0
- package/dist/blocks/shelf-strip.js +32 -0
- package/dist/blocks/shelf-strip.js.map +1 -0
- package/dist/blocks/stat-tile.d.ts +17 -1
- package/dist/blocks/stat-tile.d.ts.map +1 -1
- package/dist/blocks/stat-tile.js +4 -1
- package/dist/blocks/stat-tile.js.map +1 -1
- package/dist/blocks/top-creations.d.ts +76 -0
- package/dist/blocks/top-creations.d.ts.map +1 -0
- package/dist/blocks/top-creations.js +54 -0
- package/dist/blocks/top-creations.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/fit.d.ts +39 -0
- package/dist/lib/fit.d.ts.map +1 -0
- package/dist/lib/fit.js +92 -0
- package/dist/lib/fit.js.map +1 -0
- package/dist/lib/motion.d.ts +126 -0
- package/dist/lib/motion.d.ts.map +1 -0
- package/dist/lib/motion.js +132 -0
- package/dist/lib/motion.js.map +1 -0
- package/dist/ui/dialog.d.ts +7 -1
- package/dist/ui/dialog.d.ts.map +1 -1
- package/dist/ui/dialog.js +2 -2
- package/dist/ui/dialog.js.map +1 -1
- package/package.json +2 -1
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx,
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
|
+
import { Menu as MenuPrimitive } from "@base-ui/react/menu";
|
|
4
5
|
import { cn } from "../lib/cloudgrid-cn.js";
|
|
5
6
|
import { Avatar } from "./avatar.js";
|
|
6
7
|
import { AVATAR_PICKER_ACCEPT, routeAvatarFile, } from "./avatar-picker.js";
|
|
7
8
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "../ui/dropdown-menu.js";
|
|
8
9
|
import { ChangePhotoIcon, EditIcon } from "./icons.js";
|
|
10
|
+
import { ImageAdjustDialog, useImageAdjustStep } from "./image-adjust-dialog.js";
|
|
9
11
|
import { EditableValue } from "./settings-row.js";
|
|
10
12
|
import { Spinner } from "../ui/spinner.js";
|
|
11
13
|
/**
|
|
@@ -74,6 +76,37 @@ import { Spinner } from "../ui/spinner.js";
|
|
|
74
76
|
* opens with `description` when it is a string, and empty otherwise. They win
|
|
75
77
|
* over `onEditName` / `onEditDescription`, the pop-up path, which still works.
|
|
76
78
|
*
|
|
79
|
+
* ui#527, the adjust step, opt-in. With `logoAdjust` (and `onSelectLogoFile`),
|
|
80
|
+
* a picked file that passes the type and size checks opens `ImageAdjustDialog`
|
|
81
|
+
* in the logo's rounded square; the person moves and zooms it, and Save calls
|
|
82
|
+
* `onSelectLogoFile` with the adjusted square (WebP, else PNG, at
|
|
83
|
+
* `outputSize`, 512 by default). Cancel calls nothing. A rejected file never
|
|
84
|
+
* opens it. Without `logoAdjust` nothing changes, byte for byte, and with it
|
|
85
|
+
* the markup is the same until a file is picked.
|
|
86
|
+
*
|
|
87
|
+
* ui#544, the logo menu, opt-in. With `onAdjustLogo` (and `onSelectLogoFile`):
|
|
88
|
+
*
|
|
89
|
+
* - The menu is "Adjust logo", "Replace logo" and "Remove logo". "Adjust logo"
|
|
90
|
+
* (only when there is a `logoSrc`) opens the adjust step on the current
|
|
91
|
+
* logo, and Save calls `onAdjustLogo` with the adjusted square. "Replace
|
|
92
|
+
* logo" is "Upload new logo" under a clearer name, and "Upload logo" when
|
|
93
|
+
* there is no logo, since there is nothing to replace: it picks a picture,
|
|
94
|
+
* then the adjust step, and Save calls `onSelectLogoFile`, as before.
|
|
95
|
+
* "Remove logo" is as before.
|
|
96
|
+
* - The pencil and the tile open that same menu, each under itself: the tile
|
|
97
|
+
* is a second trigger of it (a detached `Menu.Trigger`), so the tile keeps its
|
|
98
|
+
* camera, its name and its one tab stop, and the menu its single list. With
|
|
99
|
+
* no logo the tile goes straight to the file chooser, as before.
|
|
100
|
+
* - The adjust step is always on for a picked file, so Replace and Adjust are
|
|
101
|
+
* the same step; `logoAdjust`'s title and `outputSize` apply to both.
|
|
102
|
+
* - The platform keeps only the saved square (256), not the upload, so Adjust
|
|
103
|
+
* works on that: `logoSrc` is loaded with `crossOrigin="anonymous"`, and must
|
|
104
|
+
* be same-origin or served with CORS for the canvas to be written. The API's
|
|
105
|
+
* `/api/v2/avatars/<key>.webp` is (`Access-Control-Allow-Origin: *`).
|
|
106
|
+
*
|
|
107
|
+
* Without `onAdjustLogo` nothing changes, byte for byte, and the menu reads
|
|
108
|
+
* "Upload new logo" and "Remove logo" as before.
|
|
109
|
+
*
|
|
77
110
|
* The block makes no network call: the upload, the removal and the saves are
|
|
78
111
|
* the caller's. `logoComingSoon` wins over a handler and draws what it drew before.
|
|
79
112
|
* `onEditLogo` (deprecated) still draws the old pencil that calls it, so a
|
|
@@ -88,15 +121,43 @@ const LOGO_OVERLAY = "absolute inset-0 grid place-items-center rounded-container
|
|
|
88
121
|
* the ground would let the tile show through.
|
|
89
122
|
*/
|
|
90
123
|
const BADGE = "absolute -right-1.5 -bottom-1.5 inline-flex size-7 items-center justify-center rounded-pill border border-hairline bg-card text-body shadow-sm transition-colors hover:[background-image:linear-gradient(var(--cg-hover),var(--cg-hover))] hover:text-ink focus-line";
|
|
91
|
-
function GridProfile({ name, description, logoSrc, seed, onEditLogo, onSelectLogoFile, onRejectLogoFile, onRemoveLogo, logoAccept = AVATAR_PICKER_ACCEPT, logoMaxBytes, logoPending = false, onEditName, onEditDescription, onSaveName, onSaveDescription, nameField, descriptionField, logoComingSoon = false, className, ...props }) {
|
|
124
|
+
function GridProfile({ name, description, logoSrc, seed, onEditLogo, onSelectLogoFile, onRejectLogoFile, onRemoveLogo, logoAccept = AVATAR_PICKER_ACCEPT, logoMaxBytes, logoPending = false, logoAdjust, onAdjustLogo, onEditName, onEditDescription, onSaveName, onSaveDescription, nameField, descriptionField, logoComingSoon = false, className, ...props }) {
|
|
92
125
|
const input = React.useRef(null);
|
|
93
126
|
const picker = Boolean(onSelectLogoFile) && !logoComingSoon;
|
|
127
|
+
// ui#544: the menu with Adjust, opened from the tile too while there is a logo.
|
|
128
|
+
const menu = picker && Boolean(onAdjustLogo);
|
|
129
|
+
const tileMenu = menu && Boolean(logoSrc);
|
|
130
|
+
const adjusting = useImageAdjustStep(picker && (logoAdjust || menu), "rounded-square", onSelectLogoFile);
|
|
131
|
+
const adjustOptions = typeof logoAdjust === "object" ? logoAdjust : {};
|
|
132
|
+
// The tile's link to the pencil's menu. Made once; unused without the menu.
|
|
133
|
+
const [handle] = React.useState(() => MenuPrimitive.createHandle());
|
|
134
|
+
// "Adjust logo": the logo it opened on, and whether the step is open (kept
|
|
135
|
+
// after closing, so the dialog can animate out).
|
|
136
|
+
const [current, setCurrent] = React.useState(null);
|
|
137
|
+
const [currentOpen, setCurrentOpen] = React.useState(false);
|
|
94
138
|
const tile = _jsx(Avatar, { name: name, seed: seed, src: logoSrc, size: 80, shape: "square", look: "pastel" });
|
|
95
139
|
const pick = () => {
|
|
96
140
|
if (!logoPending)
|
|
97
141
|
input.current?.click();
|
|
98
142
|
};
|
|
99
|
-
|
|
143
|
+
const adjustCurrent = () => {
|
|
144
|
+
if (logoPending || !logoSrc)
|
|
145
|
+
return;
|
|
146
|
+
setCurrent(logoSrc);
|
|
147
|
+
setCurrentOpen(true);
|
|
148
|
+
};
|
|
149
|
+
const currentDialog = menu && current ? (_jsx(ImageAdjustDialog, { open: currentOpen, src: current, shape: "rounded-square", title: adjustOptions.title, outputSize: adjustOptions.outputSize, onSave: (adjusted) => {
|
|
150
|
+
setCurrentOpen(false);
|
|
151
|
+
onAdjustLogo?.(adjusted);
|
|
152
|
+
}, onCancel: () => setCurrentOpen(false) })) : null;
|
|
153
|
+
const tileProps = {
|
|
154
|
+
"aria-label": "Change the Grid logo",
|
|
155
|
+
"aria-busy": logoPending || undefined,
|
|
156
|
+
disabled: logoPending,
|
|
157
|
+
className: "group/grid-logo relative inline-flex shrink-0 cursor-pointer rounded-container outline-none focus-line disabled:cursor-not-allowed",
|
|
158
|
+
};
|
|
159
|
+
const tileInside = (_jsxs(_Fragment, { children: [tile, logoPending ? (_jsx("span", { "data-cg-surface": "ink", "aria-hidden": "true", className: LOGO_OVERLAY, children: _jsx(Spinner, { decorative: true, size: "lg" }) })) : (_jsx("span", { "data-slot": "grid-profile-logo-mark", "data-cg-surface": "ink", "aria-hidden": "true", className: cn(LOGO_OVERLAY, "opacity-0 transition-opacity duration-150 motion-reduce:transition-none", "group-hover/grid-logo:opacity-100 group-focus-visible/grid-logo:opacity-100"), children: _jsx(ChangePhotoIcon, { className: "size-[40%] shrink-0" }) }))] }));
|
|
160
|
+
return (_jsxs("div", { "data-slot": "grid-profile", className: cn("flex min-w-0 flex-wrap items-center gap-6 text-ink", className), ...props, children: [_jsx("span", { "data-slot": "grid-profile-logo", "data-pending": (picker && logoPending) || undefined, className: "relative inline-flex shrink-0", children: picker ? (_jsxs(_Fragment, { children: [tileMenu ? (_jsx(DropdownMenuTrigger, { handle: handle, ...tileProps, children: tileInside })) : (_jsx("button", { type: "button", ...tileProps, onClick: pick, children: tileInside })), _jsxs(DropdownMenu, { handle: tileMenu ? handle : undefined, children: [_jsx(DropdownMenuTrigger, { "aria-label": "Edit Grid logo", disabled: logoPending, className: cn(BADGE, "disabled:pointer-events-none"), children: _jsx(EditIcon, { className: "size-3.5" }) }), _jsxs(DropdownMenuContent, { "data-slot": "grid-profile-logo-menu", className: "w-max", children: [menu && logoSrc ? _jsx(DropdownMenuItem, { onClick: adjustCurrent, children: "Adjust logo" }) : null, _jsx(DropdownMenuItem, { onClick: pick, children: menu ? (logoSrc ? "Replace logo" : "Upload logo") : "Upload new logo" }), logoSrc && onRemoveLogo ? (_jsx(DropdownMenuItem, { onClick: onRemoveLogo, children: "Remove logo" })) : null] })] }), _jsx("input", { ref: input, type: "file", accept: logoAccept, disabled: logoPending, hidden: true, tabIndex: -1, onChange: (e) => {
|
|
100
161
|
const picked = e.target.files?.[0];
|
|
101
162
|
// Cleared before routing, so the same file can be picked again even
|
|
102
163
|
// when a callback throws.
|
|
@@ -105,11 +166,11 @@ function GridProfile({ name, description, logoSrc, seed, onEditLogo, onSelectLog
|
|
|
105
166
|
routeAvatarFile(picked, {
|
|
106
167
|
accept: logoAccept,
|
|
107
168
|
maxBytes: logoMaxBytes,
|
|
108
|
-
onSelectFile:
|
|
169
|
+
onSelectFile: adjusting.pick,
|
|
109
170
|
onReject: onRejectLogoFile,
|
|
110
171
|
});
|
|
111
172
|
}
|
|
112
|
-
} })] })) : (_jsxs(_Fragment, { children: [tile, onEditLogo || logoComingSoon ? (_jsx("button", { type: "button", "aria-label": "Change the Grid logo", onClick: logoComingSoon ? undefined : onEditLogo, inert: logoComingSoon, "aria-disabled": logoComingSoon ? "true" : undefined, className: cn(BADGE, logoComingSoon && "opacity-50 select-none"), children: _jsx(EditIcon, { className: "size-3.5" }) })) : null] })) }), _jsxs("div", { className: "grid min-w-0 flex-1 gap-2", children: [_jsx(EditableValue, { "data-slot": "grid-profile-name", value: name, label: "Grid name", onEdit: onEditName, onSave: onSaveName, ...nameField, valueClassName: "text-heading-lg font-normal leading-tight" }), description || onEditDescription || onSaveDescription ? (_jsx(EditableValue, { "data-slot": "grid-profile-description", value: description || _jsx("span", { className: "text-faint-strong", children: "Add description" }), editValue: typeof description === "string" ? description : "", label: "Grid description", onEdit: onEditDescription, onSave: onSaveDescription, ...descriptionField, multiline: true, valueClassName: "text-body", wrap: true })) : null] })] }));
|
|
173
|
+
} })] })) : (_jsxs(_Fragment, { children: [tile, onEditLogo || logoComingSoon ? (_jsx("button", { type: "button", "aria-label": "Change the Grid logo", onClick: logoComingSoon ? undefined : onEditLogo, inert: logoComingSoon, "aria-disabled": logoComingSoon ? "true" : undefined, className: cn(BADGE, logoComingSoon && "opacity-50 select-none"), children: _jsx(EditIcon, { className: "size-3.5" }) })) : null] })) }), _jsxs("div", { className: "grid min-w-0 flex-1 gap-2", children: [_jsx(EditableValue, { "data-slot": "grid-profile-name", value: name, label: "Grid name", onEdit: onEditName, onSave: onSaveName, ...nameField, valueClassName: "text-heading-lg font-normal leading-tight" }), description || onEditDescription || onSaveDescription ? (_jsx(EditableValue, { "data-slot": "grid-profile-description", value: description || _jsx("span", { className: "text-faint-strong", children: "Add description" }), editValue: typeof description === "string" ? description : "", label: "Grid description", onEdit: onEditDescription, onSave: onSaveDescription, ...descriptionField, multiline: true, valueClassName: "text-body", wrap: true })) : null] }), adjusting.dialog || currentDialog ? (_jsxs(_Fragment, { children: [adjusting.dialog, currentDialog] })) : null] }));
|
|
113
174
|
}
|
|
114
175
|
export { GridProfile };
|
|
115
176
|
//# sourceMappingURL=grid-profile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid-profile.js","sourceRoot":"","sources":["../../src/blocks/grid-profile.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"grid-profile.js","sourceRoot":"","sources":["../../src/blocks/grid-profile.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,K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C,mBAAmB,gCAAuB,EAChF,SAAS,EAAE,OAAO,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,EAC7D,KAAK,EAAC,kBAAkB,EACxB,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,iBAAiB,KACrB,gBAAgB,EACpB,SAAS,QACT,cAAc,EAAC,WAAW,EAC1B,IAAI,SACJ,CACH,CAAC,CAAC,CAAC,IAAI,IACJ,EAKL,SAAS,CAAC,MAAM,IAAI,aAAa,CAAC,CAAC,CAAC,CACnC,8BACG,SAAS,CAAC,MAAM,EAChB,aAAa,IACb,CACJ,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAA;AACH,CAAC;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* THE HOME BENTO (ui#546), Asaf's layout B for the Console's Home, approved
|
|
4
|
+
* from mockups on 2026-11-20.
|
|
5
|
+
*
|
|
6
|
+
* <HomeBento
|
|
7
|
+
* left={[<TopCreations … />, <RecentPlugs … hint={<StretchHint />} />]}
|
|
8
|
+
* right={[<NeedsAttention … />, <InspirationCards layout="fill" … />]}
|
|
9
|
+
* />
|
|
10
|
+
*
|
|
11
|
+
* ## Two columns that stack
|
|
12
|
+
*
|
|
13
|
+
* From 1024 wide: the design's two columns, 480 and 776 at the Home's 1280,
|
|
14
|
+
* 24 apart, and as that ratio at any other width; the cards in each column
|
|
15
|
+
* 24 apart, in the caller's order. (The ratio is the design's own, not 5 and
|
|
16
|
+
* 7 of 12: at 7 of 12 the right column is 737 and an idea card 219, too narrow
|
|
17
|
+
* for Copy prompt and Paste in to share their line; at 776 it is 232.) Each card is as tall as
|
|
18
|
+
* its content, and the next card in the column moves up to meet it: a column
|
|
19
|
+
* is its own stack, not rows shared with the other column.
|
|
20
|
+
*
|
|
21
|
+
* Only the last card of the shorter column stretches, so both columns end on
|
|
22
|
+
* one line. That is CSS, not a measurement: the two columns share one grid
|
|
23
|
+
* row, so both are as tall as the taller; each column's last place takes what
|
|
24
|
+
* is left (`flex-1`), which in the taller column is nothing; and the place is a
|
|
25
|
+
* grid, so the card in it fills it. Nothing is measured, nothing runs on a
|
|
26
|
+
* timer, and a card that grows or shrinks moves the line at once.
|
|
27
|
+
*
|
|
28
|
+
* Below 1024 the columns stack into one, the left one first, and nothing
|
|
29
|
+
* stretches: each card is its own height.
|
|
30
|
+
*
|
|
31
|
+
* ## What shows in the room a stretch gives
|
|
32
|
+
*
|
|
33
|
+
* The cards are the caller's. Two of the library's use the room:
|
|
34
|
+
*
|
|
35
|
+
* - `BentoCard`'s `hint` (Recent plugs): with room for it, a hairline and the
|
|
36
|
+
* hint (`StretchHint`) centred below it;
|
|
37
|
+
* - `InspirationCards` with `layout="fill"`: with room for a second row, every
|
|
38
|
+
* page at once, one row each, and no pager.
|
|
39
|
+
*
|
|
40
|
+
* Each measures its own room with one ResizeObserver (`useFits`). A card that
|
|
41
|
+
* uses the room is exactly as tall as it would be without it, so what shows
|
|
42
|
+
* there never decides which column is shorter.
|
|
43
|
+
*
|
|
44
|
+
* ## Semantics
|
|
45
|
+
*
|
|
46
|
+
* The bento is a plain grid; each card is its own section with its own
|
|
47
|
+
* heading. The order a screen reader and Tab follow is the left column, then
|
|
48
|
+
* the right, as it reads at one column.
|
|
49
|
+
*/
|
|
50
|
+
declare function HomeBento({ left, right, className, ...props }: Omit<React.ComponentProps<"div">, "children"> & {
|
|
51
|
+
/** The left column's cards, top to bottom: 480 of the Home's 1280 from 1024 wide. */
|
|
52
|
+
left: readonly React.ReactNode[];
|
|
53
|
+
/** The right column's cards, top to bottom: 776 of the Home's 1280 from 1024 wide. */
|
|
54
|
+
right: readonly React.ReactNode[];
|
|
55
|
+
}): React.JSX.Element;
|
|
56
|
+
/** The words of the Home's hint. DRAFT: Asaf's working copy, 2026-11-20. */
|
|
57
|
+
export declare const STRETCH_HINT_COPY: Readonly<{
|
|
58
|
+
plugs: "Your next plug will show here, with its build progress.";
|
|
59
|
+
}>;
|
|
60
|
+
/**
|
|
61
|
+
* The light hint a stretched card shows in its spare room (ui#546): Recent
|
|
62
|
+
* plugs' "Your next plug will show here, with its build progress." Pass it as
|
|
63
|
+
* `BentoCard`'s `hint`; the card shows it only when there is room, under a
|
|
64
|
+
* hairline.
|
|
65
|
+
*
|
|
66
|
+
* mark a 40 round soft brand tint (`bg-brand-100`, violet-100) with the
|
|
67
|
+
* caller's icon, 20, in the brand purple (`text-brand`); the plug by
|
|
68
|
+
* default. Decorative: the line says it all.
|
|
69
|
+
* line one quiet grey line, 12 to the right of the mark and centred on
|
|
70
|
+
* it (Asaf, 2026-11-20: side by side, one layout at every width):
|
|
71
|
+
* Body (`text-body-sm`) in `text-faint-strong`, the card's
|
|
72
|
+
* empty-state words' role, which clears 4.5:1 on every surface.
|
|
73
|
+
*
|
|
74
|
+
* Side by side the hint is as tall as the taller of the round and the line,
|
|
75
|
+
* so with the hairline and the 16 under it, it needs about 58 of room.
|
|
76
|
+
*/
|
|
77
|
+
declare function StretchHint({ icon: Icon, children, className, ...props }: Omit<React.ComponentProps<"div">, "children"> & {
|
|
78
|
+
/** The mark in the round. The plug by default. */
|
|
79
|
+
icon?: React.ComponentType<{
|
|
80
|
+
className?: string;
|
|
81
|
+
}>;
|
|
82
|
+
/** The line. Recent plugs' words by default. */
|
|
83
|
+
children?: React.ReactNode;
|
|
84
|
+
}): React.JSX.Element;
|
|
85
|
+
export { HomeBento, StretchHint };
|
|
86
|
+
//# sourceMappingURL=home-bento.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"home-bento.d.ts","sourceRoot":"","sources":["../../src/blocks/home-bento.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,iBAAS,SAAS,CAAC,EACjB,IAAI,EACJ,KAAK,EACL,SAAS,EACT,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,GAAG;IACjD,qFAAqF;IACrF,IAAI,EAAE,SAAS,KAAK,CAAC,SAAS,EAAE,CAAA;IAChC,sFAAsF;IACtF,KAAK,EAAE,SAAS,KAAK,CAAC,SAAS,EAAE,CAAA;CAClC,qBAOA;AAsBD,4EAA4E;AAC5E,eAAO,MAAM,iBAAiB;;EAE5B,CAAA;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,iBAAS,WAAW,CAAC,EACnB,IAAI,EAAE,IAAe,EACrB,QAAkC,EAClC,SAAS,EACT,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,GAAG;IACjD,kDAAkD;IAClD,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAClD,gDAAgD;IAChD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,qBAeA;AAED,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "../lib/cloudgrid-cn.js";
|
|
4
|
+
import { PlugIcon } from "./icons.js";
|
|
5
|
+
/**
|
|
6
|
+
* THE HOME BENTO (ui#546), Asaf's layout B for the Console's Home, approved
|
|
7
|
+
* from mockups on 2026-11-20.
|
|
8
|
+
*
|
|
9
|
+
* <HomeBento
|
|
10
|
+
* left={[<TopCreations … />, <RecentPlugs … hint={<StretchHint />} />]}
|
|
11
|
+
* right={[<NeedsAttention … />, <InspirationCards layout="fill" … />]}
|
|
12
|
+
* />
|
|
13
|
+
*
|
|
14
|
+
* ## Two columns that stack
|
|
15
|
+
*
|
|
16
|
+
* From 1024 wide: the design's two columns, 480 and 776 at the Home's 1280,
|
|
17
|
+
* 24 apart, and as that ratio at any other width; the cards in each column
|
|
18
|
+
* 24 apart, in the caller's order. (The ratio is the design's own, not 5 and
|
|
19
|
+
* 7 of 12: at 7 of 12 the right column is 737 and an idea card 219, too narrow
|
|
20
|
+
* for Copy prompt and Paste in to share their line; at 776 it is 232.) Each card is as tall as
|
|
21
|
+
* its content, and the next card in the column moves up to meet it: a column
|
|
22
|
+
* is its own stack, not rows shared with the other column.
|
|
23
|
+
*
|
|
24
|
+
* Only the last card of the shorter column stretches, so both columns end on
|
|
25
|
+
* one line. That is CSS, not a measurement: the two columns share one grid
|
|
26
|
+
* row, so both are as tall as the taller; each column's last place takes what
|
|
27
|
+
* is left (`flex-1`), which in the taller column is nothing; and the place is a
|
|
28
|
+
* grid, so the card in it fills it. Nothing is measured, nothing runs on a
|
|
29
|
+
* timer, and a card that grows or shrinks moves the line at once.
|
|
30
|
+
*
|
|
31
|
+
* Below 1024 the columns stack into one, the left one first, and nothing
|
|
32
|
+
* stretches: each card is its own height.
|
|
33
|
+
*
|
|
34
|
+
* ## What shows in the room a stretch gives
|
|
35
|
+
*
|
|
36
|
+
* The cards are the caller's. Two of the library's use the room:
|
|
37
|
+
*
|
|
38
|
+
* - `BentoCard`'s `hint` (Recent plugs): with room for it, a hairline and the
|
|
39
|
+
* hint (`StretchHint`) centred below it;
|
|
40
|
+
* - `InspirationCards` with `layout="fill"`: with room for a second row, every
|
|
41
|
+
* page at once, one row each, and no pager.
|
|
42
|
+
*
|
|
43
|
+
* Each measures its own room with one ResizeObserver (`useFits`). A card that
|
|
44
|
+
* uses the room is exactly as tall as it would be without it, so what shows
|
|
45
|
+
* there never decides which column is shorter.
|
|
46
|
+
*
|
|
47
|
+
* ## Semantics
|
|
48
|
+
*
|
|
49
|
+
* The bento is a plain grid; each card is its own section with its own
|
|
50
|
+
* heading. The order a screen reader and Tab follow is the left column, then
|
|
51
|
+
* the right, as it reads at one column.
|
|
52
|
+
*/
|
|
53
|
+
function HomeBento({ left, right, className, ...props }) {
|
|
54
|
+
return (_jsxs("div", { "data-slot": "home-bento", className: cn("grid min-w-0 grid-cols-1 gap-6 lg:grid-cols-[minmax(0,480fr)_minmax(0,776fr)]", className), ...props, children: [_jsx(Column, { side: "left", cards: left }), _jsx(Column, { side: "right", cards: right })] }));
|
|
55
|
+
}
|
|
56
|
+
function Column({ side, cards }) {
|
|
57
|
+
return (_jsx("div", { "data-slot": "home-bento-column", "data-column": side, className: "flex min-w-0 flex-col gap-6", children: cards.map((card, i) => {
|
|
58
|
+
const last = i === cards.length - 1;
|
|
59
|
+
return (_jsx("div", { "data-slot": "home-bento-item", ...(last ? { "data-last": "" } : {}), className: cn("min-w-0", last && "grid flex-1"), children: card }, i));
|
|
60
|
+
}) }));
|
|
61
|
+
}
|
|
62
|
+
/** The words of the Home's hint. DRAFT: Asaf's working copy, 2026-11-20. */
|
|
63
|
+
export const STRETCH_HINT_COPY = Object.freeze({
|
|
64
|
+
plugs: "Your next plug will show here, with its build progress.",
|
|
65
|
+
});
|
|
66
|
+
/**
|
|
67
|
+
* The light hint a stretched card shows in its spare room (ui#546): Recent
|
|
68
|
+
* plugs' "Your next plug will show here, with its build progress." Pass it as
|
|
69
|
+
* `BentoCard`'s `hint`; the card shows it only when there is room, under a
|
|
70
|
+
* hairline.
|
|
71
|
+
*
|
|
72
|
+
* mark a 40 round soft brand tint (`bg-brand-100`, violet-100) with the
|
|
73
|
+
* caller's icon, 20, in the brand purple (`text-brand`); the plug by
|
|
74
|
+
* default. Decorative: the line says it all.
|
|
75
|
+
* line one quiet grey line, 12 to the right of the mark and centred on
|
|
76
|
+
* it (Asaf, 2026-11-20: side by side, one layout at every width):
|
|
77
|
+
* Body (`text-body-sm`) in `text-faint-strong`, the card's
|
|
78
|
+
* empty-state words' role, which clears 4.5:1 on every surface.
|
|
79
|
+
*
|
|
80
|
+
* Side by side the hint is as tall as the taller of the round and the line,
|
|
81
|
+
* so with the hairline and the 16 under it, it needs about 58 of room.
|
|
82
|
+
*/
|
|
83
|
+
function StretchHint({ icon: Icon = PlugIcon, children = STRETCH_HINT_COPY.plugs, className, ...props }) {
|
|
84
|
+
return (_jsxs("div", { "data-slot": "stretch-hint", className: cn("flex flex-row items-center gap-3 text-left", className), ...props, children: [_jsx("span", { "data-slot": "stretch-hint-icon", "aria-hidden": "true", className: "flex size-10 shrink-0 items-center justify-center rounded-full bg-brand-100 text-brand", children: _jsx(Icon, { className: "size-5" }) }), _jsx("p", { "data-slot": "stretch-hint-line", className: "m-0 text-body-sm text-faint-strong", children: children })] }));
|
|
85
|
+
}
|
|
86
|
+
export { HomeBento, StretchHint };
|
|
87
|
+
//# sourceMappingURL=home-bento.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"home-bento.js","sourceRoot":"","sources":["../../src/blocks/home-bento.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,SAAS,SAAS,CAAC,EACjB,IAAI,EACJ,KAAK,EACL,SAAS,EACT,GAAG,KAAK,EAMT;IACC,OAAO,CACL,4BAAe,YAAY,EAAC,SAAS,EAAE,EAAE,CAAC,+EAA+E,EAAE,SAAS,CAAC,KAAM,KAAK,aAC9I,KAAC,MAAM,IAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAE,IAAI,GAAI,EACnC,KAAC,MAAM,IAAC,IAAI,EAAC,OAAO,EAAC,KAAK,EAAE,KAAK,GAAI,IACjC,CACP,CAAA;AACH,CAAC;AAED,SAAS,MAAM,CAAC,EA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
|
3
|
+
* The two pictures of an empty Home's cards (ui#540), drawn from Asaf's design
|
|
4
|
+
* (2026-11-20) in the palette's own rungs:
|
|
5
|
+
*
|
|
6
|
+
* AllClearIllustration Needs attention: three notifications stacked, the
|
|
7
|
+
* front one a white slip with three lines on it, and
|
|
8
|
+
* a lime circle with a violet check on its corner.
|
|
9
|
+
* PlugToLiveIllustration Recent plugs: the CloudGrid plug, a cyan line to a
|
|
10
|
+
* creation tile, and a lime live dot on the tile.
|
|
11
|
+
*
|
|
12
|
+
* ## Like the From your grid picture
|
|
13
|
+
*
|
|
14
|
+
* They follow `SharedGridIllustration` (ui#533): one SVG on the box the design
|
|
15
|
+
* draws it at, scaled to the width it is given and never wider; every part
|
|
16
|
+
* named with `data-part`; the palette's rungs rather than the surface-scoped
|
|
17
|
+
* roles (white tiles with a violet-100 edge, cyan, lime, the brand violet), so
|
|
18
|
+
* each reads the same on the card, the panel and ink. They are decoration
|
|
19
|
+
* (`aria-hidden`): the words beside them say what they mean.
|
|
20
|
+
*
|
|
21
|
+
* They do not move on their own. The empty cards reveal them with the words,
|
|
22
|
+
* one by one, through `StaggerReveal`.
|
|
23
|
+
*
|
|
24
|
+
* ## The plug is the brand's socket
|
|
25
|
+
*
|
|
26
|
+
* The plug is the "o" of the wordmark, `SOCKET_GLYPH_PATH`, scaled by 1.75 (the
|
|
27
|
+
* picture is drawn at 1.75 times a 160 by 112 box), not a copy of its path.
|
|
28
|
+
*/
|
|
29
|
+
/** Needs attention's picture, on the 224 by 156.8 box the design draws. */
|
|
30
|
+
declare function AllClearIllustration({ className, ...props }: Omit<React.ComponentProps<"div">, "children">): React.JSX.Element;
|
|
31
|
+
/** Recent plugs' picture, on the 280 by 196 box the design draws. */
|
|
32
|
+
declare function PlugToLiveIllustration({ picture, className, ...props }: Omit<React.ComponentProps<"div">, "children"> & {
|
|
33
|
+
/** The creation tile's cover. Defaults to the library's first creation preview. */
|
|
34
|
+
picture?: string;
|
|
35
|
+
}): React.JSX.Element;
|
|
36
|
+
export { AllClearIllustration, PlugToLiveIllustration };
|
|
37
|
+
//# sourceMappingURL=home-empty-illustrations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"home-empty-illustrations.d.ts","sourceRoot":"","sources":["../../src/blocks/home-empty-illustrations.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,2EAA2E;AAC3E,iBAAS,oBAAoB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,qBAuCnG;AAOD,qEAAqE;AACrE,iBAAS,sBAAsB,CAAC,EAC9B,OAAsC,EACtC,SAAS,EACT,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,GAAG;IACjD,mFAAmF;IACnF,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,qBA2DA;AAED,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,CAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "../lib/cloudgrid-cn.js";
|
|
4
|
+
import { EMPTY_CREATIONS_PREVIEWS } from "./empty-creations-previews.js";
|
|
5
|
+
import { SOCKET_GLYPH_PATH } from "./logo.js";
|
|
6
|
+
/**
|
|
7
|
+
* The two pictures of an empty Home's cards (ui#540), drawn from Asaf's design
|
|
8
|
+
* (2026-11-20) in the palette's own rungs:
|
|
9
|
+
*
|
|
10
|
+
* AllClearIllustration Needs attention: three notifications stacked, the
|
|
11
|
+
* front one a white slip with three lines on it, and
|
|
12
|
+
* a lime circle with a violet check on its corner.
|
|
13
|
+
* PlugToLiveIllustration Recent plugs: the CloudGrid plug, a cyan line to a
|
|
14
|
+
* creation tile, and a lime live dot on the tile.
|
|
15
|
+
*
|
|
16
|
+
* ## Like the From your grid picture
|
|
17
|
+
*
|
|
18
|
+
* They follow `SharedGridIllustration` (ui#533): one SVG on the box the design
|
|
19
|
+
* draws it at, scaled to the width it is given and never wider; every part
|
|
20
|
+
* named with `data-part`; the palette's rungs rather than the surface-scoped
|
|
21
|
+
* roles (white tiles with a violet-100 edge, cyan, lime, the brand violet), so
|
|
22
|
+
* each reads the same on the card, the panel and ink. They are decoration
|
|
23
|
+
* (`aria-hidden`): the words beside them say what they mean.
|
|
24
|
+
*
|
|
25
|
+
* They do not move on their own. The empty cards reveal them with the words,
|
|
26
|
+
* one by one, through `StaggerReveal`.
|
|
27
|
+
*
|
|
28
|
+
* ## The plug is the brand's socket
|
|
29
|
+
*
|
|
30
|
+
* The plug is the "o" of the wordmark, `SOCKET_GLYPH_PATH`, scaled by 1.75 (the
|
|
31
|
+
* picture is drawn at 1.75 times a 160 by 112 box), not a copy of its path.
|
|
32
|
+
*/
|
|
33
|
+
/** Needs attention's picture, on the 224 by 156.8 box the design draws. */
|
|
34
|
+
function AllClearIllustration({ className, ...props }) {
|
|
35
|
+
return (_jsx("div", { "data-slot": "all-clear-illustration", "aria-hidden": "true", className: cn("w-full max-w-56", className), ...props, children: _jsxs("svg", { viewBox: "0 0 224 156.8", className: "block h-auto w-full overflow-visible", focusable: "false", children: [_jsx("rect", { "data-part": "back", x: 40.6, y: 22.4, width: 156.8, height: 89.6, rx: 14, className: "fill-brand-100" }), _jsx("rect", { "data-part": "middle", x: 26.6, y: 39.2, width: 156.8, height: 89.6, rx: 14, className: "fill-cyan" }), _jsx("rect", { "data-part": "slip", x: 11.9, y: 56.7, width: 155.4, height: 85.4, rx: 13.3, strokeWidth: 1.4, className: "fill-(--cg-neutral-0) stroke-brand-100" }), _jsxs("g", { "data-part": "line", className: "fill-brand-100", children: [_jsx("rect", { x: 28, y: 77, width: 75.6, height: 7, rx: 3.5 }), _jsx("rect", { x: 28, y: 93.8, width: 106.4, height: 5.6, rx: 2.8 }), _jsx("rect", { x: 28, y: 107.8, width: 56, height: 5.6, rx: 2.8 })] }), _jsx("circle", { "data-part": "status", cx: 169.4, cy: 123.2, r: 22.4, className: "fill-lime" }), _jsx("path", { "data-part": "check", d: "M162.05 123.2L166.25 127.4L176.75 116.9", fill: "none", strokeWidth: 2.1, strokeLinecap: "round", strokeLinejoin: "round", className: "stroke-brand" })] }) }));
|
|
36
|
+
}
|
|
37
|
+
/** Where the tile sits on the 280 by 196 box, and its parts inside it. */
|
|
38
|
+
const TILE = { x: 138.25, y: 49, w: 126, h: 91, r: 14, edge: 1.75 };
|
|
39
|
+
const COVER = { inset: 5.25, w: 112, h: 59.5, r: 8.75 };
|
|
40
|
+
const HINT = { x: 12.25, y: 73.5, w: 52.5, h: 5.25 };
|
|
41
|
+
/** Recent plugs' picture, on the 280 by 196 box the design draws. */
|
|
42
|
+
function PlugToLiveIllustration({ picture = EMPTY_CREATIONS_PREVIEWS[0], className, ...props }) {
|
|
43
|
+
const clip = `cg-plug-to-live-${React.useId().replace(/[^a-zA-Z0-9_-]/g, "")}`;
|
|
44
|
+
return (_jsx("div", { "data-slot": "plug-to-live-illustration", "aria-hidden": "true", className: cn("w-full max-w-70", className), ...props, children: _jsxs("svg", { viewBox: "0 0 280 196", className: "block h-auto w-full overflow-visible", focusable: "false", children: [_jsx("defs", { children: _jsx("clipPath", { id: clip, children: _jsx("rect", { x: TILE.x + COVER.inset, y: TILE.y + COVER.inset, width: COVER.w, height: COVER.h, rx: COVER.r }) }) }), _jsx("rect", { "data-part": "line", x: 78.75, y: 94.5, width: 59.5, height: 5.25, rx: 2.625, className: "fill-cyan" }), _jsx("g", { "data-part": "plug", transform: "translate(-85.75 35) scale(1.75)", className: "fill-brand", children: _jsx("path", { d: SOCKET_GLYPH_PATH }) }), _jsxs("g", { "data-part": "tile", children: [_jsx("rect", { x: TILE.x + TILE.edge / 2, y: TILE.y + TILE.edge / 2, width: TILE.w - TILE.edge, height: TILE.h - TILE.edge, rx: TILE.r - TILE.edge / 2, strokeWidth: TILE.edge, className: "fill-(--cg-neutral-0) stroke-brand-100" }), _jsx("image", { href: picture, x: TILE.x + COVER.inset, y: TILE.y + COVER.inset, width: COVER.w, height: COVER.h, preserveAspectRatio: "xMidYMid slice", clipPath: `url(#${clip})` }), _jsx("rect", { x: TILE.x + HINT.x, y: TILE.y + HINT.y, width: HINT.w, height: HINT.h, rx: HINT.h / 2, className: "fill-brand-100" })] }), _jsx("circle", { "data-part": "live", cx: 248.5, cy: 49, r: 8.75, strokeWidth: 3.5, className: "fill-lime stroke-(--cg-neutral-0)" })] }) }));
|
|
45
|
+
}
|
|
46
|
+
export { AllClearIllustration, PlugToLiveIllustration };
|
|
47
|
+
//# sourceMappingURL=home-empty-illustrations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"home-empty-illustrations.js","sourceRoot":"","sources":["../../src/blocks/home-empty-illustrations.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AACvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAA;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,2EAA2E;AAC3E,SAAS,oBAAoB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAiD;IAClG,OAAO,CACL,2BACY,wBAAwB,iBACtB,MAAM,EAClB,SAAS,EAAE,EAAE,CAAC,iBAAiB,EAAE,SAAS,CAAC,KACvC,KAAK,YAET,eAAK,OAAO,EAAC,eAAe,EAAC,SAAS,EAAC,sCAAsC,EAAC,SAAS,EAAC,OAAO,aAC7F,4BAAgB,MAAM,EAAC,CAAC,EAAE,IAAI,EAAE,C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SAAS,EAAC,gBAAgB,GAC1B,IACA,EACJ,8BACY,MAAM,EAChB,EAAE,EAAE,KAAK,EACT,EAAE,EAAE,EAAE,EACN,CAAC,EAAE,IAAI,EACP,WAAW,EAAE,GAAG,EAChB,SAAS,EAAC,mCAAmC,GAC7C,IACE,GACF,CACP,CAAA;AACH,CAAC;AAED,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,CAAA"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type EntityKind } from "./entity-card.js";
|
|
3
|
+
/**
|
|
4
|
+
* The Console Home's left column (ui#539): "Pinned" and, under it in the same
|
|
5
|
+
* card, "Continue where you left off". Asaf's design, 2026-11-20; the Pinned
|
|
6
|
+
* hover was approved from a mockup.
|
|
7
|
+
*
|
|
8
|
+
* Presentational. The creations, the links and the handlers are the caller's;
|
|
9
|
+
* nothing here fetches, and nothing here knows whether a creation is pinned:
|
|
10
|
+
* `onUnpin` says the reader asked, and the caller's list is the truth after it.
|
|
11
|
+
*
|
|
12
|
+
* ## Pinned
|
|
13
|
+
*
|
|
14
|
+
* Three a page, each a thumbnail with the name under it and the filled pin, in
|
|
15
|
+
* the brand purple, before the name. With more than three, an arrow at the
|
|
16
|
+
* right pages through them, and after the last page it comes back to the first.
|
|
17
|
+
* With fewer than three the rest of the row is the empty state's soft slots, so
|
|
18
|
+
* a pinned creation is the same width whether it has company or not.
|
|
19
|
+
*
|
|
20
|
+
* Hover an item and its picture dims a little while an "Unpin" chip eases in
|
|
21
|
+
* at the picture's top right. The chip is its own button, beside the item's
|
|
22
|
+
* link rather than in it (no nested interactive), laid over the picture: a
|
|
23
|
+
* click on the chip calls `onUnpin`, a click anywhere else on the item opens
|
|
24
|
+
* the creation. The chip is out of reach of the pointer until the item is
|
|
25
|
+
* hovered, so a tap on a touch screen opens the creation and never unpins it
|
|
26
|
+
* by surprise; Tab reaches it, and it shows while it, or the item, holds focus.
|
|
27
|
+
* The chip and the arrow take the library's hover wash, laid over their own
|
|
28
|
+
* ground. Under reduced motion nothing eases.
|
|
29
|
+
*
|
|
30
|
+
* A creation's `kind` draws its badge where the design draws it, at the
|
|
31
|
+
* picture's top right; the chip takes that corner on hover, so the badge gives
|
|
32
|
+
* way while the chip is there.
|
|
33
|
+
*
|
|
34
|
+
* Empty: three soft slots, an outline pin in each, "Pin a creation" under.
|
|
35
|
+
*
|
|
36
|
+
* ## The values
|
|
37
|
+
*
|
|
38
|
+
* thumbnail 216 by 98 at radius 8 (`rounded-xs`), on `bg-raised` until
|
|
39
|
+
* the picture paints; the row's three are 8 apart, the empty
|
|
40
|
+
* state's slots 24
|
|
41
|
+
* label 9 under the picture: the 15 filled pin in the accent role
|
|
42
|
+
* (`--cg-text-accent`: the brand purple on the page, white on the
|
|
43
|
+
* panel, lime on ink), 6, then the name in Small Medium
|
|
44
|
+
* (`text-caption font-medium`)
|
|
45
|
+
* arrow 24, the caret in the action colour (`text-cyan-dark`), 8 after
|
|
46
|
+
* the row, centred on it
|
|
47
|
+
* slot `bg-page` (the page grey; the hover wash on the panel and ink,
|
|
48
|
+
* where the page grey would be a light slab), a 30 outline pin
|
|
49
|
+
* in the middle, and
|
|
50
|
+
* "Pin a creation" in Small, `text-faint-strong`
|
|
51
|
+
* continue rows 40 tall, 6 apart: a 48 by 30 thumbnail at radius 8, 12,
|
|
52
|
+
* the name in Small Medium, and the time at the right in Small
|
|
53
|
+
* card `BentoCard`, its children 14 apart, a hairline between Pinned
|
|
54
|
+
* and Continue, whose title is 17 semibold (`text-heading-sm`)
|
|
55
|
+
*
|
|
56
|
+
* The muted words ("Pin a creation", the times, the empty line) are
|
|
57
|
+
* `text-faint-strong`, which reads at AA and flips with the surface; the design
|
|
58
|
+
* draws them in the lighter slate. The pins on an empty slot are decoration,
|
|
59
|
+
* in `text-faint`.
|
|
60
|
+
*/
|
|
61
|
+
/** A creation on the Home's lists. */
|
|
62
|
+
export type HomeCreation = {
|
|
63
|
+
/** A stable id: the key, and what a handler gets back with the item. */
|
|
64
|
+
id: string;
|
|
65
|
+
/** Its name. */
|
|
66
|
+
name: string;
|
|
67
|
+
/** Its picture. Decorative: the name is beside it. */
|
|
68
|
+
thumbnailSrc?: string;
|
|
69
|
+
/** Where it opens. Without it, `onOpen` makes the item a button. */
|
|
70
|
+
href?: string;
|
|
71
|
+
/** What it is: draws the kind badge on a pinned creation's picture. */
|
|
72
|
+
kind?: EntityKind;
|
|
73
|
+
};
|
|
74
|
+
/** A creation the reader opened lately, and when, in the caller's words. */
|
|
75
|
+
export type RecentlyOpenedCreation = HomeCreation & {
|
|
76
|
+
/** "Opened 10m ago". */
|
|
77
|
+
opened: React.ReactNode;
|
|
78
|
+
};
|
|
79
|
+
declare function PinnedCreations({ items, onUnpin, onOpen, linkComponent, emptyLabel, unpinLabel, nextLabel, className, ...props }: Omit<React.ComponentProps<"div">, "children"> & {
|
|
80
|
+
/** The pinned creations, in the caller's order. */
|
|
81
|
+
items: readonly HomeCreation[];
|
|
82
|
+
/** The reader pressed Unpin on one. No chip without it. */
|
|
83
|
+
onUnpin?: (item: HomeCreation) => void;
|
|
84
|
+
/** Opens a creation that has no `href`. */
|
|
85
|
+
onOpen?: (item: HomeCreation) => void;
|
|
86
|
+
/** The element a link renders through, for a router's own link. */
|
|
87
|
+
linkComponent?: React.ElementType;
|
|
88
|
+
/** Under each empty slot. */
|
|
89
|
+
emptyLabel?: React.ReactNode;
|
|
90
|
+
/** The chip's word. A screen reader hears the creation's name after it. */
|
|
91
|
+
unpinLabel?: string;
|
|
92
|
+
/** The arrow's accessible name. */
|
|
93
|
+
nextLabel?: string;
|
|
94
|
+
}): React.JSX.Element;
|
|
95
|
+
declare function RecentlyOpened({ items, onOpen, linkComponent, emptyLabel, className, ...props }: Omit<React.ComponentProps<"ul">, "children"> & {
|
|
96
|
+
/** The creations, most recent first, as the caller orders them. */
|
|
97
|
+
items: readonly RecentlyOpenedCreation[];
|
|
98
|
+
/** Opens a creation that has no `href`. */
|
|
99
|
+
onOpen?: (item: HomeCreation) => void;
|
|
100
|
+
/** The element a link renders through, for a router's own link. */
|
|
101
|
+
linkComponent?: React.ElementType;
|
|
102
|
+
/** Said when there is nothing yet. */
|
|
103
|
+
emptyLabel?: React.ReactNode;
|
|
104
|
+
}): React.JSX.Element;
|
|
105
|
+
/**
|
|
106
|
+
* The Home's left card: "Pinned", a hairline, "Continue where you left off".
|
|
107
|
+
* The card shell is #533's `BentoCard`, its children 14 apart as the design
|
|
108
|
+
* draws this card.
|
|
109
|
+
*/
|
|
110
|
+
declare function PinnedCard({ pinned, recent, onUnpin, onOpen, linkComponent, title, continueTitle, className, ...props }: Omit<React.ComponentProps<"section">, "title" | "children"> & {
|
|
111
|
+
pinned: readonly HomeCreation[];
|
|
112
|
+
recent: readonly RecentlyOpenedCreation[];
|
|
113
|
+
onUnpin?: (item: HomeCreation) => void;
|
|
114
|
+
onOpen?: (item: HomeCreation) => void;
|
|
115
|
+
linkComponent?: React.ElementType;
|
|
116
|
+
title?: React.ReactNode;
|
|
117
|
+
continueTitle?: React.ReactNode;
|
|
118
|
+
}): React.JSX.Element;
|
|
119
|
+
export { PinnedCard, PinnedCreations, RecentlyOpened };
|
|
120
|
+
//# sourceMappingURL=home-pinned.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"home-pinned.d.ts","sourceRoot":"","sources":["../../src/blocks/home-pinned.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,OAAO,EAAmB,KAAK,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAG5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AAEH,sCAAsC;AACtC,MAAM,MAAM,YAAY,GAAG;IACzB,wEAAwE;IACxE,EAAE,EAAE,MAAM,CAAA;IACV,gBAAgB;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,sDAAsD;IACtD,YAAY,CAAC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