@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.
@@ -237,7 +237,7 @@ var CATALOG = {
237
237
  "source": {
238
238
  "provider": "editor",
239
239
  "itemId": "bar-chart",
240
- "version": "0.323.2",
240
+ "version": "0.334.1",
241
241
  "contentHash": "h1-bc3ada602d46f641"
242
242
  },
243
243
  "implements": "bar-chart",
@@ -248,7 +248,7 @@ var CATALOG = {
248
248
  ],
249
249
  "entry": "@surreal-ui/catalog/react/editor",
250
250
  "export": "BarChart",
251
- "contentHash": "774210bf0879b4a8e02df41fbe96af20d94df6f4383a15ff0363f4fea47d940b",
251
+ "contentHash": "1267c230f4a8b4b0cf51c74406165ee4c161c68ab509b2513315406fc1b1c2c7",
252
252
  "path": "components/bar-chart",
253
253
  "alternatives": []
254
254
  },
@@ -398,7 +398,7 @@ var CATALOG = {
398
398
  "source": {
399
399
  "provider": "editor",
400
400
  "itemId": "braid",
401
- "version": "0.323.2",
401
+ "version": "0.334.1",
402
402
  "contentHash": "h1-32ab36e8632bd353"
403
403
  },
404
404
  "implements": "braid",
@@ -409,7 +409,7 @@ var CATALOG = {
409
409
  ],
410
410
  "entry": "@surreal-ui/catalog/react/editor",
411
411
  "export": "Braid",
412
- "contentHash": "cbcd53b8efc8cfb43ceb65467b055b3fadade239d82469822ea3c4fa903a053e",
412
+ "contentHash": "04184020d2108461cf79e229394805ad414b571048bf36efd15b7f969f3ed749",
413
413
  "path": "components/braid",
414
414
  "alternatives": []
415
415
  },
@@ -882,7 +882,7 @@ var CATALOG = {
882
882
  "source": {
883
883
  "provider": "editor",
884
884
  "itemId": "donut-chart",
885
- "version": "0.323.2",
885
+ "version": "0.334.1",
886
886
  "contentHash": "h1-0e889e53ac068f38"
887
887
  },
888
888
  "implements": "donut-chart",
@@ -893,10 +893,153 @@ var CATALOG = {
893
893
  ],
894
894
  "entry": "@surreal-ui/catalog/react/editor",
895
895
  "export": "DonutChart",
896
- "contentHash": "c5d9dbc35682659dd67e2205cfdeb0796124c4fada2014c2a74e6f428dfdba25",
896
+ "contentHash": "cc8bbea8891d8c6c7837e144996fbad5c6c4cb68c0b59d172c9565dc0c484743",
897
897
  "path": "components/donut-chart",
898
898
  "alternatives": []
899
899
  },
900
+ {
901
+ "id": "flow",
902
+ "name": "Flow",
903
+ "description": "A process as boxes joined by arrows, left to right or top down, in the diagram editor's layout.",
904
+ "tags": [
905
+ "editor",
906
+ "data-visual"
907
+ ],
908
+ "group": "data-visual",
909
+ "contract": {
910
+ "props": {
911
+ "type": "object",
912
+ "properties": {
913
+ "steps": {
914
+ "type": "array",
915
+ "minItems": 1,
916
+ "maxItems": 30,
917
+ "description": "The steps, in order.",
918
+ "items": {
919
+ "type": "object",
920
+ "properties": {
921
+ "id": {
922
+ "type": "string",
923
+ "pattern": "^[A-Za-z0-9_-]{1,40}$",
924
+ "description": 'Id for links (default its position, "1", "2", \u2026).'
925
+ },
926
+ "label": {
927
+ "type": "string",
928
+ "minLength": 1,
929
+ "maxLength": 80,
930
+ "description": "A short label."
931
+ }
932
+ },
933
+ "required": [
934
+ "label"
935
+ ],
936
+ "additionalProperties": false
937
+ }
938
+ },
939
+ "links": {
940
+ "type": "array",
941
+ "maxItems": 60,
942
+ "description": "Arrows between steps by id (default: each step to the next).",
943
+ "items": {
944
+ "type": "object",
945
+ "properties": {
946
+ "from": {
947
+ "type": "string"
948
+ },
949
+ "to": {
950
+ "type": "string"
951
+ },
952
+ "label": {
953
+ "type": "string",
954
+ "maxLength": 40
955
+ }
956
+ },
957
+ "required": [
958
+ "from",
959
+ "to"
960
+ ],
961
+ "additionalProperties": false
962
+ }
963
+ },
964
+ "direction": {
965
+ "type": "string",
966
+ "enum": [
967
+ "LR",
968
+ "TD"
969
+ ],
970
+ "description": "LR left to right (default) or TD top down."
971
+ },
972
+ "title": {
973
+ "type": "string",
974
+ "description": "Accessible name (default: built from the steps)."
975
+ }
976
+ },
977
+ "required": [
978
+ "steps"
979
+ ],
980
+ "additionalProperties": false
981
+ },
982
+ "state": [],
983
+ "events": [],
984
+ "a11y": {
985
+ "role": "img",
986
+ "keyboard": {},
987
+ "labelFrom": "content"
988
+ },
989
+ "colorRoles": [
990
+ "surface",
991
+ "surface-raised",
992
+ "ink",
993
+ "ink-muted",
994
+ "border",
995
+ "accent"
996
+ ],
997
+ "motion": false,
998
+ "sizing": {
999
+ "mode": "fill",
1000
+ "minWidth": 240,
1001
+ "minHeight": 80
1002
+ }
1003
+ },
1004
+ "examples": [
1005
+ {
1006
+ "name": "example",
1007
+ "props": {
1008
+ "steps": [
1009
+ {
1010
+ "label": "Sign up"
1011
+ },
1012
+ {
1013
+ "label": "Verify email"
1014
+ },
1015
+ {
1016
+ "label": "Pick a plan"
1017
+ },
1018
+ {
1019
+ "label": "Start trial"
1020
+ }
1021
+ ]
1022
+ }
1023
+ }
1024
+ ],
1025
+ "source": {
1026
+ "provider": "editor",
1027
+ "itemId": "flow",
1028
+ "version": "0.334.1",
1029
+ "contentHash": "h1-610ee378b54394ed"
1030
+ },
1031
+ "implements": "flow",
1032
+ "category": "data-visual",
1033
+ "runtime": "code",
1034
+ "platforms": [
1035
+ "react"
1036
+ ],
1037
+ "entry": "@surreal-ui/catalog/react/editor",
1038
+ "export": "Flow",
1039
+ "contentHash": "1f338547de88b93a799481e86ae9962347dd2b0a6936ea067c352f5fbe14520e",
1040
+ "path": "components/flow",
1041
+ "alternatives": []
1042
+ },
900
1043
  {
901
1044
  "id": "gauge",
902
1045
  "name": "Gauge",
@@ -1353,7 +1496,7 @@ var CATALOG = {
1353
1496
  "source": {
1354
1497
  "provider": "editor",
1355
1498
  "itemId": "line-chart",
1356
- "version": "0.323.2",
1499
+ "version": "0.334.1",
1357
1500
  "contentHash": "h1-996e92fc381f9c29"
1358
1501
  },
1359
1502
  "implements": "line-chart",
@@ -1364,7 +1507,7 @@ var CATALOG = {
1364
1507
  ],
1365
1508
  "entry": "@surreal-ui/catalog/react/editor",
1366
1509
  "export": "LineChart",
1367
- "contentHash": "ed1dcc0312378792b0b599dc4e64777e3c7ec5a7b5ab0041e6cd527f3af19ec0",
1510
+ "contentHash": "f347ec5c14a3a69f4f40eb883fa4843f5c5fb7c00da8012460b9a8f64a635ec2",
1368
1511
  "path": "components/line-chart",
1369
1512
  "alternatives": []
1370
1513
  },
@@ -1507,7 +1650,7 @@ var CATALOG = {
1507
1650
  "source": {
1508
1651
  "provider": "editor",
1509
1652
  "itemId": "lineage",
1510
- "version": "0.323.2",
1653
+ "version": "0.334.1",
1511
1654
  "contentHash": "h1-80fbdcdee156c4aa"
1512
1655
  },
1513
1656
  "implements": "lineage",
@@ -1518,10 +1661,171 @@ var CATALOG = {
1518
1661
  ],
1519
1662
  "entry": "@surreal-ui/catalog/react/editor",
1520
1663
  "export": "Lineage",
1521
- "contentHash": "1075d420e8c4648e161d005193fe364fdda7e6cc1eae093bb2363e29c066e7f2",
1664
+ "contentHash": "fce13c1bfd6418944f246f48aa395a8e0cbb966c1316e2bc9b17bfc6c5b483c7",
1522
1665
  "path": "components/lineage",
1523
1666
  "alternatives": []
1524
1667
  },
1668
+ {
1669
+ "id": "mindmap",
1670
+ "name": "Mind map",
1671
+ "description": "A central idea with branches and sub-branches spread round it, one colour per branch.",
1672
+ "tags": [
1673
+ "editor",
1674
+ "data-visual"
1675
+ ],
1676
+ "group": "data-visual",
1677
+ "contract": {
1678
+ "props": {
1679
+ "type": "object",
1680
+ "properties": {
1681
+ "root": {
1682
+ "type": "string",
1683
+ "minLength": 1,
1684
+ "maxLength": 80,
1685
+ "description": "The central idea."
1686
+ },
1687
+ "branches": {
1688
+ "type": "array",
1689
+ "minItems": 1,
1690
+ "maxItems": 12,
1691
+ "description": "Branches round the root, each with up to two levels of children.",
1692
+ "items": {
1693
+ "type": "object",
1694
+ "properties": {
1695
+ "label": {
1696
+ "type": "string",
1697
+ "minLength": 1,
1698
+ "maxLength": 80,
1699
+ "description": "A short label."
1700
+ },
1701
+ "children": {
1702
+ "type": "array",
1703
+ "maxItems": 12,
1704
+ "items": {
1705
+ "type": "object",
1706
+ "properties": {
1707
+ "label": {
1708
+ "type": "string",
1709
+ "minLength": 1,
1710
+ "maxLength": 80,
1711
+ "description": "A short label."
1712
+ },
1713
+ "children": {
1714
+ "type": "array",
1715
+ "maxItems": 12,
1716
+ "items": {
1717
+ "type": "object",
1718
+ "properties": {
1719
+ "label": {
1720
+ "type": "string",
1721
+ "minLength": 1,
1722
+ "maxLength": 80,
1723
+ "description": "A short label."
1724
+ }
1725
+ },
1726
+ "required": [
1727
+ "label"
1728
+ ],
1729
+ "additionalProperties": false
1730
+ }
1731
+ }
1732
+ },
1733
+ "required": [
1734
+ "label"
1735
+ ],
1736
+ "additionalProperties": false
1737
+ }
1738
+ }
1739
+ },
1740
+ "required": [
1741
+ "label"
1742
+ ],
1743
+ "additionalProperties": false
1744
+ }
1745
+ },
1746
+ "title": {
1747
+ "type": "string",
1748
+ "description": "Accessible name (default: built from the root)."
1749
+ }
1750
+ },
1751
+ "required": [
1752
+ "root",
1753
+ "branches"
1754
+ ],
1755
+ "additionalProperties": false
1756
+ },
1757
+ "state": [],
1758
+ "events": [],
1759
+ "a11y": {
1760
+ "role": "img",
1761
+ "keyboard": {},
1762
+ "labelFrom": "content"
1763
+ },
1764
+ "colorRoles": [
1765
+ "surface",
1766
+ "surface-raised",
1767
+ "ink",
1768
+ "ink-muted",
1769
+ "border",
1770
+ "accent"
1771
+ ],
1772
+ "motion": false,
1773
+ "sizing": {
1774
+ "mode": "fill",
1775
+ "minWidth": 280,
1776
+ "minHeight": 220
1777
+ }
1778
+ },
1779
+ "examples": [
1780
+ {
1781
+ "name": "example",
1782
+ "props": {
1783
+ "root": "Platform",
1784
+ "branches": [
1785
+ {
1786
+ "label": "Research",
1787
+ "children": [
1788
+ {
1789
+ "label": "Interviews"
1790
+ },
1791
+ {
1792
+ "label": "Surveys"
1793
+ }
1794
+ ]
1795
+ },
1796
+ {
1797
+ "label": "Design",
1798
+ "children": [
1799
+ {
1800
+ "label": "Systems"
1801
+ }
1802
+ ]
1803
+ },
1804
+ {
1805
+ "label": "Engineering"
1806
+ }
1807
+ ]
1808
+ }
1809
+ }
1810
+ ],
1811
+ "source": {
1812
+ "provider": "editor",
1813
+ "itemId": "mindmap",
1814
+ "version": "0.334.1",
1815
+ "contentHash": "h1-8de425038a9756ec"
1816
+ },
1817
+ "implements": "mindmap",
1818
+ "category": "data-visual",
1819
+ "runtime": "code",
1820
+ "platforms": [
1821
+ "react"
1822
+ ],
1823
+ "entry": "@surreal-ui/catalog/react/editor",
1824
+ "export": "Mindmap",
1825
+ "contentHash": "538c8952e438280f4e2fa69dd7e2f13655b51065347e67f433ba88ab0b2b7685",
1826
+ "path": "components/mindmap",
1827
+ "alternatives": []
1828
+ },
1525
1829
  {
1526
1830
  "id": "progress",
1527
1831
  "name": "Progress",
@@ -1912,7 +2216,7 @@ var CATALOG = {
1912
2216
  "source": {
1913
2217
  "provider": "editor",
1914
2218
  "itemId": "sparkline",
1915
- "version": "0.323.2",
2219
+ "version": "0.334.1",
1916
2220
  "contentHash": "h1-30ef47f4426f81fe"
1917
2221
  },
1918
2222
  "implements": "sparkline",
@@ -1923,7 +2227,7 @@ var CATALOG = {
1923
2227
  ],
1924
2228
  "entry": "@surreal-ui/catalog/react/editor",
1925
2229
  "export": "Sparkline",
1926
- "contentHash": "a426bbedb624253a3df8fe096c2e9d61fc19e6b459328ce827e6d74cbe93e250",
2230
+ "contentHash": "b48f05ae55a5e6fce92bf493fcb55a3098de0426be304924fd01944e88614804",
1927
2231
  "path": "components/sparkline",
1928
2232
  "alternatives": []
1929
2233
  },
@@ -2315,6 +2619,132 @@ var CATALOG = {
2315
2619
  "path": "components/textarea",
2316
2620
  "alternatives": []
2317
2621
  },
2622
+ {
2623
+ "id": "timeline",
2624
+ "name": "Timeline",
2625
+ "description": "Periods along an axis, each with its events stacked under it, one colour per period.",
2626
+ "tags": [
2627
+ "editor",
2628
+ "data-visual"
2629
+ ],
2630
+ "group": "data-visual",
2631
+ "contract": {
2632
+ "props": {
2633
+ "type": "object",
2634
+ "properties": {
2635
+ "periods": {
2636
+ "type": "array",
2637
+ "minItems": 1,
2638
+ "maxItems": 20,
2639
+ "description": "Periods in order, each with its events.",
2640
+ "items": {
2641
+ "type": "object",
2642
+ "properties": {
2643
+ "label": {
2644
+ "type": "string",
2645
+ "minLength": 1,
2646
+ "maxLength": 80,
2647
+ "description": "A short label."
2648
+ },
2649
+ "events": {
2650
+ "type": "array",
2651
+ "items": {
2652
+ "type": "string",
2653
+ "minLength": 1,
2654
+ "maxLength": 80,
2655
+ "description": "A short label."
2656
+ },
2657
+ "maxItems": 8,
2658
+ "description": "What happened in the period."
2659
+ }
2660
+ },
2661
+ "required": [
2662
+ "label",
2663
+ "events"
2664
+ ],
2665
+ "additionalProperties": false
2666
+ }
2667
+ },
2668
+ "title": {
2669
+ "type": "string",
2670
+ "description": "Title drawn above the timeline and used as its accessible name."
2671
+ }
2672
+ },
2673
+ "required": [
2674
+ "periods"
2675
+ ],
2676
+ "additionalProperties": false
2677
+ },
2678
+ "state": [],
2679
+ "events": [],
2680
+ "a11y": {
2681
+ "role": "img",
2682
+ "keyboard": {},
2683
+ "labelFrom": "content"
2684
+ },
2685
+ "colorRoles": [
2686
+ "surface",
2687
+ "surface-raised",
2688
+ "ink",
2689
+ "ink-muted",
2690
+ "border",
2691
+ "accent"
2692
+ ],
2693
+ "motion": false,
2694
+ "sizing": {
2695
+ "mode": "fill",
2696
+ "minWidth": 280,
2697
+ "minHeight": 200
2698
+ }
2699
+ },
2700
+ "examples": [
2701
+ {
2702
+ "name": "example",
2703
+ "props": {
2704
+ "title": "Product history",
2705
+ "periods": [
2706
+ {
2707
+ "label": "2021",
2708
+ "events": [
2709
+ "Prototype",
2710
+ "First customer"
2711
+ ]
2712
+ },
2713
+ {
2714
+ "label": "2022",
2715
+ "events": [
2716
+ "Series A"
2717
+ ]
2718
+ },
2719
+ {
2720
+ "label": "2023",
2721
+ "events": [
2722
+ "Mobile app",
2723
+ "1M users"
2724
+ ]
2725
+ }
2726
+ ]
2727
+ }
2728
+ }
2729
+ ],
2730
+ "source": {
2731
+ "provider": "editor",
2732
+ "itemId": "timeline",
2733
+ "version": "0.334.1",
2734
+ "contentHash": "h1-4d6bef2670bfda04"
2735
+ },
2736
+ "implements": "timeline",
2737
+ "category": "data-visual",
2738
+ "runtime": "code",
2739
+ "platforms": [
2740
+ "react"
2741
+ ],
2742
+ "entry": "@surreal-ui/catalog/react/editor",
2743
+ "export": "Timeline",
2744
+ "contentHash": "03db318aac1112136c868ecd39bb572dc55154deb9a18d323dcacfdcac083e1a",
2745
+ "path": "components/timeline",
2746
+ "alternatives": []
2747
+ },
2318
2748
  {
2319
2749
  "id": "weave",
2320
2750
  "name": "Weave",
@@ -2480,7 +2910,7 @@ var CATALOG = {
2480
2910
  "source": {
2481
2911
  "provider": "editor",
2482
2912
  "itemId": "weave",
2483
- "version": "0.323.2",
2913
+ "version": "0.334.1",
2484
2914
  "contentHash": "h1-6a819cc804a71672"
2485
2915
  },
2486
2916
  "implements": "weave",
@@ -2491,7 +2921,7 @@ var CATALOG = {
2491
2921
  ],
2492
2922
  "entry": "@surreal-ui/catalog/react/editor",
2493
2923
  "export": "Weave",
2494
- "contentHash": "6f0d0248c9c27f3c7a1b3e5c92dd75252d8aa151da297ce4bce715e12c95590d",
2924
+ "contentHash": "460409c5ddb06a6d71aad1d5eb6eeb8455e2d20e73619505ab2f959b9dd5db86",
2495
2925
  "path": "components/weave",
2496
2926
  "alternatives": []
2497
2927
  }
@@ -201,6 +201,7 @@
201
201
 
202
202
 
203
203
 
204
+
204
205
  /* input */
205
206
  .sui-input {
206
207
  display: flex;
@@ -268,6 +269,7 @@
268
269
 
269
270
 
270
271
 
272
+
271
273
  /* progress */
272
274
  .sui-progress {
273
275
  display: flex;
@@ -474,3 +476,4 @@
474
476
  cursor: not-allowed;
475
477
  }
476
478
 
479
+
package/dist/index.js CHANGED
@@ -16,7 +16,7 @@ import {
16
16
  getComponent,
17
17
  replacementFor,
18
18
  resolveRole
19
- } from "./chunk-5E7QNEVK.js";
19
+ } from "./chunk-XDW4TY7U.js";
20
20
  import {
21
21
  mapDeprecatedProps,
22
22
  resolveStructure
package/dist/lazy.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  getAesthetic,
12
12
  getComponent,
13
13
  replacementFor
14
- } from "./chunk-5E7QNEVK.js";
14
+ } from "./chunk-XDW4TY7U.js";
15
15
  import "./chunk-HMNTTISG.js";
16
16
 
17
17
  // src/lazy.generated.ts
package/dist/look.js CHANGED
@@ -33,6 +33,31 @@ function measureLook(args = {
33
33
  ];
34
34
  return rgb;
35
35
  };
36
+ const svgBackground = (el) => {
37
+ const svg = el instanceof SVGElement ? el.ownerSVGElement : null;
38
+ if (!svg) return null;
39
+ const r = el.getBoundingClientRect();
40
+ const [x, y] = [r.left + r.width / 2, r.top + r.height / 2];
41
+ let under = null;
42
+ const shapes = svg.querySelectorAll("rect, circle, ellipse, path, polygon");
43
+ for (const e of Array.from(shapes)) {
44
+ if (e.compareDocumentPosition(el) & Node.DOCUMENT_POSITION_PRECEDING) break;
45
+ if (e.closest("defs, marker, clipPath, mask, pattern")) continue;
46
+ const b = e.getBoundingClientRect();
47
+ if (x < b.left || x > b.right || y < b.top || y > b.bottom) continue;
48
+ const ctm = e.getScreenCTM();
49
+ if (ctm && !e.isPointInFill(new DOMPoint(x, y).matrixTransform(ctm.inverse()))) continue;
50
+ const cs = getComputedStyle(e);
51
+ if (cs.visibility === "hidden" || cs.display === "none") continue;
52
+ const fill = parse(cs.fill);
53
+ if (!fill || fill[3] === 0) continue;
54
+ const alpha = fill[3] * Number(cs.fillOpacity || 1) * Number(cs.opacity || 1);
55
+ if (alpha <= 0) continue;
56
+ const base = under ?? background(svg);
57
+ under = [0, 1, 2].map((i) => fill[i] * alpha + base[i] * (1 - alpha));
58
+ }
59
+ return under;
60
+ };
36
61
  const results = [];
37
62
  const found = Array.from(document.querySelectorAll(args.cellSelector));
38
63
  const cells = found.length ? found : [document.body];
@@ -52,7 +77,7 @@ function measureLook(args = {
52
77
  if (rect.width === 0 || rect.height === 0) continue;
53
78
  const fg = parse(el instanceof SVGElement ? cs.fill : cs.color);
54
79
  if (!fg || fg[3] === 0) continue;
55
- const bg = background(el);
80
+ const bg = svgBackground(el) ?? background(el);
56
81
  const fgRgb = [
57
82
  fg[0] * fg[3] + bg[0] * (1 - fg[3]),
58
83
  fg[1] * fg[3] + bg[1] * (1 - fg[3]),