@designa8/vibedesign-joyvent-ds-v1-2-176b 0.3.23 → 0.3.24
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 +82 -176
- package/dist/index.js +82 -176
- package/dist/styles.css +0 -60
- package/package.json +1 -1
- package/src/organisms/NavbarDesktop/NavbarDesktop.tsx +114 -166
- package/src/organisms/NavbarDesktop/index.ts +1 -0
- package/src/organisms/NavbarDesktop/preview.tsx +102 -17
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @designa8/vibedesign-joyvent-ds-v1-2-176b
|
|
2
2
|
|
|
3
|
-
Complete design system generated by Atoms Design, version **0.3.
|
|
3
|
+
Complete design system generated by Atoms Design, version **0.3.24**.
|
|
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
|
@@ -12243,21 +12243,35 @@ var import_react_dom10 = require("react-dom");
|
|
|
12243
12243
|
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
12244
12244
|
var cn58 = (...parts) => parts.filter(Boolean).join(" ");
|
|
12245
12245
|
var DEFAULT_MENU_ITEMS = [
|
|
12246
|
-
{ id: "
|
|
12247
|
-
{ id: "
|
|
12248
|
-
{ id: "
|
|
12249
|
-
{
|
|
12246
|
+
{ id: "gallery-night", label: "Gallery Night", icon: "calendar" },
|
|
12247
|
+
{ id: "harbor-sound", label: "Harbor Sound Session", icon: "calendar" },
|
|
12248
|
+
{ id: "makers-market", label: "Winter Makers Market", icon: "calendar" },
|
|
12249
|
+
{
|
|
12250
|
+
id: "archive",
|
|
12251
|
+
label: "Past events",
|
|
12252
|
+
icon: "folder",
|
|
12253
|
+
separated: true,
|
|
12254
|
+
submenu: true
|
|
12255
|
+
}
|
|
12250
12256
|
];
|
|
12257
|
+
var STATUS_RECIPE = {
|
|
12258
|
+
draft: { variant: "warning", label: "Draft" },
|
|
12259
|
+
published: { variant: "success", label: "Published" },
|
|
12260
|
+
ended: { variant: "neutral", label: "Ended" }
|
|
12261
|
+
};
|
|
12251
12262
|
var PANEL_MIN_WIDTH = 288;
|
|
12252
12263
|
var MENU_ROW_CLASS2 = "cursor-pointer transition duration-150 ease-out";
|
|
12253
12264
|
var NavbarDesktop = React71.forwardRef(
|
|
12254
12265
|
({
|
|
12255
|
-
title = "
|
|
12266
|
+
title = "Rooftop Supper Club",
|
|
12256
12267
|
userName = "Sera",
|
|
12257
12268
|
menuItems = DEFAULT_MENU_ITEMS,
|
|
12258
12269
|
onMenuSelect,
|
|
12259
12270
|
defaultMenuOpen = false,
|
|
12260
|
-
|
|
12271
|
+
status = "draft",
|
|
12272
|
+
onShare,
|
|
12273
|
+
onPreview,
|
|
12274
|
+
label = "Event toolbar",
|
|
12261
12275
|
className,
|
|
12262
12276
|
...rest
|
|
12263
12277
|
}, ref) => {
|
|
@@ -12338,182 +12352,74 @@ var NavbarDesktop = React71.forwardRef(
|
|
|
12338
12352
|
choose(item.id);
|
|
12339
12353
|
}
|
|
12340
12354
|
};
|
|
12341
|
-
const
|
|
12355
|
+
const statusRecipe = STATUS_RECIPE[status];
|
|
12342
12356
|
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
|
|
12343
12357
|
"header",
|
|
12344
12358
|
{
|
|
12345
12359
|
ref,
|
|
12346
12360
|
"aria-label": label,
|
|
12347
|
-
className: cn58(
|
|
12361
|
+
className: cn58(
|
|
12362
|
+
"w-full min-w-0 border-b border-hairline bg-surface text-ink",
|
|
12363
|
+
className
|
|
12364
|
+
),
|
|
12348
12365
|
...rest,
|
|
12349
12366
|
children: [
|
|
12350
|
-
/* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
|
|
12351
|
-
"
|
|
12352
|
-
{
|
|
12353
|
-
|
|
12354
|
-
|
|
12355
|
-
|
|
12356
|
-
|
|
12357
|
-
|
|
12358
|
-
|
|
12359
|
-
|
|
12360
|
-
|
|
12361
|
-
|
|
12362
|
-
|
|
12363
|
-
|
|
12364
|
-
|
|
12365
|
-
|
|
12366
|
-
|
|
12367
|
-
|
|
12368
|
-
|
|
12369
|
-
|
|
12370
|
-
|
|
12371
|
-
|
|
12372
|
-
|
|
12373
|
-
|
|
12374
|
-
|
|
12375
|
-
|
|
12376
|
-
|
|
12377
|
-
|
|
12378
|
-
|
|
12379
|
-
|
|
12380
|
-
|
|
12381
|
-
|
|
12382
|
-
|
|
12383
|
-
|
|
12384
|
-
|
|
12385
|
-
|
|
12386
|
-
|
|
12387
|
-
|
|
12388
|
-
|
|
12389
|
-
|
|
12390
|
-
|
|
12391
|
-
|
|
12392
|
-
|
|
12393
|
-
|
|
12394
|
-
|
|
12395
|
-
|
|
12396
|
-
|
|
12397
|
-
|
|
12398
|
-
|
|
12399
|
-
|
|
12400
|
-
|
|
12401
|
-
|
|
12402
|
-
|
|
12403
|
-
|
|
12404
|
-
|
|
12405
|
-
|
|
12406
|
-
name: "chevron-down",
|
|
12407
|
-
size: 16,
|
|
12408
|
-
strokeWidth: 2,
|
|
12409
|
-
className: cn58(
|
|
12410
|
-
"transition-transform duration-200 ease-out",
|
|
12411
|
-
open && "rotate-180"
|
|
12412
|
-
)
|
|
12413
|
-
}
|
|
12414
|
-
),
|
|
12415
|
-
children: "Editing"
|
|
12416
|
-
}
|
|
12417
|
-
),
|
|
12418
|
-
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
12419
|
-
"span",
|
|
12420
|
-
{
|
|
12421
|
-
"aria-hidden": "true",
|
|
12422
|
-
className: "mx-sm h-6 w-px shrink-0 bg-brand-tile-foreground/30"
|
|
12423
|
-
}
|
|
12424
|
-
),
|
|
12425
|
-
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
12426
|
-
Button,
|
|
12427
|
-
{
|
|
12428
|
-
variant: "onBrand",
|
|
12429
|
-
shape: "square",
|
|
12430
|
-
size: "md",
|
|
12431
|
-
icon: "undo",
|
|
12432
|
-
"aria-label": "Undo",
|
|
12433
|
-
className: onBrandFocus
|
|
12434
|
-
}
|
|
12435
|
-
),
|
|
12436
|
-
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
12437
|
-
Button,
|
|
12438
|
-
{
|
|
12439
|
-
variant: "onBrand",
|
|
12440
|
-
shape: "square",
|
|
12441
|
-
size: "md",
|
|
12442
|
-
icon: "redo",
|
|
12443
|
-
"aria-label": "Redo",
|
|
12444
|
-
disabled: true,
|
|
12445
|
-
className: cn58(
|
|
12446
|
-
onBrandFocus,
|
|
12447
|
-
"disabled:bg-transparent! disabled:shadow-none"
|
|
12448
|
-
)
|
|
12449
|
-
}
|
|
12450
|
-
),
|
|
12451
|
-
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
12452
|
-
Button,
|
|
12453
|
-
{
|
|
12454
|
-
variant: "onBrand",
|
|
12455
|
-
shape: "square",
|
|
12456
|
-
size: "md",
|
|
12457
|
-
icon: "cloud-check",
|
|
12458
|
-
"aria-label": "All changes saved",
|
|
12459
|
-
className: cn58(onBrandFocus, "ml-xs")
|
|
12460
|
-
}
|
|
12461
|
-
),
|
|
12462
|
-
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { className: "flex min-w-0 flex-1 items-center justify-end pr-md", children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
12463
|
-
"span",
|
|
12464
|
-
{
|
|
12465
|
-
className: "truncate text-body-sm text-brand-tile-foreground/90",
|
|
12466
|
-
title,
|
|
12467
|
-
children: title
|
|
12468
|
-
}
|
|
12469
|
-
) }),
|
|
12470
|
-
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
12471
|
-
Avatar,
|
|
12472
|
-
{
|
|
12473
|
-
size: "sm",
|
|
12474
|
-
initials: userName.slice(0, 1).toUpperCase(),
|
|
12475
|
-
name: userName,
|
|
12476
|
-
tone: "warm",
|
|
12477
|
-
className: "mr-xs"
|
|
12478
|
-
}
|
|
12479
|
-
),
|
|
12480
|
-
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
12481
|
-
Button,
|
|
12482
|
-
{
|
|
12483
|
-
variant: "onBrandGlass",
|
|
12484
|
-
shape: "square",
|
|
12485
|
-
size: "md",
|
|
12486
|
-
icon: "chart-column",
|
|
12487
|
-
"aria-label": "Open document data",
|
|
12488
|
-
className: onBrandFocus
|
|
12489
|
-
}
|
|
12490
|
-
),
|
|
12491
|
-
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
12492
|
-
Button,
|
|
12493
|
-
{
|
|
12494
|
-
variant: "onBrandGlass",
|
|
12495
|
-
shape: "square",
|
|
12496
|
-
size: "md",
|
|
12497
|
-
icon: "message-circle",
|
|
12498
|
-
"aria-label": "Open comments",
|
|
12499
|
-
className: onBrandFocus
|
|
12500
|
-
}
|
|
12501
|
-
),
|
|
12502
|
-
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
12503
|
-
Button,
|
|
12504
|
-
{
|
|
12505
|
-
variant: "onBrandSolid",
|
|
12506
|
-
size: "md",
|
|
12507
|
-
className: cn58(
|
|
12508
|
-
onBrandFocus,
|
|
12509
|
-
"ml-xs rounded-md font-weight-label-md"
|
|
12510
|
-
),
|
|
12511
|
-
children: "Share"
|
|
12512
|
-
}
|
|
12513
|
-
)
|
|
12514
|
-
]
|
|
12515
|
-
}
|
|
12516
|
-
),
|
|
12367
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: "flex w-full min-w-0 items-center gap-md px-lg py-sm", children: [
|
|
12368
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Logo, { size: "sm", className: "shrink-0" }),
|
|
12369
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { "aria-hidden": "true", className: "h-6 w-px shrink-0 bg-hairline" }),
|
|
12370
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: "flex min-w-0 items-center gap-md", children: [
|
|
12371
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
12372
|
+
Button,
|
|
12373
|
+
{
|
|
12374
|
+
ref: triggerRef,
|
|
12375
|
+
variant: "quiet",
|
|
12376
|
+
size: "md",
|
|
12377
|
+
align: "between",
|
|
12378
|
+
"aria-haspopup": "menu",
|
|
12379
|
+
"aria-expanded": open,
|
|
12380
|
+
"aria-controls": menuId,
|
|
12381
|
+
onClick: () => setOpen((value) => !value),
|
|
12382
|
+
className: "min-w-0",
|
|
12383
|
+
trailing: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
12384
|
+
Icon,
|
|
12385
|
+
{
|
|
12386
|
+
name: "chevron-down",
|
|
12387
|
+
size: 16,
|
|
12388
|
+
strokeWidth: 2,
|
|
12389
|
+
className: cn58(
|
|
12390
|
+
"text-muted transition-transform duration-200 ease-out",
|
|
12391
|
+
open && "rotate-180"
|
|
12392
|
+
)
|
|
12393
|
+
}
|
|
12394
|
+
),
|
|
12395
|
+
children: title
|
|
12396
|
+
}
|
|
12397
|
+
),
|
|
12398
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Badge, { variant: statusRecipe.variant, size: "sm", className: "shrink-0", children: statusRecipe.label }),
|
|
12399
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
12400
|
+
Button,
|
|
12401
|
+
{
|
|
12402
|
+
variant: "ghost",
|
|
12403
|
+
size: "sm",
|
|
12404
|
+
onClick: onPreview,
|
|
12405
|
+
className: "shrink-0",
|
|
12406
|
+
children: "Preview"
|
|
12407
|
+
}
|
|
12408
|
+
)
|
|
12409
|
+
] }),
|
|
12410
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: "ml-auto flex shrink-0 items-center gap-sm", children: [
|
|
12411
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
12412
|
+
Avatar,
|
|
12413
|
+
{
|
|
12414
|
+
size: "sm",
|
|
12415
|
+
initials: userName.slice(0, 1).toUpperCase(),
|
|
12416
|
+
name: userName,
|
|
12417
|
+
tone: "warm"
|
|
12418
|
+
}
|
|
12419
|
+
),
|
|
12420
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Button, { variant: "primary", size: "md", onClick: onShare, children: "Share" })
|
|
12421
|
+
] })
|
|
12422
|
+
] }),
|
|
12517
12423
|
(0, import_react_dom10.createPortal)(
|
|
12518
12424
|
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
12519
12425
|
"div",
|
|
@@ -12521,7 +12427,7 @@ var NavbarDesktop = React71.forwardRef(
|
|
|
12521
12427
|
ref: panelRef,
|
|
12522
12428
|
id: menuId,
|
|
12523
12429
|
role: "menu",
|
|
12524
|
-
"aria-label": "
|
|
12430
|
+
"aria-label": "Switch event",
|
|
12525
12431
|
"aria-hidden": !open,
|
|
12526
12432
|
"data-state": open ? "open" : "closed",
|
|
12527
12433
|
onKeyDown: onPanelKeyDown,
|
package/dist/index.js
CHANGED
|
@@ -12118,21 +12118,35 @@ import { createPortal as createPortal10 } from "react-dom";
|
|
|
12118
12118
|
import { jsx as jsx71, jsxs as jsxs68 } from "react/jsx-runtime";
|
|
12119
12119
|
var cn58 = (...parts) => parts.filter(Boolean).join(" ");
|
|
12120
12120
|
var DEFAULT_MENU_ITEMS = [
|
|
12121
|
-
{ id: "
|
|
12122
|
-
{ id: "
|
|
12123
|
-
{ id: "
|
|
12124
|
-
{
|
|
12121
|
+
{ id: "gallery-night", label: "Gallery Night", icon: "calendar" },
|
|
12122
|
+
{ id: "harbor-sound", label: "Harbor Sound Session", icon: "calendar" },
|
|
12123
|
+
{ id: "makers-market", label: "Winter Makers Market", icon: "calendar" },
|
|
12124
|
+
{
|
|
12125
|
+
id: "archive",
|
|
12126
|
+
label: "Past events",
|
|
12127
|
+
icon: "folder",
|
|
12128
|
+
separated: true,
|
|
12129
|
+
submenu: true
|
|
12130
|
+
}
|
|
12125
12131
|
];
|
|
12132
|
+
var STATUS_RECIPE = {
|
|
12133
|
+
draft: { variant: "warning", label: "Draft" },
|
|
12134
|
+
published: { variant: "success", label: "Published" },
|
|
12135
|
+
ended: { variant: "neutral", label: "Ended" }
|
|
12136
|
+
};
|
|
12126
12137
|
var PANEL_MIN_WIDTH = 288;
|
|
12127
12138
|
var MENU_ROW_CLASS2 = "cursor-pointer transition duration-150 ease-out";
|
|
12128
12139
|
var NavbarDesktop = React71.forwardRef(
|
|
12129
12140
|
({
|
|
12130
|
-
title = "
|
|
12141
|
+
title = "Rooftop Supper Club",
|
|
12131
12142
|
userName = "Sera",
|
|
12132
12143
|
menuItems = DEFAULT_MENU_ITEMS,
|
|
12133
12144
|
onMenuSelect,
|
|
12134
12145
|
defaultMenuOpen = false,
|
|
12135
|
-
|
|
12146
|
+
status = "draft",
|
|
12147
|
+
onShare,
|
|
12148
|
+
onPreview,
|
|
12149
|
+
label = "Event toolbar",
|
|
12136
12150
|
className,
|
|
12137
12151
|
...rest
|
|
12138
12152
|
}, ref) => {
|
|
@@ -12213,182 +12227,74 @@ var NavbarDesktop = React71.forwardRef(
|
|
|
12213
12227
|
choose(item.id);
|
|
12214
12228
|
}
|
|
12215
12229
|
};
|
|
12216
|
-
const
|
|
12230
|
+
const statusRecipe = STATUS_RECIPE[status];
|
|
12217
12231
|
return /* @__PURE__ */ jsxs68(
|
|
12218
12232
|
"header",
|
|
12219
12233
|
{
|
|
12220
12234
|
ref,
|
|
12221
12235
|
"aria-label": label,
|
|
12222
|
-
className: cn58(
|
|
12236
|
+
className: cn58(
|
|
12237
|
+
"w-full min-w-0 border-b border-hairline bg-surface text-ink",
|
|
12238
|
+
className
|
|
12239
|
+
),
|
|
12223
12240
|
...rest,
|
|
12224
12241
|
children: [
|
|
12225
|
-
/* @__PURE__ */ jsxs68(
|
|
12226
|
-
"
|
|
12227
|
-
{
|
|
12228
|
-
|
|
12229
|
-
|
|
12230
|
-
|
|
12231
|
-
|
|
12232
|
-
|
|
12233
|
-
|
|
12234
|
-
|
|
12235
|
-
|
|
12236
|
-
|
|
12237
|
-
|
|
12238
|
-
|
|
12239
|
-
|
|
12240
|
-
|
|
12241
|
-
|
|
12242
|
-
|
|
12243
|
-
|
|
12244
|
-
|
|
12245
|
-
|
|
12246
|
-
|
|
12247
|
-
|
|
12248
|
-
|
|
12249
|
-
|
|
12250
|
-
|
|
12251
|
-
|
|
12252
|
-
|
|
12253
|
-
|
|
12254
|
-
|
|
12255
|
-
|
|
12256
|
-
|
|
12257
|
-
|
|
12258
|
-
|
|
12259
|
-
|
|
12260
|
-
|
|
12261
|
-
|
|
12262
|
-
|
|
12263
|
-
|
|
12264
|
-
|
|
12265
|
-
|
|
12266
|
-
|
|
12267
|
-
|
|
12268
|
-
|
|
12269
|
-
|
|
12270
|
-
|
|
12271
|
-
|
|
12272
|
-
|
|
12273
|
-
|
|
12274
|
-
|
|
12275
|
-
|
|
12276
|
-
|
|
12277
|
-
|
|
12278
|
-
|
|
12279
|
-
|
|
12280
|
-
|
|
12281
|
-
name: "chevron-down",
|
|
12282
|
-
size: 16,
|
|
12283
|
-
strokeWidth: 2,
|
|
12284
|
-
className: cn58(
|
|
12285
|
-
"transition-transform duration-200 ease-out",
|
|
12286
|
-
open && "rotate-180"
|
|
12287
|
-
)
|
|
12288
|
-
}
|
|
12289
|
-
),
|
|
12290
|
-
children: "Editing"
|
|
12291
|
-
}
|
|
12292
|
-
),
|
|
12293
|
-
/* @__PURE__ */ jsx71(
|
|
12294
|
-
"span",
|
|
12295
|
-
{
|
|
12296
|
-
"aria-hidden": "true",
|
|
12297
|
-
className: "mx-sm h-6 w-px shrink-0 bg-brand-tile-foreground/30"
|
|
12298
|
-
}
|
|
12299
|
-
),
|
|
12300
|
-
/* @__PURE__ */ jsx71(
|
|
12301
|
-
Button,
|
|
12302
|
-
{
|
|
12303
|
-
variant: "onBrand",
|
|
12304
|
-
shape: "square",
|
|
12305
|
-
size: "md",
|
|
12306
|
-
icon: "undo",
|
|
12307
|
-
"aria-label": "Undo",
|
|
12308
|
-
className: onBrandFocus
|
|
12309
|
-
}
|
|
12310
|
-
),
|
|
12311
|
-
/* @__PURE__ */ jsx71(
|
|
12312
|
-
Button,
|
|
12313
|
-
{
|
|
12314
|
-
variant: "onBrand",
|
|
12315
|
-
shape: "square",
|
|
12316
|
-
size: "md",
|
|
12317
|
-
icon: "redo",
|
|
12318
|
-
"aria-label": "Redo",
|
|
12319
|
-
disabled: true,
|
|
12320
|
-
className: cn58(
|
|
12321
|
-
onBrandFocus,
|
|
12322
|
-
"disabled:bg-transparent! disabled:shadow-none"
|
|
12323
|
-
)
|
|
12324
|
-
}
|
|
12325
|
-
),
|
|
12326
|
-
/* @__PURE__ */ jsx71(
|
|
12327
|
-
Button,
|
|
12328
|
-
{
|
|
12329
|
-
variant: "onBrand",
|
|
12330
|
-
shape: "square",
|
|
12331
|
-
size: "md",
|
|
12332
|
-
icon: "cloud-check",
|
|
12333
|
-
"aria-label": "All changes saved",
|
|
12334
|
-
className: cn58(onBrandFocus, "ml-xs")
|
|
12335
|
-
}
|
|
12336
|
-
),
|
|
12337
|
-
/* @__PURE__ */ jsx71("div", { className: "flex min-w-0 flex-1 items-center justify-end pr-md", children: /* @__PURE__ */ jsx71(
|
|
12338
|
-
"span",
|
|
12339
|
-
{
|
|
12340
|
-
className: "truncate text-body-sm text-brand-tile-foreground/90",
|
|
12341
|
-
title,
|
|
12342
|
-
children: title
|
|
12343
|
-
}
|
|
12344
|
-
) }),
|
|
12345
|
-
/* @__PURE__ */ jsx71(
|
|
12346
|
-
Avatar,
|
|
12347
|
-
{
|
|
12348
|
-
size: "sm",
|
|
12349
|
-
initials: userName.slice(0, 1).toUpperCase(),
|
|
12350
|
-
name: userName,
|
|
12351
|
-
tone: "warm",
|
|
12352
|
-
className: "mr-xs"
|
|
12353
|
-
}
|
|
12354
|
-
),
|
|
12355
|
-
/* @__PURE__ */ jsx71(
|
|
12356
|
-
Button,
|
|
12357
|
-
{
|
|
12358
|
-
variant: "onBrandGlass",
|
|
12359
|
-
shape: "square",
|
|
12360
|
-
size: "md",
|
|
12361
|
-
icon: "chart-column",
|
|
12362
|
-
"aria-label": "Open document data",
|
|
12363
|
-
className: onBrandFocus
|
|
12364
|
-
}
|
|
12365
|
-
),
|
|
12366
|
-
/* @__PURE__ */ jsx71(
|
|
12367
|
-
Button,
|
|
12368
|
-
{
|
|
12369
|
-
variant: "onBrandGlass",
|
|
12370
|
-
shape: "square",
|
|
12371
|
-
size: "md",
|
|
12372
|
-
icon: "message-circle",
|
|
12373
|
-
"aria-label": "Open comments",
|
|
12374
|
-
className: onBrandFocus
|
|
12375
|
-
}
|
|
12376
|
-
),
|
|
12377
|
-
/* @__PURE__ */ jsx71(
|
|
12378
|
-
Button,
|
|
12379
|
-
{
|
|
12380
|
-
variant: "onBrandSolid",
|
|
12381
|
-
size: "md",
|
|
12382
|
-
className: cn58(
|
|
12383
|
-
onBrandFocus,
|
|
12384
|
-
"ml-xs rounded-md font-weight-label-md"
|
|
12385
|
-
),
|
|
12386
|
-
children: "Share"
|
|
12387
|
-
}
|
|
12388
|
-
)
|
|
12389
|
-
]
|
|
12390
|
-
}
|
|
12391
|
-
),
|
|
12242
|
+
/* @__PURE__ */ jsxs68("div", { className: "flex w-full min-w-0 items-center gap-md px-lg py-sm", children: [
|
|
12243
|
+
/* @__PURE__ */ jsx71(Logo, { size: "sm", className: "shrink-0" }),
|
|
12244
|
+
/* @__PURE__ */ jsx71("span", { "aria-hidden": "true", className: "h-6 w-px shrink-0 bg-hairline" }),
|
|
12245
|
+
/* @__PURE__ */ jsxs68("div", { className: "flex min-w-0 items-center gap-md", children: [
|
|
12246
|
+
/* @__PURE__ */ jsx71(
|
|
12247
|
+
Button,
|
|
12248
|
+
{
|
|
12249
|
+
ref: triggerRef,
|
|
12250
|
+
variant: "quiet",
|
|
12251
|
+
size: "md",
|
|
12252
|
+
align: "between",
|
|
12253
|
+
"aria-haspopup": "menu",
|
|
12254
|
+
"aria-expanded": open,
|
|
12255
|
+
"aria-controls": menuId,
|
|
12256
|
+
onClick: () => setOpen((value) => !value),
|
|
12257
|
+
className: "min-w-0",
|
|
12258
|
+
trailing: /* @__PURE__ */ jsx71(
|
|
12259
|
+
Icon,
|
|
12260
|
+
{
|
|
12261
|
+
name: "chevron-down",
|
|
12262
|
+
size: 16,
|
|
12263
|
+
strokeWidth: 2,
|
|
12264
|
+
className: cn58(
|
|
12265
|
+
"text-muted transition-transform duration-200 ease-out",
|
|
12266
|
+
open && "rotate-180"
|
|
12267
|
+
)
|
|
12268
|
+
}
|
|
12269
|
+
),
|
|
12270
|
+
children: title
|
|
12271
|
+
}
|
|
12272
|
+
),
|
|
12273
|
+
/* @__PURE__ */ jsx71(Badge, { variant: statusRecipe.variant, size: "sm", className: "shrink-0", children: statusRecipe.label }),
|
|
12274
|
+
/* @__PURE__ */ jsx71(
|
|
12275
|
+
Button,
|
|
12276
|
+
{
|
|
12277
|
+
variant: "ghost",
|
|
12278
|
+
size: "sm",
|
|
12279
|
+
onClick: onPreview,
|
|
12280
|
+
className: "shrink-0",
|
|
12281
|
+
children: "Preview"
|
|
12282
|
+
}
|
|
12283
|
+
)
|
|
12284
|
+
] }),
|
|
12285
|
+
/* @__PURE__ */ jsxs68("div", { className: "ml-auto flex shrink-0 items-center gap-sm", children: [
|
|
12286
|
+
/* @__PURE__ */ jsx71(
|
|
12287
|
+
Avatar,
|
|
12288
|
+
{
|
|
12289
|
+
size: "sm",
|
|
12290
|
+
initials: userName.slice(0, 1).toUpperCase(),
|
|
12291
|
+
name: userName,
|
|
12292
|
+
tone: "warm"
|
|
12293
|
+
}
|
|
12294
|
+
),
|
|
12295
|
+
/* @__PURE__ */ jsx71(Button, { variant: "primary", size: "md", onClick: onShare, children: "Share" })
|
|
12296
|
+
] })
|
|
12297
|
+
] }),
|
|
12392
12298
|
createPortal10(
|
|
12393
12299
|
/* @__PURE__ */ jsx71(
|
|
12394
12300
|
"div",
|
|
@@ -12396,7 +12302,7 @@ var NavbarDesktop = React71.forwardRef(
|
|
|
12396
12302
|
ref: panelRef,
|
|
12397
12303
|
id: menuId,
|
|
12398
12304
|
role: "menu",
|
|
12399
|
-
"aria-label": "
|
|
12305
|
+
"aria-label": "Switch event",
|
|
12400
12306
|
"aria-hidden": !open,
|
|
12401
12307
|
"data-state": open ? "open" : "closed",
|
|
12402
12308
|
onKeyDown: onPanelKeyDown,
|
package/dist/styles.css
CHANGED
|
@@ -537,9 +537,6 @@
|
|
|
537
537
|
.mx-md {
|
|
538
538
|
margin-inline: var(--spacing-md);
|
|
539
539
|
}
|
|
540
|
-
.mx-sm {
|
|
541
|
-
margin-inline: var(--spacing-sm);
|
|
542
|
-
}
|
|
543
540
|
.mx-xs {
|
|
544
541
|
margin-inline: var(--spacing-xs);
|
|
545
542
|
}
|
|
@@ -600,9 +597,6 @@
|
|
|
600
597
|
.mr-sm {
|
|
601
598
|
margin-right: var(--spacing-sm);
|
|
602
599
|
}
|
|
603
|
-
.mr-xs {
|
|
604
|
-
margin-right: var(--spacing-xs);
|
|
605
|
-
}
|
|
606
600
|
.mb-base {
|
|
607
601
|
margin-bottom: var(--spacing-base);
|
|
608
602
|
}
|
|
@@ -1506,12 +1500,6 @@
|
|
|
1506
1500
|
border-color: color-mix(in oklab, var(--color-brand-tile-foreground) 25%, transparent);
|
|
1507
1501
|
}
|
|
1508
1502
|
}
|
|
1509
|
-
.border-brand-tile-foreground\/40 {
|
|
1510
|
-
border-color: color-mix(in srgb, #FFFFFF 40%, transparent);
|
|
1511
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
1512
|
-
border-color: color-mix(in oklab, var(--color-brand-tile-foreground) 40%, transparent);
|
|
1513
|
-
}
|
|
1514
|
-
}
|
|
1515
1503
|
.border-current {
|
|
1516
1504
|
border-color: currentcolor;
|
|
1517
1505
|
}
|
|
@@ -1578,18 +1566,6 @@
|
|
|
1578
1566
|
background-color: color-mix(in oklab, var(--color-brand-tile-foreground) 12%, transparent);
|
|
1579
1567
|
}
|
|
1580
1568
|
}
|
|
1581
|
-
.bg-brand-tile-foreground\/25 {
|
|
1582
|
-
background-color: color-mix(in srgb, #FFFFFF 25%, transparent);
|
|
1583
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
1584
|
-
background-color: color-mix(in oklab, var(--color-brand-tile-foreground) 25%, transparent);
|
|
1585
|
-
}
|
|
1586
|
-
}
|
|
1587
|
-
.bg-brand-tile-foreground\/30 {
|
|
1588
|
-
background-color: color-mix(in srgb, #FFFFFF 30%, transparent);
|
|
1589
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
1590
|
-
background-color: color-mix(in oklab, var(--color-brand-tile-foreground) 30%, transparent);
|
|
1591
|
-
}
|
|
1592
|
-
}
|
|
1593
1569
|
.bg-canvas {
|
|
1594
1570
|
background-color: var(--color-canvas);
|
|
1595
1571
|
}
|
|
@@ -2047,12 +2023,6 @@
|
|
|
2047
2023
|
color: color-mix(in oklab, var(--color-brand-tile-foreground) 80%, transparent);
|
|
2048
2024
|
}
|
|
2049
2025
|
}
|
|
2050
|
-
.text-brand-tile-foreground\/90 {
|
|
2051
|
-
color: color-mix(in srgb, #FFFFFF 90%, transparent);
|
|
2052
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
2053
|
-
color: color-mix(in oklab, var(--color-brand-tile-foreground) 90%, transparent);
|
|
2054
|
-
}
|
|
2055
|
-
}
|
|
2056
2026
|
.text-brand-tile\/80 {
|
|
2057
2027
|
color: color-mix(in srgb, #4A3B77 80%, transparent);
|
|
2058
2028
|
@supports (color: color-mix(in lab, red, red)) {
|
|
@@ -2559,16 +2529,6 @@
|
|
|
2559
2529
|
}
|
|
2560
2530
|
}
|
|
2561
2531
|
}
|
|
2562
|
-
.hover\:border-brand-tile-foreground\/50 {
|
|
2563
|
-
&:hover {
|
|
2564
|
-
@media (hover: hover) {
|
|
2565
|
-
border-color: color-mix(in srgb, #FFFFFF 50%, transparent);
|
|
2566
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
2567
|
-
border-color: color-mix(in oklab, var(--color-brand-tile-foreground) 50%, transparent);
|
|
2568
|
-
}
|
|
2569
|
-
}
|
|
2570
|
-
}
|
|
2571
|
-
}
|
|
2572
2532
|
.hover\:border-hairline {
|
|
2573
2533
|
&:hover {
|
|
2574
2534
|
@media (hover: hover) {
|
|
@@ -2645,16 +2605,6 @@
|
|
|
2645
2605
|
}
|
|
2646
2606
|
}
|
|
2647
2607
|
}
|
|
2648
|
-
.hover\:bg-brand-tile-foreground\/30 {
|
|
2649
|
-
&:hover {
|
|
2650
|
-
@media (hover: hover) {
|
|
2651
|
-
background-color: color-mix(in srgb, #FFFFFF 30%, transparent);
|
|
2652
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
2653
|
-
background-color: color-mix(in oklab, var(--color-brand-tile-foreground) 30%, transparent);
|
|
2654
|
-
}
|
|
2655
|
-
}
|
|
2656
|
-
}
|
|
2657
|
-
}
|
|
2658
2608
|
.hover\:bg-inverse-surface-soft {
|
|
2659
2609
|
&:hover {
|
|
2660
2610
|
@media (hover: hover) {
|
|
@@ -2876,11 +2826,6 @@
|
|
|
2876
2826
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
2877
2827
|
}
|
|
2878
2828
|
}
|
|
2879
|
-
.focus-visible\:ring-brand-tile-foreground {
|
|
2880
|
-
&:focus-visible {
|
|
2881
|
-
--tw-ring-color: var(--color-brand-tile-foreground);
|
|
2882
|
-
}
|
|
2883
|
-
}
|
|
2884
2829
|
.focus-visible\:ring-focus-blue {
|
|
2885
2830
|
&:focus-visible {
|
|
2886
2831
|
--tw-ring-color: var(--color-focus-blue);
|
|
@@ -2900,11 +2845,6 @@
|
|
|
2900
2845
|
--tw-ring-offset-shadow: var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
|
2901
2846
|
}
|
|
2902
2847
|
}
|
|
2903
|
-
.focus-visible\:ring-offset-brand-gradient-end {
|
|
2904
|
-
&:focus-visible {
|
|
2905
|
-
--tw-ring-offset-color: var(--color-brand-gradient-end);
|
|
2906
|
-
}
|
|
2907
|
-
}
|
|
2908
2848
|
.focus-visible\:ring-offset-canvas {
|
|
2909
2849
|
&:focus-visible {
|
|
2910
2850
|
--tw-ring-offset-color: var(--color-canvas);
|
package/package.json
CHANGED
|
@@ -1,22 +1,28 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { createPortal } from "react-dom";
|
|
3
3
|
import { Avatar } from "../../atoms/Avatar";
|
|
4
|
+
import { Badge } from "../../atoms/Badge";
|
|
4
5
|
import { Button } from "../../atoms/Button";
|
|
5
6
|
import { Divider } from "../../atoms/Divider";
|
|
6
7
|
import { Icon } from "../../atoms/Icon";
|
|
8
|
+
import type { IconName } from "../../atoms/Icon";
|
|
9
|
+
import { Logo } from "../../atoms/Logo";
|
|
7
10
|
import { MenuItem } from "../../molecules/MenuItem";
|
|
8
11
|
|
|
9
12
|
const cn = (...parts: Array<string | false | null | undefined>): string =>
|
|
10
13
|
parts.filter(Boolean).join(" ");
|
|
11
14
|
|
|
12
|
-
/**
|
|
15
|
+
/** Publication state of the event the bar is showing. */
|
|
16
|
+
export type NavbarDesktopStatus = "draft" | "published" | "ended";
|
|
17
|
+
|
|
18
|
+
/** One row of the event switcher — another event the host can jump to. */
|
|
13
19
|
export interface NavbarDesktopMenuItem {
|
|
14
20
|
/** Stable id handed back to `onMenuSelect`. */
|
|
15
21
|
id: string;
|
|
16
|
-
/** Visible copy of the row. */
|
|
22
|
+
/** Visible copy of the row (the event name). */
|
|
17
23
|
label: string;
|
|
18
24
|
/** Leading glyph name, resolved through the shared Icon atom. */
|
|
19
|
-
icon:
|
|
25
|
+
icon: IconName;
|
|
20
26
|
/** Draws a trailing chevron — the row opens a further step. */
|
|
21
27
|
submenu?: boolean;
|
|
22
28
|
/** Error wash + error ink, for a removal row. */
|
|
@@ -26,13 +32,29 @@ export interface NavbarDesktopMenuItem {
|
|
|
26
32
|
}
|
|
27
33
|
|
|
28
34
|
const DEFAULT_MENU_ITEMS: NavbarDesktopMenuItem[] = [
|
|
29
|
-
{ id: "
|
|
30
|
-
{ id: "
|
|
31
|
-
{ id: "
|
|
32
|
-
{
|
|
35
|
+
{ id: "gallery-night", label: "Gallery Night", icon: "calendar" },
|
|
36
|
+
{ id: "harbor-sound", label: "Harbor Sound Session", icon: "calendar" },
|
|
37
|
+
{ id: "makers-market", label: "Winter Makers Market", icon: "calendar" },
|
|
38
|
+
{
|
|
39
|
+
id: "archive",
|
|
40
|
+
label: "Past events",
|
|
41
|
+
icon: "folder",
|
|
42
|
+
separated: true,
|
|
43
|
+
submenu: true,
|
|
44
|
+
},
|
|
33
45
|
];
|
|
34
46
|
|
|
35
|
-
/**
|
|
47
|
+
/** Status recipe per state: pill variant plus its visible copy. */
|
|
48
|
+
const STATUS_RECIPE: Record<
|
|
49
|
+
NavbarDesktopStatus,
|
|
50
|
+
{ variant: "warning" | "success" | "neutral"; label: string }
|
|
51
|
+
> = {
|
|
52
|
+
draft: { variant: "warning", label: "Draft" },
|
|
53
|
+
published: { variant: "success", label: "Published" },
|
|
54
|
+
ended: { variant: "neutral", label: "Ended" },
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/** Panel width — wide enough for the longest event name plus its glyph. */
|
|
36
58
|
const PANEL_MIN_WIDTH = 288;
|
|
37
59
|
|
|
38
60
|
/**
|
|
@@ -43,39 +65,49 @@ const MENU_ROW_CLASS = "cursor-pointer transition duration-150 ease-out";
|
|
|
43
65
|
|
|
44
66
|
export interface NavbarDesktopProps
|
|
45
67
|
extends Omit<React.HTMLAttributes<HTMLElement>, "title"> {
|
|
46
|
-
/**
|
|
68
|
+
/** Name of the event currently being managed, truncated as needed. */
|
|
47
69
|
title?: string;
|
|
48
|
-
/**
|
|
70
|
+
/** Event host the identity mark stands for. */
|
|
49
71
|
userName?: string;
|
|
50
|
-
/** Rows of the
|
|
72
|
+
/** Rows of the event switcher — the other events on this account. */
|
|
51
73
|
menuItems?: NavbarDesktopMenuItem[];
|
|
52
|
-
/** Fired when
|
|
74
|
+
/** Fired when an event row is chosen. */
|
|
53
75
|
onMenuSelect?: (id: string) => void;
|
|
54
|
-
/** Start with the
|
|
76
|
+
/** Start with the event switcher open — the preview uses the closed state. */
|
|
55
77
|
defaultMenuOpen?: boolean;
|
|
78
|
+
/** Publication state shown in the status pill. */
|
|
79
|
+
status?: NavbarDesktopStatus;
|
|
80
|
+
/** Fired by the share action. */
|
|
81
|
+
onShare?: () => void;
|
|
82
|
+
/** Fired by the preview action. */
|
|
83
|
+
onPreview?: () => void;
|
|
56
84
|
/** Accessible name of the toolbar landmark. */
|
|
57
85
|
label?: string;
|
|
58
86
|
}
|
|
59
87
|
|
|
60
88
|
/**
|
|
61
|
-
* The
|
|
62
|
-
*
|
|
63
|
-
*
|
|
89
|
+
* The event-host toolbar: a plain surface strip with a bottom hairline that
|
|
90
|
+
* holds the brand mark, an event switcher, the event's publication status, a
|
|
91
|
+
* preview action, the host's identity mark and the share action.
|
|
64
92
|
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
93
|
+
* Quiet and neutral on purpose — it frames the event's own content instead of
|
|
94
|
+
* competing with it. The switcher menu is portaled to `document.body` and
|
|
95
|
+
* anchored from the trigger's measured box, so it floats over the page instead
|
|
96
|
+
* of pushing the bar's height around. It stays mounted and is driven by
|
|
97
|
+
* `data-state`, so the close motion plays too.
|
|
69
98
|
*/
|
|
70
99
|
export const NavbarDesktop = React.forwardRef<HTMLElement, NavbarDesktopProps>(
|
|
71
100
|
(
|
|
72
101
|
{
|
|
73
|
-
title = "
|
|
102
|
+
title = "Rooftop Supper Club",
|
|
74
103
|
userName = "Sera",
|
|
75
104
|
menuItems = DEFAULT_MENU_ITEMS,
|
|
76
105
|
onMenuSelect,
|
|
77
106
|
defaultMenuOpen = false,
|
|
78
|
-
|
|
107
|
+
status = "draft",
|
|
108
|
+
onShare,
|
|
109
|
+
onPreview,
|
|
110
|
+
label = "Event toolbar",
|
|
79
111
|
className,
|
|
80
112
|
...rest
|
|
81
113
|
},
|
|
@@ -179,162 +211,78 @@ export const NavbarDesktop = React.forwardRef<HTMLElement, NavbarDesktopProps>(
|
|
|
179
211
|
}
|
|
180
212
|
};
|
|
181
213
|
|
|
182
|
-
|
|
183
|
-
const onBrandFocus =
|
|
184
|
-
"focus-visible:ring-brand-tile-foreground focus-visible:ring-offset-brand-gradient-end";
|
|
214
|
+
const statusRecipe = STATUS_RECIPE[status];
|
|
185
215
|
|
|
186
216
|
return (
|
|
187
217
|
<header
|
|
188
218
|
ref={ref}
|
|
189
219
|
aria-label={label}
|
|
190
|
-
className={cn(
|
|
220
|
+
className={cn(
|
|
221
|
+
"w-full min-w-0 border-b border-hairline bg-surface text-ink",
|
|
222
|
+
className,
|
|
223
|
+
)}
|
|
191
224
|
{...rest}
|
|
192
225
|
>
|
|
193
|
-
<div
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
backgroundImage:
|
|
197
|
-
"linear-gradient(96deg, var(--color-brand-gradient-start) 0%, var(--color-semantic-info) 44%, var(--color-brand-gradient-end) 100%)",
|
|
198
|
-
}}
|
|
199
|
-
>
|
|
200
|
-
{/* 1 — document home */}
|
|
201
|
-
<Button
|
|
202
|
-
variant="onBrandGlass"
|
|
203
|
-
shape="square"
|
|
204
|
-
size="md"
|
|
205
|
-
icon="house"
|
|
206
|
-
aria-label="Go to home"
|
|
207
|
-
className={cn(onBrandFocus, "mr-xs")}
|
|
208
|
-
/>
|
|
209
|
-
|
|
210
|
-
{/* 2 — document-level navigation */}
|
|
211
|
-
<Button
|
|
212
|
-
variant="onBrand"
|
|
213
|
-
size="md"
|
|
214
|
-
className={cn(onBrandFocus, "font-weight-body-md")}
|
|
215
|
-
>
|
|
216
|
-
File
|
|
217
|
-
</Button>
|
|
218
|
-
<Button
|
|
219
|
-
variant="onBrand"
|
|
220
|
-
size="md"
|
|
221
|
-
className={cn(onBrandFocus, "font-weight-body-md")}
|
|
222
|
-
>
|
|
223
|
-
Resize
|
|
224
|
-
</Button>
|
|
226
|
+
<div className="flex w-full min-w-0 items-center gap-md px-lg py-sm">
|
|
227
|
+
{/* 1 — brand mark */}
|
|
228
|
+
<Logo size="sm" className="shrink-0" />
|
|
225
229
|
|
|
226
|
-
{/*
|
|
227
|
-
<
|
|
228
|
-
ref={triggerRef}
|
|
229
|
-
variant="onBrandGlass"
|
|
230
|
-
size="md"
|
|
231
|
-
icon="pencil"
|
|
232
|
-
aria-haspopup="menu"
|
|
233
|
-
aria-expanded={open}
|
|
234
|
-
aria-controls={menuId}
|
|
235
|
-
onClick={() => setOpen((value) => !value)}
|
|
236
|
-
className={cn(
|
|
237
|
-
onBrandFocus,
|
|
238
|
-
"ml-sm border-brand-tile-foreground/40 bg-brand-tile-foreground/25",
|
|
239
|
-
"hover:border-brand-tile-foreground/50 hover:bg-brand-tile-foreground/30",
|
|
240
|
-
)}
|
|
241
|
-
trailing={
|
|
242
|
-
<Icon
|
|
243
|
-
name="chevron-down"
|
|
244
|
-
size={16}
|
|
245
|
-
strokeWidth={2}
|
|
246
|
-
className={cn(
|
|
247
|
-
"transition-transform duration-200 ease-out",
|
|
248
|
-
open && "rotate-180",
|
|
249
|
-
)}
|
|
250
|
-
/>
|
|
251
|
-
}
|
|
252
|
-
>
|
|
253
|
-
Editing
|
|
254
|
-
</Button>
|
|
230
|
+
{/* 2 — divider between the platform mark and the event controls */}
|
|
231
|
+
<span aria-hidden="true" className="h-6 w-px shrink-0 bg-hairline" />
|
|
255
232
|
|
|
256
|
-
{/*
|
|
257
|
-
<
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
233
|
+
{/* 3 — event switcher, status pill and preview action */}
|
|
234
|
+
<div className="flex min-w-0 items-center gap-md">
|
|
235
|
+
<Button
|
|
236
|
+
ref={triggerRef}
|
|
237
|
+
variant="quiet"
|
|
238
|
+
size="md"
|
|
239
|
+
align="between"
|
|
240
|
+
aria-haspopup="menu"
|
|
241
|
+
aria-expanded={open}
|
|
242
|
+
aria-controls={menuId}
|
|
243
|
+
onClick={() => setOpen((value) => !value)}
|
|
244
|
+
className="min-w-0"
|
|
245
|
+
trailing={
|
|
246
|
+
<Icon
|
|
247
|
+
name="chevron-down"
|
|
248
|
+
size={16}
|
|
249
|
+
strokeWidth={2}
|
|
250
|
+
className={cn(
|
|
251
|
+
"text-muted transition-transform duration-200 ease-out",
|
|
252
|
+
open && "rotate-180",
|
|
253
|
+
)}
|
|
254
|
+
/>
|
|
255
|
+
}
|
|
256
|
+
>
|
|
257
|
+
{title}
|
|
258
|
+
</Button>
|
|
261
259
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
shape="square"
|
|
266
|
-
size="md"
|
|
267
|
-
icon="undo"
|
|
268
|
-
aria-label="Undo"
|
|
269
|
-
className={onBrandFocus}
|
|
270
|
-
/>
|
|
271
|
-
<Button
|
|
272
|
-
variant="onBrand"
|
|
273
|
-
shape="square"
|
|
274
|
-
size="md"
|
|
275
|
-
icon="redo"
|
|
276
|
-
aria-label="Redo"
|
|
277
|
-
disabled
|
|
278
|
-
className={cn(
|
|
279
|
-
onBrandFocus,
|
|
280
|
-
"disabled:bg-transparent! disabled:shadow-none",
|
|
281
|
-
)}
|
|
282
|
-
/>
|
|
283
|
-
<Button
|
|
284
|
-
variant="onBrand"
|
|
285
|
-
shape="square"
|
|
286
|
-
size="md"
|
|
287
|
-
icon="cloud-check"
|
|
288
|
-
aria-label="All changes saved"
|
|
289
|
-
className={cn(onBrandFocus, "ml-xs")}
|
|
290
|
-
/>
|
|
260
|
+
<Badge variant={statusRecipe.variant} size="sm" className="shrink-0">
|
|
261
|
+
{statusRecipe.label}
|
|
262
|
+
</Badge>
|
|
291
263
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
264
|
+
<Button
|
|
265
|
+
variant="ghost"
|
|
266
|
+
size="sm"
|
|
267
|
+
onClick={onPreview}
|
|
268
|
+
className="shrink-0"
|
|
297
269
|
>
|
|
298
|
-
|
|
299
|
-
</
|
|
270
|
+
Preview
|
|
271
|
+
</Button>
|
|
300
272
|
</div>
|
|
301
273
|
|
|
302
|
-
{/*
|
|
303
|
-
<
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
shape="square"
|
|
315
|
-
size="md"
|
|
316
|
-
icon="chart-column"
|
|
317
|
-
aria-label="Open document data"
|
|
318
|
-
className={onBrandFocus}
|
|
319
|
-
/>
|
|
320
|
-
<Button
|
|
321
|
-
variant="onBrandGlass"
|
|
322
|
-
shape="square"
|
|
323
|
-
size="md"
|
|
324
|
-
icon="message-circle"
|
|
325
|
-
aria-label="Open comments"
|
|
326
|
-
className={onBrandFocus}
|
|
327
|
-
/>
|
|
328
|
-
<Button
|
|
329
|
-
variant="onBrandSolid"
|
|
330
|
-
size="md"
|
|
331
|
-
className={cn(
|
|
332
|
-
onBrandFocus,
|
|
333
|
-
"ml-xs rounded-md font-weight-label-md",
|
|
334
|
-
)}
|
|
335
|
-
>
|
|
336
|
-
Share
|
|
337
|
-
</Button>
|
|
274
|
+
{/* 4 — host identity + share */}
|
|
275
|
+
<div className="ml-auto flex shrink-0 items-center gap-sm">
|
|
276
|
+
<Avatar
|
|
277
|
+
size="sm"
|
|
278
|
+
initials={userName.slice(0, 1).toUpperCase()}
|
|
279
|
+
name={userName}
|
|
280
|
+
tone="warm"
|
|
281
|
+
/>
|
|
282
|
+
<Button variant="primary" size="md" onClick={onShare}>
|
|
283
|
+
Share
|
|
284
|
+
</Button>
|
|
285
|
+
</div>
|
|
338
286
|
</div>
|
|
339
287
|
|
|
340
288
|
{createPortal(
|
|
@@ -342,7 +290,7 @@ export const NavbarDesktop = React.forwardRef<HTMLElement, NavbarDesktopProps>(
|
|
|
342
290
|
ref={panelRef}
|
|
343
291
|
id={menuId}
|
|
344
292
|
role="menu"
|
|
345
|
-
aria-label="
|
|
293
|
+
aria-label="Switch event"
|
|
346
294
|
aria-hidden={!open}
|
|
347
295
|
data-state={open ? "open" : "closed"}
|
|
348
296
|
onKeyDown={onPanelKeyDown}
|
|
@@ -366,7 +314,7 @@ export const NavbarDesktop = React.forwardRef<HTMLElement, NavbarDesktopProps>(
|
|
|
366
314
|
<React.Fragment key={item.id}>
|
|
367
315
|
{item.separated ? <Divider className="my-xs" /> : null}
|
|
368
316
|
<MenuItem
|
|
369
|
-
icon={item.icon
|
|
317
|
+
icon={item.icon}
|
|
370
318
|
bordered={false}
|
|
371
319
|
className={MENU_ROW_CLASS}
|
|
372
320
|
tone={item.destructive ? "destructive" : "default"}
|
|
@@ -1,27 +1,112 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { Button } from "../../atoms/Button";
|
|
2
3
|
import { NavbarDesktop } from "./NavbarDesktop";
|
|
4
|
+
import type { NavbarDesktopMenuItem, NavbarDesktopStatus } from "./NavbarDesktop";
|
|
5
|
+
|
|
6
|
+
const EVENTS: NavbarDesktopMenuItem[] = [
|
|
7
|
+
{ id: "gallery-night", label: "Gallery Night", icon: "calendar" },
|
|
8
|
+
{ id: "harbor-sound", label: "Harbor Sound Session", icon: "calendar" },
|
|
9
|
+
{ id: "makers-market", label: "Winter Makers Market", icon: "calendar" },
|
|
10
|
+
{
|
|
11
|
+
id: "archive",
|
|
12
|
+
label: "Past events",
|
|
13
|
+
icon: "folder",
|
|
14
|
+
separated: true,
|
|
15
|
+
submenu: true,
|
|
16
|
+
},
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
const STATUS_ORDER: NavbarDesktopStatus[] = ["draft", "published", "ended"];
|
|
20
|
+
|
|
21
|
+
/** Copy shown on each status switch. */
|
|
22
|
+
const STATUS_COPY: Record<NavbarDesktopStatus, string> = {
|
|
23
|
+
draft: "Draft",
|
|
24
|
+
published: "Published",
|
|
25
|
+
ended: "Ended",
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const EVENT_BY_ID: Record<string, string> = {
|
|
29
|
+
"gallery-night": "Gallery Night",
|
|
30
|
+
"harbor-sound": "Harbor Sound Session",
|
|
31
|
+
"makers-market": "Winter Makers Market",
|
|
32
|
+
};
|
|
3
33
|
|
|
4
|
-
/**
|
|
5
|
-
* Full-bleed demo of the page-level editing bar. The bar stretches edge to
|
|
6
|
-
* edge at the top of the preview, exactly as it sits on a real page, with the
|
|
7
|
-
* mode menu starting closed so the open / close motion can be triggered.
|
|
8
|
-
*/
|
|
9
34
|
export default function NavbarDesktopPreview() {
|
|
10
|
-
const [
|
|
35
|
+
const [eventName, setEventName] = React.useState("Rooftop Supper Club");
|
|
36
|
+
const [status, setStatus] = React.useState<NavbarDesktopStatus>("draft");
|
|
37
|
+
|
|
38
|
+
const switchEvent = (id: string) => {
|
|
39
|
+
const next = EVENT_BY_ID[id];
|
|
40
|
+
if (next) setEventName(next);
|
|
41
|
+
};
|
|
11
42
|
|
|
12
43
|
return (
|
|
13
|
-
<div className="w-full bg-canvas">
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
44
|
+
<div className="w-full max-w-3xl mx-auto p-lg space-y-lg bg-canvas">
|
|
45
|
+
<div className="space-y-xs">
|
|
46
|
+
<p className="text-caption text-muted">
|
|
47
|
+
Live toolbar — open the event switcher, then click Share or Preview
|
|
48
|
+
</p>
|
|
49
|
+
<div className="overflow-hidden rounded-lg border border-hairline">
|
|
50
|
+
<NavbarDesktop
|
|
51
|
+
title={eventName}
|
|
52
|
+
status={status}
|
|
53
|
+
menuItems={EVENTS}
|
|
54
|
+
onMenuSelect={switchEvent}
|
|
55
|
+
onShare={() => setStatus("published")}
|
|
56
|
+
onPreview={() => setStatus("ended")}
|
|
57
|
+
/>
|
|
58
|
+
<div className="bg-canvas p-lg">
|
|
59
|
+
<p className="text-body-sm text-muted">
|
|
60
|
+
Event content sits below the bar. Share publishes the event;
|
|
61
|
+
Preview marks it as ended.
|
|
62
|
+
</p>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
<div className="space-y-xs">
|
|
68
|
+
<p className="text-caption text-muted">Each publication status</p>
|
|
69
|
+
<div className="flex flex-wrap gap-sm">
|
|
70
|
+
{STATUS_ORDER.map((value) => (
|
|
71
|
+
<Button
|
|
72
|
+
key={value}
|
|
73
|
+
size="sm"
|
|
74
|
+
variant={status === value ? "soft" : "outline"}
|
|
75
|
+
aria-pressed={status === value}
|
|
76
|
+
onClick={() => setStatus(value)}
|
|
77
|
+
>
|
|
78
|
+
{STATUS_COPY[value]}
|
|
79
|
+
</Button>
|
|
80
|
+
))}
|
|
81
|
+
</div>
|
|
82
|
+
<div className="space-y-md">
|
|
83
|
+
{STATUS_ORDER.map((value) => (
|
|
84
|
+
<div
|
|
85
|
+
key={value}
|
|
86
|
+
className="overflow-hidden rounded-lg border border-hairline"
|
|
87
|
+
>
|
|
88
|
+
<NavbarDesktop
|
|
89
|
+
title="Rooftop Supper Club"
|
|
90
|
+
status={value}
|
|
91
|
+
userName="Sera"
|
|
92
|
+
/>
|
|
93
|
+
</div>
|
|
94
|
+
))}
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
|
|
98
|
+
<div className="space-y-xs">
|
|
99
|
+
<p className="text-caption text-muted">
|
|
100
|
+
A longer event name truncates in the switcher
|
|
24
101
|
</p>
|
|
102
|
+
<div className="overflow-hidden rounded-lg border border-hairline">
|
|
103
|
+
<NavbarDesktop
|
|
104
|
+
title="Winter Makers Market — Night Two"
|
|
105
|
+
status="published"
|
|
106
|
+
userName="Mara"
|
|
107
|
+
menuItems={EVENTS}
|
|
108
|
+
/>
|
|
109
|
+
</div>
|
|
25
110
|
</div>
|
|
26
111
|
</div>
|
|
27
112
|
);
|