@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
@@ -11,12 +11,14 @@ export interface ViewToggleOption {
11
11
  value: string;
12
12
  icon: ReactNode;
13
13
  label: string;
14
+ /** Overrides this item's test id (default `${testIdPrefix}-${value}-button`). */
15
+ testId?: string;
14
16
  }
15
17
  export interface ViewToggleProps {
16
18
  options: ViewToggleOption[];
17
19
  value: string;
18
20
  onChange: (value: string) => void;
19
- /** Item test ids are `${testIdPrefix}-${value}-button`. */
21
+ /** Item test ids are `${testIdPrefix}-${value}-button` unless an option sets its own `testId`. */
20
22
  testIdPrefix?: string;
21
23
  showLabels?: boolean;
22
24
  hideTooltips?: boolean;
@@ -39,6 +41,8 @@ export interface DocumentViewToggleProps {
39
41
  labels?: Partial<DocumentViewToggleLabels>;
40
42
  /** Overrides the segmented items' prefix (default `documents-layout`: `<prefix>-<mode>-button`). */
41
43
  testIdPrefix?: string;
44
+ /** Per-mode item ids, for hosts that keep their own (e.g. `documents-view-gallery`). */
45
+ testIds?: Partial<Record<DocumentViewMode, string>>;
42
46
  /** Overrides the compact select test ids (defaults keep the current ids). */
43
47
  compactTestIds?: Partial<{
44
48
  select: string;
@@ -46,4 +50,4 @@ export interface DocumentViewToggleProps {
46
50
  }>;
47
51
  }
48
52
  /** The Documents page's Gallery / Table / Review / Smart Search switch. */
49
- export declare function DocumentViewToggle({ viewMode, onChange, compact, labels, testIdPrefix, compactTestIds, }: DocumentViewToggleProps): import("react").JSX.Element;
53
+ export declare function DocumentViewToggle({ viewMode, onChange, compact, labels, testIdPrefix, testIds, compactTestIds, }: DocumentViewToggleProps): import("react").JSX.Element;
@@ -19,9 +19,8 @@ export interface ViewerLabels {
19
19
  cropTitle: string;
20
20
  previousPage: string;
21
21
  nextPage: string;
22
- zoomIn: string;
23
- zoomOut: string;
24
- zoomReset: (level: string) => string;
22
+ /** The zoom button's accessible name; `level` is the current zoom, e.g. "150%". */
23
+ zoom: (level: string) => string;
25
24
  pageInput: string;
26
25
  pageOfTitle: string;
27
26
  pageOf: (page: number, total: number) => string;
@@ -137,19 +136,17 @@ export declare function PdfPageNav({ canPrev, canNext, onPrev, onNext, counter,
137
136
  export interface ViewerZoomControlProps {
138
137
  /** Multiplier of the fit-width size (1 = fit width). */
139
138
  zoom: number;
140
- canZoomIn: boolean;
141
- canZoomOut: boolean;
142
- onZoomIn: () => void;
143
- onZoomOut: () => void;
144
- /** Back to fit width (the level readout is the button). */
145
- onReset: () => void;
139
+ /** Steps to the next zoom level (and back to fit width after the last). */
140
+ onCycle: () => void;
146
141
  labels?: Partial<ViewerLabels>;
147
142
  testIds?: Partial<{
148
- overlay: string;
149
- in: string;
150
- out: string;
143
+ button: string;
151
144
  level: string;
152
145
  }>;
153
146
  }
154
- /** Floating zoom pill sitting just above the page control: "- 150% +". */
155
- export declare function ViewerZoomControl({ zoom, canZoomIn, canZoomOut, onZoomIn, onZoomOut, onReset, labels, testIds, }: ViewerZoomControlProps): import("react").JSX.Element;
147
+ /**
148
+ * One small zoom button for touch devices (desktop has no zoom control: the page already fits
149
+ * the width). It stays quiet at fit width and shows the level once zoomed; pinch and double-tap
150
+ * work alongside it.
151
+ */
152
+ export declare function ViewerZoomControl({ zoom, onCycle, labels, testIds }: ViewerZoomControlProps): import("react").JSX.Element;
@@ -6,7 +6,7 @@ var chunkVFUWWH52_cjs = require('../chunk-VFUWWH52.cjs');
6
6
  var chunkOB5F4577_cjs = require('../chunk-OB5F4577.cjs');
7
7
  var chunkVLCY46K6_cjs = require('../chunk-VLCY46K6.cjs');
8
8
  var chunkULWRNGGE_cjs = require('../chunk-ULWRNGGE.cjs');
9
- var chunk6ALISABK_cjs = require('../chunk-6ALISABK.cjs');
9
+ var chunkLRUCMZK6_cjs = require('../chunk-LRUCMZK6.cjs');
10
10
  var chunkV4ISCZJ7_cjs = require('../chunk-V4ISCZJ7.cjs');
11
11
  require('../chunk-PPCATBOY.cjs');
12
12
  require('../chunk-C54XEN5T.cjs');
@@ -1479,9 +1479,7 @@ var DEFAULT_VIEWER_LABELS = {
1479
1479
  cropTitle: "Crop and save as a new version",
1480
1480
  previousPage: "Previous page",
1481
1481
  nextPage: "Next page",
1482
- zoomIn: "Zoom in",
1483
- zoomOut: "Zoom out",
1484
- zoomReset: (level) => `Zoom ${level}. Click to fit the page width.`,
1482
+ zoom: (level) => `Zoom ${level}. Tap to zoom in further, then back to fit the page width.`,
1485
1483
  pageInput: "Page number input",
1486
1484
  pageOfTitle: "Click to go to page",
1487
1485
  pageOf: (page, total) => `Page ${page} of ${total}. Click to navigate.`,
@@ -1758,60 +1756,28 @@ function PdfPageNav({
1758
1756
  }
1759
1757
  );
1760
1758
  }
1761
- function ViewerZoomControl({
1762
- zoom,
1763
- canZoomIn,
1764
- canZoomOut,
1765
- onZoomIn,
1766
- onZoomOut,
1767
- onReset,
1768
- labels,
1769
- testIds
1770
- }) {
1759
+ function ViewerZoomControl({ zoom, onCycle, labels, testIds }) {
1771
1760
  const l = { ...DEFAULT_VIEWER_LABELS, ...labels };
1772
1761
  const level = `${Math.round(zoom * 100)}%`;
1762
+ const isZoomed = Math.abs(zoom - 1) > 0.02;
1773
1763
  return /* @__PURE__ */ jsxRuntime.jsxs(
1774
- "div",
1764
+ ui.Button,
1775
1765
  {
1776
- className: "absolute bottom-20 left-1/2 z-10 flex -translate-x-1/2 items-center gap-1 rounded-lg border border-border bg-background/95 px-2 py-1 shadow-lg backdrop-blur",
1777
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.overlay, { testId: "viewer-zoom-overlay" }),
1766
+ type: "button",
1767
+ variant: "ghost",
1768
+ onClick: onCycle,
1769
+ "aria-label": l.zoom(level),
1770
+ "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.button, { testId: "viewer-zoom-button" }),
1771
+ className: "absolute right-3 bottom-4 z-10 hidden h-11 min-w-11 items-center justify-center gap-1 rounded-full border border-border bg-background/95 px-2.5 shadow-md backdrop-blur pointer-coarse:inline-flex",
1778
1772
  children: [
1779
- /* @__PURE__ */ jsxRuntime.jsx(
1780
- ui.Button,
1781
- {
1782
- variant: "ghost",
1783
- size: "icon",
1784
- className: "size-7 shrink-0 pointer-coarse:size-11",
1785
- onClick: onZoomOut,
1786
- disabled: !canZoomOut,
1787
- "aria-label": l.zoomOut,
1788
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.out, { testId: "viewer-zoom-out" }),
1789
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Minus, { className: "size-4" })
1790
- }
1791
- ),
1792
- /* @__PURE__ */ jsxRuntime.jsx(
1793
- "button",
1773
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ZoomIn, { className: "size-4" }),
1774
+ isZoomed && /* @__PURE__ */ jsxRuntime.jsx(
1775
+ "span",
1794
1776
  {
1795
- type: "button",
1796
- onClick: onReset,
1797
- className: "min-w-12 rounded px-1 text-center text-sm font-medium tabular-nums hover:bg-muted pointer-coarse:min-h-11",
1798
- "aria-label": l.zoomReset(level),
1777
+ className: "text-xs font-medium tabular-nums",
1799
1778
  "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.level, { testId: "viewer-zoom-level" }),
1800
1779
  children: level
1801
1780
  }
1802
- ),
1803
- /* @__PURE__ */ jsxRuntime.jsx(
1804
- ui.Button,
1805
- {
1806
- variant: "ghost",
1807
- size: "icon",
1808
- className: "size-7 shrink-0 pointer-coarse:size-11",
1809
- onClick: onZoomIn,
1810
- disabled: !canZoomIn,
1811
- "aria-label": l.zoomIn,
1812
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.in, { testId: "viewer-zoom-in" }),
1813
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "size-4" })
1814
- }
1815
1781
  )
1816
1782
  ]
1817
1783
  }
@@ -1971,7 +1937,7 @@ var DOCUMENT_GRID_CLASS = "w-full [&_.cell-empty]:text-muted-foreground [&_.ag-r
1971
1937
  function DocumentGrid({
1972
1938
  layout,
1973
1939
  presets,
1974
- GridComponent = chunk6ALISABK_cjs.GridView,
1940
+ GridComponent = chunkLRUCMZK6_cjs.GridView,
1975
1941
  emptyWorkspace,
1976
1942
  showEmptyWorkspace,
1977
1943
  testId = "documents-grid",
@@ -7371,19 +7337,19 @@ function ExplorerDragPreview({ icon, title, count }) {
7371
7337
 
7372
7338
  Object.defineProperty(exports, "DEFAULT_DOCUMENT_VIEW_TOGGLE_LABELS", {
7373
7339
  enumerable: true,
7374
- get: function () { return chunk6ALISABK_cjs.DEFAULT_DOCUMENT_VIEW_TOGGLE_LABELS; }
7340
+ get: function () { return chunkLRUCMZK6_cjs.DEFAULT_DOCUMENT_VIEW_TOGGLE_LABELS; }
7375
7341
  });
7376
7342
  Object.defineProperty(exports, "DocumentViewToggle", {
7377
7343
  enumerable: true,
7378
- get: function () { return chunk6ALISABK_cjs.DocumentViewToggle; }
7344
+ get: function () { return chunkLRUCMZK6_cjs.DocumentViewToggle; }
7379
7345
  });
7380
7346
  Object.defineProperty(exports, "GridView", {
7381
7347
  enumerable: true,
7382
- get: function () { return chunk6ALISABK_cjs.GridView; }
7348
+ get: function () { return chunkLRUCMZK6_cjs.GridView; }
7383
7349
  });
7384
7350
  Object.defineProperty(exports, "ViewToggle", {
7385
7351
  enumerable: true,
7386
- get: function () { return chunk6ALISABK_cjs.ViewToggle; }
7352
+ get: function () { return chunkLRUCMZK6_cjs.ViewToggle; }
7387
7353
  });
7388
7354
  Object.defineProperty(exports, "DEFAULT_SELECTION_BAR_LABELS", {
7389
7355
  enumerable: true,