@fairfox/polly 0.72.0 → 0.73.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.
Files changed (35) hide show
  1. package/dist/src/elysia/index.js +464 -4
  2. package/dist/src/elysia/index.js.map +6 -4
  3. package/dist/src/peer.d.ts +2 -0
  4. package/dist/src/peer.js +468 -4
  5. package/dist/src/peer.js.map +8 -5
  6. package/dist/src/polly-ui/ActionInput.d.ts +2 -1
  7. package/dist/src/polly-ui/ActionSelect.d.ts +2 -1
  8. package/dist/src/polly-ui/Button.d.ts +4 -0
  9. package/dist/src/polly-ui/Cluster.d.ts +2 -1
  10. package/dist/src/polly-ui/Code.d.ts +2 -1
  11. package/dist/src/polly-ui/Surface.d.ts +12 -1
  12. package/dist/src/polly-ui/Text.d.ts +23 -11
  13. package/dist/src/polly-ui/index.css +42 -9
  14. package/dist/src/polly-ui/index.js +59 -6
  15. package/dist/src/polly-ui/index.js.map +11 -10
  16. package/dist/src/polly-ui/internal/passthrough.d.ts +25 -0
  17. package/dist/src/polly-ui/styles.css +57 -9
  18. package/dist/src/polly-ui/theme.css +1 -0
  19. package/dist/src/shared/lib/peer-repo-server.d.ts +18 -0
  20. package/dist/src/shared/lib/sweep-sealed.d.ts +111 -0
  21. package/dist/tools/test/src/browser/run.js +42 -33
  22. package/dist/tools/test/src/browser/run.js.map +6 -5
  23. package/dist/tools/test/src/browser/runner-core.d.ts +32 -0
  24. package/dist/tools/test/src/e2e-mesh/index.js +193 -171
  25. package/dist/tools/test/src/e2e-mesh/index.js.map +4 -4
  26. package/dist/tools/test/src/visual/index.js +248 -229
  27. package/dist/tools/test/src/visual/index.js.map +5 -5
  28. package/dist/tools/verify/specs/tla/MeshSeed.cfg +27 -0
  29. package/dist/tools/verify/specs/tla/MeshSeed.tla +179 -0
  30. package/dist/tools/verify/specs/tla/README.md +11 -1
  31. package/dist/tools/verify/src/cli.js +55 -1
  32. package/dist/tools/verify/src/cli.js.map +6 -5
  33. package/dist/tools/visualize/src/cli.js +72 -2
  34. package/dist/tools/visualize/src/cli.js.map +5 -5
  35. package/package.json +3 -2
@@ -1,31 +1,43 @@
1
1
  /**
2
- * Text — typographic primitive for secondary and sized copy.
2
+ * Text — typographic primitive for secondary, sized, and status copy.
3
3
  *
4
- * Renders subtitles, captions, field labels, and empty-state copy
5
- * without the consumer reaching for a `style` attribute or a hand-rolled
6
- * `.muted` class. `tone` and `size` map to the semantic `--polly-text-*`
7
- * token family; `as` keeps the element polymorphic so the same
8
- * primitive backs a <span>, <p>, <label>, or <figcaption>. A no-prop
9
- * <Text> is an ordinary <span> at body size and default colour.
4
+ * Renders subtitles, captions, field labels, empty-state copy, and
5
+ * error/warning messages without the consumer reaching for a `style`
6
+ * attribute or a hand-rolled class. `tone` maps to the semantic
7
+ * `--polly-text-*` and `--polly-status-*` token families; `size`,
8
+ * `weight`, `italic`, and `leading` cover the remaining typographic
9
+ * axes. `as` keeps the element polymorphic so the same primitive backs a
10
+ * <span>, <p>, <label>, or <figcaption>. A no-prop <Text> is an ordinary
11
+ * <span> at body size and default colour.
12
+ *
13
+ * polly#125: arbitrary `data-*` / `aria-*` attributes are forwarded to
14
+ * the rendered element, so a Text that also needs a test hook or an
15
+ * a11y attribute stays a single element.
10
16
  */
11
17
  import { type ComponentChildren, type JSX } from "preact";
12
- export type TextTone = "default" | "muted";
18
+ import { type PassthroughAttrs } from "./internal/passthrough.ts";
19
+ export type TextTone = "default" | "muted" | "danger" | "warning" | "success";
13
20
  export type TextSize = "xs" | "sm" | "md" | "lg" | "xl";
14
21
  export type TextWeight = "normal" | "medium" | "bold";
15
- export type TextProps = {
22
+ export type TextLeading = "tight" | "base" | "loose";
23
+ export type TextProps = PassthroughAttrs & {
16
24
  children: ComponentChildren;
17
25
  /** Polymorphic element (span, p, label, figcaption, …). Defaults to 'span'. */
18
26
  as?: keyof JSX.IntrinsicElements;
19
- /** Colour role. 'muted' renders de-emphasised secondary text. Default: 'default'. */
27
+ /** Colour role. 'muted' de-emphasises; 'danger'/'warning'/'success'
28
+ * render status copy from the `--polly-status-*` tokens. Default: 'default'. */
20
29
  tone?: TextTone;
21
30
  /** Token-backed font size. Default: inherit from context. */
22
31
  size?: TextSize;
23
32
  /** Token-backed font weight. Default: inherit from context. */
24
33
  weight?: TextWeight;
34
+ /** Italic emphasis — for hints and asides — without an inline style. */
35
+ italic?: boolean;
36
+ /** Token-backed line height. 'loose' suits multi-line body copy. */
37
+ leading?: TextLeading;
25
38
  className?: string;
26
39
  id?: string;
27
40
  /** Forwarded so <Text as="label"> can point at a control. */
28
41
  htmlFor?: string;
29
- "aria-hidden"?: boolean;
30
42
  };
31
43
  export declare function Text(props: TextProps): JSX.Element;
@@ -396,18 +396,22 @@
396
396
  --s-radius: 0;
397
397
  --s-border-color: transparent;
398
398
  --s-border-width: 0;
399
+ --s-border-style: solid;
399
400
  --s-shadow: none;
400
401
  --s-w: auto;
401
402
  --s-h: auto;
402
403
  --s-mh: auto;
404
+ --s-maxh: none;
403
405
  --s-mis: none;
406
+ --s-overflow: visible;
404
407
  --s-position: static;
405
408
  --s-inset: auto;
409
+ --s-transform: none;
406
410
  --s-z: auto;
407
411
  box-sizing: border-box;
408
412
  padding: var(--s-p);
409
413
  background: var(--s-bg);
410
- border-style: solid;
414
+ border-style: var(--s-border-style);
411
415
  border-color: var(--s-border-color);
412
416
  border-width: var(--s-border-width);
413
417
  border-radius: var(--s-radius);
@@ -415,9 +419,12 @@
415
419
  inline-size: var(--s-w);
416
420
  block-size: var(--s-h);
417
421
  min-block-size: var(--s-mh);
422
+ max-block-size: var(--s-maxh);
418
423
  max-inline-size: var(--s-mis);
424
+ overflow: var(--s-overflow);
419
425
  position: var(--s-position);
420
426
  inset: var(--s-inset);
427
+ transform: var(--s-transform);
421
428
  z-index: var(--s-z);
422
429
  }
423
430
 
@@ -428,34 +435,32 @@
428
435
 
429
436
  .sides-block-start_pQCFqA {
430
437
  border-style: none;
431
- border-block-start-style: solid;
438
+ border-block-start-style: var(--s-border-style);
432
439
  }
433
440
 
434
441
  .sides-block-end_pQCFqA {
435
442
  border-style: none;
436
- border-block-end-style: solid;
443
+ border-block-end-style: var(--s-border-style);
437
444
  }
438
445
 
439
446
  .sides-inline-start_pQCFqA {
440
447
  border-style: none;
441
- border-inline-start-style: solid;
448
+ border-inline-start-style: var(--s-border-style);
442
449
  }
443
450
 
444
451
  .sides-inline-end_pQCFqA {
445
452
  border-style: none;
446
- border-inline-end-style: solid;
453
+ border-inline-end-style: var(--s-border-style);
447
454
  }
448
455
 
449
456
  .sides-block_pQCFqA {
450
457
  border-style: none;
451
- border-block-start-style: solid;
452
- border-block-end-style: solid;
458
+ border-block-style: var(--s-border-style);
453
459
  }
454
460
 
455
461
  .sides-inline_pQCFqA {
456
462
  border-style: none;
457
- border-left-style: solid;
458
- border-right-style: solid;
463
+ border-inline-style: var(--s-border-style);
459
464
  }
460
465
  }
461
466
 
@@ -796,6 +801,34 @@
796
801
  color: var(--polly-text-muted);
797
802
  }
798
803
 
804
+ .danger_75HKdQ {
805
+ color: var(--polly-status-danger-text);
806
+ }
807
+
808
+ .warning_75HKdQ {
809
+ color: var(--polly-status-warning-text);
810
+ }
811
+
812
+ .success_75HKdQ {
813
+ color: var(--polly-status-success-text);
814
+ }
815
+
816
+ .italic_75HKdQ {
817
+ font-style: italic;
818
+ }
819
+
820
+ .tight_75HKdQ {
821
+ line-height: var(--polly-line-height-tight);
822
+ }
823
+
824
+ .base_75HKdQ {
825
+ line-height: var(--polly-line-height-base);
826
+ }
827
+
828
+ .loose_75HKdQ {
829
+ line-height: var(--polly-line-height-loose);
830
+ }
831
+
799
832
  .xs_75HKdQ {
800
833
  font-size: var(--polly-text-xs);
801
834
  }
@@ -123,6 +123,20 @@ function dispatchAction(action, data) {
123
123
  }
124
124
  }
125
125
 
126
+ // src/polly-ui/internal/passthrough.ts
127
+ function collectPassthrough(props) {
128
+ const out = {};
129
+ for (const key of Object.keys(props)) {
130
+ if (!key.startsWith("data-") && !key.startsWith("aria-"))
131
+ continue;
132
+ const value = props[key];
133
+ if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
134
+ out[key] = value;
135
+ }
136
+ }
137
+ return out;
138
+ }
139
+
126
140
  // src/polly-ui/ActionInput.tsx
127
141
  import { jsxDEV as jsxDEV2 } from "preact/jsx-dev-runtime";
128
142
  function ActionInput(props) {
@@ -180,10 +194,12 @@ function ActionInput(props) {
180
194
  }
181
195
  };
182
196
  const className = props.className ? `${ActionInput_module_default["root"]} ${props.className}` : ActionInput_module_default["root"];
197
+ const passthrough = collectPassthrough(props);
183
198
  if (mode === "view") {
184
199
  const rendered = props.renderView ? props.renderView(props.value) : props.value;
185
200
  const isEmpty = props.value.length === 0;
186
201
  return /* @__PURE__ */ jsxDEV2("div", {
202
+ ...passthrough,
187
203
  class: `${className} ${ActionInput_module_default["view"]}`,
188
204
  "data-polly-ui": true,
189
205
  "data-polly-action-input": true,
@@ -208,6 +224,7 @@ function ActionInput(props) {
208
224
  }, undefined, false, undefined, this);
209
225
  }
210
226
  const common = {
227
+ ...passthrough,
211
228
  class: `${ActionInput_module_default["edit"]} ${ActionInput_module_default["root"]}`,
212
229
  "data-polly-ui": true,
213
230
  "data-polly-action-input": true,
@@ -510,6 +527,7 @@ function ActionSelect(props) {
510
527
  if (className)
511
528
  parts.push(className);
512
529
  return /* @__PURE__ */ jsxDEV4("div", {
530
+ ...collectPassthrough(props),
513
531
  id,
514
532
  class: parts.filter(Boolean).join(" "),
515
533
  "data-polly-ui": true,
@@ -691,6 +709,7 @@ function Button(props) {
691
709
  href: disabled ? undefined : props.href,
692
710
  target: "target" in props ? props.target : undefined,
693
711
  rel: "rel" in props ? props.rel : undefined,
712
+ download: "download" in props ? props.download : undefined,
694
713
  "aria-disabled": disabled,
695
714
  "aria-label": ariaLabel,
696
715
  "data-polly-ui": true,
@@ -841,6 +860,7 @@ function Surface(props) {
841
860
  const position = props.position ?? v.position;
842
861
  const inset = props.inset ?? v.inset;
843
862
  const zIndex = props.zIndex ?? v.zIndex;
863
+ const { maxHeight, overflow, borderStyle, transform } = props;
844
864
  const borderWidth = props.borderWidth ?? v.borderWidth ?? (border && border !== "none" ? "default" : undefined);
845
865
  const style = {};
846
866
  if (padding)
@@ -855,18 +875,26 @@ function Surface(props) {
855
875
  style["--s-border-width"] = borderWidthValue(borderWidth);
856
876
  if (shadow)
857
877
  style["--s-shadow"] = shadowValue(shadow);
878
+ if (borderStyle)
879
+ style["--s-border-style"] = borderStyle;
858
880
  if (width)
859
881
  style["--s-w"] = width;
860
882
  if (height)
861
883
  style["--s-h"] = height;
862
884
  if (minHeight)
863
885
  style["--s-mh"] = minHeight;
886
+ if (maxHeight)
887
+ style["--s-maxh"] = maxHeight;
864
888
  if (maxInlineSize)
865
889
  style["--s-mis"] = maxInlineSize;
890
+ if (overflow)
891
+ style["--s-overflow"] = overflow;
866
892
  if (position)
867
893
  style["--s-position"] = position;
868
894
  if (inset)
869
895
  style["--s-inset"] = inset;
896
+ if (transform)
897
+ style["--s-transform"] = transform;
870
898
  if (zIndex !== undefined)
871
899
  style["--s-z"] = String(zIndex);
872
900
  if (props.style) {
@@ -1041,6 +1069,7 @@ function Cluster(props) {
1041
1069
  if (className)
1042
1070
  parts.push(className);
1043
1071
  return createElement3(as, {
1072
+ ...collectPassthrough(props),
1044
1073
  id,
1045
1074
  class: parts.filter(Boolean).join(" "),
1046
1075
  style,
@@ -1060,11 +1089,13 @@ var Code_module_default = {
1060
1089
  import { jsxDEV as jsxDEV9 } from "preact/jsx-dev-runtime";
1061
1090
  function Code(props) {
1062
1091
  const { children, block, className, id } = props;
1092
+ const passthrough = collectPassthrough(props);
1063
1093
  if (block) {
1064
1094
  const parts2 = [Code_module_default["block"]];
1065
1095
  if (className)
1066
1096
  parts2.push(className);
1067
1097
  return /* @__PURE__ */ jsxDEV9("pre", {
1098
+ ...passthrough,
1068
1099
  id,
1069
1100
  class: parts2.filter(Boolean).join(" "),
1070
1101
  "data-polly-ui": true,
@@ -1078,6 +1109,7 @@ function Code(props) {
1078
1109
  if (className)
1079
1110
  parts.push(className);
1080
1111
  return /* @__PURE__ */ jsxDEV9("code", {
1112
+ ...passthrough,
1081
1113
  id,
1082
1114
  class: parts.filter(Boolean).join(" "),
1083
1115
  "data-polly-ui": true,
@@ -1755,6 +1787,13 @@ import { createElement as createElement4 } from "preact";
1755
1787
  var Text_module_default = {
1756
1788
  text: "text_75HKdQ",
1757
1789
  muted: "muted_75HKdQ",
1790
+ danger: "danger_75HKdQ",
1791
+ warning: "warning_75HKdQ",
1792
+ success: "success_75HKdQ",
1793
+ italic: "italic_75HKdQ",
1794
+ tight: "tight_75HKdQ",
1795
+ base: "base_75HKdQ",
1796
+ loose: "loose_75HKdQ",
1758
1797
  xs: "xs_75HKdQ",
1759
1798
  sm: "sm_75HKdQ",
1760
1799
  md: "md_75HKdQ",
@@ -1767,23 +1806,37 @@ var Text_module_default = {
1767
1806
 
1768
1807
  // src/polly-ui/Text.tsx
1769
1808
  function Text(props) {
1770
- const { children, as = "span", tone = "default", size, weight, className, id } = props;
1809
+ const {
1810
+ children,
1811
+ as = "span",
1812
+ tone = "default",
1813
+ size,
1814
+ weight,
1815
+ italic,
1816
+ leading,
1817
+ className,
1818
+ id
1819
+ } = props;
1771
1820
  const parts = [Text_module_default["text"]];
1772
- if (tone === "muted")
1773
- parts.push(Text_module_default["muted"]);
1821
+ if (tone !== "default")
1822
+ parts.push(Text_module_default[tone]);
1774
1823
  if (size)
1775
1824
  parts.push(Text_module_default[size]);
1776
1825
  if (weight)
1777
1826
  parts.push(Text_module_default[weight]);
1827
+ if (italic)
1828
+ parts.push(Text_module_default["italic"]);
1829
+ if (leading)
1830
+ parts.push(Text_module_default[leading]);
1778
1831
  if (className)
1779
1832
  parts.push(className);
1780
1833
  return createElement4(as, {
1834
+ ...collectPassthrough(props),
1781
1835
  id,
1782
1836
  class: parts.filter(Boolean).join(" "),
1783
1837
  for: props.htmlFor,
1784
1838
  "data-polly-ui": true,
1785
- "data-polly-text": tone,
1786
- "aria-hidden": props["aria-hidden"]
1839
+ "data-polly-text": tone
1787
1840
  }, children);
1788
1841
  }
1789
1842
  // src/polly-ui/internal/input-base.ts
@@ -2047,4 +2100,4 @@ export {
2047
2100
  ActionForm
2048
2101
  };
2049
2102
 
2050
- //# debugId=05E49C730A24E5F464756E2164756E21
2103
+ //# debugId=7DA35338ECD4891D64756E2164756E21