@pie-lib/charting 8.0.4-next.20261008072957 → 8.0.4-next.20261010135116

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.
@@ -10,6 +10,7 @@ export declare class ActionsButton extends React.Component {
10
10
  categories: PropTypes.Requireable<any[]>;
11
11
  };
12
12
  triggerId: string;
13
+ menuId: string;
13
14
  handleActionsClick: any;
14
15
  handleActionsClose: any;
15
16
  handleAddCategory: any;
@@ -4,11 +4,10 @@ import { styled as n } from "@mui/material/styles";
4
4
  import { color as r, createUniqueId as i } from "@pie-lib/render-ui";
5
5
  import { jsx as a, jsxs as o } from "react/jsx-runtime";
6
6
  import s from "@pie-lib/translator";
7
- import c from "@mui/material/Button";
8
- import l from "@mui/material/Popover";
9
- import u from "@mui/material/Paper";
7
+ import c from "@mui/material/Menu";
8
+ import l from "@mui/material/MenuItem";
10
9
  //#region src/actions-button.tsx
11
- var { translator: d } = s, f = n("div")(() => ({ alignSelf: "flex-end" })), p = n("button")(({ theme: e }) => ({
10
+ var { translator: u } = s, d = n("div")(() => ({ alignSelf: "flex-end" })), f = n("button")(({ theme: e }) => ({
12
11
  display: "block",
13
12
  margin: 0,
14
13
  border: 0,
@@ -16,24 +15,16 @@ var { translator: d } = s, f = n("div")(() => ({ alignSelf: "flex-end" })), p =
16
15
  font: "inherit",
17
16
  cursor: "pointer",
18
17
  fontSize: e.typography.fontSize,
19
- color: r.tertiary(),
18
+ color: r.defaults.TERTIARY,
20
19
  padding: e.spacing(1),
21
20
  "&:focus-visible": {
22
21
  outline: `2px solid ${r.focusOutline()}`,
23
22
  outlineOffset: "-2px"
24
23
  }
25
- })), m = n(u)(({ theme: e }) => ({
26
- padding: e.spacing(1),
27
- display: "flex",
28
- flexDirection: "column",
29
- gap: e.spacing(1),
30
- "& button": {
31
- textTransform: "none",
32
- fontSize: e.typography.fontSize,
33
- color: r.text(),
34
- justifyContent: "flex-start"
35
- }
36
- })), h = class extends e.Component {
24
+ })), p = n(l)(({ theme: e }) => ({
25
+ fontSize: e.typography.fontSize,
26
+ color: r.text()
27
+ })), m = class extends e.Component {
37
28
  constructor(e) {
38
29
  super(e), this.state = { actionsAnchorEl: null };
39
30
  }
@@ -47,6 +38,7 @@ var { translator: d } = s, f = n("div")(() => ({ alignSelf: "flex-end" })), p =
47
38
  categories: t.array
48
39
  };
49
40
  triggerId = i("chart-actions");
41
+ menuId = i("chart-actions-menu");
50
42
  handleActionsClick = (e) => {
51
43
  this.setState({ actionsAnchorEl: e.currentTarget });
52
44
  };
@@ -62,18 +54,24 @@ var { translator: d } = s, f = n("div")(() => ({ alignSelf: "flex-end" })), p =
62
54
  t(e), this.handleActionsClose();
63
55
  };
64
56
  render() {
65
- let { categories: e, language: t } = this.props, { actionsAnchorEl: n } = this.state, r = !!n;
66
- return /* @__PURE__ */ o(f, { children: [/* @__PURE__ */ a(p, {
57
+ let { categories: e, language: t } = this.props, { actionsAnchorEl: n } = this.state, r = !!n, i = (e || []).map((e, t) => ({
58
+ category: e,
59
+ index: t
60
+ })).filter(({ category: e }) => e.deletable && !e.correctness);
61
+ return /* @__PURE__ */ o(d, { children: [/* @__PURE__ */ a(f, {
67
62
  type: "button",
68
63
  id: this.triggerId,
69
- "aria-haspopup": "dialog",
64
+ "aria-haspopup": "menu",
70
65
  "aria-expanded": r,
66
+ "aria-controls": r ? this.menuId : void 0,
71
67
  onClick: this.handleActionsClick,
72
- children: d.t("charting.actions", { lng: t })
73
- }), /* @__PURE__ */ a(l, {
68
+ children: u.t("charting.actions", { lng: t })
69
+ }), /* @__PURE__ */ o(c, {
70
+ id: this.menuId,
74
71
  open: r,
75
72
  anchorEl: n,
76
73
  onClose: this.handleActionsClose,
74
+ variant: "menu",
77
75
  anchorOrigin: {
78
76
  vertical: "bottom",
79
77
  horizontal: "left"
@@ -82,19 +80,16 @@ var { translator: d } = s, f = n("div")(() => ({ alignSelf: "flex-end" })), p =
82
80
  vertical: "top",
83
81
  horizontal: "left"
84
82
  },
85
- slotProps: { paper: {
86
- role: "dialog",
87
- "aria-labelledby": this.triggerId
88
- } },
89
- children: /* @__PURE__ */ o(m, { children: [/* @__PURE__ */ o(c, {
83
+ slotProps: { list: { "aria-labelledby": this.triggerId } },
84
+ children: [/* @__PURE__ */ o(p, {
90
85
  onClick: () => this.handleAddCategory(),
91
- children: ["+ ", d.t("charting.add", { lng: t })]
92
- }), e.length > 0 && e.map((e, n) => e.deletable && !e.correctness && /* @__PURE__ */ a(c, {
86
+ children: ["+ ", u.t("charting.add", { lng: t })]
87
+ }), i.map(({ category: e, index: n }) => /* @__PURE__ */ a(p, {
93
88
  onClick: () => this.handleDeleteCategory(n),
94
- children: `${d.t("charting.delete", { lng: t })} <${e.label || d.t("charting.newLabel", { lng: t })}>`
95
- }, n))] })
96
- }, `actions-popover-${Math.random()}`)] });
89
+ children: `${u.t("charting.delete", { lng: t })} <${e.label || u.t("charting.newLabel", { lng: t })}>`
90
+ }, n))]
91
+ })] });
97
92
  }
98
93
  };
99
94
  //#endregion
100
- export { h as ActionsButton, h as default };
95
+ export { m as ActionsButton, m as default };
@@ -14,7 +14,7 @@ var _ = u("div")({
14
14
  display: "flex",
15
15
  flexDirection: "column",
16
16
  alignItems: "center"
17
- }), v = f.disabledText();
17
+ }), v = f.defaults.DISABLED_TEXT;
18
18
  u("input")(({ theme: e }) => ({
19
19
  float: "right",
20
20
  fontFamily: e.typography.fontFamily,
@@ -30,7 +30,7 @@ var y = u("div")(({ theme: e }) => ({
30
30
  textAlign: "center",
31
31
  fontSize: e.typography.fontSize + 2,
32
32
  fontFamily: e.typography.fontFamily,
33
- color: f.primaryDark(),
33
+ color: f.defaults.PRIMARY_DARK,
34
34
  paddingTop: e.typography.fontSize / 2,
35
35
  "&.disabledMarkLabel": {
36
36
  ...r("color"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-lib/charting",
3
- "version": "8.0.4-next.20261008072957",
3
+ "version": "8.0.4-next.20261010135116",
4
4
  "description": "charting",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,8 +14,8 @@
14
14
  "@mui/icons-material": "^7.3.4",
15
15
  "@mui/material": "^7.3.4",
16
16
  "@pie-element/shared-utils": "0.1.4-next.20261008072957",
17
- "@pie-lib/plot": "5.0.4-next.20261008072957",
18
- "@pie-lib/render-ui": "8.0.4-next.20261008072957",
17
+ "@pie-lib/plot": "5.0.4-next.20261009061152",
18
+ "@pie-lib/render-ui": "8.0.4-next.20261009061152",
19
19
  "@pie-lib/translator": "5.0.2-next.20261006160832",
20
20
  "@visx/axis": "^4.0.0",
21
21
  "@visx/event": "^4.0.0",
@@ -30,8 +30,8 @@
30
30
  "invariant": "^2.2.4",
31
31
  "react-draggable": "^4.7.1",
32
32
  "prop-types": "^15.8.1",
33
- "@pie-lib/config-ui": "14.0.4-next.20261008072957",
34
- "@pie-element/shared-math-rendering-mathjax": "0.1.5-next.20261008072957",
33
+ "@pie-lib/config-ui": "14.0.4-next.20261009061152",
34
+ "@pie-element/shared-math-rendering-mathjax": "0.1.5-next.20261009061152",
35
35
  "@pie-element/shared-lodash": "0.1.3-next.20261006160832",
36
36
  "clsx": "^2.1.1",
37
37
  "d3-time": "^3.1.0",