@designa8/vibedesign-linear-internal-v1-b737 0.14.4 → 0.15.1
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/README.md +1 -1
- package/dist/index.cjs +92 -40
- package/dist/index.js +92 -40
- package/dist/styles.css +13 -16
- package/package.json +1 -1
- package/src/atoms/AnnouncementCard/AnnouncementCard.tsx +142 -64
- package/src/atoms/AnnouncementCard/preview.tsx +72 -8
- package/src/organisms/Sidebar/Sidebar.tsx +10 -0
- package/src/organisms/SidebarDesktop/SidebarDesktop.tsx +14 -1
- package/src/organisms/SidebarDesktop/preview.tsx +67 -21
- package/src/organisms/SidebarMobile/SidebarMobile.tsx +10 -2
- package/src/tokens.css +11 -10
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @designa8/vibedesign-linear-internal-v1-b737
|
|
2
2
|
|
|
3
|
-
Complete design system generated by Atoms Design, version **0.
|
|
3
|
+
Complete design system generated by Atoms Design, version **0.15.1**.
|
|
4
4
|
Tokens, atoms, molecules, organisms, and templates — import from the package root;
|
|
5
5
|
never hardcode visual values in consumer code.
|
|
6
6
|
|
package/dist/index.cjs
CHANGED
|
@@ -309,28 +309,41 @@ Icon.displayName = "Icon";
|
|
|
309
309
|
// virtual-pkg:src/atoms/AnnouncementCard/AnnouncementCard.tsx
|
|
310
310
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
311
311
|
var cn = (...parts) => parts.filter(Boolean).join(" ");
|
|
312
|
-
var cardBase = "group relative flex w-full cursor-pointer overflow-hidden rounded-xl border border-hairline transition duration-200 ease-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-blue";
|
|
313
|
-
var
|
|
314
|
-
|
|
312
|
+
var cardBase = "group relative flex w-full cursor-pointer overflow-hidden rounded-xl border border-hairline shadow-card transition duration-200 ease-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-blue";
|
|
313
|
+
var WASH = [
|
|
314
|
+
"linear-gradient(to right",
|
|
315
|
+
"transparent 0%",
|
|
316
|
+
"transparent 34%",
|
|
317
|
+
"color-mix(in srgb, var(--color-promo-glow) 30%, transparent) 48%",
|
|
318
|
+
"color-mix(in srgb, var(--color-promo-glow) 58%, transparent) 63%",
|
|
319
|
+
"color-mix(in srgb, var(--color-promo-glow-pink) 62%, transparent) 76%",
|
|
320
|
+
"color-mix(in srgb, var(--color-promo-violet) 84%, transparent) 88%",
|
|
321
|
+
"var(--color-promo-violet) 100%"
|
|
322
|
+
].join(", ") + ")";
|
|
323
|
+
var WARM_BLOOM = "radial-gradient(88% 150% at 60% -30%, color-mix(in srgb, var(--color-promo-glow) 96%, transparent) 0%, color-mix(in srgb, var(--color-promo-glow) 44%, transparent) 48%, transparent 80%)";
|
|
324
|
+
var CORNER = "radial-gradient(58% 88% at 100% -10%, var(--color-promo-glow-pink) 0%, var(--color-promo-glow-pink) 22%, color-mix(in srgb, var(--color-promo-glow-pink) 62%, transparent) 54%, transparent 86%)";
|
|
325
|
+
var HILL_LEFT_FADE = "linear-gradient(to right, transparent 18%, black 46%)";
|
|
326
|
+
var ARTWORK_FADE = "linear-gradient(to right, transparent 0%, transparent 30%, black 60%, black 100%)";
|
|
327
|
+
var ARTWORK_WIDTH = "70%";
|
|
315
328
|
var HILLS = [
|
|
316
329
|
{
|
|
317
330
|
id: "violet",
|
|
318
|
-
shape: "radial-gradient(
|
|
319
|
-
fill: "linear-gradient(
|
|
331
|
+
shape: "radial-gradient(44% 185% at 66% 230%, black 0 99%, transparent 100%)",
|
|
332
|
+
fill: "linear-gradient(to bottom, var(--color-promo-hill-mid) 0%, var(--color-promo-hill-mid-deep) 100%)"
|
|
320
333
|
},
|
|
321
334
|
{
|
|
322
335
|
id: "indigo",
|
|
323
|
-
shape: "radial-gradient(
|
|
324
|
-
fill: "linear-gradient(
|
|
336
|
+
shape: "radial-gradient(36% 185% at 92% 250%, black 0 99%, transparent 100%)",
|
|
337
|
+
fill: "linear-gradient(to bottom, var(--color-promo-hill-back) 0%, var(--color-promo-hill-back-deep) 100%)"
|
|
325
338
|
},
|
|
326
339
|
{
|
|
327
340
|
id: "cyan",
|
|
328
|
-
shape: "radial-gradient(
|
|
329
|
-
fill: "linear-gradient(to bottom, var(--color-promo-hill-front) 0%, var(--color-promo-hill-front-deep)
|
|
341
|
+
shape: "radial-gradient(32% 175% at 56% 230%, black 0 99%, transparent 100%)",
|
|
342
|
+
fill: "linear-gradient(to bottom, var(--color-promo-hill-front) 0%, var(--color-promo-hill-front-deep) 100%)"
|
|
330
343
|
}
|
|
331
344
|
];
|
|
332
345
|
var AnnouncementCard = React2.forwardRef(
|
|
333
|
-
({ eyebrow, title, subtitle, variant = "default", icon, href = "#", onClick, className }, ref) => {
|
|
346
|
+
({ eyebrow, title, subtitle, variant = "default", icon, artwork, href = "#", onClick, className }, ref) => {
|
|
334
347
|
const handleClick = (event) => {
|
|
335
348
|
if (onClick) {
|
|
336
349
|
event.preventDefault();
|
|
@@ -338,6 +351,7 @@ var AnnouncementCard = React2.forwardRef(
|
|
|
338
351
|
}
|
|
339
352
|
};
|
|
340
353
|
if (variant === "promo") {
|
|
354
|
+
const hasArtwork = artwork !== void 0 && artwork !== null && artwork !== false;
|
|
341
355
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
342
356
|
"a",
|
|
343
357
|
{
|
|
@@ -349,49 +363,77 @@ var AnnouncementCard = React2.forwardRef(
|
|
|
349
363
|
cardBase,
|
|
350
364
|
// Flat in the flow: no lift, no shadow escalation, so the card can never
|
|
351
365
|
// ride up over the nav rows above it. Hover is a hairline emphasis only.
|
|
352
|
-
"items-center gap-
|
|
366
|
+
"min-h-[5rem] items-center gap-xs bg-canvas py-base pl-base pr-xs",
|
|
353
367
|
"hover:border-hairline-strong",
|
|
354
368
|
className
|
|
355
369
|
),
|
|
356
370
|
children: [
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
371
|
+
hasArtwork ? (
|
|
372
|
+
/* Artwork slot. The card owns the box (right-anchored, full height, ~70%
|
|
373
|
+
wide, frozen to the card radius by the root's `overflow-hidden`, and
|
|
374
|
+
masked so it fades to the card surface toward the left); the consumer
|
|
375
|
+
owns every pixel inside it. Sits between the card surface and the copy. */
|
|
376
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
377
|
+
"span",
|
|
378
|
+
{
|
|
379
|
+
"aria-hidden": "true",
|
|
380
|
+
className: "pointer-events-none absolute inset-0",
|
|
381
|
+
style: { maskImage: ARTWORK_FADE, WebkitMaskImage: ARTWORK_FADE },
|
|
382
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
366
383
|
"span",
|
|
367
384
|
{
|
|
368
|
-
className: "absolute inset-0",
|
|
369
|
-
style: {
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
385
|
+
className: "pointer-events-none absolute inset-y-0 right-0",
|
|
386
|
+
style: { width: ARTWORK_WIDTH },
|
|
387
|
+
children: artwork
|
|
388
|
+
}
|
|
389
|
+
)
|
|
390
|
+
}
|
|
391
|
+
)
|
|
392
|
+
) : (
|
|
393
|
+
/* Decorative illustration only: warm wash, upper bloom, corner, then the hills. */
|
|
394
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { "aria-hidden": "true", className: "pointer-events-none absolute inset-0", children: [
|
|
395
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "absolute inset-0", style: { backgroundImage: WASH } }),
|
|
396
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "absolute inset-0", style: { backgroundImage: WARM_BLOOM } }),
|
|
397
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "absolute inset-0", style: { backgroundImage: CORNER } }),
|
|
398
|
+
HILLS.map((hill) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
399
|
+
"span",
|
|
400
|
+
{
|
|
401
|
+
className: "absolute inset-0",
|
|
402
|
+
style: {
|
|
403
|
+
maskImage: HILL_LEFT_FADE,
|
|
404
|
+
WebkitMaskImage: HILL_LEFT_FADE
|
|
374
405
|
},
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
406
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
407
|
+
"span",
|
|
408
|
+
{
|
|
409
|
+
className: "absolute inset-0",
|
|
410
|
+
style: {
|
|
411
|
+
backgroundImage: hill.fill,
|
|
412
|
+
maskImage: hill.shape,
|
|
413
|
+
WebkitMaskImage: hill.shape
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
)
|
|
417
|
+
},
|
|
418
|
+
hill.id
|
|
419
|
+
))
|
|
420
|
+
] })
|
|
379
421
|
),
|
|
380
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: "relative flex min-w-0 flex-1 flex-col gap-
|
|
381
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "truncate text-
|
|
382
|
-
subtitle && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "truncate text-
|
|
422
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: "relative flex min-w-0 flex-1 flex-col gap-xxs", children: [
|
|
423
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "truncate text-heading-sm font-weight-heading-md text-ink", children: title }),
|
|
424
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "truncate text-body-sm text-ink opacity-70 dark:opacity-80", children: subtitle })
|
|
383
425
|
] }),
|
|
384
|
-
icon && //
|
|
385
|
-
//
|
|
386
|
-
//
|
|
426
|
+
icon && // White in every case: over the consumer's coloured artwork, and over the
|
|
427
|
+
// saturated violet end of the built-in hills. `promo-crown` is white in
|
|
428
|
+
// both themes, so the glyph never picks up the theme ink.
|
|
387
429
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
388
430
|
Icon,
|
|
389
431
|
{
|
|
390
432
|
name: icon,
|
|
391
|
-
size:
|
|
433
|
+
size: 24,
|
|
392
434
|
strokeWidth: 2,
|
|
393
|
-
|
|
394
|
-
|
|
435
|
+
className: "relative shrink-0",
|
|
436
|
+
style: { color: "var(--color-promo-crown)" }
|
|
395
437
|
}
|
|
396
438
|
)
|
|
397
439
|
]
|
|
@@ -12083,6 +12125,7 @@ var SidebarDesktop = React92.forwardRef(
|
|
|
12083
12125
|
title: announcement.title,
|
|
12084
12126
|
subtitle: announcement.subtitle,
|
|
12085
12127
|
icon: announcement.icon,
|
|
12128
|
+
artwork: announcement.artwork,
|
|
12086
12129
|
href: announcement.href,
|
|
12087
12130
|
onClick: announcement.onClick,
|
|
12088
12131
|
variant: "promo"
|
|
@@ -12117,7 +12160,15 @@ var SidebarDesktop = React92.forwardRef(
|
|
|
12117
12160
|
onClick: onHelpClick
|
|
12118
12161
|
}
|
|
12119
12162
|
),
|
|
12120
|
-
showSettingsAction && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
12163
|
+
showSettingsAction && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
12164
|
+
IconButton,
|
|
12165
|
+
{
|
|
12166
|
+
icon: "settings",
|
|
12167
|
+
variant: "ghost",
|
|
12168
|
+
"aria-label": "Settings",
|
|
12169
|
+
onClick: onSettingsClick
|
|
12170
|
+
}
|
|
12171
|
+
)
|
|
12121
12172
|
] })
|
|
12122
12173
|
]
|
|
12123
12174
|
}
|
|
@@ -12386,6 +12437,7 @@ var SidebarMobile = React93.forwardRef(
|
|
|
12386
12437
|
title: announcement.title,
|
|
12387
12438
|
subtitle: announcement.subtitle,
|
|
12388
12439
|
icon: announcement.icon,
|
|
12440
|
+
artwork: announcement.artwork,
|
|
12389
12441
|
href: announcement.href,
|
|
12390
12442
|
onClick: announcement.onClick,
|
|
12391
12443
|
variant: "promo"
|
package/dist/index.js
CHANGED
|
@@ -163,28 +163,41 @@ Icon.displayName = "Icon";
|
|
|
163
163
|
// virtual-pkg:src/atoms/AnnouncementCard/AnnouncementCard.tsx
|
|
164
164
|
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
165
165
|
var cn = (...parts) => parts.filter(Boolean).join(" ");
|
|
166
|
-
var cardBase = "group relative flex w-full cursor-pointer overflow-hidden rounded-xl border border-hairline transition duration-200 ease-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-blue";
|
|
167
|
-
var
|
|
168
|
-
|
|
166
|
+
var cardBase = "group relative flex w-full cursor-pointer overflow-hidden rounded-xl border border-hairline shadow-card transition duration-200 ease-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-blue";
|
|
167
|
+
var WASH = [
|
|
168
|
+
"linear-gradient(to right",
|
|
169
|
+
"transparent 0%",
|
|
170
|
+
"transparent 34%",
|
|
171
|
+
"color-mix(in srgb, var(--color-promo-glow) 30%, transparent) 48%",
|
|
172
|
+
"color-mix(in srgb, var(--color-promo-glow) 58%, transparent) 63%",
|
|
173
|
+
"color-mix(in srgb, var(--color-promo-glow-pink) 62%, transparent) 76%",
|
|
174
|
+
"color-mix(in srgb, var(--color-promo-violet) 84%, transparent) 88%",
|
|
175
|
+
"var(--color-promo-violet) 100%"
|
|
176
|
+
].join(", ") + ")";
|
|
177
|
+
var WARM_BLOOM = "radial-gradient(88% 150% at 60% -30%, color-mix(in srgb, var(--color-promo-glow) 96%, transparent) 0%, color-mix(in srgb, var(--color-promo-glow) 44%, transparent) 48%, transparent 80%)";
|
|
178
|
+
var CORNER = "radial-gradient(58% 88% at 100% -10%, var(--color-promo-glow-pink) 0%, var(--color-promo-glow-pink) 22%, color-mix(in srgb, var(--color-promo-glow-pink) 62%, transparent) 54%, transparent 86%)";
|
|
179
|
+
var HILL_LEFT_FADE = "linear-gradient(to right, transparent 18%, black 46%)";
|
|
180
|
+
var ARTWORK_FADE = "linear-gradient(to right, transparent 0%, transparent 30%, black 60%, black 100%)";
|
|
181
|
+
var ARTWORK_WIDTH = "70%";
|
|
169
182
|
var HILLS = [
|
|
170
183
|
{
|
|
171
184
|
id: "violet",
|
|
172
|
-
shape: "radial-gradient(
|
|
173
|
-
fill: "linear-gradient(
|
|
185
|
+
shape: "radial-gradient(44% 185% at 66% 230%, black 0 99%, transparent 100%)",
|
|
186
|
+
fill: "linear-gradient(to bottom, var(--color-promo-hill-mid) 0%, var(--color-promo-hill-mid-deep) 100%)"
|
|
174
187
|
},
|
|
175
188
|
{
|
|
176
189
|
id: "indigo",
|
|
177
|
-
shape: "radial-gradient(
|
|
178
|
-
fill: "linear-gradient(
|
|
190
|
+
shape: "radial-gradient(36% 185% at 92% 250%, black 0 99%, transparent 100%)",
|
|
191
|
+
fill: "linear-gradient(to bottom, var(--color-promo-hill-back) 0%, var(--color-promo-hill-back-deep) 100%)"
|
|
179
192
|
},
|
|
180
193
|
{
|
|
181
194
|
id: "cyan",
|
|
182
|
-
shape: "radial-gradient(
|
|
183
|
-
fill: "linear-gradient(to bottom, var(--color-promo-hill-front) 0%, var(--color-promo-hill-front-deep)
|
|
195
|
+
shape: "radial-gradient(32% 175% at 56% 230%, black 0 99%, transparent 100%)",
|
|
196
|
+
fill: "linear-gradient(to bottom, var(--color-promo-hill-front) 0%, var(--color-promo-hill-front-deep) 100%)"
|
|
184
197
|
}
|
|
185
198
|
];
|
|
186
199
|
var AnnouncementCard = React2.forwardRef(
|
|
187
|
-
({ eyebrow, title, subtitle, variant = "default", icon, href = "#", onClick, className }, ref) => {
|
|
200
|
+
({ eyebrow, title, subtitle, variant = "default", icon, artwork, href = "#", onClick, className }, ref) => {
|
|
188
201
|
const handleClick = (event) => {
|
|
189
202
|
if (onClick) {
|
|
190
203
|
event.preventDefault();
|
|
@@ -192,6 +205,7 @@ var AnnouncementCard = React2.forwardRef(
|
|
|
192
205
|
}
|
|
193
206
|
};
|
|
194
207
|
if (variant === "promo") {
|
|
208
|
+
const hasArtwork = artwork !== void 0 && artwork !== null && artwork !== false;
|
|
195
209
|
return /* @__PURE__ */ jsxs(
|
|
196
210
|
"a",
|
|
197
211
|
{
|
|
@@ -203,49 +217,77 @@ var AnnouncementCard = React2.forwardRef(
|
|
|
203
217
|
cardBase,
|
|
204
218
|
// Flat in the flow: no lift, no shadow escalation, so the card can never
|
|
205
219
|
// ride up over the nav rows above it. Hover is a hairline emphasis only.
|
|
206
|
-
"items-center gap-
|
|
220
|
+
"min-h-[5rem] items-center gap-xs bg-canvas py-base pl-base pr-xs",
|
|
207
221
|
"hover:border-hairline-strong",
|
|
208
222
|
className
|
|
209
223
|
),
|
|
210
224
|
children: [
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
225
|
+
hasArtwork ? (
|
|
226
|
+
/* Artwork slot. The card owns the box (right-anchored, full height, ~70%
|
|
227
|
+
wide, frozen to the card radius by the root's `overflow-hidden`, and
|
|
228
|
+
masked so it fades to the card surface toward the left); the consumer
|
|
229
|
+
owns every pixel inside it. Sits between the card surface and the copy. */
|
|
230
|
+
/* @__PURE__ */ jsx2(
|
|
231
|
+
"span",
|
|
232
|
+
{
|
|
233
|
+
"aria-hidden": "true",
|
|
234
|
+
className: "pointer-events-none absolute inset-0",
|
|
235
|
+
style: { maskImage: ARTWORK_FADE, WebkitMaskImage: ARTWORK_FADE },
|
|
236
|
+
children: /* @__PURE__ */ jsx2(
|
|
220
237
|
"span",
|
|
221
238
|
{
|
|
222
|
-
className: "absolute inset-0",
|
|
223
|
-
style: {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
239
|
+
className: "pointer-events-none absolute inset-y-0 right-0",
|
|
240
|
+
style: { width: ARTWORK_WIDTH },
|
|
241
|
+
children: artwork
|
|
242
|
+
}
|
|
243
|
+
)
|
|
244
|
+
}
|
|
245
|
+
)
|
|
246
|
+
) : (
|
|
247
|
+
/* Decorative illustration only: warm wash, upper bloom, corner, then the hills. */
|
|
248
|
+
/* @__PURE__ */ jsxs("span", { "aria-hidden": "true", className: "pointer-events-none absolute inset-0", children: [
|
|
249
|
+
/* @__PURE__ */ jsx2("span", { className: "absolute inset-0", style: { backgroundImage: WASH } }),
|
|
250
|
+
/* @__PURE__ */ jsx2("span", { className: "absolute inset-0", style: { backgroundImage: WARM_BLOOM } }),
|
|
251
|
+
/* @__PURE__ */ jsx2("span", { className: "absolute inset-0", style: { backgroundImage: CORNER } }),
|
|
252
|
+
HILLS.map((hill) => /* @__PURE__ */ jsx2(
|
|
253
|
+
"span",
|
|
254
|
+
{
|
|
255
|
+
className: "absolute inset-0",
|
|
256
|
+
style: {
|
|
257
|
+
maskImage: HILL_LEFT_FADE,
|
|
258
|
+
WebkitMaskImage: HILL_LEFT_FADE
|
|
228
259
|
},
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
260
|
+
children: /* @__PURE__ */ jsx2(
|
|
261
|
+
"span",
|
|
262
|
+
{
|
|
263
|
+
className: "absolute inset-0",
|
|
264
|
+
style: {
|
|
265
|
+
backgroundImage: hill.fill,
|
|
266
|
+
maskImage: hill.shape,
|
|
267
|
+
WebkitMaskImage: hill.shape
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
)
|
|
271
|
+
},
|
|
272
|
+
hill.id
|
|
273
|
+
))
|
|
274
|
+
] })
|
|
233
275
|
),
|
|
234
|
-
/* @__PURE__ */ jsxs("span", { className: "relative flex min-w-0 flex-1 flex-col gap-
|
|
235
|
-
/* @__PURE__ */ jsx2("span", { className: "truncate text-
|
|
236
|
-
subtitle && /* @__PURE__ */ jsx2("span", { className: "truncate text-
|
|
276
|
+
/* @__PURE__ */ jsxs("span", { className: "relative flex min-w-0 flex-1 flex-col gap-xxs", children: [
|
|
277
|
+
/* @__PURE__ */ jsx2("span", { className: "truncate text-heading-sm font-weight-heading-md text-ink", children: title }),
|
|
278
|
+
subtitle && /* @__PURE__ */ jsx2("span", { className: "truncate text-body-sm text-ink opacity-70 dark:opacity-80", children: subtitle })
|
|
237
279
|
] }),
|
|
238
|
-
icon && //
|
|
239
|
-
//
|
|
240
|
-
//
|
|
280
|
+
icon && // White in every case: over the consumer's coloured artwork, and over the
|
|
281
|
+
// saturated violet end of the built-in hills. `promo-crown` is white in
|
|
282
|
+
// both themes, so the glyph never picks up the theme ink.
|
|
241
283
|
/* @__PURE__ */ jsx2(
|
|
242
284
|
Icon,
|
|
243
285
|
{
|
|
244
286
|
name: icon,
|
|
245
|
-
size:
|
|
287
|
+
size: 24,
|
|
246
288
|
strokeWidth: 2,
|
|
247
|
-
|
|
248
|
-
|
|
289
|
+
className: "relative shrink-0",
|
|
290
|
+
style: { color: "var(--color-promo-crown)" }
|
|
249
291
|
}
|
|
250
292
|
)
|
|
251
293
|
]
|
|
@@ -11937,6 +11979,7 @@ var SidebarDesktop = React92.forwardRef(
|
|
|
11937
11979
|
title: announcement.title,
|
|
11938
11980
|
subtitle: announcement.subtitle,
|
|
11939
11981
|
icon: announcement.icon,
|
|
11982
|
+
artwork: announcement.artwork,
|
|
11940
11983
|
href: announcement.href,
|
|
11941
11984
|
onClick: announcement.onClick,
|
|
11942
11985
|
variant: "promo"
|
|
@@ -11971,7 +12014,15 @@ var SidebarDesktop = React92.forwardRef(
|
|
|
11971
12014
|
onClick: onHelpClick
|
|
11972
12015
|
}
|
|
11973
12016
|
),
|
|
11974
|
-
showSettingsAction && /* @__PURE__ */ jsx92(
|
|
12017
|
+
showSettingsAction && /* @__PURE__ */ jsx92(
|
|
12018
|
+
IconButton,
|
|
12019
|
+
{
|
|
12020
|
+
icon: "settings",
|
|
12021
|
+
variant: "ghost",
|
|
12022
|
+
"aria-label": "Settings",
|
|
12023
|
+
onClick: onSettingsClick
|
|
12024
|
+
}
|
|
12025
|
+
)
|
|
11975
12026
|
] })
|
|
11976
12027
|
]
|
|
11977
12028
|
}
|
|
@@ -12240,6 +12291,7 @@ var SidebarMobile = React93.forwardRef(
|
|
|
12240
12291
|
title: announcement.title,
|
|
12241
12292
|
subtitle: announcement.subtitle,
|
|
12242
12293
|
icon: announcement.icon,
|
|
12294
|
+
artwork: announcement.artwork,
|
|
12243
12295
|
href: announcement.href,
|
|
12244
12296
|
onClick: announcement.onClick,
|
|
12245
12297
|
variant: "promo"
|
package/dist/styles.css
CHANGED
|
@@ -63,14 +63,17 @@
|
|
|
63
63
|
--color-link-blue: #5E6AD2;
|
|
64
64
|
--color-focus-blue: #5E6AD2;
|
|
65
65
|
--color-scrim: #000000;
|
|
66
|
-
--color-promo-
|
|
67
|
-
--color-promo-
|
|
68
|
-
--color-promo-
|
|
69
|
-
--color-promo-hill-
|
|
70
|
-
--color-promo-hill-
|
|
71
|
-
--color-promo-hill-
|
|
72
|
-
--color-promo-hill-
|
|
73
|
-
--color-promo-
|
|
66
|
+
--color-promo-sky: #7DD3FC;
|
|
67
|
+
--color-promo-violet: #7C3AED;
|
|
68
|
+
--color-promo-glow: #FFD0A6;
|
|
69
|
+
--color-promo-hill-front: #7DD3FC;
|
|
70
|
+
--color-promo-hill-front-deep: #3B82F6;
|
|
71
|
+
--color-promo-hill-mid: #A78BFA;
|
|
72
|
+
--color-promo-hill-mid-deep: #7C3AED;
|
|
73
|
+
--color-promo-hill-back: #6D28D9;
|
|
74
|
+
--color-promo-hill-back-deep: #4C1D95;
|
|
75
|
+
--color-promo-glow-pink: #EE7BC4;
|
|
76
|
+
--color-promo-crown: #FFFFFF;
|
|
74
77
|
--font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
|
|
75
78
|
--text-display-lg: 40px;
|
|
76
79
|
--text-display-lg--font-weight: 600;
|
|
@@ -1764,9 +1767,6 @@
|
|
|
1764
1767
|
.pl-lg {
|
|
1765
1768
|
padding-left: var(--spacing-lg);
|
|
1766
1769
|
}
|
|
1767
|
-
.pl-md {
|
|
1768
|
-
padding-left: var(--spacing-md);
|
|
1769
|
-
}
|
|
1770
1770
|
.pl-xl {
|
|
1771
1771
|
padding-left: var(--spacing-xl);
|
|
1772
1772
|
}
|
|
@@ -1967,9 +1967,6 @@
|
|
|
1967
1967
|
.opacity-70 {
|
|
1968
1968
|
opacity: 70%;
|
|
1969
1969
|
}
|
|
1970
|
-
.opacity-80 {
|
|
1971
|
-
opacity: 80%;
|
|
1972
|
-
}
|
|
1973
1970
|
.opacity-100 {
|
|
1974
1971
|
opacity: 100%;
|
|
1975
1972
|
}
|
|
@@ -3047,9 +3044,9 @@
|
|
|
3047
3044
|
background-color: var(--color-ink);
|
|
3048
3045
|
}
|
|
3049
3046
|
}
|
|
3050
|
-
.dark\:opacity-
|
|
3047
|
+
.dark\:opacity-80 {
|
|
3051
3048
|
&:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
3052
|
-
opacity:
|
|
3049
|
+
opacity: 80%;
|
|
3053
3050
|
}
|
|
3054
3051
|
}
|
|
3055
3052
|
|
package/package.json
CHANGED
|
@@ -10,14 +10,23 @@ export interface AnnouncementCardProps {
|
|
|
10
10
|
subtitle?: string;
|
|
11
11
|
/**
|
|
12
12
|
* `"default"` is the plain "what's new" card. `"promo"` is the upgrade card with
|
|
13
|
-
* the
|
|
13
|
+
* the full-bleed warm wash and the rolling-hills illustration.
|
|
14
14
|
*/
|
|
15
15
|
variant?: "default" | "promo";
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
17
|
+
* Glyph drawn over the illustration. Promo only. Always white (`promo-crown`), so
|
|
18
|
+
* it reads on the saturated violet side of the built-in art and on whatever
|
|
19
|
+
* coloured artwork a consumer supplies through `artwork`.
|
|
19
20
|
*/
|
|
20
21
|
icon?: IconName;
|
|
22
|
+
/**
|
|
23
|
+
* Optional artwork slot. Promo only. The card owns the box — anchored right, full
|
|
24
|
+
* card height, roughly 70% of the card width, clipped to the card radius, masked so
|
|
25
|
+
* it fades into the card surface over the left third — and the consumer owns
|
|
26
|
+
* whatever goes inside it (a gradient, an image, an inline SVG). When supplied, the
|
|
27
|
+
* built-in wash, bloom, and hills are not rendered at all.
|
|
28
|
+
*/
|
|
29
|
+
artwork?: React.ReactNode;
|
|
21
30
|
/** Destination. Used as the fallback when `onClick` is not supplied. */
|
|
22
31
|
href?: string;
|
|
23
32
|
/**
|
|
@@ -32,64 +41,103 @@ const cn = (...parts: Array<string | false | null | undefined>) =>
|
|
|
32
41
|
parts.filter(Boolean).join(" ");
|
|
33
42
|
|
|
34
43
|
const cardBase =
|
|
35
|
-
"group relative flex w-full cursor-pointer overflow-hidden rounded-xl border border-hairline transition duration-200 ease-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-blue";
|
|
44
|
+
"group relative flex w-full cursor-pointer overflow-hidden rounded-xl border border-hairline shadow-card transition duration-200 ease-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-blue";
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* The full-bleed horizontal wash. The left third stays clear so the copy keeps a
|
|
48
|
+
* near-white (near-black in dark mode) field to sit on; it then warms into peach
|
|
49
|
+
* across the middle, drifts through pink and lands on saturated violet over the
|
|
50
|
+
* right quarter — the top-right corner included.
|
|
51
|
+
*/
|
|
52
|
+
const WASH = [
|
|
53
|
+
"linear-gradient(to right",
|
|
54
|
+
"transparent 0%",
|
|
55
|
+
"transparent 34%",
|
|
56
|
+
"color-mix(in srgb, var(--color-promo-glow) 30%, transparent) 48%",
|
|
57
|
+
"color-mix(in srgb, var(--color-promo-glow) 58%, transparent) 63%",
|
|
58
|
+
"color-mix(in srgb, var(--color-promo-glow-pink) 62%, transparent) 76%",
|
|
59
|
+
"color-mix(in srgb, var(--color-promo-violet) 84%, transparent) 88%",
|
|
60
|
+
"var(--color-promo-violet) 100%",
|
|
61
|
+
].join(", ") + ")";
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* The warm bloom fills the upper middle of the card, so the peach reads as a wide
|
|
65
|
+
* glow rather than a thin band.
|
|
66
|
+
*/
|
|
67
|
+
const WARM_BLOOM =
|
|
68
|
+
"radial-gradient(88% 150% at 60% -30%, color-mix(in srgb, var(--color-promo-glow) 96%, transparent) 0%, color-mix(in srgb, var(--color-promo-glow) 44%, transparent) 48%, transparent 80%)";
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Pink holds the top-right corner before it hands over to violet lower down, so the
|
|
72
|
+
* corner reads pink-magenta rather than a flat violet slab.
|
|
73
|
+
*/
|
|
74
|
+
const CORNER =
|
|
75
|
+
"radial-gradient(58% 88% at 100% -10%, var(--color-promo-glow-pink) 0%, var(--color-promo-glow-pink) 22%, color-mix(in srgb, var(--color-promo-glow-pink) 62%, transparent) 54%, transparent 86%)";
|
|
36
76
|
|
|
37
77
|
/**
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
78
|
+
* Shared left edge for every hill: each layer keeps a crisp crest and only softens
|
|
79
|
+
* here, where it dissolves into the white field behind the copy. Nesting this mask
|
|
80
|
+
* around the shape mask keeps the two from being unioned into one blob. It holds
|
|
81
|
+
* back until past the copy column, so the title and subtitle always read on clean
|
|
82
|
+
* card surface — on the narrow rail and on a wide card alike.
|
|
42
83
|
*/
|
|
43
|
-
const
|
|
44
|
-
"linear-gradient(to right, transparent 62%, color-mix(in srgb, black 18%, transparent) 72%, color-mix(in srgb, black 62%, transparent) 82%, black 92%)";
|
|
84
|
+
const HILL_LEFT_FADE = "linear-gradient(to right, transparent 18%, black 46%)";
|
|
45
85
|
|
|
46
86
|
/**
|
|
47
|
-
* The
|
|
48
|
-
*
|
|
49
|
-
*
|
|
87
|
+
* The artwork slot's horizontal mask, measured against the CARD width (the art
|
|
88
|
+
* starts around 30% across, so the fade falls over the art's own left edge): fully
|
|
89
|
+
* transparent up to 30%, fully opaque from 60% rightwards. The copy on the left
|
|
90
|
+
* therefore always sits on clean card surface, whatever the consumer drops in.
|
|
50
91
|
*/
|
|
51
|
-
const
|
|
52
|
-
"
|
|
92
|
+
const ARTWORK_FADE =
|
|
93
|
+
"linear-gradient(to right, transparent 0%, transparent 30%, black 60%, black 100%)";
|
|
94
|
+
|
|
95
|
+
/** The art area: right-anchored, full card height, ~70% of the card width. */
|
|
96
|
+
const ARTWORK_WIDTH = "70%";
|
|
53
97
|
|
|
54
98
|
interface Hill {
|
|
55
99
|
id: string;
|
|
56
100
|
/**
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
101
|
+
* Every hill is one very tall, wide ellipse whose centre sits far below the card,
|
|
102
|
+
* so only a shallow, gently curving crest falls inside — a rolling hill, never a
|
|
103
|
+
* circle and never a diagonal sweep.
|
|
104
|
+
*
|
|
105
|
+
* Reading the numbers: the centre sits at `cy`, the vertical radius is `H`, so the
|
|
106
|
+
* crest lands at `cy - H` as a share of the card measured from the top; `W` and
|
|
107
|
+
* `cx` decide how far the flanks reach across the bottom edge.
|
|
108
|
+
*
|
|
109
|
+
* Back to front, each crest about ten points apart so every layer stays visible:
|
|
110
|
+
* violet — crest ~45% up, peaking at 66% across, easing off toward the right edge;
|
|
111
|
+
* indigo — crest ~65% up (low), arriving around 58% across and running off the
|
|
112
|
+
* right edge to fill the bottom-right corner;
|
|
113
|
+
* cyan — the bright front hill: crest ~55% up just past mid-width, then falling
|
|
114
|
+
* back to the bottom around 86% so it overlaps the indigo layer.
|
|
60
115
|
*/
|
|
61
116
|
shape: string;
|
|
62
|
-
/** Vertical shading
|
|
117
|
+
/** Vertical shading inside the hill, so each layer deepens toward its base. */
|
|
63
118
|
fill: string;
|
|
64
119
|
}
|
|
65
120
|
|
|
66
|
-
/**
|
|
67
|
-
* Back to front, crests quoted as a share of the card height. The band occupies only
|
|
68
|
-
* the bottom ~55-60% and the top-right keeps its warm glow.
|
|
69
|
-
* violet: crest ~42%, peaking around three-quarters of the width — the main hill.
|
|
70
|
-
* indigo: crest ~30% at the far right, so the glyph sits on saturated violet.
|
|
71
|
-
* cyan: crest ~62%, drawn last, the bright front hill along the lower-left.
|
|
72
|
-
*/
|
|
73
121
|
const HILLS: Hill[] = [
|
|
74
122
|
{
|
|
75
123
|
id: "violet",
|
|
76
|
-
shape: "radial-gradient(
|
|
77
|
-
fill: "linear-gradient(
|
|
124
|
+
shape: "radial-gradient(44% 185% at 66% 230%, black 0 99%, transparent 100%)",
|
|
125
|
+
fill: "linear-gradient(to bottom, var(--color-promo-hill-mid) 0%, var(--color-promo-hill-mid-deep) 100%)",
|
|
78
126
|
},
|
|
79
127
|
{
|
|
80
128
|
id: "indigo",
|
|
81
|
-
shape: "radial-gradient(
|
|
82
|
-
fill: "linear-gradient(
|
|
129
|
+
shape: "radial-gradient(36% 185% at 92% 250%, black 0 99%, transparent 100%)",
|
|
130
|
+
fill: "linear-gradient(to bottom, var(--color-promo-hill-back) 0%, var(--color-promo-hill-back-deep) 100%)",
|
|
83
131
|
},
|
|
84
132
|
{
|
|
85
133
|
id: "cyan",
|
|
86
|
-
shape: "radial-gradient(
|
|
87
|
-
fill: "linear-gradient(to bottom, var(--color-promo-hill-front) 0%, var(--color-promo-hill-front-deep)
|
|
134
|
+
shape: "radial-gradient(32% 175% at 56% 230%, black 0 99%, transparent 100%)",
|
|
135
|
+
fill: "linear-gradient(to bottom, var(--color-promo-hill-front) 0%, var(--color-promo-hill-front-deep) 100%)",
|
|
88
136
|
},
|
|
89
137
|
];
|
|
90
138
|
|
|
91
139
|
export const AnnouncementCard = React.forwardRef<HTMLAnchorElement, AnnouncementCardProps>(
|
|
92
|
-
({ eyebrow, title, subtitle, variant = "default", icon, href = "#", onClick, className }, ref) => {
|
|
140
|
+
({ eyebrow, title, subtitle, variant = "default", icon, artwork, href = "#", onClick, className }, ref) => {
|
|
93
141
|
const handleClick = (event: React.MouseEvent<HTMLAnchorElement>) => {
|
|
94
142
|
if (onClick) {
|
|
95
143
|
event.preventDefault();
|
|
@@ -98,6 +146,9 @@ export const AnnouncementCard = React.forwardRef<HTMLAnchorElement, Announcement
|
|
|
98
146
|
};
|
|
99
147
|
|
|
100
148
|
if (variant === "promo") {
|
|
149
|
+
/** The consumer supplies art, so the built-in illustration stands down entirely. */
|
|
150
|
+
const hasArtwork = artwork !== undefined && artwork !== null && artwork !== false;
|
|
151
|
+
|
|
101
152
|
return (
|
|
102
153
|
<a
|
|
103
154
|
ref={ref}
|
|
@@ -108,56 +159,83 @@ export const AnnouncementCard = React.forwardRef<HTMLAnchorElement, Announcement
|
|
|
108
159
|
cardBase,
|
|
109
160
|
// Flat in the flow: no lift, no shadow escalation, so the card can never
|
|
110
161
|
// ride up over the nav rows above it. Hover is a hairline emphasis only.
|
|
111
|
-
"items-center gap-
|
|
162
|
+
"min-h-[5rem] items-center gap-xs bg-canvas py-base pl-base pr-xs",
|
|
112
163
|
"hover:border-hairline-strong",
|
|
113
164
|
className,
|
|
114
165
|
)}
|
|
115
166
|
>
|
|
116
|
-
{
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
167
|
+
{hasArtwork ? (
|
|
168
|
+
/* Artwork slot. The card owns the box (right-anchored, full height, ~70%
|
|
169
|
+
wide, frozen to the card radius by the root's `overflow-hidden`, and
|
|
170
|
+
masked so it fades to the card surface toward the left); the consumer
|
|
171
|
+
owns every pixel inside it. Sits between the card surface and the copy. */
|
|
172
|
+
<span
|
|
173
|
+
aria-hidden="true"
|
|
174
|
+
className="pointer-events-none absolute inset-0"
|
|
175
|
+
style={{ maskImage: ARTWORK_FADE, WebkitMaskImage: ARTWORK_FADE }}
|
|
176
|
+
>
|
|
125
177
|
<span
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
178
|
+
className="pointer-events-none absolute inset-y-0 right-0"
|
|
179
|
+
style={{ width: ARTWORK_WIDTH }}
|
|
180
|
+
>
|
|
181
|
+
{artwork}
|
|
182
|
+
</span>
|
|
183
|
+
</span>
|
|
184
|
+
) : (
|
|
185
|
+
/* Decorative illustration only: warm wash, upper bloom, corner, then the hills. */
|
|
186
|
+
<span aria-hidden="true" className="pointer-events-none absolute inset-0">
|
|
187
|
+
<span className="absolute inset-0" style={{ backgroundImage: WASH }} />
|
|
188
|
+
<span className="absolute inset-0" style={{ backgroundImage: WARM_BLOOM }} />
|
|
189
|
+
<span className="absolute inset-0" style={{ backgroundImage: CORNER }} />
|
|
190
|
+
{HILLS.map((hill) => (
|
|
191
|
+
<span
|
|
192
|
+
key={hill.id}
|
|
193
|
+
className="absolute inset-0"
|
|
194
|
+
style={{
|
|
195
|
+
maskImage: HILL_LEFT_FADE,
|
|
196
|
+
WebkitMaskImage: HILL_LEFT_FADE,
|
|
197
|
+
}}
|
|
198
|
+
>
|
|
199
|
+
<span
|
|
200
|
+
className="absolute inset-0"
|
|
201
|
+
style={{
|
|
202
|
+
backgroundImage: hill.fill,
|
|
203
|
+
maskImage: hill.shape,
|
|
204
|
+
WebkitMaskImage: hill.shape,
|
|
205
|
+
}}
|
|
206
|
+
/>
|
|
207
|
+
</span>
|
|
208
|
+
))}
|
|
209
|
+
</span>
|
|
210
|
+
)}
|
|
136
211
|
|
|
137
|
-
<span className="relative flex min-w-0 flex-1 flex-col gap-
|
|
212
|
+
<span className="relative flex min-w-0 flex-1 flex-col gap-xxs">
|
|
138
213
|
{/* Near-black on the light card, near-white on the dark one — `ink` flips
|
|
139
214
|
with the theme, so no `dark:` override is needed for the title. */}
|
|
140
|
-
<span className="truncate text-
|
|
215
|
+
<span className="truncate text-heading-sm font-weight-heading-md text-ink">
|
|
216
|
+
{title}
|
|
217
|
+
</span>
|
|
141
218
|
{/* Same `ink` as the title, knocked back with element opacity rather than a
|
|
142
|
-
muted color:
|
|
143
|
-
as soft white in dark mode. Never `text-muted` — that washes out
|
|
219
|
+
muted color: 70% of ink still reads clearly dark in light mode, 80%
|
|
220
|
+
reads as soft white in dark mode. Never `text-muted` — that washes out
|
|
221
|
+
here. */}
|
|
144
222
|
{subtitle && (
|
|
145
|
-
<span className="truncate text-
|
|
223
|
+
<span className="truncate text-body-sm text-ink opacity-70 dark:opacity-80">
|
|
146
224
|
{subtitle}
|
|
147
225
|
</span>
|
|
148
226
|
)}
|
|
149
227
|
</span>
|
|
150
228
|
|
|
151
229
|
{icon && (
|
|
152
|
-
//
|
|
153
|
-
//
|
|
154
|
-
//
|
|
230
|
+
// White in every case: over the consumer's coloured artwork, and over the
|
|
231
|
+
// saturated violet end of the built-in hills. `promo-crown` is white in
|
|
232
|
+
// both themes, so the glyph never picks up the theme ink.
|
|
155
233
|
<Icon
|
|
156
234
|
name={icon}
|
|
157
|
-
size={
|
|
235
|
+
size={24}
|
|
158
236
|
strokeWidth={2}
|
|
159
|
-
|
|
160
|
-
|
|
237
|
+
className="relative shrink-0"
|
|
238
|
+
style={{ color: "var(--color-promo-crown)" }}
|
|
161
239
|
/>
|
|
162
240
|
)}
|
|
163
241
|
</a>
|
|
@@ -1,17 +1,49 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { AnnouncementCard } from "./AnnouncementCard";
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Stand-ins for what a consumer app drops into the `artwork` slot. Nothing here ships
|
|
6
|
+
* with the atom — the card only owns the box the art is clipped and masked into.
|
|
7
|
+
*/
|
|
8
|
+
const GradientArt = () => (
|
|
9
|
+
<div
|
|
10
|
+
className="h-full w-full"
|
|
11
|
+
style={{
|
|
12
|
+
backgroundImage:
|
|
13
|
+
"linear-gradient(135deg, var(--color-promo-glow) 0%, var(--color-promo-glow-pink) 46%, var(--color-promo-violet) 100%)",
|
|
14
|
+
}}
|
|
15
|
+
/>
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
const LayeredArt = () => (
|
|
19
|
+
<div
|
|
20
|
+
className="h-full w-full"
|
|
21
|
+
style={{
|
|
22
|
+
backgroundImage: [
|
|
23
|
+
"radial-gradient(120% 130% at 100% 120%, var(--color-promo-hill-mid-deep) 0%, transparent 62%)",
|
|
24
|
+
"radial-gradient(90% 90% at 30% 110%, var(--color-promo-hill-front) 0%, transparent 70%)",
|
|
25
|
+
"linear-gradient(160deg, var(--color-promo-sky) 0%, var(--color-promo-glow-pink) 100%)",
|
|
26
|
+
].join(", "),
|
|
27
|
+
}}
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
30
|
+
|
|
4
31
|
export default function Preview() {
|
|
5
32
|
const [clicks, setClicks] = React.useState(0);
|
|
33
|
+
const bump = () => setClicks((n) => n + 1);
|
|
6
34
|
|
|
7
35
|
return (
|
|
8
36
|
<div className="w-full max-w-3xl mx-auto p-lg space-y-lg bg-canvas">
|
|
9
37
|
<div className="space-y-sm">
|
|
10
38
|
<p className="text-caption text-muted">
|
|
11
|
-
Promo in the rail —
|
|
39
|
+
Promo in the rail — full-bleed wash, hills overlapping on the right
|
|
12
40
|
</p>
|
|
13
|
-
{/* Rail frame only
|
|
14
|
-
|
|
41
|
+
{/* Rail frame only, so the card is judged at its real sidebar size:
|
|
42
|
+
a 224px card inside the 256px rail. */}
|
|
43
|
+
<div
|
|
44
|
+
className="space-y-sm rounded-lg border border-hairline-soft p-base"
|
|
45
|
+
style={{ width: "256px" }}
|
|
46
|
+
>
|
|
15
47
|
<AnnouncementCard
|
|
16
48
|
variant="promo"
|
|
17
49
|
eyebrow="Plan"
|
|
@@ -19,7 +51,7 @@ export default function Preview() {
|
|
|
19
51
|
subtitle="Unlock more features"
|
|
20
52
|
icon="crown"
|
|
21
53
|
href="#upgrade"
|
|
22
|
-
onClick={
|
|
54
|
+
onClick={bump}
|
|
23
55
|
/>
|
|
24
56
|
<AnnouncementCard
|
|
25
57
|
variant="promo"
|
|
@@ -28,32 +60,64 @@ export default function Preview() {
|
|
|
28
60
|
subtitle="Top up when you run low"
|
|
29
61
|
icon="zap"
|
|
30
62
|
href="#credits"
|
|
31
|
-
onClick={
|
|
63
|
+
onClick={bump}
|
|
32
64
|
/>
|
|
33
65
|
</div>
|
|
34
66
|
<p className="text-caption text-muted">Click handled: {clicks}</p>
|
|
35
67
|
</div>
|
|
36
68
|
|
|
37
69
|
<div className="space-y-sm">
|
|
38
|
-
<p className="text-caption text-muted">
|
|
70
|
+
<p className="text-caption text-muted">
|
|
71
|
+
Artwork slot at full width — the built-in illustration is not rendered
|
|
72
|
+
</p>
|
|
73
|
+
<AnnouncementCard
|
|
74
|
+
variant="promo"
|
|
75
|
+
eyebrow="Plan"
|
|
76
|
+
title="Upgrade to Pro"
|
|
77
|
+
subtitle="Unlock more features"
|
|
78
|
+
icon="crown"
|
|
79
|
+
artwork={<GradientArt />}
|
|
80
|
+
href="#upgrade"
|
|
81
|
+
onClick={bump}
|
|
82
|
+
/>
|
|
39
83
|
<AnnouncementCard
|
|
40
84
|
variant="promo"
|
|
41
85
|
eyebrow="Plan"
|
|
42
86
|
title="Upgrade to Pro"
|
|
43
87
|
subtitle="Unlock more features"
|
|
44
88
|
icon="crown"
|
|
89
|
+
artwork={<LayeredArt />}
|
|
45
90
|
href="#upgrade"
|
|
46
|
-
onClick={
|
|
91
|
+
onClick={bump}
|
|
47
92
|
/>
|
|
48
93
|
</div>
|
|
49
94
|
|
|
95
|
+
<div className="space-y-sm">
|
|
96
|
+
<p className="text-caption text-muted">Artwork slot in the rail</p>
|
|
97
|
+
<div
|
|
98
|
+
className="rounded-lg border border-hairline-soft p-base"
|
|
99
|
+
style={{ width: "256px" }}
|
|
100
|
+
>
|
|
101
|
+
<AnnouncementCard
|
|
102
|
+
variant="promo"
|
|
103
|
+
eyebrow="Plan"
|
|
104
|
+
title="Upgrade to Pro"
|
|
105
|
+
subtitle="Unlock more features"
|
|
106
|
+
icon="crown"
|
|
107
|
+
artwork={<GradientArt />}
|
|
108
|
+
href="#upgrade"
|
|
109
|
+
onClick={bump}
|
|
110
|
+
/>
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
113
|
+
|
|
50
114
|
<div className="space-y-sm">
|
|
51
115
|
<p className="text-caption text-muted">Default — what's new card, unchanged</p>
|
|
52
116
|
<AnnouncementCard
|
|
53
117
|
eyebrow="What's new"
|
|
54
118
|
title="Projects are now shareable"
|
|
55
119
|
href="#whats-new"
|
|
56
|
-
onClick={
|
|
120
|
+
onClick={bump}
|
|
57
121
|
/>
|
|
58
122
|
</div>
|
|
59
123
|
</div>
|
|
@@ -23,6 +23,10 @@ export interface SidebarSection {
|
|
|
23
23
|
items: SidebarLink[];
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
/**
|
|
27
|
+
* The same announcement shape in both placements, so one object feeds the rail and the
|
|
28
|
+
* drawer. Includes the promo `artwork` slot (see `SidebarDesktopAnnouncement.artwork`).
|
|
29
|
+
*/
|
|
26
30
|
export type SidebarAnnouncement = SidebarDesktopAnnouncement;
|
|
27
31
|
|
|
28
32
|
export interface SidebarProps {
|
|
@@ -56,6 +60,12 @@ export interface SidebarProps {
|
|
|
56
60
|
/**
|
|
57
61
|
* Card above the footer: a plain "what's new" note, or a `variant="promo"`
|
|
58
62
|
* upgrade card with illustration, subtitle, glyph, and an `onClick` action.
|
|
63
|
+
*
|
|
64
|
+
* The promo variant also takes an `artwork` slot (`React.ReactNode`). The card owns
|
|
65
|
+
* the box — anchored right, full card height, about two thirds of the width, clipped
|
|
66
|
+
* to the card radius and faded into the card surface toward the left — and you own
|
|
67
|
+
* whatever renders inside it. Supplying it replaces the built-in hills/glow art, and
|
|
68
|
+
* the card just forwards the node to both placements.
|
|
59
69
|
*/
|
|
60
70
|
announcement?: SidebarAnnouncement;
|
|
61
71
|
userName?: string;
|
|
@@ -42,6 +42,13 @@ export interface SidebarDesktopAnnouncement {
|
|
|
42
42
|
subtitle?: string;
|
|
43
43
|
/** Large glyph drawn over the illustration. Promo only. */
|
|
44
44
|
icon?: IconName;
|
|
45
|
+
/**
|
|
46
|
+
* Artwork slot. Promo only. The card owns the box (right-anchored, full card
|
|
47
|
+
* height, ~70% of the card width, clipped to the card radius, fading into the card
|
|
48
|
+
* surface over the left third); the app owns whatever is inside it. When supplied,
|
|
49
|
+
* the card's built-in illustration is not rendered at all.
|
|
50
|
+
*/
|
|
51
|
+
artwork?: React.ReactNode;
|
|
45
52
|
/**
|
|
46
53
|
* When supplied, a click calls it and navigation is prevented — `href` stays as
|
|
47
54
|
* the fallback for middle-click, copy-link, and open-in-new-tab.
|
|
@@ -452,6 +459,7 @@ export const SidebarDesktop = React.forwardRef<HTMLDivElement, SidebarDesktopPro
|
|
|
452
459
|
title={announcement.title}
|
|
453
460
|
subtitle={announcement.subtitle}
|
|
454
461
|
icon={announcement.icon}
|
|
462
|
+
artwork={announcement.artwork}
|
|
455
463
|
href={announcement.href}
|
|
456
464
|
onClick={announcement.onClick}
|
|
457
465
|
variant="promo"
|
|
@@ -489,7 +497,12 @@ export const SidebarDesktop = React.forwardRef<HTMLDivElement, SidebarDesktopPro
|
|
|
489
497
|
/>
|
|
490
498
|
)}
|
|
491
499
|
{showSettingsAction && (
|
|
492
|
-
<IconButton
|
|
500
|
+
<IconButton
|
|
501
|
+
icon="settings"
|
|
502
|
+
variant="ghost"
|
|
503
|
+
aria-label="Settings"
|
|
504
|
+
onClick={onSettingsClick}
|
|
505
|
+
/>
|
|
493
506
|
)}
|
|
494
507
|
</div>
|
|
495
508
|
)}
|
|
@@ -55,6 +55,20 @@ const HEADER_ACTIONS = (
|
|
|
55
55
|
</>
|
|
56
56
|
);
|
|
57
57
|
|
|
58
|
+
/**
|
|
59
|
+
* Stand-in for the app's own art, passed through the sidebar's announcement object
|
|
60
|
+
* into the card's `artwork` slot. Nothing here ships with the sidebar.
|
|
61
|
+
*/
|
|
62
|
+
const ArtGradient = () => (
|
|
63
|
+
<div
|
|
64
|
+
className="h-full w-full"
|
|
65
|
+
style={{
|
|
66
|
+
backgroundImage:
|
|
67
|
+
"linear-gradient(135deg, var(--color-promo-glow) 0%, var(--color-promo-glow-pink) 46%, var(--color-promo-violet) 100%)",
|
|
68
|
+
}}
|
|
69
|
+
/>
|
|
70
|
+
);
|
|
71
|
+
|
|
58
72
|
export default function SidebarDesktopPreview() {
|
|
59
73
|
const [collapsed, setCollapsed] = React.useState(false);
|
|
60
74
|
const [active, setActive] = React.useState("canva");
|
|
@@ -99,30 +113,62 @@ export default function SidebarDesktopPreview() {
|
|
|
99
113
|
</div>
|
|
100
114
|
|
|
101
115
|
<div className="grid w-full gap-lg md:grid-cols-2">
|
|
102
|
-
<div className="
|
|
103
|
-
<
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
116
|
+
<div className="space-y-sm">
|
|
117
|
+
<p className="text-caption text-muted">
|
|
118
|
+
Promo with the app's own `artwork` passed through the announcement object — the card's built-in
|
|
119
|
+
illustration stands down and the icon goes white over the art.
|
|
120
|
+
</p>
|
|
121
|
+
<div
|
|
122
|
+
className="w-full overflow-hidden rounded-lg border border-hairline"
|
|
123
|
+
style={{ height: "20rem" }}
|
|
124
|
+
>
|
|
125
|
+
<SidebarDesktop
|
|
126
|
+
sections={FOLDED_SECTIONS}
|
|
127
|
+
defaultExpanded={["main"]}
|
|
128
|
+
activeId="inbox"
|
|
129
|
+
userName="AS Mobbin"
|
|
130
|
+
onSettingsClick={() => setCredits((n) => n + 1)}
|
|
131
|
+
announcement={{
|
|
132
|
+
eyebrow: "Plan",
|
|
133
|
+
title: "Upgrade to Pro",
|
|
134
|
+
subtitle: "Unlock more features",
|
|
135
|
+
icon: "crown",
|
|
136
|
+
variant: "promo",
|
|
137
|
+
artwork: <ArtGradient />,
|
|
138
|
+
href: "#upgrade",
|
|
139
|
+
onClick: () => setCredits((n) => n + 1),
|
|
140
|
+
}}
|
|
141
|
+
/>
|
|
142
|
+
</div>
|
|
111
143
|
</div>
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
144
|
+
|
|
145
|
+
<div className="space-y-sm">
|
|
146
|
+
<p className="text-caption text-muted">
|
|
147
|
+
No `artwork`: the built-in rolling-hills illustration renders exactly as before.
|
|
148
|
+
</p>
|
|
149
|
+
<div
|
|
150
|
+
className="w-full overflow-hidden rounded-lg border border-hairline"
|
|
151
|
+
style={{ height: "20rem" }}
|
|
152
|
+
>
|
|
153
|
+
<SidebarDesktop
|
|
154
|
+
sections={FOLDED_SECTIONS}
|
|
155
|
+
defaultExpanded={["main"]}
|
|
156
|
+
activeId="inbox"
|
|
157
|
+
userName="AS Mobbin"
|
|
158
|
+
onSettingsClick={() => setCredits((n) => n + 1)}
|
|
159
|
+
announcement={{
|
|
160
|
+
eyebrow: "Plan",
|
|
161
|
+
title: "Upgrade to Pro",
|
|
162
|
+
subtitle: "Unlock more features",
|
|
163
|
+
icon: "crown",
|
|
164
|
+
variant: "promo",
|
|
165
|
+
href: "#upgrade",
|
|
166
|
+
onClick: () => setCredits((n) => n + 1),
|
|
167
|
+
}}
|
|
168
|
+
/>
|
|
169
|
+
</div>
|
|
120
170
|
</div>
|
|
121
171
|
</div>
|
|
122
|
-
<p className="text-body-sm text-muted">
|
|
123
|
-
Left: plain "what's new" card in flow plus a settings handler. Right: showFooter=false drops the row for
|
|
124
|
-
apps that keep those actions in the nav and account menu.
|
|
125
|
-
</p>
|
|
126
172
|
|
|
127
173
|
<div className="w-full overflow-hidden rounded-lg border border-hairline" style={{ height: "22rem" }}>
|
|
128
174
|
<SidebarDesktop
|
|
@@ -35,13 +35,20 @@ export interface SidebarMobileAnnouncement {
|
|
|
35
35
|
href?: string;
|
|
36
36
|
/**
|
|
37
37
|
* `"default"` is the plain "what's new" card. `"promo"` is the taller upgrade
|
|
38
|
-
* card with the layered rolling-hills illustration.
|
|
38
|
+
* card with either the layered rolling-hills illustration or your own artwork.
|
|
39
39
|
*/
|
|
40
40
|
variant?: "default" | "promo";
|
|
41
41
|
/** Secondary line under the title. Promo only. */
|
|
42
42
|
subtitle?: string;
|
|
43
|
-
/** Large glyph drawn over the
|
|
43
|
+
/** Large glyph drawn over the art area. Promo only. */
|
|
44
44
|
icon?: IconName;
|
|
45
|
+
/**
|
|
46
|
+
* Promo only. Your own art for the right-hand panel of the card. The card owns the
|
|
47
|
+
* box (anchored right, full height, about two thirds wide, clipped to the radius,
|
|
48
|
+
* faded into the surface toward the left); you own what is inside it. Supplying it
|
|
49
|
+
* replaces the built-in hills/glow illustration.
|
|
50
|
+
*/
|
|
51
|
+
artwork?: React.ReactNode;
|
|
45
52
|
/**
|
|
46
53
|
* When supplied, a click calls it and navigation is prevented — `href` stays as
|
|
47
54
|
* the fallback for middle-click, copy-link, and open-in-new-tab.
|
|
@@ -398,6 +405,7 @@ export const SidebarMobile = React.forwardRef<HTMLDivElement, SidebarMobileProps
|
|
|
398
405
|
title={announcement.title}
|
|
399
406
|
subtitle={announcement.subtitle}
|
|
400
407
|
icon={announcement.icon}
|
|
408
|
+
artwork={announcement.artwork}
|
|
401
409
|
href={announcement.href}
|
|
402
410
|
onClick={announcement.onClick}
|
|
403
411
|
variant="promo"
|
package/src/tokens.css
CHANGED
|
@@ -34,16 +34,17 @@
|
|
|
34
34
|
--color-link-blue: #5E6AD2;
|
|
35
35
|
--color-focus-blue: #5E6AD2;
|
|
36
36
|
--color-scrim: #000000;
|
|
37
|
-
--color-promo-sky: #
|
|
38
|
-
--color-promo-violet: #
|
|
39
|
-
--color-promo-glow: #
|
|
40
|
-
--color-promo-hill-front: #
|
|
41
|
-
--color-promo-hill-front-deep: #
|
|
42
|
-
--color-promo-hill-mid: #
|
|
43
|
-
--color-promo-hill-mid-deep: #
|
|
44
|
-
--color-promo-hill-back: #
|
|
45
|
-
--color-promo-hill-back-deep: #
|
|
46
|
-
--color-promo-glow-pink: #
|
|
37
|
+
--color-promo-sky: #7DD3FC;
|
|
38
|
+
--color-promo-violet: #7C3AED;
|
|
39
|
+
--color-promo-glow: #FFD0A6;
|
|
40
|
+
--color-promo-hill-front: #7DD3FC;
|
|
41
|
+
--color-promo-hill-front-deep: #3B82F6;
|
|
42
|
+
--color-promo-hill-mid: #A78BFA;
|
|
43
|
+
--color-promo-hill-mid-deep: #7C3AED;
|
|
44
|
+
--color-promo-hill-back: #6D28D9;
|
|
45
|
+
--color-promo-hill-back-deep: #4C1D95;
|
|
46
|
+
--color-promo-glow-pink: #EE7BC4;
|
|
47
|
+
--color-promo-crown: #FFFFFF;
|
|
47
48
|
--font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
|
|
48
49
|
--font-heading: var(--font-body);
|
|
49
50
|
--font-display-lg: var(--font-body);
|