@pie-lib/render-ui 8.0.1-next.20261003064518 → 8.0.1-next.20261004023419

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.
@@ -15,6 +15,7 @@ export declare class Collapsible extends React.Component {
15
15
  state: {
16
16
  expanded: boolean;
17
17
  };
18
+ panelId: string;
18
19
  toggleExpanded: any;
19
20
  componentDidMount(): void;
20
21
  componentDidUpdate(): void;
@@ -1,53 +1,67 @@
1
- import e from "react";
2
- import t from "prop-types";
3
- import { styled as n } from "@mui/material/styles";
4
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
- import a from "@mui/material/Collapse";
6
- import { renderMath as o } from "@pie-element/shared-math-rendering-mathjax";
1
+ import { tertiary as e } from "../color.js";
2
+ import t from "react";
3
+ import n from "prop-types";
4
+ import { styled as r } from "@mui/material/styles";
5
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
+ import o from "@mui/material/Collapse";
7
+ import { renderMath as s } from "@pie-element/shared-math-rendering-mathjax";
7
8
  //#region src/collapsible/index.tsx
8
- var s = n("span")(({ theme: e }) => ({
9
- color: e.palette.primary.light,
10
- borderBottom: `1px dotted ${e.palette.primary.light}`,
9
+ var c = r("button")({
10
+ display: "inline-block",
11
+ minHeight: "24px",
12
+ padding: 0,
13
+ border: 0,
14
+ background: "transparent",
15
+ font: "inherit",
16
+ textAlign: "inherit",
17
+ color: e(),
11
18
  cursor: "pointer"
12
- })), c = n(a)(({ theme: e }) => ({ paddingTop: e.spacing(2) })), l = class extends e.Component {
19
+ }), l = r("span")({ borderBottom: "1px dotted currentColor" }), u = r(o)(({ theme: e }) => ({ paddingTop: e.spacing(2) })), d = class extends t.Component {
13
20
  static propTypes = {
14
- className: t.string,
15
- children: t.object,
16
- labels: t.shape({
17
- visible: t.string,
18
- hidden: t.string
21
+ className: n.string,
22
+ children: n.object,
23
+ labels: n.shape({
24
+ visible: n.string,
25
+ hidden: n.string
19
26
  })
20
27
  };
21
28
  static defaultProps = { labels: {} };
22
29
  state = { expanded: !1 };
30
+ panelId = `pie-collapsible-${Math.random().toString(36).slice(2, 10)}`;
23
31
  toggleExpanded = () => {
24
32
  this.setState((e) => ({ expanded: !e.expanded }));
25
33
  };
26
34
  componentDidMount() {
27
- o(this.root);
35
+ s(this.root);
28
36
  }
29
37
  componentDidUpdate() {
30
- o(this.root);
38
+ s(this.root);
31
39
  }
32
40
  render() {
33
- let { labels: e, children: t, className: n } = this.props, a = this.state.expanded ? e.visible || "Hide" : e.hidden || "Show";
34
- return /* @__PURE__ */ i("div", {
41
+ let { labels: e, children: t, className: n } = this.props, { expanded: r } = this.state, o = r ? e.visible || "Hide" : e.hidden || "Show";
42
+ return /* @__PURE__ */ a("div", {
35
43
  className: n,
36
44
  ref: (e) => this.root = e,
37
- children: [/* @__PURE__ */ r("div", {
45
+ children: [/* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(c, {
46
+ type: "button",
47
+ "aria-expanded": r,
48
+ "aria-controls": this.panelId,
38
49
  onClick: this.toggleExpanded,
39
- children: /* @__PURE__ */ r(s, { children: a })
40
- }), /* @__PURE__ */ r(c, {
41
- in: this.state.expanded,
42
- timeout: {
43
- enter: 225,
44
- exit: 195
45
- },
46
- unmountOnExit: !0,
47
- children: t
50
+ children: /* @__PURE__ */ i(l, { children: o })
51
+ }) }), /* @__PURE__ */ i("div", {
52
+ id: this.panelId,
53
+ children: /* @__PURE__ */ i(u, {
54
+ in: r,
55
+ timeout: {
56
+ enter: 225,
57
+ exit: 195
58
+ },
59
+ unmountOnExit: !0,
60
+ children: t
61
+ })
48
62
  })]
49
63
  });
50
64
  }
51
65
  };
52
66
  //#endregion
53
- export { l as Collapsible, l as default };
67
+ export { d as Collapsible, d as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-lib/render-ui",
3
- "version": "8.0.1-next.20261003064518",
3
+ "version": "8.0.1-next.20261004023419",
4
4
  "description": "Some shared ui elements when rendering - but not worthy of their own package yet.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,7 +16,7 @@
16
16
  "debug": "^4.1.1",
17
17
  "prop-types": "^15.7.2",
18
18
  "react-transition-group": "^4.4.5",
19
- "@pie-element/shared-math-rendering-mathjax": "0.1.2-next.20261003064518",
19
+ "@pie-element/shared-math-rendering-mathjax": "0.1.2-next.20261003161149",
20
20
  "@pie-element/shared-lodash": "0.1.2-next.20261002215153"
21
21
  },
22
22
  "type": "module",