@designa8/vibedesign-v6 2.1.3 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @plasma/vibedesign-v6
2
2
 
3
- Complete design system generated by Atoms Design, version **2.1.1**.
3
+ Complete design system generated by Atoms Design, version **2.2.0**.
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
@@ -84,6 +84,7 @@ __export(src_exports, {
84
84
  TemplateHero: () => TemplateHero,
85
85
  TemplateSummary: () => TemplateSummary,
86
86
  Toast: () => Toast,
87
+ ToastStack: () => ToastStack,
87
88
  TopNavbar: () => TopNavbar,
88
89
  TopupModal: () => TopupModal,
89
90
  Typography: () => Typography,
@@ -13164,9 +13165,285 @@ var Toast = React55.forwardRef(
13164
13165
  );
13165
13166
  Toast.displayName = "Toast";
13166
13167
 
13168
+ // virtual-pkg:src/atoms/ToastStack/ToastStack.tsx
13169
+ var React56 = __toESM(require("react"));
13170
+ var import_jsx_runtime56 = require("react/jsx-runtime");
13171
+ var TONE = {
13172
+ success: {
13173
+ icon: "check-checkmark",
13174
+ tile: "bg-semantic-success-soft",
13175
+ glyph: "text-semantic-success",
13176
+ rail: "bg-semantic-success",
13177
+ border: "border-hairline"
13178
+ },
13179
+ error: {
13180
+ icon: "circle-alert",
13181
+ tile: "bg-semantic-error-soft",
13182
+ glyph: "text-semantic-error",
13183
+ rail: "bg-semantic-error",
13184
+ border: "border-semantic-error-soft"
13185
+ },
13186
+ info: {
13187
+ icon: "info",
13188
+ tile: "bg-semantic-info-soft",
13189
+ glyph: "text-semantic-info",
13190
+ rail: "bg-semantic-info",
13191
+ border: "border-hairline"
13192
+ },
13193
+ warning: {
13194
+ icon: "triangle-alert",
13195
+ tile: "bg-semantic-warning-soft",
13196
+ glyph: "text-semantic-warning",
13197
+ rail: "bg-semantic-warning",
13198
+ border: "border-hairline"
13199
+ }
13200
+ };
13201
+ var CONTROL = "rounded-sm font-weight-body-sm transition duration-150 ease-out";
13202
+ var ToastCard = ({ toast, state, onDismiss }) => {
13203
+ const tone = toast.tone ?? "info";
13204
+ const theme = TONE[tone];
13205
+ const duration = toast.duration ?? (tone === "error" ? 0 : 6e3);
13206
+ const [paused, setPaused] = React56.useState(false);
13207
+ const [entered, setEntered] = React56.useState(false);
13208
+ const remaining = React56.useRef(duration);
13209
+ const startedAt = React56.useRef(0);
13210
+ const dismissRef = React56.useRef(onDismiss);
13211
+ dismissRef.current = onDismiss;
13212
+ React56.useEffect(() => {
13213
+ const frame = window.requestAnimationFrame(() => setEntered(true));
13214
+ return () => window.cancelAnimationFrame(frame);
13215
+ }, []);
13216
+ const open = state === "open" && entered;
13217
+ React56.useEffect(() => {
13218
+ if (duration <= 0 || paused || state !== "open") return;
13219
+ startedAt.current = Date.now();
13220
+ const timer = window.setTimeout(
13221
+ () => dismissRef.current(toast.id),
13222
+ Math.max(remaining.current, 0)
13223
+ );
13224
+ return () => {
13225
+ window.clearTimeout(timer);
13226
+ remaining.current = Math.max(
13227
+ remaining.current - (Date.now() - startedAt.current),
13228
+ 0
13229
+ );
13230
+ };
13231
+ }, [duration, paused, state, toast.id]);
13232
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
13233
+ "div",
13234
+ {
13235
+ "data-state": open ? "open" : "closed",
13236
+ style: { zIndex: open ? "var(--z-toast, 1300)" : void 0 },
13237
+ className: "relative grid w-full transition-[grid-template-rows,opacity,transform] duration-200 ease-out data-[state=open]:grid-rows-[1fr] data-[state=open]:translate-y-0 data-[state=open]:scale-100 data-[state=open]:opacity-100 data-[state=closed]:pointer-events-none data-[state=closed]:grid-rows-[0fr] data-[state=closed]:translate-y-2 data-[state=closed]:scale-95 data-[state=closed]:opacity-0",
13238
+ children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
13239
+ "div",
13240
+ {
13241
+ "data-state": open ? "open" : "closed",
13242
+ className: "min-h-0 data-[state=closed]:overflow-hidden",
13243
+ children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
13244
+ "div",
13245
+ {
13246
+ role: tone === "error" ? "alert" : "status",
13247
+ "aria-live": tone === "error" ? "assertive" : "polite",
13248
+ "aria-hidden": !open,
13249
+ onMouseEnter: () => setPaused(true),
13250
+ onMouseLeave: () => setPaused(false),
13251
+ onFocus: () => setPaused(true),
13252
+ onBlur: () => setPaused(false),
13253
+ className: [
13254
+ "relative flex items-start gap-md rounded-lg border bg-surface pb-lg pl-base pr-md pt-base shadow-card",
13255
+ "transition-[box-shadow,border-color] duration-150 ease-out hover:shadow-md",
13256
+ theme.border
13257
+ ].join(" "),
13258
+ children: [
13259
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
13260
+ "span",
13261
+ {
13262
+ className: [
13263
+ "mt-xxs flex size-10 shrink-0 items-center justify-center rounded-full",
13264
+ theme.tile
13265
+ ].join(" "),
13266
+ children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
13267
+ Icon,
13268
+ {
13269
+ name: theme.icon,
13270
+ size: 20,
13271
+ strokeWidth: 2.5,
13272
+ className: theme.glyph
13273
+ }
13274
+ )
13275
+ }
13276
+ ),
13277
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-xxs", children: [
13278
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "text-body-md text-ink", children: toast.title }),
13279
+ toast.description ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "text-body-sm text-muted", children: toast.description }) : null
13280
+ ] }),
13281
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex shrink-0 items-center gap-sm", children: [
13282
+ toast.actionLabel ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
13283
+ Button,
13284
+ {
13285
+ type: "button",
13286
+ variant: "bare",
13287
+ size: "auto",
13288
+ onClick: toast.onAction,
13289
+ className: [
13290
+ "px-sm py-xs text-body-sm text-primary-text hover:bg-primary-soft",
13291
+ CONTROL
13292
+ ].join(" "),
13293
+ children: toast.actionLabel
13294
+ }
13295
+ ) : null,
13296
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
13297
+ Button,
13298
+ {
13299
+ type: "button",
13300
+ variant: "bare",
13301
+ size: "auto",
13302
+ "aria-label": `Dismiss ${toast.title}`,
13303
+ onClick: () => onDismiss(toast.id),
13304
+ className: [
13305
+ "flex size-8 items-center justify-center bg-surface-soft text-muted hover:bg-surface-strong hover:text-ink",
13306
+ CONTROL
13307
+ ].join(" "),
13308
+ children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Icon, { name: "close", size: 16 })
13309
+ }
13310
+ )
13311
+ ] }),
13312
+ duration > 0 ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
13313
+ "span",
13314
+ {
13315
+ "aria-hidden": "true",
13316
+ className: "absolute bottom-sm left-base right-base h-1 overflow-hidden rounded-full bg-hairline-soft",
13317
+ children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
13318
+ "span",
13319
+ {
13320
+ className: ["block h-full w-full origin-left rounded-full", theme.rail].join(" "),
13321
+ style: {
13322
+ animation: `toaststack-drain ${duration}ms linear forwards`,
13323
+ animationPlayState: paused ? "paused" : "running"
13324
+ }
13325
+ }
13326
+ )
13327
+ }
13328
+ ) : null
13329
+ ]
13330
+ }
13331
+ )
13332
+ }
13333
+ )
13334
+ }
13335
+ );
13336
+ };
13337
+ var ToastStack = React56.forwardRef(
13338
+ function ToastStack2({
13339
+ toasts,
13340
+ onDismiss,
13341
+ onDismissAll,
13342
+ max = 3,
13343
+ dismissAllLabel = "Dismiss all",
13344
+ label = "Notifications",
13345
+ className,
13346
+ ...rest
13347
+ }, ref) {
13348
+ const [exiting, setExiting] = React56.useState([]);
13349
+ const seen = React56.useRef(toasts);
13350
+ React56.useEffect(() => {
13351
+ const live = new Set(toasts.map((toast) => toast.id));
13352
+ const gone = seen.current.filter((toast) => !live.has(toast.id));
13353
+ seen.current = toasts;
13354
+ if (gone.length > 0) setExiting((prev) => [...prev, ...gone]);
13355
+ }, [toasts]);
13356
+ React56.useEffect(() => {
13357
+ if (exiting.length === 0) return;
13358
+ const timer = window.setTimeout(() => setExiting([]), 240);
13359
+ return () => window.clearTimeout(timer);
13360
+ }, [exiting]);
13361
+ const dismiss = React56.useCallback(
13362
+ (id) => {
13363
+ onDismiss(id);
13364
+ },
13365
+ [onDismiss]
13366
+ );
13367
+ React56.useEffect(() => {
13368
+ const onKeyDown = (event) => {
13369
+ if (event.key !== "Escape" || toasts.length === 0) return;
13370
+ onDismiss(toasts[0].id);
13371
+ };
13372
+ document.addEventListener("keydown", onKeyDown);
13373
+ return () => document.removeEventListener("keydown", onKeyDown);
13374
+ }, [onDismiss, toasts]);
13375
+ const legible = toasts.slice(0, max);
13376
+ const overflow = Math.max(toasts.length - legible.length, 0);
13377
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
13378
+ "div",
13379
+ {
13380
+ ref,
13381
+ role: "region",
13382
+ "aria-label": label,
13383
+ className: ["flex w-full max-w-3xl flex-col", className].filter(Boolean).join(" "),
13384
+ ...rest,
13385
+ children: [
13386
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("style", { children: `@keyframes toaststack-drain{from{transform:scaleX(1)}to{transform:scaleX(0)}}` }),
13387
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "ml-auto flex w-full max-w-md flex-col gap-md", children: [
13388
+ onDismissAll && toasts.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
13389
+ Button,
13390
+ {
13391
+ type: "button",
13392
+ variant: "bare",
13393
+ size: "auto",
13394
+ onClick: onDismissAll,
13395
+ className: "rounded-sm px-xs py-xxs text-body-sm font-weight-body-sm text-muted transition duration-150 ease-out hover:text-ink",
13396
+ children: dismissAllLabel
13397
+ }
13398
+ ) }) : null,
13399
+ legible.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "flex flex-col gap-md", children: legible.map((toast) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
13400
+ ToastCard,
13401
+ {
13402
+ toast,
13403
+ state: "open",
13404
+ onDismiss: dismiss
13405
+ },
13406
+ toast.id
13407
+ )) }) : null,
13408
+ exiting.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "flex flex-col gap-md", children: exiting.map((toast) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
13409
+ ToastCard,
13410
+ {
13411
+ toast,
13412
+ state: "closed",
13413
+ onDismiss: dismiss
13414
+ },
13415
+ toast.id
13416
+ )) }) : null,
13417
+ overflow > 0 ? /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
13418
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
13419
+ "div",
13420
+ {
13421
+ "aria-hidden": "true",
13422
+ className: "-mt-sm flex flex-col items-center gap-xs",
13423
+ children: [
13424
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "flex h-4 w-11/12 items-center rounded-lg border border-hairline-soft bg-surface px-sm", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "h-1 w-full rounded-full bg-hairline" }) }),
13425
+ overflow > 1 ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "flex h-3 w-10/12 items-center rounded-lg border border-hairline-soft bg-surface-soft px-sm", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "h-1 w-2/3 rounded-full bg-hairline-soft" }) }) : null
13426
+ ]
13427
+ }
13428
+ ),
13429
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("span", { className: "sr-only", children: [
13430
+ overflow,
13431
+ " more notification",
13432
+ overflow > 1 ? "s" : "",
13433
+ " queued"
13434
+ ] })
13435
+ ] }) : null
13436
+ ] })
13437
+ ]
13438
+ }
13439
+ );
13440
+ }
13441
+ );
13442
+ ToastStack.displayName = "ToastStack";
13443
+
13167
13444
  // virtual-pkg:src/atoms/TopupModal/TopupModal.tsx
13168
13445
  var import_react47 = __toESM(require("react"));
13169
- var import_jsx_runtime56 = require("react/jsx-runtime");
13446
+ var import_jsx_runtime57 = require("react/jsx-runtime");
13170
13447
  var DEFAULT_OFFER = {
13171
13448
  credits: 1e3,
13172
13449
  price: "$10",
@@ -13184,9 +13461,9 @@ var TopupModal = import_react47.default.forwardRef(
13184
13461
  onUpgradePlan
13185
13462
  }, ref) => {
13186
13463
  const creditsLabel = offer.credits.toLocaleString();
13187
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Modal, { ref, isOpen, onClose, title, size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex w-full flex-col items-center gap-lg rounded-lg", children: [
13188
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Typography, { role: "body-md", color: "muted", className: "text-center", children: subtitle }),
13189
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
13464
+ return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Modal, { ref, isOpen, onClose, title, size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex w-full flex-col items-center gap-lg rounded-lg", children: [
13465
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Typography, { role: "body-md", color: "muted", className: "text-center", children: subtitle }),
13466
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
13190
13467
  PricingCard,
13191
13468
  {
13192
13469
  planName: `${creditsLabel} credits`,
@@ -13205,7 +13482,7 @@ var TopupModal = import_react47.default.forwardRef(
13205
13482
  onCtaClick: () => onBuy?.()
13206
13483
  }
13207
13484
  ) }),
13208
- onUpgradePlan ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Button, { variant: "ghost", size: "sm", onClick: onUpgradePlan, children: "Or pick a larger monthly plan" }) : null
13485
+ onUpgradePlan ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Button, { variant: "ghost", size: "sm", onClick: onUpgradePlan, children: "Or pick a larger monthly plan" }) : null
13209
13486
  ] }) });
13210
13487
  }
13211
13488
  );
@@ -13213,7 +13490,7 @@ TopupModal.displayName = "TopupModal";
13213
13490
 
13214
13491
  // virtual-pkg:src/atoms/UpgradeModal/UpgradeModal.tsx
13215
13492
  var import_react48 = __toESM(require("react"));
13216
- var import_jsx_runtime57 = require("react/jsx-runtime");
13493
+ var import_jsx_runtime58 = require("react/jsx-runtime");
13217
13494
  var PAID_FEATURES2 = [
13218
13495
  "npm package with managed versioning",
13219
13496
  "DESIGN.md with agent-to-agent component requests, component fixes, and token updates",
@@ -13307,14 +13584,14 @@ var UpgradeModal = import_react48.default.forwardRef(
13307
13584
  const resolvedTitle = title ?? copy.title;
13308
13585
  const resolvedSubtitle = subtitle ?? copy.subtitle;
13309
13586
  const gridClassName = plans.length === 3 ? "grid w-full grid-cols-1 sm:grid-cols-3 items-stretch gap-lg" : "grid w-full grid-cols-1 sm:grid-cols-4 items-stretch gap-lg";
13310
- return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Modal, { ref, isOpen, onClose, title: resolvedTitle, size: "2xl", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
13587
+ return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Modal, { ref, isOpen, onClose, title: resolvedTitle, size: "2xl", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
13311
13588
  "div",
13312
13589
  {
13313
13590
  "data-state": isOpen ? "open" : "closed",
13314
13591
  className: "flex w-full flex-col gap-lg rounded-lg transition duration-200 ease-out data-[state=open]:translate-y-0 data-[state=open]:opacity-100 data-[state=closed]:translate-y-2 data-[state=closed]:opacity-0",
13315
13592
  children: [
13316
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Typography, { role: "body-md", color: "muted", children: resolvedSubtitle }),
13317
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: gridClassName, children: plans.map((plan) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
13593
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Typography, { role: "body-md", color: "muted", children: resolvedSubtitle }),
13594
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: gridClassName, children: plans.map((plan) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
13318
13595
  PricingCard,
13319
13596
  {
13320
13597
  planName: plan.planName,