@designa8/vibedesign-linear-internal-v1-b737 0.15.0 → 0.15.2
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 +62 -24
- package/dist/index.js +62 -24
- package/dist/styles.css +1 -0
- package/package.json +1 -1
- package/src/atoms/AnnouncementCard/AnnouncementCard.tsx +68 -25
- package/src/atoms/AnnouncementCard/preview.tsx +65 -5
- 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/organisms/SidebarMobile/preview.tsx +28 -13
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.15.
|
|
3
|
+
Complete design system generated by Atoms Design, version **0.15.2**.
|
|
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
|
@@ -323,6 +323,8 @@ var WASH = [
|
|
|
323
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
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
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%";
|
|
326
328
|
var HILLS = [
|
|
327
329
|
{
|
|
328
330
|
id: "violet",
|
|
@@ -341,7 +343,7 @@ var HILLS = [
|
|
|
341
343
|
}
|
|
342
344
|
];
|
|
343
345
|
var AnnouncementCard = React2.forwardRef(
|
|
344
|
-
({ eyebrow, title, subtitle, variant = "default", icon, href = "#", onClick, className }, ref) => {
|
|
346
|
+
({ eyebrow, title, subtitle, variant = "default", icon, artwork, href = "#", onClick, className }, ref) => {
|
|
345
347
|
const handleClick = (event) => {
|
|
346
348
|
if (onClick) {
|
|
347
349
|
event.preventDefault();
|
|
@@ -349,6 +351,7 @@ var AnnouncementCard = React2.forwardRef(
|
|
|
349
351
|
}
|
|
350
352
|
};
|
|
351
353
|
if (variant === "promo") {
|
|
354
|
+
const hasArtwork = artwork !== void 0 && artwork !== null && artwork !== false;
|
|
352
355
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
353
356
|
"a",
|
|
354
357
|
{
|
|
@@ -365,39 +368,64 @@ var AnnouncementCard = React2.forwardRef(
|
|
|
365
368
|
className
|
|
366
369
|
),
|
|
367
370
|
children: [
|
|
368
|
-
|
|
369
|
-
/*
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
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)(
|
|
373
377
|
"span",
|
|
374
378
|
{
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
WebkitMaskImage: HILL_LEFT_FADE
|
|
379
|
-
},
|
|
379
|
+
"aria-hidden": "true",
|
|
380
|
+
className: "pointer-events-none absolute inset-0",
|
|
381
|
+
style: { maskImage: ARTWORK_FADE, WebkitMaskImage: ARTWORK_FADE },
|
|
380
382
|
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
381
383
|
"span",
|
|
382
384
|
{
|
|
383
|
-
className: "absolute inset-0",
|
|
384
|
-
style: {
|
|
385
|
-
|
|
386
|
-
maskImage: hill.shape,
|
|
387
|
-
WebkitMaskImage: hill.shape
|
|
388
|
-
}
|
|
385
|
+
className: "pointer-events-none absolute inset-y-0 right-0",
|
|
386
|
+
style: { width: ARTWORK_WIDTH },
|
|
387
|
+
children: artwork
|
|
389
388
|
}
|
|
390
389
|
)
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
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
|
|
405
|
+
},
|
|
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
|
+
] })
|
|
421
|
+
),
|
|
395
422
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: "relative flex min-w-0 flex-1 flex-col gap-xxs", children: [
|
|
396
423
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "truncate text-heading-sm font-weight-heading-md text-ink", children: title }),
|
|
397
424
|
subtitle && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "truncate text-body-sm text-ink opacity-70 dark:opacity-80", children: subtitle })
|
|
398
425
|
] }),
|
|
399
|
-
icon && //
|
|
400
|
-
//
|
|
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.
|
|
401
429
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
402
430
|
Icon,
|
|
403
431
|
{
|
|
@@ -12097,6 +12125,7 @@ var SidebarDesktop = React92.forwardRef(
|
|
|
12097
12125
|
title: announcement.title,
|
|
12098
12126
|
subtitle: announcement.subtitle,
|
|
12099
12127
|
icon: announcement.icon,
|
|
12128
|
+
artwork: announcement.artwork,
|
|
12100
12129
|
href: announcement.href,
|
|
12101
12130
|
onClick: announcement.onClick,
|
|
12102
12131
|
variant: "promo"
|
|
@@ -12131,7 +12160,15 @@ var SidebarDesktop = React92.forwardRef(
|
|
|
12131
12160
|
onClick: onHelpClick
|
|
12132
12161
|
}
|
|
12133
12162
|
),
|
|
12134
|
-
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
|
+
)
|
|
12135
12172
|
] })
|
|
12136
12173
|
]
|
|
12137
12174
|
}
|
|
@@ -12400,6 +12437,7 @@ var SidebarMobile = React93.forwardRef(
|
|
|
12400
12437
|
title: announcement.title,
|
|
12401
12438
|
subtitle: announcement.subtitle,
|
|
12402
12439
|
icon: announcement.icon,
|
|
12440
|
+
artwork: announcement.artwork,
|
|
12403
12441
|
href: announcement.href,
|
|
12404
12442
|
onClick: announcement.onClick,
|
|
12405
12443
|
variant: "promo"
|
package/dist/index.js
CHANGED
|
@@ -177,6 +177,8 @@ var WASH = [
|
|
|
177
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
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
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%";
|
|
180
182
|
var HILLS = [
|
|
181
183
|
{
|
|
182
184
|
id: "violet",
|
|
@@ -195,7 +197,7 @@ var HILLS = [
|
|
|
195
197
|
}
|
|
196
198
|
];
|
|
197
199
|
var AnnouncementCard = React2.forwardRef(
|
|
198
|
-
({ eyebrow, title, subtitle, variant = "default", icon, href = "#", onClick, className }, ref) => {
|
|
200
|
+
({ eyebrow, title, subtitle, variant = "default", icon, artwork, href = "#", onClick, className }, ref) => {
|
|
199
201
|
const handleClick = (event) => {
|
|
200
202
|
if (onClick) {
|
|
201
203
|
event.preventDefault();
|
|
@@ -203,6 +205,7 @@ var AnnouncementCard = React2.forwardRef(
|
|
|
203
205
|
}
|
|
204
206
|
};
|
|
205
207
|
if (variant === "promo") {
|
|
208
|
+
const hasArtwork = artwork !== void 0 && artwork !== null && artwork !== false;
|
|
206
209
|
return /* @__PURE__ */ jsxs(
|
|
207
210
|
"a",
|
|
208
211
|
{
|
|
@@ -219,39 +222,64 @@ var AnnouncementCard = React2.forwardRef(
|
|
|
219
222
|
className
|
|
220
223
|
),
|
|
221
224
|
children: [
|
|
222
|
-
|
|
223
|
-
/*
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
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(
|
|
227
231
|
"span",
|
|
228
232
|
{
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
WebkitMaskImage: HILL_LEFT_FADE
|
|
233
|
-
},
|
|
233
|
+
"aria-hidden": "true",
|
|
234
|
+
className: "pointer-events-none absolute inset-0",
|
|
235
|
+
style: { maskImage: ARTWORK_FADE, WebkitMaskImage: ARTWORK_FADE },
|
|
234
236
|
children: /* @__PURE__ */ jsx2(
|
|
235
237
|
"span",
|
|
236
238
|
{
|
|
237
|
-
className: "absolute inset-0",
|
|
238
|
-
style: {
|
|
239
|
-
|
|
240
|
-
maskImage: hill.shape,
|
|
241
|
-
WebkitMaskImage: hill.shape
|
|
242
|
-
}
|
|
239
|
+
className: "pointer-events-none absolute inset-y-0 right-0",
|
|
240
|
+
style: { width: ARTWORK_WIDTH },
|
|
241
|
+
children: artwork
|
|
243
242
|
}
|
|
244
243
|
)
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
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
|
|
259
|
+
},
|
|
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
|
+
] })
|
|
275
|
+
),
|
|
249
276
|
/* @__PURE__ */ jsxs("span", { className: "relative flex min-w-0 flex-1 flex-col gap-xxs", children: [
|
|
250
277
|
/* @__PURE__ */ jsx2("span", { className: "truncate text-heading-sm font-weight-heading-md text-ink", children: title }),
|
|
251
278
|
subtitle && /* @__PURE__ */ jsx2("span", { className: "truncate text-body-sm text-ink opacity-70 dark:opacity-80", children: subtitle })
|
|
252
279
|
] }),
|
|
253
|
-
icon && //
|
|
254
|
-
//
|
|
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.
|
|
255
283
|
/* @__PURE__ */ jsx2(
|
|
256
284
|
Icon,
|
|
257
285
|
{
|
|
@@ -11951,6 +11979,7 @@ var SidebarDesktop = React92.forwardRef(
|
|
|
11951
11979
|
title: announcement.title,
|
|
11952
11980
|
subtitle: announcement.subtitle,
|
|
11953
11981
|
icon: announcement.icon,
|
|
11982
|
+
artwork: announcement.artwork,
|
|
11954
11983
|
href: announcement.href,
|
|
11955
11984
|
onClick: announcement.onClick,
|
|
11956
11985
|
variant: "promo"
|
|
@@ -11985,7 +12014,15 @@ var SidebarDesktop = React92.forwardRef(
|
|
|
11985
12014
|
onClick: onHelpClick
|
|
11986
12015
|
}
|
|
11987
12016
|
),
|
|
11988
|
-
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
|
+
)
|
|
11989
12026
|
] })
|
|
11990
12027
|
]
|
|
11991
12028
|
}
|
|
@@ -12254,6 +12291,7 @@ var SidebarMobile = React93.forwardRef(
|
|
|
12254
12291
|
title: announcement.title,
|
|
12255
12292
|
subtitle: announcement.subtitle,
|
|
12256
12293
|
icon: announcement.icon,
|
|
12294
|
+
artwork: announcement.artwork,
|
|
12257
12295
|
href: announcement.href,
|
|
12258
12296
|
onClick: announcement.onClick,
|
|
12259
12297
|
variant: "promo"
|
package/dist/styles.css
CHANGED
package/package.json
CHANGED
|
@@ -14,11 +14,19 @@ export interface AnnouncementCardProps {
|
|
|
14
14
|
*/
|
|
15
15
|
variant?: "default" | "promo";
|
|
16
16
|
/**
|
|
17
|
-
* Glyph drawn over the illustration. Promo only.
|
|
18
|
-
*
|
|
19
|
-
*
|
|
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`.
|
|
20
20
|
*/
|
|
21
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;
|
|
22
30
|
/** Destination. Used as the fallback when `onClick` is not supplied. */
|
|
23
31
|
href?: string;
|
|
24
32
|
/**
|
|
@@ -75,6 +83,18 @@ const CORNER =
|
|
|
75
83
|
*/
|
|
76
84
|
const HILL_LEFT_FADE = "linear-gradient(to right, transparent 18%, black 46%)";
|
|
77
85
|
|
|
86
|
+
/**
|
|
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.
|
|
91
|
+
*/
|
|
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%";
|
|
97
|
+
|
|
78
98
|
interface Hill {
|
|
79
99
|
id: string;
|
|
80
100
|
/**
|
|
@@ -117,7 +137,7 @@ const HILLS: Hill[] = [
|
|
|
117
137
|
];
|
|
118
138
|
|
|
119
139
|
export const AnnouncementCard = React.forwardRef<HTMLAnchorElement, AnnouncementCardProps>(
|
|
120
|
-
({ eyebrow, title, subtitle, variant = "default", icon, href = "#", onClick, className }, ref) => {
|
|
140
|
+
({ eyebrow, title, subtitle, variant = "default", icon, artwork, href = "#", onClick, className }, ref) => {
|
|
121
141
|
const handleClick = (event: React.MouseEvent<HTMLAnchorElement>) => {
|
|
122
142
|
if (onClick) {
|
|
123
143
|
event.preventDefault();
|
|
@@ -126,6 +146,9 @@ export const AnnouncementCard = React.forwardRef<HTMLAnchorElement, Announcement
|
|
|
126
146
|
};
|
|
127
147
|
|
|
128
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
|
+
|
|
129
152
|
return (
|
|
130
153
|
<a
|
|
131
154
|
ref={ref}
|
|
@@ -141,31 +164,50 @@ export const AnnouncementCard = React.forwardRef<HTMLAnchorElement, Announcement
|
|
|
141
164
|
className,
|
|
142
165
|
)}
|
|
143
166
|
>
|
|
144
|
-
{
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
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
|
+
>
|
|
150
177
|
<span
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
style={{
|
|
154
|
-
maskImage: HILL_LEFT_FADE,
|
|
155
|
-
WebkitMaskImage: HILL_LEFT_FADE,
|
|
156
|
-
}}
|
|
178
|
+
className="pointer-events-none absolute inset-y-0 right-0"
|
|
179
|
+
style={{ width: ARTWORK_WIDTH }}
|
|
157
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) => (
|
|
158
191
|
<span
|
|
192
|
+
key={hill.id}
|
|
159
193
|
className="absolute inset-0"
|
|
160
194
|
style={{
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
WebkitMaskImage: hill.shape,
|
|
195
|
+
maskImage: HILL_LEFT_FADE,
|
|
196
|
+
WebkitMaskImage: HILL_LEFT_FADE,
|
|
164
197
|
}}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
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
|
+
)}
|
|
169
211
|
|
|
170
212
|
<span className="relative flex min-w-0 flex-1 flex-col gap-xxs">
|
|
171
213
|
{/* Near-black on the light card, near-white on the dark one — `ink` flips
|
|
@@ -185,8 +227,9 @@ export const AnnouncementCard = React.forwardRef<HTMLAnchorElement, Announcement
|
|
|
185
227
|
</span>
|
|
186
228
|
|
|
187
229
|
{icon && (
|
|
188
|
-
//
|
|
189
|
-
//
|
|
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.
|
|
190
233
|
<Icon
|
|
191
234
|
name={icon}
|
|
192
235
|
size={24}
|
|
@@ -1,8 +1,36 @@
|
|
|
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">
|
|
@@ -23,7 +51,7 @@ export default function Preview() {
|
|
|
23
51
|
subtitle="Unlock more features"
|
|
24
52
|
icon="crown"
|
|
25
53
|
href="#upgrade"
|
|
26
|
-
onClick={
|
|
54
|
+
onClick={bump}
|
|
27
55
|
/>
|
|
28
56
|
<AnnouncementCard
|
|
29
57
|
variant="promo"
|
|
@@ -32,32 +60,64 @@ export default function Preview() {
|
|
|
32
60
|
subtitle="Top up when you run low"
|
|
33
61
|
icon="zap"
|
|
34
62
|
href="#credits"
|
|
35
|
-
onClick={
|
|
63
|
+
onClick={bump}
|
|
36
64
|
/>
|
|
37
65
|
</div>
|
|
38
66
|
<p className="text-caption text-muted">Click handled: {clicks}</p>
|
|
39
67
|
</div>
|
|
40
68
|
|
|
41
69
|
<div className="space-y-sm">
|
|
42
|
-
<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
|
+
/>
|
|
43
83
|
<AnnouncementCard
|
|
44
84
|
variant="promo"
|
|
45
85
|
eyebrow="Plan"
|
|
46
86
|
title="Upgrade to Pro"
|
|
47
87
|
subtitle="Unlock more features"
|
|
48
88
|
icon="crown"
|
|
89
|
+
artwork={<LayeredArt />}
|
|
49
90
|
href="#upgrade"
|
|
50
|
-
onClick={
|
|
91
|
+
onClick={bump}
|
|
51
92
|
/>
|
|
52
93
|
</div>
|
|
53
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
|
+
|
|
54
114
|
<div className="space-y-sm">
|
|
55
115
|
<p className="text-caption text-muted">Default — what's new card, unchanged</p>
|
|
56
116
|
<AnnouncementCard
|
|
57
117
|
eyebrow="What's new"
|
|
58
118
|
title="Projects are now shareable"
|
|
59
119
|
href="#whats-new"
|
|
60
|
-
onClick={
|
|
120
|
+
onClick={bump}
|
|
61
121
|
/>
|
|
62
122
|
</div>
|
|
63
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"
|
|
@@ -60,6 +60,20 @@ const MOBILE_ACTIONS = (
|
|
|
60
60
|
</>
|
|
61
61
|
);
|
|
62
62
|
|
|
63
|
+
/**
|
|
64
|
+
* A stand-in for what a consumer app drops into the announcement's `artwork` slot.
|
|
65
|
+
* Nothing here ships with the Sidebar — the card owns the box and the mask.
|
|
66
|
+
*/
|
|
67
|
+
const ARTWORK = (
|
|
68
|
+
<div
|
|
69
|
+
className="h-full w-full"
|
|
70
|
+
style={{
|
|
71
|
+
backgroundImage:
|
|
72
|
+
"linear-gradient(135deg, var(--color-promo-glow) 0%, var(--color-promo-glow-pink) 46%, var(--color-promo-violet) 100%)",
|
|
73
|
+
}}
|
|
74
|
+
/>
|
|
75
|
+
);
|
|
76
|
+
|
|
63
77
|
export default function SidebarMobilePreview() {
|
|
64
78
|
const [open, setOpen] = React.useState(false);
|
|
65
79
|
const [active, setActive] = React.useState("issues");
|
|
@@ -83,7 +97,16 @@ export default function SidebarMobilePreview() {
|
|
|
83
97
|
onNavigate={navigate}
|
|
84
98
|
workspaceName="AS Mobbin"
|
|
85
99
|
userName="AS Mobbin"
|
|
86
|
-
announcement={{
|
|
100
|
+
announcement={{
|
|
101
|
+
eyebrow: "Plan",
|
|
102
|
+
title: "Upgrade to Pro",
|
|
103
|
+
subtitle: "Unlock more features",
|
|
104
|
+
variant: "promo",
|
|
105
|
+
icon: "crown",
|
|
106
|
+
artwork: ARTWORK,
|
|
107
|
+
href: "#upgrade",
|
|
108
|
+
onClick: () => setUpgrades((n) => n + 1),
|
|
109
|
+
}}
|
|
87
110
|
mobileActions={MOBILE_ACTIONS}
|
|
88
111
|
onHelpClick={() => undefined}
|
|
89
112
|
onSettingsClick={() => undefined}
|
|
@@ -93,7 +116,7 @@ export default function SidebarMobilePreview() {
|
|
|
93
116
|
<div className="bg-surface p-base">
|
|
94
117
|
<h1 className="text-heading-sm text-ink">Issues</h1>
|
|
95
118
|
<p className="mt-xs text-body-sm text-muted">
|
|
96
|
-
|
|
119
|
+
The promo card takes an artwork slot ({upgrades} clicks). Open the drawer to see it above the footer.
|
|
97
120
|
</p>
|
|
98
121
|
</div>
|
|
99
122
|
</SidebarMobile>
|
|
@@ -110,21 +133,13 @@ export default function SidebarMobilePreview() {
|
|
|
110
133
|
onNavigate={navigate}
|
|
111
134
|
workspaceName="AS Mobbin"
|
|
112
135
|
userName="AS Mobbin"
|
|
113
|
-
announcement={{
|
|
114
|
-
eyebrow: "Plan",
|
|
115
|
-
title: "Upgrade to Pro",
|
|
116
|
-
subtitle: "Unlock more features",
|
|
117
|
-
variant: "promo",
|
|
118
|
-
icon: "crown",
|
|
119
|
-
href: "#upgrade",
|
|
120
|
-
onClick: () => setUpgrades((n) => n + 1),
|
|
121
|
-
}}
|
|
136
|
+
announcement={{ eyebrow: "What's new", title: "Web forms for intake requests" }}
|
|
122
137
|
onSettingsClick={() => undefined}
|
|
123
138
|
>
|
|
124
139
|
<div className="bg-surface p-base">
|
|
125
|
-
<h1 className="text-heading-sm text-ink">
|
|
140
|
+
<h1 className="text-heading-sm text-ink">Default announcement</h1>
|
|
126
141
|
<p className="mt-xs text-body-sm text-muted">
|
|
127
|
-
The
|
|
142
|
+
The plain "what's new" note is unchanged — no art area, no icon.
|
|
128
143
|
</p>
|
|
129
144
|
</div>
|
|
130
145
|
</SidebarMobile>
|