@mechane-ai/ui 0.2.2 → 0.3.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 (139) hide show
  1. package/README.md +34 -13
  2. package/dist/ai.js +315 -0
  3. package/dist/assets/stylex.css +1533 -360
  4. package/dist/cartesian-Bwt6ZnF5.js +847 -0
  5. package/dist/chart-input-Bti0gyzz.js +173 -0
  6. package/dist/charts/cartesian.js +1 -0
  7. package/dist/charts/distribution.js +1 -0
  8. package/dist/charts/graph.js +1 -0
  9. package/dist/charts/matrix.js +1 -0
  10. package/dist/charts.js +98 -93
  11. package/dist/code-BJp-g4Fw.js +172 -0
  12. package/dist/collections.js +666 -0
  13. package/dist/content/code.js +1 -0
  14. package/dist/content/diff.js +101 -0
  15. package/dist/content/link.js +1 -0
  16. package/dist/content/tree.js +77 -0
  17. package/dist/content-link-52aZVX3X.js +26 -0
  18. package/dist/content.js +367 -0
  19. package/dist/distribution-CViLvcPP.js +609 -0
  20. package/dist/graph-DAfo72ZD.js +230 -0
  21. package/dist/index.js +1 -1
  22. package/dist/layout.js +201 -160
  23. package/dist/matrix-B9dybkce.js +785 -0
  24. package/dist/packages/ai/src/approval.d.ts +29 -0
  25. package/dist/packages/ai/src/conversation.d.ts +34 -0
  26. package/dist/packages/ai/src/index.d.ts +10 -0
  27. package/dist/packages/ai/src/message.d.ts +19 -0
  28. package/dist/packages/ai/src/prompt-input.d.ts +25 -0
  29. package/dist/packages/ai/src/sources.d.ts +17 -0
  30. package/dist/packages/charts/src/cartesian/categorical.d.ts +43 -0
  31. package/dist/packages/charts/src/cartesian/index.d.ts +8 -0
  32. package/dist/packages/charts/src/cartesian/sparkline.d.ts +11 -0
  33. package/dist/packages/charts/src/cartesian/time-series-data.d.ts +54 -0
  34. package/dist/packages/charts/src/cartesian/time-series-line.d.ts +9 -0
  35. package/dist/packages/charts/src/cartesian/time-series.d.ts +29 -0
  36. package/dist/packages/charts/src/chart-frame.d.ts +34 -0
  37. package/dist/packages/charts/src/chart-input.d.ts +10 -0
  38. package/dist/packages/charts/src/chart-theme.d.ts +48 -0
  39. package/dist/packages/charts/src/distribution/distribution-input.d.ts +14 -0
  40. package/dist/packages/charts/src/distribution/distribution-plot.d.ts +135 -0
  41. package/dist/packages/charts/src/distribution/ecdf.d.ts +23 -0
  42. package/dist/packages/charts/src/distribution/histogram.d.ts +26 -0
  43. package/dist/packages/charts/src/distribution/index.d.ts +8 -0
  44. package/dist/packages/charts/src/distribution/interval-plot.d.ts +24 -0
  45. package/dist/packages/charts/src/distribution/ranked-bars.d.ts +22 -0
  46. package/dist/packages/charts/src/graph/index.d.ts +2 -0
  47. package/dist/packages/charts/src/graph/relation-graph.d.ts +45 -0
  48. package/dist/packages/charts/src/index.d.ts +13 -0
  49. package/dist/packages/charts/src/matrix/color-legend.d.ts +7 -0
  50. package/dist/packages/charts/src/matrix/heatmap-scale.d.ts +8 -0
  51. package/dist/packages/charts/src/matrix/index.d.ts +9 -0
  52. package/dist/packages/charts/src/matrix/matrix.d.ts +34 -0
  53. package/dist/packages/charts/src/matrix/scatter-plot.d.ts +37 -0
  54. package/dist/packages/charts/src/matrix/token-heatmap.d.ts +20 -0
  55. package/dist/packages/charts/src/plot-width.d.ts +5 -0
  56. package/dist/packages/collections/src/calendar.d.ts +32 -0
  57. package/dist/packages/collections/src/collection-controls.d.ts +41 -0
  58. package/dist/packages/collections/src/command.d.ts +37 -0
  59. package/dist/packages/collections/src/data-table.d.ts +49 -0
  60. package/dist/packages/collections/src/date-range-picker.d.ts +16 -0
  61. package/dist/packages/collections/src/index.d.ts +13 -0
  62. package/dist/packages/content/src/code/code-block.d.ts +22 -0
  63. package/dist/packages/content/src/code/index.d.ts +2 -0
  64. package/dist/packages/content/src/code/use-highlighted-code.d.ts +9 -0
  65. package/dist/packages/content/src/content-link.d.ts +8 -0
  66. package/dist/packages/content/src/diff/diff-source.d.ts +32 -0
  67. package/dist/packages/content/src/diff/diff-viewer.d.ts +3 -0
  68. package/dist/packages/content/src/diff/index.d.ts +2 -0
  69. package/dist/packages/content/src/diff/pierre-diff.d.ts +14 -0
  70. package/dist/packages/content/src/index.d.ts +10 -0
  71. package/dist/packages/content/src/json-viewer.d.ts +11 -0
  72. package/dist/packages/content/src/link.d.ts +2 -0
  73. package/dist/packages/content/src/log-viewer.d.ts +9 -0
  74. package/dist/packages/content/src/markdown.d.ts +7 -0
  75. package/dist/packages/content/src/pierre-theme.d.ts +36 -0
  76. package/dist/packages/content/src/stack-trace.d.ts +16 -0
  77. package/dist/packages/content/src/tree/file-tree-types.d.ts +12 -0
  78. package/dist/packages/content/src/tree/file-tree.d.ts +3 -0
  79. package/dist/packages/content/src/tree/index.d.ts +2 -0
  80. package/dist/packages/content/src/tree/pierre-tree.d.ts +3 -0
  81. package/dist/packages/core/src/alert-dialog.d.ts +18 -0
  82. package/dist/packages/core/src/combobox.d.ts +81 -0
  83. package/dist/{control-state.d.ts → packages/core/src/control-state.d.ts} +18 -2
  84. package/dist/{copy-value.d.ts → packages/core/src/copy-value.d.ts} +2 -1
  85. package/dist/packages/core/src/details-controls.d.ts +23 -0
  86. package/dist/packages/core/src/disclosure.d.ts +33 -0
  87. package/dist/packages/core/src/field-styles.d.ts +66 -0
  88. package/dist/packages/core/src/form-controls.d.ts +81 -0
  89. package/dist/{forms.d.ts → packages/core/src/forms.d.ts} +1 -1
  90. package/dist/packages/core/src/index.d.ts +32 -0
  91. package/dist/packages/core/src/menu.d.ts +51 -0
  92. package/dist/packages/core/src/navigation.d.ts +24 -0
  93. package/dist/packages/core/src/popover.d.ts +24 -0
  94. package/dist/packages/core/src/popup-styles.d.ts +84 -0
  95. package/dist/packages/core/src/preview.d.ts +17 -0
  96. package/dist/packages/core/src/progress.d.ts +10 -0
  97. package/dist/packages/core/src/selection-styles.d.ts +110 -0
  98. package/dist/packages/core/src/selection.d.ts +57 -0
  99. package/dist/packages/core/src/skeleton.d.ts +18 -0
  100. package/dist/packages/core/src/theme.d.ts +16 -0
  101. package/dist/packages/core/src/toast.d.ts +28 -0
  102. package/dist/{tokens.stylex.d.ts → packages/core/src/tokens.stylex.d.ts} +60 -0
  103. package/dist/packages/core/src/trace.d.ts +35 -0
  104. package/dist/{layout → packages/layout/src}/index.d.ts +2 -0
  105. package/dist/{layout → packages/layout/src}/page-toolbar.d.ts +1 -1
  106. package/dist/packages/layout/src/resizable.d.ts +27 -0
  107. package/dist/{layout → packages/layout/src}/sidebar.d.ts +1 -1
  108. package/dist/pierre-diff-D3m4JCu0.js +66 -0
  109. package/dist/pierre-theme-CPlfl-AA.js +96 -0
  110. package/dist/pierre-tree-BaEkz16y.js +105 -0
  111. package/dist/plot-width--OgdohB5.js +18 -0
  112. package/dist/src-E7YRJBMO.js +2821 -0
  113. package/dist/tokens.js +118 -64
  114. package/package.json +67 -10
  115. package/{src → packages/core/src}/tokens.stylex.ts +64 -0
  116. package/dist/charts/index.d.ts +0 -2
  117. package/dist/index.d.ts +0 -16
  118. package/dist/src-Czfi0YQa.js +0 -1319
  119. /package/dist/{charts → packages/charts/src}/waterfall.d.ts +0 -0
  120. /package/dist/{inspector.d.ts → packages/collections/src/inspector.d.ts} +0 -0
  121. /package/dist/{list-footer.d.ts → packages/collections/src/list-footer.d.ts} +0 -0
  122. /package/dist/{table.d.ts → packages/collections/src/table.d.ts} +0 -0
  123. /package/dist/{accessibility.d.ts → packages/core/src/accessibility.d.ts} +0 -0
  124. /package/dist/{actions.d.ts → packages/core/src/actions.d.ts} +0 -0
  125. /package/dist/{dialog.d.ts → packages/core/src/dialog.d.ts} +0 -0
  126. /package/dist/{drawer.d.ts → packages/core/src/drawer.d.ts} +0 -0
  127. /package/dist/{loading.d.ts → packages/core/src/loading.d.ts} +0 -0
  128. /package/dist/{metrics.d.ts → packages/core/src/metrics.d.ts} +0 -0
  129. /package/dist/{overlay-styles.d.ts → packages/core/src/overlay-styles.d.ts} +0 -0
  130. /package/dist/{select.d.ts → packages/core/src/select.d.ts} +0 -0
  131. /package/dist/{skip-link.d.ts → packages/core/src/skip-link.d.ts} +0 -0
  132. /package/dist/{style-composition.d.ts → packages/core/src/style-composition.d.ts} +0 -0
  133. /package/dist/{surfaces.d.ts → packages/core/src/surfaces.d.ts} +0 -0
  134. /package/dist/{tabs.d.ts → packages/core/src/tabs.d.ts} +0 -0
  135. /package/dist/{text.d.ts → packages/core/src/text.d.ts} +0 -0
  136. /package/dist/{tooltip.d.ts → packages/core/src/tooltip.d.ts} +0 -0
  137. /package/dist/{layout → packages/layout/src}/app-shell.d.ts +0 -0
  138. /package/dist/{layout → packages/layout/src}/detail-page.d.ts +0 -0
  139. /package/dist/{layout → packages/layout/src}/frame.stylex.d.ts +0 -0
@@ -0,0 +1,173 @@
1
+ import { z as e } from "./src-E7YRJBMO.js";
2
+ import { chartColors as t, colors as n } from "./tokens.js";
3
+ import * as r from "@stylexjs/stylex";
4
+ import { useId as i } from "react";
5
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
6
+ import { ChevronDown as s } from "lucide-react";
7
+ // packages/charts/src/chart-theme.ts
8
+ var c = {
9
+ series1: t.series1,
10
+ series2: t.series2,
11
+ series3: t.series3,
12
+ series4: t.series4,
13
+ series5: t.series5,
14
+ series6: t.series6,
15
+ positive: t.positive,
16
+ negative: t.negative,
17
+ neutral: n.muted
18
+ }, l = {
19
+ plot: {
20
+ k7Eaqz: "xeuugli",
21
+ kVQacm: "xb3r6kr",
22
+ $$css: !0
23
+ },
24
+ svg: {
25
+ k1xSpc: "x1lliihq",
26
+ kzqmXN: "xh8yej3",
27
+ kVQacm: "x1rea2x4",
28
+ $$css: !0
29
+ },
30
+ axis: {
31
+ kjVXCG: "xouukkm",
32
+ kfJifR: "xnpr05h",
33
+ kREpy8: "x13efnbd",
34
+ $$css: !0
35
+ },
36
+ grid: {
37
+ kjVXCG: "xouukkm",
38
+ kfJifR: "xnpr05h",
39
+ k5rJSQ: "x1ntoi03",
40
+ kREpy8: "x13efnbd",
41
+ $$css: !0
42
+ },
43
+ label: {
44
+ kDwRjp: "xee94xy",
45
+ kMv6JI: "xoedhln",
46
+ kGuDYH: "xut3y95",
47
+ kcqcaj: "xss6m8b",
48
+ $$css: !0
49
+ },
50
+ mark: {
51
+ kfJifR: "xhr4kjn",
52
+ kREpy8: "x13efnbd",
53
+ $$css: !0
54
+ },
55
+ selected: {
56
+ kjVXCG: "x7if6lq",
57
+ kfJifR: "xvlca1e",
58
+ kREpy8: "x13efnbd",
59
+ $$css: !0
60
+ },
61
+ focus: {
62
+ kZs9gx: "x1m2ab5f",
63
+ k7shQP: "x9v5kkp",
64
+ kPJHz1: "xnktsf1",
65
+ kiEn40: "x7s97pk",
66
+ $$css: !0
67
+ }
68
+ }, u = {
69
+ kzqmXN: "x1xc55vz",
70
+ kZKoxP: "xdk7pt",
71
+ kmuXW: "x2lah0s",
72
+ $$css: !0
73
+ }, d = { swatch: (e) => [
74
+ u,
75
+ {
76
+ kWkggS: e == null ? e : "xl8spv7",
77
+ $$css: !0
78
+ },
79
+ { "--x-backgroundColor": e ?? void 0 }
80
+ ] };
81
+ function f({ title: e, description: t, children: n, actions: r, footer: s }) {
82
+ let c = i();
83
+ return /* @__PURE__ */ o("figure", {
84
+ "aria-labelledby": c,
85
+ className: "xeuugli x1ghz6dp xgl13c x1l90twa xoedhln x118kxxs x1hyyzld",
86
+ children: [
87
+ /* @__PURE__ */ o("figcaption", {
88
+ className: "x78zum5 x1qughib x7a106z xtmze7h xeouufa",
89
+ children: [/* @__PURE__ */ o("div", { children: [/* @__PURE__ */ a("p", {
90
+ id: c,
91
+ className: "x1ghz6dp x1hm5896 x1hyyzld xk50ysn",
92
+ children: e
93
+ }), t !== void 0 && /* @__PURE__ */ a("p", {
94
+ className: "x1ghz6dp x1mmnwsm xv9cywu xut3y95",
95
+ children: t
96
+ })] }), r !== void 0 && /* @__PURE__ */ a("div", {
97
+ className: "x2lah0s",
98
+ children: r
99
+ })]
100
+ }),
101
+ n,
102
+ s !== void 0 && /* @__PURE__ */ a("div", {
103
+ className: "x1dj7zaa xv9cywu xut3y95",
104
+ children: s
105
+ })
106
+ ]
107
+ });
108
+ }
109
+ function p({ items: e, label: t = "Legend" }) {
110
+ return /* @__PURE__ */ a("ul", {
111
+ "aria-label": t,
112
+ className: "x78zum5 x1a02dak xtmze7h xe8uvvx x1ghz6dp x1717udv xv9cywu xoedhln xut3y95 xam3yii",
113
+ children: e.map((e) => /* @__PURE__ */ o("li", {
114
+ className: "x3nfvp2 x6s0dn4 xzwl0l2",
115
+ children: [/* @__PURE__ */ a("span", {
116
+ "aria-hidden": !0,
117
+ ...r.props(d.swatch(c[e.tone]))
118
+ }), e.label]
119
+ }, e.id))
120
+ });
121
+ }
122
+ function m({ label: e, selected: t = !1, onSelect: n, children: r }) {
123
+ return n === void 0 ? /* @__PURE__ */ a("div", {
124
+ className: "x78zum5 x6s0dn4 x1qughib xtmze7h xeuugli xgvaw1x xekz7sd x9f619 xh8yej3 xc342km xlfmwf6 x13hf59f xoedhln x118kxxs x1hyyzld x1yc453h xj0a0fe xgl13c x1l90twa xss6m8b",
125
+ children: r
126
+ }) : /* @__PURE__ */ a("button", {
127
+ type: "button",
128
+ "aria-label": e,
129
+ "aria-pressed": t,
130
+ onClick: n,
131
+ ...{
132
+ 0: { className: "x78zum5 x6s0dn4 x1qughib xtmze7h xeuugli xgvaw1x xekz7sd x9f619 xh8yej3 xc342km xlfmwf6 x13hf59f xoedhln x118kxxs x1hyyzld x1yc453h xj0a0fe xgl13c x1l90twa xss6m8b x1ypdohk x160po9z x1m2ab5f x9v5kkp xnktsf1 x1bqaal" },
133
+ 1: { className: "x78zum5 x6s0dn4 x1qughib xtmze7h xeuugli xgvaw1x xekz7sd x9f619 xh8yej3 xc342km xlfmwf6 x13hf59f xoedhln x118kxxs x1hyyzld x1yc453h xj0a0fe xgl13c xss6m8b x1ypdohk x160po9z x1m2ab5f x9v5kkp xnktsf1 x1bqaal x1m7rfvg x1jmj9dw" }
134
+ }[!!t | 0],
135
+ children: r
136
+ });
137
+ }
138
+ function h({ children: e, label: t = "View data" }) {
139
+ return /* @__PURE__ */ o("details", {
140
+ className: "x1dj7zaa x178xt8z x13fuv20 x1cbnph0",
141
+ children: [/* @__PURE__ */ o("summary", {
142
+ className: "x78zum5 x6s0dn4 xzwl0l2 xgvaw1x xekz7sd xoedhln xut3y95 xv9cywu x1ypdohk xe8uvvx x1hl8ikr x1m2ab5f x9v5kkp xnktsf1 x1i5lizr",
143
+ children: [/* @__PURE__ */ a(s, {
144
+ "aria-hidden": !0,
145
+ className: "xbor0ac x1sqm5u1"
146
+ }), t]
147
+ }), /* @__PURE__ */ a("div", {
148
+ role: "region",
149
+ "aria-label": t,
150
+ tabIndex: 0,
151
+ className: "xeuugli x1sslpiy xysyzu8 x1m2ab5f x9v5kkp xnktsf1 x1bqaal",
152
+ children: e
153
+ })]
154
+ });
155
+ }
156
+ // packages/charts/src/chart-input.tsx
157
+ function g(e) {
158
+ return Number.isFinite(e[0]) && Number.isFinite(e[1]) && Number.isFinite(e[1] - e[0]) && e[0] < e[1];
159
+ }
160
+ function _(e) {
161
+ return new Set(e.map((e) => e.id)).size === e.length;
162
+ }
163
+ function v({ title: t, description: n, message: r }) {
164
+ return /* @__PURE__ */ a(f, {
165
+ title: t,
166
+ description: n,
167
+ children: /* @__PURE__ */ a(e, {
168
+ error: !0,
169
+ children: r
170
+ })
171
+ });
172
+ }
173
+ export { m as a, l as c, h as i, c as l, _ as n, f as o, g as r, p as s, v as t };
@@ -0,0 +1 @@
1
+ export { a as AreaChart, t as BarChart, n as BreakdownBar, o as LineChart, s as SmallMultiples, i as Sparkline, r as Treemap, c as timeSeriesLimits } from "../cartesian-Bwt6ZnF5.js";
@@ -0,0 +1 @@
1
+ export { r as ECDF, i as Histogram, n as IntervalPlot, t as RankedBars } from "../distribution-CViLvcPP.js";
@@ -0,0 +1 @@
1
+ export { t as MAX_RELATION_DIMENSION, n as MAX_RELATION_EDGES, r as MAX_RELATION_GROUPS, i as MAX_RELATION_NODES, a as RelationGraph } from "../graph-DAfo72ZD.js";
@@ -0,0 +1 @@
1
+ export { s as ColorLegend, r as MAX_HEATMAP_TOKENS, a as MAX_MATRIX_CELLS, t as MAX_SCATTER_POINTS, o as Matrix, n as ScatterPlot, i as TokenHeatmap } from "../matrix-B9dybkce.js";
package/dist/charts.js CHANGED
@@ -1,10 +1,15 @@
1
- import { N as e } from "./src-Czfi0YQa.js";
2
- import * as t from "@stylexjs/stylex";
3
- import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
- import { scaleLinear as i } from "@visx/scale";
5
- import { Bar as a } from "@visx/shape";
6
- // src/charts/waterfall.tsx
7
- var o = {
1
+ import { rt as e } from "./src-E7YRJBMO.js";
2
+ import { o as t, s as n } from "./chart-input-Bti0gyzz.js";
3
+ import { a as r, i, n as a, o, r as s, s as c, t as l } from "./cartesian-Bwt6ZnF5.js";
4
+ import { i as u, n as d, r as f, t as p } from "./distribution-CViLvcPP.js";
5
+ import { i as m, n as h, o as g, s as _ } from "./matrix-B9dybkce.js";
6
+ import { a as v } from "./graph-DAfo72ZD.js";
7
+ import * as y from "@stylexjs/stylex";
8
+ import { jsx as b, jsxs as x } from "react/jsx-runtime";
9
+ import { scaleLinear as S } from "@visx/scale";
10
+ import { Bar as C } from "@visx/shape";
11
+ // packages/charts/src/waterfall.tsx
12
+ var w = {
8
13
  plot: {
9
14
  k7Eaqz: "xeuugli",
10
15
  kUOVxO: "xl4o6ss",
@@ -13,173 +18,173 @@ var o = {
13
18
  $$css: !0
14
19
  },
15
20
  neutral: {
16
- kMwMTN: "x1ns7tj1",
21
+ kMwMTN: "xv9cywu",
17
22
  $$css: !0
18
23
  },
19
24
  positive: {
20
- kMwMTN: "x1swbf3d",
25
+ kMwMTN: "x76p87n",
21
26
  $$css: !0
22
27
  },
23
28
  negative: {
24
- kMwMTN: "x11ep619",
29
+ kMwMTN: "x1dege03",
25
30
  $$css: !0
26
31
  }
27
- }, s = {
28
- neutral: o.neutral,
29
- positive: o.positive,
30
- negative: o.negative
31
- }, c = [
32
+ }, T = {
33
+ neutral: w.neutral,
34
+ positive: w.positive,
35
+ negative: w.negative
36
+ }, E = [
32
37
  0,
33
38
  .5,
34
39
  1
35
- ], l = 100;
36
- function u({ items: a, start: u, end: p, label: m, rowLabel: h, summaryLabel: g, emptyLabel: _, selectedId: v, onSelect: y, formatOffset: b }) {
37
- let x = p - u, S = i({
38
- domain: [u, p],
39
- range: [0, x === 0 ? 0 : l]
40
- }), C = x > 0 ? c : [0];
41
- return /* @__PURE__ */ r("div", {
40
+ ], D = 100;
41
+ function O({ items: t, start: n, end: r, label: i, rowLabel: a, summaryLabel: o, emptyLabel: s, selectedId: c, onSelect: l, formatOffset: u }) {
42
+ let d = r - n, f = S({
43
+ domain: [n, r],
44
+ range: [0, d === 0 ? 0 : D]
45
+ }), p = d > 0 ? E : [0];
46
+ return /* @__PURE__ */ x("div", {
42
47
  role: "group",
43
- "aria-label": m,
44
- className: "xeuugli x1o2ymkw",
48
+ "aria-label": i,
49
+ className: "xeuugli xoedhln",
45
50
  children: [
46
- /* @__PURE__ */ r("div", {
47
- className: "xrvj5dj x13sfnbj xj8mwme x6s0dn4 x1y871oy xq5c7ks xh8yej3 x9f619 xqin4a2 xu0aao5 x1ns7tj1 x1755wjq xso031l x1q0q8m5 xx6l4uz",
51
+ /* @__PURE__ */ x("div", {
52
+ className: "xrvj5dj x13sfnbj xj8mwme x6s0dn4 x1bkjjcv xq5c7ks xh8yej3 x9f619 xqin4a2 xu0aao5 xv9cywu xut3y95 xso031l x1q0q8m5 x7a6td9",
48
53
  children: [
49
- /* @__PURE__ */ n(e, {
54
+ /* @__PURE__ */ b(e, {
50
55
  variant: "caption",
51
56
  tone: "muted",
52
- children: h
57
+ children: a
53
58
  }),
54
- /* @__PURE__ */ n("div", {
55
- className: "xeuugli xl4o6ss x1npkx4u xp7zxbh x1ms6mhf xq5skvx x78zum5 x1qughib x6s0dn4 x1755wjq x1df3ybb xss6m8b",
56
- children: C.map((e) => /* @__PURE__ */ n("span", { children: b(x * e) }, e))
59
+ /* @__PURE__ */ b("div", {
60
+ className: "xeuugli xl4o6ss x1npkx4u xp7zxbh x1ms6mhf xq5skvx x78zum5 x1qughib x6s0dn4 xut3y95 xam3yii xss6m8b",
61
+ children: p.map((e) => /* @__PURE__ */ b("span", { children: u(d * e) }, e))
57
62
  }),
58
- /* @__PURE__ */ n("span", {
63
+ /* @__PURE__ */ b("span", {
59
64
  className: "xeuugli x1k3v4rp x1moszlt x1ms6mhf xp4054r xj0a0fe xss6m8b",
60
- children: /* @__PURE__ */ n(e, {
65
+ children: /* @__PURE__ */ b(e, {
61
66
  variant: "caption",
62
67
  tone: "muted",
63
- children: g
68
+ children: o
64
69
  })
65
70
  })
66
71
  ]
67
72
  }),
68
- a.length === 0 && /* @__PURE__ */ n("p", {
69
- className: "x1ghz6dp x805nir",
70
- children: /* @__PURE__ */ n(e, {
73
+ t.length === 0 && /* @__PURE__ */ b("p", {
74
+ className: "x1ghz6dp x1h65vws",
75
+ children: /* @__PURE__ */ b(e, {
71
76
  tone: "muted",
72
- children: _
77
+ children: s
73
78
  })
74
79
  }),
75
- a.map((i) => {
76
- let a = f({
77
- geometry: i.geometry,
78
- start: u,
79
- formatOffset: b
80
+ t.map((t) => {
81
+ let r = A({
82
+ geometry: t.geometry,
83
+ start: n,
84
+ formatOffset: u
80
85
  });
81
- return /* @__PURE__ */ r("button", {
86
+ return /* @__PURE__ */ x("button", {
82
87
  type: "button",
83
- "aria-pressed": v === i.id,
84
- "aria-label": `${i.label} · ${i.detail} · ${i.summary} · ${a}`,
85
- onClick: () => y(i.id),
88
+ "aria-pressed": c === t.id,
89
+ "aria-label": `${t.label} · ${t.detail} · ${t.summary} · ${r}`,
90
+ onClick: () => l(t.id),
86
91
  ...{
87
- 0: { className: "xrvj5dj x13sfnbj xj8mwme x6s0dn4 x1y871oy xq5c7ks xh8yej3 x9f619 xqin4a2 x1r1ej2n x1wiwyrm xc342km xso031l x1q0q8m5 xx6l4uz x1kb4e9r xn4qiis x1o2ymkw x1yc453h x1ypdohk x1p052by x1f1h9gf x9v5kkp xdv554w x1bqaal x1t1lzn6" },
88
- 1: { className: "xrvj5dj x13sfnbj xj8mwme x6s0dn4 x1y871oy xq5c7ks xh8yej3 x9f619 xqin4a2 x1r1ej2n x1wiwyrm xc342km xso031l x1q0q8m5 xx6l4uz xn4qiis x1o2ymkw x1yc453h x1ypdohk x1p052by x1f1h9gf x9v5kkp xdv554w x1bqaal x1t1lzn6 xco4m3t x1jmj9dw" }
89
- }[v === i.id | 0],
92
+ 0: { className: "xrvj5dj x13sfnbj xj8mwme x6s0dn4 x1bkjjcv xq5c7ks xh8yej3 x9f619 xqin4a2 x4wz14 x1wiwyrm xc342km xso031l x1q0q8m5 x7a6td9 x1l90twa xgl13c xoedhln x1yc453h x1ypdohk x160po9z x1m2ab5f x9v5kkp xnktsf1 x1bqaal x1t1lzn6" },
93
+ 1: { className: "xrvj5dj x13sfnbj xj8mwme x6s0dn4 x1bkjjcv xq5c7ks xh8yej3 x9f619 xqin4a2 x4wz14 x1wiwyrm xc342km xso031l x1q0q8m5 x7a6td9 xgl13c xoedhln x1yc453h x1ypdohk x160po9z x1m2ab5f x9v5kkp xnktsf1 x1bqaal x1t1lzn6 x1m7rfvg x1jmj9dw" }
94
+ }[c === t.id | 0],
90
95
  children: [
91
- /* @__PURE__ */ r("span", {
92
- className: "xeuugli xrvj5dj x1tothx9",
93
- children: [/* @__PURE__ */ n("span", {
96
+ /* @__PURE__ */ x("span", {
97
+ className: "xeuugli xrvj5dj x1r8op4a",
98
+ children: [/* @__PURE__ */ b("span", {
94
99
  className: "xk50ysn xj0a0fe",
95
- children: /* @__PURE__ */ n(e, { children: i.label })
96
- }), /* @__PURE__ */ n("span", {
97
- title: i.detail,
100
+ children: /* @__PURE__ */ b(e, { children: t.label })
101
+ }), /* @__PURE__ */ b("span", {
102
+ title: t.detail,
98
103
  className: "xb3r6kr xuxw1ft xlyipyv",
99
- children: /* @__PURE__ */ n(e, {
104
+ children: /* @__PURE__ */ b(e, {
100
105
  variant: "caption",
101
106
  tone: "muted",
102
- children: i.detail
107
+ children: t.detail
103
108
  })
104
109
  })]
105
110
  }),
106
- /* @__PURE__ */ n("span", {
107
- title: a,
108
- ...t.props(o.plot, s[i.tone]),
109
- children: i.geometry.kind === "unavailable" ? /* @__PURE__ */ n(e, {
111
+ /* @__PURE__ */ b("span", {
112
+ title: r,
113
+ ...y.props(w.plot, T[t.tone]),
114
+ children: t.geometry.kind === "unavailable" ? /* @__PURE__ */ b(e, {
110
115
  variant: "caption",
111
116
  tone: "muted",
112
- children: a
113
- }) : /* @__PURE__ */ r("svg", {
117
+ children: r
118
+ }) : /* @__PURE__ */ x("svg", {
114
119
  "aria-hidden": !0,
115
120
  className: "x1lliihq xh8yej3 xmix8c7 x1rea2x4",
116
- children: [C.map((e) => /* @__PURE__ */ n("line", {
117
- x1: `${e * l}%`,
118
- x2: `${e * l}%`,
121
+ children: [p.map((e) => /* @__PURE__ */ b("line", {
122
+ x1: `${e * D}%`,
123
+ x2: `${e * D}%`,
119
124
  y1: "0",
120
125
  y2: "18",
121
- className: "xi5i0ux"
122
- }, e)), /* @__PURE__ */ n(d, {
123
- geometry: i.geometry,
124
- scale: S
126
+ className: "xouukkm"
127
+ }, e)), /* @__PURE__ */ b(k, {
128
+ geometry: t.geometry,
129
+ scale: f
125
130
  })]
126
131
  })
127
132
  }),
128
- /* @__PURE__ */ n("span", {
133
+ /* @__PURE__ */ b("span", {
129
134
  className: "xeuugli x1k3v4rp x1moszlt x1ms6mhf xp4054r xj0a0fe xss6m8b",
130
- children: /* @__PURE__ */ n(e, {
135
+ children: /* @__PURE__ */ b(e, {
131
136
  variant: "caption",
132
137
  tone: "muted",
133
- children: i.summary
138
+ children: t.summary
134
139
  })
135
140
  })
136
141
  ]
137
- }, i.id);
142
+ }, t.id);
138
143
  })
139
144
  ]
140
145
  });
141
146
  }
142
- function d({ geometry: e, scale: t }) {
147
+ function k({ geometry: e, scale: t }) {
143
148
  switch (e.kind) {
144
149
  case "unavailable": return null;
145
150
  case "interval": {
146
- let r = t(e.start), i = t(e.end) - r;
147
- return i === 0 ? /* @__PURE__ */ n("circle", {
148
- cx: `${r}%`,
151
+ let n = t(e.start), r = t(e.end) - n;
152
+ return r === 0 ? /* @__PURE__ */ b("circle", {
153
+ cx: `${n}%`,
149
154
  cy: 9,
150
155
  r: 3,
151
156
  className: "x117rol3"
152
- }) : /* @__PURE__ */ n(a, {
153
- x: `${r}%`,
157
+ }) : /* @__PURE__ */ b(C, {
158
+ x: `${n}%`,
154
159
  y: 6,
155
- width: `${i}%`,
160
+ width: `${r}%`,
156
161
  height: 6,
157
162
  rx: 2,
158
163
  className: "x117rol3"
159
164
  });
160
165
  }
161
166
  case "point": {
162
- let r = t(e.at);
167
+ let n = t(e.at);
163
168
  switch (e.marker) {
164
- case "filled": return /* @__PURE__ */ n("circle", {
165
- cx: `${r}%`,
169
+ case "filled": return /* @__PURE__ */ b("circle", {
170
+ cx: `${n}%`,
166
171
  cy: 9,
167
172
  r: 3,
168
173
  className: "x117rol3"
169
174
  });
170
- case "hollow": return /* @__PURE__ */ n("circle", {
171
- cx: `${r}%`,
175
+ case "hollow": return /* @__PURE__ */ b("circle", {
176
+ cx: `${n}%`,
172
177
  cy: 9,
173
178
  r: 3.5,
174
- className: "x17dcl0o x73je2i xvlca1e"
179
+ className: "x1cyvyya x73je2i xvlca1e"
175
180
  });
176
- case "diamond": return /* @__PURE__ */ n("svg", {
177
- x: `${r}%`,
181
+ case "diamond": return /* @__PURE__ */ b("svg", {
182
+ x: `${n}%`,
178
183
  y: 9,
179
184
  width: 1,
180
185
  height: 1,
181
186
  overflow: "visible",
182
- children: /* @__PURE__ */ n("path", {
187
+ children: /* @__PURE__ */ b("path", {
183
188
  d: "M0 -5 5 0 0 5 -5 0Z",
184
189
  className: "x117rol3"
185
190
  })
@@ -188,11 +193,11 @@ function d({ geometry: e, scale: t }) {
188
193
  }
189
194
  }
190
195
  }
191
- function f({ geometry: e, start: t, formatOffset: n }) {
196
+ function A({ geometry: e, start: t, formatOffset: n }) {
192
197
  switch (e.kind) {
193
198
  case "interval": return `Start ${n(e.start - t)}, end ${n(e.end - t)}, duration ${n(e.end - e.start)}`;
194
199
  case "point": return `At ${n(e.at - t)}`;
195
200
  case "unavailable": return "Timing unavailable";
196
201
  }
197
202
  }
198
- export { u as Waterfall };
203
+ export { r as AreaChart, l as BarChart, a as BreakdownBar, t as ChartFrame, n as ChartLegend, _ as ColorLegend, f as ECDF, u as Histogram, d as IntervalPlot, o as LineChart, g as Matrix, p as RankedBars, v as RelationGraph, h as ScatterPlot, c as SmallMultiples, i as Sparkline, m as TokenHeatmap, s as Treemap, O as Waterfall };
@@ -0,0 +1,172 @@
1
+ import { N as e } from "./src-E7YRJBMO.js";
2
+ import { colors as t } from "./tokens.js";
3
+ import { t as n } from "./pierre-theme-CPlfl-AA.js";
4
+ import * as r from "@stylexjs/stylex";
5
+ import { useEffect as i, useRef as a, useState as o } from "react";
6
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
7
+ // packages/content/src/code/use-highlighted-code.ts
8
+ var l = 2e5, u = 4096;
9
+ function d(e, t) {
10
+ let r = a(null), [s, c] = o();
11
+ return i(() => () => {
12
+ r.current !== null && (r.current.tokenizer.dispose(), r.current = null);
13
+ }, []), i(() => {
14
+ let i = !0;
15
+ async function a() {
16
+ try {
17
+ let a = await import("@pierre/highlights");
18
+ if (!i || e.length > l || !a.isSupportedLanguage(t)) return;
19
+ let o = r.current, s = o !== null && o.language === t, d = s ? o : {
20
+ language: t,
21
+ source: e,
22
+ tokenizer: new a.LiveTokenizer({
23
+ code: e,
24
+ lang: t,
25
+ theme: n,
26
+ tokenizeMaxLineLength: u
27
+ })
28
+ };
29
+ if (s) {
30
+ if (e.startsWith(o.source)) {
31
+ let t = d.tokenizer.lineCount - 1, n = {
32
+ line: t,
33
+ character: d.tokenizer.getLineLength(t)
34
+ };
35
+ d.tokenizer.applyEdits([{
36
+ range: {
37
+ start: n,
38
+ end: n
39
+ },
40
+ newText: e.slice(o.source.length)
41
+ }]);
42
+ } else d.tokenizer.reset(e);
43
+ } else o !== null && o.tokenizer.dispose();
44
+ r.current = {
45
+ ...d,
46
+ source: e
47
+ };
48
+ let f = d.tokenizer;
49
+ f.flush();
50
+ let p = Array.from({ length: f.lineCount }, (e, t) => f.getLineTokens(t).tokens);
51
+ c({
52
+ code: e,
53
+ language: t,
54
+ lines: p,
55
+ hasFailed: !1
56
+ });
57
+ } catch {
58
+ i && c({
59
+ code: e,
60
+ language: t,
61
+ lines: [],
62
+ hasFailed: !0
63
+ });
64
+ }
65
+ }
66
+ return a(), () => {
67
+ i = !1;
68
+ };
69
+ }, [e, t]), s !== void 0 && s.code === e && s.language === t ? s : void 0;
70
+ }
71
+ // packages/content/src/code/code-block.tsx
72
+ var f = {
73
+ kVQacm: "xysyzu8",
74
+ $$css: !0
75
+ }, p = {
76
+ viewport: (e) => [
77
+ f,
78
+ {
79
+ kskxy: e == null ? e : "x1jols5v",
80
+ $$css: !0
81
+ },
82
+ { "--x-maxHeight": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(e) }
83
+ ],
84
+ token: (e) => [{
85
+ kMwMTN: e == null ? e : "x14rh7hd",
86
+ $$css: !0
87
+ }, { "--x-color": e ?? void 0 }],
88
+ italic: {
89
+ kKX8nH: "x1k4tb9n",
90
+ $$css: !0
91
+ },
92
+ bold: {
93
+ k63SB2: "x1s688f",
94
+ $$css: !0
95
+ }
96
+ }, m = 2e5;
97
+ function h({ token: e }) {
98
+ let n = e.fontStyle ?? 0, [i, a] = [!!(n & 1), !!(n & 2)];
99
+ return /* @__PURE__ */ s("span", {
100
+ ...r.props(p.token(e.color ?? t.ink), i && p.italic, a && p.bold),
101
+ children: e.content
102
+ });
103
+ }
104
+ function g({ code: t, language: n = "text", filename: i, streaming: a = !1, wrap: o = !1, lineNumbers: l = !0, selectedLines: u, annotations: f = [], maxHeight: g = 400, maxLines: _ = 2e3 }) {
105
+ let v = d(t, n), y = t.slice(0, m).split(/\r\n|\n|\r/u), b = y.slice(0, Math.max(1, _)).map((e, t) => ({
106
+ text: e,
107
+ line: t + 1
108
+ })), x = i ?? n;
109
+ return /* @__PURE__ */ c("section", {
110
+ "aria-label": i ?? "Code",
111
+ className: "xeuugli xmkeg23 x1y0btm7 x1yww3zy x1l90twa xgl13c x1vyzsr4",
112
+ children: [
113
+ /* @__PURE__ */ c("div", {
114
+ className: "x78zum5 x6s0dn4 x1qughib xtmze7h x4wz14 x1ri6wgn xoedhln xut3y95 x1hyyzld xv9cywu xso031l x1q0q8m5 x7a6td9",
115
+ children: [/* @__PURE__ */ c("span", { children: [x, a && " · streaming"] }), /* @__PURE__ */ s(e, {
116
+ label: i ?? "code",
117
+ value: t,
118
+ children: "Copy"
119
+ })]
120
+ }),
121
+ /* @__PURE__ */ s("div", {
122
+ role: "region",
123
+ "aria-label": `${x} source`,
124
+ tabIndex: 0,
125
+ ...r.props(p.viewport(g)),
126
+ children: /* @__PURE__ */ s("pre", {
127
+ ...{
128
+ 0: { className: "x1ghz6dp x4wz14 xdxxwph xut3y95 x1hyyzld xeq4nuv xk8lq53" },
129
+ 1: { className: "x1ghz6dp x4wz14 xdxxwph xut3y95 x1hyyzld xeq4nuv xeuugli x126k92a xj0a0fe" }
130
+ }[!!o | 0],
131
+ children: /* @__PURE__ */ s("code", { children: b.map(({ text: e, line: t }) => {
132
+ let n = v === void 0 ? void 0 : v.lines[t - 1], r = u !== void 0 && t >= u.start && t <= (u.end ?? u.start), i = f.find((e) => e.line === t);
133
+ return /* @__PURE__ */ c("span", { children: [/* @__PURE__ */ c("span", {
134
+ ...{
135
+ 0: { className: "x78zum5 x19zkttd" },
136
+ 1: { className: "x78zum5 x19zkttd xzriygp" }
137
+ }[!!r | 0],
138
+ children: [l && /* @__PURE__ */ s("span", {
139
+ "aria-hidden": !0,
140
+ className: "x1rg5ohu x2lah0s xl3ry0p x13hf59f xp4054r x1xpctow x87ps6o",
141
+ children: t
142
+ }), /* @__PURE__ */ c("span", {
143
+ className: "x1lliihq x12lumcd x1ri6wgn xeuugli",
144
+ children: [n === void 0 ? e : n.map((e) => /* @__PURE__ */ s(h, { token: e }, e.offset)), e.length === 0 && "\n"]
145
+ })]
146
+ }), i !== void 0 && /* @__PURE__ */ s("span", {
147
+ className: "x1lliihq x1i1dks5 x1m7rfvg xoedhln x118kxxs xeaf4i8",
148
+ children: i.content
149
+ })] }, t);
150
+ }) })
151
+ })
152
+ }),
153
+ y.length > b.length && /* @__PURE__ */ s("div", {
154
+ className: "x4wz14 x1ri6wgn xoedhln xut3y95 x1hyyzld xv9cywu",
155
+ children: "Additional lines omitted. Copy includes the complete source."
156
+ }),
157
+ t.length > m && /* @__PURE__ */ s("div", {
158
+ className: "x4wz14 x1ri6wgn xoedhln xut3y95 x1hyyzld xv9cywu",
159
+ children: "Preview limited to the first 200,000 characters. Copy includes the complete source."
160
+ }),
161
+ t.length === 0 && /* @__PURE__ */ s("div", {
162
+ className: "x4wz14 x1ri6wgn xoedhln xut3y95 x1hyyzld xv9cywu",
163
+ children: "No source text."
164
+ }),
165
+ v !== void 0 && v.hasFailed && /* @__PURE__ */ s("div", {
166
+ className: "x4wz14 x1ri6wgn xoedhln xut3y95 x1hyyzld xv9cywu",
167
+ children: "Syntax highlighting unavailable. The source is shown unchanged."
168
+ })
169
+ ]
170
+ });
171
+ }
172
+ export { g as t };