@pie-lib/charting 8.0.1-next.20261005003301 → 8.0.1-next.20261005075357

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