@pie-lib/config-ui 0.1.0

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.
Files changed (132) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +11 -0
  2. package/dist/alert-dialog.d.ts +44 -0
  3. package/dist/alert-dialog.d.ts.map +1 -0
  4. package/dist/alert-dialog.js +47 -0
  5. package/dist/checkbox.d.ts +34 -0
  6. package/dist/checkbox.d.ts.map +1 -0
  7. package/dist/checkbox.js +57 -0
  8. package/dist/choice-configuration/feedback-menu.d.ts +33 -0
  9. package/dist/choice-configuration/feedback-menu.d.ts.map +1 -0
  10. package/dist/choice-configuration/feedback-menu.js +85 -0
  11. package/dist/choice-configuration/index.d.ts +63 -0
  12. package/dist/choice-configuration/index.d.ts.map +1 -0
  13. package/dist/choice-configuration/index.js +240 -0
  14. package/dist/choice-utils.d.ts +22 -0
  15. package/dist/choice-utils.d.ts.map +1 -0
  16. package/dist/choice-utils.js +15 -0
  17. package/dist/feedback-config/feedback-selector.d.ts +34 -0
  18. package/dist/feedback-config/feedback-selector.d.ts.map +1 -0
  19. package/dist/feedback-config/feedback-selector.js +92 -0
  20. package/dist/feedback-config/group.d.ts +21 -0
  21. package/dist/feedback-config/group.d.ts.map +1 -0
  22. package/dist/feedback-config/group.js +33 -0
  23. package/dist/feedback-config/index.d.ts +49 -0
  24. package/dist/feedback-config/index.d.ts.map +1 -0
  25. package/dist/feedback-config/index.js +96 -0
  26. package/dist/form-section.d.ts +25 -0
  27. package/dist/form-section.d.ts.map +1 -0
  28. package/dist/form-section.js +25 -0
  29. package/dist/help.d.ts +42 -0
  30. package/dist/help.d.ts.map +1 -0
  31. package/dist/help.js +61 -0
  32. package/dist/index.d.ts +32 -0
  33. package/dist/index.d.ts.map +1 -0
  34. package/dist/index.js +34 -0
  35. package/dist/input.d.ts +30 -0
  36. package/dist/input.d.ts.map +1 -0
  37. package/dist/input.js +65 -0
  38. package/dist/inputs.d.ts +63 -0
  39. package/dist/inputs.d.ts.map +1 -0
  40. package/dist/inputs.js +70 -0
  41. package/dist/langs.d.ts +42 -0
  42. package/dist/langs.d.ts.map +1 -0
  43. package/dist/langs.js +76 -0
  44. package/dist/layout/config-layout.d.ts +11 -0
  45. package/dist/layout/config-layout.d.ts.map +1 -0
  46. package/dist/layout/config-layout.js +75 -0
  47. package/dist/layout/index.d.ts +12 -0
  48. package/dist/layout/index.d.ts.map +1 -0
  49. package/dist/layout/index.js +10 -0
  50. package/dist/layout/layout-contents.d.ts +22 -0
  51. package/dist/layout/layout-contents.d.ts.map +1 -0
  52. package/dist/layout/layout-contents.js +70 -0
  53. package/dist/layout/settings-box.d.ts +20 -0
  54. package/dist/layout/settings-box.d.ts.map +1 -0
  55. package/dist/layout/settings-box.js +31 -0
  56. package/dist/mui-box/index.d.ts +21 -0
  57. package/dist/mui-box/index.d.ts.map +1 -0
  58. package/dist/mui-box/index.js +47 -0
  59. package/dist/node_modules/.bun/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/esm/extends.js +12 -0
  60. package/dist/node_modules/.bun/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js +7 -0
  61. package/dist/node_modules/.bun/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +12 -0
  62. package/dist/node_modules/.bun/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +8 -0
  63. package/dist/node_modules/.bun/react-measure@2.5.2_6dbf9a050bc9aadb/node_modules/react-measure/dist/index.esm.js +122 -0
  64. package/dist/node_modules/.bun/resize-observer-polyfill@1.5.1/node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js +276 -0
  65. package/dist/number-text-field-custom.d.ts +52 -0
  66. package/dist/number-text-field-custom.d.ts.map +1 -0
  67. package/dist/number-text-field-custom.js +192 -0
  68. package/dist/number-text-field.d.ts +48 -0
  69. package/dist/number-text-field.d.ts.map +1 -0
  70. package/dist/number-text-field.js +122 -0
  71. package/dist/radio-with-label.d.ts +25 -0
  72. package/dist/radio-with-label.d.ts.map +1 -0
  73. package/dist/radio-with-label.js +27 -0
  74. package/dist/settings/display-size.d.ts +26 -0
  75. package/dist/settings/display-size.d.ts.map +1 -0
  76. package/dist/settings/display-size.js +45 -0
  77. package/dist/settings/index.d.ts +46 -0
  78. package/dist/settings/index.d.ts.map +1 -0
  79. package/dist/settings/index.js +63 -0
  80. package/dist/settings/panel.d.ts +28 -0
  81. package/dist/settings/panel.d.ts.map +1 -0
  82. package/dist/settings/panel.js +201 -0
  83. package/dist/settings/settings-radio-label.d.ts +25 -0
  84. package/dist/settings/settings-radio-label.d.ts.map +1 -0
  85. package/dist/settings/settings-radio-label.js +29 -0
  86. package/dist/settings/toggle.d.ts +25 -0
  87. package/dist/settings/toggle.d.ts.map +1 -0
  88. package/dist/settings/toggle.js +33 -0
  89. package/dist/tabs/index.d.ts +23 -0
  90. package/dist/tabs/index.d.ts.map +1 -0
  91. package/dist/tabs/index.js +39 -0
  92. package/dist/tags-input/index.d.ts +22 -0
  93. package/dist/tags-input/index.d.ts.map +1 -0
  94. package/dist/tags-input/index.js +83 -0
  95. package/dist/two-choice.d.ts +44 -0
  96. package/dist/two-choice.d.ts.map +1 -0
  97. package/dist/two-choice.js +79 -0
  98. package/dist/with-stateful-model.d.ts +22 -0
  99. package/dist/with-stateful-model.d.ts.map +1 -0
  100. package/dist/with-stateful-model.js +32 -0
  101. package/package.json +40 -0
  102. package/src/alert-dialog.tsx +85 -0
  103. package/src/checkbox.tsx +71 -0
  104. package/src/choice-configuration/feedback-menu.tsx +134 -0
  105. package/src/choice-configuration/index.tsx +400 -0
  106. package/src/choice-utils.ts +40 -0
  107. package/src/feedback-config/feedback-selector.tsx +153 -0
  108. package/src/feedback-config/group.tsx +61 -0
  109. package/src/feedback-config/index.tsx +121 -0
  110. package/src/form-section.tsx +41 -0
  111. package/src/help.tsx +89 -0
  112. package/src/index.ts +93 -0
  113. package/src/input.tsx +109 -0
  114. package/src/inputs.tsx +107 -0
  115. package/src/langs.tsx +121 -0
  116. package/src/layout/config-layout.tsx +113 -0
  117. package/src/layout/index.ts +14 -0
  118. package/src/layout/layout-contents.tsx +127 -0
  119. package/src/layout/settings-box.tsx +42 -0
  120. package/src/mui-box/index.tsx +66 -0
  121. package/src/number-text-field-custom.tsx +343 -0
  122. package/src/number-text-field.tsx +229 -0
  123. package/src/radio-with-label.tsx +40 -0
  124. package/src/settings/display-size.tsx +63 -0
  125. package/src/settings/index.ts +93 -0
  126. package/src/settings/panel.tsx +343 -0
  127. package/src/settings/settings-radio-label.tsx +42 -0
  128. package/src/settings/toggle.tsx +56 -0
  129. package/src/tabs/index.tsx +57 -0
  130. package/src/tags-input/index.tsx +126 -0
  131. package/src/two-choice.tsx +128 -0
  132. package/src/with-stateful-model.tsx +46 -0
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/config-ui/src/feedback-config/feedback-selector.jsx
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ import PropTypes from 'prop-types';
10
+ import React from 'react';
11
+ export declare const FeedbackType: {
12
+ type: PropTypes.Requireable<string>;
13
+ default: PropTypes.Requireable<string>;
14
+ custom: PropTypes.Requireable<string>;
15
+ };
16
+ export declare class FeedbackSelector extends React.Component {
17
+ static propTypes: {
18
+ keys: PropTypes.Requireable<(string | null | undefined)[]>;
19
+ label: PropTypes.Validator<string>;
20
+ feedback: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
21
+ type: PropTypes.Requireable<string>;
22
+ default: PropTypes.Requireable<string>;
23
+ custom: PropTypes.Requireable<string>;
24
+ }>>>;
25
+ onChange: PropTypes.Validator<(...args: any[]) => any>;
26
+ toolbarOpts: PropTypes.Requireable<object>;
27
+ mathMlOptions: PropTypes.Requireable<object>;
28
+ };
29
+ changeType: any;
30
+ changeCustom: any;
31
+ render(): JSX.Element;
32
+ }
33
+ export default FeedbackSelector;
34
+ //# sourceMappingURL=feedback-selector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feedback-selector.d.ts","sourceRoot":"","sources":["../../src/feedback-config/feedback-selector.tsx"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAgCH,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,MAAM,OAAO,CAAC;AAgD1B,eAAO,MAAM,YAAY;;;;CAIxB,CAAC;AAEF,qBAAa,gBAAiB,SAAQ,KAAK,CAAC,SAAS;IACnD,MAAM,CAAC,SAAS;;;;;;;;;;;MAOd;IAEF,UAAU,EAAE,GAAG,CAIb;IAEF,YAAY,EAAE,GAAG,CAIf;IAEF,MAAM;CAiCP;AAED,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,92 @@
1
+ import e from "./group.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 * as o from "@pie-lib/render-ui";
7
+ import { InputContainer as s } from "@pie-lib/render-ui";
8
+ import c from "@pie-lib/editable-html-tip-tap";
9
+ //#region src/feedback-config/feedback-selector.tsx
10
+ function l(e) {
11
+ return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
12
+ }
13
+ function u(e, t) {
14
+ return !e || l(e) ? e : l(e.default) ? e.default : t && l(e[t]) ? e[t] : t && l(e[t]?.default) ? e[t].default : e;
15
+ }
16
+ var d = u(s, "InputContainer") || u(m.InputContainer, "InputContainer"), f = o, p = f.default, m = p && typeof p == "object" ? p : f, h = r(c)(({ theme: e }) => ({ fontFamily: e.typography.fontFamily })), g = {
17
+ default: "Simple Feedback",
18
+ none: "No Feedback",
19
+ custom: "Customized Feedback"
20
+ }, _ = r("div")(({ theme: e }) => ({ marginBottom: e.spacing(1) })), v = r(d)(() => ({ paddingBottom: 0 })), y = r("div")(({ theme: e }) => ({
21
+ marginTop: "0px",
22
+ background: e.palette.grey[300],
23
+ padding: 0,
24
+ marginBottom: e.spacing(2),
25
+ borderRadius: "4px"
26
+ })), b = r("div")(({ theme: e }) => ({
27
+ marginTop: "0px",
28
+ background: e.palette.grey[300],
29
+ padding: e.spacing(2),
30
+ marginBottom: e.spacing(2),
31
+ borderRadius: "4px",
32
+ fontFamily: e.typography.fontFamily,
33
+ cursor: "default"
34
+ })), x = r(e)(({ theme: e }) => ({ paddingTop: e.spacing(1) })), S = {
35
+ type: n.oneOf([
36
+ "default",
37
+ "custom",
38
+ "none"
39
+ ]),
40
+ default: n.string,
41
+ custom: n.string
42
+ }, C = class extends t.Component {
43
+ static propTypes = {
44
+ keys: n.arrayOf(n.string),
45
+ label: n.string.isRequired,
46
+ feedback: n.shape(S).isRequired,
47
+ onChange: n.func.isRequired,
48
+ toolbarOpts: n.object,
49
+ mathMlOptions: n.object
50
+ };
51
+ changeType = (e) => {
52
+ let { onChange: t, feedback: n } = this.props;
53
+ t({
54
+ ...n,
55
+ type: e
56
+ });
57
+ };
58
+ changeCustom = (e) => {
59
+ let { onChange: t, feedback: n } = this.props;
60
+ t({
61
+ ...n,
62
+ type: "custom",
63
+ custom: e
64
+ });
65
+ };
66
+ render() {
67
+ let { keys: e, label: t, feedback: n, toolbarOpts: r, mathMlOptions: o = {} } = this.props;
68
+ return /* @__PURE__ */ a(_, { children: [
69
+ /* @__PURE__ */ i(v, {
70
+ label: t,
71
+ extraClasses: { label: { transform: "translateY(-20%)" } },
72
+ children: /* @__PURE__ */ i(x, {
73
+ keys: e || Object.keys(g),
74
+ label: t,
75
+ value: n.type,
76
+ onChange: this.changeType,
77
+ feedbackLabels: g
78
+ })
79
+ }),
80
+ n.type === "custom" && /* @__PURE__ */ i(y, { children: /* @__PURE__ */ i(h, {
81
+ onChange: this.changeCustom,
82
+ markup: n.custom || "",
83
+ toolbarOpts: r,
84
+ languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
85
+ mathMlOptions: o
86
+ }) }),
87
+ n.type === "default" && /* @__PURE__ */ a(b, { children: [" ", n.default] })
88
+ ] });
89
+ }
90
+ };
91
+ //#endregion
92
+ export { S as FeedbackType, C as default };
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/config-ui/src/feedback-config/group.jsx
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ import PropTypes from 'prop-types';
10
+ declare const Group: {
11
+ (props: any): JSX.Element;
12
+ propTypes: {
13
+ className: PropTypes.Requireable<string>;
14
+ feedbackLabels: PropTypes.Validator<object>;
15
+ value: PropTypes.Validator<string>;
16
+ keys: PropTypes.Requireable<(string | null | undefined)[]>;
17
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
18
+ };
19
+ };
20
+ export default Group;
21
+ //# sourceMappingURL=group.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"group.d.ts","sourceRoot":"","sources":["../../src/feedback-config/group.tsx"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,SAAS,MAAM,YAAY,CAAC;AAqBnC,QAAA,MAAM,KAAK;;;;;;;;;CAmBV,CAAC;AAUF,eAAe,KAAK,CAAC"}
@@ -0,0 +1,33 @@
1
+ import e from "../radio-with-label.js";
2
+ import "react";
3
+ import t from "prop-types";
4
+ import { styled as n } from "@mui/material/styles";
5
+ import { jsx as r } from "react/jsx-runtime";
6
+ //#region src/feedback-config/group.tsx
7
+ var i = n("div")(() => ({
8
+ display: "flex",
9
+ alignItems: "center"
10
+ })), a = n("div")(() => ({
11
+ display: "flex",
12
+ alignItems: "center"
13
+ })), o = n(e)(({ theme: e }) => ({ "& .MuiFormControlLabel-label": { fontSize: e.typography.fontSize - 2 } })), s = (e) => {
14
+ let { feedbackLabels: t, value: n, className: s, onChange: c, keys: l } = e;
15
+ return /* @__PURE__ */ r(i, {
16
+ className: s,
17
+ children: l.map((e) => /* @__PURE__ */ r(a, { children: /* @__PURE__ */ r(o, {
18
+ value: e,
19
+ checked: n === e,
20
+ onChange: (e) => c(e.currentTarget.value),
21
+ label: t[e]
22
+ }) }, e))
23
+ });
24
+ };
25
+ s.propTypes = {
26
+ className: t.string,
27
+ feedbackLabels: t.object.isRequired,
28
+ value: t.string.isRequired,
29
+ keys: t.arrayOf(t.string),
30
+ onChange: t.func
31
+ };
32
+ //#endregion
33
+ export { s as default };
@@ -0,0 +1,49 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/config-ui/src/feedback-config/index.jsx
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ import FeedbackSelector from './feedback-selector.js';
10
+ import PropTypes from 'prop-types';
11
+ import React from 'react';
12
+ export { FeedbackSelector };
13
+ export declare const buildDefaults: (input: any) => any;
14
+ export declare class FeedbackConfig extends React.Component {
15
+ static propTypes: {
16
+ allowPartial: PropTypes.Requireable<boolean>;
17
+ className: PropTypes.Requireable<string>;
18
+ feedback: PropTypes.Requireable<PropTypes.InferProps<{
19
+ correct: PropTypes.Requireable<PropTypes.InferProps<{
20
+ type: PropTypes.Requireable<string>;
21
+ default: PropTypes.Requireable<string>;
22
+ custom: PropTypes.Requireable<string>;
23
+ }>>;
24
+ incorrect: PropTypes.Requireable<PropTypes.InferProps<{
25
+ type: PropTypes.Requireable<string>;
26
+ default: PropTypes.Requireable<string>;
27
+ custom: PropTypes.Requireable<string>;
28
+ }>>;
29
+ partial: PropTypes.Requireable<PropTypes.InferProps<{
30
+ type: PropTypes.Requireable<string>;
31
+ default: PropTypes.Requireable<string>;
32
+ custom: PropTypes.Requireable<string>;
33
+ }>>;
34
+ }>>;
35
+ onChange: PropTypes.Validator<(...args: any[]) => any>;
36
+ toolbarOpts: PropTypes.Requireable<object>;
37
+ };
38
+ static defaultProps: {
39
+ allowPartial: boolean;
40
+ feedback: any;
41
+ };
42
+ onChange(key: any, config: any): void;
43
+ onCorrectChange: (config: any) => void;
44
+ onIncorrectChange: (config: any) => void;
45
+ onPartialChange: (config: any) => void;
46
+ render(): JSX.Element;
47
+ }
48
+ export default FeedbackConfig;
49
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/feedback-config/index.tsx"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,gBAAkC,MAAM,wBAAwB,CAAC;AACxE,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAa5B,eAAO,MAAM,aAAa,GAAI,UAAK,QAUlC,CAAC;AAEF,qBAAa,cAAe,SAAQ,KAAK,CAAC,SAAS;IACjD,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;;;;;;;;MAUd;IAEF,MAAM,CAAC,YAAY;;;MAGjB;IAEF,QAAQ,CAAC,GAAG,KAAA,EAAE,MAAM,KAAA;IAOpB,eAAe,wBAAuC;IAEtD,iBAAiB,wBAAyC;IAE1D,eAAe,wBAAuC;IAEtD,MAAM;CAwCP;AAED,eAAe,cAAc,CAAC"}
@@ -0,0 +1,96 @@
1
+ import e, { FeedbackType as t } from "./feedback-selector.js";
2
+ import n from "react";
3
+ import r from "prop-types";
4
+ import { styled as i } from "@mui/material/styles";
5
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
6
+ import { merge as s } from "lodash-es";
7
+ import c from "@mui/material/Accordion";
8
+ import l from "@mui/material/AccordionSummary";
9
+ import u from "@mui/material/AccordionDetails";
10
+ import d from "@mui/material/Typography";
11
+ import f from "@mui/icons-material/ExpandMore";
12
+ //#region src/feedback-config/index.tsx
13
+ var p = i("div")(() => ({
14
+ display: "flex",
15
+ flex: 1,
16
+ flexDirection: "column"
17
+ })), m = i(u)(() => ({
18
+ paddingTop: 0,
19
+ paddingBottom: 0
20
+ })), h = (e) => s({}, {
21
+ correct: {
22
+ type: "default",
23
+ default: "Correct"
24
+ },
25
+ incorrect: {
26
+ type: "default",
27
+ default: "Incorrect"
28
+ },
29
+ partial: {
30
+ type: "default",
31
+ default: "Nearly"
32
+ }
33
+ }, e), g = class extends n.Component {
34
+ static propTypes = {
35
+ allowPartial: r.bool,
36
+ className: r.string,
37
+ feedback: r.shape({
38
+ correct: r.shape(t),
39
+ incorrect: r.shape(t),
40
+ partial: r.shape(t)
41
+ }),
42
+ onChange: r.func.isRequired,
43
+ toolbarOpts: r.object
44
+ };
45
+ static defaultProps = {
46
+ allowPartial: !0,
47
+ feedback: h()
48
+ };
49
+ onChange(e, t) {
50
+ let { feedback: n, onChange: r } = this.props;
51
+ r({
52
+ ...n,
53
+ [e]: t
54
+ });
55
+ }
56
+ onCorrectChange = this.onChange.bind(this, "correct");
57
+ onIncorrectChange = this.onChange.bind(this, "incorrect");
58
+ onPartialChange = this.onChange.bind(this, "partial");
59
+ render() {
60
+ let { className: t, allowPartial: n, feedback: r, toolbarOpts: i } = this.props;
61
+ return /* @__PURE__ */ a("div", {
62
+ className: t,
63
+ children: /* @__PURE__ */ o(c, {
64
+ slotProps: { transition: { timeout: {
65
+ enter: 225,
66
+ exit: 195
67
+ } } },
68
+ children: [/* @__PURE__ */ a(l, {
69
+ expandIcon: /* @__PURE__ */ a(f, {}),
70
+ children: /* @__PURE__ */ a(d, { children: "Feedback" })
71
+ }), /* @__PURE__ */ a(m, { children: /* @__PURE__ */ o(p, { children: [
72
+ /* @__PURE__ */ a(e, {
73
+ label: "If correct, show",
74
+ feedback: r.correct,
75
+ onChange: this.onCorrectChange,
76
+ toolbarOpts: i
77
+ }),
78
+ n && /* @__PURE__ */ a(e, {
79
+ label: "If partially correct, show",
80
+ feedback: r.partial,
81
+ onChange: this.onPartialChange,
82
+ toolbarOpts: i
83
+ }),
84
+ /* @__PURE__ */ a(e, {
85
+ label: "If incorrect, show",
86
+ feedback: r.incorrect,
87
+ onChange: this.onIncorrectChange,
88
+ toolbarOpts: i
89
+ })
90
+ ] }) })]
91
+ })
92
+ });
93
+ }
94
+ };
95
+ //#endregion
96
+ export { h as buildDefaults, g as default };
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/config-ui/src/form-section.jsx
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ import PropTypes from 'prop-types';
10
+ declare const FormSection: {
11
+ ({ className, label, children, labelExtraStyle }: {
12
+ className: any;
13
+ label: any;
14
+ children: any;
15
+ labelExtraStyle: any;
16
+ }): JSX.Element;
17
+ propTypes: {
18
+ className: PropTypes.Requireable<string>;
19
+ label: PropTypes.Requireable<string>;
20
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
21
+ labelExtraStyle: PropTypes.Requireable<object>;
22
+ };
23
+ };
24
+ export default FormSection;
25
+ //# sourceMappingURL=form-section.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-section.d.ts","sourceRoot":"","sources":["../src/form-section.tsx"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAGH,OAAO,SAAS,MAAM,YAAY,CAAC;AAanC,QAAA,MAAM,WAAW;;;;;;;;;;;;;CAOhB,CAAC;AASF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,25 @@
1
+ import "react";
2
+ import e from "prop-types";
3
+ import { styled as t } from "@mui/material/styles";
4
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
5
+ import i from "@mui/material/Typography";
6
+ //#region src/form-section.tsx
7
+ var a = t("div")(({ theme: e }) => ({
8
+ marginTop: e.spacing(2),
9
+ marginBottom: e.spacing(2)
10
+ })), o = t(i)(({ theme: e }) => ({ marginBottom: e.spacing(1) })), s = ({ className: e, label: t, children: i, labelExtraStyle: s }) => /* @__PURE__ */ r(a, {
11
+ className: e,
12
+ children: [/* @__PURE__ */ n(o, {
13
+ variant: "subtitle1",
14
+ style: s,
15
+ children: t
16
+ }), i]
17
+ });
18
+ s.propTypes = {
19
+ className: e.string,
20
+ label: e.string,
21
+ children: e.node,
22
+ labelExtraStyle: e.object
23
+ };
24
+ //#endregion
25
+ export { s as default };
package/dist/help.d.ts ADDED
@@ -0,0 +1,42 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/config-ui/src/help.jsx
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ import PropTypes from 'prop-types';
10
+ import React from 'react';
11
+ export declare const HelpButton: {
12
+ ({ onClick }: {
13
+ onClick: any;
14
+ }): JSX.Element;
15
+ propTypes: {
16
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
17
+ };
18
+ };
19
+ export declare const HelpDialog: {
20
+ ({ open, onClose, children, title }: {
21
+ open: any;
22
+ onClose: any;
23
+ children: any;
24
+ title: any;
25
+ }): JSX.Element;
26
+ propTypes: {
27
+ open: PropTypes.Requireable<boolean>;
28
+ onClose: PropTypes.Requireable<(...args: any[]) => any>;
29
+ children: PropTypes.Validator<NonNullable<NonNullable<PropTypes.ReactNodeLike>>>;
30
+ title: PropTypes.Validator<string>;
31
+ };
32
+ };
33
+ declare class Help extends React.Component {
34
+ static propTypes: {
35
+ children: PropTypes.Validator<NonNullable<NonNullable<PropTypes.ReactNodeLike>>>;
36
+ title: PropTypes.Requireable<string>;
37
+ };
38
+ constructor(props: any);
39
+ render(): JSX.Element;
40
+ }
41
+ export default Help;
42
+ //# sourceMappingURL=help.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../src/help.tsx"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAOH,OAAO,SAAS,MAAM,YAAY,CAAC;AAKnC,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,eAAO,MAAM,UAAU;;;;;;;CAItB,CAAC;AAMF,eAAO,MAAM,UAAU;;;;;;;;;;;;;CAYtB,CAAC;AASF,cAAM,IAAK,SAAQ,KAAK,CAAC,SAAS;IAChC,MAAM,CAAC,SAAS;;;MAGd;gBAEU,KAAK,KAAA;IAOjB,MAAM;CAaP;AAED,eAAe,IAAI,CAAC"}
package/dist/help.js ADDED
@@ -0,0 +1,61 @@
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/Dialog";
6
+ import o from "@mui/material/DialogTitle";
7
+ import s from "@mui/material/DialogContentText";
8
+ import c from "@mui/material/DialogContent";
9
+ import l from "@mui/material/DialogActions";
10
+ import u from "@mui/material/Button";
11
+ import d from "@mui/icons-material/Help";
12
+ import f from "@mui/material/IconButton";
13
+ //#region src/help.tsx
14
+ var p = n(f)(({ theme: e }) => ({ "&:hover": { color: e.palette.grey[300] } })), m = ({ onClick: e }) => /* @__PURE__ */ r(p, {
15
+ onClick: e,
16
+ size: "large",
17
+ children: /* @__PURE__ */ r(d, {})
18
+ });
19
+ m.propTypes = { onClick: t.func };
20
+ var h = ({ open: e, onClose: t, children: n, title: d }) => /* @__PURE__ */ i(a, {
21
+ open: e,
22
+ onClose: t,
23
+ children: [
24
+ /* @__PURE__ */ r(o, { children: d }),
25
+ /* @__PURE__ */ r(c, { children: /* @__PURE__ */ r(s, { children: n }) }),
26
+ /* @__PURE__ */ r(l, { children: /* @__PURE__ */ r(u, {
27
+ onClick: t,
28
+ color: "primary",
29
+ children: "OK"
30
+ }) })
31
+ ]
32
+ });
33
+ h.propTypes = {
34
+ open: t.bool,
35
+ onClose: t.func,
36
+ children: t.oneOfType([t.arrayOf(t.node), t.node]).isRequired,
37
+ title: t.string.isRequired
38
+ };
39
+ var g = class extends e.Component {
40
+ static propTypes = {
41
+ children: t.oneOfType([t.arrayOf(t.node), t.node]).isRequired,
42
+ title: t.string
43
+ };
44
+ constructor(e) {
45
+ super(e), this.state = { open: !1 };
46
+ }
47
+ render() {
48
+ let { children: e, title: t } = this.props;
49
+ return /* @__PURE__ */ i("div", { children: [/* @__PURE__ */ r(m, {
50
+ color: "accent",
51
+ onClick: () => this.setState({ open: !0 })
52
+ }), /* @__PURE__ */ r(h, {
53
+ open: this.state.open,
54
+ title: t,
55
+ onClose: () => this.setState({ open: !1 }),
56
+ children: e
57
+ })] });
58
+ }
59
+ };
60
+ //#endregion
61
+ export { g as default };
@@ -0,0 +1,32 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/config-ui/src/index.js
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ import AlertDialog from './alert-dialog.js';
10
+ import FeedbackConfig, { buildDefaults as feedbackConfigDefaults, FeedbackSelector } from './feedback-config/index.js';
11
+ import { InputCheckbox, InputRadio, InputSwitch } from './inputs.js';
12
+ import Langs, { LanguageControls } from './langs.js';
13
+ import Tabs from './tabs/index.js';
14
+ import Checkbox from './checkbox.js';
15
+ import FormSection from './form-section.js';
16
+ import Help from './help.js';
17
+ import Input from './input.js';
18
+ declare const InputContainer: any;
19
+ import NumberTextField from './number-text-field.js';
20
+ import NumberTextFieldCustom from './number-text-field-custom.js';
21
+ import TwoChoice, { NChoice } from './two-choice.js';
22
+ import TagsInput from './tags-input/index.js';
23
+ import MuiBox from './mui-box/index.js';
24
+ import ChoiceConfiguration from './choice-configuration/index.js';
25
+ import * as layout from './layout/index.js';
26
+ import * as choiceUtils from './choice-utils.js';
27
+ import withStatefulModel from './with-stateful-model.js';
28
+ import Toggle from './settings/toggle.js';
29
+ import DisplaySize from './settings/display-size.js';
30
+ import * as settings from './settings/index.js';
31
+ export { AlertDialog, FeedbackConfig, FeedbackSelector, feedbackConfigDefaults, InputCheckbox, InputSwitch, InputRadio, Langs, LanguageControls, Tabs, Checkbox, FormSection, Help, Input, InputContainer, NumberTextField, NumberTextFieldCustom, TwoChoice, NChoice, TagsInput, MuiBox, ChoiceConfiguration, layout, choiceUtils, withStatefulModel, Toggle, DisplaySize, settings, };
32
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAC5C,OAAO,cAAc,EAAE,EAAE,aAAa,IAAI,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACvH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,KAAK,EAAE,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,IAAI,MAAM,iBAAiB,CAAC;AACnC,OAAO,QAAQ,MAAM,eAAe,CAAC;AACrC,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,KAAK,MAAM,YAAY,CAAC;AAsB/B,QAAA,MAAM,cAAc,KAA0I,CAAC;AAQ/J,OAAO,eAAe,MAAM,wBAAwB,CAAC;AACrD,OAAO,qBAAqB,MAAM,+BAA+B,CAAC;AAClE,OAAO,SAAS,EAAE,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,SAAS,MAAM,uBAAuB,CAAC;AAC9C,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,mBAAmB,MAAM,iCAAiC,CAAC;AAClE,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAE5C,OAAO,KAAK,WAAW,MAAM,mBAAmB,CAAC;AACjD,OAAO,iBAAiB,MAAM,0BAA0B,CAAC;AACzD,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,WAAW,MAAM,4BAA4B,CAAC;AAErD,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAEhD,OAAO,EACL,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,aAAa,EACb,WAAW,EACX,UAAU,EACV,KAAK,EACL,gBAAgB,EAChB,IAAI,EACJ,QAAQ,EACR,WAAW,EACX,IAAI,EACJ,KAAK,EACL,cAAc,EACd,eAAe,EACf,qBAAqB,EACrB,SAAS,EACT,OAAO,EACP,SAAS,EACT,MAAM,EACN,mBAAmB,EACnB,MAAM,EACN,WAAW,EACX,iBAAiB,EACjB,MAAM,EACN,WAAW,EACX,QAAQ,GACT,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,34 @@
1
+ import e from "./alert-dialog.js";
2
+ import t from "./feedback-config/feedback-selector.js";
3
+ import n, { buildDefaults as r } from "./feedback-config/index.js";
4
+ import { InputCheckbox as i, InputRadio as a, InputSwitch as o } from "./inputs.js";
5
+ import s, { LanguageControls as c } from "./langs.js";
6
+ import l from "./tabs/index.js";
7
+ import u from "./checkbox.js";
8
+ import d from "./form-section.js";
9
+ import f from "./help.js";
10
+ import p from "./input.js";
11
+ import m from "./number-text-field.js";
12
+ import h from "./number-text-field-custom.js";
13
+ import g, { NChoice as _ } from "./two-choice.js";
14
+ import v from "./mui-box/index.js";
15
+ import y from "./tags-input/index.js";
16
+ import b from "./choice-configuration/index.js";
17
+ import { layout_exports as x } from "./layout/index.js";
18
+ import { choice_utils_exports as S } from "./choice-utils.js";
19
+ import C from "./with-stateful-model.js";
20
+ import w from "./settings/toggle.js";
21
+ import T from "./settings/display-size.js";
22
+ import { settings_exports as E } from "./settings/index.js";
23
+ import * as D from "@pie-lib/render-ui";
24
+ import { InputContainer as O } from "@pie-lib/render-ui";
25
+ //#region src/index.ts
26
+ function k(e) {
27
+ return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
28
+ }
29
+ function A(e, t) {
30
+ return !e || k(e) ? e : k(e.default) ? e.default : t && k(e[t]) ? e[t] : t && k(e[t]?.default) ? e[t].default : e;
31
+ }
32
+ var j = A(O, "InputContainer") || A(P.InputContainer, "InputContainer"), M = D, N = M.default, P = N && typeof N == "object" ? N : M;
33
+ //#endregion
34
+ export { e as AlertDialog, u as Checkbox, b as ChoiceConfiguration, T as DisplaySize, n as FeedbackConfig, t as FeedbackSelector, d as FormSection, f as Help, p as Input, i as InputCheckbox, j as InputContainer, a as InputRadio, o as InputSwitch, s as Langs, c as LanguageControls, v as MuiBox, _ as NChoice, m as NumberTextField, h as NumberTextFieldCustom, l as Tabs, y as TagsInput, w as Toggle, g as TwoChoice, S as choiceUtils, r as feedbackConfigDefaults, x as layout, E as settings, C as withStatefulModel };
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @synced-from pie-lib/packages/config-ui/src/input.jsx
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ import * as React from 'react';
10
+ import PropTypes from 'prop-types';
11
+ export default class Input extends React.Component {
12
+ static propTypes: {
13
+ value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
14
+ onChange: PropTypes.Validator<(...args: any[]) => any>;
15
+ label: PropTypes.Requireable<string>;
16
+ type: PropTypes.Validator<string>;
17
+ error: PropTypes.Requireable<(...args: any[]) => any>;
18
+ noModelUpdateOnError: PropTypes.Requireable<boolean>;
19
+ };
20
+ static defaultProps: {
21
+ type: string;
22
+ error: (value: any, type: any) => boolean;
23
+ noModelUpdateOnError: boolean;
24
+ };
25
+ constructor(props: any);
26
+ UNSAFE_componentWillReceiveProps(newProps: any): void;
27
+ onChange: any;
28
+ render(): JSX.Element;
29
+ }
30
+ //# sourceMappingURL=input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../src/input.tsx"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,SAAS,MAAM,YAAY,CAAC;AA+BnC,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,KAAK,CAAC,SAAS;IAChD,MAAM,CAAC,SAAS;;;;;;;MAOd;IAEF,MAAM,CAAC,YAAY;;;;MAIjB;gBAEU,KAAK,KAAA;IAQjB,gCAAgC,CAAC,QAAQ,KAAA;IAMzC,QAAQ,EAAE,GAAG,CAiBX;IAEF,MAAM;CAiBP"}