@arbidocs/blocks 0.4.0 → 0.4.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.
Files changed (74) hide show
  1. package/README.md +22 -0
  2. package/dist/{chunk-7G3JNSJB.cjs → chunk-2K33YGM6.cjs} +51 -14
  3. package/dist/chunk-2K33YGM6.cjs.map +1 -0
  4. package/dist/{chunk-S5T7ZTX2.js → chunk-2ORA62OF.js} +3 -3
  5. package/dist/{chunk-S5T7ZTX2.js.map → chunk-2ORA62OF.js.map} +1 -1
  6. package/dist/{chunk-RBXZYNVB.js → chunk-6P6AEQJB.js} +195 -35
  7. package/dist/chunk-6P6AEQJB.js.map +1 -0
  8. package/dist/{chunk-5TYEJOXY.js → chunk-7PEELPMA.js} +52 -15
  9. package/dist/chunk-7PEELPMA.js.map +1 -0
  10. package/dist/{chunk-KUA3BCT2.cjs → chunk-AE5FHFZ5.cjs} +6 -6
  11. package/dist/{chunk-KUA3BCT2.cjs.map → chunk-AE5FHFZ5.cjs.map} +1 -1
  12. package/dist/{chunk-FZQJ2S6P.cjs → chunk-DREI7EQ2.cjs} +197 -33
  13. package/dist/chunk-DREI7EQ2.cjs.map +1 -0
  14. package/dist/chunk-J2BGSWXM.cjs +990 -0
  15. package/dist/chunk-J2BGSWXM.cjs.map +1 -0
  16. package/dist/{chunk-6ALISABK.cjs → chunk-LRUCMZK6.cjs} +7 -4
  17. package/dist/{chunk-6ALISABK.cjs.map → chunk-LRUCMZK6.cjs.map} +1 -1
  18. package/dist/chunk-OBLSURHV.js +973 -0
  19. package/dist/chunk-OBLSURHV.js.map +1 -0
  20. package/dist/{chunk-DVLEQURC.js → chunk-QXEJXIP4.js} +7 -4
  21. package/dist/{chunk-DVLEQURC.js.map → chunk-QXEJXIP4.js.map} +1 -1
  22. package/dist/collaboration/index.cjs +1 -1
  23. package/dist/collaboration/index.js +1 -1
  24. package/dist/components/Chart.d.ts +9 -1
  25. package/dist/components/ContactForm.d.ts +15 -3
  26. package/dist/components/TeamGrid.d.ts +14 -2
  27. package/dist/components/editorial/ArticleList.d.ts +32 -0
  28. package/dist/components/editorial/Bands.d.ts +29 -0
  29. package/dist/components/editorial/EditorialHeading.d.ts +17 -0
  30. package/dist/components/editorial/EditorialHero.d.ts +46 -0
  31. package/dist/components/editorial/EditorialSection.d.ts +47 -0
  32. package/dist/components/editorial/Eyebrow.d.ts +14 -0
  33. package/dist/components/editorial/PanelGrid.d.ts +45 -0
  34. package/dist/components/editorial/ProfileCard.d.ts +27 -0
  35. package/dist/components/editorial/PullQuote.d.ts +17 -0
  36. package/dist/components/editorial/Reveal.d.ts +15 -0
  37. package/dist/components/editorial/index.d.ts +12 -0
  38. package/dist/components/editorial/lists.d.ts +42 -0
  39. package/dist/components/editorial/tone.d.ts +33 -0
  40. package/dist/facts/FactsViewToggle.d.ts +3 -1
  41. package/dist/facts/fact-row.d.ts +32 -0
  42. package/dist/facts/index.cjs +34 -5
  43. package/dist/facts/index.cjs.map +1 -1
  44. package/dist/facts/index.d.ts +1 -0
  45. package/dist/facts/index.js +31 -4
  46. package/dist/facts/index.js.map +1 -1
  47. package/dist/files/ViewToggle.d.ts +6 -2
  48. package/dist/files/ViewerChrome.d.ts +11 -14
  49. package/dist/files/index.cjs +20 -54
  50. package/dist/files/index.cjs.map +1 -1
  51. package/dist/files/index.js +17 -51
  52. package/dist/files/index.js.map +1 -1
  53. package/dist/index.cjs +161 -101
  54. package/dist/index.d.ts +1 -0
  55. package/dist/index.js +6 -6
  56. package/dist/shell/ActionCluster.d.ts +7 -2
  57. package/dist/shell/AskField.d.ts +6 -1
  58. package/dist/shell/index.cjs +42 -42
  59. package/dist/shell/index.js +1 -1
  60. package/dist/site/index.cjs +107 -47
  61. package/dist/site/index.d.ts +1 -0
  62. package/dist/site/index.js +2 -2
  63. package/dist/studio/index.cjs +71 -71
  64. package/dist/studio/index.js +3 -3
  65. package/package.json +3 -3
  66. package/src/blocks.css +17 -0
  67. package/dist/chunk-5TYEJOXY.js.map +0 -1
  68. package/dist/chunk-7G3JNSJB.cjs.map +0 -1
  69. package/dist/chunk-FZQJ2S6P.cjs.map +0 -1
  70. package/dist/chunk-MMYCZRKT.cjs +0 -168
  71. package/dist/chunk-MMYCZRKT.cjs.map +0 -1
  72. package/dist/chunk-RBXZYNVB.js.map +0 -1
  73. package/dist/chunk-UTWX2X2A.js +0 -165
  74. package/dist/chunk-UTWX2X2A.js.map +0 -1
@@ -1228,6 +1228,11 @@ function VideoEmbed({
1228
1228
  }
1229
1229
  ) : url ? /* @__PURE__ */ jsxRuntime.jsx("video", { src: url, controls: true, className: "size-full", "data-testid": testId && `${testId}-video` }) : null });
1230
1230
  }
1231
+ function initialValues(fields) {
1232
+ const values = {};
1233
+ for (const f of fields) values[f.name] = f.defaultValue ?? "";
1234
+ return values;
1235
+ }
1231
1236
  var INPUT_CLASS = "w-full rounded-md border border-border bg-card px-3 py-2 text-sm text-foreground outline-none focus:border-primary";
1232
1237
  function ContactForm({
1233
1238
  fields,
@@ -1236,18 +1241,34 @@ function ContactForm({
1236
1241
  onSubmit,
1237
1242
  successMessage = "Thanks \u2014 we\u2019ll be in touch shortly.",
1238
1243
  renderSuccess,
1244
+ resetLabel,
1245
+ onValuesChange,
1246
+ footerSlot,
1239
1247
  testId,
1240
1248
  testIds
1241
1249
  }) {
1242
1250
  const [sentValues, setSentValues] = react.useState(null);
1243
1251
  const [isSending, setIsSending] = react.useState(false);
1244
1252
  const list = fields ?? [];
1253
+ const [liveValues, setLiveValues] = react.useState(() => initialValues(list));
1245
1254
  const ids = {
1246
1255
  form: testIds?.form ?? testId,
1247
1256
  success: testIds?.success ?? (testId ? `${testId}-success` : void 0),
1248
1257
  submit: testIds?.submit ?? (testId ? `${testId}-submit` : void 0),
1249
1258
  field: (name) => testIds?.field?.(name) ?? (testId ? `${testId}-field-${name}` : void 0)
1250
1259
  };
1260
+ const reset = () => {
1261
+ setLiveValues(initialValues(list));
1262
+ setSentValues(null);
1263
+ };
1264
+ const handleChange = (e) => {
1265
+ const values = { ...initialValues(list) };
1266
+ new FormData(e.currentTarget).forEach((v, k) => {
1267
+ if (typeof v === "string") values[k] = v;
1268
+ });
1269
+ setLiveValues(values);
1270
+ onValuesChange?.(values);
1271
+ };
1251
1272
  const handleSubmit = async (e) => {
1252
1273
  if (action && !onSubmit) return;
1253
1274
  e.preventDefault();
@@ -1268,13 +1289,16 @@ function ContactForm({
1268
1289
  setSentValues(values);
1269
1290
  };
1270
1291
  if (sentValues) {
1271
- return renderSuccess ? /* @__PURE__ */ jsxRuntime.jsx("div", { "data-testid": ids.success, children: renderSuccess(sentValues) }) : /* @__PURE__ */ jsxRuntime.jsx(
1272
- "p",
1292
+ return renderSuccess ? /* @__PURE__ */ jsxRuntime.jsx("div", { "data-testid": ids.success, children: renderSuccess(sentValues, reset) }) : /* @__PURE__ */ jsxRuntime.jsxs(
1293
+ "div",
1273
1294
  {
1274
1295
  className: "rounded-lg border border-border bg-muted p-6 text-center text-sm text-foreground",
1275
1296
  role: "status",
1276
1297
  "data-testid": ids.success,
1277
- children: successMessage
1298
+ children: [
1299
+ /* @__PURE__ */ jsxRuntime.jsx("p", { children: successMessage }),
1300
+ resetLabel && /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { type: "button", variant: "outline", className: "mt-4", onClick: reset, children: resetLabel })
1301
+ ]
1278
1302
  }
1279
1303
  );
1280
1304
  }
@@ -1284,6 +1308,7 @@ function ContactForm({
1284
1308
  action,
1285
1309
  method: action && !onSubmit ? "post" : void 0,
1286
1310
  onSubmit: handleSubmit,
1311
+ onChange: handleChange,
1287
1312
  className: "mx-auto flex max-w-xl flex-col gap-4",
1288
1313
  "data-testid": ids.form,
1289
1314
  children: [
@@ -1326,6 +1351,7 @@ function ContactForm({
1326
1351
  }
1327
1352
  )
1328
1353
  ] }, i)),
1354
+ typeof footerSlot === "function" ? footerSlot(liveValues) : footerSlot,
1329
1355
  /* @__PURE__ */ jsxRuntime.jsx(
1330
1356
  ui.Button,
1331
1357
  {
@@ -1396,41 +1422,175 @@ function MediaText({
1396
1422
  copy
1397
1423
  ] }) });
1398
1424
  }
1425
+ var TONES = {
1426
+ default: {
1427
+ text: "text-foreground",
1428
+ muted: "text-muted-foreground",
1429
+ subtle: "text-muted-foreground",
1430
+ accent: "text-primary",
1431
+ hairline: "border-border",
1432
+ panel: "border-border bg-card text-card-foreground",
1433
+ panelHover: "hover:border-primary/45 hover:bg-muted/60",
1434
+ chip: "border-border text-muted-foreground",
1435
+ tile: "border-primary/30 text-primary"
1436
+ },
1437
+ inverse: {
1438
+ text: "text-background",
1439
+ muted: "text-background/70",
1440
+ subtle: "text-background/55",
1441
+ accent: "text-primary",
1442
+ hairline: "border-background/15",
1443
+ panel: "border-background/15 bg-background/5 text-background",
1444
+ panelHover: "hover:border-primary/45 hover:bg-background/10",
1445
+ chip: "border-background/20 text-background/65",
1446
+ tile: "border-primary/40 text-primary"
1447
+ }
1448
+ };
1449
+ var EditorialToneContext = react.createContext("default");
1450
+ function useEditorialTone(override) {
1451
+ const inherited = react.useContext(EditorialToneContext);
1452
+ const tone = override ?? inherited;
1453
+ return { tone, ...TONES[tone] };
1454
+ }
1455
+ function formatIndex(index) {
1456
+ return typeof index === "number" ? String(index).padStart(2, "0") : index;
1457
+ }
1458
+ var CLAMP = { 2: "line-clamp-2", 3: "line-clamp-3", 4: "line-clamp-4" };
1459
+ function ProfileCard({
1460
+ name,
1461
+ role,
1462
+ kicker,
1463
+ bio,
1464
+ avatarUrl,
1465
+ avatar,
1466
+ avatarClassName,
1467
+ meta,
1468
+ href,
1469
+ linkComponent,
1470
+ bioLines = 3,
1471
+ headingLevel = 3,
1472
+ className,
1473
+ testId
1474
+ }) {
1475
+ const t = useEditorialTone();
1476
+ const Heading = `h${headingLevel}`;
1477
+ return /* @__PURE__ */ jsxRuntime.jsx(BlockLink, { href, linkComponent, className: "group block h-full", children: /* @__PURE__ */ jsxRuntime.jsxs(
1478
+ "article",
1479
+ {
1480
+ className: ui.cn(
1481
+ "flex h-full flex-col rounded-sm border p-6 transition-colors duration-300",
1482
+ t.panel,
1483
+ href && t.panelHover,
1484
+ className
1485
+ ),
1486
+ "data-slot": "profile-card",
1487
+ "data-testid": testId,
1488
+ children: [
1489
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-4", children: [
1490
+ avatar ?? /* @__PURE__ */ jsxRuntime.jsxs(ui.Avatar, { className: "size-14 text-sm", children: [
1491
+ avatarUrl && /* @__PURE__ */ jsxRuntime.jsx(ui.AvatarImage, { src: avatarUrl, alt: "" }),
1492
+ /* @__PURE__ */ jsxRuntime.jsx(ui.AvatarFallback, { className: avatarClassName, children: chunkWJMEXTVD_cjs.initials(name || "?") })
1493
+ ] }),
1494
+ href && /* @__PURE__ */ jsxRuntime.jsx(
1495
+ lucideReact.ArrowUpRight,
1496
+ {
1497
+ "aria-hidden": "true",
1498
+ className: ui.cn("size-4 shrink-0 transition-colors group-hover:text-primary", t.subtle)
1499
+ }
1500
+ )
1501
+ ] }),
1502
+ /* @__PURE__ */ jsxRuntime.jsx(Heading, { className: ui.cn("mt-5 font-display text-lg font-semibold", t.text), children: name }),
1503
+ role && /* @__PURE__ */ jsxRuntime.jsx("p", { className: ui.cn("text-sm", t.muted), children: role }),
1504
+ kicker && /* @__PURE__ */ jsxRuntime.jsx("p", { className: ui.cn("mt-0.5 text-xs", t.accent), children: kicker }),
1505
+ bio && /* @__PURE__ */ jsxRuntime.jsx(
1506
+ "p",
1507
+ {
1508
+ className: ui.cn(
1509
+ "mt-4 text-sm leading-relaxed",
1510
+ t.muted,
1511
+ bioLines ? CLAMP[bioLines] : void 0
1512
+ ),
1513
+ children: bio
1514
+ }
1515
+ ),
1516
+ meta && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-auto pt-5", children: meta })
1517
+ ]
1518
+ }
1519
+ ) });
1520
+ }
1399
1521
  var COLS3 = {
1400
1522
  "2": "sm:grid-cols-2",
1401
1523
  "3": "sm:grid-cols-2 lg:grid-cols-3",
1402
1524
  "4": "sm:grid-cols-2 lg:grid-cols-4"
1403
1525
  };
1404
- function TeamGrid({ members, columns = "3", linkComponent, testId }) {
1405
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: ui.cn("grid gap-6", COLS3[columns] ?? COLS3["3"]), "data-testid": testId, children: (members ?? []).map((m, i) => /* @__PURE__ */ jsxRuntime.jsx(
1406
- BlockLink,
1526
+ function TeamGrid({
1527
+ members,
1528
+ columns = "3",
1529
+ variant = "centered",
1530
+ renderMeta,
1531
+ linkComponent,
1532
+ testId
1533
+ }) {
1534
+ const profile = variant === "profile";
1535
+ return /* @__PURE__ */ jsxRuntime.jsx(
1536
+ "div",
1407
1537
  {
1408
- href: m.href,
1409
- linkComponent,
1410
- className: ui.cn("block h-full", m.href && "group"),
1411
- children: /* @__PURE__ */ jsxRuntime.jsxs(
1412
- ui.Card,
1413
- {
1414
- variant: "outline",
1415
- className: ui.cn(
1416
- "flex h-full flex-col items-center p-6 text-center",
1417
- m.href && "transition-colors group-hover:border-primary/40"
1418
- ),
1419
- "data-testid": testId && `${testId}-item-${i}`,
1420
- children: [
1421
- /* @__PURE__ */ jsxRuntime.jsxs(ui.Avatar, { className: "size-20", children: [
1422
- m.avatarUrl && /* @__PURE__ */ jsxRuntime.jsx(ui.AvatarImage, { src: m.avatarUrl, alt: m.name }),
1423
- /* @__PURE__ */ jsxRuntime.jsx(ui.AvatarFallback, { children: chunkWJMEXTVD_cjs.initials(m.name || "?") })
1424
- ] }),
1425
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "mt-4 text-base font-semibold tracking-tight", children: m.name }),
1426
- m.role && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-primary", children: m.role }),
1427
- m.bio && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-2 text-sm leading-relaxed text-muted-foreground", children: m.bio })
1428
- ]
1538
+ className: ui.cn("grid", profile ? "gap-4" : "gap-6", COLS3[columns] ?? COLS3["3"]),
1539
+ "data-testid": testId,
1540
+ children: (members ?? []).map((m, i) => {
1541
+ const cardTestId = m.testId ?? (testId ? `${testId}-item-${i}` : void 0);
1542
+ const meta = renderMeta?.(m, i);
1543
+ if (profile) {
1544
+ return /* @__PURE__ */ jsxRuntime.jsx(
1545
+ ProfileCard,
1546
+ {
1547
+ name: m.name,
1548
+ role: m.role,
1549
+ kicker: m.kicker,
1550
+ bio: m.bio,
1551
+ avatarUrl: m.avatarUrl,
1552
+ href: m.href,
1553
+ linkComponent,
1554
+ meta,
1555
+ testId: cardTestId
1556
+ },
1557
+ i
1558
+ );
1429
1559
  }
1430
- )
1431
- },
1432
- i
1433
- )) });
1560
+ return /* @__PURE__ */ jsxRuntime.jsx(
1561
+ BlockLink,
1562
+ {
1563
+ href: m.href,
1564
+ linkComponent,
1565
+ className: ui.cn("block h-full", m.href && "group"),
1566
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
1567
+ ui.Card,
1568
+ {
1569
+ variant: "outline",
1570
+ className: ui.cn(
1571
+ "flex h-full flex-col items-center p-6 text-center",
1572
+ m.href && "transition-colors group-hover:border-primary/40"
1573
+ ),
1574
+ "data-testid": cardTestId,
1575
+ children: [
1576
+ /* @__PURE__ */ jsxRuntime.jsxs(ui.Avatar, { className: "size-20", children: [
1577
+ m.avatarUrl && /* @__PURE__ */ jsxRuntime.jsx(ui.AvatarImage, { src: m.avatarUrl, alt: m.name }),
1578
+ /* @__PURE__ */ jsxRuntime.jsx(ui.AvatarFallback, { children: chunkWJMEXTVD_cjs.initials(m.name || "?") })
1579
+ ] }),
1580
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "mt-4 text-base font-semibold tracking-tight", children: m.name }),
1581
+ m.role && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-primary", children: m.role }),
1582
+ m.kicker && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: m.kicker }),
1583
+ m.bio && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-2 text-sm leading-relaxed text-muted-foreground", children: m.bio }),
1584
+ meta && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-4", children: meta })
1585
+ ]
1586
+ }
1587
+ )
1588
+ },
1589
+ i
1590
+ );
1591
+ })
1592
+ }
1593
+ );
1434
1594
  }
1435
1595
  function Steps({ steps, variant = "numbered", testId }) {
1436
1596
  const list = steps ?? [];
@@ -1495,6 +1655,7 @@ exports.CTABanner = CTABanner;
1495
1655
  exports.Columns = Columns;
1496
1656
  exports.ContactForm = ContactForm;
1497
1657
  exports.Container = Container;
1658
+ exports.EditorialToneContext = EditorialToneContext;
1498
1659
  exports.FAQ = FAQ;
1499
1660
  exports.FONT_PAIRINGS = FONT_PAIRINGS;
1500
1661
  exports.FeatureGrid = FeatureGrid;
@@ -1506,6 +1667,7 @@ exports.LogoCloud = LogoCloud;
1506
1667
  exports.MediaText = MediaText;
1507
1668
  exports.Navbar = Navbar;
1508
1669
  exports.PricingTable = PricingTable;
1670
+ exports.ProfileCard = ProfileCard;
1509
1671
  exports.RichTextBlock = RichTextBlock;
1510
1672
  exports.SectionHeading = SectionHeading;
1511
1673
  exports.Spacer = Spacer;
@@ -1526,6 +1688,7 @@ exports.clearFontVars = clearFontVars;
1526
1688
  exports.clearThemeVars = clearThemeVars;
1527
1689
  exports.createThemeStore = createThemeStore;
1528
1690
  exports.fontPackages = fontPackages;
1691
+ exports.formatIndex = formatIndex;
1529
1692
  exports.getFontPairing = getFontPairing;
1530
1693
  exports.isAssetRef = isAssetRef;
1531
1694
  exports.matchFontPairing = matchFontPairing;
@@ -1534,5 +1697,6 @@ exports.toEmbedUrl = toEmbedUrl;
1534
1697
  exports.toHslTriplet = toHslTriplet;
1535
1698
  exports.useAssetRenderer = useAssetRenderer;
1536
1699
  exports.useAssetResolverActive = useAssetResolverActive;
1537
- //# sourceMappingURL=chunk-FZQJ2S6P.cjs.map
1538
- //# sourceMappingURL=chunk-FZQJ2S6P.cjs.map
1700
+ exports.useEditorialTone = useEditorialTone;
1701
+ //# sourceMappingURL=chunk-DREI7EQ2.cjs.map
1702
+ //# sourceMappingURL=chunk-DREI7EQ2.cjs.map