@pie-lib/render-ui 8.0.1-next.20261005184705 → 8.0.1-next.20261006003311
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.
- package/dist/feedback.js +21 -21
- package/dist/inline-menu.d.ts +7 -7
- package/dist/inline-menu.js +3 -8
- package/package.json +2 -2
package/dist/feedback.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { styled as
|
|
5
|
-
import { CSSTransition as
|
|
6
|
-
import { jsx as
|
|
1
|
+
import { backgroundDark as e, correctSecondary as t, incorrectSecondary as n, text as r } from "./color.js";
|
|
2
|
+
import i from "react";
|
|
3
|
+
import a from "prop-types";
|
|
4
|
+
import { styled as o } from "@mui/material/styles";
|
|
5
|
+
import { CSSTransition as s, TransitionGroup as c } from "react-transition-group";
|
|
6
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
7
7
|
//#region src/feedback.tsx
|
|
8
|
-
var
|
|
8
|
+
var u = o("div")({
|
|
9
9
|
transformOrigin: "0% 0px 0px",
|
|
10
10
|
width: "100%",
|
|
11
11
|
display: "block",
|
|
12
12
|
overflow: "hidden",
|
|
13
13
|
"&.incorrect": { color: "#946202" }
|
|
14
|
-
}),
|
|
14
|
+
}), d = o("div")({
|
|
15
15
|
WebkitFontSmoothing: "antialiased",
|
|
16
|
-
backgroundColor: `var(--feedback-bg-color, ${
|
|
16
|
+
backgroundColor: `var(--feedback-bg-color, ${e()})`,
|
|
17
17
|
borderRadius: "4px",
|
|
18
18
|
lineHeight: "25px",
|
|
19
19
|
margin: "0px",
|
|
20
20
|
padding: "10px",
|
|
21
21
|
verticalAlign: "middle",
|
|
22
|
-
color:
|
|
23
|
-
"&.correct": { backgroundColor: `var(--feedback-correct-bg-color, ${
|
|
22
|
+
color: `var(--feedback-color, ${r()})`,
|
|
23
|
+
"&.correct": { backgroundColor: `var(--feedback-correct-bg-color, ${t()})` },
|
|
24
24
|
"&.incorrect": { backgroundColor: `var(--feedback-incorrect-bg-color, ${n()})` }
|
|
25
|
-
}),
|
|
25
|
+
}), f = o("div")({
|
|
26
26
|
"&.feedback-enter": { height: "1px" },
|
|
27
27
|
"&.feedback-enter-active": {
|
|
28
28
|
height: "45px",
|
|
@@ -33,24 +33,24 @@ var l = a("div")({
|
|
|
33
33
|
height: "1px",
|
|
34
34
|
transition: "height 200ms"
|
|
35
35
|
}
|
|
36
|
-
}),
|
|
36
|
+
}), p = class extends i.Component {
|
|
37
37
|
static propTypes = {
|
|
38
|
-
correctness:
|
|
39
|
-
feedback:
|
|
38
|
+
correctness: a.string,
|
|
39
|
+
feedback: a.string
|
|
40
40
|
};
|
|
41
|
-
nodeRef =
|
|
41
|
+
nodeRef = i.createRef();
|
|
42
42
|
renderFeedback() {
|
|
43
43
|
let { correctness: e, feedback: t } = this.props;
|
|
44
|
-
return !e || !t ? null : /* @__PURE__ */
|
|
44
|
+
return !e || !t ? null : /* @__PURE__ */ l(s, {
|
|
45
45
|
nodeRef: this.nodeRef,
|
|
46
46
|
timeout: {
|
|
47
47
|
enter: 500,
|
|
48
48
|
exit: 200
|
|
49
49
|
},
|
|
50
50
|
classNames: "feedback",
|
|
51
|
-
children: /* @__PURE__ */
|
|
51
|
+
children: /* @__PURE__ */ l(f, {
|
|
52
52
|
ref: this.nodeRef,
|
|
53
|
-
children: /* @__PURE__ */
|
|
53
|
+
children: /* @__PURE__ */ l(u, { children: /* @__PURE__ */ l(d, {
|
|
54
54
|
className: e,
|
|
55
55
|
dangerouslySetInnerHTML: { __html: t }
|
|
56
56
|
}) })
|
|
@@ -58,8 +58,8 @@ var l = a("div")({
|
|
|
58
58
|
}, "hasFeedback");
|
|
59
59
|
}
|
|
60
60
|
render() {
|
|
61
|
-
return /* @__PURE__ */
|
|
61
|
+
return /* @__PURE__ */ l("div", { children: /* @__PURE__ */ l(c, { children: this.renderFeedback() }) });
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
64
|
//#endregion
|
|
65
|
-
export {
|
|
65
|
+
export { p as Feedback, p as default };
|
package/dist/inline-menu.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* InlineMenu - A wrapper around MUI's Menu component for inline contexts
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* MUI's Menu renders inside a modal root that covers the viewport, and
|
|
5
|
+
* `styled(Menu)` puts its class on that root, so a background styled onto the
|
|
6
|
+
* menu paints over the whole page. InlineMenu keeps the page visible under an
|
|
7
|
+
* open menu. It's designed for use in inline contexts like dropdowns within
|
|
8
|
+
* text or other UI elements.
|
|
7
9
|
*
|
|
8
10
|
* Key differences from standard MUI Menu:
|
|
9
|
-
* -
|
|
10
|
-
* - Transparent modal root (doesn't block UI)
|
|
11
|
+
* - Transparent modal root, whatever background the menu is styled with
|
|
11
12
|
* - No scroll locking (disableScrollLock)
|
|
12
|
-
* - Menu itself remains interactive
|
|
13
13
|
*/
|
|
14
14
|
import React from 'react';
|
|
15
15
|
import { MenuProps } from '@mui/material/Menu';
|
|
16
16
|
/**
|
|
17
|
-
* InlineMenu component that wraps MUI Menu without the
|
|
17
|
+
* InlineMenu component that wraps MUI Menu without painting over the page
|
|
18
18
|
*
|
|
19
19
|
* @example
|
|
20
20
|
* ```tsx
|
package/dist/inline-menu.js
CHANGED
|
@@ -5,23 +5,18 @@ import t from "@mui/material/Menu";
|
|
|
5
5
|
var n = ({ slotProps: n, ...r }) => /* @__PURE__ */ e(t, {
|
|
6
6
|
...r,
|
|
7
7
|
disableScrollLock: !0,
|
|
8
|
-
hideBackdrop: !0,
|
|
9
8
|
slotProps: {
|
|
10
9
|
...n,
|
|
11
10
|
root: {
|
|
12
11
|
...n?.root,
|
|
13
12
|
style: {
|
|
14
13
|
backgroundColor: "transparent",
|
|
15
|
-
pointerEvents: "none",
|
|
16
14
|
...n?.root?.style
|
|
17
15
|
}
|
|
18
16
|
},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
pointerEvents: "auto",
|
|
23
|
-
...n?.paper?.style
|
|
24
|
-
}
|
|
17
|
+
backdrop: {
|
|
18
|
+
invisible: !0,
|
|
19
|
+
...n?.backdrop
|
|
25
20
|
}
|
|
26
21
|
}
|
|
27
22
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-lib/render-ui",
|
|
3
|
-
"version": "8.0.1-next.
|
|
3
|
+
"version": "8.0.1-next.20261006003311",
|
|
4
4
|
"description": "Some shared ui elements when rendering - but not worthy of their own package yet.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"prop-types": "^15.7.2",
|
|
19
19
|
"react-transition-group": "^4.4.5",
|
|
20
20
|
"@pie-element/shared-math-rendering-mathjax": "0.1.2-next.20261003161149",
|
|
21
|
-
"@pie-element/shared-lodash": "0.1.2-next.
|
|
21
|
+
"@pie-element/shared-lodash": "0.1.2-next.20261005190856"
|
|
22
22
|
},
|
|
23
23
|
"type": "module",
|
|
24
24
|
"main": "./dist/index.js",
|