@cloudgrid-io/ui 0.65.0 → 0.67.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.
Files changed (124) hide show
  1. package/README.md +1 -1
  2. package/dist/badge/owner.js +1 -1
  3. package/dist/badge/owner.js.map +1 -1
  4. package/dist/blocks/avatar-picker.d.ts +50 -4
  5. package/dist/blocks/avatar-picker.d.ts.map +1 -1
  6. package/dist/blocks/avatar-picker.js +56 -10
  7. package/dist/blocks/avatar-picker.js.map +1 -1
  8. package/dist/blocks/creation-search.d.ts +10 -1
  9. package/dist/blocks/creation-search.d.ts.map +1 -1
  10. package/dist/blocks/creation-search.js +5 -1
  11. package/dist/blocks/creation-search.js.map +1 -1
  12. package/dist/blocks/entity-card.d.ts +2 -0
  13. package/dist/blocks/entity-card.d.ts.map +1 -1
  14. package/dist/blocks/entity-card.js +22 -8
  15. package/dist/blocks/entity-card.js.map +1 -1
  16. package/dist/blocks/entity-identity.d.ts +24 -1
  17. package/dist/blocks/entity-identity.d.ts.map +1 -1
  18. package/dist/blocks/entity-identity.js +19 -0
  19. package/dist/blocks/entity-identity.js.map +1 -1
  20. package/dist/blocks/grid-profile.d.ts +18 -6
  21. package/dist/blocks/grid-profile.d.ts.map +1 -1
  22. package/dist/blocks/grid-profile.js +28 -17
  23. package/dist/blocks/grid-profile.js.map +1 -1
  24. package/dist/blocks/help-menu.d.ts +58 -0
  25. package/dist/blocks/help-menu.d.ts.map +1 -0
  26. package/dist/blocks/help-menu.js +64 -0
  27. package/dist/blocks/help-menu.js.map +1 -0
  28. package/dist/blocks/home-bento.d.ts +1 -1
  29. package/dist/blocks/home-bento.js +1 -1
  30. package/dist/blocks/home-pinned.d.ts +76 -9
  31. package/dist/blocks/home-pinned.d.ts.map +1 -1
  32. package/dist/blocks/home-pinned.js +66 -12
  33. package/dist/blocks/home-pinned.js.map +1 -1
  34. package/dist/blocks/icons.d.ts +13 -0
  35. package/dist/blocks/icons.d.ts.map +1 -1
  36. package/dist/blocks/icons.js +13 -0
  37. package/dist/blocks/icons.js.map +1 -1
  38. package/dist/blocks/image-adjust-dialog.d.ts +68 -11
  39. package/dist/blocks/image-adjust-dialog.d.ts.map +1 -1
  40. package/dist/blocks/image-adjust-dialog.js +69 -17
  41. package/dist/blocks/image-adjust-dialog.js.map +1 -1
  42. package/dist/blocks/inspiration-cards.d.ts +80 -24
  43. package/dist/blocks/inspiration-cards.d.ts.map +1 -1
  44. package/dist/blocks/inspiration-cards.js +145 -25
  45. package/dist/blocks/inspiration-cards.js.map +1 -1
  46. package/dist/blocks/invite-popup.d.ts +63 -5
  47. package/dist/blocks/invite-popup.d.ts.map +1 -1
  48. package/dist/blocks/invite-popup.js +60 -20
  49. package/dist/blocks/invite-popup.js.map +1 -1
  50. package/dist/blocks/motion.d.ts +4 -2
  51. package/dist/blocks/motion.d.ts.map +1 -1
  52. package/dist/blocks/motion.js +30 -26
  53. package/dist/blocks/motion.js.map +1 -1
  54. package/dist/blocks/need-help-line.d.ts +21 -0
  55. package/dist/blocks/need-help-line.d.ts.map +1 -0
  56. package/dist/blocks/need-help-line.js +24 -0
  57. package/dist/blocks/need-help-line.js.map +1 -0
  58. package/dist/blocks/needs-attention.d.ts +11 -0
  59. package/dist/blocks/needs-attention.d.ts.map +1 -1
  60. package/dist/blocks/needs-attention.js +4 -1
  61. package/dist/blocks/needs-attention.js.map +1 -1
  62. package/dist/blocks/phosphor-marks.d.ts +4 -0
  63. package/dist/blocks/phosphor-marks.d.ts.map +1 -1
  64. package/dist/blocks/phosphor-marks.js +6 -0
  65. package/dist/blocks/phosphor-marks.js.map +1 -1
  66. package/dist/blocks/picture-menu.d.ts +26 -0
  67. package/dist/blocks/picture-menu.d.ts.map +1 -0
  68. package/dist/blocks/picture-menu.js +22 -0
  69. package/dist/blocks/picture-menu.js.map +1 -0
  70. package/dist/blocks/recent-plugs.d.ts +23 -3
  71. package/dist/blocks/recent-plugs.d.ts.map +1 -1
  72. package/dist/blocks/recent-plugs.js +6 -3
  73. package/dist/blocks/recent-plugs.js.map +1 -1
  74. package/dist/blocks/shared-grid-illustration.js +3 -3
  75. package/dist/blocks/shared-grid-illustration.js.map +1 -1
  76. package/dist/blocks/top-creations.d.ts +10 -0
  77. package/dist/blocks/top-creations.d.ts.map +1 -1
  78. package/dist/blocks/top-creations.js +6 -1
  79. package/dist/blocks/top-creations.js.map +1 -1
  80. package/dist/brand/email/headline-1-invitation-left.png +0 -0
  81. package/dist/brand/email/headline-2-invitations-left.png +0 -0
  82. package/dist/brand/email/headline-3-invitations-left.png +0 -0
  83. package/dist/brand/email/headline-4-invitations-left.png +0 -0
  84. package/dist/brand/email/headline-5-invitations-left.png +0 -0
  85. package/dist/brand/email/headline-6-invitations-left.png +0 -0
  86. package/dist/brand/email/headline-7-invitations-left.png +0 -0
  87. package/dist/brand/email/headline-8-invitations-left.png +0 -0
  88. package/dist/brand/email/headline-9-invitations-left.png +0 -0
  89. package/dist/brand/email/headline-you-have-1-invitation.png +0 -0
  90. package/dist/brand/email/headline-you-have-2-invitations.png +0 -0
  91. package/dist/brand/email/headline-you-have-3-invitations.png +0 -0
  92. package/dist/brand/email/headline-you-have-4-invitations.png +0 -0
  93. package/dist/brand/email/headline-you-have-5-invitations.png +0 -0
  94. package/dist/brand/email/headline-you-have-6-invitations.png +0 -0
  95. package/dist/brand/email/headline-you-have-7-invitations.png +0 -0
  96. package/dist/brand/email/headline-you-have-8-invitations.png +0 -0
  97. package/dist/brand/email/headline-you-have-9-invitations.png +0 -0
  98. package/dist/email/assets.d.ts +108 -0
  99. package/dist/email/assets.d.ts.map +1 -1
  100. package/dist/email/assets.js +18 -0
  101. package/dist/email/assets.js.map +1 -1
  102. package/dist/email/index.d.ts +71 -0
  103. package/dist/email/index.d.ts.map +1 -1
  104. package/dist/email/index.js +110 -5
  105. package/dist/email/index.js.map +1 -1
  106. package/dist/index.d.ts +5 -0
  107. package/dist/index.d.ts.map +1 -1
  108. package/dist/index.js +8 -0
  109. package/dist/index.js.map +1 -1
  110. package/dist/lib/fit.js +1 -1
  111. package/dist/lib/fit.js.map +1 -1
  112. package/dist/lib/motion.d.ts +49 -10
  113. package/dist/lib/motion.d.ts.map +1 -1
  114. package/dist/lib/motion.js +75 -11
  115. package/dist/lib/motion.js.map +1 -1
  116. package/dist/lib/thumbnail-identity.d.ts +47 -0
  117. package/dist/lib/thumbnail-identity.d.ts.map +1 -0
  118. package/dist/lib/thumbnail-identity.js +59 -0
  119. package/dist/lib/thumbnail-identity.js.map +1 -0
  120. package/dist/lib/touch-hover.d.ts +63 -0
  121. package/dist/lib/touch-hover.d.ts.map +1 -0
  122. package/dist/lib/touch-hover.js +164 -0
  123. package/dist/lib/touch-hover.js.map +1 -0
  124. package/package.json +2 -2
@@ -21,10 +21,11 @@ export const INSPIRATION_CATEGORIES = Object.freeze({
21
21
  export const INSPIRATION_COPY = Object.freeze({
22
22
  title: "Your grid starts with your creations.",
23
23
  subtitle: "Need inspiration? Pick an idea and make it yours.",
24
- copy: "Copy prompt",
25
- copied: "Copied",
26
- blocked: "Couldn't copy",
27
- announceCopied: "Prompt copied. Paste it into your AI coding tool.",
24
+ copy: "Pick it up",
25
+ copied: "Picked up",
26
+ blocked: "Couldn't pick it up",
27
+ announceCopied: "Picked up. Paste it into your AI coding tool.",
28
+ announceBlocked: "Couldn't pick it up. Try again.",
28
29
  pasteIn: "Paste in",
29
30
  /** Read after "Paste in" by a screen reader only: the mark beside it is hidden. */
30
31
  pasteInEnd: "your AI coding tool",
@@ -46,31 +47,56 @@ export function pasteInMark(prev, next) {
46
47
  const slot = ONBOARD_WIDGET_SLOTS[i];
47
48
  return next[i] === "a" ? slot.a : slot.b;
48
49
  }
49
- /** The mark shown now, turned by the pill's cycle unless held still. */
50
- function useAgentMark(still) {
51
- const [mark, setMark] = React.useState(REST_MARK);
50
+ /** The marks the Paste in slot turns to after the rest mark, in order: the pill's cycle, one crossing at a time. */
51
+ export const PASTE_IN_TURNS = (() => {
52
+ let sets = ONBOARD_WIDGET_SLOTS.map(() => "a");
53
+ const turns = [];
54
+ for (const target of ["b", "a"]) {
55
+ ONBOARD_WIDGET_SLOTS.forEach((_, i) => {
56
+ const next = sets.map((set, j) => (j === i ? target : set));
57
+ turns.push(pasteInMark(sets, next));
58
+ sets = next;
59
+ });
60
+ }
61
+ return Object.freeze(turns);
62
+ })();
63
+ /**
64
+ * The mark the card at `place` on its page (from 0) shows `step` turns into
65
+ * the cycle: what place 0 shows `place` turns later. Place 0 at step 0 is the
66
+ * rest mark; every other count is a turn.
67
+ */
68
+ export function pasteInMarkAt(step, place = 0) {
69
+ const n = Math.max(0, Math.floor(step)) + Math.max(0, Math.floor(place));
70
+ return n === 0 ? REST_MARK : PASTE_IN_TURNS[(n - 1) % PASTE_IN_TURNS.length];
71
+ }
72
+ /** The turns the cycle has made, 0 at rest; counted round one loop, 1 to 6 once it has started. */
73
+ function useAgentStep(run) {
74
+ const [step, setStep] = React.useState(0);
52
75
  React.useEffect(() => {
53
- if (still || typeof window === "undefined" || typeof window.matchMedia !== "function")
76
+ if (!run || typeof window === "undefined" || typeof window.matchMedia !== "function")
54
77
  return;
55
78
  const reducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)");
56
- let prev = ONBOARD_WIDGET_SLOTS.map(() => "a");
57
79
  const cycle = createLogoCycle({
58
80
  onChange: (next) => {
59
81
  // Reduced motion switched on mid-loop: `bindLogoCycle` stops the cycle
60
- // and resets it to every slot's A, which is the rest mark, whichever
61
- // slot that reset happened to move.
82
+ // and resets it to every slot's A, which is the rest, whichever slot
83
+ // that reset happened to move.
62
84
  const reset = reducedMotion.matches && next.every((set) => set === "a");
63
- setMark(reset ? REST_MARK : pasteInMark(prev, next));
64
- prev = [...next];
85
+ setStep((s) => (reset ? 0 : (s % PASTE_IN_TURNS.length) + 1));
65
86
  },
66
87
  });
67
88
  return bindLogoCycle(cycle, { document, reducedMotion });
68
- }, [still]);
69
- return still ? REST_MARK : mark;
89
+ }, [run]);
90
+ return run ? step : 0;
70
91
  }
92
+ /** The card of cards' clock, which its cards share; null outside one. */
93
+ const AgentStepContext = React.createContext(null);
71
94
  /** One 20px place, every mark stacked, the shown one at full opacity. */
72
- function AgentMark({ still }) {
73
- const shown = useAgentMark(still);
95
+ function AgentMark({ still, place }) {
96
+ const shared = React.useContext(AgentStepContext);
97
+ // A lone card runs its own clock; a card in a card of cards keeps to theirs.
98
+ const own = useAgentStep(!still && shared === null);
99
+ const shown = pasteInMarkAt(still ? 0 : (shared ?? own), place);
74
100
  return (_jsx("span", { "data-slot": "inspiration-card-agent", "data-agent-shown": shown, "aria-hidden": "true", className: "relative size-5 shrink-0", children: PASTE_IN_MARKS.map((name) => {
75
101
  const { Mark, hex } = TOOL_MARKS[name];
76
102
  const colour = ONBOARD_WIDGET_SLOTS.some((s) => s.a === name && s.aColour);
@@ -80,9 +106,9 @@ function AgentMark({ still }) {
80
106
  }) }));
81
107
  }
82
108
  /** The button's three faces in one cell: the shown one visible, the others keep the width. */
83
- function Face({ face, shown, children }) {
109
+ function Face({ face, shown, className, children }) {
84
110
  const on = face === shown;
85
- return (_jsx("span", { "data-face": face, "aria-hidden": on ? undefined : true, className: cn("col-start-1 row-start-1 inline-flex items-center justify-center gap-1.5", on ? "visible" : "invisible"), children: children }));
111
+ return (_jsx("span", { "data-face": face, "aria-hidden": on ? undefined : true, className: cn("col-start-1 row-start-1 inline-flex items-center justify-center gap-1.5", className, on ? "visible" : "invisible"), children: children }));
86
112
  }
87
113
  /**
88
114
  * Paper on every surface. `data-theme="default"` puts every --cg- token back to
@@ -102,12 +128,12 @@ const SPECIMEN_CLASS = {
102
128
  // focus-line's look, drawn without the focus.
103
129
  focus: "outline-1 outline-solid outline-offset-2 outline-(--ring)",
104
130
  };
105
- function InspirationCard({ image, category, title, description, prompt, specimen, className, }) {
131
+ function InspirationCard({ image, category, title, description, prompt, place = 0, specimen, className, }) {
106
132
  const titleId = React.useId();
107
133
  const tag = INSPIRATION_CATEGORIES[category];
108
134
  const [state, setState] = React.useState("idle");
109
135
  const face = specimen === "copied" ? "copied" : specimen === "blocked" ? "blocked" : state;
110
- return (_jsxs("article", { "data-slot": "inspiration-card", "data-theme": "default", className: cn("flex h-full min-w-0 flex-col gap-2.5 rounded-md border border-hairline bg-(--cg-surface-card) p-2.75 font-ui text-ink", LIGHT_SCOPE, className), children: [_jsx("img", { "data-slot": "inspiration-card-picture", src: image, alt: "", loading: "lazy", decoding: "async", className: "block aspect-[26/15] w-full rounded-xs bg-page object-cover" }), _jsx(Badge, { "data-slot": "inspiration-card-tag", "data-category": category, className: cn("h-5.5 rounded-full px-2.5 py-0 text-caption font-bold leading-none text-ink", tag.className), children: tag.label }), _jsxs("div", { className: "flex min-w-0 flex-col gap-1", children: [_jsx("h3", { id: titleId, "data-slot": "inspiration-card-title", className: "m-0 text-body-sm font-bold text-ink", children: title }), _jsx("p", { "data-slot": "inspiration-card-description", className: "m-0 min-h-[2lh] text-caption text-ink", children: description })] }), _jsxs("div", { "data-slot": "inspiration-card-actions", className: "mt-auto flex flex-wrap items-center justify-between gap-x-1 gap-y-2", children: [_jsx(CopyButton, { value: prompt, copiedLabel: INSPIRATION_COPY.copied, blockedLabel: INSPIRATION_COPY.blocked, announceCopied: INSPIRATION_COPY.announceCopied, onStateChange: setState, render: _jsx(Button, { "data-slot": "inspiration-card-copy", "data-face": face, "aria-describedby": titleId, size: "sm", className: cn(COPY_BUTTON_CLASS, specimen && SPECIMEN_CLASS[specimen]) }), children: () => (_jsxs("span", { className: "inline-grid", children: [_jsxs(Face, { face: "idle", shown: face, children: [INSPIRATION_COPY.copy, _jsx("span", { "data-slot": "inspiration-card-copy-icon", className: "inline-flex size-4.5", children: _jsx(CopyIcon, { className: "size-full" }) })] }), _jsxs(Face, { face: "copied", shown: face, children: [INSPIRATION_COPY.copied, _jsx("span", { "data-slot": "inspiration-card-check", className: "inline-flex size-4.5", children: _jsx(CheckIcon, { className: "size-full" }) })] }), _jsx(Face, { face: "blocked", shown: face, children: INSPIRATION_COPY.blocked })] })) }), _jsxs("span", { "data-slot": "inspiration-card-paste-in", className: "ml-auto inline-flex shrink-0 items-center gap-1.25 text-caption text-faint-strong", children: [_jsxs("span", { children: [INSPIRATION_COPY.pasteIn, _jsxs("span", { className: "sr-only", children: [" ", INSPIRATION_COPY.pasteInEnd] })] }), _jsx(AgentMark, { still: specimen !== undefined })] })] })] }));
136
+ return (_jsxs("article", { "data-slot": "inspiration-card", "data-theme": "default", className: cn("flex h-full min-w-0 flex-col gap-2.5 rounded-md border border-hairline bg-(--cg-surface-card) p-2.75 font-ui text-ink", LIGHT_SCOPE, className), children: [_jsx("img", { "data-slot": "inspiration-card-picture", src: image, alt: "", loading: "lazy", decoding: "async", className: "block aspect-[26/15] w-full rounded-xs bg-page object-cover" }), _jsx(Badge, { "data-slot": "inspiration-card-tag", "data-category": category, className: cn("h-5.5 rounded-full px-2.5 py-0 text-caption font-bold leading-none text-ink", tag.className), children: tag.label }), _jsxs("div", { className: "flex min-w-0 flex-col gap-1", children: [_jsx("h3", { id: titleId, "data-slot": "inspiration-card-title", className: "m-0 text-body-sm font-bold text-ink", children: title }), _jsx("p", { "data-slot": "inspiration-card-description", className: "m-0 min-h-[2lh] text-caption text-ink", children: description })] }), _jsxs("div", { "data-slot": "inspiration-card-actions", className: "mt-auto flex flex-wrap items-center justify-between gap-x-1 gap-y-2", children: [_jsx(CopyButton, { value: prompt, copiedLabel: INSPIRATION_COPY.copied, blockedLabel: INSPIRATION_COPY.blocked, announceCopied: INSPIRATION_COPY.announceCopied, announceBlocked: INSPIRATION_COPY.announceBlocked, onStateChange: setState, render: _jsx(Button, { "data-slot": "inspiration-card-copy", "data-face": face, "aria-describedby": titleId, size: "sm", className: cn(COPY_BUTTON_CLASS, specimen && SPECIMEN_CLASS[specimen]) }), children: () => (_jsxs("span", { className: "inline-grid", children: [_jsxs(Face, { face: "idle", shown: face, children: [INSPIRATION_COPY.copy, _jsx("span", { "data-slot": "inspiration-card-copy-icon", className: "inline-flex size-4.5", children: _jsx(CopyIcon, { className: "size-full" }) })] }), _jsxs(Face, { face: "copied", shown: face, children: [INSPIRATION_COPY.copied, _jsx("span", { "data-slot": "inspiration-card-check", className: "inline-flex size-4.5", children: _jsx(CheckIcon, { className: "size-full" }) })] }), _jsx(Face, { face: "blocked", shown: face, className: "-mx-1", children: INSPIRATION_COPY.blocked })] })) }), _jsxs("span", { "data-slot": "inspiration-card-paste-in", className: "ml-auto inline-flex shrink-0 items-center gap-1.25 text-caption text-faint-strong", children: [_jsxs("span", { children: [INSPIRATION_COPY.pasteIn, _jsxs("span", { className: "sr-only", children: [" ", INSPIRATION_COPY.pasteInEnd] })] }), _jsx(AgentMark, { still: specimen !== undefined, place: place })] })] })] }));
111
137
  }
112
138
  /**
113
139
  * The rows, in CSS, so the server's page is the hydrated one (nothing moves
@@ -130,8 +156,9 @@ const TWO_INSET = "@min-[468px]/inspiration-cards:@max-[728px]/inspiration-cards
130
156
  * 12 between the idea cards and 20 inside the card, against 16 and 24.
131
157
  *
132
158
  * The widths are the card's OUTER width, so the band does not move when two
133
- * to a row changes the padding. An idea card's action row is Copy prompt
134
- * (126.4) + 4 + Paste in with its mark (72.5) = 202.9 here; CI's Linux
159
+ * to a row changes the padding. An idea card's action row is the button
160
+ * (126.4, measured when it said "Copy prompt"; ui#579) + 4 + Paste in with
161
+ * its mark (72.5) = 202.9 here; CI's Linux
135
162
  * Chromium sets it 3.1 wider, 206.0. An idea card adds 12 each side (11
136
163
  * padding, the 1px edge).
137
164
  *
@@ -170,9 +197,60 @@ export function inspirationPerPage({ pageSize, columns, secondRow }) {
170
197
  export function inspirationPageOf(first, perPage) {
171
198
  return Math.floor(Math.max(0, first) / Math.max(1, perPage));
172
199
  }
200
+ /** How often `autoAdvance` turns the page, by default: 30s (ui#575). */
201
+ export const INSPIRATION_AUTO_ADVANCE_MS = 30_000;
202
+ /** The interval `autoAdvance` asks for, in ms; 0 when it is off. */
203
+ export function inspirationAutoAdvanceMs(autoAdvance) {
204
+ if (autoAdvance === true)
205
+ return INSPIRATION_AUTO_ADVANCE_MS;
206
+ if (typeof autoAdvance === "number" && Number.isFinite(autoAdvance) && autoAdvance > 0)
207
+ return autoAdvance;
208
+ return 0;
209
+ }
210
+ /**
211
+ * Whether the card may advance by itself: on screen, in a shown tab, and not
212
+ * under reduced motion. False until measured, and always false when not `on`.
213
+ */
214
+ function useMayAdvance(ref, on) {
215
+ const [onScreen, setOnScreen] = React.useState(false);
216
+ const [tabShown, setTabShown] = React.useState(true);
217
+ const [reduced, setReduced] = React.useState(false);
218
+ React.useEffect(() => {
219
+ const el = ref.current;
220
+ if (!on || !el || typeof window === "undefined" || typeof IntersectionObserver !== "function")
221
+ return;
222
+ const motion = typeof window.matchMedia === "function" ? window.matchMedia("(prefers-reduced-motion: reduce)") : null;
223
+ const sync = () => {
224
+ setTabShown(document.visibilityState !== "hidden");
225
+ setReduced(motion?.matches ?? false);
226
+ };
227
+ sync();
228
+ document.addEventListener("visibilitychange", sync);
229
+ motion?.addEventListener("change", sync);
230
+ const io = new IntersectionObserver((entries) => setOnScreen(entries[entries.length - 1].isIntersecting));
231
+ io.observe(el);
232
+ return () => {
233
+ document.removeEventListener("visibilitychange", sync);
234
+ motion?.removeEventListener("change", sync);
235
+ io.disconnect();
236
+ };
237
+ }, [ref, on]);
238
+ return on && onScreen && tabShown && !reduced;
239
+ }
240
+ /** Keyboard focus, not focus from a click: `:focus-visible`, where the browser knows it. */
241
+ function keyboardFocus(el) {
242
+ if (!(el instanceof Element))
243
+ return false;
244
+ try {
245
+ return el.matches(":focus-visible");
246
+ }
247
+ catch {
248
+ return true;
249
+ }
250
+ }
173
251
  /** The pager's arrow: a 28 by 30 ghost button, an 18px chevron, dimmed at the end. */
174
252
  const ARROW_CLASS = "h-7.5 w-7 text-ink hover:bg-(--cg-hover) hover:text-ink aria-disabled:cursor-default aria-disabled:opacity-30 aria-disabled:hover:bg-transparent [&_svg]:size-4.5";
175
- function InspirationCards({ ideas, title = INSPIRATION_COPY.title, subtitle = INSPIRATION_COPY.subtitle, pageSize = 3, layout = "paged", page: pageProp, defaultPage = 0, onPageChange, specimen, className, ...props }) {
253
+ function InspirationCards({ ideas, title = INSPIRATION_COPY.title, subtitle = INSPIRATION_COPY.subtitle, pageSize = 3, layout = "paged", page: pageProp, defaultPage = 0, onPageChange, autoAdvance, specimen, className, onPointerEnter, onPointerLeave, onFocus, onBlur, ...props }) {
176
254
  const headingId = React.useId();
177
255
  const size = Math.max(1, Math.floor(pageSize));
178
256
  // Two to a row only once measured: the server and the first render are the
@@ -211,6 +289,8 @@ function InspirationCards({ ideas, title = INSPIRATION_COPY.title, subtitle = IN
211
289
  const start = allShown ? 0 : page * perPage;
212
290
  const shown = ideas.slice(start, start + rowSize);
213
291
  const paged = pages > 1 && !allShown;
292
+ // One clock for every card shown, so they turn together, each offset by its place.
293
+ const step = useAgentStep(specimen === undefined);
214
294
  const go = (next) => {
215
295
  if (next < 0 || next >= pages || next === page)
216
296
  return;
@@ -218,6 +298,46 @@ function InspirationCards({ ideas, title = INSPIRATION_COPY.title, subtitle = IN
218
298
  setAnchor(next * perPage);
219
299
  onPageChange?.(next);
220
300
  };
301
+ // Advancing by itself: only with a pager to turn, never for a specimen.
302
+ const interval = specimen === undefined ? inspirationAutoAdvanceMs(autoAdvance) : 0;
303
+ const auto = interval > 0;
304
+ const mayAdvance = useMayAdvance(section, auto && paged);
305
+ const [pointerOn, setPointerOn] = React.useState(false);
306
+ const [focusOn, setFocusOn] = React.useState(false);
307
+ const running = mayAdvance && !pointerOn && !focusOn;
308
+ // The latest turn, for the timer: the next page, or the first after the last.
309
+ const advance = React.useRef(() => { });
310
+ React.useEffect(() => {
311
+ advance.current = () => go(page === pages - 1 ? 0 : page + 1);
312
+ });
313
+ // A whole interval from each start: a hold, a page turned, an advance.
314
+ React.useEffect(() => {
315
+ if (!running)
316
+ return;
317
+ const timer = setTimeout(() => advance.current(), interval);
318
+ return () => clearTimeout(timer);
319
+ }, [running, interval, page]);
320
+ const holdHandlers = auto
321
+ ? {
322
+ onPointerEnter: (event) => {
323
+ onPointerEnter?.(event);
324
+ setPointerOn(true);
325
+ },
326
+ onPointerLeave: (event) => {
327
+ onPointerLeave?.(event);
328
+ setPointerOn(false);
329
+ },
330
+ onFocus: (event) => {
331
+ onFocus?.(event);
332
+ setFocusOn(keyboardFocus(event.target));
333
+ },
334
+ onBlur: (event) => {
335
+ onBlur?.(event);
336
+ if (!(event.relatedTarget instanceof Node && event.currentTarget.contains(event.relatedTarget)))
337
+ setFocusOn(false);
338
+ },
339
+ }
340
+ : { onPointerEnter, onPointerLeave, onFocus, onBlur };
221
341
  const onKeyDown = (event) => {
222
342
  if (event.key === "ArrowLeft") {
223
343
  event.preventDefault();
@@ -228,7 +348,7 @@ function InspirationCards({ ideas, title = INSPIRATION_COPY.title, subtitle = IN
228
348
  go(page + 1);
229
349
  }
230
350
  };
231
- return (_jsxs("section", { ref: section, "data-slot": "inspiration-cards", "data-theme": "default", ...(layout === "fill" ? { "data-layout": "fill", "data-all-shown": allShown } : {}), ...(two ? { "data-columns": "2" } : {}), ...(fillTwo ? { "data-second-row": secondRow } : {}), "aria-labelledby": headingId, ...(paged ? { "aria-roledescription": "carousel" } : {}), className: cn("@container/inspiration-cards flex w-full min-w-0 flex-col gap-5 rounded-md bg-(--cg-surface-card) p-6 font-ui text-ink", TWO_INSET, LIGHT_SCOPE, className), ...props, children: [_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-x-4 gap-y-3", children: [_jsxs("div", { className: "flex min-w-0 flex-col gap-1", children: [_jsx("h2", { id: headingId, "data-slot": "inspiration-cards-title", className: "m-0 text-body-xl font-bold text-ink", children: title }), _jsx("p", { "data-slot": "inspiration-cards-subtitle", className: "m-0 text-caption text-ink", children: subtitle })] }), paged ? (_jsxs("div", { "data-slot": "inspiration-cards-pager", className: "ml-auto flex shrink-0 items-center gap-2", children: [_jsx(Button, { "data-slot": "inspiration-cards-previous", variant: "ghost", size: "icon-sm", "aria-label": INSPIRATION_COPY.previous, "aria-disabled": page === 0 || undefined, onClick: () => go(page - 1), onKeyDown: onKeyDown, className: ARROW_CLASS, children: _jsx(ChevronLeftIcon, {}) }), _jsxs("span", { "data-slot": "inspiration-cards-position", "aria-hidden": "true", className: "text-caption font-bold text-ink tabular-nums", children: [page + 1, " / ", pages] }), _jsx(Button, { "data-slot": "inspiration-cards-next", variant: "ghost", size: "icon-sm", "aria-label": INSPIRATION_COPY.next, "aria-disabled": page === pages - 1 || undefined, onClick: () => go(page + 1), onKeyDown: onKeyDown, className: ARROW_CLASS, children: _jsx(ChevronRightIcon, {}) })] })) : null] }), _jsx("div", { ref: viewport, "data-slot": "inspiration-cards-viewport", "aria-live": "polite", className: "min-w-0", children: _jsx("ul", { "data-slot": "inspiration-cards-page", ...(paged ? { "aria-roledescription": "slide", "aria-label": `Page ${page + 1} of ${pages}` } : {}), className: PAGE_COLUMNS, children: shown.map((idea, i) => (_jsx("li", { className: "min-w-0", children: _jsx(InspirationCard, { ...idea, specimen: specimen }) }, `${page}-${i}`))) }, page) }), fillAll || fillTwo ? (_jsx("div", { ref: more, "data-slot": "inspiration-cards-more", className: "-mt-5 min-h-0 flex-[1_1_0] overflow-hidden", children: fillTwo ? (_jsx("ul", { "data-slot": "inspiration-cards-second-row", className: cn(PAGE_COLUMNS, "pt-3 transition-[opacity,visibility] duration-200 ease-out motion-reduce:transition-none", secondRow ? "visible opacity-100" : "invisible opacity-0"), children: ideas.slice(page * perPage + rowSize, page * perPage + 2 * rowSize).map((idea, i) => (_jsx("li", { className: "min-w-0", children: _jsx(InspirationCard, { ...idea, specimen: specimen }) }, `${page}-${i}`))) })) : (_jsx("div", { ref: rows, "data-slot": "inspiration-cards-more-rows", className: cn("grid gap-4 pt-4 transition-[opacity,visibility] duration-200 ease-out motion-reduce:transition-none", allShown ? "visible opacity-100" : "invisible opacity-0"), children: Array.from({ length: pages - 1 }, (_, p) => (_jsx("ul", { "data-slot": "inspiration-cards-row", "data-page": p + 1, className: PAGE_COLUMNS, children: ideas.slice((p + 1) * size, (p + 2) * size).map((idea, i) => (_jsx("li", { className: "min-w-0", children: _jsx(InspirationCard, { ...idea, specimen: specimen }) }, i))) }, p + 1))) })) })) : null] }));
351
+ return (_jsx(AgentStepContext.Provider, { value: step, children: _jsxs("section", { ref: section, "data-slot": "inspiration-cards", "data-theme": "default", ...(layout === "fill" ? { "data-layout": "fill", "data-all-shown": allShown } : {}), ...(two ? { "data-columns": "2" } : {}), ...(fillTwo ? { "data-second-row": secondRow } : {}), "aria-labelledby": headingId, ...(paged ? { "aria-roledescription": "carousel" } : {}), ...(auto ? { "data-auto-advance": running ? "running" : "held" } : {}), className: cn("@container/inspiration-cards flex w-full min-w-0 flex-col gap-5 rounded-md bg-(--cg-surface-card) p-6 font-ui text-ink", TWO_INSET, LIGHT_SCOPE, className), ...props, ...holdHandlers, children: [_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-x-4 gap-y-3", children: [_jsxs("div", { className: "flex min-w-0 flex-col gap-1", children: [_jsx("h2", { id: headingId, "data-slot": "inspiration-cards-title", className: "m-0 text-body-xl font-bold text-ink", children: title }), _jsx("p", { "data-slot": "inspiration-cards-subtitle", className: "m-0 text-caption text-ink", children: subtitle })] }), paged ? (_jsxs("div", { "data-slot": "inspiration-cards-pager", className: "ml-auto flex shrink-0 items-center gap-2", children: [_jsx(Button, { "data-slot": "inspiration-cards-previous", variant: "ghost", size: "icon-sm", "aria-label": INSPIRATION_COPY.previous, "aria-disabled": page === 0 || undefined, onClick: () => go(page - 1), onKeyDown: onKeyDown, className: ARROW_CLASS, children: _jsx(ChevronLeftIcon, {}) }), _jsxs("span", { "data-slot": "inspiration-cards-position", "aria-hidden": "true", className: "text-caption font-bold text-ink tabular-nums", children: [page + 1, " / ", pages] }), _jsx(Button, { "data-slot": "inspiration-cards-next", variant: "ghost", size: "icon-sm", "aria-label": INSPIRATION_COPY.next, "aria-disabled": page === pages - 1 || undefined, onClick: () => go(page + 1), onKeyDown: onKeyDown, className: ARROW_CLASS, children: _jsx(ChevronRightIcon, {}) })] })) : null] }), _jsx("div", { ref: viewport, "data-slot": "inspiration-cards-viewport", "aria-live": running ? "off" : "polite", className: "min-w-0", children: _jsx("ul", { "data-slot": "inspiration-cards-page", ...(paged ? { "aria-roledescription": "slide", "aria-label": `Page ${page + 1} of ${pages}` } : {}), className: PAGE_COLUMNS, children: shown.map((idea, i) => (_jsx("li", { className: "min-w-0", children: _jsx(InspirationCard, { ...idea, place: i, specimen: specimen }) }, `${page}-${i}`))) }, page) }), fillAll || fillTwo ? (_jsx("div", { ref: more, "data-slot": "inspiration-cards-more", className: "-mt-5 min-h-0 flex-[1_1_0] overflow-hidden", children: fillTwo ? (_jsx("ul", { "data-slot": "inspiration-cards-second-row", className: cn(PAGE_COLUMNS, "pt-3 transition-[opacity,visibility] duration-200 ease-out motion-reduce:transition-none", secondRow ? "visible opacity-100" : "invisible opacity-0"), children: ideas.slice(page * perPage + rowSize, page * perPage + 2 * rowSize).map((idea, i) => (_jsx("li", { className: "min-w-0", children: _jsx(InspirationCard, { ...idea, place: rowSize + i, specimen: specimen }) }, `${page}-${i}`))) })) : (_jsx("div", { ref: rows, "data-slot": "inspiration-cards-more-rows", className: cn("grid gap-4 pt-4 transition-[opacity,visibility] duration-200 ease-out motion-reduce:transition-none", allShown ? "visible opacity-100" : "invisible opacity-0"), children: Array.from({ length: pages - 1 }, (_, p) => (_jsx("ul", { "data-slot": "inspiration-cards-row", "data-page": p + 1, className: PAGE_COLUMNS, children: ideas.slice((p + 1) * size, (p + 2) * size).map((idea, i) => (_jsx("li", { className: "min-w-0", children: _jsx(InspirationCard, { ...idea, place: (p + 1) * size + i, specimen: specimen }) }, i))) }, p + 1))) })) })) : null] }) }));
232
352
  }
233
353
  export { InspirationCard, InspirationCards };
234
354
  //# sourceMappingURL=inspiration-cards.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"inspiration-cards.js","sourceRoot":"","sources":["../../src/blocks/inspiration-cards.tsx"],"names":[],"mappings":"AAAA,Y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AC,GAAG,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAC5D,aAAY,SAAS,EAAC,SAAS,YAC7B,KAAC,eAAe,OAAK,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAI,IADrE,CAAC,CAEL,CACN,CAAC,IATG,CAAC,GAAG,CAAC,CAUP,CACN,CAAC,GACE,CACP,GACG,CACP,CAAC,CAAC,CAAC,IAAI,IACA,GACgB,CAC7B,CAAA;AACH,CAAC;AAED,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,CAAA"}
@@ -38,7 +38,7 @@ import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
38
38
  * Opening moves focus to the dialog itself, not to Copy (founder, 2026-10-21:
39
39
  * no ring on Copy when the card appears). Base UI's popup is already
40
40
  * `tabindex="-1"` and labelled by the title, so a screen reader announces "Know
41
- * someone who'd use CloudGrid?, dialog" and the next Tab reaches the x, then
41
+ * someone who would use CloudGrid?, dialog" and the next Tab reaches the x, then
42
42
  * Copy, where `:focus-visible` draws the ring for a keyboard user only. The
43
43
  * popup's own outline is off: it is a container, and the card's edge already
44
44
  * shows where focus is. `initialFocus={false}` leaves focus where it was, which
@@ -89,11 +89,28 @@ import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
89
89
  * the page's in the same pixels. The field is `--cg-surface-raised` on white,
90
90
  * as drawn, and `--cg-hover` inside a panel or ink scope, because raised is
91
91
  * declared at `:root` only and would be a pale slab with white text on it.
92
+ *
93
+ * ## Invitations left (ui#517, cloudgrid#6645)
94
+ *
95
+ * Refer a friend gives each person a number of invitations, and the popup says
96
+ * how many are left: `invitationsLeft={3}` draws a row between the line and the
97
+ * field, the count in the library's `tag` badge and "invitations left" beside
98
+ * it ("1 invitation left" for one, `invitationsLeftLabel` for other words).
99
+ * Without the prop nothing is drawn and the popup is byte for byte what it was,
100
+ * except the title, now "Know someone who would use CloudGrid?" (Asaf, 2026-11-22)
101
+ * (registry/e2e/refer-a-friend-517.spec.ts pins it against 0.65.0). WHEN to
102
+ * show the count, and hiding every surface at 0, are the Console's (#6645, "At
103
+ * 0"): the library draws the number it is given.
104
+ *
105
+ * `ReferFriendBlock` is the same offer on the Profile page: a section with
106
+ * "Refer a friend", the same count row, one line, and the same field and Copy,
107
+ * so Copied and Blocked behave as they do here. Who joined is not shown
108
+ * (#6645 §3).
92
109
  */
93
110
  type InviteLayout = "auto" | "card" | "sheet";
94
111
  type InviteCopyState = "idle" | "copied" | "blocked";
95
112
  declare const INVITE_DEFAULTS: {
96
- readonly title: "Know someone who'd use CloudGrid?";
113
+ readonly title: "Know someone who would use CloudGrid?";
97
114
  readonly description: "Send them this link to start their own grid.";
98
115
  readonly copyLabel: "Copy";
99
116
  readonly copiedLabel: "Copied";
@@ -101,6 +118,10 @@ declare const INVITE_DEFAULTS: {
101
118
  readonly copyAriaLabel: "Copy the invite link";
102
119
  readonly closeLabel: "Close";
103
120
  readonly pillLabel: "Invite people";
121
+ /** The words after the count: "1 invitation left", "3 invitations left". */
122
+ readonly invitationsLeft: (count: number) => "invitation left" | "invitations left";
123
+ readonly referTitle: "Refer a friend";
124
+ readonly referDescription: "CloudGrid is invite-only during the launch. Send your link to someone who would use it. An invitation is used when they create an account.";
104
125
  };
105
126
  /**
106
127
  * The collapsed invite: a 44px pill with the UserPlus mark and "Invite people".
@@ -148,9 +169,46 @@ type InvitePopupProps = {
148
169
  /** The x's accessible name. */
149
170
  closeLabel?: string;
150
171
  pillLabel?: string;
172
+ /**
173
+ * How many invitations the person has left. Draws the row "3 invitations
174
+ * left" between the line and the field. Leave it out and there is no row.
175
+ */
176
+ invitationsLeft?: number;
177
+ /** The words after the count. Default: "invitation left" for 1, else "invitations left". */
178
+ invitationsLeftLabel?: (count: number) => string;
151
179
  className?: string;
152
180
  };
153
- declare function InvitePopup({ link, open, onOpenChange, onCopy, pill, layout, copyState, initialFocus, container, title, description, copyLabel, copiedLabel, blockedLabel, copyAriaLabel, closeLabel, pillLabel, className, }: InvitePopupProps): React.JSX.Element;
154
- export { InvitePill, InvitePopup, INVITE_DEFAULTS };
155
- export type { InviteCopyState, InviteLayout, InvitePopupProps };
181
+ declare function InvitePopup({ link, open, onOpenChange, onCopy, pill, layout, copyState, initialFocus, container, title, description, copyLabel, copiedLabel, blockedLabel, copyAriaLabel, closeLabel, pillLabel, invitationsLeft, invitationsLeftLabel, className, }: InvitePopupProps): React.JSX.Element;
182
+ type ReferFriendBlockProps = {
183
+ /** The invite link. Shown without its scheme, written to the clipboard verbatim. */
184
+ link: string;
185
+ /** How many invitations are left. The Console hides the block at 0 (#6645). */
186
+ invitationsLeft: number;
187
+ /** Called after the link reached the clipboard. Not called when the browser refused. */
188
+ onCopy?: (link: string) => void;
189
+ /** Pin the copy control's label, for previews. Leave it out for the real cycle. */
190
+ copyState?: InviteCopyState;
191
+ /** The heading. Default "Refer a friend". */
192
+ title?: string;
193
+ /** The one line under the heading. */
194
+ description?: string;
195
+ /** The words after the count. Default: "invitation left" for 1, else "invitations left". */
196
+ invitationsLeftLabel?: (count: number) => string;
197
+ copyLabel?: string;
198
+ copiedLabel?: string;
199
+ /** The label when the browser refuses the clipboard write. */
200
+ blockedLabel?: string;
201
+ /** Copy's accessible name, which stays put while the visible label flips. */
202
+ copyAriaLabel?: string;
203
+ className?: string;
204
+ };
205
+ /**
206
+ * The Profile page's "Refer a friend" block (ui#517, cloudgrid#6645 §3): a
207
+ * section named by its heading, the count at the heading's right, one line,
208
+ * and the popup's own link field and Copy. On a phone the count wraps under
209
+ * the heading when the two do not fit on one line.
210
+ */
211
+ declare function ReferFriendBlock({ link, invitationsLeft, onCopy, copyState, title, description, invitationsLeftLabel, copyLabel, copiedLabel, blockedLabel, copyAriaLabel, className, }: ReferFriendBlockProps): React.JSX.Element;
212
+ export { InvitePill, InvitePopup, INVITE_DEFAULTS, ReferFriendBlock };
213
+ export type { InviteCopyState, InviteLayout, InvitePopupProps, ReferFriendBlockProps };
156
214
  //# sourceMappingURL=invite-popup.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"invite-popup.d.ts","sourceRoot":"","sources":["../../src/blocks/invite-popup.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAOjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyFG;AAEH,KAAK,YAAY,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAA;AAC7C,KAAK,eAAe,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAA;AAEpD,QAAA,MAAM,eAAe;;;;;;;;;CASX,CAAA;AAoCV;;;;;;GAMG;AACH,iBAAS,UAAU,CAAC,EAClB,KAAiC,EACjC,MAAc,EACd,SAAS,EACT,IAAe,EACf,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,GAAG;IACpD,wBAAwB;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,+DAA+D;IAC/D,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,qBAoBA;AAED,KAAK,gBAAgB,GAAG;IACtB,iFAAiF;IACjF,IAAI,EAAE,MAAM,CAAA;IACZ,+EAA+E;IAC/E,IAAI,EAAE,OAAO,CAAA;IACb,6EAA6E;IAC7E,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACrC,wFAAwF;IACxF,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/B,+EAA+E;IAC/E,IAAI,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,KAAK,MAAM,CAAA;IAChD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,8DAA8D;IAC9D,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,6EAA6E;IAC7E,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED;;;;;GAKG;AACH,iBAAS,gBAAgB,CAAC,EACxB,IAAI,EACJ,eAAe,EACf,MAAM,EACN,SAAS,EACT,KAAkC,EAClC,WAA8C,EAC9C,oBAAsD,EACtD,SAAqC,EACrC,WAAyC,EACzC,YAA2C,EAC3C,aAA6C,EAC7C,SAAS,GACV,EAAE,qBAAqB,qBAoCvB;AAED,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,gBAAgB,EAAE,CAAA;AACrE,YAAY,EAAE,eAAe,EAAE,YAAY,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,CAAA"}
@@ -2,12 +2,15 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
4
  import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
5
+ import { Badge } from "../ui/badge.js";
5
6
  import { Button } from "../ui/button.js";
6
7
  import { CheckIcon, CloseIcon, CopyIcon, InvitePersonIcon } from "./icons.js";
7
8
  import { cn } from "../lib/cloudgrid-cn.js";
8
9
  import { usePortalContainer } from "../lib/portal-container.js";
9
10
  const INVITE_DEFAULTS = {
10
- title: "Know someone who'd use CloudGrid?",
11
+ // "who would", never "who'd" (Asaf, 2026-11-22): the title is Refer a
12
+ // friend's main line, so it changed with ui#517.
13
+ title: "Know someone who would use CloudGrid?",
11
14
  description: "Send them this link to start their own grid.",
12
15
  copyLabel: "Copy",
13
16
  copiedLabel: "Copied",
@@ -15,6 +18,10 @@ const INVITE_DEFAULTS = {
15
18
  copyAriaLabel: "Copy the invite link",
16
19
  closeLabel: "Close",
17
20
  pillLabel: "Invite people",
21
+ /** The words after the count: "1 invitation left", "3 invitations left". */
22
+ invitationsLeft: (count) => (count === 1 ? "invitation left" : "invitations left"),
23
+ referTitle: "Refer a friend",
24
+ referDescription: "CloudGrid is invite-only during the launch. Send your link to someone who would use it. An invitation is used when they create an account.",
18
25
  };
19
26
  /** How long Copied shows before the label returns to Copy. `CommandField`'s. */
20
27
  const COPIED_MS = 1600;
@@ -50,13 +57,18 @@ const GRABBER_ROW_CLASS = {
50
57
  function InvitePill({ label = INVITE_DEFAULTS.pillLabel, placed = false, className, type = "button", ...props }) {
51
58
  return (_jsxs("button", { "data-slot": "invite-pill", type: type, className: cn("inline-flex h-11 shrink-0 items-center gap-2 rounded-pill border border-hairline pr-4.5 pl-3.5", "bg-popover text-ink in-data-[cg-surface=panel]:bg-panel in-data-[cg-surface=ink]:bg-code", "font-ui text-body-sm leading-none font-bold whitespace-nowrap shadow-(--cg-shadow-card-hover)", "cursor-pointer transition-[background-color,box-shadow] duration-(--cg-duration) ease-out hover:shadow-(--cg-shadow-hover) hover:bg-raised in-data-[cg-surface=panel]:hover:bg-(--cg-hover) in-data-[cg-surface=ink]:hover:bg-(--cg-hover)", FOCUS_RING, placed && "fixed right-6 bottom-6 z-50", className), ...props, children: [_jsx(InvitePersonIcon, { className: "size-4.5 text-(--cg-text-accent)" }), label] }));
52
59
  }
53
- function InvitePopup({ link, open, onOpenChange, onCopy, pill = true, layout = "auto", copyState, initialFocus = true, container, title = INVITE_DEFAULTS.title, description = INVITE_DEFAULTS.description, copyLabel = INVITE_DEFAULTS.copyLabel, copiedLabel = INVITE_DEFAULTS.copiedLabel, blockedLabel = INVITE_DEFAULTS.blockedLabel, copyAriaLabel = INVITE_DEFAULTS.copyAriaLabel, closeLabel = INVITE_DEFAULTS.closeLabel, pillLabel = INVITE_DEFAULTS.pillLabel, className, }) {
60
+ /**
61
+ * The count and its words: the `tag` badge (24 tall, radius 6, the accent on
62
+ * the page grey, flipping on a panel or ink) and the words in the line's face.
63
+ * The popup's row and the Profile block's heading row are this one element.
64
+ */
65
+ function InvitationsLeft({ count, label, slot, className, }) {
66
+ return (_jsxs("p", { "data-slot": slot, className: cn("m-0 flex items-center gap-2.5 font-body text-[length:var(--cg-body-14)] leading-body text-body", className), children: [_jsx(Badge, { variant: "tag", className: "min-w-6.5 font-medium tabular-nums", children: count }), " ", _jsx("span", { children: label(count) })] }));
67
+ }
68
+ /** The copy cycle the popup and the block share: Copy, then Copied or Blocked, then Copy. */
69
+ function useInviteCopy(link, onCopy) {
54
70
  const [ownState, setOwnState] = React.useState("idle");
55
- const state = copyState ?? ownState;
56
71
  const timer = React.useRef(undefined);
57
- const popupRef = React.useRef(null);
58
- const pillRef = React.useRef(null);
59
- const portalContainer = usePortalContainer(container);
60
72
  React.useEffect(() => () => clearTimeout(timer.current), []);
61
73
  async function copy() {
62
74
  let next;
@@ -73,6 +85,34 @@ function InvitePopup({ link, open, onOpenChange, onCopy, pill = true, layout = "
73
85
  clearTimeout(timer.current);
74
86
  timer.current = setTimeout(() => setOwnState("idle"), COPIED_MS);
75
87
  }
88
+ return { ownState, copy };
89
+ }
90
+ /**
91
+ * The link field with Copy inside its right edge: the popup's, and the Profile
92
+ * block's, so both look and behave as one. `slot` prefixes the data-slots
93
+ * (`invite-popup` gives `invite-popup-field`, `-link` and `-copy`).
94
+ */
95
+ function InviteLinkField({ slot, link, state, onCopyClick, labels, copyAriaLabel, }) {
96
+ return (_jsxs("div", { "data-slot": `${slot}-field`, className: cn("flex items-center gap-2 rounded-md border border-hairline py-1.5 pr-1.5 pl-3.5", "bg-raised in-data-[cg-surface=panel]:bg-(--cg-hover) in-data-[cg-surface=ink]:bg-(--cg-hover)"), children: [_jsx("code", { "data-slot": `${slot}-link`, title: link, className: "min-w-0 flex-1 truncate font-mono text-caption text-ink", children: link.replace(/^https?:\/\//, "") }), _jsxs(Button, { type: "button", variant: "cta", onClick: onCopyClick, "data-slot": `${slot}-copy`, "data-state": state, "aria-label": copyAriaLabel, className: cn(
97
+ // EmptyCreations' Add, the frame's same button: 40px, 16px corners,
98
+ // Manrope 600 at 15px. 12 / 14 padding round a 20px mark.
99
+ "relative h-10 min-w-27 gap-1.5 rounded-xl pr-3.5 pl-3 font-ui text-body-sm font-bold",
100
+ // The 44px hit area: 2px above and below, inside the field's padding.
101
+ // 3px from the pseudo's origin, because an absolute box is placed
102
+ // against the PADDING box and Button carries a 1px transparent
103
+ // border: 38 + 3 + 3 = 44, where -0.5 measured 42 (e2e).
104
+ "before:absolute before:inset-x-0 before:-inset-y-0.75 before:content-['']"), children: [state === "copied" ? _jsx(CheckIcon, { className: "size-5" }) : _jsx(CopyIcon, { className: "size-5" }), _jsx("span", { className: "grid", children: ["idle", "copied", "blocked"].map((s) => (_jsx("span", { "data-label": s, "aria-hidden": s === state ? undefined : true, className: cn("[grid-area:1/1]", s === state ? "visible" : "invisible"), children: labels[s] }, s))) })] })] }));
105
+ }
106
+ /** What the live region says after a copy: the label, or that the browser refused. */
107
+ function copyStatus(state, copiedLabel) {
108
+ return state === "copied" ? copiedLabel : state === "blocked" ? "The browser blocked the copy" : "";
109
+ }
110
+ function InvitePopup({ link, open, onOpenChange, onCopy, pill = true, layout = "auto", copyState, initialFocus = true, container, title = INVITE_DEFAULTS.title, description = INVITE_DEFAULTS.description, copyLabel = INVITE_DEFAULTS.copyLabel, copiedLabel = INVITE_DEFAULTS.copiedLabel, blockedLabel = INVITE_DEFAULTS.blockedLabel, copyAriaLabel = INVITE_DEFAULTS.copyAriaLabel, closeLabel = INVITE_DEFAULTS.closeLabel, pillLabel = INVITE_DEFAULTS.pillLabel, invitationsLeft, invitationsLeftLabel = INVITE_DEFAULTS.invitationsLeft, className, }) {
111
+ const { ownState, copy } = useInviteCopy(link, onCopy);
112
+ const state = copyState ?? ownState;
113
+ const popupRef = React.useRef(null);
114
+ const pillRef = React.useRef(null);
115
+ const portalContainer = usePortalContainer(container);
76
116
  const labels = {
77
117
  idle: copyLabel,
78
118
  copied: copiedLabel,
@@ -83,19 +123,19 @@ function InvitePopup({ link, open, onOpenChange, onCopy, pill = true, layout = "
83
123
  // focus returns, so it has to be the same element when it comes back.
84
124
  render: _jsx(InvitePill, { label: pillLabel, placed: true, className: open ? "hidden" : undefined }) })) : null, _jsx(DialogPrimitive.Portal, { container: portalContainer, children: _jsxs(DialogPrimitive.Popup, { ref: popupRef, "data-slot": "invite-popup", "data-layout": layout, initialFocus: initialFocus ? popupRef : false, finalFocus: pill ? pillRef : undefined, className: cn("fixed z-50 flex flex-col gap-3.5 border-hairline text-ink outline-none", "bg-popover in-data-[cg-surface=panel]:bg-panel in-data-[cg-surface=ink]:bg-code", "shadow-[var(--cg-shadow-panel),var(--cg-shadow-hover)]", "duration-150 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0", LAYOUT_CLASS[layout], className), children: [_jsx("div", { "data-slot": "invite-popup-grabber", "aria-hidden": "true", className: cn("justify-center", GRABBER_ROW_CLASS[layout]), children: _jsx("span", { className: "block h-1 w-9 rounded-pill bg-control" }) }), _jsxs("div", { className: "flex items-center gap-2.5", children: [_jsx(DialogPrimitive.Title, { "data-slot": "invite-popup-title", className: "m-0 min-w-0 flex-1 font-ui text-body-18 leading-heading font-bold text-ink", children: title }), _jsx(DialogPrimitive.Close, { "data-slot": "invite-popup-close", "aria-label": closeLabel, className: cn("relative grid size-7 shrink-0 cursor-pointer place-items-center rounded-pill text-body", "transition-colors duration-(--cg-duration) ease-out hover:bg-(--cg-hover) hover:text-ink",
85
125
  // The 44px hit area round a 28px drawing.
86
- "before:absolute before:-inset-2 before:content-['']", FOCUS_RING), children: _jsx(CloseIcon, { className: "size-4" }) })] }), _jsx(DialogPrimitive.Description, { "data-slot": "invite-popup-description", className: "m-0 font-body text-[length:var(--cg-body-14)] leading-body text-body", children: description }), _jsxs("div", { "data-slot": "invite-popup-field", className: cn("flex items-center gap-2 rounded-md border border-hairline py-1.5 pr-1.5 pl-3.5", "bg-raised in-data-[cg-surface=panel]:bg-(--cg-hover) in-data-[cg-surface=ink]:bg-(--cg-hover)"), children: [_jsx("code", { "data-slot": "invite-popup-link", title: link, className: "min-w-0 flex-1 truncate font-mono text-caption text-ink", children: link.replace(/^https?:\/\//, "") }), _jsxs(Button, { type: "button", variant: "cta", onClick: copy, "data-slot": "invite-popup-copy", "data-state": state, "aria-label": copyAriaLabel, className: cn(
87
- // EmptyCreations' Add, the frame's same button: 40px, 16px corners,
88
- // Manrope 600 at 15px. 12 / 14 padding round a 20px mark.
89
- "relative h-10 min-w-27 gap-1.5 rounded-xl pr-3.5 pl-3 font-ui text-body-sm font-bold",
90
- // The 44px hit area: 2px above and below, inside the field's padding.
91
- // 3px from the pseudo's origin, because an absolute box is placed
92
- // against the PADDING box and Button carries a 1px transparent
93
- // border: 38 + 3 + 3 = 44, where -0.5 measured 42 (e2e).
94
- "before:absolute before:inset-x-0 before:-inset-y-0.75 before:content-['']"), children: [state === "copied" ? _jsx(CheckIcon, { className: "size-5" }) : _jsx(CopyIcon, { className: "size-5" }), _jsx("span", { className: "grid", children: ["idle", "copied", "blocked"].map((s) => (_jsx("span", { "data-label": s, "aria-hidden": s === state ? undefined : true, className: cn("[grid-area:1/1]", s === state ? "visible" : "invisible"), children: labels[s] }, s))) })] })] }), _jsx("span", { "data-slot": "invite-popup-status", "aria-live": "polite", className: "sr-only", children: state === "copied"
95
- ? copiedLabel
96
- : state === "blocked"
97
- ? "The browser blocked the copy"
98
- : "" })] }) })] }));
126
+ "before:absolute before:-inset-2 before:content-['']", FOCUS_RING), children: _jsx(CloseIcon, { className: "size-4" }) })] }), _jsx(DialogPrimitive.Description, { "data-slot": "invite-popup-description", className: "m-0 font-body text-[length:var(--cg-body-14)] leading-body text-body", children: description }), invitationsLeft === undefined ? null : (_jsx(InvitationsLeft, { count: invitationsLeft, label: invitationsLeftLabel, slot: "invite-popup-left" })), _jsx(InviteLinkField, { slot: "invite-popup", link: link, state: state, onCopyClick: copy, labels: labels, copyAriaLabel: copyAriaLabel }), _jsx("span", { "data-slot": "invite-popup-status", "aria-live": "polite", className: "sr-only", children: copyStatus(state, copiedLabel) })] }) })] }));
127
+ }
128
+ /**
129
+ * The Profile page's "Refer a friend" block (ui#517, cloudgrid#6645 §3): a
130
+ * section named by its heading, the count at the heading's right, one line,
131
+ * and the popup's own link field and Copy. On a phone the count wraps under
132
+ * the heading when the two do not fit on one line.
133
+ */
134
+ function ReferFriendBlock({ link, invitationsLeft, onCopy, copyState, title = INVITE_DEFAULTS.referTitle, description = INVITE_DEFAULTS.referDescription, invitationsLeftLabel = INVITE_DEFAULTS.invitationsLeft, copyLabel = INVITE_DEFAULTS.copyLabel, copiedLabel = INVITE_DEFAULTS.copiedLabel, blockedLabel = INVITE_DEFAULTS.blockedLabel, copyAriaLabel = INVITE_DEFAULTS.copyAriaLabel, className, }) {
135
+ const { ownState, copy } = useInviteCopy(link, onCopy);
136
+ const state = copyState ?? ownState;
137
+ const titleId = React.useId();
138
+ return (_jsxs("section", { "data-slot": "refer-friend", "aria-labelledby": titleId, className: cn("flex flex-col gap-3 rounded-xl border border-hairline bg-card p-4 text-ink sm:p-6", className), children: [_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-x-4 gap-y-2", children: [_jsx("h2", { id: titleId, "data-slot": "refer-friend-title", className: "m-0 font-ui text-body-18 leading-heading font-medium text-ink", children: title }), _jsx(InvitationsLeft, { count: invitationsLeft, label: invitationsLeftLabel, slot: "refer-friend-left" })] }), _jsx("p", { "data-slot": "refer-friend-description", className: "m-0 font-body text-[length:var(--cg-body-14)] leading-body text-body", children: description }), _jsx(InviteLinkField, { slot: "refer-friend", link: link, state: state, onCopyClick: copy, labels: { idle: copyLabel, copied: copiedLabel, blocked: blockedLabel }, copyAriaLabel: copyAriaLabel }), _jsx("span", { "data-slot": "refer-friend-status", "aria-live": "polite", className: "sr-only", children: copyStatus(state, copiedLabel) })] }));
99
139
  }
100
- export { InvitePill, InvitePopup, INVITE_DEFAULTS };
140
+ export { InvitePill, InvitePopup, INVITE_DEFAULTS, ReferFriendBlock };
101
141
  //# sourceMappingURL=invite-popup.js.map