@mechane-ai/elements 0.45.0 → 0.46.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 +48 -18
- package/bin/mechane-elements-catalog.mjs +42 -4
- package/dist/ai.js +268 -202
- package/dist/catalog.json +91 -31
- package/dist/categorical-values-BXi-rJuv.js +74 -0
- package/dist/chart-cursor-1mFd48Jc.js +23 -0
- package/dist/chart-data-CIJVWCYt.js +21 -0
- package/dist/{chart-frame-Ztktqs1b.js → chart-frame-BaxKn_MB.js} +22 -41
- package/dist/{chart-input-BO3BqlFO.js → chart-input-Bm82_9Rd.js} +2 -2
- package/dist/chart-theme-4zprJ3rW.js +404 -0
- package/dist/charts/cartesian.js +1598 -1432
- package/dist/charts/distribution.js +476 -404
- package/dist/charts/graph.js +363 -349
- package/dist/charts/hierarchy.js +103 -94
- package/dist/charts/matrix.js +340 -333
- package/dist/charts/timeline.js +167 -134
- package/dist/charts.js +3 -3
- package/dist/{code-block-Cpfr7B6a.js → code-block-DioAM2bZ.js} +67 -52
- package/dist/collections.js +1648 -1188
- package/dist/content/code.js +1 -1
- package/dist/content/diff.js +67 -66
- package/dist/content/link.js +1 -1
- package/dist/content/markdown.js +2 -2
- package/dist/content/tree.js +2 -2
- package/dist/{content-link-CGeFFb9F.js → content-link-NWuHp5rC.js} +1 -1
- package/dist/content.js +1 -1
- package/dist/csp.js +6 -11
- package/dist/feedback.js +1 -1
- package/dist/forms/dates.js +274 -214
- package/dist/{forms-DeU0Tiv3.js → forms-CEbwzlRR.js} +50 -41
- package/dist/forms.js +3 -3
- package/dist/index.js +1 -1
- package/dist/layout.js +207 -207
- package/dist/navigation.js +4 -3
- package/dist/packages/ai/src/conversation.d.ts +2 -0
- package/dist/packages/ai/src/prompt-input.d.ts +7 -2
- package/dist/packages/charts/src/cartesian/composition-bars.d.ts +2 -2
- package/dist/packages/charts/src/cartesian/index.d.ts +3 -2
- package/dist/packages/charts/src/cartesian/scatter-plot.d.ts +8 -2
- package/dist/packages/charts/src/cartesian/time-series.d.ts +11 -1
- package/dist/packages/charts/src/categorical-values.d.ts +14 -9
- package/dist/packages/charts/src/chart-frame.d.ts +7 -9
- package/dist/packages/charts/src/chart-inspection.d.ts +1 -2
- package/dist/packages/charts/src/chart-range.d.ts +33 -0
- package/dist/packages/charts/src/chart-rows.d.ts +20 -0
- package/dist/packages/charts/src/chart-theme.d.ts +17 -0
- package/dist/packages/charts/src/chart.d.ts +81 -0
- package/dist/packages/charts/src/distribution/distribution-plot.d.ts +4 -4
- package/dist/packages/charts/src/index.d.ts +1 -0
- package/dist/packages/charts/src/matrix/matrix-strip.d.ts +3 -3
- package/dist/packages/charts/src/plot-width.d.ts +0 -1
- package/dist/packages/charts/src/timeline/index.d.ts +1 -1
- package/dist/packages/charts/src/timeline/waterfall.d.ts +6 -2
- package/dist/packages/collections/src/collection-controls.d.ts +5 -1
- package/dist/packages/collections/src/collection-filters.d.ts +4 -1
- package/dist/packages/collections/src/control-toolbar.d.ts +13 -0
- package/dist/packages/collections/src/data-table-layout.d.ts +78 -0
- package/dist/packages/collections/src/data-table-rows.d.ts +54 -0
- package/dist/packages/collections/src/data-table-styles.d.ts +340 -0
- package/dist/packages/collections/src/data-table-text.d.ts +13 -0
- package/dist/packages/collections/src/data-table-trigger.d.ts +23 -0
- package/dist/packages/collections/src/data-table.d.ts +3 -85
- package/dist/packages/collections/src/index.d.ts +11 -6
- package/dist/packages/collections/src/query-controls.d.ts +6 -2
- package/dist/packages/collections/src/table-results.d.ts +47 -13
- package/dist/packages/collections/src/timeline.d.ts +1 -0
- package/dist/packages/collections/src/use-collection-controls.d.ts +2 -1
- package/dist/packages/collections/src/use-table-window.d.ts +25 -0
- package/dist/packages/content/src/viewer.d.ts +8 -0
- package/dist/packages/core/src/disclosure.d.ts +9 -1
- package/dist/packages/core/src/index.d.ts +1 -0
- package/dist/packages/core/src/route-link.d.ts +11 -0
- package/dist/packages/forms/src/dates/date-inputs.d.ts +3 -1
- package/dist/packages/forms/src/file-picker.d.ts +15 -0
- package/dist/packages/forms/src/form-controls.d.ts +1 -6
- package/dist/packages/forms/src/forms.d.ts +4 -1
- package/dist/packages/forms/src/index.d.ts +4 -2
- package/dist/packages/forms/src/selection.d.ts +14 -0
- package/dist/packages/foundations/src/csp/index.d.ts +1 -1
- package/dist/packages/foundations/src/csp/provider.d.ts +7 -2
- package/dist/packages/navigation/src/index.d.ts +1 -1
- package/dist/{pierre-diff-B3tD3-6z.js → pierre-diff-DlvjyuJn.js} +1 -1
- package/dist/plot-width-v2c_rA20.js +63 -0
- package/dist/{src-gqEebHEa.js → src-1EHkSFS-.js} +395 -274
- package/dist/{src-DBNncL7_.js → src-BPTDJqt0.js} +48 -68
- package/dist/src-CGc_hjxJ.js +409 -0
- package/dist/{src-DcW_gMX8.js → src-CpdJlDhO.js} +480 -362
- package/dist/{src-Dcs3SZ9V.js → src-DVHlknB6.js} +1 -1
- package/dist/styles2.css +136 -114
- package/package.json +1 -4
- package/skills/extend-elements/SKILL.md +74 -0
- package/skills/review-elements/SKILL.md +76 -0
- package/skills/upgrade-elements/SKILL.md +34 -0
- package/skills/upgrade-elements/references/releases.md +58 -0
- package/skills/use-elements/SKILL.md +64 -13
- package/skills/use-elements/references/agent.md +57 -0
- package/skills/use-elements/references/charts.md +63 -0
- package/skills/use-elements/references/collections.md +89 -0
- package/skills/use-elements/references/conversations.md +47 -0
- package/skills/use-elements/references/forms.md +81 -0
- package/skills/use-elements/references/styling.md +70 -0
- package/skills/use-elements/references/workspace.md +3 -3
- package/dist/categorical-values-DZLGQVW1.js +0 -63
- package/dist/chart-navigation-BAbb5PV9.js +0 -154
- package/dist/header-styles-COxCYFZx.js +0 -90
- package/dist/packages/charts/src/chart-navigation.d.ts +0 -39
- package/dist/packages/charts/src/chart-surface.d.ts +0 -27
- package/dist/packages/navigation/src/route-link.d.ts +0 -2
- package/dist/plot-width-CIqBiHcd.js +0 -105
- package/dist/src-Bk7M67zy.js +0 -396
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Themes, tokens and styles
|
|
2
|
+
|
|
3
|
+
## The default setup
|
|
4
|
+
|
|
5
|
+
Import `@mechane-ai/elements/styles.css` once. The package ships compiled ESM, declarations and CSS, so an ordinary
|
|
6
|
+
React app needs no StyleX compiler. The light theme works with no class. The application installs its own reset and
|
|
7
|
+
fonts.
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { themeProps } from '@mechane-ai/elements/theme';
|
|
11
|
+
import type { ReactNode } from 'react';
|
|
12
|
+
|
|
13
|
+
export function Document({ isDark, children }: { readonly isDark: boolean; readonly children: ReactNode }) {
|
|
14
|
+
return <html {...(isDark ? themeProps.dark : themeProps.light)}>{children}</html>;
|
|
15
|
+
}
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Apply the theme to the document root so portaled menus, dialogs and tooltips inherit it. The application stores the
|
|
19
|
+
preference; there is no theme provider. A themed wrapper suits an isolated preview only.
|
|
20
|
+
|
|
21
|
+
## Appearance comes from the components
|
|
22
|
+
|
|
23
|
+
- Choose a named `variant`, `tone` or `density`. There is no size, padding or radius prop.
|
|
24
|
+
- `xstyle`, where a part supports it, accepts placement such as width or alignment.
|
|
25
|
+
- Compose another element through `render`, as in `<Dialog.Trigger render={<Button />}>`. The rendered element keeps its
|
|
26
|
+
own semantics, so a link stays a link.
|
|
27
|
+
- Do not restyle a control with a class that targets its internals. Fix spacing in the layout that places it.
|
|
28
|
+
- Text fields use 16px text on a coarse pointer and standalone controls give 44px targets. Leave both alone.
|
|
29
|
+
|
|
30
|
+
## CSS layers
|
|
31
|
+
|
|
32
|
+
Put reset rules in the `reset` layer. Elements rules use the StyleX `priority` layers. Keep those layers at the top
|
|
33
|
+
level: wrapping the Elements stylesheet in another layer lets a base rule override hover and focus states. Ordinary
|
|
34
|
+
unlayered application rules override the package.
|
|
35
|
+
|
|
36
|
+
## Tokens in your own styles
|
|
37
|
+
|
|
38
|
+
`@mechane-ai/elements/tokens` exports runtime references for colors, spacing, type, radii, motion and chart colors. Use
|
|
39
|
+
them in inline styles or any CSS-in-JS.
|
|
40
|
+
|
|
41
|
+
For StyleX authoring, import variables from `/tokens.stylex` and compile-time constants, such as
|
|
42
|
+
`conditions.coarsePointer`, from `/constants.stylex`. With Vite and StyleX 0.19.1:
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
import stylex from '@stylexjs/unplugin/vite';
|
|
46
|
+
import { defineConfig } from 'vite';
|
|
47
|
+
|
|
48
|
+
export default defineConfig({
|
|
49
|
+
plugins: [
|
|
50
|
+
stylex({
|
|
51
|
+
useCSSLayers: true,
|
|
52
|
+
debug: false,
|
|
53
|
+
runtimeInjection: false,
|
|
54
|
+
unstable_moduleResolution: { type: 'commonJS' },
|
|
55
|
+
externalPackages: ['@mechane-ai/elements'],
|
|
56
|
+
}),
|
|
57
|
+
],
|
|
58
|
+
resolve: { alias: [{ find: /^@mechane-ai\/elements\/tokens\.stylex$/, replacement: '@mechane-ai/elements/tokens' }] },
|
|
59
|
+
});
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The alias uses the compiled variable references without emitting the defaults again over the selected theme. Keep
|
|
63
|
+
`/constants.stylex` direct. Override roles with `stylex.createTheme(colors, ...)` using `colors` from `/tokens.stylex`.
|
|
64
|
+
|
|
65
|
+
Derive a CSS dimension from a token with CSS `calc()`. JavaScript arithmetic on a token produces an invalid declaration.
|
|
66
|
+
|
|
67
|
+
## A nonce policy
|
|
68
|
+
|
|
69
|
+
When the Content Security Policy requires nonces, wrap the tree in `CSPProvider` from `@mechane-ai/elements/csp` with
|
|
70
|
+
the request's nonce, and keep that nonce through hydration. The application generates the nonce and owns the policy.
|
|
@@ -11,9 +11,9 @@ At a wide desktop viewport, compare the right edge of a report header with its t
|
|
|
11
11
|
Give repeatable tasks such as reviewing a queue a named navigation link with deep-link and Back support. Put filters in
|
|
12
12
|
the toolbar. Keep drill-down on the data mark or row it explains.
|
|
13
13
|
|
|
14
|
-
Use `
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
Use `SegmentedControl` from `/forms` to switch between a few views; one item is always checked. Use `ToggleGroup` for
|
|
15
|
+
independent pressed choices. Both size to their content. Put either beside an Elements field and select, compare their
|
|
16
|
+
outer heights with a fine pointer and a coarse pointer, and check wrapping at phone width.
|
|
17
17
|
|
|
18
18
|
Use the shell's `railFooter.navigation` and `railFooter.menu` for persistent settings and account controls. Let the
|
|
19
19
|
shell space and position both groups. Put route tabs and their actions in `PageLayout.navigation`. Wrap each report
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { c as e, l as t } from "./src-Dcs3SZ9V.js";
|
|
2
|
-
import { t as n } from "./chart-frame-Ztktqs1b.js";
|
|
3
|
-
import { n as r } from "./chart-input-BO3BqlFO.js";
|
|
4
|
-
import * as i from "@stylexjs/stylex";
|
|
5
|
-
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
-
// packages/charts/src/categorical-values.tsx
|
|
7
|
-
var s = {
|
|
8
|
-
kzqmXN: "x1xc55vz",
|
|
9
|
-
kZKoxP: "xdk7pt",
|
|
10
|
-
kmuXW: "x2lah0s",
|
|
11
|
-
kGVxlE: "x1iotiob",
|
|
12
|
-
$$css: !0
|
|
13
|
-
}, c = { swatch: (e, t) => [
|
|
14
|
-
s,
|
|
15
|
-
{
|
|
16
|
-
kWkggS: e == null ? e : "xl8spv7",
|
|
17
|
-
$$css: !0
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
"--x-backgroundColor": e ?? void 0,
|
|
21
|
-
"--x-boxShadow": `inset 0 0 0 1px ${t}` == null ? void 0 : `inset 0 0 0 1px ${t}`
|
|
22
|
-
}
|
|
23
|
-
] }, l = {
|
|
24
|
-
items: 200,
|
|
25
|
-
series: 12
|
|
26
|
-
}, u = [
|
|
27
|
-
"series1",
|
|
28
|
-
"series2",
|
|
29
|
-
"series3",
|
|
30
|
-
"series4",
|
|
31
|
-
"series5",
|
|
32
|
-
"series6"
|
|
33
|
-
];
|
|
34
|
-
function d(e, t) {
|
|
35
|
-
return e ?? u[t % u.length] ?? "series1";
|
|
36
|
-
}
|
|
37
|
-
function f(e) {
|
|
38
|
-
if (e.length > l.items) return `Choose a window with at most ${l.items} items.`;
|
|
39
|
-
if (!r(e)) return "Every breakdown item needs a unique identifier.";
|
|
40
|
-
if (e.some((e) => e.value !== null && (!Number.isFinite(e.value) || e.value < 0))) return "Breakdown values must be finite and nonnegative, or explicitly missing.";
|
|
41
|
-
if (!Number.isFinite(e.reduce((e, t) => e + (t.value ?? 0), 0))) return "The sum of recorded values must be finite.";
|
|
42
|
-
}
|
|
43
|
-
function p({ items: r, selection: s }) {
|
|
44
|
-
return /* @__PURE__ */ a("ul", {
|
|
45
|
-
className: "xrvj5dj x1ghz6dp x1717udv xe8uvvx",
|
|
46
|
-
children: r.map((r) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ o(n, {
|
|
47
|
-
label: `${r.label}: ${r.valueLabel}`,
|
|
48
|
-
isSelected: s?.selectedId === r.id,
|
|
49
|
-
onSelect: s === void 0 ? void 0 : () => s.onSelect(r.id),
|
|
50
|
-
children: [/* @__PURE__ */ o("span", {
|
|
51
|
-
className: "x78zum5 x6s0dn4 x1hnptsi x1slnebi xeuugli",
|
|
52
|
-
children: [/* @__PURE__ */ a("span", {
|
|
53
|
-
"aria-hidden": !0,
|
|
54
|
-
...i.props(c.swatch(e[r.tone], t[r.tone]))
|
|
55
|
-
}), r.label]
|
|
56
|
-
}), /* @__PURE__ */ a("span", {
|
|
57
|
-
className: "x153jb6y xp4054r xeuugli x193iq5w",
|
|
58
|
-
children: r.valueLabel
|
|
59
|
-
})]
|
|
60
|
-
}) }, r.id))
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
export { f as i, l as n, d as r, p as t };
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./accessibility-P89UG9-r.js";
|
|
2
|
-
import * as t from "@stylexjs/stylex";
|
|
3
|
-
import { createParts as n } from "@ui-sdk/react/primitive";
|
|
4
|
-
import { useId as r, useState as i } from "react";
|
|
5
|
-
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
-
import { definePrimitive as s } from "@ui-sdk/core";
|
|
7
|
-
// packages/charts/src/chart-data.tsx
|
|
8
|
-
function c({ label: n, columns: r, rows: i }) {
|
|
9
|
-
return /* @__PURE__ */ a("div", {
|
|
10
|
-
...t.props(e.hidden),
|
|
11
|
-
children: /* @__PURE__ */ o("table", { children: [
|
|
12
|
-
/* @__PURE__ */ a("caption", { children: n }),
|
|
13
|
-
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ a("tr", { children: r.map((e) => /* @__PURE__ */ a("th", {
|
|
14
|
-
scope: "col",
|
|
15
|
-
children: e.label
|
|
16
|
-
}, e.id)) }) }),
|
|
17
|
-
/* @__PURE__ */ a("tbody", { children: i.map((e) => /* @__PURE__ */ a("tr", { children: r.map((t, n) => n === 0 ? /* @__PURE__ */ a("th", {
|
|
18
|
-
scope: "row",
|
|
19
|
-
children: e.values[n]
|
|
20
|
-
}, t.id) : /* @__PURE__ */ a("td", { children: e.values[n] }, t.id)) }, e.id)) })
|
|
21
|
-
] })
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
// packages/charts/src/chart-surface.tsx
|
|
25
|
-
var l = /* @__PURE__ */ new Set([" ", "Enter"]);
|
|
26
|
-
function u({ index: e, last: t, allowVerticalNavigation: n }) {
|
|
27
|
-
let r = Math.max(0, e - 1), i = Math.min(t, e + 1);
|
|
28
|
-
return {
|
|
29
|
-
Home: 0,
|
|
30
|
-
End: t,
|
|
31
|
-
ArrowLeft: r,
|
|
32
|
-
ArrowRight: i,
|
|
33
|
-
ArrowUp: n ? r : void 0,
|
|
34
|
-
ArrowDown: n ? i : void 0
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
function d({ index: e, last: t, columnCount: n }) {
|
|
38
|
-
let r = Math.max(0, e), i = r - r % n, a = Math.min(t, i + n - 1), o = r - n, s = r + n;
|
|
39
|
-
return {
|
|
40
|
-
Home: i,
|
|
41
|
-
End: a,
|
|
42
|
-
ArrowLeft: Math.max(i, r - 1),
|
|
43
|
-
ArrowRight: Math.min(a, r + 1),
|
|
44
|
-
ArrowUp: o < 0 ? r : o,
|
|
45
|
-
ArrowDown: s > t ? r : s
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
function f({ controls: e }) {
|
|
49
|
-
return {
|
|
50
|
-
value: e.inspected ?? null,
|
|
51
|
-
readout: e.readout ?? null,
|
|
52
|
-
selected: e.selected ?? null
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
var p = s({
|
|
56
|
-
name: "chart-inspection",
|
|
57
|
-
options: { controls: "value" },
|
|
58
|
-
state: f,
|
|
59
|
-
sync: f,
|
|
60
|
-
controlled: [
|
|
61
|
-
"value",
|
|
62
|
-
"readout",
|
|
63
|
-
"selected"
|
|
64
|
-
],
|
|
65
|
-
api: ({ options: e }) => {
|
|
66
|
-
function t(t) {
|
|
67
|
-
let { items: n, onInspect: r } = e().controls;
|
|
68
|
-
return n.some((e) => e.id === t) ? (r(t), !0) : !1;
|
|
69
|
-
}
|
|
70
|
-
function n(t) {
|
|
71
|
-
let { items: n, onSelect: r } = e().controls;
|
|
72
|
-
return r === void 0 || !n.some((e) => e.id === t) ? !1 : (r(t), !0);
|
|
73
|
-
}
|
|
74
|
-
function r(t) {
|
|
75
|
-
let { items: r, cursor: i, allowVerticalNavigation: a, onDismiss: o } = e().controls, s = t.altKey || t.ctrlKey || t.metaKey;
|
|
76
|
-
if (t.defaultPrevented || s || r.length === 0) return;
|
|
77
|
-
if (t.key === "Escape") {
|
|
78
|
-
t.preventDefault(), t.stopPropagation(), o();
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
if (l.has(t.key)) {
|
|
82
|
-
if (t.target instanceof Element && t.target.closest("button, a, input, select, textarea") !== null) return;
|
|
83
|
-
i !== void 0 && n(i) && t.preventDefault();
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
let c = r.findIndex((e) => e.id === i), f = r.length - 1, { columnCount: p } = e().controls, m = (p === void 0 || p < 1 ? u({
|
|
87
|
-
index: c,
|
|
88
|
-
last: f,
|
|
89
|
-
allowVerticalNavigation: a === !0
|
|
90
|
-
}) : d({
|
|
91
|
-
index: c,
|
|
92
|
-
last: f,
|
|
93
|
-
columnCount: p
|
|
94
|
-
}))[t.key], h = m === void 0 ? void 0 : r[m];
|
|
95
|
-
h !== void 0 && (t.preventDefault(), e().controls.onInspect(h.id));
|
|
96
|
-
}
|
|
97
|
-
return {
|
|
98
|
-
setValue: t,
|
|
99
|
-
get selectItem() {
|
|
100
|
-
return e().controls.onSelect === void 0 ? void 0 : n;
|
|
101
|
-
},
|
|
102
|
-
clear: () => e().controls.onDismiss(),
|
|
103
|
-
items: () => e().controls.items.map(({ id: e, label: t }) => ({
|
|
104
|
-
value: e,
|
|
105
|
-
label: t
|
|
106
|
-
})),
|
|
107
|
-
onKeyDown: r
|
|
108
|
-
};
|
|
109
|
-
},
|
|
110
|
-
slots: (e) => ({ root: e({ on: { keydown: (e, { api: t }) => t.onKeyDown(e) } }) }),
|
|
111
|
-
agent: {
|
|
112
|
-
items: (e) => e.items(),
|
|
113
|
-
closed: !0
|
|
114
|
-
}
|
|
115
|
-
}), m = n(p, { root: "div" }).Root, h = n(p, { root: "p" }).Root, g = n(p, { root: "svg" }).Root;
|
|
116
|
-
// packages/charts/src/chart-navigation.tsx
|
|
117
|
-
function _({ title: e, items: t, selection: n, columnCount: a }) {
|
|
118
|
-
let o = r(), [s, c] = i(void 0), [l, u] = i(!1), d = t[Math.max(0, t.findIndex((e) => e.id === (s ?? n?.selectedId)))];
|
|
119
|
-
function f(e) {
|
|
120
|
-
c(e), u(!0);
|
|
121
|
-
}
|
|
122
|
-
return {
|
|
123
|
-
id: o,
|
|
124
|
-
props: {
|
|
125
|
-
controls: {
|
|
126
|
-
items: t,
|
|
127
|
-
cursor: d?.id,
|
|
128
|
-
inspected: l ? d?.id : void 0,
|
|
129
|
-
readout: l ? d?.label : void 0,
|
|
130
|
-
selected: t.find((e) => e.id === n?.selectedId)?.id,
|
|
131
|
-
allowVerticalNavigation: !0,
|
|
132
|
-
columnCount: a,
|
|
133
|
-
onInspect: f,
|
|
134
|
-
onDismiss: () => u(!1),
|
|
135
|
-
onSelect: n?.onSelect
|
|
136
|
-
},
|
|
137
|
-
role: "group",
|
|
138
|
-
tabIndex: t.length > 0 ? 0 : void 0,
|
|
139
|
-
"aria-label": `${e}. Use arrow keys to inspect.${n === void 0 ? "" : " Press Enter to select."}`,
|
|
140
|
-
"aria-describedby": o,
|
|
141
|
-
onFocus: () => u(!0),
|
|
142
|
-
onBlur: (e) => {
|
|
143
|
-
e.currentTarget.contains(e.relatedTarget) || u(!1);
|
|
144
|
-
},
|
|
145
|
-
onPointerLeave: (e) => {
|
|
146
|
-
e.currentTarget.contains(document.activeElement) || u(!1);
|
|
147
|
-
}
|
|
148
|
-
},
|
|
149
|
-
activeId: d?.id,
|
|
150
|
-
label: l ? d?.label : void 0,
|
|
151
|
-
inspect: f
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
export { c as a, h as i, m as n, g as r, _ as t };
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import "@stylexjs/stylex";
|
|
2
|
-
// packages/foundations/src/header-styles.ts
|
|
3
|
-
var e = {
|
|
4
|
-
row: {
|
|
5
|
-
kB7OPa: "x9f619",
|
|
6
|
-
kVAEAm: "x1n2onr6",
|
|
7
|
-
k1xSpc: "x78zum5",
|
|
8
|
-
kGNEyG: "x6s0dn4",
|
|
9
|
-
kwnvtZ: "x1a02dak",
|
|
10
|
-
k7Eaqz: "xeuugli",
|
|
11
|
-
kAzted: "x1oec0jp",
|
|
12
|
-
kg3NbH: "x1dc62k6",
|
|
13
|
-
k8WAf4: "x1yrrsrt x1c526fk",
|
|
14
|
-
$$css: !0
|
|
15
|
-
},
|
|
16
|
-
reportRow: {
|
|
17
|
-
kAzted: "xca473s xmhh96",
|
|
18
|
-
k8WAf4: "x18fcflc x1c526fk",
|
|
19
|
-
$$css: !0
|
|
20
|
-
},
|
|
21
|
-
title: {
|
|
22
|
-
kUk6DE: "x12lumcd",
|
|
23
|
-
k7Eaqz: "xeuugli",
|
|
24
|
-
kogj98: "x1ghz6dp",
|
|
25
|
-
kHjlTd: "xj0a0fe",
|
|
26
|
-
kGuDYH: "x12myhf4",
|
|
27
|
-
k63SB2: "xk4h15q",
|
|
28
|
-
kLWn49: "x1778rvt",
|
|
29
|
-
$$css: !0
|
|
30
|
-
},
|
|
31
|
-
trailing: {
|
|
32
|
-
k1xSpc: "x78zum5",
|
|
33
|
-
kwnvtZ: "x1a02dak",
|
|
34
|
-
kGNEyG: "x6s0dn4",
|
|
35
|
-
kOIVth: "x1n8ia3y",
|
|
36
|
-
keTefX: "xvc5jky",
|
|
37
|
-
k7Eaqz: "xeuugli",
|
|
38
|
-
ks0D6T: "x193iq5w",
|
|
39
|
-
$$css: !0
|
|
40
|
-
},
|
|
41
|
-
meta: {
|
|
42
|
-
k7Eaqz: "xeuugli",
|
|
43
|
-
keTefX: "xvc5jky",
|
|
44
|
-
kHjlTd: "xj0a0fe",
|
|
45
|
-
kMwMTN: "x153jb6y",
|
|
46
|
-
kGuDYH: "xy8obcc",
|
|
47
|
-
kLWn49: "xas2l8k",
|
|
48
|
-
$$css: !0
|
|
49
|
-
},
|
|
50
|
-
actions: {
|
|
51
|
-
k1xSpc: "x78zum5",
|
|
52
|
-
kGNEyG: "x6s0dn4",
|
|
53
|
-
kwnvtZ: "x1a02dak",
|
|
54
|
-
kOIVth: "x1hnptsi",
|
|
55
|
-
k7Eaqz: "xeuugli",
|
|
56
|
-
ks0D6T: "x193iq5w",
|
|
57
|
-
$$css: !0
|
|
58
|
-
},
|
|
59
|
-
blockEnd: {
|
|
60
|
-
k5JduY: "x1s928wv",
|
|
61
|
-
kwXMNM: "x1j6awrg",
|
|
62
|
-
kcktkL: "xb7ltuz",
|
|
63
|
-
k8Iv0R: "x1xrz1ek",
|
|
64
|
-
k4zj60: "xcock1l",
|
|
65
|
-
ks3ayO: "xtccgxd",
|
|
66
|
-
kloYau: "x2q1x1w",
|
|
67
|
-
$$css: !0
|
|
68
|
-
},
|
|
69
|
-
blockStart: {
|
|
70
|
-
k5JduY: "x1s928wv",
|
|
71
|
-
kwXMNM: "x1j6awrg",
|
|
72
|
-
kcktkL: "xb7ltuz",
|
|
73
|
-
k3foIR: "x1m1drc7",
|
|
74
|
-
k4zj60: "xcock1l",
|
|
75
|
-
ks3ayO: "xtccgxd",
|
|
76
|
-
kloYau: "x2q1x1w",
|
|
77
|
-
$$css: !0
|
|
78
|
-
},
|
|
79
|
-
inlineEnd: {
|
|
80
|
-
k5JduY: "x1s928wv",
|
|
81
|
-
kwXMNM: "x1j6awrg",
|
|
82
|
-
kSy8m5: "xd54j2p",
|
|
83
|
-
kH8aOt: "x1unh1gc",
|
|
84
|
-
kkgrvl: "xv6d0c5",
|
|
85
|
-
ks3ayO: "xtccgxd",
|
|
86
|
-
kloYau: "x2q1x1w",
|
|
87
|
-
$$css: !0
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
export { e as t };
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { ChartSelection } from './chart-frame.tsx';
|
|
2
|
-
type ChartNavigationItem = {
|
|
3
|
-
readonly id: string;
|
|
4
|
-
readonly label: string;
|
|
5
|
-
};
|
|
6
|
-
type ChartNavigationInput = {
|
|
7
|
-
readonly title: string;
|
|
8
|
-
readonly items: ReadonlyArray<ChartNavigationItem>;
|
|
9
|
-
readonly selection: ChartSelection | undefined;
|
|
10
|
-
readonly columnCount?: number | undefined;
|
|
11
|
-
};
|
|
12
|
-
export declare function useChartNavigation({ title, items, selection, columnCount }: ChartNavigationInput): {
|
|
13
|
-
id: string;
|
|
14
|
-
props: {
|
|
15
|
-
controls: {
|
|
16
|
-
items: readonly ChartNavigationItem[];
|
|
17
|
-
cursor: string | undefined;
|
|
18
|
-
inspected: string | undefined;
|
|
19
|
-
readout: string | undefined;
|
|
20
|
-
selected: string | undefined;
|
|
21
|
-
allowVerticalNavigation: true;
|
|
22
|
-
columnCount: number | undefined;
|
|
23
|
-
onInspect: (itemId: string) => void;
|
|
24
|
-
onDismiss: () => void;
|
|
25
|
-
onSelect: ((id: string) => void) | undefined;
|
|
26
|
-
};
|
|
27
|
-
role: "group";
|
|
28
|
-
tabIndex: number | undefined;
|
|
29
|
-
'aria-label': string;
|
|
30
|
-
'aria-describedby': string;
|
|
31
|
-
onFocus: () => void;
|
|
32
|
-
onBlur: (event: import("react").FocusEvent<HTMLElement, Element>) => void;
|
|
33
|
-
onPointerLeave: (event: import("react").PointerEvent<HTMLElement>) => void;
|
|
34
|
-
};
|
|
35
|
-
activeId: string | undefined;
|
|
36
|
-
label: string | undefined;
|
|
37
|
-
inspect: (itemId: string) => void;
|
|
38
|
-
};
|
|
39
|
-
export {};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { PartProps } from '@ui-sdk/react/primitive';
|
|
2
|
-
import type { ReactNode } from 'react';
|
|
3
|
-
type ChartItem = {
|
|
4
|
-
readonly id: string;
|
|
5
|
-
readonly label: string;
|
|
6
|
-
};
|
|
7
|
-
export type ChartControls = {
|
|
8
|
-
readonly items: ReadonlyArray<ChartItem>;
|
|
9
|
-
readonly cursor: string | undefined;
|
|
10
|
-
readonly inspected: string | undefined;
|
|
11
|
-
readonly readout: string | undefined;
|
|
12
|
-
readonly selected?: string | undefined;
|
|
13
|
-
readonly allowVerticalNavigation?: boolean;
|
|
14
|
-
/** Arranges the items row by row in a grid of this width. Up and Down change rows; Home and End stay in the row. */
|
|
15
|
-
readonly columnCount?: number | undefined;
|
|
16
|
-
readonly onInspect: (id: string) => void;
|
|
17
|
-
readonly onDismiss: () => void;
|
|
18
|
-
readonly onSelect?: ((id: string) => void) | undefined;
|
|
19
|
-
};
|
|
20
|
-
type ChartRoot<Tag extends 'div' | 'p' | 'svg'> = (props: Omit<PartProps<Tag>, 'id' | 'controls'> & {
|
|
21
|
-
id?: string;
|
|
22
|
-
controls: ChartControls;
|
|
23
|
-
}) => ReactNode;
|
|
24
|
-
export declare const ChartSurface: ChartRoot<'div'>;
|
|
25
|
-
export declare const ChartTextSurface: ChartRoot<'p'>;
|
|
26
|
-
export declare const ChartSvgSurface: ChartRoot<'svg'>;
|
|
27
|
-
export {};
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import "@stylexjs/stylex";
|
|
2
|
-
import { useEffect as e, useState as t } from "react";
|
|
3
|
-
// packages/charts/src/chart-theme.ts
|
|
4
|
-
var n = {
|
|
5
|
-
plot: {
|
|
6
|
-
k7Eaqz: "xeuugli",
|
|
7
|
-
kVQacm: "xb3r6kr",
|
|
8
|
-
$$css: !0
|
|
9
|
-
},
|
|
10
|
-
svg: {
|
|
11
|
-
k1xSpc: "x1lliihq",
|
|
12
|
-
kzqmXN: "xh8yej3",
|
|
13
|
-
kVQacm: "x1rea2x4",
|
|
14
|
-
$$css: !0
|
|
15
|
-
},
|
|
16
|
-
axis: {
|
|
17
|
-
kjVXCG: "x17y187c",
|
|
18
|
-
kfJifR: "xnpr05h",
|
|
19
|
-
kREpy8: "x13efnbd",
|
|
20
|
-
$$css: !0
|
|
21
|
-
},
|
|
22
|
-
grid: {
|
|
23
|
-
kjVXCG: "x13hfdr1",
|
|
24
|
-
kfJifR: "xnpr05h",
|
|
25
|
-
kREpy8: "x13efnbd",
|
|
26
|
-
$$css: !0
|
|
27
|
-
},
|
|
28
|
-
baseline: {
|
|
29
|
-
kjVXCG: "x17y187c",
|
|
30
|
-
kfJifR: "xnpr05h",
|
|
31
|
-
kREpy8: "x13efnbd",
|
|
32
|
-
$$css: !0
|
|
33
|
-
},
|
|
34
|
-
label: {
|
|
35
|
-
kDwRjp: "xlrhuyr",
|
|
36
|
-
kMv6JI: "x1hz01jw",
|
|
37
|
-
kGuDYH: "xy8obcc",
|
|
38
|
-
k63SB2: "xj57cvi",
|
|
39
|
-
kcqcaj: "xss6m8b",
|
|
40
|
-
$$css: !0
|
|
41
|
-
},
|
|
42
|
-
tick: {
|
|
43
|
-
kMv6JI: "xiard35",
|
|
44
|
-
$$css: !0
|
|
45
|
-
},
|
|
46
|
-
strongLabel: {
|
|
47
|
-
kDwRjp: "xlrhuyr",
|
|
48
|
-
k63SB2: "xk4h15q",
|
|
49
|
-
$$css: !0
|
|
50
|
-
},
|
|
51
|
-
haloLabel: {
|
|
52
|
-
kCrYw0: "x1x0jnz8",
|
|
53
|
-
kjVXCG: "xaep1og",
|
|
54
|
-
kfJifR: "xqjr0vm",
|
|
55
|
-
kJdQPc: "x1f6yumg",
|
|
56
|
-
$$css: !0
|
|
57
|
-
},
|
|
58
|
-
mark: {
|
|
59
|
-
kfJifR: "x1pvypsb",
|
|
60
|
-
kU5bRw: "x1owpc8m",
|
|
61
|
-
kJdQPc: "x1f6yumg",
|
|
62
|
-
kREpy8: "x13efnbd",
|
|
63
|
-
$$css: !0
|
|
64
|
-
},
|
|
65
|
-
outlined: {
|
|
66
|
-
kfJifR: "xnpr05h",
|
|
67
|
-
kREpy8: "x13efnbd",
|
|
68
|
-
$$css: !0
|
|
69
|
-
},
|
|
70
|
-
selected: {
|
|
71
|
-
kjVXCG: "x17y187c",
|
|
72
|
-
kfJifR: "xvlca1e",
|
|
73
|
-
kREpy8: "x13efnbd",
|
|
74
|
-
$$css: !0
|
|
75
|
-
},
|
|
76
|
-
inspectable: {
|
|
77
|
-
k3XXqK: "x1t137rt",
|
|
78
|
-
$$css: !0
|
|
79
|
-
},
|
|
80
|
-
emphasis: {
|
|
81
|
-
k1ekBW: "x19991ni",
|
|
82
|
-
kIyJzY: "xtitasy x12w9bfk",
|
|
83
|
-
kAMwcw: "x1faw7qm",
|
|
84
|
-
$$css: !0
|
|
85
|
-
},
|
|
86
|
-
receded: {
|
|
87
|
-
kSiTet: "xk8c4ds",
|
|
88
|
-
$$css: !0
|
|
89
|
-
}
|
|
90
|
-
}, r = 640;
|
|
91
|
-
function i() {
|
|
92
|
-
let [n, i] = t(null), [a, o] = t(r);
|
|
93
|
-
return e(() => {
|
|
94
|
-
if (n === null) return;
|
|
95
|
-
let e = new ResizeObserver(([e]) => {
|
|
96
|
-
e !== void 0 && e.contentRect.width > 0 && o(e.contentRect.width);
|
|
97
|
-
});
|
|
98
|
-
return e.observe(n), () => e.disconnect();
|
|
99
|
-
}, [n]), {
|
|
100
|
-
ref: i,
|
|
101
|
-
width: a,
|
|
102
|
-
element: n
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
export { n, i as t };
|