@cloudgrid-io/ui 0.68.0 → 0.70.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/badge/marks.d.ts +2 -0
- package/dist/badge/marks.d.ts.map +1 -1
- package/dist/badge/marks.js +5 -0
- package/dist/badge/marks.js.map +1 -1
- package/dist/badge/watermark.js +2 -2
- package/dist/badge/watermark.js.map +1 -1
- package/dist/blocks/browse-categories.d.ts +80 -0
- package/dist/blocks/browse-categories.d.ts.map +1 -0
- package/dist/blocks/browse-categories.js +106 -0
- package/dist/blocks/browse-categories.js.map +1 -0
- package/dist/blocks/creation-search.d.ts +145 -102
- package/dist/blocks/creation-search.d.ts.map +1 -1
- package/dist/blocks/creation-search.js +502 -125
- package/dist/blocks/creation-search.js.map +1 -1
- package/dist/blocks/entity-card.d.ts +23 -8
- package/dist/blocks/entity-card.d.ts.map +1 -1
- package/dist/blocks/entity-card.js +25 -47
- package/dist/blocks/entity-card.js.map +1 -1
- package/dist/blocks/feed-row.d.ts +92 -0
- package/dist/blocks/feed-row.d.ts.map +1 -0
- package/dist/blocks/feed-row.js +30 -0
- package/dist/blocks/feed-row.js.map +1 -0
- package/dist/blocks/filter-tabs.d.ts +12 -1
- package/dist/blocks/filter-tabs.d.ts.map +1 -1
- package/dist/blocks/filter-tabs.js +11 -2
- package/dist/blocks/filter-tabs.js.map +1 -1
- package/dist/blocks/greeting.d.ts +42 -0
- package/dist/blocks/greeting.d.ts.map +1 -0
- package/dist/blocks/greeting.js +38 -0
- package/dist/blocks/greeting.js.map +1 -0
- package/dist/blocks/header-menu.d.ts +35 -2
- package/dist/blocks/header-menu.d.ts.map +1 -1
- package/dist/blocks/header-menu.js +67 -3
- package/dist/blocks/header-menu.js.map +1 -1
- package/dist/blocks/help-menu.d.ts +18 -3
- package/dist/blocks/help-menu.d.ts.map +1 -1
- package/dist/blocks/help-menu.js +59 -6
- package/dist/blocks/help-menu.js.map +1 -1
- package/dist/blocks/home-bento.d.ts +11 -4
- package/dist/blocks/home-bento.d.ts.map +1 -1
- package/dist/blocks/home-bento.js +22 -6
- package/dist/blocks/home-bento.js.map +1 -1
- package/dist/blocks/home-pinned.d.ts +87 -3
- package/dist/blocks/home-pinned.d.ts.map +1 -1
- package/dist/blocks/home-pinned.js +205 -12
- package/dist/blocks/home-pinned.js.map +1 -1
- package/dist/blocks/icons.d.ts +54 -6
- package/dist/blocks/icons.d.ts.map +1 -1
- package/dist/blocks/icons.js +67 -6
- package/dist/blocks/icons.js.map +1 -1
- package/dist/blocks/impact-card.d.ts +105 -0
- package/dist/blocks/impact-card.d.ts.map +1 -0
- package/dist/blocks/impact-card.js +57 -0
- package/dist/blocks/impact-card.js.map +1 -0
- package/dist/blocks/inspiration-cards.d.ts +251 -5
- package/dist/blocks/inspiration-cards.d.ts.map +1 -1
- package/dist/blocks/inspiration-cards.js +348 -8
- package/dist/blocks/inspiration-cards.js.map +1 -1
- package/dist/blocks/jump-back-in.d.ts +249 -0
- package/dist/blocks/jump-back-in.d.ts.map +1 -0
- package/dist/blocks/jump-back-in.js +272 -0
- package/dist/blocks/jump-back-in.js.map +1 -0
- package/dist/blocks/load-more-grid.d.ts +125 -0
- package/dist/blocks/load-more-grid.d.ts.map +1 -0
- package/dist/blocks/load-more-grid.js +157 -0
- package/dist/blocks/load-more-grid.js.map +1 -0
- package/dist/blocks/menu-trigger.d.ts +7 -2
- package/dist/blocks/menu-trigger.d.ts.map +1 -1
- package/dist/blocks/menu-trigger.js +2 -0
- package/dist/blocks/menu-trigger.js.map +1 -1
- package/dist/blocks/phosphor-marks.d.ts +17 -1
- package/dist/blocks/phosphor-marks.d.ts.map +1 -1
- package/dist/blocks/phosphor-marks.js +25 -1
- package/dist/blocks/phosphor-marks.js.map +1 -1
- package/dist/blocks/recent-plugs.js +1 -1
- package/dist/blocks/recent-plugs.js.map +1 -1
- package/dist/blocks/start-card.d.ts +76 -0
- package/dist/blocks/start-card.d.ts.map +1 -0
- package/dist/blocks/start-card.js +82 -0
- package/dist/blocks/start-card.js.map +1 -0
- package/dist/blocks/top-creations.js +1 -1
- package/dist/blocks/top-creations.js.map +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/fade-in-picture.d.ts +37 -0
- package/dist/lib/fade-in-picture.d.ts.map +1 -0
- package/dist/lib/fade-in-picture.js +72 -0
- package/dist/lib/fade-in-picture.js.map +1 -0
- package/dist/lib/motion.d.ts +14 -0
- package/dist/lib/motion.d.ts.map +1 -1
- package/dist/lib/motion.js +4 -0
- package/dist/lib/motion.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The greeting at the top of the Grid page (ui#607, Asaf, 2026-11-25,
|
|
3
|
+
* cloudgrid-console#1183): "Good afternoon, Asaf", centred, with one line
|
|
4
|
+
* under it ("3 new creations on Atomic Labs this week.").
|
|
5
|
+
*
|
|
6
|
+
* ## A sibling of PageHeading, not a change to it
|
|
7
|
+
*
|
|
8
|
+
* `PageHeading` writes its title in the display face and in capitals, by
|
|
9
|
+
* design. A greeting is a sentence to a person, so it is the UI face in
|
|
10
|
+
* sentence case; it is its own small block rather than a mode of that one.
|
|
11
|
+
*
|
|
12
|
+
* ## The look
|
|
13
|
+
*
|
|
14
|
+
* title the page's large title: the UI face, Medium, 40 on a desktop
|
|
15
|
+
* (`text-title-lg`) and the page title's 32 on a phone
|
|
16
|
+
* (`text-title-32`, the Settings page's title rung), on the heading
|
|
17
|
+
* leading, in Ink, balanced when it wraps
|
|
18
|
+
* name the brand purple, `--cg-text-accent`: purple on the page, white on
|
|
19
|
+
* the panel, lime on ink, so it reads on every surface (the same token
|
|
20
|
+
* as PageHeading's title, for the same reason, #120)
|
|
21
|
+
* line Body (`text-body`, the secondary tone), 12 under the title. The
|
|
22
|
+
* design draws it at 17; the library has no 17, so it is the nearest
|
|
23
|
+
* body rung under a page title, 16 (`text-body-md`), as the Settings
|
|
24
|
+
* page's line is
|
|
25
|
+
*
|
|
26
|
+
* The greeting word is the caller's ("Good morning", "Good afternoon", "Good
|
|
27
|
+
* evening"): the time of day is the reader's, and only the page knows it. So
|
|
28
|
+
* are the name and the line. With no name the title is the greeting alone,
|
|
29
|
+
* with no comma; with no line there is no paragraph.
|
|
30
|
+
*/
|
|
31
|
+
declare function Greeting({ greeting, name, line, level, className, ...props }: Omit<React.ComponentProps<"header">, "children"> & {
|
|
32
|
+
/** "Good afternoon": the caller's, for the reader's time of day. */
|
|
33
|
+
greeting: string;
|
|
34
|
+
/** The reader's first name, in the brand purple. */
|
|
35
|
+
name?: string;
|
|
36
|
+
/** The one line under it. */
|
|
37
|
+
line?: React.ReactNode;
|
|
38
|
+
/** Render as an `<h2>` when the page already has its `<h1>`. */
|
|
39
|
+
level?: 1 | 2;
|
|
40
|
+
}): import("react").JSX.Element;
|
|
41
|
+
export { Greeting };
|
|
42
|
+
//# sourceMappingURL=greeting.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"greeting.d.ts","sourceRoot":"","sources":["../../src/blocks/greeting.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,iBAAS,QAAQ,CAAC,EAChB,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,KAAS,EACT,SAAS,EACT,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,GAAG;IACpD,oEAAoE;IACpE,QAAQ,EAAE,MAAM,CAAA;IAChB,oDAAoD;IACpD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,6BAA6B;IAC7B,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,gEAAgE;IAChE,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAA;CACd,+BAyBA;AAED,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../lib/cloudgrid-cn.js";
|
|
3
|
+
/**
|
|
4
|
+
* The greeting at the top of the Grid page (ui#607, Asaf, 2026-11-25,
|
|
5
|
+
* cloudgrid-console#1183): "Good afternoon, Asaf", centred, with one line
|
|
6
|
+
* under it ("3 new creations on Atomic Labs this week.").
|
|
7
|
+
*
|
|
8
|
+
* ## A sibling of PageHeading, not a change to it
|
|
9
|
+
*
|
|
10
|
+
* `PageHeading` writes its title in the display face and in capitals, by
|
|
11
|
+
* design. A greeting is a sentence to a person, so it is the UI face in
|
|
12
|
+
* sentence case; it is its own small block rather than a mode of that one.
|
|
13
|
+
*
|
|
14
|
+
* ## The look
|
|
15
|
+
*
|
|
16
|
+
* title the page's large title: the UI face, Medium, 40 on a desktop
|
|
17
|
+
* (`text-title-lg`) and the page title's 32 on a phone
|
|
18
|
+
* (`text-title-32`, the Settings page's title rung), on the heading
|
|
19
|
+
* leading, in Ink, balanced when it wraps
|
|
20
|
+
* name the brand purple, `--cg-text-accent`: purple on the page, white on
|
|
21
|
+
* the panel, lime on ink, so it reads on every surface (the same token
|
|
22
|
+
* as PageHeading's title, for the same reason, #120)
|
|
23
|
+
* line Body (`text-body`, the secondary tone), 12 under the title. The
|
|
24
|
+
* design draws it at 17; the library has no 17, so it is the nearest
|
|
25
|
+
* body rung under a page title, 16 (`text-body-md`), as the Settings
|
|
26
|
+
* page's line is
|
|
27
|
+
*
|
|
28
|
+
* The greeting word is the caller's ("Good morning", "Good afternoon", "Good
|
|
29
|
+
* evening"): the time of day is the reader's, and only the page knows it. So
|
|
30
|
+
* are the name and the line. With no name the title is the greeting alone,
|
|
31
|
+
* with no comma; with no line there is no paragraph.
|
|
32
|
+
*/
|
|
33
|
+
function Greeting({ greeting, name, line, level = 1, className, ...props }) {
|
|
34
|
+
const Heading = level === 1 ? "h1" : "h2";
|
|
35
|
+
return (_jsxs("header", { "data-slot": "greeting", className: cn("flex flex-col items-center gap-3 text-center", className), ...props, children: [_jsxs(Heading, { "data-slot": "greeting-title", className: "m-0 font-ui text-title-32 leading-heading font-medium tracking-normal text-balance text-ink md:text-title-lg", children: [greeting, name ? (_jsxs(_Fragment, { children: [", ", _jsx("span", { "data-slot": "greeting-name", className: "text-(--cg-text-accent)", children: name })] })) : null] }), line !== undefined && line !== null && line !== false ? (_jsx("p", { "data-slot": "greeting-line", className: "m-0 text-body-md text-body", children: line })) : null] }));
|
|
36
|
+
}
|
|
37
|
+
export { Greeting };
|
|
38
|
+
//# sourceMappingURL=greeting.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"greeting.js","sourceRoot":"","sources":["../../src/blocks/greeting.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AAEvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,SAAS,QAAQ,CAAC,EAChB,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,KAAK,GAAG,CAAC,EACT,SAAS,EACT,GAAG,KAAK,EAUT;IACC,MAAM,OAAO,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAA;IACzC,OAAO,CACL,+BAAkB,UAAU,EAAC,SAAS,EAAE,EAAE,CAAC,8CAA8C,EAAE,SAAS,CAAC,KAAM,KAAK,aAC9G,MAAC,OAAO,iBACI,gBAAgB,EAC1B,SAAS,EAAC,8GAA8G,aAEvH,QAAQ,EACR,IAAI,CAAC,CAAC,CAAC,CACN,8BACG,IAAI,EACL,4BAAgB,eAAe,EAAC,SAAS,EAAC,yBAAyB,YAChE,IAAI,GACA,IACN,CACJ,CAAC,CAAC,CAAC,IAAI,IACA,EACT,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,CACvD,yBAAa,eAAe,EAAC,SAAS,EAAC,4BAA4B,YAChE,IAAI,GACH,CACL,CAAC,CAAC,CAAC,IAAI,IACD,CACV,CAAA;AACH,CAAC;AAED,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -53,13 +53,46 @@ declare function HeaderMenuRowAction({ label, icon, href, render, onClick, disab
|
|
|
53
53
|
disabled?: boolean;
|
|
54
54
|
}): React.JSX.Element;
|
|
55
55
|
declare function HeaderMenuSeparator({ className, ...props }: MenuPrimitive.Separator.Props): React.JSX.Element;
|
|
56
|
-
|
|
56
|
+
/**
|
|
57
|
+
* ui#597: the account menu's picture as the way to change it. The rows are the
|
|
58
|
+
* Settings picture menu's (`PictureMenuItems`): "Adjust photo" (with a picture
|
|
59
|
+
* and `onAdjust`), "Replace photo" ("Upload photo" with no picture) and
|
|
60
|
+
* "Remove photo" (with a picture and `onRemove`). Each row calls the caller
|
|
61
|
+
* and closes the menus.
|
|
62
|
+
*
|
|
63
|
+
* The file chooser and the adjust step are the caller's, and live outside the
|
|
64
|
+
* account menu: the menu, and anything inside it, unmounts when it closes.
|
|
65
|
+
* `useImageAdjustStep` and `useImageAdjustCurrent` are the Settings picture's
|
|
66
|
+
* own steps, for the Console to reuse.
|
|
67
|
+
*/
|
|
68
|
+
type HeaderMenuPictureMenu = {
|
|
69
|
+
/** There is a picture to adjust, replace or remove. */
|
|
70
|
+
picture: boolean;
|
|
71
|
+
/** "Replace photo", or "Upload photo" with no picture: the file chooser. */
|
|
72
|
+
onPick: () => void;
|
|
73
|
+
/** "Adjust photo", shown with a picture. */
|
|
74
|
+
onAdjust?: () => void;
|
|
75
|
+
/** "Remove photo", shown with a picture. */
|
|
76
|
+
onRemove?: () => void;
|
|
77
|
+
/** The picture's accessible name. Defaults to "Change photo", the Settings picture's. */
|
|
78
|
+
label?: string;
|
|
79
|
+
};
|
|
80
|
+
declare function HeaderMenuIdentity({ avatar, name, detail, pictureMenu, className, }: {
|
|
57
81
|
/** The person's 64px avatar. */
|
|
58
82
|
avatar: React.ReactNode;
|
|
59
83
|
name: React.ReactNode;
|
|
60
84
|
/** The line under the name, e.g. "2 followers". */
|
|
61
85
|
detail?: React.ReactNode;
|
|
86
|
+
/**
|
|
87
|
+
* ui#597: the picture becomes the way to change it. A hover (or the
|
|
88
|
+
* keyboard's focus) dims it and shows the camera, the Settings picture's
|
|
89
|
+
* look; a click opens the Settings picture menu's rows on the account
|
|
90
|
+
* menu's left, beside the picture (under it on a phone).
|
|
91
|
+
* Only this picture: the menu's trigger is the caller's and does not
|
|
92
|
+
* change. Without it the block is 0.68.0's, byte for byte.
|
|
93
|
+
*/
|
|
94
|
+
pictureMenu?: HeaderMenuPictureMenu;
|
|
62
95
|
className?: string;
|
|
63
96
|
}): React.JSX.Element;
|
|
64
|
-
export { HeaderMenuAction, HeaderMenuContent, HeaderMenuIdentity, HeaderMenuRow, HeaderMenuRowAction, HeaderMenuSection, HeaderMenuSeparator, };
|
|
97
|
+
export { HeaderMenuAction, HeaderMenuContent, HeaderMenuIdentity, HeaderMenuRow, HeaderMenuRowAction, HeaderMenuSection, HeaderMenuSeparator, type HeaderMenuPictureMenu, };
|
|
65
98
|
//# sourceMappingURL=header-menu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header-menu.d.ts","sourceRoot":"","sources":["../../src/blocks/header-menu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"header-menu.d.ts","sourceRoot":"","sources":["../../src/blocks/header-menu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAI3D,OAAO,EAAE,mBAAmB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AAM,EACN,WAAW,EACX,SAAS,GACV,EAAE;IACD,gCAAgC;IAChC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,IAAI,EAAE,KAAK,CAAC,SAAS,CAAA;IACrB,mDAAmD;IACnD,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACxB;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,qBAAqB,CAAA;IACnC,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,qBAUA;AAED,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,KAAK,qBAAqB,GAC3B,CAAA"}
|
|
@@ -3,7 +3,10 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { Menu as MenuPrimitive } from "@base-ui/react/menu";
|
|
5
5
|
import { cn } from "../lib/cloudgrid-cn.js";
|
|
6
|
-
import {
|
|
6
|
+
import { AVATAR_PICKER_LABEL } from "./avatar-picker.js";
|
|
7
|
+
import { DropdownMenuContent, DropdownMenuSub, DropdownMenuSubContent } from "../ui/dropdown-menu.js";
|
|
8
|
+
import { ChangePhotoIcon } from "./icons.js";
|
|
9
|
+
import { PictureMenuItems } from "./picture-menu.js";
|
|
7
10
|
/**
|
|
8
11
|
* THE HEADER MENUS' LOOK (#381): the grid, space and account menus of the
|
|
9
12
|
* CloudGrid-2026 header (frames 11324:90626, 11324:90892, 11324:92125).
|
|
@@ -73,8 +76,69 @@ function HeaderMenuRowAction({ label, icon, href, render, onClick, disabled = fa
|
|
|
73
76
|
function HeaderMenuSeparator({ className, ...props }) {
|
|
74
77
|
return (_jsx(MenuPrimitive.Separator, { "data-slot": "header-menu-separator", className: cn("relative h-4 shrink-0 after:absolute after:inset-x-0 after:top-1/2 after:h-px after:bg-page", className), ...props }));
|
|
75
78
|
}
|
|
76
|
-
|
|
77
|
-
|
|
79
|
+
/**
|
|
80
|
+
* The Settings picture's camera (`AvatarPicker`'s mark), class for class: the
|
|
81
|
+
* strong scrim on the ink surface, faded in. Shown on hover, on keyboard focus
|
|
82
|
+
* and while the picture menu is open.
|
|
83
|
+
*/
|
|
84
|
+
const PICTURE_CAMERA_CLASS = cn("absolute inset-0 grid place-items-center rounded-pill bg-scrim-strong text-ink", "opacity-0 transition-opacity duration-150 motion-reduce:transition-none", "group-hover/header-menu-picture:opacity-100 group-focus-visible/header-menu-picture:opacity-100", "group-data-popup-open/header-menu-picture:opacity-100");
|
|
85
|
+
/**
|
|
86
|
+
* The Console's phone breakpoint, as `Shelf` and `HelpMenu` read it. Under it
|
|
87
|
+
* there is no room beside the account menu, so the picture menu opens under
|
|
88
|
+
* the picture.
|
|
89
|
+
*/
|
|
90
|
+
const PHONE = "(max-width: 767px)";
|
|
91
|
+
/** True under `PHONE`. False on the server and the first paint. */
|
|
92
|
+
function usePhoneWidth() {
|
|
93
|
+
const [phone, setPhone] = React.useState(false);
|
|
94
|
+
React.useEffect(() => {
|
|
95
|
+
if (typeof window === "undefined" || typeof window.matchMedia !== "function")
|
|
96
|
+
return;
|
|
97
|
+
const list = window.matchMedia(PHONE);
|
|
98
|
+
const update = () => setPhone(list.matches);
|
|
99
|
+
update();
|
|
100
|
+
list.addEventListener?.("change", update);
|
|
101
|
+
return () => list.removeEventListener?.("change", update);
|
|
102
|
+
}, []);
|
|
103
|
+
return phone;
|
|
104
|
+
}
|
|
105
|
+
/** The picture menu's gap from the account menu's left edge (Asaf, ui#599). */
|
|
106
|
+
const PICTURE_MENU_GAP = 10;
|
|
107
|
+
/**
|
|
108
|
+
* On a desktop the picture menu opens on the account menu's left: from the
|
|
109
|
+
* picture, which sits at that menu's left edge, the offset is the inset from
|
|
110
|
+
* the picture to the menu's edge, plus the gap.
|
|
111
|
+
*/
|
|
112
|
+
function pastTheMenu(trigger) {
|
|
113
|
+
return () => {
|
|
114
|
+
const el = trigger.current;
|
|
115
|
+
const menu = el?.closest('[role="menu"]');
|
|
116
|
+
if (!el || !menu)
|
|
117
|
+
return PICTURE_MENU_GAP;
|
|
118
|
+
return el.getBoundingClientRect().left - menu.getBoundingClientRect().left + PICTURE_MENU_GAP;
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* The account menu's card (`HeaderMenuContent`): its radius, line, ground and
|
|
123
|
+
* shadow, so the picture menu beside it reads as its sibling. The shadow is
|
|
124
|
+
* `shadow-md`, which theme.css points at the card shadow: tailwind-merge
|
|
125
|
+
* knows it as a shadow and drops the submenu's `shadow-lg` (the raised one)
|
|
126
|
+
* for it, where it does not know `shadow-card` and would keep both.
|
|
127
|
+
*/
|
|
128
|
+
const PICTURE_MENU_CARD = "w-max rounded-xl border border-line bg-card text-ink shadow-md ring-0";
|
|
129
|
+
/** The big picture, with its camera, as the trigger of the Settings picture menu. */
|
|
130
|
+
function IdentityPicture({ avatar, menu }) {
|
|
131
|
+
const trigger = React.useRef(null);
|
|
132
|
+
const phone = usePhoneWidth();
|
|
133
|
+
return (
|
|
134
|
+
// Escape closes the account menu too, as it does from any of its rows.
|
|
135
|
+
_jsxs(DropdownMenuSub, { closeParentOnEsc: true, children: [_jsxs(MenuPrimitive.SubmenuTrigger, { ref: trigger, "data-slot": "header-menu-identity-picture", "aria-label": menu.label ?? AVATAR_PICKER_LABEL,
|
|
136
|
+
// A hover shows the camera; only a click (or Enter, Space, Arrow
|
|
137
|
+
// Right) opens the menu.
|
|
138
|
+
openOnHover: false, className: "group/header-menu-picture relative inline-flex shrink-0 cursor-pointer rounded-pill outline-none focus-line", children: [avatar, _jsx("span", { "data-slot": "header-menu-identity-camera", "data-cg-surface": "ink", "aria-hidden": "true", className: PICTURE_CAMERA_CLASS, children: _jsx(ChangePhotoIcon, { className: "size-[40%] min-h-3.5 min-w-3.5 shrink-0" }) })] }), _jsx(DropdownMenuSubContent, { "data-slot": "header-menu-picture-menu", side: phone ? "bottom" : "left", align: "start", alignOffset: 0, sideOffset: phone ? 4 : pastTheMenu(trigger), className: PICTURE_MENU_CARD, children: _jsx(PictureMenuItems, { noun: "photo", picture: menu.picture, onAdjust: menu.onAdjust, onPick: menu.onPick, onRemove: menu.onRemove }) })] }));
|
|
139
|
+
}
|
|
140
|
+
function HeaderMenuIdentity({ avatar, name, detail, pictureMenu, className, }) {
|
|
141
|
+
return (_jsxs("div", { "data-slot": "header-menu-identity", className: cn("flex items-center gap-4 pb-1.5", className), children: [pictureMenu ? _jsx(IdentityPicture, { avatar: avatar, menu: pictureMenu }) : avatar, _jsxs("div", { className: "flex min-w-0 flex-col", children: [_jsx("span", { className: "truncate text-body-sm font-medium text-ink", children: name }), detail ? _jsx("span", { className: "truncate text-body-sm text-steel", children: detail }) : null] })] }));
|
|
78
142
|
}
|
|
79
143
|
export { HeaderMenuAction, HeaderMenuContent, HeaderMenuIdentity, HeaderMenuRow, HeaderMenuRowAction, HeaderMenuSection, HeaderMenuSeparator, };
|
|
80
144
|
//# sourceMappingURL=header-menu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header-menu.js","sourceRoot":"","sources":["../../src/blocks/header-menu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAE3D,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;
|
|
1
|
+
{"version":3,"file":"header-menu.js","sourceRoot":"","sources":["../../src/blocks/header-menu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAE3D,OAAO,EAAE,EAAE,EAAE,MAA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AI,CAAC,QAAQ,GACvB,GACqB,IACT,CACnB,CAAA;AACH,CAAC;AAED,SAAS,kBAAkB,CAAC,EAC1B,MAAM,EACN,IAAI,EACJ,MAAM,EACN,WAAW,EACX,SAAS,GAiBV;IACC,OAAO,CACL,4BAAe,sBAAsB,EAAC,SAAS,EAAE,EAAE,CAAC,gCAAgC,EAAE,SAAS,CAAC,aAC7F,WAAW,CAAC,CAAC,CAAC,KAAC,eAAe,IAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAI,CAAC,CAAC,CAAC,MAAM,EAC9E,eAAK,SAAS,EAAC,uBAAuB,aACpC,eAAM,SAAS,EAAC,4CAA4C,YAAE,IAAI,GAAQ,EACzE,MAAM,CAAC,CAAC,CAAC,eAAM,SAAS,EAAC,kCAAkC,YAAE,MAAM,GAAQ,CAAC,CAAC,CAAC,IAAI,IAC/E,IACF,CACP,CAAA;AACH,CAAC;AAED,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,GAEpB,CAAA"}
|
|
@@ -21,7 +21,14 @@ declare const HELP_COPY: Readonly<{
|
|
|
21
21
|
needHelp: "Need help?";
|
|
22
22
|
/** Read after "Read the docs" by a screen reader: the link opens a new tab. */
|
|
23
23
|
newTab: "(opens in a new tab)";
|
|
24
|
+
/** The row that opens the website's legal pages (ui#597). */
|
|
25
|
+
learnMore: "Learn more";
|
|
24
26
|
}>;
|
|
27
|
+
/** One of the website's pages under Learn more: its own name, and where it is. */
|
|
28
|
+
type HelpMenuLink = {
|
|
29
|
+
label: string;
|
|
30
|
+
href: string;
|
|
31
|
+
};
|
|
25
32
|
/**
|
|
26
33
|
* HELP MENU: the "?" button and the small menu it opens.
|
|
27
34
|
*
|
|
@@ -30,7 +37,9 @@ declare const HELP_COPY: Readonly<{
|
|
|
30
37
|
* menu the library's dropdown menu, 232 wide, under the button's right
|
|
31
38
|
* edge: "Chat with us" (`onChat`), "Read the docs" (a link to
|
|
32
39
|
* `docsHref`, in a new tab), a separator, "Report a problem"
|
|
33
|
-
* (`onReport`), each after its glyph
|
|
40
|
+
* (`onReport`), each after its glyph; with `legalLinks`, a
|
|
41
|
+
* separator and "Learn more", which opens the website's legal
|
|
42
|
+
* pages, each in a new tab (`LearnMore`, ui#597)
|
|
34
43
|
* keyboard the library's menu: Enter or Space opens it on the first row,
|
|
35
44
|
* the arrows move between rows, Escape closes it and gives the
|
|
36
45
|
* button its focus back. No outline on a click; the line for the
|
|
@@ -41,18 +50,24 @@ declare const HELP_COPY: Readonly<{
|
|
|
41
50
|
* `container`, as for any library menu. `open`, `defaultOpen` and
|
|
42
51
|
* `onOpenChange` are the menu's own.
|
|
43
52
|
*/
|
|
44
|
-
declare function HelpMenu({ onChat, onReport, docsHref, open, defaultOpen, onOpenChange, container, className, ...props }: Omit<React.ComponentProps<typeof DropdownMenuTrigger>, "children" | "render" | "className"> & {
|
|
53
|
+
declare function HelpMenu({ onChat, onReport, docsHref, legalLinks, open, defaultOpen, onOpenChange, container, className, ...props }: Omit<React.ComponentProps<typeof DropdownMenuTrigger>, "children" | "render" | "className"> & {
|
|
45
54
|
/** Opens the chat. */
|
|
46
55
|
onChat: () => void;
|
|
47
56
|
/** Opens the way to report a problem. */
|
|
48
57
|
onReport: () => void;
|
|
49
58
|
/** The docs, opened in a new tab. */
|
|
50
59
|
docsHref: string;
|
|
60
|
+
/**
|
|
61
|
+
* ui#597: the website's legal pages, under "Learn more", each in a new tab,
|
|
62
|
+
* with the website's own names: the Console passes Terms & Conditions,
|
|
63
|
+
* Privacy and Launch Offer Terms. No list, or an empty one: no Learn more.
|
|
64
|
+
*/
|
|
65
|
+
legalLinks?: readonly HelpMenuLink[];
|
|
51
66
|
open?: React.ComponentProps<typeof DropdownMenu>["open"];
|
|
52
67
|
defaultOpen?: React.ComponentProps<typeof DropdownMenu>["defaultOpen"];
|
|
53
68
|
onOpenChange?: React.ComponentProps<typeof DropdownMenu>["onOpenChange"];
|
|
54
69
|
container?: React.ComponentProps<typeof DropdownMenuContent>["container"];
|
|
55
70
|
className?: string;
|
|
56
71
|
}): React.JSX.Element;
|
|
57
|
-
export { HELP_COPY, HelpMenu };
|
|
72
|
+
export { HELP_COPY, HelpMenu, type HelpMenuLink };
|
|
58
73
|
//# sourceMappingURL=help-menu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help-menu.d.ts","sourceRoot":"","sources":["../../src/blocks/help-menu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,EACL,YAAY,EACZ,mBAAmB,
|
|
1
|
+
{"version":3,"file":"help-menu.d.ts","sourceRoot":"","sources":["../../src/blocks/help-menu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,EACL,YAAY,EACZ,mBAAmB,EAOnB,mBAAmB,EACpB,MAAM,6BAA6B,CAAA;AAWpC;;;;;;;;;;GAUG;AACH,QAAA,MAAM,SAAS;IACb,6CAA6C;;;;;IAK7C,iEAAiE;;IAEjE,+EAA+E;;IAE/E,6DAA6D;;EAE7D,CAAA;AAEF,kFAAkF;AAClF,KAAK,YAAY,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AA8GnD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,iBAAS,QAAQ,CAAC,EAChB,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,IAAI,EACJ,WAAW,EACX,YAAY,EACZ,SAAS,EACT,SAAS,EACT,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,mBAAmB,CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,WAAW,CAAC,GAAG;IAC/F,sBAAsB;IACtB,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,yCAAyC;IACzC,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,qCAAqC;IACrC,QAAQ,EAAE,MAAM,CAAA;IAChB;;;;OAIG;IACH,UAAU,CAAC,EAAE,SAAS,YAAY,EAAE,CAAA;IACpC,IAAI,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAA;IACxD,WAAW,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,YAAY,CAAC,CAAC,aAAa,CAAC,CAAA;IACtE,YAAY,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,YAAY,CAAC,CAAC,cAAc,CAAC,CAAA;IACxE,SAAS,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,mBAAmB,CAAC,CAAC,WAAW,CAAC,CAAA;IACzE,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,qBAmDA;AAED,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,YAAY,EAAE,CAAA"}
|
package/dist/blocks/help-menu.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx,
|
|
2
|
+
import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { cn } from "../lib/cloudgrid-cn.js";
|
|
5
|
-
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLinkItem, DropdownMenuSeparator, DropdownMenuTrigger, } from "../ui/dropdown-menu.js";
|
|
6
|
-
import { ChatWithUsIcon, DocsIcon, HelpIcon, ReportProblemIcon } from "./icons.js";
|
|
5
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLinkItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, } from "../ui/dropdown-menu.js";
|
|
6
|
+
import { ChatWithUsIcon, ChevronRightIcon, DocsIcon, HelpIcon, InfoIcon, ReportProblemIcon, } from "./icons.js";
|
|
7
7
|
import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/tooltip.js";
|
|
8
8
|
/**
|
|
9
9
|
* THE HELP ENTRY (ui#563, Asaf, 2026-11-22). The Console's floating chat
|
|
@@ -26,6 +26,8 @@ const HELP_COPY = Object.freeze({
|
|
|
26
26
|
needHelp: "Need help?",
|
|
27
27
|
/** Read after "Read the docs" by a screen reader: the link opens a new tab. */
|
|
28
28
|
newTab: "(opens in a new tab)",
|
|
29
|
+
/** The row that opens the website's legal pages (ui#597). */
|
|
30
|
+
learnMore: "Learn more",
|
|
29
31
|
});
|
|
30
32
|
/**
|
|
31
33
|
* The Console top bar's bell button (NotificationsBell), class for class, so
|
|
@@ -35,6 +37,55 @@ const HELP_COPY = Object.freeze({
|
|
|
35
37
|
const TRIGGER_CLASS = "relative inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-full border-0 bg-transparent text-steel transition-colors hover:bg-(--cg-hover) focus-line";
|
|
36
38
|
/** A row: the library's menu row, roomier, with its 16px glyph 10 before the words. */
|
|
37
39
|
const ROW_CLASS = "min-h-8 gap-2.5 px-2.5 py-1.5";
|
|
40
|
+
/**
|
|
41
|
+
* The Console's phone breakpoint, as `Shelf` reads it. Under it Learn more
|
|
42
|
+
* opens its pages inside the same menu: a side menu beside a menu that already
|
|
43
|
+
* spans most of a phone would be off the screen.
|
|
44
|
+
*/
|
|
45
|
+
const PHONE = "(max-width: 767px)";
|
|
46
|
+
/** True under `PHONE`. False on the server and the first paint. */
|
|
47
|
+
function usePhoneWidth() {
|
|
48
|
+
const [phone, setPhone] = React.useState(false);
|
|
49
|
+
React.useEffect(() => {
|
|
50
|
+
if (typeof window === "undefined" || typeof window.matchMedia !== "function")
|
|
51
|
+
return;
|
|
52
|
+
const list = window.matchMedia(PHONE);
|
|
53
|
+
const update = () => setPhone(list.matches);
|
|
54
|
+
update();
|
|
55
|
+
list.addEventListener?.("change", update);
|
|
56
|
+
return () => list.removeEventListener?.("change", update);
|
|
57
|
+
}, []);
|
|
58
|
+
return phone;
|
|
59
|
+
}
|
|
60
|
+
/** A legal page: a link to a new tab, said so to a screen reader, as Read the docs is. */
|
|
61
|
+
function LegalLink({ link, className }) {
|
|
62
|
+
return (_jsxs(DropdownMenuLinkItem, { "data-slot": "help-menu-legal-link", className: cn(ROW_CLASS, className), href: link.href, target: "_blank", rel: "noopener noreferrer", children: [link.label, _jsxs("span", { className: "sr-only", children: [" ", HELP_COPY.newTab] })] }));
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* LEARN MORE (ui#597): the website's legal pages, after a divider.
|
|
66
|
+
*
|
|
67
|
+
* On a wide screen, the library's submenu beside the menu: a hover or a click
|
|
68
|
+
* opens it, Arrow Right opens it on its first page, Arrow Left closes it and
|
|
69
|
+
* gives Learn more its focus back, Escape closes the whole menu. On a phone's
|
|
70
|
+
* width the pages open inside the same menu, under Learn more, which says
|
|
71
|
+
* whether they are open (`aria-expanded`) and turns its chevron down; the
|
|
72
|
+
* arrows open and close it there too.
|
|
73
|
+
*/
|
|
74
|
+
function LearnMore({ links }) {
|
|
75
|
+
const phone = usePhoneWidth();
|
|
76
|
+
const [open, setOpen] = React.useState(false);
|
|
77
|
+
if (!phone) {
|
|
78
|
+
return (
|
|
79
|
+
// Escape closes the whole menu, not only the pages.
|
|
80
|
+
_jsxs(DropdownMenuSub, { closeParentOnEsc: true, children: [_jsxs(DropdownMenuSubTrigger, { "data-slot": "help-menu-learn-more", className: ROW_CLASS, children: [_jsx(InfoIcon, {}), HELP_COPY.learnMore] }), _jsx(DropdownMenuSubContent, { "data-slot": "help-menu-legal", sideOffset: 8, className: "w-58", children: links.map((link) => (_jsx(LegalLink, { link: link }, link.href))) })] }));
|
|
81
|
+
}
|
|
82
|
+
return (_jsxs(_Fragment, { children: [_jsxs(DropdownMenuItem, { "data-slot": "help-menu-learn-more", "aria-expanded": open, closeOnClick: false, className: ROW_CLASS, onClick: () => setOpen((was) => !was), onKeyDown: (e) => {
|
|
83
|
+
if (e.key === "ArrowRight")
|
|
84
|
+
setOpen(true);
|
|
85
|
+
if (e.key === "ArrowLeft")
|
|
86
|
+
setOpen(false);
|
|
87
|
+
}, children: [_jsx(InfoIcon, {}), HELP_COPY.learnMore, _jsx(ChevronRightIcon, { className: cn("ml-auto transition-transform motion-reduce:transition-none", open && "rotate-90") })] }), open ? (_jsx("div", { "data-slot": "help-menu-legal", role: "group", "aria-label": HELP_COPY.learnMore, children: links.map((link) => (_jsx(LegalLink, { link: link, className: "pl-[2.25rem]" }, link.href))) })) : null] }));
|
|
88
|
+
}
|
|
38
89
|
/**
|
|
39
90
|
* HELP MENU: the "?" button and the small menu it opens.
|
|
40
91
|
*
|
|
@@ -43,7 +94,9 @@ const ROW_CLASS = "min-h-8 gap-2.5 px-2.5 py-1.5";
|
|
|
43
94
|
* menu the library's dropdown menu, 232 wide, under the button's right
|
|
44
95
|
* edge: "Chat with us" (`onChat`), "Read the docs" (a link to
|
|
45
96
|
* `docsHref`, in a new tab), a separator, "Report a problem"
|
|
46
|
-
* (`onReport`), each after its glyph
|
|
97
|
+
* (`onReport`), each after its glyph; with `legalLinks`, a
|
|
98
|
+
* separator and "Learn more", which opens the website's legal
|
|
99
|
+
* pages, each in a new tab (`LearnMore`, ui#597)
|
|
47
100
|
* keyboard the library's menu: Enter or Space opens it on the first row,
|
|
48
101
|
* the arrows move between rows, Escape closes it and gives the
|
|
49
102
|
* button its focus back. No outline on a click; the line for the
|
|
@@ -54,11 +107,11 @@ const ROW_CLASS = "min-h-8 gap-2.5 px-2.5 py-1.5";
|
|
|
54
107
|
* `container`, as for any library menu. `open`, `defaultOpen` and
|
|
55
108
|
* `onOpenChange` are the menu's own.
|
|
56
109
|
*/
|
|
57
|
-
function HelpMenu({ onChat, onReport, docsHref, open, defaultOpen, onOpenChange, container, className, ...props }) {
|
|
110
|
+
function HelpMenu({ onChat, onReport, docsHref, legalLinks, open, defaultOpen, onOpenChange, container, className, ...props }) {
|
|
58
111
|
return (_jsxs(DropdownMenu, { open: open, defaultOpen: defaultOpen, onOpenChange: onOpenChange, children: [_jsxs(Tooltip, { children: [_jsx(TooltipTrigger
|
|
59
112
|
// The tooltip repeats the button's name; describing the button by it
|
|
60
113
|
// as well would read "Help" twice.
|
|
61
|
-
, { "aria-describedby": undefined, render: _jsx(DropdownMenuTrigger, { "data-slot": "help-menu-trigger", "aria-label": HELP_COPY.label, className: cn(TRIGGER_CLASS, className), ...props }), children: _jsx(HelpIcon, { className: "size-5" }) }), _jsx(TooltipContent, { side: "bottom", children: HELP_COPY.label })] }), _jsxs(DropdownMenuContent, { "data-slot": "help-menu-content", align: "end", sideOffset: 8, container: container, className: "w-58", children: [_jsxs(DropdownMenuItem, { "data-slot": "help-menu-chat", className: ROW_CLASS, onClick: onChat, children: [_jsx(ChatWithUsIcon, {}), HELP_COPY.chat] }), _jsxs(DropdownMenuLinkItem, { "data-slot": "help-menu-docs", className: ROW_CLASS, href: docsHref, target: "_blank", rel: "noopener noreferrer", children: [_jsx(DocsIcon, {}), HELP_COPY.docs, _jsxs("span", { className: "sr-only", children: [" ", HELP_COPY.newTab] })] }), _jsx(DropdownMenuSeparator, { className: "mx-1 my-1.5" }), _jsxs(DropdownMenuItem, { "data-slot": "help-menu-report", className: ROW_CLASS, onClick: onReport, children: [_jsx(ReportProblemIcon, {}), HELP_COPY.report] })] })] }));
|
|
114
|
+
, { "aria-describedby": undefined, render: _jsx(DropdownMenuTrigger, { "data-slot": "help-menu-trigger", "aria-label": HELP_COPY.label, className: cn(TRIGGER_CLASS, className), ...props }), children: _jsx(HelpIcon, { className: "size-5" }) }), _jsx(TooltipContent, { side: "bottom", children: HELP_COPY.label })] }), _jsxs(DropdownMenuContent, { "data-slot": "help-menu-content", align: "end", sideOffset: 8, container: container, className: "w-58", children: [_jsxs(DropdownMenuItem, { "data-slot": "help-menu-chat", className: ROW_CLASS, onClick: onChat, children: [_jsx(ChatWithUsIcon, {}), HELP_COPY.chat] }), _jsxs(DropdownMenuLinkItem, { "data-slot": "help-menu-docs", className: ROW_CLASS, href: docsHref, target: "_blank", rel: "noopener noreferrer", children: [_jsx(DocsIcon, {}), HELP_COPY.docs, _jsxs("span", { className: "sr-only", children: [" ", HELP_COPY.newTab] })] }), _jsx(DropdownMenuSeparator, { className: "mx-1 my-1.5" }), _jsxs(DropdownMenuItem, { "data-slot": "help-menu-report", className: ROW_CLASS, onClick: onReport, children: [_jsx(ReportProblemIcon, {}), HELP_COPY.report] }), legalLinks?.length ? (_jsxs(_Fragment, { children: [_jsx(DropdownMenuSeparator, { className: "mx-1 my-1.5" }), _jsx(LearnMore, { links: legalLinks })] })) : null] })] }));
|
|
62
115
|
}
|
|
63
116
|
export { HELP_COPY, HelpMenu };
|
|
64
117
|
//# sourceMappingURL=help-menu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help-menu.js","sourceRoot":"","sources":["../../src/blocks/help-menu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AACvC,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,6BAA6B,CAAA;AACpC,OAAO,
|
|
1
|
+
{"version":3,"file":"help-menu.js","sourceRoot":"","sources":["../../src/blocks/help-menu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AACvC,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,GACpB,MAA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,EAAqB,CAAA"}
|
|
@@ -63,9 +63,16 @@ export declare const STRETCH_HINT_COPY: Readonly<{
|
|
|
63
63
|
* `BentoCard`'s `hint`; the card shows it only when there is room, under a
|
|
64
64
|
* hairline.
|
|
65
65
|
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
66
|
+
* place the centre of the card's spare room, across as well as down
|
|
67
|
+
* (Asaf, 2026-11-26, ui#611): the card's hint place centres it down,
|
|
68
|
+
* and the mark and the line, side by side, are centred across.
|
|
69
|
+
* mark a 40 round soft brand tint (`bg-brand-100`, violet-100). By
|
|
70
|
+
* default the CloudGrid socket, the "o" of the wordmark
|
|
71
|
+
* (`SOCKET_GLYPH_PATH`, ui#611), in the brand purple (`fill-brand`):
|
|
72
|
+
* LogoMark's box and offset, so the glyph sits centred in its box,
|
|
73
|
+
* drawn at 32, where the glyph is about 20. A caller's own `icon`
|
|
74
|
+
* is drawn at 20 in the brand purple (`text-brand`), as before.
|
|
75
|
+
* Decorative: the line says it all.
|
|
69
76
|
* line one quiet grey line, 12 to the right of the mark and centred on
|
|
70
77
|
* it (Asaf, 2026-11-20: side by side, one layout at every width):
|
|
71
78
|
* Body (`text-body-sm`) in `text-faint-strong`, the card's
|
|
@@ -75,7 +82,7 @@ export declare const STRETCH_HINT_COPY: Readonly<{
|
|
|
75
82
|
* so with the hairline and the 16 under it, it needs about 58 of room.
|
|
76
83
|
*/
|
|
77
84
|
declare function StretchHint({ icon: Icon, children, className, ...props }: Omit<React.ComponentProps<"div">, "children"> & {
|
|
78
|
-
/** The mark in the round. The
|
|
85
|
+
/** The mark in the round, drawn at 20. The CloudGrid socket by default. */
|
|
79
86
|
icon?: React.ComponentType<{
|
|
80
87
|
className?: string;
|
|
81
88
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"home-bento.d.ts","sourceRoot":"","sources":["../../src/blocks/home-bento.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAA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D,2EAA2E;IAC3E,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;AAsBD,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { cn } from "../lib/cloudgrid-cn.js";
|
|
4
|
-
import {
|
|
4
|
+
import { SOCKET_GLYPH_PATH } from "./logo.js";
|
|
5
5
|
/**
|
|
6
6
|
* THE HOME BENTO (ui#546), Asaf's layout B for the Console's Home, approved
|
|
7
7
|
* from mockups on 2026-11-20.
|
|
@@ -69,9 +69,16 @@ export const STRETCH_HINT_COPY = Object.freeze({
|
|
|
69
69
|
* `BentoCard`'s `hint`; the card shows it only when there is room, under a
|
|
70
70
|
* hairline.
|
|
71
71
|
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
72
|
+
* place the centre of the card's spare room, across as well as down
|
|
73
|
+
* (Asaf, 2026-11-26, ui#611): the card's hint place centres it down,
|
|
74
|
+
* and the mark and the line, side by side, are centred across.
|
|
75
|
+
* mark a 40 round soft brand tint (`bg-brand-100`, violet-100). By
|
|
76
|
+
* default the CloudGrid socket, the "o" of the wordmark
|
|
77
|
+
* (`SOCKET_GLYPH_PATH`, ui#611), in the brand purple (`fill-brand`):
|
|
78
|
+
* LogoMark's box and offset, so the glyph sits centred in its box,
|
|
79
|
+
* drawn at 32, where the glyph is about 20. A caller's own `icon`
|
|
80
|
+
* is drawn at 20 in the brand purple (`text-brand`), as before.
|
|
81
|
+
* Decorative: the line says it all.
|
|
75
82
|
* line one quiet grey line, 12 to the right of the mark and centred on
|
|
76
83
|
* it (Asaf, 2026-11-20: side by side, one layout at every width):
|
|
77
84
|
* Body (`text-body-sm`) in `text-faint-strong`, the card's
|
|
@@ -80,8 +87,17 @@ export const STRETCH_HINT_COPY = Object.freeze({
|
|
|
80
87
|
* Side by side the hint is as tall as the taller of the round and the line,
|
|
81
88
|
* so with the hairline and the 16 under it, it needs about 58 of room.
|
|
82
89
|
*/
|
|
83
|
-
function StretchHint({ icon: Icon
|
|
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 })] }));
|
|
90
|
+
function StretchHint({ icon: Icon, children = STRETCH_HINT_COPY.plugs, className, ...props }) {
|
|
91
|
+
return (_jsxs("div", { "data-slot": "stretch-hint", className: cn("flex flex-row items-center justify-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: Icon ? _jsx(Icon, { className: "size-5" }) : _jsx(Socket, {}) }), _jsx("p", { "data-slot": "stretch-hint-line", className: "m-0 text-body-sm text-faint-strong", children: children })] }));
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* The socket the hint draws by default: the wordmark's "o" from the one
|
|
95
|
+
* constant `Logo` and `LogoMark` draw it from, never a copy. The box is
|
|
96
|
+
* LogoMark's 64, moved by its offset (`translate(-41.58 -3.28)`), so the glyph
|
|
97
|
+
* sits centred in it as it does in the sign.
|
|
98
|
+
*/
|
|
99
|
+
function Socket() {
|
|
100
|
+
return (_jsx("svg", { "data-slot": "stretch-hint-socket", viewBox: "41.58 3.28 64 64", "aria-hidden": "true", focusable: "false", className: "size-8 shrink-0 fill-brand", children: _jsx("path", { d: SOCKET_GLYPH_PATH }) }));
|
|
85
101
|
}
|
|
86
102
|
export { HomeBento, StretchHint };
|
|
87
103
|
//# sourceMappingURL=home-bento.js.map
|
|
@@ -1 +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,
|
|
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,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,EAAE,IAAI,EAAE,KAAK,EAAiE;IAC5F,OAAO,CACL,2BAAe,mBAAmB,iBAAc,IAAI,EAAE,SAAS,EAAC,6BAA6B,YAC1F,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE;YACrB,MAAM,IAAI,GAAG,CAAC,KAAK,KAAK,CAAC,MAAM,GA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