@mechane-ai/elements 0.65.0 → 0.68.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 (129) hide show
  1. package/README.md +21 -10
  2. package/dist/ai.js +288 -205
  3. package/dist/{article-BrUa4Wz1.js → article-Ni152e-v.js} +107 -92
  4. package/dist/article.js +1 -1
  5. package/dist/catalog.json +151 -34
  6. package/dist/{categorical-values-AXJkMt-Y.js → categorical-values-6Iz03F1i.js} +1 -1
  7. package/dist/{cells-X8SVrZBc.js → cells-BRI8LpMU.js} +1 -1
  8. package/dist/charts/cartesian.js +1 -1
  9. package/dist/charts/cells.js +1 -1
  10. package/dist/charts/comparison.js +1 -1
  11. package/dist/charts/distribution.js +1 -1
  12. package/dist/charts/figure.js +12 -12
  13. package/dist/charts/graph.js +1 -1
  14. package/dist/charts/hierarchy.js +1 -1
  15. package/dist/charts/image.js +1 -1
  16. package/dist/charts/matrix.js +2 -2
  17. package/dist/charts/plot.js +16 -15
  18. package/dist/charts/relationship.js +1 -1
  19. package/dist/charts/text.js +1 -1
  20. package/dist/charts/timeline.js +2 -2
  21. package/dist/charts/trend.js +1 -1
  22. package/dist/charts.js +3 -3
  23. package/dist/{code-block-BDRmjlES.js → code-block-DbW_t9U4.js} +1 -1
  24. package/dist/collections.js +1 -1
  25. package/dist/{color-legend-CIo7DhXB.js → color-legend-4As8881l.js} +1 -1
  26. package/dist/{commands-rzsDElrG.js → commands-C7Zrp-tG.js} +2 -2
  27. package/dist/content/code.js +1 -1
  28. package/dist/content/diff.js +3 -3
  29. package/dist/content/link.js +1 -1
  30. package/dist/content/markdown.js +1 -1
  31. package/dist/content/tree.js +2 -2
  32. package/dist/{content-link-DRaNf1mD.js → content-link-BN4NPp0u.js} +1 -1
  33. package/dist/content.js +1 -1
  34. package/dist/{dates-wu-gKO2C.js → dates-OTq-xU33.js} +2 -2
  35. package/dist/{dumbbell-plot-VFajQtEW.js → dumbbell-plot-jaQvOctJ.js} +4 -4
  36. package/dist/{embedding-map-BqDEmy88.js → embedding-map-DnZL1kvY.js} +8 -8
  37. package/dist/feedback.js +1 -1
  38. package/dist/figure-format-BVb7yFCA.js +46 -0
  39. package/dist/{figure-frame-Dd-pOeZN.js → figure-frame-96zFqsWz.js} +22 -21
  40. package/dist/forms/dates.js +1 -1
  41. package/dist/{forms-Bjx7JQ30.js → forms-iAOjGRTO.js} +1 -1
  42. package/dist/forms.js +2 -2
  43. package/dist/{image-grid-Dpyqxgwy.js → image-grid-B6fdmE9c.js} +4 -4
  44. package/dist/index.js +1 -1
  45. package/dist/kits/evaluation.js +15 -15
  46. package/dist/kits/interpretability.js +49 -45
  47. package/dist/kits/operations.js +81 -80
  48. package/dist/kits/research.js +776 -499
  49. package/dist/kits/training.js +108 -107
  50. package/dist/layout.js +1 -1
  51. package/dist/lesson.js +3 -3
  52. package/dist/markdown-JeuBeMDZ.js +293 -0
  53. package/dist/mdx.js +6 -6
  54. package/dist/navigation/commands.js +1 -1
  55. package/dist/{navigation-Cp3p0gss.js → navigation-CTnYtVD8.js} +1 -1
  56. package/dist/navigation.js +3 -3
  57. package/dist/packages/ai/src/index.d.ts +2 -0
  58. package/dist/packages/ai/src/message-reactions.d.ts +51 -0
  59. package/dist/packages/ai/src/message.d.ts +3 -1
  60. package/dist/packages/charts/src/plot/index.d.ts +2 -0
  61. package/dist/packages/charts/src/plot/plot-layout.d.ts +2 -2
  62. package/dist/packages/charts/src/plot/spatial-layer.d.ts +32 -0
  63. package/dist/packages/charts/src/plot/ticks.d.ts +2 -2
  64. package/dist/packages/collections/src/card-columns-model.d.ts +50 -0
  65. package/dist/packages/collections/src/card-columns.d.ts +30 -0
  66. package/dist/packages/collections/src/collection-page.d.ts +43 -0
  67. package/dist/packages/collections/src/column-card.d.ts +15 -0
  68. package/dist/packages/collections/src/data-table-layout.d.ts +2 -0
  69. package/dist/packages/collections/src/data-table-rows.d.ts +4 -3
  70. package/dist/packages/collections/src/data-table.d.ts +2 -2
  71. package/dist/packages/collections/src/index.d.ts +5 -0
  72. package/dist/packages/collections/src/table-query.d.ts +9 -1
  73. package/dist/packages/feedback/src/feedback.d.ts +0 -4
  74. package/dist/packages/feedback/src/index.d.ts +1 -1
  75. package/dist/packages/foundations/src/visible-motion.d.ts +1 -1
  76. package/dist/packages/kits/src/research/index.d.ts +7 -2
  77. package/dist/packages/kits/src/research/motion-clip.d.ts +41 -0
  78. package/dist/packages/kits/src/research/motion-error.d.ts +8 -0
  79. package/dist/packages/kits/src/research/motion-figure.d.ts +9 -0
  80. package/dist/packages/kits/src/research/motion-frame.d.ts +22 -0
  81. package/dist/packages/kits/src/research/motion-scene.d.ts +22 -0
  82. package/dist/packages/teaching/src/article/uncover.d.ts +2 -0
  83. package/dist/{param-CwT1RvUS.js → param-Dk92C-K1.js} +2 -2
  84. package/dist/{pierre-diff-DuvK3kLF.js → pierre-diff-DXVIwW7o.js} +1 -1
  85. package/dist/plot-CpTwLIYN.js +101 -0
  86. package/dist/{plot-layout-CvkeUuG6.js → plot-layout-1MG72ZWn.js} +175 -124
  87. package/dist/{plot-surface-yy37R4vs.js → plot-surface-8-FZI94y.js} +1 -1
  88. package/dist/{reference-lines-AMeDkYlo.js → reference-lines-C18o1yEY.js} +1 -1
  89. package/dist/{scene-BRhI8XSy.js → scene-B8dppj5V.js} +7 -7
  90. package/dist/scene.js +1 -1
  91. package/dist/{slope-chart-BMOCaa8R.js → slope-chart-CELflRJd.js} +5 -5
  92. package/dist/{src-9n2M1V_y.js → src-BCAelv4f.js} +3 -3
  93. package/dist/{src-BgmAkau8.js → src-Bkov5TTa.js} +171 -164
  94. package/dist/{src-Bns-5joF.js → src-BsqbWDxS.js} +4 -4
  95. package/dist/{src-BdyO4PgQ.js → src-CIyuaSCi.js} +101 -107
  96. package/dist/{src-Tu6d_Pm8.js → src-Dc1t1ugL.js} +958 -585
  97. package/dist/{src-C5SH3jjU.js → src-DceyVyL0.js} +2 -2
  98. package/dist/{src-C_E29-DX.js → src-Dlh99sPD.js} +1 -1
  99. package/dist/styles2.css +33 -1
  100. package/dist/{time-series-CTNVqoUQ.js → time-series-DtAtGoT_.js} +9 -9
  101. package/dist/{timeline-DrsDtEIW.js → timeline-CzianQir.js} +5 -5
  102. package/dist/{token-heatmap-DddArdH8.js → token-heatmap-m6oaMwkK.js} +274 -289
  103. package/dist/{token-predictions-CBykmPID.js → token-predictions-CpGVjOIs.js} +4 -4
  104. package/dist/{transport-r1QgELf8.js → transport-DQ1yzsQl.js} +5 -5
  105. package/dist/{tree-diagram-BIJFK4pl.js → tree-diagram-D9ekymCQ.js} +5 -5
  106. package/dist/{treemap-DgmEw_mr.js → treemap-DT8q65LQ.js} +5 -5
  107. package/dist/{use-tween-BWf44Jy4.js → use-tween-DbXVZBR8.js} +1 -1
  108. package/dist/{violin-plot-BYJnv6sG.js → violin-plot-83HSjnQM.js} +4 -4
  109. package/dist/visible-motion-D6NwjGNz.js +24 -0
  110. package/dist/{waterfall-BNseqMas.js → waterfall-DmApvdrY.js} +5 -5
  111. package/package.json +1 -1
  112. package/recipes/recorded-motion.tsx +14 -0
  113. package/recipes/searchable-collection.tsx +74 -76
  114. package/skills/extend-elements/SKILL.md +2 -1
  115. package/skills/review-elements/SKILL.md +15 -7
  116. package/skills/review-explainer/SKILL.md +4 -0
  117. package/skills/upgrade-elements/SKILL.md +3 -1
  118. package/skills/upgrade-elements/references/releases.md +20 -0
  119. package/skills/use-elements/SKILL.md +10 -6
  120. package/skills/use-elements/references/collections.md +59 -12
  121. package/skills/use-elements/references/conversations.md +32 -0
  122. package/skills/use-elements/references/editorial-restraint.md +17 -29
  123. package/skills/use-elements/references/figures.md +6 -2
  124. package/skills/use-elements/references/kits.md +23 -0
  125. package/skills/use-elements/references/workspace.md +5 -5
  126. package/skills/write-explainer/SKILL.md +5 -0
  127. package/dist/figure-format-B8kRZMlo.js +0 -36
  128. package/dist/markdown--nfaDoR1.js +0 -313
  129. package/dist/packages/kits/src/research/collection-page.d.ts +0 -71
@@ -1,7 +1,7 @@
1
- import { u as e } from "./src-BgmAkau8.js";
2
- import { d as t, m as n } from "./src-BdyO4PgQ.js";
1
+ import { o as e, u as t } from "./src-Bkov5TTa.js";
2
+ import { d as n } from "./src-CIyuaSCi.js";
3
3
  import { n as r, t as i } from "./chart-tones-ei3BC2AL.js";
4
- import { a, i as o, n as s, r as c } from "./figure-format-B8kRZMlo.js";
4
+ import { a, i as o, n as s, r as c } from "./figure-format-BVb7yFCA.js";
5
5
  import { r as l, t as u } from "./scale-C2xgZyZN.js";
6
6
  import * as d from "@stylexjs/stylex";
7
7
  import { createParts as f, mergeProps as p } from "@ui-sdk/react/primitive";
@@ -14,24 +14,24 @@ function re(e) {
14
14
  return new Set(e.map((e) => e.id)).size === e.length;
15
15
  }
16
16
  // packages/charts/src/chart.tsx
17
- var ie = 10, O = "[data-slot=\"chart-mark\"]", ae = /* @__PURE__ */ new Set(["Enter", " "]), oe = /* @__PURE__ */ new Set(["ArrowDown", "ArrowUp"]), se = {
17
+ var ie = 10, ae = "[data-slot=\"chart-mark\"]", oe = /* @__PURE__ */ new Set(["Enter", " "]), se = /* @__PURE__ */ new Set(["ArrowDown", "ArrowUp"]), ce = {
18
18
  ArrowLeft: [-1, 0],
19
19
  ArrowRight: [1, 0],
20
20
  ArrowUp: [0, -1],
21
21
  ArrowDown: [0, 1]
22
22
  };
23
- function k(e, t) {
23
+ function O(e, t) {
24
24
  return t !== null && e.some((e) => e.id === t);
25
25
  }
26
- function A(e) {
27
- let t = [e.cursor, e.selected].find((t) => k(e.items, t)) ?? e.items[0]?.id ?? null;
26
+ function k(e) {
27
+ let t = [e.cursor, e.selected].find((t) => O(e.items, t)) ?? e.items[0]?.id ?? null;
28
28
  return {
29
- inspected: k(e.items, e.inspected) ? e.inspected : null,
30
- selected: k(e.items, e.selected) ? e.selected : null,
29
+ inspected: O(e.items, e.inspected) ? e.inspected : null,
30
+ selected: O(e.items, e.selected) ? e.selected : null,
31
31
  cursor: t
32
32
  };
33
33
  }
34
- function ce({ key: e, index: t, last: n, columns: r, isReversed: i }) {
34
+ function le({ key: e, index: t, last: n, columns: r, isReversed: i }) {
35
35
  let a = t - t % r, o = Math.min(n, a + r - 1), s = Math.max(a, t - 1), c = Math.min(o, t + 1);
36
36
  return {
37
37
  Home: a,
@@ -42,15 +42,15 @@ function ce({ key: e, index: t, last: n, columns: r, isReversed: i }) {
42
42
  ArrowDown: t + r > n ? t : t + r
43
43
  }[e];
44
44
  }
45
- function le({ event: e, index: t, last: n, arrows: r, isReversed: i }) {
46
- if (r === "both" && oe.has(e.key)) return Math.max(0, Math.min(n, t + (e.key === "ArrowDown" ? 1 : -1)));
45
+ function ue({ event: e, index: t, last: n, arrows: r, isReversed: i }) {
46
+ if (r === "both" && se.has(e.key)) return Math.max(0, Math.min(n, t + (e.key === "ArrowDown" ? 1 : -1)));
47
47
  let a = ne(e, {
48
48
  arrows: "horizontal",
49
49
  dir: i ? "rtl" : "ltr"
50
50
  });
51
51
  if (a !== null) return a.bound === void 0 ? Math.max(0, Math.min(n, t + a.direction * (a.size === "large" ? ie : 1))) : a.bound === "min" ? 0 : n;
52
52
  }
53
- var j = b({
53
+ var A = b({
54
54
  name: "chart",
55
55
  options: {
56
56
  items: "value",
@@ -83,7 +83,7 @@ var j = b({
83
83
  api: (e) => {
84
84
  let { store: t } = e, n = ee(e), r = !1, i = e.options().revision;
85
85
  e.onOptions((e) => {
86
- let { inspected: n } = t.get(), r = e.revision !== i || n !== null && !k(e.items, n);
86
+ let { inspected: n } = t.get(), r = e.revision !== i || n !== null && !O(e.items, n);
87
87
  i = e.revision, r && n !== null && e.inspected === void 0 && t.set({ inspected: null });
88
88
  });
89
89
  function a(t) {
@@ -91,7 +91,7 @@ var j = b({
91
91
  return r?.(t) ?? n.find((e) => e.id === t)?.label ?? t;
92
92
  }
93
93
  function o(i, o) {
94
- if (i !== null && !k(e.options().items, i) || (r = !1, i !== null && o.reason !== "item-hover" && t.set({ cursor: i }), t.get().inspected === i)) return !1;
94
+ if (i !== null && !O(e.options().items, i) || (r = !1, i !== null && o.reason !== "item-hover" && t.set({ cursor: i }), t.get().inspected === i)) return !1;
95
95
  let { reason: s, event: c } = o, l = n("inspected", i, c === void 0 ? { reason: s } : {
96
96
  reason: s,
97
97
  event: c
@@ -99,13 +99,13 @@ var j = b({
99
99
  return l && i !== null && o.reason === "list-navigation" && v(i === t.get().selected ? `${a(i)}. Selected.` : a(i)), l;
100
100
  }
101
101
  function s(t, n) {
102
- return k(e.options().items, t) ? !x(e, "onSelect", t, n === void 0 ? { reason: "item-press" } : {
102
+ return O(e.options().items, t) ? !x(e, "onSelect", t, n === void 0 ? { reason: "item-press" } : {
103
103
  reason: "item-press",
104
104
  event: n
105
105
  }) : !1;
106
106
  }
107
107
  function c(n, r) {
108
- let { items: i, columns: a, arrows: o = "horizontal", place: s } = e.options(), { cursor: c } = A(t.get()), l = Math.max(0, i.findIndex((e) => e.id === c)), u = i.length - 1, d = se[n.key];
108
+ let { items: i, columns: a, arrows: o = "horizontal", place: s } = e.options(), { cursor: c } = k(t.get()), l = Math.max(0, i.findIndex((e) => e.id === c)), u = i.length - 1, d = ce[n.key];
109
109
  if (s !== void 0 && d !== void 0) {
110
110
  let e = c === null ? void 0 : s(c);
111
111
  if (c === null || e === void 0) return i[l]?.id;
@@ -118,13 +118,13 @@ var j = b({
118
118
  });
119
119
  return w(e, t, d) ?? c;
120
120
  }
121
- let f = C(r), p = a === void 0 || a < 1 ? le({
121
+ let f = C(r), p = a === void 0 || a < 1 ? ue({
122
122
  event: n,
123
123
  index: l,
124
124
  last: u,
125
125
  arrows: o,
126
126
  isReversed: f
127
- }) : ce({
127
+ }) : le({
128
128
  key: n.key,
129
129
  index: l,
130
130
  last: u,
@@ -150,8 +150,8 @@ var j = b({
150
150
  keydown(n, r) {
151
151
  let i = n.altKey || n.ctrlKey || n.metaKey;
152
152
  if (n.defaultPrevented || i || e.options().items.length === 0) return;
153
- if (ae.has(n.key)) {
154
- let { cursor: r } = A(t.get());
153
+ if (oe.has(n.key)) {
154
+ let { cursor: r } = k(t.get());
155
155
  !(n.target instanceof Element && n.target.closest("button, a, input, select, textarea") !== null) && r !== null && e.options().onSelect !== void 0 && (n.preventDefault(), s(r, n));
156
156
  return;
157
157
  }
@@ -162,7 +162,7 @@ var j = b({
162
162
  }));
163
163
  },
164
164
  focus(e, n) {
165
- e.target === n && S() && o(A(t.get()).cursor, {
165
+ e.target === n && S() && o(k(t.get()).cursor, {
166
166
  reason: "focus-in",
167
167
  event: e
168
168
  });
@@ -202,18 +202,18 @@ var j = b({
202
202
  });
203
203
  },
204
204
  press(n) {
205
- let { inspected: r } = A(t.get());
206
- n?.target instanceof Element && n.target.closest(O) !== null || e.options().locate !== void 0 && r !== null && e.options().onSelect !== void 0 && s(r, n);
205
+ let { inspected: r } = k(t.get());
206
+ n?.target instanceof Element && n.target.closest(ae) !== null || e.options().locate !== void 0 && r !== null && e.options().onSelect !== void 0 && s(r, n);
207
207
  }
208
208
  };
209
209
  },
210
210
  slots: (e) => ({
211
- root: e({ state: A }),
211
+ root: e({ state: k }),
212
212
  plot: e({
213
- state: A,
213
+ state: k,
214
214
  attrs: (e) => ({
215
215
  tabindex: e.items.length > 0 ? "0" : void 0,
216
- "data-inspecting": A(e).inspected === null ? void 0 : ""
216
+ "data-inspecting": k(e).inspected === null ? void 0 : ""
217
217
  }),
218
218
  press: ({ api: e }, t) => e.press(t),
219
219
  on: {
@@ -236,7 +236,7 @@ var j = b({
236
236
  e.pointerType === "mouse" && t.leave(e);
237
237
  },
238
238
  mousedown: (e, { el: t }) => {
239
- t !== void 0 && e.target instanceof Element && e.target.closest(O) !== null && (e.preventDefault(), t.focus({ preventScroll: !0 }));
239
+ t !== void 0 && e.target instanceof Element && e.target.closest(ae) !== null && (e.preventDefault(), t.focus({ preventScroll: !0 }));
240
240
  }
241
241
  },
242
242
  bind: (e, t) => {
@@ -285,14 +285,14 @@ var j = b({
285
285
  items: (e) => e.items(),
286
286
  closed: !0
287
287
  }
288
- }), ue = f(j, { root: "figure" }).Root, de = f(j, {
288
+ }), de = f(A, { root: "figure" }).Root, j = f(A, {
289
289
  root: "figure",
290
290
  plot: "div",
291
291
  mark: "span"
292
- }), fe = de.Plot, pe = f(j, {
292
+ }), fe = j.Plot, pe = f(A, {
293
293
  root: "figure",
294
294
  plot: "p"
295
- }).Plot, me = de.Mark;
295
+ }).Plot, me = j.Mark;
296
296
  function he(e, t) {
297
297
  return e.find((e) => e.id === t)?.label ?? "\xA0";
298
298
  }
@@ -309,22 +309,22 @@ var _e = { root: {
309
309
  kLWn49: "x1778rvt",
310
310
  $$css: !0
311
311
  } };
312
- function ve({ title: t, id: n, meta: r, actions: i }) {
312
+ function ve({ title: e, id: n, meta: r, actions: i }) {
313
313
  let a = m.toArray(r).length > 0, o = m.toArray(i).length > 0, s = a || o, c = a && /* @__PURE__ */ E("div", {
314
- ...d.props(e.meta),
314
+ ...d.props(t.meta),
315
315
  children: r
316
316
  }), l = o && /* @__PURE__ */ E("div", {
317
- ...d.props(e.actions),
317
+ ...d.props(t.actions),
318
318
  children: i
319
319
  });
320
320
  return /* @__PURE__ */ D("div", {
321
- ...d.props(e.row, e.reportRow, _e.root),
321
+ ...d.props(t.row, t.reportRow, _e.root),
322
322
  children: [/* @__PURE__ */ E("p", {
323
323
  id: n,
324
- ...d.props(e.title),
325
- children: t
324
+ ...d.props(t.title),
325
+ children: e
326
326
  }), s && /* @__PURE__ */ D("div", {
327
- ...d.props(e.trailing),
327
+ ...d.props(t.trailing),
328
328
  children: [c, l]
329
329
  })]
330
330
  });
@@ -414,15 +414,15 @@ function P({ tone: e, shape: t = "swatch", children: n }) {
414
414
  });
415
415
  }
416
416
  // packages/charts/src/chart-series-summary.tsx
417
- function Se({ series: e, values: r }) {
418
- return Object.keys(r).length === e.length && e.every((e) => Object.hasOwn(r, e.id)) ? /* @__PURE__ */ E("dl", {
417
+ function Se({ series: t, values: r }) {
418
+ return Object.keys(r).length === t.length && t.every((e) => Object.hasOwn(r, e.id)) ? /* @__PURE__ */ E("dl", {
419
419
  "aria-label": "Period summary",
420
420
  className: "x78zum5 x1a02dak xaml1ju x1ghz6dp xeuugli",
421
- children: e.map((e, n) => /* @__PURE__ */ D("div", {
421
+ children: t.map((e, t) => /* @__PURE__ */ D("div", {
422
422
  ...{
423
423
  0: { className: "xeuugli" },
424
424
  1: { className: "xeuugli xo02m6d xpilrb4 x1t7ytsu x97x49r" }
425
- }[n > 0 | 0],
425
+ }[t > 0 | 0],
426
426
  children: [/* @__PURE__ */ D("dt", {
427
427
  className: "x78zum5 x6s0dn4 xunmzkg x153jb6y xy8obcc",
428
428
  children: [/* @__PURE__ */ E(P, {
@@ -431,11 +431,12 @@ function Se({ series: e, values: r }) {
431
431
  }), e.label]
432
432
  }), /* @__PURE__ */ E("dd", {
433
433
  className: "x1ghz6dp xbixft x71lla1 xgkpprq xk4h15q x1wjjqco xss6m8b xj0a0fe",
434
- children: r[e.id] === void 0 ? /* @__PURE__ */ E(t, { width: "6ch" }) : r[e.id]
434
+ children: r[e.id] === void 0 ? /* @__PURE__ */ E(n, { width: "6ch" }) : r[e.id]
435
435
  })]
436
436
  }, e.id))
437
- }) : /* @__PURE__ */ E(n, {
438
- hasError: !0,
437
+ }) : /* @__PURE__ */ E(e, {
438
+ tone: "negative",
439
+ role: "alert",
439
440
  children: "Period values must match the chart series identifiers."
440
441
  });
441
442
  }
@@ -451,7 +452,7 @@ function we() {
451
452
  return g(F);
452
453
  }
453
454
  // packages/charts/src/chart-frame.tsx
454
- function Te({ title: t, description: n, children: r, actions: i, footer: a, report: o, series: s = [], figure: c = {}, seriesLegend: l, scaleLegend: u }) {
455
+ function Te({ title: e, description: n, children: r, actions: i, footer: a, report: o, series: s = [], figure: c = {}, seriesLegend: l, scaleLegend: u }) {
455
456
  let f = _(), h = we() && i === void 0, g = /* @__PURE__ */ D(T, { children: [
456
457
  l !== void 0 && /* @__PURE__ */ E("div", {
457
458
  className: "xeuugli x1jfksii",
@@ -468,15 +469,15 @@ function Te({ title: t, description: n, children: r, actions: i, footer: a, repo
468
469
  })
469
470
  ] });
470
471
  if (o !== void 0) {
471
- let e = o.seriesValues === void 0 ? o.summary : /* @__PURE__ */ E(Se, {
472
+ let t = o.seriesValues === void 0 ? o.summary : /* @__PURE__ */ E(Se, {
472
473
  series: s,
473
474
  values: o.seriesValues
474
- }), r = e != null && e !== !1, a = m.toArray([o.actions, i]).length > 0, l = /* @__PURE__ */ D(T, { children: [o.actions, i] });
475
+ }), r = t != null && t !== !1, a = m.toArray([o.actions, i]).length > 0, l = /* @__PURE__ */ D(T, { children: [o.actions, i] });
475
476
  return /* @__PURE__ */ D("figure", {
476
477
  ...p(c, { "aria-labelledby": f }, { className: "xeuugli x1ghz6dp xbixft xpvm0e4 x1hz01jw xtqrqnz xj57cvi x1778rvt xmkeg23 x1y0btm7 x1ey3b81" }),
477
478
  children: [/* @__PURE__ */ E("figcaption", { children: /* @__PURE__ */ E(ve, {
478
479
  id: f,
479
- title: t,
480
+ title: e,
480
481
  meta: o.meta,
481
482
  actions: a && l
482
483
  }) }), /* @__PURE__ */ D("div", {
@@ -484,7 +485,7 @@ function Te({ title: t, description: n, children: r, actions: i, footer: a, repo
484
485
  children: [
485
486
  r && /* @__PURE__ */ E("div", {
486
487
  className: "x1xxlxpq xeuugli",
487
- children: e
488
+ children: t
488
489
  }),
489
490
  n !== void 0 && /* @__PURE__ */ E("p", {
490
491
  className: "x1ghz6dp x1c87qhr x153jb6y xy8obcc xas2l8k",
@@ -507,13 +508,13 @@ function Te({ title: t, description: n, children: r, actions: i, footer: a, repo
507
508
  children: [/* @__PURE__ */ E("p", {
508
509
  id: f,
509
510
  className: "x1ghz6dp x12myhf4 x1778rvt x1b5ytql",
510
- children: t
511
+ children: e
511
512
  }), n !== void 0 && /* @__PURE__ */ E("p", {
512
513
  className: "x1ghz6dp x1c87qhr x153jb6y xy8obcc xas2l8k",
513
514
  children: n
514
515
  })]
515
516
  }), i !== void 0 && /* @__PURE__ */ E("div", {
516
- ...d.props(e.actions),
517
+ ...d.props(t.actions),
517
518
  children: i
518
519
  })]
519
520
  }), g]
@@ -607,24 +608,45 @@ var B = 1e3, V = {
607
608
  function Be({ domain: e, count: t, zoneOffset: n }) {
608
609
  let [r, i] = e;
609
610
  if (!(t > 0) || !(i > r)) return [];
610
- let a = (i - r) / t, o = Object.values(V).map((e) => e * B).find((e) => e >= a) ?? V.year * B, s = o > ze ? Math.ceil((r + n) / Re) * Re : 0, c = s + Math.ceil((r + n - s) / o) * o, l = Math.max(0, Math.min(ke, Math.floor((i + n - c) / o) + 1));
611
- return Array.from({ length: l }, (e, t) => c + t * o - n);
611
+ let a = (i - r) / t, o = Object.values(V).map((e) => e * B).find((e) => e >= a) ?? V.year * B, s = typeof n == "number" ? () => n : n, c = o > ze ? Math.ceil((r + s(r)) / Re) * Re : 0;
612
+ function* l() {
613
+ let e = Math.ceil(r);
614
+ for (; e <= i;) {
615
+ let t = s(e), n = e + t - c, r = c + Math.ceil(n / o) * o - t;
616
+ r === e && (yield e);
617
+ let a = r === e ? e + o : r, l = Math.min(a, Math.floor(i));
618
+ e = s(l) === t ? a : Ve(e, l, s);
619
+ }
620
+ }
621
+ let u = l();
622
+ return Array.from({ length: ke }, () => {
623
+ let e = u.next();
624
+ return e.done === !0 ? void 0 : e.value;
625
+ }).filter((e) => e !== void 0);
626
+ }
627
+ function Ve(e, t, n) {
628
+ let r = n(e), i = e, a = t;
629
+ for (; a - i > 1;) {
630
+ let e = i + Math.floor((a - i) / L);
631
+ n(e) === r ? i = e : a = e;
632
+ }
633
+ return a;
612
634
  }
613
635
  // packages/charts/src/plot/plot-layout.ts
614
- var Ve = {
636
+ var He = {
615
637
  compact: 160,
616
638
  regular: 260,
617
639
  tall: 380
618
- }, H = 7, He = 12, Ue = 44, We = 20, Ge = 28, Ke = 24, qe = 12, Je = 20, U = .4, Ye = .5, Xe = 2, Ze = 3, Qe = 120, $e = 6, et = .4, tt = Array.from({ length: 4 }, (e, t) => t + 1), W = 10, G = 96, K = 56, nt = 3, rt = .2, it = 16, at = 14, ot = "\n", st = {
640
+ }, H = 7, Ue = 12, We = 44, Ge = 20, Ke = 28, qe = 24, Je = 12, Ye = 20, U = .4, Xe = .5, Ze = 2, Qe = 3, $e = 120, et = 6, tt = .4, nt = Array.from({ length: 4 }, (e, t) => t + 1), W = 10, G = 96, K = 56, rt = 3, it = .2, at = 16, ot = 14, st = "\n", ct = {
619
641
  linear: void 0,
620
642
  log: "log scale",
621
643
  symlog: "symmetric log scale"
622
644
  };
623
- function ct(e) {
624
- let t = st[e.scale ?? "linear"];
645
+ function lt(e) {
646
+ let t = ct[e.scale ?? "linear"];
625
647
  return t === void 0 ? e.label : `${e.label} (${t})`;
626
648
  }
627
- function lt({ values: e, isZeroBased: t = !1, scale: n = "linear" }) {
649
+ function ut({ values: e, isZeroBased: t = !1, scale: n = "linear" }) {
628
650
  let r = e.flatMap((e) => e !== null && Number.isFinite(e) ? [e] : []), i = t && n !== "log" ? [...r, 0] : r;
629
651
  if (i.length === 0) return n === "log" ? [1, W] : [0, 1];
630
652
  let a = Math.min(...i), o = Math.max(...i);
@@ -634,16 +656,16 @@ function lt({ values: e, isZeroBased: t = !1, scale: n = "linear" }) {
634
656
  }
635
657
  if (a === o) return [a - 1, o + 1];
636
658
  if (n === "symlog") return [a, o];
637
- let [s, c] = R([a, o], nt), l = s === void 0 || c === void 0 ? o - a : c - s;
659
+ let [s, c] = R([a, o], rt), l = s === void 0 || c === void 0 ? o - a : c - s;
638
660
  return [Math.floor(a / l) * l, Math.ceil(o / l) * l];
639
661
  }
640
662
  function q({ width: e, valueLabels: t, hasXTitle: n, hasYTitle: r, leftShare: i = U }) {
641
- let a = Math.max(0, ...t.map((e) => e.length)) * H + He + (r ? Ge : 0);
663
+ let a = Math.max(0, ...t.map((e) => e.length)) * H + Ue + (r ? Ke : 0);
642
664
  return {
643
- top: qe,
644
- right: Je,
645
- bottom: Ke + (n ? We : 0),
646
- left: Math.min(Math.max(Ue, a), e * i)
665
+ top: Je,
666
+ right: Ye,
667
+ bottom: qe + (n ? Ge : 0),
668
+ left: Math.min(Math.max(We, a), e * i)
647
669
  };
648
670
  }
649
671
  function J({ width: e, height: t, margins: n }) {
@@ -659,10 +681,10 @@ function J({ width: e, height: t, margins: n }) {
659
681
  innerHeight: i - n.top
660
682
  };
661
683
  }
662
- function ut(e) {
684
+ function dt(e) {
663
685
  return new Set(e).size === e.length;
664
686
  }
665
- function Y(e, t) {
687
+ function ft(e, t) {
666
688
  return {
667
689
  ...e,
668
690
  minimumSignificantDigits: void 0,
@@ -671,7 +693,7 @@ function Y(e, t) {
671
693
  maximumFractionDigits: Math.max(e.maximumFractionDigits ?? 0, t)
672
694
  };
673
695
  }
674
- function dt(e, t) {
696
+ function pt(e, t) {
675
697
  return !t || typeof e == "function" || e.style !== "unit" ? e : {
676
698
  ...e,
677
699
  style: "decimal",
@@ -679,36 +701,36 @@ function dt(e, t) {
679
701
  unitDisplay: void 0
680
702
  };
681
703
  }
682
- function X({ values: e, axis: t, locale: n, hasTitle: r }) {
683
- let i = dt(t.tickFormat ?? o(t.format), r), a = dt(t.format, r), s = (typeof i == "function" ? [i] : [
704
+ function Y({ values: e, axis: t, locale: n, hasTitle: r }) {
705
+ let i = pt(t.tickFormat ?? o(t.format), r), a = pt(t.format, r), s = (typeof i == "function" ? [i] : [
684
706
  i,
685
- ...tt.map((e) => Y(i, e)),
686
- ...typeof a == "function" ? [] : tt.map((e) => Y(a, e))
707
+ ...nt.map((e) => ft(i, e)),
708
+ ...typeof a == "function" ? [] : nt.map((e) => ft(a, e))
687
709
  ]).map((t) => e.map((e) => c({
688
710
  value: e,
689
711
  locale: n,
690
712
  format: t
691
713
  })));
692
- return s.find(ut) ?? s.at(-1) ?? [];
714
+ return s.find(dt) ?? s.at(-1) ?? [];
693
715
  }
694
- function Z(e) {
695
- return e > Qe ? Ze : Xe;
716
+ function X(e) {
717
+ return e > $e ? Qe : Ze;
696
718
  }
697
- function ft(e) {
719
+ function mt(e) {
698
720
  let t = e.tickFormat ?? e.format;
699
721
  return typeof t == "function" || e.scale === "log" ? !1 : t.maximumFractionDigits === 0 && t.style !== "percent";
700
722
  }
701
- function Q({ axis: e, domain: t, length: n, spacing: r, locale: i, hasTitle: a }) {
702
- let o = Z(n), s = Math.max(o, Math.round(n / r)), c = Array.from({ length: $e }, (n, r) => Le({
723
+ function Z({ axis: e, domain: t, length: n, spacing: r, locale: i, hasTitle: a }) {
724
+ let o = X(n), s = Math.max(o, Math.round(n / r)), c = Array.from({ length: et }, (n, r) => Le({
703
725
  domain: t,
704
726
  type: e.scale,
705
727
  count: s + r
706
- })).filter((e, t) => t === 0 || e.length * r * et <= n), l = c.filter((e) => e.length >= o), u = l.find((e) => e[0] === t[0] && e.at(-1) === t[1]), d = l[0] ?? c[0] ?? [], f = u ?? d;
707
- if (ft(e)) {
708
- let t = f.filter((e) => Number.isInteger(e)), n = t.length >= Xe ? t : f;
728
+ })).filter((e, t) => t === 0 || e.length * r * tt <= n), l = c.filter((e) => e.length >= o), u = l.find((e) => e[0] === t[0] && e.at(-1) === t[1]), d = l[0] ?? c[0] ?? [], f = u ?? d;
729
+ if (mt(e)) {
730
+ let t = f.filter((e) => Number.isInteger(e)), n = t.length >= Ze ? t : f;
709
731
  return {
710
732
  values: n,
711
- labels: X({
733
+ labels: Y({
712
734
  values: n,
713
735
  axis: e,
714
736
  locale: i,
@@ -718,7 +740,7 @@ function Q({ axis: e, domain: t, length: n, spacing: r, locale: i, hasTitle: a }
718
740
  }
719
741
  return {
720
742
  values: f,
721
- labels: X({
743
+ labels: Y({
722
744
  values: f,
723
745
  axis: e,
724
746
  locale: i,
@@ -726,24 +748,24 @@ function Q({ axis: e, domain: t, length: n, spacing: r, locale: i, hasTitle: a }
726
748
  })
727
749
  };
728
750
  }
729
- function $(e, t) {
751
+ function Q(e, t) {
730
752
  return t.values.map((n, r) => ({
731
753
  key: String(n),
732
754
  position: e.position(n),
733
755
  label: t.labels[r] ?? ""
734
756
  }));
735
757
  }
736
- function pt(e) {
758
+ function ht(e) {
737
759
  let t = e.split(" ");
738
760
  return t.slice(1).map((e, n) => {
739
761
  let r = t.slice(0, n + 1).join(" "), i = t.slice(n + 1).join(" ");
740
762
  return {
741
- text: `${r}${ot}${i}`,
763
+ text: `${r}${st}${i}`,
742
764
  longest: Math.max(r.length, i.length)
743
765
  };
744
766
  }).toSorted((e, t) => e.longest - t.longest)[0]?.text ?? e;
745
767
  }
746
- function mt(e, t) {
768
+ function gt(e, t) {
747
769
  return t.flatMap((t) => {
748
770
  let n = e.center(t.id);
749
771
  return n === void 0 ? [] : [{
@@ -753,8 +775,8 @@ function mt(e, t) {
753
775
  }];
754
776
  });
755
777
  }
756
- function ht({ width: e, height: t, x: n, y: r, xDomain: i, yDomain: a, locale: o, rightGutter: s = 0 }) {
757
- let c = Q({
778
+ function _t({ width: e, height: t, x: n, y: r, xDomain: i, yDomain: a, locale: o, rightGutter: s = 0 }) {
779
+ let c = Z({
758
780
  axis: r,
759
781
  domain: a,
760
782
  length: t,
@@ -773,7 +795,7 @@ function ht({ width: e, height: t, x: n, y: r, xDomain: i, yDomain: a, locale: o
773
795
  ...u,
774
796
  right: u.right + s
775
797
  }
776
- }), f = Q({
798
+ }), f = Z({
777
799
  axis: n,
778
800
  domain: i,
779
801
  length: d.innerWidth,
@@ -793,12 +815,12 @@ function ht({ width: e, height: t, x: n, y: r, xDomain: i, yDomain: a, locale: o
793
815
  box: d,
794
816
  x: p,
795
817
  y: m,
796
- xTicks: $(p, f),
797
- yTicks: $(m, c)
818
+ xTicks: Q(p, f),
819
+ yTicks: Q(m, c)
798
820
  };
799
821
  }
800
- function gt({ width: e, height: t, direction: n, categories: r, value: i, valueDomain: a, locale: o, padding: s = rt, topInset: c = 0, rightGutter: d = 0, hasValueTitle: f = !0 }) {
801
- let p = r.map((e) => e.id), m = n === "columns", h = Q({
822
+ function vt({ width: e, height: t, direction: n, categories: r, value: i, valueDomain: a, locale: o, padding: s = it, topInset: c = 0, rightGutter: d = 0, hasValueTitle: f = !0 }) {
823
+ let p = r.map((e) => e.id), m = n === "columns", h = Z({
802
824
  axis: i,
803
825
  domain: a,
804
826
  length: m ? t : e,
@@ -810,7 +832,7 @@ function gt({ width: e, height: t, direction: n, categories: r, value: i, valueD
810
832
  valueLabels: m ? h.labels : r.map((e) => e.label),
811
833
  hasXTitle: !m && f,
812
834
  hasYTitle: m && f,
813
- leftShare: m ? U : Ye
835
+ leftShare: m ? U : Xe
814
836
  }), _ = {
815
837
  ...g,
816
838
  top: g.top + c,
@@ -823,15 +845,15 @@ function gt({ width: e, height: t, direction: n, categories: r, value: i, valueD
823
845
  ids: p,
824
846
  range: [v.left, v.right],
825
847
  padding: s
826
- }).step - it, ee = r.some((e) => e.label.length * H > y), b = r.map((e) => ({
848
+ }).step - at, ee = r.some((e) => e.label.length * H > y), b = r.map((e) => ({
827
849
  ...e,
828
- label: pt(e.label)
829
- })), x = m && ee && b.every((e) => e.label.split(ot).every((e) => e.length * H <= y)), S = x ? J({
850
+ label: ht(e.label)
851
+ })), x = m && ee && b.every((e) => e.label.split(st).every((e) => e.length * H <= y)), S = x ? J({
830
852
  width: e,
831
853
  height: t,
832
854
  margins: {
833
855
  ..._,
834
- bottom: _.bottom + at
856
+ bottom: _.bottom + ot
835
857
  }
836
858
  }) : v, C = u({
837
859
  ids: p,
@@ -846,14 +868,14 @@ function gt({ width: e, height: t, direction: n, categories: r, value: i, valueD
846
868
  box: S,
847
869
  band: C,
848
870
  value: w,
849
- bandTicks: mt(C, x ? b : r),
850
- valueTicks: $(w, h)
871
+ bandTicks: gt(C, x ? b : r),
872
+ valueTicks: Q(w, h)
851
873
  };
852
874
  }
853
- function _t({ height: e, axes: t, locale: n, hasValueTitle: r = !1 }) {
875
+ function yt({ height: e, axes: t, locale: n, hasValueTitle: r = !1 }) {
854
876
  return q({
855
877
  width: Infinity,
856
- valueLabels: t.flatMap(({ axis: t, domain: i }) => Q({
878
+ valueLabels: t.flatMap(({ axis: t, domain: i }) => Z({
857
879
  axis: t,
858
880
  domain: i,
859
881
  length: e,
@@ -865,8 +887,8 @@ function _t({ height: e, axes: t, locale: n, hasValueTitle: r = !1 }) {
865
887
  hasYTitle: r
866
888
  }).left;
867
889
  }
868
- function vt({ width: e, height: t, value: n, valueDomain: r, timeDomain: i, timeFormat: a, locale: o, topInset: s = 0, gutter: c = 0, hasValueTitle: u = !1 }) {
869
- let d = Q({
890
+ function bt({ width: e, height: t, value: n, valueDomain: r, timeDomain: i, timeFormat: a, locale: o, topInset: s = 0, gutter: c = 0, hasValueTitle: u = !1 }) {
891
+ let d = Z({
870
892
  axis: n,
871
893
  domain: r,
872
894
  length: t,
@@ -898,16 +920,16 @@ function vt({ width: e, height: t, value: n, valueDomain: r, timeDomain: i, time
898
920
  box: m,
899
921
  x: h,
900
922
  y: g,
901
- xTicks: $(h, bt({
923
+ xTicks: Q(h, $({
902
924
  domain: i,
903
925
  length: m.innerWidth,
904
926
  timeFormat: a,
905
927
  locale: o
906
928
  })),
907
- yTicks: $(g, d)
929
+ yTicks: Q(g, d)
908
930
  };
909
931
  }
910
- var yt = [
932
+ var xt = [
911
933
  {
912
934
  month: "short",
913
935
  day: "numeric"
@@ -922,24 +944,53 @@ var yt = [
922
944
  month: "short",
923
945
  day: "numeric",
924
946
  second: "2-digit"
947
+ },
948
+ {
949
+ year: "numeric",
950
+ month: "short",
951
+ day: "numeric",
952
+ second: "2-digit",
953
+ timeZoneName: "shortOffset"
925
954
  }
926
955
  ];
927
- function bt({ domain: e, length: t, timeFormat: n, locale: r, timeZone: i }) {
928
- let o = typeof n == "function" ? i : n.timeZone, c = o === void 0 ? 0 : a(e[0], o), l = Z(t), u = Math.max(l, Math.round(t / G)), d = Array.from({ length: $e }, (t, n) => Be({
929
- domain: e,
930
- count: u + n,
931
- zoneOffset: c
932
- })), f = d.find((e) => e.length >= l) ?? d[0] ?? [], p = (typeof n == "function" ? [n] : [n, ...yt.map((e) => ({
933
- ...e,
934
- ...n
935
- }))]).map((e) => f.map((t) => s({
936
- timestamp: t,
937
- locale: r,
938
- format: e
939
- })));
956
+ function $({ domain: e, length: t, timeFormat: n, locale: r, timeZone: i }) {
957
+ let o = typeof n == "function" ? i : n.timeZone, c = o === void 0 ? 0 : (e) => a(e, o), l = X(t), u = Math.max(l, Math.round(t / G));
958
+ function d(t) {
959
+ return Be({
960
+ domain: e,
961
+ count: t,
962
+ zoneOffset: c
963
+ });
964
+ }
965
+ function f() {
966
+ let e = d(u);
967
+ if (e.length >= l) return e;
968
+ let t = Array.from({ length: 5 }, (e, t) => u + t + 1);
969
+ for (let e of t) {
970
+ let t = d(e);
971
+ if (t.length >= l) return t;
972
+ }
973
+ return e;
974
+ }
975
+ let p = f();
976
+ function m(e) {
977
+ return p.map((t) => s({
978
+ timestamp: t,
979
+ locale: r,
980
+ format: e
981
+ }));
982
+ }
983
+ let h = m(n);
984
+ if (typeof n != "function" && n.dateStyle === void 0 && n.timeStyle === void 0) for (let e of xt) {
985
+ if (dt(h)) break;
986
+ h = m({
987
+ ...e,
988
+ ...n
989
+ });
990
+ }
940
991
  return {
941
- values: f,
942
- labels: p.find(ut) ?? p.at(-1) ?? []
992
+ values: p,
993
+ labels: h
943
994
  };
944
995
  }
945
- export { he as A, Ce as C, me as D, ue as E, re as M, fe as O, De as S, P as T, Le as _, lt as a, Te as b, Ve as c, Z as d, bt as f, z as g, R as h, gt as i, ge as j, pe as k, q as l, _t as m, ct as n, ht as o, vt as p, mt as r, J as s, Q as t, X as u, Ie as v, we as w, Ee as x, Be as y };
996
+ export { he as A, Ce as C, me as D, de as E, re as M, fe as O, De as S, P as T, Le as _, ut as a, Te as b, He as c, X as d, $ as f, z as g, R as h, vt as i, ge as j, pe as k, q as l, yt as m, lt as n, _t as o, bt as p, gt as r, J as s, Z as t, Y as u, Ie as v, we as w, Ee as x, Be as y };
@@ -1,5 +1,5 @@
1
1
  import { n as e, t } from "./plot-width-D3hTycYX.js";
2
- import { O as n, c as r } from "./plot-layout-CvkeUuG6.js";
2
+ import { O as n, c as r } from "./plot-layout-1MG72ZWn.js";
3
3
  import * as i from "@stylexjs/stylex";
4
4
  import { useId as a } from "react";
5
5
  import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";