@mechane-ai/elements 0.18.0 → 0.19.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.
@@ -43,6 +43,13 @@ var E = {
43
43
  kAzted: "xseoqlg",
44
44
  kskxy: "x1y3glee",
45
45
  $$css: !0
46
+ },
47
+ growingTextarea: {
48
+ kAzted: "x2lwn1j",
49
+ kskxy: "xp8lc2p",
50
+ kOwNse: "x5f5z56",
51
+ kHenm0: "xtt52l0",
52
+ $$css: !0
46
53
  }
47
54
  }, D = {
48
55
  field: { field: { $$css: !0 } }.field,
@@ -808,20 +815,20 @@ function je({ className: t, style: n, xstyle: r, ...i }) {
808
815
  })
809
816
  });
810
817
  }
811
- function Me({ isCompact: t = !1, appearance: n = "field", value: r, defaultValue: i, onValueChange: a, name: s, disabled: l, readOnly: d, required: f, className: p, style: m, xstyle: h, ...g }) {
818
+ function Me({ isCompact: t = !1, shouldGrow: n = !1, appearance: r = "field", value: i, defaultValue: a, onValueChange: s, name: l, disabled: d, readOnly: f, required: p, className: m, style: h, xstyle: g, ..._ }) {
812
819
  return /* @__PURE__ */ u(S.Control, {
813
- value: r,
814
- defaultValue: i,
815
- onValueChange: a,
816
- name: s,
817
- disabled: l,
818
- readOnly: d,
819
- required: f,
820
- render: /* @__PURE__ */ u("textarea", { ...g }),
820
+ value: i,
821
+ defaultValue: a,
822
+ onValueChange: s,
823
+ name: l,
824
+ disabled: d,
825
+ readOnly: f,
826
+ required: p,
827
+ render: /* @__PURE__ */ u("textarea", { ..._ }),
821
828
  ...o({
822
- className: p,
823
- style: m,
824
- styles: c.props(e.base, e.field, E.input, e.textarea, t && E.compactTextarea, D[n], h)
829
+ className: m,
830
+ style: h,
831
+ styles: c.props(e.base, e.field, E.input, e.textarea, t && E.compactTextarea, n && E.growingTextarea, D[r], g)
825
832
  })
826
833
  });
827
834
  }
@@ -0,0 +1,23 @@
1
+ import { useEffect as e, useRef as t, useState as n } from "react";
2
+ // packages/foundations/src/visible-motion.ts
3
+ function r(r) {
4
+ let i = t(null), [a, o] = n(!1);
5
+ return e(() => {
6
+ let e = i.current;
7
+ if (!r || e === null) return;
8
+ let t = matchMedia("(prefers-reduced-motion: reduce)"), n = !1;
9
+ function a() {
10
+ o(n && !document.hidden && !t.matches);
11
+ }
12
+ let s = new IntersectionObserver((e) => {
13
+ n = e.some((e) => e.isIntersecting), a();
14
+ });
15
+ return s.observe(e), t.addEventListener("change", a), document.addEventListener("visibilitychange", a), () => {
16
+ s.disconnect(), t.removeEventListener("change", a), document.removeEventListener("visibilitychange", a);
17
+ };
18
+ }, [r]), {
19
+ ref: i,
20
+ isActive: r && a
21
+ };
22
+ }
23
+ export { r as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mechane-ai/elements",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "description": "Elements by Mechane — React components for applications, AI interfaces, and analytical graphics",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {