@mechane-ai/elements 0.38.0 → 0.39.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 CHANGED
@@ -4,6 +4,15 @@ React components for applications, AI interfaces, and analytical graphics. Eleme
4
4
  surfaces, shared visual tokens, and accessible interactions. Mechane's Console consumes the same package. Components
5
5
  receive values and callbacks; applications own routing, data, identity, and persistence.
6
6
 
7
+ ## Workspace implementation guides
8
+
9
+ - [Workspace layout](skills/elements-workspace/SKILL.md) covers shell lifetime, full-width reports, task navigation and
10
+ toolbar geometry.
11
+ - [Loading and chart interaction](skills/elements-presentation/SKILL.md) covers coordinated route transitions, delayed
12
+ skeletons and pointer and keyboard inspection.
13
+
14
+ The guides are included under `skills/` in the package.
15
+
7
16
  ## Install
8
17
 
9
18
  Install [Elements from npm](https://www.npmjs.com/package/@mechane-ai/elements). React and React DOM are peer
@@ -90,9 +99,9 @@ input limits, and readable fallbacks.
90
99
 
91
100
  Choose the
92
101
  [containing task and layout](https://github.com/mechane-ai/mechane/blob/main/workspaces/core/docs/visual-system.md#composition-decisions)
93
- before adding a surface. Stack related page sections. `PageContent` insets content, `ReportContent` combines inset
94
- content with full-width finite rows, and `CollectionLayout` gives a primary collection its available height. Dialogs,
95
- inspectors and structured message Cards retain their own containing width. `Panel` bounds an independent unit.
102
+ before adding a surface. Stack related page sections. `PageContent` insets content, `PageSection` combines inset content
103
+ with full-width finite rows, and `CollectionLayout` gives a primary collection its available height. Dialogs, inspectors
104
+ and structured message Cards retain their own containing width. `Panel` bounds an independent unit.
96
105
 
97
106
  Use Base UI's `render` composition and named variants for appearance. Native attributes, events, and refs remain
98
107
  available. Typed `xstyle` inputs permit placement styles compiled by the application's StyleX setup. Applications own
@@ -111,6 +120,13 @@ initials or photo trigger. Applications supply selection, URLs, native link hand
111
120
  rail for a sidebar that collapses to page icons. `SidebarFooter layout="navigation"` holds persistent controls in the
112
121
  contextual sidebar and reserves their intrinsic height while its pages scroll independently.
113
122
 
123
+ Use `PageLayout` for a screen. Give it the page title, actions, and optional `navigation` with the destination links,
124
+ selected ID, and view actions. The toolbar and navigation keep their natural height above the scrolling body. Wrap each
125
+ report section's heading and content together in a sibling `PageSection`. Its heading stays visible until the next
126
+ section arrives. On a short viewport the body prioritizes reading space. Use `RecordPage.Layout` for a record with a
127
+ back link and optional route navigation. A bounded table or workbench can fill the page body and scroll its own rows or
128
+ panes. Set `scrollRestorationId` when the router restores a named page body.
129
+
114
130
  `PageNavigation` uses real destination links; `Tabs` switches associated local panels with keyboard tab semantics. Both
115
131
  share the same typography, height, inset and selected indicator. Supply view controls through `PageNavigation.actions`
116
132
  so the links keep their own scroll region. Do not wrap page navigation in another padded collection toolbar. A
@@ -169,14 +185,14 @@ Use a chart's `report` input for a self-contained analytical report with a compa
169
185
  summary choices, scoped actions and matching placeholders, with links to the maintained examples. Embedded charts use
170
186
  their ordinary frame within the containing region. The application owns periods, aggregates, coverage and read state.
171
187
 
172
- Keep full-width tables outside `PageContent` so their cell insets remain the only gutter. `ReportContent` owns the inset
188
+ Keep full-width tables outside `PageContent` so their cell insets remain the only gutter. `PageSection` owns the inset
173
189
  for its optional `summary` and leaves its `breakdown` full width. Pass summary content directly; omit it when a section
174
190
  contains only rows. Absent, `null` and `false` summaries reserve no empty space. `ContentTabs` uses `defaultSelectedId`
175
- for an initial local choice or `navigation` for application-controlled links; the two modes are mutually exclusive.
176
- `SettingsSection` keeps wide tables inside their scroll region, and `SettingsRow` aligns labels and controls. Use
177
- `isPlaceholder` on a decorative row without a control ID; ready rows require a real `controlId` for their label.
178
- `FormActions` owns submission rows and their internal spacing. The enclosing section owns the gap before and after the
179
- actions.
191
+ for an initial local choice. Give shareable views real links in the navigation slot on `PageLayout` or
192
+ `RecordPage.Layout`. `SettingsSection` keeps wide tables inside their scroll region, and `SettingsRow` aligns labels and
193
+ controls. Use `isPlaceholder` on a decorative row without a control ID; ready rows require a real `controlId` for their
194
+ label. `FormActions` owns submission rows and their internal spacing. The enclosing section owns the gap before and
195
+ after the actions.
180
196
 
181
197
  Elements 0.29 removes `ReportSection`. Move its metric summary into the explanatory chart's `report.summary` or
182
198
  `report.seriesValues`. Use ordinary `Stack` composition when content already belongs to an existing region.
@@ -6,7 +6,7 @@ import { n as f, r as p, t as m } from "../chart-input-DwAobO8Y.js";
6
6
  import { r as h } from "../tokens.stylex-CJbIDPB9.js";
7
7
  import { n as g, t as ee } from "../plot-width-BQQS-mw9.js";
8
8
  import { D as _ } from "../src-C-Sx37kz.js";
9
- import { m as v } from "../src-CoFxE4Cj.js";
9
+ import { m as v } from "../src-DPRmO-JY.js";
10
10
  import * as y from "@stylexjs/stylex";
11
11
  import { useEffect as te, useId as b, useMemo as ne, useRef as x, useState as S } from "react";
12
12
  import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
@@ -1,5 +1,5 @@
1
1
  import { T as e, _ as t, c as n, i as r, p as i, w as a } from "./src-C-Sx37kz.js";
2
- import { r as o } from "./src-CoFxE4Cj.js";
2
+ import { r as o } from "./src-DPRmO-JY.js";
3
3
  import { t as s } from "./header-styles-COxCYFZx.js";
4
4
  import { i as c, r as l, t as u } from "./src-d7EAi61b.js";
5
5
  import { f as d } from "./src-nkgFDl-g.js";
package/dist/elements.css CHANGED
@@ -276,10 +276,6 @@ html[dir=ltr],[data-sonner-toaster][dir=ltr]{--toast-icon-margin-start:-3px;--to
276
276
  padding: var(--x1xijsos);
277
277
  }
278
278
 
279
- .xlsiant {
280
- padding: var(--xjighox);
281
- }
282
-
283
279
  .xg7ukam {
284
280
  padding: var(--xnv5ly4);
285
281
  }
@@ -1070,6 +1066,10 @@ html[dir=ltr],[data-sonner-toaster][dir=ltr]{--toast-icon-margin-start:-3px;--to
1070
1066
  container-name: inspector;
1071
1067
  }
1072
1068
 
1069
+ .x78161z {
1070
+ container-name: page-body;
1071
+ }
1072
+
1073
1073
  .x180ayaa {
1074
1074
  container-name: setting;
1075
1075
  }
@@ -1086,6 +1086,10 @@ html[dir=ltr],[data-sonner-toaster][dir=ltr]{--toast-icon-margin-start:-3px;--to
1086
1086
  container-type: inline-size;
1087
1087
  }
1088
1088
 
1089
+ .xpqogu8 {
1090
+ container-type: size;
1091
+ }
1092
+
1089
1093
  .xsid9ct {
1090
1094
  cursor: crosshair;
1091
1095
  }
@@ -1346,6 +1350,10 @@ html[dir=ltr],[data-sonner-toaster][dir=ltr]{--toast-icon-margin-start:-3px;--to
1346
1350
  grid-template-columns: var(--x1ud0cvw) minmax(0,1fr);
1347
1351
  }
1348
1352
 
1353
+ .x16p6thf {
1354
+ grid-template-rows: auto minmax(0, 1fr);
1355
+ }
1356
+
1349
1357
  .x1b86y6l {
1350
1358
  inset-inline-end: var(--x1xijsos);
1351
1359
  }
@@ -1474,10 +1482,18 @@ html[dir=ltr],[data-sonner-toaster][dir=ltr]{--toast-icon-margin-start:-3px;--to
1474
1482
  outline-color: var(--x169lqhw);
1475
1483
  }
1476
1484
 
1485
+ .x17owej5 {
1486
+ outline-color: var(--xe11pje);
1487
+ }
1488
+
1477
1489
  .xx9gdjd {
1478
1490
  outline-color: var(--xzqn2nu);
1479
1491
  }
1480
1492
 
1493
+ .x1g40iwv {
1494
+ outline-offset: -1px;
1495
+ }
1496
+
1481
1497
  .x2ssjo2 {
1482
1498
  outline-offset: -2px;
1483
1499
  }
@@ -1506,6 +1522,10 @@ html[dir=ltr],[data-sonner-toaster][dir=ltr]{--toast-icon-margin-start:-3px;--to
1506
1522
  outline-width: 0;
1507
1523
  }
1508
1524
 
1525
+ .x1qgsegg {
1526
+ outline-width: 1px;
1527
+ }
1528
+
1509
1529
  .x12ei19c {
1510
1530
  outline-width: var(--xxx3t85);
1511
1531
  }
@@ -1574,6 +1594,10 @@ html[dir=ltr],[data-sonner-toaster][dir=ltr]{--toast-icon-margin-start:-3px;--to
1574
1594
  position: relative;
1575
1595
  }
1576
1596
 
1597
+ .x1uhb9sk {
1598
+ position: static;
1599
+ }
1600
+
1577
1601
  .x7wzq59 {
1578
1602
  position: sticky;
1579
1603
  }
@@ -1598,6 +1622,10 @@ html[dir=ltr],[data-sonner-toaster][dir=ltr]{--toast-icon-margin-start:-3px;--to
1598
1622
  row-gap: var(--xxhyxt);
1599
1623
  }
1600
1624
 
1625
+ .xoka7y6 {
1626
+ scroll-padding-block-start: var(--x1m0ogk9);
1627
+ }
1628
+
1601
1629
  .x185mbhu {
1602
1630
  scrollbar-gutter: stable;
1603
1631
  }
@@ -2207,6 +2235,12 @@ html[dir=ltr],[data-sonner-toaster][dir=ltr]{--toast-icon-margin-start:-3px;--to
2207
2235
  position: static;
2208
2236
  }
2209
2237
  }
2238
+
2239
+ @container page-body (height >= 260px) {
2240
+ .xsbffnv.xsbffnv {
2241
+ position: sticky;
2242
+ }
2243
+ }
2210
2244
  }
2211
2245
 
2212
2246
  @layer priority5 {
@@ -2390,10 +2424,6 @@ html[dir=ltr],[data-sonner-toaster][dir=ltr]{--toast-icon-margin-start:-3px;--to
2390
2424
  height: auto;
2391
2425
  }
2392
2426
 
2393
- .x1r09gfs {
2394
- height: calc(100dvh - var(--x1m0ogk9));
2395
- }
2396
-
2397
2427
  .xw3im37 {
2398
2428
  height: 47px;
2399
2429
  }
@@ -2482,6 +2512,10 @@ html[dir=ltr],[data-sonner-toaster][dir=ltr]{--toast-icon-margin-start:-3px;--to
2482
2512
  margin-top: var(--xxhyxt);
2483
2513
  }
2484
2514
 
2515
+ .xmz0i5r {
2516
+ max-height: 100%;
2517
+ }
2518
+
2485
2519
  .xp8lc2p {
2486
2520
  max-height: 16lh;
2487
2521
  }
package/dist/forms.js CHANGED
@@ -1,3 +1,3 @@
1
1
  import { n as e, r as t, t as n } from "./forms-BQQFas9g.js";
2
- import { a as r, c as i, d as a, f as o, g as s, h as c, i as l, l as u, m as d, n as f, o as p, p as m, r as h, s as g, t as _, u as v } from "./src-CoFxE4Cj.js";
2
+ import { a as r, c as i, d as a, f as o, g as s, h as c, i as l, l as u, m as d, n as f, o as p, p as m, r as h, s as g, t as _, u as v } from "./src-DPRmO-JY.js";
3
3
  export { c as AgentAvatarPicker, h as Checkbox, s as Combobox, n as Field, v as Fieldset, a as FilePicker, u as FormActions, e as Input, o as InputGroup, m as NumberField, l as RadioGroup, i as Select, g as SelectControl, f as SettingsRow, _ as SettingsSection, d as Slider, r as Switch, t as Textarea, p as ToggleGroup };