@mechane-ai/elements 0.20.0 → 0.21.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 (33) hide show
  1. package/README.md +11 -5
  2. package/dist/{categorical-values-Cf-zlA1u.js → categorical-values-DG0kzYxN.js} +2 -2
  3. package/dist/{chart-frame-Cf6LBA8M.js → chart-frame-DxAZ0h_q.js} +49 -50
  4. package/dist/{chart-input-BTDzeBQU.js → chart-input-Dru0GScv.js} +1 -1
  5. package/dist/charts/cartesian.js +276 -226
  6. package/dist/charts/distribution.js +2 -2
  7. package/dist/charts/graph.js +82 -80
  8. package/dist/charts/hierarchy.js +3 -3
  9. package/dist/charts/matrix.js +136 -134
  10. package/dist/charts/timeline.js +1 -1
  11. package/dist/charts.js +1 -1
  12. package/dist/code-block-DlUwVaPP.js +182 -0
  13. package/dist/collections.js +227 -117
  14. package/dist/content/code.js +1 -1
  15. package/dist/content/diff.js +2 -2
  16. package/dist/content/markdown.js +108 -102
  17. package/dist/content/tree.js +41 -39
  18. package/dist/content.js +138 -136
  19. package/dist/elements.css +42 -0
  20. package/dist/layout.js +212 -203
  21. package/dist/navigation.js +0 -1
  22. package/dist/packages/charts/src/chart-cursor.d.ts +7 -0
  23. package/dist/packages/charts/src/chart-theme.d.ts +1 -7
  24. package/dist/packages/collections/src/index.d.ts +1 -0
  25. package/dist/packages/collections/src/metrics.d.ts +64 -5
  26. package/dist/packages/foundations/src/use-scroll-tab-index.d.ts +6 -0
  27. package/dist/packages/layout/src/index.d.ts +2 -0
  28. package/dist/packages/layout/src/report-section.d.ts +6 -0
  29. package/dist/pierre-diff-CHQsoQSZ.js +72 -0
  30. package/dist/use-scroll-tab-index-Dxpdh4W7.js +45 -0
  31. package/package.json +1 -1
  32. package/dist/code-block-D1_kzPrs.js +0 -180
  33. package/dist/pierre-diff-hAwARDse.js +0 -71
package/README.md CHANGED
@@ -110,7 +110,10 @@ Navigation closes the mobile drawer and preserves focus set by the destination.
110
110
  inactive content mounted and measurable but removes it from keyboard and assistive-technology navigation. The
111
111
  application owns which view is active and when to unmount it; use this for a draft or reading position that must survive
112
112
  inspection. `WorkbenchScroll` requires an accessible `label`; its `isFlush` mode leaves list insets to the table. Its
113
- `scrollRestorationId` identifies the actual scroll region for application-owned restoration.
113
+ `scrollRestorationId` identifies the actual scroll region for application-owned restoration. Layout wrappers leave
114
+ sequential keyboard navigation to their controls. Tables and viewers add a named scroll stop when overflow needs one.
115
+ Interactive Cartesian charts have one Tab stop, a local datum cursor, and arrow-key inspection. Enter or Space activates
116
+ supplied selection; Escape dismisses details while retaining the cursor.
114
117
 
115
118
  `Workbench` accepts an optional `inspector={{ label: 'Workspace', content: <WorkspaceFiles /> }}`. The application
116
119
  supplies the accessible name with the panel content and owns opening, closing, and focus restoration. The inspector
@@ -139,10 +142,13 @@ acknowledgement, and draft retention.
139
142
  record and store named choices rather than catalog indexes. Identity palettes remain separate from status colors.
140
143
 
141
144
  `MetricGrid layout="columns"` distributes supplied metrics by available container width. Its inline layout suits compact
142
- record summaries. `PageContent` owns report insets and section gaps; keep full-width tables outside it so their cell
143
- insets remain the only gutter. `SettingsSection` keeps wide tables inside their scroll region, and `SettingsRow` aligns
144
- labels and controls. `FormActions` owns submission rows and their internal spacing. The enclosing section owns the gap
145
- before and after the actions.
145
+ record summaries. `Metric` offers `statistic` and `headline` variants, a concise `detail`, and a passive `trend` slot.
146
+ Use `isLoading` and `hasDetail` to reserve its value and qualification while the application loads data. `ReportSection`
147
+ takes a `summary` element and a chart as its child, placing the number above the full-width chart that explains it. The
148
+ application supplies the measure, period, formatting, coverage and read state. `PageContent` owns report insets and
149
+ section gaps; keep full-width tables outside it so their cell insets remain the only gutter. `SettingsSection` keeps
150
+ wide tables inside their scroll region, and `SettingsRow` aligns labels and controls. `FormActions` owns submission rows
151
+ and their internal spacing. The enclosing section owns the gap before and after the actions.
146
152
 
147
153
  The default theme is light, with system fonts and a compact spacing scale. Import `themeProps` from
148
154
  `@mechane-ai/elements/theme` and spread `themeProps.light` or `themeProps.dark` onto the document root. Portaled content
@@ -1,5 +1,5 @@
1
- import { n as e, s as t } from "./chart-frame-Cf6LBA8M.js";
2
- import { n } from "./chart-input-BTDzeBQU.js";
1
+ import { n as e, s as t } from "./chart-frame-DxAZ0h_q.js";
2
+ import { n } from "./chart-input-Dru0GScv.js";
3
3
  import * as r from "@stylexjs/stylex";
4
4
  import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
5
  // packages/charts/src/categorical-values.tsx
@@ -1,20 +1,21 @@
1
1
  import { g as e } from "./src-qU5Z5LRH.js";
2
- import { n as t, r as n } from "./tokens.stylex-DTHHFbyl.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";
2
+ import { t } from "./use-scroll-tab-index-Dxpdh4W7.js";
3
+ import { n, r } from "./tokens.stylex-DTHHFbyl.js";
4
+ import * as i from "@stylexjs/stylex";
5
+ import { useId as a } from "react";
6
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
6
7
  // packages/charts/src/chart-theme.ts
7
- var s = {
8
- series1: t.series1,
9
- series2: t.series2,
10
- series3: t.series3,
11
- series4: t.series4,
12
- series5: t.series5,
13
- series6: t.series6,
14
- positive: t.positive,
15
- negative: t.negative,
16
- neutral: n.muted
17
- }, c = {
8
+ var c = {
9
+ series1: n.series1,
10
+ series2: n.series2,
11
+ series3: n.series3,
12
+ series4: n.series4,
13
+ series5: n.series5,
14
+ series6: n.series6,
15
+ positive: n.positive,
16
+ negative: n.negative,
17
+ neutral: r.muted
18
+ }, l = {
18
19
  plot: {
19
20
  k7Eaqz: "xeuugli",
20
21
  kVQacm: "xb3r6kr",
@@ -58,82 +59,78 @@ var s = {
58
59
  kREpy8: "x13efnbd",
59
60
  $$css: !0
60
61
  },
61
- focus: {
62
+ inspectable: {
62
63
  k3XXqK: "x1t137rt",
63
- kZs9gx: "x19rmrnh",
64
- k7shQP: "x9v5kkp",
65
- kPJHz1: "x13qnu6",
66
- kiEn40: "x17c0hmk",
67
64
  $$css: !0
68
65
  }
69
- }, l = {
66
+ }, u = {
70
67
  kzqmXN: "x1xc55vz",
71
68
  kZKoxP: "xdk7pt",
72
69
  kmuXW: "x2lah0s",
73
70
  $$css: !0
74
- }, u = { swatch: (e) => [
75
- l,
71
+ }, d = { swatch: (e) => [
72
+ u,
76
73
  {
77
74
  kWkggS: e == null ? e : "xl8spv7",
78
75
  $$css: !0
79
76
  },
80
77
  { "--x-backgroundColor": e ?? void 0 }
81
78
  ] };
82
- function d({ title: e, description: t, children: n, actions: r, footer: s }) {
83
- let c = i();
84
- return /* @__PURE__ */ o("figure", {
79
+ function f({ title: e, description: t, children: n, actions: r, footer: i }) {
80
+ let c = a();
81
+ return /* @__PURE__ */ s("figure", {
85
82
  "aria-labelledby": c,
86
83
  className: "xeuugli x1ghz6dp xbixft xpvm0e4 x1hz01jw xtqrqnz xj57cvi x1778rvt",
87
84
  children: [
88
- /* @__PURE__ */ o("figcaption", {
85
+ /* @__PURE__ */ s("figcaption", {
89
86
  className: "x78zum5 x1a02dak x1qughib x7a106z x1n8ia3y x1wv5www",
90
- children: [/* @__PURE__ */ o("div", {
87
+ children: [/* @__PURE__ */ s("div", {
91
88
  className: "x1iv9x3n xeuugli xj0a0fe",
92
- children: [/* @__PURE__ */ a("p", {
89
+ children: [/* @__PURE__ */ o("p", {
93
90
  id: c,
94
91
  className: "x1ghz6dp x12myhf4 x1778rvt xk4h15q",
95
92
  children: e
96
- }), t !== void 0 && /* @__PURE__ */ a("p", {
93
+ }), t !== void 0 && /* @__PURE__ */ o("p", {
97
94
  className: "x1ghz6dp x1c87qhr x153jb6y xy8obcc xas2l8k",
98
95
  children: t
99
96
  })]
100
- }), r !== void 0 && /* @__PURE__ */ a("div", {
97
+ }), r !== void 0 && /* @__PURE__ */ o("div", {
101
98
  className: "x78zum5 x1a02dak x1hnptsi x193iq5w",
102
99
  children: r
103
100
  })]
104
101
  }),
105
102
  n,
106
- s !== void 0 && /* @__PURE__ */ a("div", {
103
+ i !== void 0 && /* @__PURE__ */ o("div", {
107
104
  className: "x1xxf3xd xeuugli x153jb6y xy8obcc xas2l8k xj0a0fe",
108
- children: s
105
+ children: i
109
106
  })
110
107
  ]
111
108
  });
112
109
  }
113
- function f({ items: e, label: t = "Legend", isScrollable: n = !1 }) {
114
- return /* @__PURE__ */ a("ul", {
110
+ function p({ items: e, label: t = "Legend", isScrollable: n = !1 }) {
111
+ return /* @__PURE__ */ o("ul", {
115
112
  "aria-label": t,
116
113
  ...{
117
114
  0: { className: "x78zum5 x1a02dak x8zbtdt x1gkm1c7 xe8uvvx x1ghz6dp x1717udv x153jb6y x1hz01jw xy8obcc xas2l8k" },
118
115
  1: { className: "x78zum5 x8zbtdt x1gkm1c7 xe8uvvx x1ghz6dp x1717udv x153jb6y x1hz01jw xy8obcc xas2l8k xozqiw3 xw2csxc x1mqbd49" }
119
116
  }[!!n | 0],
120
- children: e.map((e) => /* @__PURE__ */ o("li", {
117
+ children: e.map((e) => /* @__PURE__ */ s("li", {
121
118
  ...{
122
119
  0: { className: "x3nfvp2 x6s0dn4 xunmzkg xeuugli x193iq5w xj0a0fe" },
123
120
  1: { className: "x3nfvp2 x6s0dn4 xunmzkg xeuugli xj0a0fe x2lah0s x1x1rfll xuxw1ft" }
124
121
  }[!!n | 0],
125
- children: [/* @__PURE__ */ a("span", {
122
+ children: [/* @__PURE__ */ o("span", {
126
123
  "aria-hidden": !0,
127
- ...r.props(u.swatch(s[e.tone]))
124
+ ...i.props(d.swatch(c[e.tone]))
128
125
  }), e.label]
129
126
  }, e.id))
130
127
  });
131
128
  }
132
- function p({ label: e, isSelected: t = !1, onSelect: n, children: r }) {
133
- return n === void 0 ? /* @__PURE__ */ a("div", {
129
+ function m({ label: e, isSelected: t = !1, onSelect: n, children: r }) {
130
+ return n === void 0 ? /* @__PURE__ */ o("div", {
134
131
  className: "x78zum5 x1a02dak x6s0dn4 x1qughib x8zbtdt x1gkm1c7 xeuugli x17tes2r x17oiadl x9f619 xh8yej3 xc342km x1hmw7ec x5g2kb4 x1hz01jw xtqrqnz xj57cvi x1778rvt x1yc453h xj0a0fe xbixft xpvm0e4 xss6m8b",
135
132
  children: r
136
- }) : /* @__PURE__ */ a("button", {
133
+ }) : /* @__PURE__ */ o("button", {
137
134
  type: "button",
138
135
  "aria-label": e,
139
136
  "aria-pressed": t,
@@ -145,23 +142,25 @@ function p({ label: e, isSelected: t = !1, onSelect: n, children: r }) {
145
142
  children: r
146
143
  });
147
144
  }
148
- function m({ children: e }) {
149
- return /* @__PURE__ */ a("p", {
145
+ function h({ children: e }) {
146
+ return /* @__PURE__ */ o("p", {
150
147
  "aria-live": "polite",
151
148
  className: "x1ghz6dp xeuugli x1mqbd49 xbixft xy8obcc xas2l8k xss6m8b xj0a0fe",
152
149
  children: e
153
150
  });
154
151
  }
155
- function h({ children: t, label: n = "View data" }) {
156
- return /* @__PURE__ */ a("div", {
152
+ function g({ children: n, label: r = "View data" }) {
153
+ let i = t();
154
+ return /* @__PURE__ */ o("div", {
157
155
  className: "x1xxf3xd x178xt8z x13fuv20 xhjagg4",
158
- children: /* @__PURE__ */ o(e.Root, { children: [/* @__PURE__ */ a(e.Trigger, { children: n }), /* @__PURE__ */ a(e.Panel, { children: /* @__PURE__ */ a("div", {
156
+ children: /* @__PURE__ */ s(e.Root, { children: [/* @__PURE__ */ o(e.Trigger, { children: r }), /* @__PURE__ */ o(e.Panel, { children: /* @__PURE__ */ o("div", {
157
+ ref: i.ref,
159
158
  role: "region",
160
- "aria-label": n,
161
- tabIndex: 0,
159
+ "aria-label": r,
160
+ tabIndex: i.tabIndex,
162
161
  className: "xeuugli x1sslpiy xysyzu8 x1t137rt x19rmrnh x9v5kkp x13qnu6 x1bqaal",
163
- children: t
162
+ children: n
164
163
  }) })] })
165
164
  });
166
165
  }
167
- export { m as a, f as i, p as n, c as o, d as r, s, h as t };
166
+ export { h as a, p as i, m as n, l as o, f as r, c as s, g as t };
@@ -1,5 +1,5 @@
1
1
  import { m as e } from "./src-0mocxTaR.js";
2
- import { r as t } from "./chart-frame-Cf6LBA8M.js";
2
+ import { r as t } from "./chart-frame-DxAZ0h_q.js";
3
3
  import { jsx as n } from "react/jsx-runtime";
4
4
  // packages/charts/src/chart-input.tsx
5
5
  function r(e) {