@pie-lib/render-ui 8.0.1-next.20261004162038 → 8.0.1-next.20261005000911

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.
@@ -8,6 +8,8 @@ export declare class Collapsible extends React.Component {
8
8
  visible: PropTypes.Requireable<string>;
9
9
  hidden: PropTypes.Requireable<string>;
10
10
  }>>;
11
+ /** The item language, which the default "Show" and "Hide" labels follow. */
12
+ language: PropTypes.Requireable<string>;
11
13
  };
12
14
  static defaultProps: {
13
15
  labels: {};
@@ -6,8 +6,9 @@ import { styled as i } from "@mui/material/styles";
6
6
  import { jsx as a, jsxs as o } from "react/jsx-runtime";
7
7
  import s from "@mui/material/Collapse";
8
8
  import { renderMath as c } from "@pie-element/shared-math-rendering-mathjax";
9
+ import l from "@pie-lib/translator";
9
10
  //#region src/collapsible/index.tsx
10
- var l = i("button")({
11
+ var { translator: u } = l, d = i("button")({
11
12
  display: "inline-block",
12
13
  minHeight: "24px",
13
14
  padding: 0,
@@ -17,14 +18,15 @@ var l = i("button")({
17
18
  textAlign: "inherit",
18
19
  color: e(),
19
20
  cursor: "pointer"
20
- }), u = i("span")({ borderBottom: "1px dotted currentColor" }), d = i(s)(({ theme: e }) => ({ paddingTop: e.spacing(2) })), f = class extends n.Component {
21
+ }), f = i("span")({ borderBottom: "1px dotted currentColor" }), p = i(s)(({ theme: e }) => ({ paddingTop: e.spacing(2) })), m = class extends n.Component {
21
22
  static propTypes = {
22
23
  className: r.string,
23
24
  children: r.object,
24
25
  labels: r.shape({
25
26
  visible: r.string,
26
27
  hidden: r.string
27
- })
28
+ }),
29
+ language: r.string
28
30
  };
29
31
  static defaultProps = { labels: {} };
30
32
  state = { expanded: !1 };
@@ -39,20 +41,20 @@ var l = i("button")({
39
41
  c(this.root);
40
42
  }
41
43
  render() {
42
- let { labels: e, children: t, className: n } = this.props, { expanded: r } = this.state, i = r ? e.visible || "Hide" : e.hidden || "Show";
44
+ let { labels: e, children: t, className: n, language: r } = this.props, { expanded: i } = this.state, s = i ? e.visible || u.t("common:hide", { lng: r }) : e.hidden || u.t("common:show", { lng: r });
43
45
  return /* @__PURE__ */ o("div", {
44
46
  className: n,
45
47
  ref: (e) => this.root = e,
46
- children: [/* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(l, {
48
+ children: [/* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(d, {
47
49
  type: "button",
48
- "aria-expanded": r,
50
+ "aria-expanded": i,
49
51
  "aria-controls": this.panelId,
50
52
  onClick: this.toggleExpanded,
51
- children: /* @__PURE__ */ a(u, { children: i })
53
+ children: /* @__PURE__ */ a(f, { children: s })
52
54
  }) }), /* @__PURE__ */ a("div", {
53
55
  id: this.panelId,
54
- children: /* @__PURE__ */ a(d, {
55
- in: r,
56
+ children: /* @__PURE__ */ a(p, {
57
+ in: i,
56
58
  timeout: {
57
59
  enter: 225,
58
60
  exit: 195
@@ -65,4 +67,4 @@ var l = i("button")({
65
67
  }
66
68
  };
67
69
  //#endregion
68
- export { f as Collapsible, f as default };
70
+ export { m as Collapsible, m 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.20261004162038",
3
+ "version": "8.0.1-next.20261005000911",
4
4
  "description": "Some shared ui elements when rendering - but not worthy of their own package yet.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,7 +12,8 @@
12
12
  "@emotion/styled": "^11.14.1",
13
13
  "@mui/icons-material": "^7.3.4",
14
14
  "@mui/material": "^7.3.4",
15
- "@pie-lib/icons": "5.0.1-next.20261002233132",
15
+ "@pie-lib/icons": "5.0.1-next.20261004165705",
16
+ "@pie-lib/translator": "5.0.1-next.20261005000911",
16
17
  "debug": "^4.1.1",
17
18
  "prop-types": "^15.7.2",
18
19
  "react-transition-group": "^4.4.5",