@surreal-ui/catalog 0.10.1 → 0.11.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.
@@ -73,6 +73,32 @@ interface DonutChartProps {
73
73
  /** Parts of a whole as slices of a ring, one colour per slice, with a legend. (editor `donut-chart`, coloured by the aesthetic's roles.) */
74
74
  declare function DonutChart({ slices, title, unit, width, height, className, style }: DonutChartProps): React.JSX.Element;
75
75
 
76
+ interface FlowProps {
77
+ /** The steps, in order. */
78
+ steps: {
79
+ id?: string;
80
+ label: string;
81
+ }[];
82
+ /** Arrows between steps by id (default: each step to the next). */
83
+ links?: {
84
+ from: string;
85
+ to: string;
86
+ label?: string;
87
+ }[];
88
+ /** LR left to right (default) or TD top down. */
89
+ direction?: 'LR' | 'TD';
90
+ /** Accessible name (default: built from the steps). */
91
+ title?: string;
92
+ /** Width in CSS px. */
93
+ width?: number;
94
+ /** Height in CSS px. */
95
+ height?: number;
96
+ className?: string;
97
+ style?: React.CSSProperties;
98
+ }
99
+ /** A process as boxes joined by arrows, left to right or top down, in the diagram editor's layout. (editor `flow`, coloured by the aesthetic's roles.) */
100
+ declare function Flow({ steps, links, direction, title, width, height, className, style }: FlowProps): React.JSX.Element;
101
+
76
102
  interface LineChartProps {
77
103
  /** Labels along the x axis, in order. */
78
104
  categories: string[];
@@ -123,6 +149,31 @@ interface LineageProps {
123
149
  /** One root fanned out to a row of items with rounded connectors that never cross, labels sized to fit their columns; draws on from the root, and focusing an item lights its branch. (editor `lineage`, coloured by the aesthetic's roles.) */
124
150
  declare function Lineage({ root, items, title, focus, onFocusChange, progress, animate, duration, width, height, className, style }: LineageProps): React.JSX.Element;
125
151
 
152
+ interface MindmapProps {
153
+ /** The central idea. */
154
+ root: string;
155
+ /** Branches round the root, each with up to two levels of children. */
156
+ branches: {
157
+ label: string;
158
+ children?: {
159
+ label: string;
160
+ children?: {
161
+ label: string;
162
+ }[];
163
+ }[];
164
+ }[];
165
+ /** Accessible name (default: built from the root). */
166
+ title?: string;
167
+ /** Width in CSS px. */
168
+ width?: number;
169
+ /** Height in CSS px. */
170
+ height?: number;
171
+ className?: string;
172
+ style?: React.CSSProperties;
173
+ }
174
+ /** A central idea with branches and sub-branches spread round it, one colour per branch. (editor `mindmap`, coloured by the aesthetic's roles.) */
175
+ declare function Mindmap({ root, branches, title, width, height, className, style }: MindmapProps): React.JSX.Element;
176
+
126
177
  interface SparklineProps {
127
178
  /** The values in order, left to right. */
128
179
  values: number[];
@@ -138,6 +189,24 @@ interface SparklineProps {
138
189
  /** A word-sized line chart of one run of values, without axes or labels. (editor `sparkline`, coloured by the aesthetic's roles.) */
139
190
  declare function Sparkline({ values, label, width, height, className, style }: SparklineProps): React.JSX.Element;
140
191
 
192
+ interface TimelineProps {
193
+ /** Periods in order, each with its events. */
194
+ periods: {
195
+ label: string;
196
+ events: string[];
197
+ }[];
198
+ /** Title drawn above the timeline and used as its accessible name. */
199
+ title?: string;
200
+ /** Width in CSS px. */
201
+ width?: number;
202
+ /** Height in CSS px. */
203
+ height?: number;
204
+ className?: string;
205
+ style?: React.CSSProperties;
206
+ }
207
+ /** Periods along an axis, each with its events stacked under it, one colour per period. (editor `timeline`, coloured by the aesthetic's roles.) */
208
+ declare function Timeline({ periods, title, width, height, className, style }: TimelineProps): React.JSX.Element;
209
+
141
210
  interface WeaveProps {
142
211
  /** Items along the top, each with the tags it has; tags along the bottom in order of first appearance (at most 24). */
143
212
  items: {
@@ -165,4 +234,4 @@ interface WeaveProps {
165
234
  /** Items along the top joined to the tags they share along the bottom, many to many; focusing an item lights its tags, and focusing a tag lights its items. (editor `weave`, coloured by the aesthetic's roles.) */
166
235
  declare function Weave({ items, title, focus, onFocusChange, progress, animate, duration, width, height, className, style }: WeaveProps): React.JSX.Element;
167
236
 
168
- export { BarChart, type BarChartProps, Braid, type BraidProps, DonutChart, type DonutChartProps, LineChart, type LineChartProps, Lineage, type LineageProps, Sparkline, type SparklineProps, Weave, type WeaveProps };
237
+ export { BarChart, type BarChartProps, Braid, type BraidProps, DonutChart, type DonutChartProps, Flow, type FlowProps, LineChart, type LineChartProps, Lineage, type LineageProps, Mindmap, type MindmapProps, Sparkline, type SparklineProps, Timeline, type TimelineProps, Weave, type WeaveProps };
@@ -236,17 +236,17 @@ function DonutChart({
236
236
  );
237
237
  }
238
238
 
239
- // ../../components/line-chart/react.tsx
239
+ // ../../components/flow/react.tsx
240
240
  import * as React4 from "react";
241
- import { uiComponents as uiComponents4 } from "@pixerate/editor/chart";
241
+ import { diagramUiComponents } from "@pixerate/editor/canvas";
242
242
  import { jsx as jsx4 } from "react/jsx-runtime";
243
- var ROLES4 = ["surface", "ink", "ink-muted", "border", "accent"];
244
- var COMPONENT4 = uiComponents4().find((c) => c.id === "line-chart");
245
- function LineChart({
246
- categories,
247
- series,
243
+ var ROLES4 = ["surface", "surface-raised", "ink", "ink-muted", "border", "accent"];
244
+ var COMPONENT4 = diagramUiComponents().find((c) => c.id === "flow");
245
+ function Flow({
246
+ steps,
247
+ links,
248
+ direction,
248
249
  title,
249
- unit,
250
250
  width,
251
251
  height,
252
252
  className,
@@ -259,7 +259,7 @@ function LineChart({
259
259
  const el = ref.current?.parentElement;
260
260
  if (!el || width !== void 0) return;
261
261
  const observer = new ResizeObserver(
262
- ([entry]) => setMeasured(Math.max(200, Math.round(entry.contentRect.width)))
262
+ ([entry]) => setMeasured(Math.max(240, Math.round(entry.contentRect.width)))
263
263
  );
264
264
  observer.observe(el);
265
265
  return () => observer.disconnect();
@@ -268,9 +268,9 @@ function LineChart({
268
268
  const h = height ?? 240;
269
269
  const data = React4.useMemo(
270
270
  () => Object.fromEntries(
271
- Object.entries({ categories, series, title, unit }).filter(([, v]) => v !== void 0)
271
+ Object.entries({ steps, links, direction, title }).filter(([, v]) => v !== void 0)
272
272
  ),
273
- [categories, series, title, unit]
273
+ [steps, links, direction, title]
274
274
  );
275
275
  const svg = React4.useMemo(
276
276
  () => w === void 0 ? "" : COMPONENT4.render(data, {
@@ -292,13 +292,69 @@ function LineChart({
292
292
  );
293
293
  }
294
294
 
295
- // ../../components/lineage/react.tsx
295
+ // ../../components/line-chart/react.tsx
296
296
  import * as React5 from "react";
297
+ import { uiComponents as uiComponents4 } from "@pixerate/editor/chart";
298
+ import { jsx as jsx5 } from "react/jsx-runtime";
299
+ var ROLES5 = ["surface", "ink", "ink-muted", "border", "accent"];
300
+ var COMPONENT5 = uiComponents4().find((c) => c.id === "line-chart");
301
+ function LineChart({
302
+ categories,
303
+ series,
304
+ title,
305
+ unit,
306
+ width,
307
+ height,
308
+ className,
309
+ style
310
+ }) {
311
+ const ref = React5.useRef(null);
312
+ const colors = useRoleColors(ref, ROLES5);
313
+ const [measured, setMeasured] = React5.useState(void 0);
314
+ React5.useEffect(() => {
315
+ const el = ref.current?.parentElement;
316
+ if (!el || width !== void 0) return;
317
+ const observer = new ResizeObserver(
318
+ ([entry]) => setMeasured(Math.max(200, Math.round(entry.contentRect.width)))
319
+ );
320
+ observer.observe(el);
321
+ return () => observer.disconnect();
322
+ }, [width]);
323
+ const w = width ?? measured;
324
+ const h = height ?? 240;
325
+ const data = React5.useMemo(
326
+ () => Object.fromEntries(
327
+ Object.entries({ categories, series, title, unit }).filter(([, v]) => v !== void 0)
328
+ ),
329
+ [categories, series, title, unit]
330
+ );
331
+ const svg = React5.useMemo(
332
+ () => w === void 0 ? "" : COMPONENT5.render(data, {
333
+ width: w,
334
+ height: h,
335
+ theme: colors?.scheme ?? "light",
336
+ ...colors ? { colors: colors.css } : {}
337
+ }),
338
+ [data, w, h, colors]
339
+ );
340
+ return /* @__PURE__ */ jsx5(
341
+ "span",
342
+ {
343
+ ref,
344
+ className: ["sui-provider", className].filter(Boolean).join(" "),
345
+ style: { display: "inline-block", width: w ?? "100%", height: h, ...style },
346
+ dangerouslySetInnerHTML: { __html: svg }
347
+ }
348
+ );
349
+ }
350
+
351
+ // ../../components/lineage/react.tsx
352
+ import * as React6 from "react";
297
353
  import { uiComponents as uiComponents5 } from "@pixerate/editor/chart";
298
354
  import { createLinkFocus as createLinkFocus2 } from "@pixerate/editor/tools";
299
- import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
300
- var ROLES5 = ["surface", "ink", "ink-muted", "accent"];
301
- var COMPONENT5 = uiComponents5().find((c) => c.id === "lineage");
355
+ import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
356
+ var ROLES6 = ["surface", "ink", "ink-muted", "accent"];
357
+ var COMPONENT6 = uiComponents5().find((c) => c.id === "lineage");
302
358
  var VISUALLY_HIDDEN2 = {
303
359
  position: "absolute",
304
360
  width: 1,
@@ -321,10 +377,10 @@ function Lineage({
321
377
  className,
322
378
  style
323
379
  }) {
324
- const ref = React5.useRef(null);
325
- const colors = useRoleColors(ref, ROLES5);
326
- const [measured, setMeasured] = React5.useState(void 0);
327
- React5.useEffect(() => {
380
+ const ref = React6.useRef(null);
381
+ const colors = useRoleColors(ref, ROLES6);
382
+ const [measured, setMeasured] = React6.useState(void 0);
383
+ React6.useEffect(() => {
328
384
  const el = ref.current?.parentElement;
329
385
  if (!el || width !== void 0) return;
330
386
  const observer = new ResizeObserver(
@@ -335,13 +391,13 @@ function Lineage({
335
391
  }, [width]);
336
392
  const w = width ?? measured;
337
393
  const h = height ?? 240;
338
- const data = React5.useMemo(
394
+ const data = React6.useMemo(
339
395
  () => Object.fromEntries(Object.entries({ root, items, title }).filter(([, v]) => v !== void 0)),
340
396
  [root, items, title]
341
397
  );
342
398
  const controlled = progress !== void 0;
343
- const [played, setPlayed] = React5.useState(controlled || animate === false ? 1 : 0);
344
- React5.useEffect(() => {
399
+ const [played, setPlayed] = React6.useState(controlled || animate === false ? 1 : 0);
400
+ React6.useEffect(() => {
345
401
  if (controlled || animate === false) return;
346
402
  if (typeof matchMedia === "function" && matchMedia("(prefers-reduced-motion: reduce)").matches) {
347
403
  setPlayed(1);
@@ -359,28 +415,28 @@ function Lineage({
359
415
  return () => cancelAnimationFrame(frame);
360
416
  }, [controlled, animate, duration]);
361
417
  const p = Math.min(1, Math.max(0, progress ?? played));
362
- const dataKey = React5.useMemo(() => JSON.stringify(data), [data]);
363
- const model = React5.useMemo(
364
- () => createLinkFocus2(COMPONENT5.interaction(JSON.parse(dataKey))),
418
+ const dataKey = React6.useMemo(() => JSON.stringify(data), [data]);
419
+ const model = React6.useMemo(
420
+ () => createLinkFocus2(COMPONENT6.interaction(JSON.parse(dataKey))),
365
421
  [dataKey]
366
422
  );
367
- const [ownFocus, setOwnFocus] = React5.useState(null);
368
- const onFocusChangeRef = React5.useRef(onFocusChange);
423
+ const [ownFocus, setOwnFocus] = React6.useState(null);
424
+ const onFocusChangeRef = React6.useRef(onFocusChange);
369
425
  onFocusChangeRef.current = onFocusChange;
370
- React5.useEffect(() => {
426
+ React6.useEffect(() => {
371
427
  setOwnFocus(model.getState().focus);
372
428
  return model.subscribe((state) => {
373
429
  setOwnFocus(state.focus);
374
430
  onFocusChangeRef.current?.(state.focus);
375
431
  });
376
432
  }, [model]);
377
- React5.useEffect(() => {
433
+ React6.useEffect(() => {
378
434
  if (focus !== void 0 && (focus === null || model.order.includes(focus))) model.focus(focus);
379
435
  }, [model, focus]);
380
436
  const wanted = focus !== void 0 ? focus : ownFocus;
381
437
  const f = wanted !== null && model.order.includes(wanted) ? wanted : null;
382
- const svg = React5.useMemo(
383
- () => w === void 0 ? "" : COMPONENT5.render(data, {
438
+ const svg = React6.useMemo(
439
+ () => w === void 0 ? "" : COMPONENT6.render(data, {
384
440
  width: w,
385
441
  height: h,
386
442
  theme: colors?.scheme ?? "light",
@@ -415,30 +471,77 @@ function Lineage({
415
471
  if (!event.currentTarget.contains(event.relatedTarget)) model.clear();
416
472
  },
417
473
  children: [
418
- /* @__PURE__ */ jsx5("span", { style: { display: "block" }, dangerouslySetInnerHTML: { __html: svg } }),
419
- /* @__PURE__ */ jsx5("span", { "aria-live": "polite", style: VISUALLY_HIDDEN2, children: f === null ? "" : model.describe(f) })
474
+ /* @__PURE__ */ jsx6("span", { style: { display: "block" }, dangerouslySetInnerHTML: { __html: svg } }),
475
+ /* @__PURE__ */ jsx6("span", { "aria-live": "polite", style: VISUALLY_HIDDEN2, children: f === null ? "" : model.describe(f) })
420
476
  ]
421
477
  }
422
478
  );
423
479
  }
424
480
 
481
+ // ../../components/mindmap/react.tsx
482
+ import * as React7 from "react";
483
+ import { diagramUiComponents as diagramUiComponents2 } from "@pixerate/editor/canvas";
484
+ import { jsx as jsx7 } from "react/jsx-runtime";
485
+ var ROLES7 = ["surface", "surface-raised", "ink", "ink-muted", "border", "accent"];
486
+ var COMPONENT7 = diagramUiComponents2().find((c) => c.id === "mindmap");
487
+ function Mindmap({ root, branches, title, width, height, className, style }) {
488
+ const ref = React7.useRef(null);
489
+ const colors = useRoleColors(ref, ROLES7);
490
+ const [measured, setMeasured] = React7.useState(void 0);
491
+ React7.useEffect(() => {
492
+ const el = ref.current?.parentElement;
493
+ if (!el || width !== void 0) return;
494
+ const observer = new ResizeObserver(
495
+ ([entry]) => setMeasured(Math.max(280, Math.round(entry.contentRect.width)))
496
+ );
497
+ observer.observe(el);
498
+ return () => observer.disconnect();
499
+ }, [width]);
500
+ const w = width ?? measured;
501
+ const h = height ?? 240;
502
+ const data = React7.useMemo(
503
+ () => Object.fromEntries(
504
+ Object.entries({ root, branches, title }).filter(([, v]) => v !== void 0)
505
+ ),
506
+ [root, branches, title]
507
+ );
508
+ const svg = React7.useMemo(
509
+ () => w === void 0 ? "" : COMPONENT7.render(data, {
510
+ width: w,
511
+ height: h,
512
+ theme: colors?.scheme ?? "light",
513
+ ...colors ? { colors: colors.css } : {}
514
+ }),
515
+ [data, w, h, colors]
516
+ );
517
+ return /* @__PURE__ */ jsx7(
518
+ "span",
519
+ {
520
+ ref,
521
+ className: ["sui-provider", className].filter(Boolean).join(" "),
522
+ style: { display: "inline-block", width: w ?? "100%", height: h, ...style },
523
+ dangerouslySetInnerHTML: { __html: svg }
524
+ }
525
+ );
526
+ }
527
+
425
528
  // ../../components/sparkline/react.tsx
426
- import * as React6 from "react";
529
+ import * as React8 from "react";
427
530
  import { uiComponents as uiComponents6 } from "@pixerate/editor/chart";
428
- import { jsx as jsx6 } from "react/jsx-runtime";
429
- var ROLES6 = ["accent"];
430
- var COMPONENT6 = uiComponents6().find((c) => c.id === "sparkline");
531
+ import { jsx as jsx8 } from "react/jsx-runtime";
532
+ var ROLES8 = ["accent"];
533
+ var COMPONENT8 = uiComponents6().find((c) => c.id === "sparkline");
431
534
  function Sparkline({ values, label, width, height, className, style }) {
432
- const ref = React6.useRef(null);
433
- const colors = useRoleColors(ref, ROLES6);
535
+ const ref = React8.useRef(null);
536
+ const colors = useRoleColors(ref, ROLES8);
434
537
  const w = width ?? 240;
435
538
  const h = height ?? 48;
436
- const data = React6.useMemo(
539
+ const data = React8.useMemo(
437
540
  () => Object.fromEntries(Object.entries({ values, label }).filter(([, v]) => v !== void 0)),
438
541
  [values, label]
439
542
  );
440
- const svg = React6.useMemo(
441
- () => w === void 0 ? "" : COMPONENT6.render(data, {
543
+ const svg = React8.useMemo(
544
+ () => w === void 0 ? "" : COMPONENT8.render(data, {
442
545
  width: w,
443
546
  height: h,
444
547
  theme: colors?.scheme ?? "light",
@@ -446,7 +549,7 @@ function Sparkline({ values, label, width, height, className, style }) {
446
549
  }),
447
550
  [data, w, h, colors]
448
551
  );
449
- return /* @__PURE__ */ jsx6(
552
+ return /* @__PURE__ */ jsx8(
450
553
  "span",
451
554
  {
452
555
  ref,
@@ -457,13 +560,58 @@ function Sparkline({ values, label, width, height, className, style }) {
457
560
  );
458
561
  }
459
562
 
563
+ // ../../components/timeline/react.tsx
564
+ import * as React9 from "react";
565
+ import { diagramUiComponents as diagramUiComponents3 } from "@pixerate/editor/canvas";
566
+ import { jsx as jsx9 } from "react/jsx-runtime";
567
+ var ROLES9 = ["surface", "surface-raised", "ink", "ink-muted", "border", "accent"];
568
+ var COMPONENT9 = diagramUiComponents3().find((c) => c.id === "timeline");
569
+ function Timeline({ periods, title, width, height, className, style }) {
570
+ const ref = React9.useRef(null);
571
+ const colors = useRoleColors(ref, ROLES9);
572
+ const [measured, setMeasured] = React9.useState(void 0);
573
+ React9.useEffect(() => {
574
+ const el = ref.current?.parentElement;
575
+ if (!el || width !== void 0) return;
576
+ const observer = new ResizeObserver(
577
+ ([entry]) => setMeasured(Math.max(280, Math.round(entry.contentRect.width)))
578
+ );
579
+ observer.observe(el);
580
+ return () => observer.disconnect();
581
+ }, [width]);
582
+ const w = width ?? measured;
583
+ const h = height ?? 240;
584
+ const data = React9.useMemo(
585
+ () => Object.fromEntries(Object.entries({ periods, title }).filter(([, v]) => v !== void 0)),
586
+ [periods, title]
587
+ );
588
+ const svg = React9.useMemo(
589
+ () => w === void 0 ? "" : COMPONENT9.render(data, {
590
+ width: w,
591
+ height: h,
592
+ theme: colors?.scheme ?? "light",
593
+ ...colors ? { colors: colors.css } : {}
594
+ }),
595
+ [data, w, h, colors]
596
+ );
597
+ return /* @__PURE__ */ jsx9(
598
+ "span",
599
+ {
600
+ ref,
601
+ className: ["sui-provider", className].filter(Boolean).join(" "),
602
+ style: { display: "inline-block", width: w ?? "100%", height: h, ...style },
603
+ dangerouslySetInnerHTML: { __html: svg }
604
+ }
605
+ );
606
+ }
607
+
460
608
  // ../../components/weave/react.tsx
461
- import * as React7 from "react";
609
+ import * as React10 from "react";
462
610
  import { uiComponents as uiComponents7 } from "@pixerate/editor/chart";
463
611
  import { createLinkFocus as createLinkFocus3 } from "@pixerate/editor/tools";
464
- import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
465
- var ROLES7 = ["surface", "surface-raised", "ink", "ink-muted", "border", "accent"];
466
- var COMPONENT7 = uiComponents7().find((c) => c.id === "weave");
612
+ import { jsx as jsx10, jsxs as jsxs3 } from "react/jsx-runtime";
613
+ var ROLES10 = ["surface", "surface-raised", "ink", "ink-muted", "border", "accent"];
614
+ var COMPONENT10 = uiComponents7().find((c) => c.id === "weave");
467
615
  var VISUALLY_HIDDEN3 = {
468
616
  position: "absolute",
469
617
  width: 1,
@@ -485,10 +633,10 @@ function Weave({
485
633
  className,
486
634
  style
487
635
  }) {
488
- const ref = React7.useRef(null);
489
- const colors = useRoleColors(ref, ROLES7);
490
- const [measured, setMeasured] = React7.useState(void 0);
491
- React7.useEffect(() => {
636
+ const ref = React10.useRef(null);
637
+ const colors = useRoleColors(ref, ROLES10);
638
+ const [measured, setMeasured] = React10.useState(void 0);
639
+ React10.useEffect(() => {
492
640
  const el = ref.current?.parentElement;
493
641
  if (!el || width !== void 0) return;
494
642
  const observer = new ResizeObserver(
@@ -499,13 +647,13 @@ function Weave({
499
647
  }, [width]);
500
648
  const w = width ?? measured;
501
649
  const h = height ?? 240;
502
- const data = React7.useMemo(
650
+ const data = React10.useMemo(
503
651
  () => Object.fromEntries(Object.entries({ items, title }).filter(([, v]) => v !== void 0)),
504
652
  [items, title]
505
653
  );
506
654
  const controlled = progress !== void 0;
507
- const [played, setPlayed] = React7.useState(controlled || animate === false ? 1 : 0);
508
- React7.useEffect(() => {
655
+ const [played, setPlayed] = React10.useState(controlled || animate === false ? 1 : 0);
656
+ React10.useEffect(() => {
509
657
  if (controlled || animate === false) return;
510
658
  if (typeof matchMedia === "function" && matchMedia("(prefers-reduced-motion: reduce)").matches) {
511
659
  setPlayed(1);
@@ -523,28 +671,28 @@ function Weave({
523
671
  return () => cancelAnimationFrame(frame);
524
672
  }, [controlled, animate, duration]);
525
673
  const p = Math.min(1, Math.max(0, progress ?? played));
526
- const dataKey = React7.useMemo(() => JSON.stringify(data), [data]);
527
- const model = React7.useMemo(
528
- () => createLinkFocus3(COMPONENT7.interaction(JSON.parse(dataKey))),
674
+ const dataKey = React10.useMemo(() => JSON.stringify(data), [data]);
675
+ const model = React10.useMemo(
676
+ () => createLinkFocus3(COMPONENT10.interaction(JSON.parse(dataKey))),
529
677
  [dataKey]
530
678
  );
531
- const [ownFocus, setOwnFocus] = React7.useState(null);
532
- const onFocusChangeRef = React7.useRef(onFocusChange);
679
+ const [ownFocus, setOwnFocus] = React10.useState(null);
680
+ const onFocusChangeRef = React10.useRef(onFocusChange);
533
681
  onFocusChangeRef.current = onFocusChange;
534
- React7.useEffect(() => {
682
+ React10.useEffect(() => {
535
683
  setOwnFocus(model.getState().focus);
536
684
  return model.subscribe((state) => {
537
685
  setOwnFocus(state.focus);
538
686
  onFocusChangeRef.current?.(state.focus);
539
687
  });
540
688
  }, [model]);
541
- React7.useEffect(() => {
689
+ React10.useEffect(() => {
542
690
  if (focus !== void 0 && (focus === null || model.order.includes(focus))) model.focus(focus);
543
691
  }, [model, focus]);
544
692
  const wanted = focus !== void 0 ? focus : ownFocus;
545
693
  const f = wanted !== null && model.order.includes(wanted) ? wanted : null;
546
- const svg = React7.useMemo(
547
- () => w === void 0 ? "" : COMPONENT7.render(data, {
694
+ const svg = React10.useMemo(
695
+ () => w === void 0 ? "" : COMPONENT10.render(data, {
548
696
  width: w,
549
697
  height: h,
550
698
  theme: colors?.scheme ?? "light",
@@ -579,8 +727,8 @@ function Weave({
579
727
  if (!event.currentTarget.contains(event.relatedTarget)) model.clear();
580
728
  },
581
729
  children: [
582
- /* @__PURE__ */ jsx7("span", { style: { display: "block" }, dangerouslySetInnerHTML: { __html: svg } }),
583
- /* @__PURE__ */ jsx7("span", { "aria-live": "polite", style: VISUALLY_HIDDEN3, children: f === null ? "" : model.describe(f) })
730
+ /* @__PURE__ */ jsx10("span", { style: { display: "block" }, dangerouslySetInnerHTML: { __html: svg } }),
731
+ /* @__PURE__ */ jsx10("span", { "aria-live": "polite", style: VISUALLY_HIDDEN3, children: f === null ? "" : model.describe(f) })
584
732
  ]
585
733
  }
586
734
  );
@@ -589,8 +737,11 @@ export {
589
737
  BarChart,
590
738
  Braid,
591
739
  DonutChart,
740
+ Flow,
592
741
  LineChart,
593
742
  Lineage,
743
+ Mindmap,
594
744
  Sparkline,
745
+ Timeline,
595
746
  Weave
596
747
  };
@@ -1,4 +1,4 @@
1
- // Generated by packages/catalog/scripts/sync-providers.ts from @pixerate/editor 0.323.2 (bar-chart). Do not edit.
1
+ // Generated by packages/catalog/scripts/sync-providers.ts from @pixerate/editor 0.334.1 (bar-chart). Do not edit.
2
2
  import * as React from 'react';
3
3
  import { uiComponents } from '@pixerate/editor/chart';
4
4
  import { useRoleColors } from '../../packages/catalog/src/runtime/role-colors';
@@ -1,4 +1,4 @@
1
- // Generated by packages/catalog/scripts/sync-providers.ts from @pixerate/editor 0.323.2 (braid). Do not edit.
1
+ // Generated by packages/catalog/scripts/sync-providers.ts from @pixerate/editor 0.334.1 (braid). Do not edit.
2
2
  import * as React from 'react';
3
3
  import { uiComponents } from '@pixerate/editor/chart';
4
4
  import { createLinkFocus } from '@pixerate/editor/tools';
@@ -1,4 +1,4 @@
1
- // Generated by packages/catalog/scripts/sync-providers.ts from @pixerate/editor 0.323.2 (donut-chart). Do not edit.
1
+ // Generated by packages/catalog/scripts/sync-providers.ts from @pixerate/editor 0.334.1 (donut-chart). Do not edit.
2
2
  import * as React from 'react';
3
3
  import { uiComponents } from '@pixerate/editor/chart';
4
4
  import { useRoleColors } from '../../packages/catalog/src/runtime/role-colors';
@@ -0,0 +1,79 @@
1
+ // Generated by packages/catalog/scripts/sync-providers.ts from @pixerate/editor 0.334.1 (flow). Do not edit.
2
+ import * as React from 'react';
3
+ import { diagramUiComponents } from '@pixerate/editor/canvas';
4
+ import { useRoleColors } from '../../packages/catalog/src/runtime/role-colors';
5
+
6
+ const ROLES = ['surface', 'surface-raised', 'ink', 'ink-muted', 'border', 'accent'] as const;
7
+ const COMPONENT = diagramUiComponents().find((c) => c.id === 'flow')!;
8
+
9
+ export interface FlowProps {
10
+ /** The steps, in order. */
11
+ steps: { id?: string; label: string }[];
12
+ /** Arrows between steps by id (default: each step to the next). */
13
+ links?: { from: string; to: string; label?: string }[];
14
+ /** LR left to right (default) or TD top down. */
15
+ direction?: 'LR' | 'TD';
16
+ /** Accessible name (default: built from the steps). */
17
+ title?: string;
18
+ /** Width in CSS px. */
19
+ width?: number;
20
+ /** Height in CSS px. */
21
+ height?: number;
22
+ className?: string;
23
+ style?: React.CSSProperties;
24
+ }
25
+
26
+ /** A process as boxes joined by arrows, left to right or top down, in the diagram editor's layout. (editor `flow`, coloured by the aesthetic's roles.) */
27
+ export function Flow({
28
+ steps,
29
+ links,
30
+ direction,
31
+ title,
32
+ width,
33
+ height,
34
+ className,
35
+ style
36
+ }: FlowProps) {
37
+ const ref = React.useRef<HTMLSpanElement>(null);
38
+ const colors = useRoleColors(ref, ROLES);
39
+ // Fills its container: render at the container's width, and again when it changes.
40
+ const [measured, setMeasured] = React.useState<number | undefined>(undefined);
41
+ React.useEffect(() => {
42
+ const el = ref.current?.parentElement;
43
+ if (!el || width !== undefined) return;
44
+ const observer = new ResizeObserver(([entry]) =>
45
+ setMeasured(Math.max(240, Math.round(entry!.contentRect.width)))
46
+ );
47
+ observer.observe(el);
48
+ return () => observer.disconnect();
49
+ }, [width]);
50
+ const w = width ?? measured;
51
+ const h = height ?? 240;
52
+ const data = React.useMemo(
53
+ () =>
54
+ Object.fromEntries(
55
+ Object.entries({ steps, links, direction, title }).filter(([, v]) => v !== undefined)
56
+ ),
57
+ [steps, links, direction, title]
58
+ );
59
+ const svg = React.useMemo(
60
+ () =>
61
+ w === undefined
62
+ ? ''
63
+ : COMPONENT.render(data, {
64
+ width: w,
65
+ height: h,
66
+ theme: colors?.scheme ?? 'light',
67
+ ...(colors ? { colors: colors.css } : {})
68
+ }),
69
+ [data, w, h, colors]
70
+ );
71
+ return (
72
+ <span
73
+ ref={ref}
74
+ className={['sui-provider', className].filter(Boolean).join(' ')}
75
+ style={{ display: 'inline-block', width: w ?? '100%', height: h, ...style }}
76
+ dangerouslySetInnerHTML={{ __html: svg }}
77
+ />
78
+ );
79
+ }
@@ -1,4 +1,4 @@
1
- // Generated by packages/catalog/scripts/sync-providers.ts from @pixerate/editor 0.323.2 (line-chart). Do not edit.
1
+ // Generated by packages/catalog/scripts/sync-providers.ts from @pixerate/editor 0.334.1 (line-chart). Do not edit.
2
2
  import * as React from 'react';
3
3
  import { uiComponents } from '@pixerate/editor/chart';
4
4
  import { useRoleColors } from '../../packages/catalog/src/runtime/role-colors';
@@ -1,4 +1,4 @@
1
- // Generated by packages/catalog/scripts/sync-providers.ts from @pixerate/editor 0.323.2 (lineage). Do not edit.
1
+ // Generated by packages/catalog/scripts/sync-providers.ts from @pixerate/editor 0.334.1 (lineage). Do not edit.
2
2
  import * as React from 'react';
3
3
  import { uiComponents } from '@pixerate/editor/chart';
4
4
  import { createLinkFocus } from '@pixerate/editor/tools';