@mechane-ai/elements 0.5.1 → 0.7.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 +4 -2
- package/dist/ai.js +24 -23
- package/dist/assets/stylex.css +32 -4
- package/dist/{categorical-values-BfAEQUd0.js → categorical-values-75J0TUkR.js} +2 -2
- package/dist/{chart-frame-bX0VLC_W.js → chart-frame--DOsZKwP.js} +1 -1
- package/dist/{chart-input--VSrlMl-.js → chart-input-C-g586YE.js} +2 -2
- package/dist/charts/cartesian.js +203 -141
- package/dist/charts/distribution.js +2 -2
- package/dist/charts/graph.js +2 -2
- package/dist/charts/hierarchy.js +3 -3
- package/dist/charts/matrix.js +2 -2
- package/dist/charts/timeline.js +1 -1
- package/dist/charts.js +1 -1
- package/dist/{code-block-BiMcfdlB.js → code-block-D0Jmsj7w.js} +1 -1
- package/dist/collections.js +99 -87
- package/dist/content/code.js +1 -1
- package/dist/content/diff.js +2 -2
- 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-Bm-Td5wm.js → content-link-HLYu0cmz.js} +1 -1
- package/dist/content.js +2 -2
- package/dist/feedback.js +1 -1
- package/dist/forms/dates.js +1 -1
- package/dist/forms.js +1 -1
- package/dist/index.js +1 -1
- package/dist/layout.js +77 -35
- package/dist/navigation/commands.js +1 -1
- package/dist/packages/ai/src/prompt-input.d.ts +2 -1
- package/dist/packages/charts/src/cartesian/bar-chart.d.ts +1 -0
- package/dist/packages/collections/src/data-table.d.ts +3 -2
- package/dist/packages/core/src/text.d.ts +4 -2
- package/dist/packages/forms/src/field-styles.d.ts +12 -0
- package/dist/packages/forms/src/form-controls.d.ts +1 -1
- package/dist/packages/forms/src/forms.d.ts +5 -3
- package/dist/packages/layout/src/focus-page.d.ts +4 -0
- package/dist/packages/layout/src/index.d.ts +2 -0
- package/dist/packages/layout/src/workbench.d.ts +12 -0
- package/dist/{pierre-tree-LY7PGy-7.js → pierre-tree-DVybsnm4.js} +2 -2
- package/dist/{src-CbJTK9oP.js → src-B_DCatpY.js} +1 -1
- package/dist/{src-CbYaLvhD.js → src-BkCsvZGi.js} +6 -2
- package/dist/{src-CjnbzSgq.js → src-DjTM64tN.js} +183 -170
- package/package.json +1 -1
- package/styles.css +2 -2
package/README.md
CHANGED
|
@@ -39,8 +39,10 @@ export function Example() {
|
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
Elements supplies compiled ESM, TypeScript declarations, and CSS. Ordinary React consumers need no StyleX compiler.
|
|
42
|
-
Applications install their own reset and fonts. Put reset rules in the `reset` CSS layer
|
|
43
|
-
|
|
42
|
+
Applications install their own reset and fonts. Put reset rules in the `reset` CSS layer. Elements and consumer StyleX
|
|
43
|
+
rules share the compiler's ordered `priority` layers. Keep those layers at the top level: wrapping Elements in another
|
|
44
|
+
layer lets consumer base declarations override component hover and focus states. Unlayered application themes can
|
|
45
|
+
override token defaults.
|
|
44
46
|
|
|
45
47
|
## Imports
|
|
46
48
|
|
package/dist/ai.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { b as e, f as t, p as n, t as r, v as i } from "./src-
|
|
2
|
-
import { t as a } from "./content-link-
|
|
3
|
-
import { c as o, u as s } from "./src-
|
|
1
|
+
import { b as e, f as t, p as n, t as r, v as i } from "./src-BkCsvZGi.js";
|
|
2
|
+
import { t as a } from "./content-link-HLYu0cmz.js";
|
|
3
|
+
import { c as o, u as s } from "./src-DjTM64tN.js";
|
|
4
4
|
import { r as c } from "./src-CfDf8TY8.js";
|
|
5
5
|
import * as l from "@stylexjs/stylex";
|
|
6
6
|
import { createContext as u, useContext as d, useId as f, useRef as p } from "react";
|
|
@@ -193,52 +193,53 @@ var I = { action: {
|
|
|
193
193
|
keTefX: "xvc5jky",
|
|
194
194
|
$$css: !0
|
|
195
195
|
} };
|
|
196
|
-
function L({ label: e, value: t, onValueChange: n, onSubmit: r, name: a = "prompt", placeholder: c, maxLength: l, required: u = !0, pending: d = !1, disabled: p = !1, submitDisabled: g = !1, submitLabel: v = "Send message", pendingLabel: y = "Sending…", enterBehavior: x = "newline",
|
|
197
|
-
let
|
|
198
|
-
function
|
|
196
|
+
function L({ label: e, value: t, onValueChange: n, onSubmit: r, name: a = "prompt", placeholder: c, maxLength: l, required: u = !0, pending: d = !1, disabled: p = !1, submitDisabled: g = !1, submitLabel: v = "Send message", pendingLabel: y = "Sending…", enterBehavior: x = "newline", compact: S = !1, description: C, error: w, controls: T, attachments: E, onStop: D, stopPending: O = !1, stopLabel: k = "Stop response" }) {
|
|
197
|
+
let A = f(), j = p || d;
|
|
198
|
+
function M(e) {
|
|
199
199
|
if (x !== "submit" || e.key !== "Enter" || e.repeat) return;
|
|
200
200
|
let t = e.altKey || e.ctrlKey || e.metaKey;
|
|
201
|
-
e.shiftKey || t || e.nativeEvent.isComposing || e.nativeEvent.keyCode === 229 || (e.preventDefault(), !
|
|
201
|
+
e.shiftKey || t || e.nativeEvent.isComposing || e.nativeEvent.keyCode === 229 || (e.preventDefault(), !j && !g && D === void 0 && e.currentTarget.form?.requestSubmit());
|
|
202
202
|
}
|
|
203
|
-
function
|
|
204
|
-
e.preventDefault(), !
|
|
203
|
+
function N(e) {
|
|
204
|
+
e.preventDefault(), !j && !g && D === void 0 && r(e);
|
|
205
205
|
}
|
|
206
206
|
return /* @__PURE__ */ h("form", {
|
|
207
|
-
onSubmit:
|
|
207
|
+
onSubmit: N,
|
|
208
208
|
className: "x78zum5 xdt5ytf x1n8ia3y xeuugli",
|
|
209
209
|
children: [
|
|
210
210
|
/* @__PURE__ */ h(o.Root, {
|
|
211
|
-
invalid:
|
|
211
|
+
invalid: w !== void 0,
|
|
212
212
|
children: [
|
|
213
213
|
/* @__PURE__ */ m(o.Label, { children: e }),
|
|
214
214
|
/* @__PURE__ */ m(s, {
|
|
215
|
+
compact: S,
|
|
215
216
|
name: a,
|
|
216
217
|
value: t,
|
|
217
218
|
onChange: (e) => n(e.currentTarget.value),
|
|
218
|
-
onKeyDown:
|
|
219
|
+
onKeyDown: M,
|
|
219
220
|
placeholder: c,
|
|
220
221
|
maxLength: l,
|
|
221
222
|
required: u,
|
|
222
223
|
disabled: p,
|
|
223
224
|
readOnly: d,
|
|
224
|
-
"aria-errormessage":
|
|
225
|
+
"aria-errormessage": w === void 0 ? void 0 : A
|
|
225
226
|
}),
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
id:
|
|
227
|
+
C !== void 0 && /* @__PURE__ */ m(o.Description, { children: C }),
|
|
228
|
+
w !== void 0 && /* @__PURE__ */ m(o.Error, {
|
|
229
|
+
id: A,
|
|
229
230
|
match: !0,
|
|
230
231
|
role: "alert",
|
|
231
|
-
children:
|
|
232
|
+
children: w
|
|
232
233
|
})
|
|
233
234
|
]
|
|
234
235
|
}),
|
|
235
|
-
|
|
236
|
+
E,
|
|
236
237
|
/* @__PURE__ */ h("div", {
|
|
237
238
|
className: "x78zum5 x1a02dak x6s0dn4 x1qughib x1n8ia3y",
|
|
238
239
|
children: [/* @__PURE__ */ m("div", {
|
|
239
240
|
className: "x78zum5 x1a02dak x6s0dn4 x1hnptsi xeuugli x12lumcd",
|
|
240
|
-
children:
|
|
241
|
-
}),
|
|
241
|
+
children: T
|
|
242
|
+
}), D === void 0 ? /* @__PURE__ */ h(i, {
|
|
242
243
|
xstyle: I.action,
|
|
243
244
|
type: "submit",
|
|
244
245
|
variant: "solid",
|
|
@@ -253,15 +254,15 @@ function L({ label: e, value: t, onValueChange: n, onSubmit: r, name: a = "promp
|
|
|
253
254
|
xstyle: I.action,
|
|
254
255
|
type: "button",
|
|
255
256
|
onClick: (e) => {
|
|
256
|
-
e.preventDefault(),
|
|
257
|
+
e.preventDefault(), D();
|
|
257
258
|
},
|
|
258
259
|
disabled: p,
|
|
259
|
-
pending:
|
|
260
|
+
pending: O,
|
|
260
261
|
pendingLabel: "Stopping…",
|
|
261
262
|
children: [/* @__PURE__ */ m(b, {
|
|
262
263
|
size: 14,
|
|
263
264
|
"aria-hidden": !0
|
|
264
|
-
}),
|
|
265
|
+
}), k]
|
|
265
266
|
})]
|
|
266
267
|
})
|
|
267
268
|
]
|
package/dist/assets/stylex.css
CHANGED
|
@@ -1382,6 +1382,12 @@
|
|
|
1382
1382
|
transform: translateY(0);
|
|
1383
1383
|
}
|
|
1384
1384
|
|
|
1385
|
+
@media (width <= 1100px) {
|
|
1386
|
+
.x1g9v1si.x1g9v1si {
|
|
1387
|
+
display: none;
|
|
1388
|
+
}
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1385
1391
|
@media (width <= 650px) {
|
|
1386
1392
|
.xj8mwme.xj8mwme {
|
|
1387
1393
|
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
|
@@ -1574,6 +1580,10 @@
|
|
|
1574
1580
|
height: 8px;
|
|
1575
1581
|
}
|
|
1576
1582
|
|
|
1583
|
+
.x1b7uu3i {
|
|
1584
|
+
height: calc(100dvh - var(--xrzfcxb));
|
|
1585
|
+
}
|
|
1586
|
+
|
|
1577
1587
|
.x16ye13r {
|
|
1578
1588
|
height: var(--x-height);
|
|
1579
1589
|
}
|
|
@@ -1650,6 +1660,10 @@
|
|
|
1650
1660
|
margin-top: var(--x1xijsos);
|
|
1651
1661
|
}
|
|
1652
1662
|
|
|
1663
|
+
.x1y3glee {
|
|
1664
|
+
max-height: 30dvh;
|
|
1665
|
+
}
|
|
1666
|
+
|
|
1653
1667
|
.x1sslpiy {
|
|
1654
1668
|
max-height: 320px;
|
|
1655
1669
|
}
|
|
@@ -1702,6 +1716,10 @@
|
|
|
1702
1716
|
max-width: 280px;
|
|
1703
1717
|
}
|
|
1704
1718
|
|
|
1719
|
+
.xxc7z9f {
|
|
1720
|
+
max-width: 360px;
|
|
1721
|
+
}
|
|
1722
|
+
|
|
1705
1723
|
.x1ewvobj {
|
|
1706
1724
|
max-width: 72ch;
|
|
1707
1725
|
}
|
|
@@ -1754,6 +1772,10 @@
|
|
|
1754
1772
|
min-height: 52px;
|
|
1755
1773
|
}
|
|
1756
1774
|
|
|
1775
|
+
.xseoqlg {
|
|
1776
|
+
min-height: 80px;
|
|
1777
|
+
}
|
|
1778
|
+
|
|
1757
1779
|
.x1avwmir {
|
|
1758
1780
|
min-height: var(--x10l6e8v);
|
|
1759
1781
|
}
|
|
@@ -1830,10 +1852,6 @@
|
|
|
1830
1852
|
min-width: var(--x6uufy4);
|
|
1831
1853
|
}
|
|
1832
1854
|
|
|
1833
|
-
.x167izq3 {
|
|
1834
|
-
min-width: var(--xrzfcxb);
|
|
1835
|
-
}
|
|
1836
|
-
|
|
1837
1855
|
.xelkyza {
|
|
1838
1856
|
min-width: var(--xymjgzc);
|
|
1839
1857
|
}
|
|
@@ -1950,6 +1968,10 @@
|
|
|
1950
1968
|
width: 40px;
|
|
1951
1969
|
}
|
|
1952
1970
|
|
|
1971
|
+
.x1peuizl {
|
|
1972
|
+
width: 440px;
|
|
1973
|
+
}
|
|
1974
|
+
|
|
1953
1975
|
.x187nhsf {
|
|
1954
1976
|
width: 44px;
|
|
1955
1977
|
}
|
|
@@ -2053,6 +2075,12 @@
|
|
|
2053
2075
|
.x1t1lzn6:last-child {
|
|
2054
2076
|
border-bottom-width: 0;
|
|
2055
2077
|
}
|
|
2078
|
+
|
|
2079
|
+
@media (width <= 1100px) {
|
|
2080
|
+
.x1tama1k.x1tama1k {
|
|
2081
|
+
width: 100%;
|
|
2082
|
+
}
|
|
2083
|
+
}
|
|
2056
2084
|
}
|
|
2057
2085
|
|
|
2058
2086
|
@layer priority6 {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as e, o as t } from "./chart-frame
|
|
2
|
-
import { n } from "./chart-input
|
|
1
|
+
import { n as e, o as t } from "./chart-frame--DOsZKwP.js";
|
|
2
|
+
import { n } from "./chart-input-C-g586YE.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,5 +1,5 @@
|
|
|
1
|
-
import { d as e } from "./src-
|
|
2
|
-
import { r as t } from "./chart-frame
|
|
1
|
+
import { d as e } from "./src-B_DCatpY.js";
|
|
2
|
+
import { r as t } from "./chart-frame--DOsZKwP.js";
|
|
3
3
|
import { jsx as n } from "react/jsx-runtime";
|
|
4
4
|
// packages/charts/src/chart-input.tsx
|
|
5
5
|
function r(e) {
|