@pie-lib/correct-answer-toggle 5.0.7-next.20261019015909 → 5.0.7-next.20261019062545

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 (2) hide show
  1. package/dist/index.js +21 -19
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -8,24 +8,25 @@ import { Readable as o, color as s } from "@pie-lib/render-ui";
8
8
  import { jsx as c, jsxs as l } from "react/jsx-runtime";
9
9
  import u from "react";
10
10
  import d from "prop-types";
11
+ import { elementLanguageAttributes as f } from "@pie-element/shared-i18n";
11
12
  //#region src/index.tsx
12
- function f(e) {
13
+ function p(e) {
13
14
  return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
14
15
  }
15
- function p(e, t) {
16
- return !e || f(e) ? e : f(e.default) ? e.default : t && f(e[t]) ? e[t] : t && f(e[t]?.default) ? e[t].default : e;
16
+ function m(e, t) {
17
+ return !e || p(e) ? e : p(e.default) ? e.default : t && p(e[t]) ? e[t] : t && p(e[t]?.default) ? e[t].default : e;
17
18
  }
18
- var m = a, h = m.default, g = h && typeof h == "object" ? h : m, _ = p(o, "Readable") || p(g.Readable, "Readable"), v = {
19
+ var h = a, g = h.default, _ = g && typeof g == "object" ? g : h, v = m(o, "Readable") || m(_.Readable, "Readable"), y = {
19
20
  WebkitTouchCallout: "none",
20
21
  WebkitUserSelect: "none",
21
22
  KhtmlUserSelect: "none",
22
23
  MozUserSelect: "none",
23
24
  msUserSelect: "none",
24
25
  userSelect: "none"
25
- }, y = n("div")(() => ({
26
+ }, b = n("div")(() => ({
26
27
  width: "100%",
27
28
  cursor: "pointer"
28
- })), b = n("button")(() => ({
29
+ })), x = n("button")(() => ({
29
30
  margin: "0 auto",
30
31
  textAlign: "center",
31
32
  display: "flex",
@@ -41,15 +42,15 @@ var m = a, h = m.default, g = h && typeof h == "object" ? h : m, _ = p(o, "Reada
41
42
  outline: `2px solid ${s.buttonFocusOutline()}`,
42
43
  outlineOffset: "-2px"
43
44
  }
44
- })), x = n("div")(() => ({
45
+ })), S = n("div")(() => ({
45
46
  width: "fit-content",
46
47
  minWidth: "140px",
47
48
  alignSelf: "center",
48
49
  verticalAlign: "middle",
49
50
  color: `var(--correct-answer-toggle-label-color, ${s.text()})`,
50
51
  fontWeight: "normal",
51
- ...v
52
- })), S = n("div")(() => ({
52
+ ...y
53
+ })), C = n("div")(() => ({
53
54
  position: "absolute",
54
55
  width: "25px",
55
56
  "&.enter": { opacity: "0" },
@@ -62,12 +63,12 @@ var m = a, h = m.default, g = h && typeof h == "object" ? h : m, _ = p(o, "Reada
62
63
  opacity: "0",
63
64
  transition: "opacity 0.3s ease-in"
64
65
  }
65
- })), C = n("div")(() => ({
66
+ })), w = n("div")(() => ({
66
67
  width: "25px",
67
68
  marginRight: "5px",
68
69
  display: "flex",
69
70
  alignItems: "center"
70
- })), w = class extends u.Component {
71
+ })), T = class extends u.Component {
71
72
  static propTypes = {
72
73
  onToggle: d.func,
73
74
  toggled: d.bool,
@@ -96,16 +97,17 @@ var m = a, h = m.default, g = h && typeof h == "object" ? h : m, _ = p(o, "Reada
96
97
  }
97
98
  render() {
98
99
  let { className: n, toggled: a, language: o } = this.props, s = t.forLocale(o, this.relabel), u = this.props.hideMessage ?? s.t("hideCorrectAnswer"), d = this.props.showMessage ?? s.t("showCorrectAnswer");
99
- return /* @__PURE__ */ c(y, {
100
+ return /* @__PURE__ */ c(b, {
100
101
  className: n,
102
+ ...f(o),
101
103
  children: /* @__PURE__ */ c(e, {
102
104
  show: this.state.show,
103
- children: /* @__PURE__ */ l(b, {
105
+ children: /* @__PURE__ */ l(x, {
104
106
  type: "button",
105
107
  "aria-pressed": !!a,
106
108
  onClick: this.onClick.bind(this),
107
109
  onTouchEnd: this.onTouch.bind(this),
108
- children: [/* @__PURE__ */ l(C, { children: [/* @__PURE__ */ c(r, {
110
+ children: [/* @__PURE__ */ l(w, { children: [/* @__PURE__ */ c(r, {
109
111
  nodeRef: this.openIconRef,
110
112
  timeout: 400,
111
113
  in: a,
@@ -116,7 +118,7 @@ var m = a, h = m.default, g = h && typeof h == "object" ? h : m, _ = p(o, "Reada
116
118
  exit: "exit",
117
119
  exitActive: "exit-active"
118
120
  },
119
- children: /* @__PURE__ */ c(S, {
121
+ children: /* @__PURE__ */ c(C, {
120
122
  ref: this.openIconRef,
121
123
  children: /* @__PURE__ */ c(i, { open: a }, "correct-open")
122
124
  })
@@ -131,13 +133,13 @@ var m = a, h = m.default, g = h && typeof h == "object" ? h : m, _ = p(o, "Reada
131
133
  exit: "exit",
132
134
  exitActive: "exit-active"
133
135
  },
134
- children: /* @__PURE__ */ c(S, {
136
+ children: /* @__PURE__ */ c(C, {
135
137
  ref: this.closedIconRef,
136
138
  children: /* @__PURE__ */ c(i, { open: a }, "correct-closed")
137
139
  })
138
- })] }), /* @__PURE__ */ c(_, {
140
+ })] }), /* @__PURE__ */ c(v, {
139
141
  false: !0,
140
- children: /* @__PURE__ */ c(x, {
142
+ children: /* @__PURE__ */ c(S, {
141
143
  "aria-hidden": !this.state.show,
142
144
  children: a ? u : d
143
145
  })
@@ -148,4 +150,4 @@ var m = a, h = m.default, g = h && typeof h == "object" ? h : m, _ = p(o, "Reada
148
150
  }
149
151
  };
150
152
  //#endregion
151
- export { w as CorrectAnswerToggle, w as default };
153
+ export { T as CorrectAnswerToggle, T as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-lib/correct-answer-toggle",
3
- "version": "5.0.7-next.20261019015909",
3
+ "version": "5.0.7-next.20261019062545",
4
4
  "description": "A react based toggle component",
5
5
  "repository": {
6
6
  "type": "git",
@@ -13,8 +13,8 @@
13
13
  "@mui/icons-material": "^7.3.4",
14
14
  "@mui/material": "^7.3.4",
15
15
  "@pie-lib/icons": "5.0.2-next.20261006160832",
16
- "@pie-lib/render-ui": "8.0.7-next.20261019015909",
17
- "@pie-element/shared-i18n": "0.1.2-next.20261019015909",
16
+ "@pie-lib/render-ui": "8.0.7-next.20261019062545",
17
+ "@pie-element/shared-i18n": "0.1.2-next.20261019062545",
18
18
  "prop-types": "^15.6.2",
19
19
  "react-transition-group": "^4.4.5",
20
20
  "@pie-element/shared-lodash": "0.1.3-next.20261012213240"