@mechane-ai/elements 0.36.0 → 0.38.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.
- package/README.md +8 -6
- package/dist/ai.js +3 -3
- package/dist/{chart-theme-Bwr9YSP1.js → categorical-values-BECG-J6R.js} +4 -54
- package/dist/{chart-frame-C0UBu4ku.js → chart-frame-CJFnI39T.js} +78 -93
- package/dist/{chart-input-Ccr2NJ6J.js → chart-input-DwAobO8Y.js} +2 -2
- package/dist/chart-navigation-CBIeNtJq.js +67 -0
- package/dist/charts/cartesian.js +631 -618
- package/dist/charts/distribution.js +298 -267
- package/dist/charts/graph.js +113 -122
- package/dist/charts/hierarchy.js +12 -12
- package/dist/charts/matrix.js +208 -200
- package/dist/charts/timeline.js +2 -2
- package/dist/charts.js +3 -3
- package/dist/{code-block-DT1TCkTC.js → code-block-aC0Htt4N.js} +33 -32
- package/dist/collections.js +597 -351
- package/dist/content/code.js +1 -1
- package/dist/content/diff.js +1 -1
- package/dist/content/markdown.js +1 -1
- package/dist/content.js +1 -1
- package/dist/elements.css +22 -2
- package/dist/feedback.js +1 -1
- package/dist/navigation/commands.js +4 -3
- package/dist/packages/charts/src/chart-data.d.ts +13 -3
- package/dist/packages/charts/src/chart-frame.d.ts +2 -5
- package/dist/packages/charts/src/chart-navigation.d.ts +19 -0
- package/dist/packages/charts/src/distribution/distribution-plot.d.ts +4 -2
- package/dist/packages/collections/src/collection-filters.d.ts +20 -0
- package/dist/packages/collections/src/data-table.d.ts +4 -6
- package/dist/packages/collections/src/index.d.ts +4 -0
- package/dist/packages/collections/src/use-collection-controls.d.ts +30 -0
- package/dist/packages/feedback/src/index.d.ts +2 -2
- package/dist/packages/feedback/src/notifications.d.ts +35 -0
- package/dist/packages/feedback/src/toast.d.ts +1 -1
- package/dist/packages/navigation/src/commands/command.d.ts +1 -0
- package/dist/plot-width-BQQS-mw9.js +67 -0
- package/dist/{src-D9DktxEq.js → src-DWjAoOyd.js} +1 -1
- package/dist/{src-DXdsMc_Z.js → src-nkgFDl-g.js} +246 -207
- package/package.json +1 -1
- package/dist/plot-width--OgdohB5.js +0 -18
package/README.md
CHANGED
|
@@ -220,12 +220,14 @@ When an application's Content Security Policy requires nonces, wrap its componen
|
|
|
220
220
|
This is [Base UI's CSP provider](https://base-ui.com/react/utils/csp-provider); it authorizes component style tags such
|
|
221
221
|
as Select's scrollbar rules. The application owns nonce generation and its security policy.
|
|
222
222
|
|
|
223
|
-
Mount one `Toaster` from `/feedback` and call its exported `toast` API
|
|
224
|
-
|
|
225
|
-
initial-read failures and field validation local;
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
223
|
+
Mount one `Toaster` from `/feedback` and call its exported `toast` API with a plain-text object such as
|
|
224
|
+
`toast.error({ title: 'Could not save' })`. Elements includes Sonner's structural styles in the published stylesheet, so
|
|
225
|
+
the production package injects no additional toast style tag. Keep initial-read failures and field validation local;
|
|
226
|
+
retained-content refresh failures can use one notification with Retry. Loading updates require a stable ID, and
|
|
227
|
+
dismissal names its ID through `toast.dismiss({ id })`. Actions and loading notices persist. Keep titles, descriptions
|
|
228
|
+
and action labels brief; longer explanations belong in the relevant view. Shared toasts bound visible text and wrap
|
|
229
|
+
actions without narrowing the message. Opening a page or discovering background status does not warrant a notification.
|
|
230
|
+
The application owns stable IDs and dismissal on recovery or navigation.
|
|
229
231
|
|
|
230
232
|
## Loading content
|
|
231
233
|
|
package/dist/ai.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { D as e, E as t, T as n, _ as r, i, j as a, m as o, p as s, t as c, w as l } from "./src-C-Sx37kz.js";
|
|
2
|
-
import { t as u } from "./code-block-
|
|
3
|
-
import { a as d } from "./src-
|
|
2
|
+
import { t as u } from "./code-block-aC0Htt4N.js";
|
|
3
|
+
import { a as d } from "./src-DWjAoOyd.js";
|
|
4
4
|
import { t as f } from "./content-link-B3ObdyZY.js";
|
|
5
5
|
import { r as p, t as m } from "./src-d7EAi61b.js";
|
|
6
|
-
import { f as h, l as g } from "./src-
|
|
6
|
+
import { f as h, l as g } from "./src-nkgFDl-g.js";
|
|
7
7
|
import { r as ee, t as _ } from "./forms-BQQFas9g.js";
|
|
8
8
|
import { t as v } from "./accessibility-C-aIZ1Yx.js";
|
|
9
9
|
import { t as y } from "./visible-motion-1GcUaEi4.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as e } from "./src-
|
|
2
|
-
import {
|
|
3
|
-
import { n } from "./chart-input-
|
|
1
|
+
import { c as e } from "./src-nkgFDl-g.js";
|
|
2
|
+
import { t } from "./chart-frame-CJFnI39T.js";
|
|
3
|
+
import { n } from "./chart-input-DwAobO8Y.js";
|
|
4
4
|
import * as r from "@stylexjs/stylex";
|
|
5
5
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
6
|
// packages/charts/src/categorical-values.tsx
|
|
@@ -56,54 +56,4 @@ function f({ items: n, selection: o }) {
|
|
|
56
56
|
}) }, n.id))
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
|
-
|
|
60
|
-
var p = {
|
|
61
|
-
plot: {
|
|
62
|
-
k7Eaqz: "xeuugli",
|
|
63
|
-
kVQacm: "xb3r6kr",
|
|
64
|
-
$$css: !0
|
|
65
|
-
},
|
|
66
|
-
svg: {
|
|
67
|
-
k1xSpc: "x1lliihq",
|
|
68
|
-
kzqmXN: "xh8yej3",
|
|
69
|
-
kVQacm: "x1rea2x4",
|
|
70
|
-
$$css: !0
|
|
71
|
-
},
|
|
72
|
-
axis: {
|
|
73
|
-
kjVXCG: "x13hfdr1",
|
|
74
|
-
kfJifR: "xnpr05h",
|
|
75
|
-
kREpy8: "x13efnbd",
|
|
76
|
-
$$css: !0
|
|
77
|
-
},
|
|
78
|
-
grid: {
|
|
79
|
-
kjVXCG: "x13hfdr1",
|
|
80
|
-
kfJifR: "xnpr05h",
|
|
81
|
-
k5rJSQ: "x1ntoi03",
|
|
82
|
-
kREpy8: "x13efnbd",
|
|
83
|
-
$$css: !0
|
|
84
|
-
},
|
|
85
|
-
label: {
|
|
86
|
-
kDwRjp: "x1q7gtio",
|
|
87
|
-
kMv6JI: "x1hz01jw",
|
|
88
|
-
kGuDYH: "xy8obcc",
|
|
89
|
-
k63SB2: "xj57cvi",
|
|
90
|
-
kcqcaj: "xss6m8b",
|
|
91
|
-
$$css: !0
|
|
92
|
-
},
|
|
93
|
-
mark: {
|
|
94
|
-
kfJifR: "xhr4kjn",
|
|
95
|
-
kREpy8: "x13efnbd",
|
|
96
|
-
$$css: !0
|
|
97
|
-
},
|
|
98
|
-
selected: {
|
|
99
|
-
kjVXCG: "x17y187c",
|
|
100
|
-
kfJifR: "xvlca1e",
|
|
101
|
-
kREpy8: "x13efnbd",
|
|
102
|
-
$$css: !0
|
|
103
|
-
},
|
|
104
|
-
inspectable: {
|
|
105
|
-
k3XXqK: "x1t137rt",
|
|
106
|
-
$$css: !0
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
export { d as a, u as i, f as n, c as r, p as t };
|
|
59
|
+
export { d as i, c as n, u as r, f as t };
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "./
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import { Children as s, useId as c } from "react";
|
|
7
|
-
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
1
|
+
import { t as e } from "./header-styles-COxCYFZx.js";
|
|
2
|
+
import { c as t, f as n, h as r } from "./src-nkgFDl-g.js";
|
|
3
|
+
import * as i from "@stylexjs/stylex";
|
|
4
|
+
import { Children as a, useId as o } from "react";
|
|
5
|
+
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
6
|
// packages/charts/src/chart-heading.tsx
|
|
9
|
-
var
|
|
7
|
+
var u = { root: {
|
|
10
8
|
k1C7PZ: "x8zbtdt",
|
|
11
9
|
khm7nJ: "x1gkm1c7",
|
|
12
10
|
kMwMTN: "xbixft",
|
|
@@ -15,28 +13,28 @@ var f = { root: {
|
|
|
15
13
|
kLWn49: "x1778rvt",
|
|
16
14
|
$$css: !0
|
|
17
15
|
} };
|
|
18
|
-
function
|
|
19
|
-
let
|
|
20
|
-
...
|
|
16
|
+
function d({ title: t, id: n, meta: r, actions: o }) {
|
|
17
|
+
let s = a.toArray(r).length > 0, d = a.toArray(o).length > 0, f = s || d, p = s && /* @__PURE__ */ c("div", {
|
|
18
|
+
...i.props(e.meta),
|
|
21
19
|
children: r
|
|
22
|
-
}), m =
|
|
23
|
-
...
|
|
24
|
-
children:
|
|
20
|
+
}), m = d && /* @__PURE__ */ c("div", {
|
|
21
|
+
...i.props(e.actions),
|
|
22
|
+
children: o
|
|
25
23
|
});
|
|
26
|
-
return /* @__PURE__ */
|
|
27
|
-
...
|
|
28
|
-
children: [/* @__PURE__ */
|
|
24
|
+
return /* @__PURE__ */ l("div", {
|
|
25
|
+
...i.props(e.row, e.reportRow, u.root),
|
|
26
|
+
children: [/* @__PURE__ */ c("p", {
|
|
29
27
|
id: n,
|
|
30
|
-
...
|
|
31
|
-
children:
|
|
32
|
-
}),
|
|
33
|
-
...
|
|
28
|
+
...i.props(e.title),
|
|
29
|
+
children: t
|
|
30
|
+
}), f && /* @__PURE__ */ l("div", {
|
|
31
|
+
...i.props(e.trailing),
|
|
34
32
|
children: [p, m]
|
|
35
33
|
})]
|
|
36
34
|
});
|
|
37
35
|
}
|
|
38
36
|
// packages/charts/src/chart-series-marker.tsx
|
|
39
|
-
var
|
|
37
|
+
var f = {
|
|
40
38
|
root: {
|
|
41
39
|
k1xSpc: "x3nfvp2",
|
|
42
40
|
kGNEyG: "x6s0dn4",
|
|
@@ -60,124 +58,124 @@ var m = {
|
|
|
60
58
|
$$css: !0
|
|
61
59
|
}
|
|
62
60
|
};
|
|
63
|
-
function
|
|
64
|
-
let
|
|
65
|
-
return /* @__PURE__ */
|
|
61
|
+
function p({ tone: e, children: n }) {
|
|
62
|
+
let r = a.toArray(n).length > 0;
|
|
63
|
+
return /* @__PURE__ */ c("span", {
|
|
66
64
|
"aria-hidden": !0,
|
|
67
65
|
inert: !0,
|
|
68
|
-
...
|
|
69
|
-
children:
|
|
66
|
+
...i.props(f.root, f.color(t[e]), r ? f.icon : f.swatch),
|
|
67
|
+
children: n
|
|
70
68
|
});
|
|
71
69
|
}
|
|
72
70
|
// packages/charts/src/chart-series-summary.tsx
|
|
73
|
-
function
|
|
74
|
-
return Object.keys(t).length === e.length && e.every((e) => Object.hasOwn(t, e.id)) ? /* @__PURE__ */
|
|
71
|
+
function m({ series: e, values: t }) {
|
|
72
|
+
return Object.keys(t).length === e.length && e.every((e) => Object.hasOwn(t, e.id)) ? /* @__PURE__ */ c("dl", {
|
|
75
73
|
"aria-label": "Period summary",
|
|
76
74
|
className: "x78zum5 x1a02dak xaml1ju x1ghz6dp xeuugli",
|
|
77
|
-
children: e.map((e,
|
|
75
|
+
children: e.map((e, r) => /* @__PURE__ */ l("div", {
|
|
78
76
|
...{
|
|
79
77
|
0: { className: "xeuugli" },
|
|
80
78
|
1: { className: "xeuugli xo02m6d xpilrb4 x1t7ytsu x97x49r" }
|
|
81
|
-
}[
|
|
82
|
-
children: [/* @__PURE__ */
|
|
79
|
+
}[r > 0 | 0],
|
|
80
|
+
children: [/* @__PURE__ */ l("dt", {
|
|
83
81
|
className: "x78zum5 x6s0dn4 xunmzkg x153jb6y xy8obcc",
|
|
84
|
-
children: [/* @__PURE__ */
|
|
85
|
-
}), /* @__PURE__ */
|
|
82
|
+
children: [/* @__PURE__ */ c(p, { tone: e.tone }), e.label]
|
|
83
|
+
}), /* @__PURE__ */ c("dd", {
|
|
86
84
|
className: "x1ghz6dp xbixft x71lla1 xgkpprq xk4h15q x1wjjqco xss6m8b xj0a0fe",
|
|
87
|
-
children: t[e.id] === void 0 ? /* @__PURE__ */
|
|
85
|
+
children: t[e.id] === void 0 ? /* @__PURE__ */ c(n, { width: "6ch" }) : t[e.id]
|
|
88
86
|
})]
|
|
89
87
|
}, e.id))
|
|
90
|
-
}) : /* @__PURE__ */
|
|
88
|
+
}) : /* @__PURE__ */ c(r, {
|
|
91
89
|
hasError: !0,
|
|
92
90
|
children: "Period values must match the chart series identifiers."
|
|
93
91
|
});
|
|
94
92
|
}
|
|
95
93
|
// packages/charts/src/chart-frame.tsx
|
|
96
|
-
function
|
|
97
|
-
let
|
|
98
|
-
if (
|
|
99
|
-
let
|
|
100
|
-
series:
|
|
101
|
-
values:
|
|
102
|
-
}),
|
|
103
|
-
return /* @__PURE__ */
|
|
104
|
-
"aria-labelledby":
|
|
94
|
+
function h({ title: t, description: n, children: r, actions: u, footer: f, report: p, series: h = [] }) {
|
|
95
|
+
let g = o();
|
|
96
|
+
if (p !== void 0) {
|
|
97
|
+
let e = p.seriesValues === void 0 ? p.summary : /* @__PURE__ */ c(m, {
|
|
98
|
+
series: h,
|
|
99
|
+
values: p.seriesValues
|
|
100
|
+
}), i = e != null && e !== !1, o = a.toArray([p.actions, u]).length > 0, _ = /* @__PURE__ */ l(s, { children: [p.actions, u] });
|
|
101
|
+
return /* @__PURE__ */ l("figure", {
|
|
102
|
+
"aria-labelledby": g,
|
|
105
103
|
className: "xeuugli x1ghz6dp xbixft xpvm0e4 x1hz01jw xtqrqnz xj57cvi x1778rvt xmkeg23 x1y0btm7 x1ey3b81",
|
|
106
|
-
children: [/* @__PURE__ */
|
|
107
|
-
id:
|
|
108
|
-
title:
|
|
109
|
-
meta:
|
|
110
|
-
actions:
|
|
111
|
-
}) }), /* @__PURE__ */
|
|
104
|
+
children: [/* @__PURE__ */ c("figcaption", { children: /* @__PURE__ */ c(d, {
|
|
105
|
+
id: g,
|
|
106
|
+
title: t,
|
|
107
|
+
meta: p.meta,
|
|
108
|
+
actions: o && _
|
|
109
|
+
}) }), /* @__PURE__ */ l("div", {
|
|
112
110
|
className: "xeuugli xg7ukam",
|
|
113
111
|
children: [
|
|
114
|
-
|
|
112
|
+
i && /* @__PURE__ */ c("div", {
|
|
115
113
|
className: "x1xxlxpq xeuugli",
|
|
116
|
-
children:
|
|
114
|
+
children: e
|
|
117
115
|
}),
|
|
118
|
-
n !== void 0 && /* @__PURE__ */
|
|
116
|
+
n !== void 0 && /* @__PURE__ */ c("p", {
|
|
119
117
|
className: "x1ghz6dp x1c87qhr x153jb6y xy8obcc xas2l8k",
|
|
120
118
|
children: n
|
|
121
119
|
}),
|
|
122
120
|
r,
|
|
123
|
-
|
|
121
|
+
f !== void 0 && /* @__PURE__ */ c("div", {
|
|
124
122
|
className: "x1xxf3xd xeuugli x153jb6y xy8obcc xas2l8k xj0a0fe",
|
|
125
|
-
children:
|
|
123
|
+
children: f
|
|
126
124
|
})
|
|
127
125
|
]
|
|
128
126
|
})]
|
|
129
127
|
});
|
|
130
128
|
}
|
|
131
|
-
return /* @__PURE__ */
|
|
132
|
-
"aria-labelledby":
|
|
129
|
+
return /* @__PURE__ */ l("figure", {
|
|
130
|
+
"aria-labelledby": g,
|
|
133
131
|
className: "xeuugli x1ghz6dp xbixft xpvm0e4 x1hz01jw xtqrqnz xj57cvi x1778rvt",
|
|
134
132
|
children: [
|
|
135
|
-
/* @__PURE__ */
|
|
133
|
+
/* @__PURE__ */ l("figcaption", {
|
|
136
134
|
className: "x78zum5 x1a02dak x1qughib x7a106z x1n8ia3y x1wv5www",
|
|
137
|
-
children: [/* @__PURE__ */
|
|
135
|
+
children: [/* @__PURE__ */ l("div", {
|
|
138
136
|
className: "x1cqoux5 xeuugli xj0a0fe",
|
|
139
|
-
children: [/* @__PURE__ */
|
|
140
|
-
id:
|
|
137
|
+
children: [/* @__PURE__ */ c("p", {
|
|
138
|
+
id: g,
|
|
141
139
|
className: "x1ghz6dp x12myhf4 x1778rvt xk4h15q",
|
|
142
|
-
children:
|
|
143
|
-
}), n !== void 0 && /* @__PURE__ */
|
|
140
|
+
children: t
|
|
141
|
+
}), n !== void 0 && /* @__PURE__ */ c("p", {
|
|
144
142
|
className: "x1ghz6dp x1c87qhr x153jb6y xy8obcc xas2l8k",
|
|
145
143
|
children: n
|
|
146
144
|
})]
|
|
147
|
-
}),
|
|
148
|
-
...
|
|
149
|
-
children:
|
|
145
|
+
}), u !== void 0 && /* @__PURE__ */ c("div", {
|
|
146
|
+
...i.props(e.actions),
|
|
147
|
+
children: u
|
|
150
148
|
})]
|
|
151
149
|
}),
|
|
152
150
|
r,
|
|
153
|
-
|
|
151
|
+
f !== void 0 && /* @__PURE__ */ c("div", {
|
|
154
152
|
className: "x1xxf3xd xeuugli x153jb6y xy8obcc xas2l8k xj0a0fe",
|
|
155
|
-
children:
|
|
153
|
+
children: f
|
|
156
154
|
})
|
|
157
155
|
]
|
|
158
156
|
});
|
|
159
157
|
}
|
|
160
|
-
function
|
|
161
|
-
return /* @__PURE__ */
|
|
158
|
+
function g({ items: e, label: t = "Legend", isScrollable: n = !1 }) {
|
|
159
|
+
return /* @__PURE__ */ c("ul", {
|
|
162
160
|
"aria-label": t,
|
|
163
161
|
...{
|
|
164
162
|
0: { className: "x78zum5 x1a02dak x8zbtdt x1gkm1c7 xe8uvvx x1ghz6dp x1717udv x153jb6y x1hz01jw xy8obcc xas2l8k" },
|
|
165
163
|
1: { className: "x78zum5 x8zbtdt x1gkm1c7 xe8uvvx x1ghz6dp x1717udv x153jb6y x1hz01jw xy8obcc xas2l8k xozqiw3 xw2csxc x1mqbd49" }
|
|
166
164
|
}[!!n | 0],
|
|
167
|
-
children: e.map((e) => /* @__PURE__ */
|
|
165
|
+
children: e.map((e) => /* @__PURE__ */ l("li", {
|
|
168
166
|
...{
|
|
169
167
|
0: { className: "x3nfvp2 x6s0dn4 xunmzkg xeuugli x193iq5w xj0a0fe" },
|
|
170
168
|
1: { className: "x3nfvp2 x6s0dn4 xunmzkg xeuugli xj0a0fe x2lah0s x1x1rfll xuxw1ft" }
|
|
171
169
|
}[!!n | 0],
|
|
172
|
-
children: [/* @__PURE__ */
|
|
170
|
+
children: [/* @__PURE__ */ c(p, { tone: e.tone }), e.label]
|
|
173
171
|
}, e.id))
|
|
174
172
|
});
|
|
175
173
|
}
|
|
176
|
-
function
|
|
177
|
-
return n === void 0 ? /* @__PURE__ */
|
|
174
|
+
function _({ label: e, isSelected: t = !1, onSelect: n, children: r }) {
|
|
175
|
+
return n === void 0 ? /* @__PURE__ */ c("div", {
|
|
178
176
|
className: "x78zum5 x1a02dak x6s0dn4 x1qughib x8zbtdt x1gkm1c7 xeuugli x17tes2r x17oiadl x9f619 xh8yej3 xc342km x1hmw7ec x5g2kb4 x1hz01jw xtqrqnz xj57cvi x1778rvt x1yc453h xj0a0fe xbixft xpvm0e4 xss6m8b",
|
|
179
177
|
children: r
|
|
180
|
-
}) : /* @__PURE__ */
|
|
178
|
+
}) : /* @__PURE__ */ c("button", {
|
|
181
179
|
type: "button",
|
|
182
180
|
"aria-label": e,
|
|
183
181
|
"aria-pressed": t,
|
|
@@ -189,25 +187,12 @@ function y({ label: e, isSelected: t = !1, onSelect: n, children: r }) {
|
|
|
189
187
|
children: r
|
|
190
188
|
});
|
|
191
189
|
}
|
|
192
|
-
function
|
|
193
|
-
return /* @__PURE__ */
|
|
190
|
+
function v({ children: e, id: t }) {
|
|
191
|
+
return /* @__PURE__ */ c("p", {
|
|
192
|
+
id: t,
|
|
194
193
|
"aria-live": "polite",
|
|
195
194
|
className: "x1ghz6dp xeuugli x1mqbd49 xbixft xy8obcc xas2l8k xss6m8b xj0a0fe",
|
|
196
195
|
children: e
|
|
197
196
|
});
|
|
198
197
|
}
|
|
199
|
-
|
|
200
|
-
let i = n();
|
|
201
|
-
return /* @__PURE__ */ u("div", {
|
|
202
|
-
className: "x1xxf3xd x178xt8z x13fuv20 xhjagg4",
|
|
203
|
-
children: /* @__PURE__ */ d(e.Root, { children: [/* @__PURE__ */ u(e.Trigger, { children: r }), /* @__PURE__ */ u(e.Panel, { children: /* @__PURE__ */ u("div", {
|
|
204
|
-
ref: i.ref,
|
|
205
|
-
role: "region",
|
|
206
|
-
"aria-label": r,
|
|
207
|
-
tabIndex: i.tabIndex,
|
|
208
|
-
className: "xeuugli x1sslpiy xysyzu8 x1t137rt x19rmrnh x9v5kkp x13qnu6 x1bqaal",
|
|
209
|
-
children: t
|
|
210
|
-
}) })] })
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
export { b as a, v as i, y as n, h as o, _ as r, x as t };
|
|
198
|
+
export { p as a, v as i, h as n, g as r, _ as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { h as e } from "./src-
|
|
2
|
-
import {
|
|
1
|
+
import { h as e } from "./src-nkgFDl-g.js";
|
|
2
|
+
import { n as t } from "./chart-frame-CJFnI39T.js";
|
|
3
3
|
import { jsx as n } from "react/jsx-runtime";
|
|
4
4
|
// packages/charts/src/chart-input.tsx
|
|
5
5
|
function r(e) {
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { t as e } from "./accessibility-C-aIZ1Yx.js";
|
|
2
|
+
import * as t from "@stylexjs/stylex";
|
|
3
|
+
import { useId as n, useState as r } from "react";
|
|
4
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
|
+
// packages/charts/src/chart-data.tsx
|
|
6
|
+
function o({ label: n, columns: r, rows: o }) {
|
|
7
|
+
return /* @__PURE__ */ i("div", {
|
|
8
|
+
...t.props(e.hidden),
|
|
9
|
+
children: /* @__PURE__ */ a("table", { children: [
|
|
10
|
+
/* @__PURE__ */ i("caption", { children: n }),
|
|
11
|
+
/* @__PURE__ */ i("thead", { children: /* @__PURE__ */ i("tr", { children: r.map((e) => /* @__PURE__ */ i("th", {
|
|
12
|
+
scope: "col",
|
|
13
|
+
children: e.label
|
|
14
|
+
}, e.id)) }) }),
|
|
15
|
+
/* @__PURE__ */ i("tbody", { children: o.map((e) => /* @__PURE__ */ i("tr", { children: r.map((t, n) => n === 0 ? /* @__PURE__ */ i("th", {
|
|
16
|
+
scope: "row",
|
|
17
|
+
children: e.values[n]
|
|
18
|
+
}, t.id) : /* @__PURE__ */ i("td", { children: e.values[n] }, t.id)) }, e.id)) })
|
|
19
|
+
] })
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
// packages/charts/src/chart-navigation.tsx
|
|
23
|
+
var s = /* @__PURE__ */ new Set(["Enter", " "]);
|
|
24
|
+
function c({ title: e, items: t, selection: i }) {
|
|
25
|
+
let a = n(), [o, c] = r(void 0), [l, u] = r(!1), d = Math.max(0, t.findIndex((e) => e.id === (o ?? i?.selectedId))), f = t[d];
|
|
26
|
+
function p(e) {
|
|
27
|
+
c(e), u(!0);
|
|
28
|
+
}
|
|
29
|
+
function m(e) {
|
|
30
|
+
let n = e.altKey || e.ctrlKey || e.metaKey;
|
|
31
|
+
if (e.defaultPrevented || n || t.length === 0) return;
|
|
32
|
+
let r = t.length - 1, a = {
|
|
33
|
+
ArrowLeft: -1,
|
|
34
|
+
ArrowRight: 1,
|
|
35
|
+
ArrowUp: -1,
|
|
36
|
+
ArrowDown: 1,
|
|
37
|
+
Home: -d,
|
|
38
|
+
End: r - d
|
|
39
|
+
}[e.key];
|
|
40
|
+
if (a !== void 0) {
|
|
41
|
+
e.preventDefault();
|
|
42
|
+
let n = t[Math.max(0, Math.min(r, d + a))];
|
|
43
|
+
n !== void 0 && p(n.id);
|
|
44
|
+
} else s.has(e.key) && i !== void 0 && f !== void 0 ? (e.preventDefault(), i.onSelect(f.id)) : e.key === "Escape" && (e.preventDefault(), u(!1));
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
id: a,
|
|
48
|
+
props: {
|
|
49
|
+
role: "group",
|
|
50
|
+
tabIndex: t.length > 0 ? 0 : void 0,
|
|
51
|
+
"aria-label": `${e}. Use arrow keys to inspect.${i === void 0 ? "" : " Press Enter to select."}`,
|
|
52
|
+
"aria-describedby": a,
|
|
53
|
+
onKeyDown: m,
|
|
54
|
+
onFocus: () => u(!0),
|
|
55
|
+
onBlur: (e) => {
|
|
56
|
+
e.currentTarget.contains(e.relatedTarget) || u(!1);
|
|
57
|
+
},
|
|
58
|
+
onPointerLeave: (e) => {
|
|
59
|
+
e.currentTarget.contains(document.activeElement) || u(!1);
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
activeId: f?.id,
|
|
63
|
+
label: l ? f?.label : void 0,
|
|
64
|
+
inspect: p
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
export { o as n, c as t };
|