@birimengo/calculator 1.0.2 → 1.0.4
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/index.es.js +418 -370
- package/dist/index.umd.js +2 -8
- package/package.json +11 -38
package/dist/index.es.js
CHANGED
|
@@ -1,149 +1,148 @@
|
|
|
1
|
-
import le, {
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return l = n.ref, {
|
|
1
|
+
import le, { memo as B, useState as R, useEffect as ce, useCallback as E } from "react";
|
|
2
|
+
var L = { exports: {} }, V = {};
|
|
3
|
+
var ee;
|
|
4
|
+
function ie() {
|
|
5
|
+
if (ee) return V;
|
|
6
|
+
ee = 1;
|
|
7
|
+
var r = /* @__PURE__ */ Symbol.for("react.transitional.element"), t = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
8
|
+
function c(u, s, o) {
|
|
9
|
+
var f = null;
|
|
10
|
+
if (o !== void 0 && (f = "" + o), s.key !== void 0 && (f = "" + s.key), "key" in s) {
|
|
11
|
+
o = {};
|
|
12
|
+
for (var g in s)
|
|
13
|
+
g !== "key" && (o[g] = s[g]);
|
|
14
|
+
} else o = s;
|
|
15
|
+
return s = o.ref, {
|
|
17
16
|
$$typeof: r,
|
|
18
|
-
type:
|
|
19
|
-
key:
|
|
20
|
-
ref:
|
|
21
|
-
props:
|
|
17
|
+
type: u,
|
|
18
|
+
key: f,
|
|
19
|
+
ref: s !== void 0 ? s : null,
|
|
20
|
+
props: o
|
|
22
21
|
};
|
|
23
22
|
}
|
|
24
|
-
return
|
|
23
|
+
return V.Fragment = t, V.jsx = c, V.jsxs = c, V;
|
|
25
24
|
}
|
|
26
|
-
var
|
|
27
|
-
var
|
|
28
|
-
function
|
|
29
|
-
return
|
|
25
|
+
var I = {};
|
|
26
|
+
var re;
|
|
27
|
+
function ue() {
|
|
28
|
+
return re || (re = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
30
29
|
function r(e) {
|
|
31
30
|
if (e == null) return null;
|
|
32
31
|
if (typeof e == "function")
|
|
33
|
-
return e.$$typeof ===
|
|
32
|
+
return e.$$typeof === j ? null : e.displayName || e.name || null;
|
|
34
33
|
if (typeof e == "string") return e;
|
|
35
34
|
switch (e) {
|
|
36
|
-
case
|
|
35
|
+
case w:
|
|
37
36
|
return "Fragment";
|
|
38
|
-
case
|
|
37
|
+
case M:
|
|
39
38
|
return "Profiler";
|
|
40
|
-
case
|
|
39
|
+
case F:
|
|
41
40
|
return "StrictMode";
|
|
42
41
|
case x:
|
|
43
42
|
return "Suspense";
|
|
44
|
-
case
|
|
43
|
+
case N:
|
|
45
44
|
return "SuspenseList";
|
|
46
|
-
case
|
|
45
|
+
case k:
|
|
47
46
|
return "Activity";
|
|
48
47
|
}
|
|
49
48
|
if (typeof e == "object")
|
|
50
49
|
switch (typeof e.tag == "number" && console.error(
|
|
51
50
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
52
51
|
), e.$$typeof) {
|
|
53
|
-
case
|
|
52
|
+
case $:
|
|
54
53
|
return "Portal";
|
|
55
54
|
case Y:
|
|
56
55
|
return e.displayName || "Context";
|
|
57
|
-
case
|
|
56
|
+
case D:
|
|
58
57
|
return (e._context.displayName || "Context") + ".Consumer";
|
|
59
|
-
case
|
|
60
|
-
var
|
|
61
|
-
return e = e.displayName, e || (e =
|
|
62
|
-
case
|
|
63
|
-
return
|
|
64
|
-
case
|
|
65
|
-
|
|
58
|
+
case l:
|
|
59
|
+
var a = e.render;
|
|
60
|
+
return e = e.displayName, e || (e = a.displayName || a.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
61
|
+
case i:
|
|
62
|
+
return a = e.displayName || null, a !== null ? a : r(e.type) || "Memo";
|
|
63
|
+
case p:
|
|
64
|
+
a = e._payload, e = e._init;
|
|
66
65
|
try {
|
|
67
|
-
return r(e(
|
|
66
|
+
return r(e(a));
|
|
68
67
|
} catch {
|
|
69
68
|
}
|
|
70
69
|
}
|
|
71
70
|
return null;
|
|
72
71
|
}
|
|
73
|
-
function
|
|
72
|
+
function t(e) {
|
|
74
73
|
return "" + e;
|
|
75
74
|
}
|
|
76
75
|
function c(e) {
|
|
77
76
|
try {
|
|
78
|
-
|
|
79
|
-
var
|
|
77
|
+
t(e);
|
|
78
|
+
var a = !1;
|
|
80
79
|
} catch {
|
|
81
|
-
|
|
80
|
+
a = !0;
|
|
82
81
|
}
|
|
83
|
-
if (
|
|
84
|
-
|
|
85
|
-
var
|
|
86
|
-
return
|
|
87
|
-
|
|
82
|
+
if (a) {
|
|
83
|
+
a = console;
|
|
84
|
+
var m = a.error, b = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
85
|
+
return m.call(
|
|
86
|
+
a,
|
|
88
87
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
89
|
-
|
|
90
|
-
),
|
|
88
|
+
b
|
|
89
|
+
), t(e);
|
|
91
90
|
}
|
|
92
91
|
}
|
|
93
|
-
function
|
|
94
|
-
if (e ===
|
|
95
|
-
if (typeof e == "object" && e !== null && e.$$typeof ===
|
|
92
|
+
function u(e) {
|
|
93
|
+
if (e === w) return "<>";
|
|
94
|
+
if (typeof e == "object" && e !== null && e.$$typeof === p)
|
|
96
95
|
return "<...>";
|
|
97
96
|
try {
|
|
98
|
-
var
|
|
99
|
-
return
|
|
97
|
+
var a = r(e);
|
|
98
|
+
return a ? "<" + a + ">" : "<...>";
|
|
100
99
|
} catch {
|
|
101
100
|
return "<...>";
|
|
102
101
|
}
|
|
103
102
|
}
|
|
104
|
-
function
|
|
105
|
-
var e =
|
|
103
|
+
function s() {
|
|
104
|
+
var e = W.A;
|
|
106
105
|
return e === null ? null : e.getOwner();
|
|
107
106
|
}
|
|
108
|
-
function
|
|
107
|
+
function o() {
|
|
109
108
|
return Error("react-stack-top-frame");
|
|
110
109
|
}
|
|
111
|
-
function
|
|
112
|
-
if (
|
|
113
|
-
var
|
|
114
|
-
if (
|
|
110
|
+
function f(e) {
|
|
111
|
+
if (G.call(e, "key")) {
|
|
112
|
+
var a = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
113
|
+
if (a && a.isReactWarning) return !1;
|
|
115
114
|
}
|
|
116
115
|
return e.key !== void 0;
|
|
117
116
|
}
|
|
118
|
-
function
|
|
119
|
-
function
|
|
120
|
-
|
|
117
|
+
function g(e, a) {
|
|
118
|
+
function m() {
|
|
119
|
+
X || (X = !0, console.error(
|
|
121
120
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
122
|
-
|
|
121
|
+
a
|
|
123
122
|
));
|
|
124
123
|
}
|
|
125
|
-
|
|
126
|
-
get:
|
|
124
|
+
m.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
125
|
+
get: m,
|
|
127
126
|
configurable: !0
|
|
128
127
|
});
|
|
129
128
|
}
|
|
130
|
-
function
|
|
129
|
+
function C() {
|
|
131
130
|
var e = r(this.type);
|
|
132
|
-
return
|
|
131
|
+
return H[e] || (H[e] = !0, console.error(
|
|
133
132
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
134
133
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
135
134
|
}
|
|
136
|
-
function
|
|
137
|
-
var
|
|
135
|
+
function y(e, a, m, b, q, J) {
|
|
136
|
+
var h = m.ref;
|
|
138
137
|
return e = {
|
|
139
|
-
$$typeof:
|
|
138
|
+
$$typeof: P,
|
|
140
139
|
type: e,
|
|
141
|
-
key:
|
|
142
|
-
props:
|
|
143
|
-
_owner:
|
|
144
|
-
}, (
|
|
140
|
+
key: a,
|
|
141
|
+
props: m,
|
|
142
|
+
_owner: b
|
|
143
|
+
}, (h !== void 0 ? h : null) !== null ? Object.defineProperty(e, "ref", {
|
|
145
144
|
enumerable: !1,
|
|
146
|
-
get:
|
|
145
|
+
get: C
|
|
147
146
|
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
148
147
|
configurable: !1,
|
|
149
148
|
enumerable: !1,
|
|
@@ -158,119 +157,313 @@ function ke() {
|
|
|
158
157
|
configurable: !1,
|
|
159
158
|
enumerable: !1,
|
|
160
159
|
writable: !0,
|
|
161
|
-
value:
|
|
160
|
+
value: q
|
|
162
161
|
}), Object.defineProperty(e, "_debugTask", {
|
|
163
162
|
configurable: !1,
|
|
164
163
|
enumerable: !1,
|
|
165
164
|
writable: !0,
|
|
166
|
-
value:
|
|
165
|
+
value: J
|
|
167
166
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
168
167
|
}
|
|
169
|
-
function
|
|
170
|
-
var
|
|
171
|
-
if (
|
|
172
|
-
if (
|
|
173
|
-
if (
|
|
174
|
-
for (
|
|
175
|
-
|
|
176
|
-
Object.freeze && Object.freeze(
|
|
168
|
+
function T(e, a, m, b, q, J) {
|
|
169
|
+
var h = a.children;
|
|
170
|
+
if (h !== void 0)
|
|
171
|
+
if (b)
|
|
172
|
+
if (se(h)) {
|
|
173
|
+
for (b = 0; b < h.length; b++)
|
|
174
|
+
v(h[b]);
|
|
175
|
+
Object.freeze && Object.freeze(h);
|
|
177
176
|
} else
|
|
178
177
|
console.error(
|
|
179
178
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
180
179
|
);
|
|
181
|
-
else
|
|
182
|
-
if (
|
|
183
|
-
|
|
184
|
-
var
|
|
180
|
+
else v(h);
|
|
181
|
+
if (G.call(a, "key")) {
|
|
182
|
+
h = r(e);
|
|
183
|
+
var A = Object.keys(a).filter(function(oe) {
|
|
185
184
|
return oe !== "key";
|
|
186
185
|
});
|
|
187
|
-
|
|
186
|
+
b = 0 < A.length ? "{key: someKey, " + A.join(": ..., ") + ": ...}" : "{key: someKey}", K[h + b] || (A = 0 < A.length ? "{" + A.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
188
187
|
`A props object containing a "key" prop is being spread into JSX:
|
|
189
188
|
let props = %s;
|
|
190
189
|
<%s {...props} />
|
|
191
190
|
React keys must be passed directly to JSX without using spread:
|
|
192
191
|
let props = %s;
|
|
193
192
|
<%s key={someKey} {...props} />`,
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
),
|
|
193
|
+
b,
|
|
194
|
+
h,
|
|
195
|
+
A,
|
|
196
|
+
h
|
|
197
|
+
), K[h + b] = !0);
|
|
199
198
|
}
|
|
200
|
-
if (
|
|
201
|
-
|
|
202
|
-
for (var
|
|
203
|
-
|
|
204
|
-
} else
|
|
205
|
-
return
|
|
206
|
-
|
|
199
|
+
if (h = null, m !== void 0 && (c(m), h = "" + m), f(a) && (c(a.key), h = "" + a.key), "key" in a) {
|
|
200
|
+
m = {};
|
|
201
|
+
for (var z in a)
|
|
202
|
+
z !== "key" && (m[z] = a[z]);
|
|
203
|
+
} else m = a;
|
|
204
|
+
return h && g(
|
|
205
|
+
m,
|
|
207
206
|
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
208
|
-
),
|
|
207
|
+
), y(
|
|
209
208
|
e,
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
209
|
+
h,
|
|
210
|
+
m,
|
|
211
|
+
s(),
|
|
212
|
+
q,
|
|
213
|
+
J
|
|
215
214
|
);
|
|
216
215
|
}
|
|
217
|
-
function
|
|
218
|
-
|
|
216
|
+
function v(e) {
|
|
217
|
+
O(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === p && (e._payload.status === "fulfilled" ? O(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
219
218
|
}
|
|
220
|
-
function
|
|
221
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
219
|
+
function O(e) {
|
|
220
|
+
return typeof e == "object" && e !== null && e.$$typeof === P;
|
|
222
221
|
}
|
|
223
|
-
var
|
|
222
|
+
var S = le, P = /* @__PURE__ */ Symbol.for("react.transitional.element"), $ = /* @__PURE__ */ Symbol.for("react.portal"), w = /* @__PURE__ */ Symbol.for("react.fragment"), F = /* @__PURE__ */ Symbol.for("react.strict_mode"), M = /* @__PURE__ */ Symbol.for("react.profiler"), D = /* @__PURE__ */ Symbol.for("react.consumer"), Y = /* @__PURE__ */ Symbol.for("react.context"), l = /* @__PURE__ */ Symbol.for("react.forward_ref"), x = /* @__PURE__ */ Symbol.for("react.suspense"), N = /* @__PURE__ */ Symbol.for("react.suspense_list"), i = /* @__PURE__ */ Symbol.for("react.memo"), p = /* @__PURE__ */ Symbol.for("react.lazy"), k = /* @__PURE__ */ Symbol.for("react.activity"), j = /* @__PURE__ */ Symbol.for("react.client.reference"), W = S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, G = Object.prototype.hasOwnProperty, se = Array.isArray, U = console.createTask ? console.createTask : function() {
|
|
224
223
|
return null;
|
|
225
224
|
};
|
|
226
|
-
|
|
225
|
+
S = {
|
|
227
226
|
react_stack_bottom_frame: function(e) {
|
|
228
227
|
return e();
|
|
229
228
|
}
|
|
230
229
|
};
|
|
231
|
-
var
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
)(),
|
|
235
|
-
|
|
236
|
-
var
|
|
237
|
-
return
|
|
230
|
+
var X, H = {}, Q = S.react_stack_bottom_frame.bind(
|
|
231
|
+
S,
|
|
232
|
+
o
|
|
233
|
+
)(), Z = U(u(o)), K = {};
|
|
234
|
+
I.Fragment = w, I.jsx = function(e, a, m) {
|
|
235
|
+
var b = 1e4 > W.recentlyCreatedOwnerStacks++;
|
|
236
|
+
return T(
|
|
238
237
|
e,
|
|
239
|
-
|
|
240
|
-
|
|
238
|
+
a,
|
|
239
|
+
m,
|
|
241
240
|
!1,
|
|
242
|
-
|
|
243
|
-
|
|
241
|
+
b ? Error("react-stack-top-frame") : Q,
|
|
242
|
+
b ? U(u(e)) : Z
|
|
244
243
|
);
|
|
245
|
-
},
|
|
246
|
-
var
|
|
247
|
-
return
|
|
244
|
+
}, I.jsxs = function(e, a, m) {
|
|
245
|
+
var b = 1e4 > W.recentlyCreatedOwnerStacks++;
|
|
246
|
+
return T(
|
|
248
247
|
e,
|
|
249
|
-
|
|
250
|
-
|
|
248
|
+
a,
|
|
249
|
+
m,
|
|
251
250
|
!0,
|
|
252
|
-
|
|
253
|
-
|
|
251
|
+
b ? Error("react-stack-top-frame") : Q,
|
|
252
|
+
b ? U(u(e)) : Z
|
|
254
253
|
);
|
|
255
254
|
};
|
|
256
|
-
})()),
|
|
255
|
+
})()), I;
|
|
257
256
|
}
|
|
258
|
-
var
|
|
259
|
-
function
|
|
260
|
-
return
|
|
257
|
+
var te;
|
|
258
|
+
function de() {
|
|
259
|
+
return te || (te = 1, process.env.NODE_ENV === "production" ? L.exports = ie() : L.exports = ue()), L.exports;
|
|
261
260
|
}
|
|
262
|
-
var
|
|
263
|
-
const
|
|
261
|
+
var n = de();
|
|
262
|
+
const ne = B(({ value: r, memory: t, expression: c }) => /* @__PURE__ */ n.jsxs("div", { className: "border border-white/30 rounded-2xl p-6 bg-black/5", children: [
|
|
263
|
+
/* @__PURE__ */ n.jsx("div", { className: "text-right text-sm text-blue-600 dark:text-blue-400 font-mono mb-1 h-5 opacity-70", children: c }),
|
|
264
|
+
/* @__PURE__ */ n.jsx("div", { className: "text-right", children: /* @__PURE__ */ n.jsx("div", { className: "text-6xl font-light text-blue-600 dark:text-blue-400 font-mono tracking-tight", children: r }) }),
|
|
265
|
+
t !== 0 && /* @__PURE__ */ n.jsxs("div", { className: "absolute top-2 left-2 text-xs border border-white/30 rounded-full px-2 py-1 bg-black/5 text-blue-600 dark:text-blue-400 font-medium", children: [
|
|
266
|
+
"M=",
|
|
267
|
+
t
|
|
268
|
+
] })
|
|
269
|
+
] }));
|
|
270
|
+
ne.displayName = "Display";
|
|
271
|
+
const d = B(({
|
|
272
|
+
children: r,
|
|
273
|
+
onClick: t,
|
|
274
|
+
type: c = "number",
|
|
275
|
+
className: u = ""
|
|
276
|
+
}) => {
|
|
277
|
+
const s = "px-4 py-3 text-base rounded-lg font-semibold transition-all duration-200 active:scale-95 shadow-sm border border-white/30 hover:border-white/60", o = {
|
|
278
|
+
// Number buttons: blue text, subtle background
|
|
279
|
+
number: "bg-black/5 text-blue-600 dark:text-blue-400 hover:bg-black/10",
|
|
280
|
+
// Operator buttons: blue text, slightly darker background
|
|
281
|
+
operator: "bg-black/10 text-blue-600 dark:text-blue-400 hover:bg-black/20",
|
|
282
|
+
// Function buttons: blue text, subtle background
|
|
283
|
+
function: "bg-black/5 text-blue-600 dark:text-blue-400 hover:bg-black/10",
|
|
284
|
+
// Equals button: blue text, slightly darker
|
|
285
|
+
equals: "bg-black/10 text-blue-600 dark:text-blue-400 hover:bg-black/20",
|
|
286
|
+
// Memory buttons: blue text, subtle background
|
|
287
|
+
memory: "bg-black/5 text-blue-600 dark:text-blue-400 hover:bg-black/10 text-sm"
|
|
288
|
+
};
|
|
289
|
+
return /* @__PURE__ */ n.jsx(
|
|
290
|
+
"button",
|
|
291
|
+
{
|
|
292
|
+
onClick: t,
|
|
293
|
+
className: `${s} ${o[c]} ${u}`,
|
|
294
|
+
children: r
|
|
295
|
+
}
|
|
296
|
+
);
|
|
297
|
+
});
|
|
298
|
+
d.displayName = "Button";
|
|
299
|
+
const ae = B(({
|
|
300
|
+
onNumber: r,
|
|
301
|
+
onDecimal: t,
|
|
302
|
+
onOperator: c,
|
|
303
|
+
onEquals: u,
|
|
304
|
+
onClear: s,
|
|
305
|
+
onBackspace: o,
|
|
306
|
+
onPercentage: f,
|
|
307
|
+
onToggleSign: g,
|
|
308
|
+
onMemoryAdd: C,
|
|
309
|
+
onMemorySubtract: y,
|
|
310
|
+
onMemoryRecall: T,
|
|
311
|
+
onMemoryClear: v
|
|
312
|
+
}) => /* @__PURE__ */ n.jsxs("div", { className: "space-y-2", children: [
|
|
313
|
+
/* @__PURE__ */ n.jsxs("div", { className: "grid grid-cols-4 gap-2", children: [
|
|
314
|
+
/* @__PURE__ */ n.jsx(d, { type: "memory", onClick: C, className: "text-xs", children: "M+" }),
|
|
315
|
+
/* @__PURE__ */ n.jsx(d, { type: "memory", onClick: y, className: "text-xs", children: "M-" }),
|
|
316
|
+
/* @__PURE__ */ n.jsx(d, { type: "memory", onClick: T, className: "text-xs", children: "MR" }),
|
|
317
|
+
/* @__PURE__ */ n.jsx(d, { type: "memory", onClick: v, className: "text-xs", children: "MC" })
|
|
318
|
+
] }),
|
|
319
|
+
/* @__PURE__ */ n.jsxs("div", { className: "grid grid-cols-4 gap-2", children: [
|
|
320
|
+
/* @__PURE__ */ n.jsx(d, { type: "function", onClick: s, children: "C" }),
|
|
321
|
+
/* @__PURE__ */ n.jsx(d, { type: "function", onClick: g, children: "±" }),
|
|
322
|
+
/* @__PURE__ */ n.jsx(d, { type: "function", onClick: f, children: "%" }),
|
|
323
|
+
/* @__PURE__ */ n.jsx(d, { type: "operator", onClick: () => c("÷"), children: "÷" })
|
|
324
|
+
] }),
|
|
325
|
+
/* @__PURE__ */ n.jsxs("div", { className: "grid grid-cols-4 gap-2", children: [
|
|
326
|
+
/* @__PURE__ */ n.jsx(d, { type: "number", onClick: () => r("7"), children: "7" }),
|
|
327
|
+
/* @__PURE__ */ n.jsx(d, { type: "number", onClick: () => r("8"), children: "8" }),
|
|
328
|
+
/* @__PURE__ */ n.jsx(d, { type: "number", onClick: () => r("9"), children: "9" }),
|
|
329
|
+
/* @__PURE__ */ n.jsx(d, { type: "operator", onClick: () => c("×"), children: "×" })
|
|
330
|
+
] }),
|
|
331
|
+
/* @__PURE__ */ n.jsxs("div", { className: "grid grid-cols-4 gap-2", children: [
|
|
332
|
+
/* @__PURE__ */ n.jsx(d, { type: "number", onClick: () => r("4"), children: "4" }),
|
|
333
|
+
/* @__PURE__ */ n.jsx(d, { type: "number", onClick: () => r("5"), children: "5" }),
|
|
334
|
+
/* @__PURE__ */ n.jsx(d, { type: "number", onClick: () => r("6"), children: "6" }),
|
|
335
|
+
/* @__PURE__ */ n.jsx(d, { type: "operator", onClick: () => c("-"), children: "-" })
|
|
336
|
+
] }),
|
|
337
|
+
/* @__PURE__ */ n.jsxs("div", { className: "grid grid-cols-4 gap-2", children: [
|
|
338
|
+
/* @__PURE__ */ n.jsx(d, { type: "number", onClick: () => r("1"), children: "1" }),
|
|
339
|
+
/* @__PURE__ */ n.jsx(d, { type: "number", onClick: () => r("2"), children: "2" }),
|
|
340
|
+
/* @__PURE__ */ n.jsx(d, { type: "number", onClick: () => r("3"), children: "3" }),
|
|
341
|
+
/* @__PURE__ */ n.jsx(d, { type: "operator", onClick: () => c("+"), children: "+" })
|
|
342
|
+
] }),
|
|
343
|
+
/* @__PURE__ */ n.jsxs("div", { className: "grid grid-cols-4 gap-2", children: [
|
|
344
|
+
/* @__PURE__ */ n.jsx(d, { type: "number", onClick: () => r("0"), className: "col-span-2", children: "0" }),
|
|
345
|
+
/* @__PURE__ */ n.jsx(d, { type: "number", onClick: t, children: "." }),
|
|
346
|
+
/* @__PURE__ */ n.jsx(d, { type: "function", onClick: o, children: "⌫" }),
|
|
347
|
+
/* @__PURE__ */ n.jsx(d, { type: "equals", onClick: u, children: "=" })
|
|
348
|
+
] })
|
|
349
|
+
] }));
|
|
350
|
+
ae.displayName = "Keypad";
|
|
351
|
+
const me = () => {
|
|
352
|
+
const [r, t] = R("0"), [c, u] = R(0), [s, o] = R(null), [f, g] = R(null), [C, y] = R(!1), [T, v] = R("");
|
|
353
|
+
ce(() => {
|
|
354
|
+
const i = new MutationObserver(() => {
|
|
355
|
+
t((p) => p);
|
|
356
|
+
});
|
|
357
|
+
return i.observe(document.documentElement, { attributes: !0 }), () => i.disconnect();
|
|
358
|
+
}, []);
|
|
359
|
+
const O = (i) => {
|
|
360
|
+
C ? (t(String(i)), y(!1)) : t(r === "0" ? String(i) : r + i);
|
|
361
|
+
}, S = () => {
|
|
362
|
+
C ? (t("0."), y(!1)) : r.includes(".") || t(r + ".");
|
|
363
|
+
}, P = () => {
|
|
364
|
+
t("0"), o(null), g(null), y(!1), v("");
|
|
365
|
+
}, $ = () => {
|
|
366
|
+
r.length > 1 ? t(r.slice(0, -1)) : t("0");
|
|
367
|
+
}, w = () => {
|
|
368
|
+
t((i) => String(-parseFloat(i)));
|
|
369
|
+
}, F = () => {
|
|
370
|
+
t((i) => String(parseFloat(i) / 100));
|
|
371
|
+
}, M = (i) => {
|
|
372
|
+
const p = parseFloat(r);
|
|
373
|
+
if (f === null)
|
|
374
|
+
v(`${p} ${i}`), g(p);
|
|
375
|
+
else {
|
|
376
|
+
v(`${f} ${s} ${p} =`);
|
|
377
|
+
const k = f || 0;
|
|
378
|
+
let j;
|
|
379
|
+
switch (s) {
|
|
380
|
+
case "+":
|
|
381
|
+
j = k + p;
|
|
382
|
+
break;
|
|
383
|
+
case "-":
|
|
384
|
+
j = k - p;
|
|
385
|
+
break;
|
|
386
|
+
case "×":
|
|
387
|
+
j = k * p;
|
|
388
|
+
break;
|
|
389
|
+
case "÷":
|
|
390
|
+
j = k / p;
|
|
391
|
+
break;
|
|
392
|
+
default:
|
|
393
|
+
j = p;
|
|
394
|
+
}
|
|
395
|
+
g(j), t(String(j)), v(`${j} ${i}`);
|
|
396
|
+
}
|
|
397
|
+
y(!0), o(i);
|
|
398
|
+
}, D = () => {
|
|
399
|
+
if (s && f !== null) {
|
|
400
|
+
const i = parseFloat(r), p = f || 0;
|
|
401
|
+
let k;
|
|
402
|
+
switch (s) {
|
|
403
|
+
case "+":
|
|
404
|
+
k = p + i;
|
|
405
|
+
break;
|
|
406
|
+
case "-":
|
|
407
|
+
k = p - i;
|
|
408
|
+
break;
|
|
409
|
+
case "×":
|
|
410
|
+
k = p * i;
|
|
411
|
+
break;
|
|
412
|
+
case "÷":
|
|
413
|
+
k = p / i;
|
|
414
|
+
break;
|
|
415
|
+
default:
|
|
416
|
+
k = i;
|
|
417
|
+
}
|
|
418
|
+
v(`${p} ${s} ${i} =`), t(String(k)), g(k), o(null), y(!0);
|
|
419
|
+
}
|
|
420
|
+
}, Y = () => {
|
|
421
|
+
u((i) => i + parseFloat(r));
|
|
422
|
+
}, l = () => {
|
|
423
|
+
u((i) => i - parseFloat(r));
|
|
424
|
+
}, x = () => {
|
|
425
|
+
t(String(c)), y(!0);
|
|
426
|
+
}, N = () => {
|
|
427
|
+
u(0);
|
|
428
|
+
};
|
|
429
|
+
return /* @__PURE__ */ n.jsxs("div", { className: "max-w-md w-full mx-auto p-4", children: [
|
|
430
|
+
/* @__PURE__ */ n.jsx(
|
|
431
|
+
ne,
|
|
432
|
+
{
|
|
433
|
+
value: r,
|
|
434
|
+
memory: c,
|
|
435
|
+
expression: T
|
|
436
|
+
}
|
|
437
|
+
),
|
|
438
|
+
/* @__PURE__ */ n.jsx("div", { className: "mt-6", children: /* @__PURE__ */ n.jsx(
|
|
439
|
+
ae,
|
|
440
|
+
{
|
|
441
|
+
onNumber: O,
|
|
442
|
+
onDecimal: S,
|
|
443
|
+
onOperator: M,
|
|
444
|
+
onEquals: D,
|
|
445
|
+
onClear: P,
|
|
446
|
+
onBackspace: $,
|
|
447
|
+
onPercentage: F,
|
|
448
|
+
onToggleSign: w,
|
|
449
|
+
onMemoryAdd: Y,
|
|
450
|
+
onMemorySubtract: l,
|
|
451
|
+
onMemoryRecall: x,
|
|
452
|
+
onMemoryClear: N
|
|
453
|
+
}
|
|
454
|
+
) })
|
|
455
|
+
] });
|
|
456
|
+
}, _ = {
|
|
264
457
|
// Basic operations
|
|
265
|
-
add: (r,
|
|
266
|
-
subtract: (r,
|
|
267
|
-
multiply: (r,
|
|
268
|
-
divide: (r,
|
|
458
|
+
add: (r, t) => r + t,
|
|
459
|
+
subtract: (r, t) => r - t,
|
|
460
|
+
multiply: (r, t) => r * t,
|
|
461
|
+
divide: (r, t) => t !== 0 ? r / t : "Error",
|
|
269
462
|
// Format number for display
|
|
270
463
|
formatNumber: (r) => {
|
|
271
464
|
if (r === "Error") return "Error";
|
|
272
|
-
const
|
|
273
|
-
return
|
|
465
|
+
const t = r.toString();
|
|
466
|
+
return t.length > 12 ? parseFloat(r).toExponential(6) : t;
|
|
274
467
|
},
|
|
275
468
|
// Calculate percentage
|
|
276
469
|
percentage: (r) => r / 100,
|
|
@@ -293,254 +486,109 @@ const E = {
|
|
|
293
486
|
},
|
|
294
487
|
// Evaluate expression
|
|
295
488
|
evaluate: (r) => {
|
|
296
|
-
const
|
|
297
|
-
for (r.forEach((
|
|
298
|
-
if (!
|
|
299
|
-
|
|
489
|
+
const t = [], c = [];
|
|
490
|
+
for (r.forEach((s) => {
|
|
491
|
+
if (!_.isOperator(s))
|
|
492
|
+
t.push(parseFloat(s));
|
|
300
493
|
else {
|
|
301
|
-
for (; c.length > 0 &&
|
|
302
|
-
|
|
303
|
-
c.push(
|
|
494
|
+
for (; c.length > 0 && _.isOperator(c[c.length - 1]) && _.getPrecedence(c[c.length - 1]) >= _.getPrecedence(s); )
|
|
495
|
+
t.push(c.pop());
|
|
496
|
+
c.push(s);
|
|
304
497
|
}
|
|
305
498
|
}); c.length > 0; )
|
|
306
|
-
|
|
307
|
-
const
|
|
308
|
-
return
|
|
309
|
-
if (!
|
|
310
|
-
|
|
499
|
+
t.push(c.pop());
|
|
500
|
+
const u = [];
|
|
501
|
+
return t.forEach((s) => {
|
|
502
|
+
if (!_.isOperator(s))
|
|
503
|
+
u.push(s);
|
|
311
504
|
else {
|
|
312
|
-
const
|
|
313
|
-
switch (
|
|
505
|
+
const o = u.pop(), f = u.pop();
|
|
506
|
+
switch (s) {
|
|
314
507
|
case "+":
|
|
315
|
-
|
|
508
|
+
u.push(f + o);
|
|
316
509
|
break;
|
|
317
510
|
case "-":
|
|
318
|
-
|
|
511
|
+
u.push(f - o);
|
|
319
512
|
break;
|
|
320
513
|
case "×":
|
|
321
|
-
|
|
514
|
+
u.push(f * o);
|
|
322
515
|
break;
|
|
323
516
|
case "÷":
|
|
324
|
-
|
|
517
|
+
u.push(o !== 0 ? f / o : "Error");
|
|
325
518
|
break;
|
|
326
519
|
}
|
|
327
520
|
}
|
|
328
|
-
}),
|
|
521
|
+
}), u[0];
|
|
329
522
|
}
|
|
330
|
-
},
|
|
331
|
-
const [r,
|
|
332
|
-
|
|
333
|
-
}, [
|
|
334
|
-
|
|
335
|
-
}, [
|
|
336
|
-
|
|
337
|
-
const
|
|
338
|
-
return r !== "Error" &&
|
|
339
|
-
}),
|
|
340
|
-
}, [r]),
|
|
523
|
+
}, pe = () => {
|
|
524
|
+
const [r, t] = R("0"), [c, u] = R([]), [s, o] = R(!0), [f, g] = R(0), C = E((l) => {
|
|
525
|
+
t((x) => s || x === "0" || x === "Error" ? (o(!1), l) : x.length < 12 ? x + l : x);
|
|
526
|
+
}, [s]), y = E(() => {
|
|
527
|
+
t((l) => s || l === "0" || l === "Error" ? (o(!1), "0.") : !l.includes(".") && l.length < 12 ? l + "." : l);
|
|
528
|
+
}, [s]), T = E((l) => {
|
|
529
|
+
u((x) => {
|
|
530
|
+
const N = [...x];
|
|
531
|
+
return r !== "Error" && N.push(r), N.push(l), N;
|
|
532
|
+
}), o(!0);
|
|
533
|
+
}, [r]), v = E(() => {
|
|
341
534
|
if (r !== "Error") {
|
|
342
|
-
const
|
|
343
|
-
|
|
535
|
+
const l = [...c, r], x = _.evaluate(l);
|
|
536
|
+
t(_.formatNumber(x)), u([]), o(!0);
|
|
344
537
|
}
|
|
345
|
-
}, [r, c]),
|
|
346
|
-
|
|
347
|
-
}, []),
|
|
348
|
-
|
|
349
|
-
}, []),
|
|
350
|
-
|
|
351
|
-
}, []),
|
|
352
|
-
|
|
353
|
-
if (
|
|
354
|
-
const x =
|
|
355
|
-
return
|
|
538
|
+
}, [r, c]), O = E(() => {
|
|
539
|
+
t("0"), u([]), o(!0);
|
|
540
|
+
}, []), S = E(() => {
|
|
541
|
+
t("0"), o(!0);
|
|
542
|
+
}, []), P = E(() => {
|
|
543
|
+
t((l) => l.length > 1 && l !== "Error" ? l.slice(0, -1) : "0");
|
|
544
|
+
}, []), $ = E(() => {
|
|
545
|
+
t((l) => {
|
|
546
|
+
if (l !== "Error") {
|
|
547
|
+
const x = _.percentage(parseFloat(l));
|
|
548
|
+
return _.formatNumber(x);
|
|
356
549
|
}
|
|
357
|
-
return
|
|
550
|
+
return l;
|
|
358
551
|
});
|
|
359
|
-
}, []),
|
|
360
|
-
|
|
361
|
-
if (
|
|
362
|
-
const x =
|
|
363
|
-
return
|
|
552
|
+
}, []), w = E(() => {
|
|
553
|
+
t((l) => {
|
|
554
|
+
if (l !== "Error" && l !== "0") {
|
|
555
|
+
const x = _.toggleSign(parseFloat(l));
|
|
556
|
+
return _.formatNumber(x);
|
|
364
557
|
}
|
|
365
|
-
return
|
|
558
|
+
return l;
|
|
366
559
|
});
|
|
367
|
-
}, []),
|
|
368
|
-
r !== "Error" && (
|
|
369
|
-
}, [r]),
|
|
370
|
-
r !== "Error" && (
|
|
371
|
-
}, [r]),
|
|
372
|
-
|
|
373
|
-
}, [
|
|
374
|
-
|
|
560
|
+
}, []), F = E(() => {
|
|
561
|
+
r !== "Error" && (g((l) => l + parseFloat(r)), o(!0));
|
|
562
|
+
}, [r]), M = E(() => {
|
|
563
|
+
r !== "Error" && (g((l) => l - parseFloat(r)), o(!0));
|
|
564
|
+
}, [r]), D = E(() => {
|
|
565
|
+
t(_.formatNumber(f)), o(!0);
|
|
566
|
+
}, [f]), Y = E(() => {
|
|
567
|
+
g(0);
|
|
375
568
|
}, []);
|
|
376
569
|
return {
|
|
377
570
|
display: r,
|
|
378
571
|
expression: c,
|
|
379
|
-
memory:
|
|
380
|
-
handleNumber:
|
|
381
|
-
handleDecimal:
|
|
382
|
-
handleOperator:
|
|
383
|
-
handleEquals:
|
|
384
|
-
handleClear:
|
|
385
|
-
handleClearEntry:
|
|
386
|
-
handleBackspace:
|
|
387
|
-
handlePercentage:
|
|
388
|
-
handleToggleSign:
|
|
389
|
-
handleMemoryAdd:
|
|
390
|
-
handleMemorySubtract:
|
|
391
|
-
handleMemoryRecall:
|
|
572
|
+
memory: f,
|
|
573
|
+
handleNumber: C,
|
|
574
|
+
handleDecimal: y,
|
|
575
|
+
handleOperator: T,
|
|
576
|
+
handleEquals: v,
|
|
577
|
+
handleClear: O,
|
|
578
|
+
handleClearEntry: S,
|
|
579
|
+
handleBackspace: P,
|
|
580
|
+
handlePercentage: $,
|
|
581
|
+
handleToggleSign: w,
|
|
582
|
+
handleMemoryAdd: F,
|
|
583
|
+
handleMemorySubtract: M,
|
|
584
|
+
handleMemoryRecall: D,
|
|
392
585
|
handleMemoryClear: Y
|
|
393
586
|
};
|
|
394
|
-
}, ee = U(({
|
|
395
|
-
value: r,
|
|
396
|
-
expression: a,
|
|
397
|
-
memory: c
|
|
398
|
-
}) => {
|
|
399
|
-
const [i, l] = O(/* @__PURE__ */ new Date());
|
|
400
|
-
return ce(() => {
|
|
401
|
-
const n = setInterval(() => l(/* @__PURE__ */ new Date()), 1e3);
|
|
402
|
-
return () => clearInterval(n);
|
|
403
|
-
}, []), /* @__PURE__ */ t.jsxs("div", { className: "bg-card rounded-xl p-6 shadow-inner border border-custom", children: [
|
|
404
|
-
/* @__PURE__ */ t.jsxs("div", { className: "flex justify-between items-center mb-4 text-sm text-secondary", children: [
|
|
405
|
-
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
406
|
-
/* @__PURE__ */ t.jsx(ie, { className: "w-4 h-4" }),
|
|
407
|
-
/* @__PURE__ */ t.jsx("span", { children: "Standard" })
|
|
408
|
-
] }),
|
|
409
|
-
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-4", children: [
|
|
410
|
-
c !== 0 && /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-1 text-purple-600 dark:text-purple-400", children: [
|
|
411
|
-
/* @__PURE__ */ t.jsx("span", { className: "text-xs", children: "M" }),
|
|
412
|
-
/* @__PURE__ */ t.jsx("span", { children: c })
|
|
413
|
-
] }),
|
|
414
|
-
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-1", children: [
|
|
415
|
-
/* @__PURE__ */ t.jsx(ue, { className: "w-3 h-3" }),
|
|
416
|
-
/* @__PURE__ */ t.jsx("span", { children: i.toLocaleTimeString() })
|
|
417
|
-
] })
|
|
418
|
-
] })
|
|
419
|
-
] }),
|
|
420
|
-
a.length > 0 && /* @__PURE__ */ t.jsx("div", { className: "text-right text-sm text-secondary mb-2 font-mono", children: a.join(" ") }),
|
|
421
|
-
/* @__PURE__ */ t.jsx("div", { className: "text-right", children: /* @__PURE__ */ t.jsx("div", { className: "text-5xl font-bold text-primary font-mono truncate", children: r }) }),
|
|
422
|
-
/* @__PURE__ */ t.jsx("div", { className: "flex justify-end mt-2", children: /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-1 text-xs text-secondary opacity-60", children: [
|
|
423
|
-
/* @__PURE__ */ t.jsx(me, { className: "w-3 h-3" }),
|
|
424
|
-
/* @__PURE__ */ t.jsx("span", { className: "font-mono", children: r !== "Error" ? parseInt(r).toString(2).slice(0, 16) : "ERROR" })
|
|
425
|
-
] }) })
|
|
426
|
-
] });
|
|
427
|
-
});
|
|
428
|
-
ee.displayName = "Display";
|
|
429
|
-
const m = U(({
|
|
430
|
-
children: r,
|
|
431
|
-
onClick: a,
|
|
432
|
-
type: c = "number",
|
|
433
|
-
size: i = "normal",
|
|
434
|
-
className: l = ""
|
|
435
|
-
}) => {
|
|
436
|
-
const n = {
|
|
437
|
-
small: "px-3 py-2 text-sm",
|
|
438
|
-
normal: "px-4 py-3 text-base",
|
|
439
|
-
large: "px-6 py-4 text-lg"
|
|
440
|
-
}, p = {
|
|
441
|
-
number: "bg-button-number text-primary",
|
|
442
|
-
operator: "bg-button-operator text-white",
|
|
443
|
-
function: "bg-button-function text-primary",
|
|
444
|
-
equals: "bg-button-equals text-white col-span-2",
|
|
445
|
-
memory: "bg-button-memory text-white text-sm"
|
|
446
|
-
};
|
|
447
|
-
return /* @__PURE__ */ t.jsx(
|
|
448
|
-
"button",
|
|
449
|
-
{
|
|
450
|
-
onClick: a,
|
|
451
|
-
className: `
|
|
452
|
-
${n[i]}
|
|
453
|
-
${p[c]}
|
|
454
|
-
rounded-lg font-semibold transition-all duration-200
|
|
455
|
-
active:scale-95 shadow-sm hover:shadow-md
|
|
456
|
-
${l}
|
|
457
|
-
`,
|
|
458
|
-
children: r
|
|
459
|
-
}
|
|
460
|
-
);
|
|
461
|
-
});
|
|
462
|
-
m.displayName = "Button";
|
|
463
|
-
const re = U(({
|
|
464
|
-
onNumber: r,
|
|
465
|
-
onDecimal: a,
|
|
466
|
-
onOperator: c,
|
|
467
|
-
onEquals: i,
|
|
468
|
-
onClear: l,
|
|
469
|
-
onClearEntry: n,
|
|
470
|
-
onBackspace: p,
|
|
471
|
-
onPercentage: y,
|
|
472
|
-
onToggleSign: k,
|
|
473
|
-
onMemoryAdd: w,
|
|
474
|
-
onMemorySubtract: g,
|
|
475
|
-
onMemoryRecall: N,
|
|
476
|
-
onMemoryClear: _
|
|
477
|
-
}) => {
|
|
478
|
-
const j = [7, 8, 9, 4, 5, 6, 1, 2, 3, 0];
|
|
479
|
-
return /* @__PURE__ */ t.jsxs("div", { className: "grid grid-cols-5 gap-2", children: [
|
|
480
|
-
/* @__PURE__ */ t.jsx(m, { type: "memory", onClick: w, size: "small", children: /* @__PURE__ */ t.jsx(de, { className: "w-4 h-4" }) }),
|
|
481
|
-
/* @__PURE__ */ t.jsx(m, { type: "memory", onClick: g, size: "small", children: /* @__PURE__ */ t.jsx(fe, { className: "w-4 h-4" }) }),
|
|
482
|
-
/* @__PURE__ */ t.jsx(m, { type: "memory", onClick: N, size: "small", children: /* @__PURE__ */ t.jsx(pe, { className: "w-4 h-4" }) }),
|
|
483
|
-
/* @__PURE__ */ t.jsx(m, { type: "memory", onClick: _, size: "small", children: /* @__PURE__ */ t.jsx(he, { className: "w-4 h-4" }) }),
|
|
484
|
-
/* @__PURE__ */ t.jsx(m, { type: "function", onClick: n, size: "small", children: "CE" }),
|
|
485
|
-
/* @__PURE__ */ t.jsx(m, { type: "function", onClick: k, size: "small", children: "±" }),
|
|
486
|
-
/* @__PURE__ */ t.jsx(m, { type: "function", onClick: y, size: "small", children: /* @__PURE__ */ t.jsx(xe, { className: "w-4 h-4" }) }),
|
|
487
|
-
/* @__PURE__ */ t.jsx(m, { type: "function", onClick: l, size: "small", children: /* @__PURE__ */ t.jsx(be, { className: "w-4 h-4" }) }),
|
|
488
|
-
/* @__PURE__ */ t.jsxs(m, { type: "function", onClick: p, size: "small", children: [
|
|
489
|
-
/* @__PURE__ */ t.jsx(Ee, { className: "w-4 h-4" }),
|
|
490
|
-
" "
|
|
491
|
-
] }),
|
|
492
|
-
/* @__PURE__ */ t.jsx(m, { type: "operator", onClick: () => c("÷"), size: "small", children: /* @__PURE__ */ t.jsx(ye, { className: "w-4 h-4" }) }),
|
|
493
|
-
j.slice(0, 3).map((h) => /* @__PURE__ */ t.jsx(m, { onClick: () => r(h.toString()), children: h }, h)),
|
|
494
|
-
/* @__PURE__ */ t.jsx(m, { type: "operator", onClick: () => c("×"), children: /* @__PURE__ */ t.jsx(je, { className: "w-4 h-4" }) }),
|
|
495
|
-
j.slice(3, 6).map((h) => /* @__PURE__ */ t.jsx(m, { onClick: () => r(h.toString()), children: h }, h)),
|
|
496
|
-
/* @__PURE__ */ t.jsx(m, { type: "operator", onClick: () => c("-"), children: /* @__PURE__ */ t.jsx(ge, { className: "w-4 h-4" }) }),
|
|
497
|
-
j.slice(6, 9).map((h) => /* @__PURE__ */ t.jsx(m, { onClick: () => r(h.toString()), children: h }, h)),
|
|
498
|
-
/* @__PURE__ */ t.jsx(m, { type: "operator", onClick: () => c("+"), children: /* @__PURE__ */ t.jsx(Ne, { className: "w-4 h-4" }) }),
|
|
499
|
-
/* @__PURE__ */ t.jsx(m, { type: "number", onClick: a, className: "col-span-2", children: "." }),
|
|
500
|
-
/* @__PURE__ */ t.jsx(m, { type: "number", onClick: () => r("0"), className: "col-span-2", children: "0" }),
|
|
501
|
-
/* @__PURE__ */ t.jsx(m, { type: "equals", onClick: i, className: "col-span-1", children: /* @__PURE__ */ t.jsx(_e, { className: "w-5 h-5" }) })
|
|
502
|
-
] });
|
|
503
|
-
});
|
|
504
|
-
re.displayName = "Keypad";
|
|
505
|
-
const Se = () => {
|
|
506
|
-
const r = ve();
|
|
507
|
-
return /* @__PURE__ */ t.jsxs("div", { className: "max-w-md w-full mx-auto p-4", children: [
|
|
508
|
-
/* @__PURE__ */ t.jsx(
|
|
509
|
-
ee,
|
|
510
|
-
{
|
|
511
|
-
value: r.display,
|
|
512
|
-
expression: r.expression,
|
|
513
|
-
memory: r.memory
|
|
514
|
-
}
|
|
515
|
-
),
|
|
516
|
-
/* @__PURE__ */ t.jsx("div", { className: "mt-6", children: /* @__PURE__ */ t.jsx(
|
|
517
|
-
re,
|
|
518
|
-
{
|
|
519
|
-
onNumber: r.handleNumber,
|
|
520
|
-
onDecimal: r.handleDecimal,
|
|
521
|
-
onOperator: r.handleOperator,
|
|
522
|
-
onEquals: r.handleEquals,
|
|
523
|
-
onClear: r.handleClear,
|
|
524
|
-
onClearEntry: r.handleClearEntry,
|
|
525
|
-
onBackspace: r.handleBackspace,
|
|
526
|
-
onPercentage: r.handlePercentage,
|
|
527
|
-
onToggleSign: r.handleToggleSign,
|
|
528
|
-
onMemoryAdd: r.handleMemoryAdd,
|
|
529
|
-
onMemorySubtract: r.handleMemorySubtract,
|
|
530
|
-
onMemoryRecall: r.handleMemoryRecall,
|
|
531
|
-
onMemoryClear: r.handleMemoryClear
|
|
532
|
-
}
|
|
533
|
-
) }),
|
|
534
|
-
/* @__PURE__ */ t.jsx("div", { className: "mt-4 text-xs text-center text-secondary", children: /* @__PURE__ */ t.jsxs("p", { children: [
|
|
535
|
-
"Memory: ",
|
|
536
|
-
r.memory
|
|
537
|
-
] }) })
|
|
538
|
-
] });
|
|
539
587
|
};
|
|
540
588
|
export {
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
589
|
+
d as Button,
|
|
590
|
+
me as Calculator,
|
|
591
|
+
ne as Display,
|
|
592
|
+
ae as Keypad,
|
|
593
|
+
pe as useCalculator
|
|
546
594
|
};
|
package/dist/index.umd.js
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],c):(_=typeof globalThis<"u"?globalThis:_||self,c(_.Calculator={},_.React))})(this,(function(_,c){"use strict";var W={exports:{}},F={};var Q;function ne(){if(Q)return F;Q=1;var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function u(f,s,l){var m=null;if(l!==void 0&&(m=""+l),s.key!==void 0&&(m=""+s.key),"key"in s){l={};for(var g in s)g!=="key"&&(l[g]=s[g])}else l=s;return s=l.ref,{$$typeof:t,type:f,key:m,ref:s!==void 0?s:null,props:l}}return F.Fragment=r,F.jsx=u,F.jsxs=u,F}var M={};var Z;function se(){return Z||(Z=1,process.env.NODE_ENV!=="production"&&(function(){function t(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===C?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case w:return"Fragment";case V:return"Profiler";case Y:return"StrictMode";case x:return"Suspense";case N:return"SuspenseList";case y:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case D:return"Portal";case L:return e.displayName||"Context";case I:return(e._context.displayName||"Context")+".Consumer";case o:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case i:return n=e.displayName||null,n!==null?n:t(e.type)||"Memo";case p:n=e._payload,e=e._init;try{return t(e(n))}catch{}}return null}function r(e){return""+e}function u(e){try{r(e);var n=!1}catch{n=!0}if(n){n=console;var b=n.error,h=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return b.call(n,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",h),r(e)}}function f(e){if(e===w)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===p)return"<...>";try{var n=t(e);return n?"<"+n+">":"<...>"}catch{return"<...>"}}function s(){var e=B.A;return e===null?null:e.getOwner()}function l(){return Error("react-stack-top-frame")}function m(e){if(q.call(e,"key")){var n=Object.getOwnPropertyDescriptor(e,"key").get;if(n&&n.isReactWarning)return!1}return e.key!==void 0}function g(e,n){function b(){$||($=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",n))}b.isReactWarning=!0,Object.defineProperty(e,"key",{get:b,configurable:!0})}function R(){var e=t(this.type);return ee[e]||(ee[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function v(e,n,b,h,U,X){var k=b.ref;return e={$$typeof:P,type:e,key:n,props:b,_owner:h},(k!==void 0?k:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:R}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:U}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:X}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function S(e,n,b,h,U,X){var k=n.children;if(k!==void 0)if(h)if(ue(k)){for(h=0;h<k.length;h++)j(k[h]);Object.freeze&&Object.freeze(k)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else j(k);if(q.call(n,"key")){k=t(e);var A=Object.keys(n).filter(function(ie){return ie!=="key"});h=0<A.length?"{key: someKey, "+A.join(": ..., ")+": ...}":"{key: someKey}",ae[k+h]||(A=0<A.length?"{"+A.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
2
|
let props = %s;
|
|
3
3
|
<%s {...props} />
|
|
4
4
|
React keys must be passed directly to JSX without using spread:
|
|
5
5
|
let props = %s;
|
|
6
|
-
<%s key={someKey} {...props} />`,
|
|
7
|
-
${n[u]}
|
|
8
|
-
${h[c]}
|
|
9
|
-
rounded-lg font-semibold transition-all duration-200
|
|
10
|
-
active:scale-95 shadow-sm hover:shadow-md
|
|
11
|
-
${o}
|
|
12
|
-
`,children:r})});d.displayName="Button";const F=i.memo(({onNumber:r,onDecimal:a,onOperator:c,onEquals:u,onClear:o,onClearEntry:n,onBackspace:h,onPercentage:g,onToggleSign:R,onMemoryAdd:S,onMemorySubtract:C,onMemoryRecall:N,onMemoryClear:_})=>{const k=[7,8,9,4,5,6,1,2,3,0];return t.jsxs("div",{className:"grid grid-cols-5 gap-2",children:[t.jsx(d,{type:"memory",onClick:S,size:"small",children:t.jsx(b.PlusCircle,{className:"w-4 h-4"})}),t.jsx(d,{type:"memory",onClick:C,size:"small",children:t.jsx(b.MinusCircle,{className:"w-4 h-4"})}),t.jsx(d,{type:"memory",onClick:N,size:"small",children:t.jsx(b.RotateCw,{className:"w-4 h-4"})}),t.jsx(d,{type:"memory",onClick:_,size:"small",children:t.jsx(b.Trash2,{className:"w-4 h-4"})}),t.jsx(d,{type:"function",onClick:n,size:"small",children:"CE"}),t.jsx(d,{type:"function",onClick:R,size:"small",children:"±"}),t.jsx(d,{type:"function",onClick:g,size:"small",children:t.jsx(b.Percent,{className:"w-4 h-4"})}),t.jsx(d,{type:"function",onClick:o,size:"small",children:t.jsx(b.RotateCcw,{className:"w-4 h-4"})}),t.jsxs(d,{type:"function",onClick:h,size:"small",children:[t.jsx(b.Delete,{className:"w-4 h-4"})," "]}),t.jsx(d,{type:"operator",onClick:()=>c("÷"),size:"small",children:t.jsx(b.Divide,{className:"w-4 h-4"})}),k.slice(0,3).map(x=>t.jsx(d,{onClick:()=>r(x.toString()),children:x},x)),t.jsx(d,{type:"operator",onClick:()=>c("×"),children:t.jsx(b.X,{className:"w-4 h-4"})}),k.slice(3,6).map(x=>t.jsx(d,{onClick:()=>r(x.toString()),children:x},x)),t.jsx(d,{type:"operator",onClick:()=>c("-"),children:t.jsx(b.Minus,{className:"w-4 h-4"})}),k.slice(6,9).map(x=>t.jsx(d,{onClick:()=>r(x.toString()),children:x},x)),t.jsx(d,{type:"operator",onClick:()=>c("+"),children:t.jsx(b.Plus,{className:"w-4 h-4"})}),t.jsx(d,{type:"number",onClick:a,className:"col-span-2",children:"."}),t.jsx(d,{type:"number",onClick:()=>r("0"),className:"col-span-2",children:"0"}),t.jsx(d,{type:"equals",onClick:u,className:"col-span-1",children:t.jsx(b.Equal,{className:"w-5 h-5"})})]})});F.displayName="Keypad";const le=()=>{const r=Q();return t.jsxs("div",{className:"max-w-md w-full mx-auto p-4",children:[t.jsx(D,{value:r.display,expression:r.expression,memory:r.memory}),t.jsx("div",{className:"mt-6",children:t.jsx(F,{onNumber:r.handleNumber,onDecimal:r.handleDecimal,onOperator:r.handleOperator,onEquals:r.handleEquals,onClear:r.handleClear,onClearEntry:r.handleClearEntry,onBackspace:r.handleBackspace,onPercentage:r.handlePercentage,onToggleSign:r.handleToggleSign,onMemoryAdd:r.handleMemoryAdd,onMemorySubtract:r.handleMemorySubtract,onMemoryRecall:r.handleMemoryRecall,onMemoryClear:r.handleMemoryClear})}),t.jsx("div",{className:"mt-4 text-xs text-center text-secondary",children:t.jsxs("p",{children:["Memory: ",r.memory]})})]})};E.Button=d,E.Calculator=le,E.Display=D,E.Keypad=F,E.useCalculator=Q,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})}));
|
|
6
|
+
<%s key={someKey} {...props} />`,h,k,A,k),ae[k+h]=!0)}if(k=null,b!==void 0&&(u(b),k=""+b),m(n)&&(u(n.key),k=""+n.key),"key"in n){b={};for(var H in n)H!=="key"&&(b[H]=n[H])}else b=n;return k&&g(b,typeof e=="function"?e.displayName||e.name||"Unknown":e),v(e,k,b,s(),U,X)}function j(e){O(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===p&&(e._payload.status==="fulfilled"?O(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function O(e){return typeof e=="object"&&e!==null&&e.$$typeof===P}var T=c,P=Symbol.for("react.transitional.element"),D=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),Y=Symbol.for("react.strict_mode"),V=Symbol.for("react.profiler"),I=Symbol.for("react.consumer"),L=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),i=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),C=Symbol.for("react.client.reference"),B=T.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=Object.prototype.hasOwnProperty,ue=Array.isArray,G=console.createTask?console.createTask:function(){return null};T={react_stack_bottom_frame:function(e){return e()}};var $,ee={},te=T.react_stack_bottom_frame.bind(T,l)(),re=G(f(l)),ae={};M.Fragment=w,M.jsx=function(e,n,b){var h=1e4>B.recentlyCreatedOwnerStacks++;return S(e,n,b,!1,h?Error("react-stack-top-frame"):te,h?G(f(e)):re)},M.jsxs=function(e,n,b){var h=1e4>B.recentlyCreatedOwnerStacks++;return S(e,n,b,!0,h?Error("react-stack-top-frame"):te,h?G(f(e)):re)}})()),M}var K;function le(){return K||(K=1,process.env.NODE_ENV==="production"?W.exports=ne():W.exports=se()),W.exports}var a=le();const J=c.memo(({value:t,memory:r,expression:u})=>a.jsxs("div",{className:"border border-white/30 rounded-2xl p-6 bg-black/5",children:[a.jsx("div",{className:"text-right text-sm text-blue-600 dark:text-blue-400 font-mono mb-1 h-5 opacity-70",children:u}),a.jsx("div",{className:"text-right",children:a.jsx("div",{className:"text-6xl font-light text-blue-600 dark:text-blue-400 font-mono tracking-tight",children:t})}),r!==0&&a.jsxs("div",{className:"absolute top-2 left-2 text-xs border border-white/30 rounded-full px-2 py-1 bg-black/5 text-blue-600 dark:text-blue-400 font-medium",children:["M=",r]})]}));J.displayName="Display";const d=c.memo(({children:t,onClick:r,type:u="number",className:f=""})=>{const s="px-4 py-3 text-base rounded-lg font-semibold transition-all duration-200 active:scale-95 shadow-sm border border-white/30 hover:border-white/60",l={number:"bg-black/5 text-blue-600 dark:text-blue-400 hover:bg-black/10",operator:"bg-black/10 text-blue-600 dark:text-blue-400 hover:bg-black/20",function:"bg-black/5 text-blue-600 dark:text-blue-400 hover:bg-black/10",equals:"bg-black/10 text-blue-600 dark:text-blue-400 hover:bg-black/20",memory:"bg-black/5 text-blue-600 dark:text-blue-400 hover:bg-black/10 text-sm"};return a.jsx("button",{onClick:r,className:`${s} ${l[u]} ${f}`,children:t})});d.displayName="Button";const z=c.memo(({onNumber:t,onDecimal:r,onOperator:u,onEquals:f,onClear:s,onBackspace:l,onPercentage:m,onToggleSign:g,onMemoryAdd:R,onMemorySubtract:v,onMemoryRecall:S,onMemoryClear:j})=>a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"grid grid-cols-4 gap-2",children:[a.jsx(d,{type:"memory",onClick:R,className:"text-xs",children:"M+"}),a.jsx(d,{type:"memory",onClick:v,className:"text-xs",children:"M-"}),a.jsx(d,{type:"memory",onClick:S,className:"text-xs",children:"MR"}),a.jsx(d,{type:"memory",onClick:j,className:"text-xs",children:"MC"})]}),a.jsxs("div",{className:"grid grid-cols-4 gap-2",children:[a.jsx(d,{type:"function",onClick:s,children:"C"}),a.jsx(d,{type:"function",onClick:g,children:"±"}),a.jsx(d,{type:"function",onClick:m,children:"%"}),a.jsx(d,{type:"operator",onClick:()=>u("÷"),children:"÷"})]}),a.jsxs("div",{className:"grid grid-cols-4 gap-2",children:[a.jsx(d,{type:"number",onClick:()=>t("7"),children:"7"}),a.jsx(d,{type:"number",onClick:()=>t("8"),children:"8"}),a.jsx(d,{type:"number",onClick:()=>t("9"),children:"9"}),a.jsx(d,{type:"operator",onClick:()=>u("×"),children:"×"})]}),a.jsxs("div",{className:"grid grid-cols-4 gap-2",children:[a.jsx(d,{type:"number",onClick:()=>t("4"),children:"4"}),a.jsx(d,{type:"number",onClick:()=>t("5"),children:"5"}),a.jsx(d,{type:"number",onClick:()=>t("6"),children:"6"}),a.jsx(d,{type:"operator",onClick:()=>u("-"),children:"-"})]}),a.jsxs("div",{className:"grid grid-cols-4 gap-2",children:[a.jsx(d,{type:"number",onClick:()=>t("1"),children:"1"}),a.jsx(d,{type:"number",onClick:()=>t("2"),children:"2"}),a.jsx(d,{type:"number",onClick:()=>t("3"),children:"3"}),a.jsx(d,{type:"operator",onClick:()=>u("+"),children:"+"})]}),a.jsxs("div",{className:"grid grid-cols-4 gap-2",children:[a.jsx(d,{type:"number",onClick:()=>t("0"),className:"col-span-2",children:"0"}),a.jsx(d,{type:"number",onClick:r,children:"."}),a.jsx(d,{type:"function",onClick:l,children:"⌫"}),a.jsx(d,{type:"equals",onClick:f,children:"="})]})]}));z.displayName="Keypad";const oe=()=>{const[t,r]=c.useState("0"),[u,f]=c.useState(0),[s,l]=c.useState(null),[m,g]=c.useState(null),[R,v]=c.useState(!1),[S,j]=c.useState("");c.useEffect(()=>{const i=new MutationObserver(()=>{r(p=>p)});return i.observe(document.documentElement,{attributes:!0}),()=>i.disconnect()},[]);const O=i=>{R?(r(String(i)),v(!1)):r(t==="0"?String(i):t+i)},T=()=>{R?(r("0."),v(!1)):t.includes(".")||r(t+".")},P=()=>{r("0"),l(null),g(null),v(!1),j("")},D=()=>{t.length>1?r(t.slice(0,-1)):r("0")},w=()=>{r(i=>String(-parseFloat(i)))},Y=()=>{r(i=>String(parseFloat(i)/100))},V=i=>{const p=parseFloat(t);if(m===null)j(`${p} ${i}`),g(p);else{j(`${m} ${s} ${p} =`);const y=m||0;let C;switch(s){case"+":C=y+p;break;case"-":C=y-p;break;case"×":C=y*p;break;case"÷":C=y/p;break;default:C=p}g(C),r(String(C)),j(`${C} ${i}`)}v(!0),l(i)},I=()=>{if(s&&m!==null){const i=parseFloat(t),p=m||0;let y;switch(s){case"+":y=p+i;break;case"-":y=p-i;break;case"×":y=p*i;break;case"÷":y=p/i;break;default:y=i}j(`${p} ${s} ${i} =`),r(String(y)),g(y),l(null),v(!0)}},L=()=>{f(i=>i+parseFloat(t))},o=()=>{f(i=>i-parseFloat(t))},x=()=>{r(String(u)),v(!0)},N=()=>{f(0)};return a.jsxs("div",{className:"max-w-md w-full mx-auto p-4",children:[a.jsx(J,{value:t,memory:u,expression:S}),a.jsx("div",{className:"mt-6",children:a.jsx(z,{onNumber:O,onDecimal:T,onOperator:V,onEquals:I,onClear:P,onBackspace:D,onPercentage:Y,onToggleSign:w,onMemoryAdd:L,onMemorySubtract:o,onMemoryRecall:x,onMemoryClear:N})})]})},E={add:(t,r)=>t+r,subtract:(t,r)=>t-r,multiply:(t,r)=>t*r,divide:(t,r)=>r!==0?t/r:"Error",formatNumber:t=>{if(t==="Error")return"Error";const r=t.toString();return r.length>12?parseFloat(t).toExponential(6):r},percentage:t=>t/100,toggleSign:t=>-t,isOperator:t=>["+","-","×","÷"].includes(t),getPrecedence:t=>{switch(t){case"+":case"-":return 1;case"×":case"÷":return 2;default:return 0}},evaluate:t=>{const r=[],u=[];for(t.forEach(s=>{if(!E.isOperator(s))r.push(parseFloat(s));else{for(;u.length>0&&E.isOperator(u[u.length-1])&&E.getPrecedence(u[u.length-1])>=E.getPrecedence(s);)r.push(u.pop());u.push(s)}});u.length>0;)r.push(u.pop());const f=[];return r.forEach(s=>{if(!E.isOperator(s))f.push(s);else{const l=f.pop(),m=f.pop();switch(s){case"+":f.push(m+l);break;case"-":f.push(m-l);break;case"×":f.push(m*l);break;case"÷":f.push(l!==0?m/l:"Error");break}}}),f[0]}},ce=()=>{const[t,r]=c.useState("0"),[u,f]=c.useState([]),[s,l]=c.useState(!0),[m,g]=c.useState(0),R=c.useCallback(o=>{r(x=>s||x==="0"||x==="Error"?(l(!1),o):x.length<12?x+o:x)},[s]),v=c.useCallback(()=>{r(o=>s||o==="0"||o==="Error"?(l(!1),"0."):!o.includes(".")&&o.length<12?o+".":o)},[s]),S=c.useCallback(o=>{f(x=>{const N=[...x];return t!=="Error"&&N.push(t),N.push(o),N}),l(!0)},[t]),j=c.useCallback(()=>{if(t!=="Error"){const o=[...u,t],x=E.evaluate(o);r(E.formatNumber(x)),f([]),l(!0)}},[t,u]),O=c.useCallback(()=>{r("0"),f([]),l(!0)},[]),T=c.useCallback(()=>{r("0"),l(!0)},[]),P=c.useCallback(()=>{r(o=>o.length>1&&o!=="Error"?o.slice(0,-1):"0")},[]),D=c.useCallback(()=>{r(o=>{if(o!=="Error"){const x=E.percentage(parseFloat(o));return E.formatNumber(x)}return o})},[]),w=c.useCallback(()=>{r(o=>{if(o!=="Error"&&o!=="0"){const x=E.toggleSign(parseFloat(o));return E.formatNumber(x)}return o})},[]),Y=c.useCallback(()=>{t!=="Error"&&(g(o=>o+parseFloat(t)),l(!0))},[t]),V=c.useCallback(()=>{t!=="Error"&&(g(o=>o-parseFloat(t)),l(!0))},[t]),I=c.useCallback(()=>{r(E.formatNumber(m)),l(!0)},[m]),L=c.useCallback(()=>{g(0)},[]);return{display:t,expression:u,memory:m,handleNumber:R,handleDecimal:v,handleOperator:S,handleEquals:j,handleClear:O,handleClearEntry:T,handleBackspace:P,handlePercentage:D,handleToggleSign:w,handleMemoryAdd:Y,handleMemorySubtract:V,handleMemoryRecall:I,handleMemoryClear:L}};_.Button=d,_.Calculator=oe,_.Display=J,_.Keypad=z,_.useCalculator=ce,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
|
|
2
1
|
{
|
|
3
2
|
"name": "@birimengo/calculator",
|
|
4
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
5
4
|
"description": "A beautiful calculator component with memory functions",
|
|
6
5
|
"main": "dist/index.js",
|
|
7
6
|
"module": "dist/index.es.js",
|
|
8
|
-
"unpkg": "dist/index.umd.js",
|
|
9
|
-
"types": "dist/index.d.ts",
|
|
10
7
|
"files": [
|
|
11
8
|
"dist",
|
|
12
|
-
"README.md"
|
|
13
|
-
"LICENSE"
|
|
9
|
+
"README.md"
|
|
14
10
|
],
|
|
15
11
|
"scripts": {
|
|
16
12
|
"dev": "vite",
|
|
@@ -18,25 +14,6 @@
|
|
|
18
14
|
"prepublishOnly": "npm run build",
|
|
19
15
|
"preview": "vite preview"
|
|
20
16
|
},
|
|
21
|
-
"keywords": [
|
|
22
|
-
"react",
|
|
23
|
-
"calculator",
|
|
24
|
-
"component",
|
|
25
|
-
"ui",
|
|
26
|
-
"math",
|
|
27
|
-
"memory-calculator",
|
|
28
|
-
"bizcore"
|
|
29
|
-
],
|
|
30
|
-
"author": "Your Name <your.email@example.com>",
|
|
31
|
-
"license": "MIT",
|
|
32
|
-
"repository": {
|
|
33
|
-
"type": "git",
|
|
34
|
-
"url": "git+https://github.com/birimengo/calculator.git"
|
|
35
|
-
},
|
|
36
|
-
"bugs": {
|
|
37
|
-
"url": "https://github.com/birimengo/calculator/issues"
|
|
38
|
-
},
|
|
39
|
-
"homepage": "https://github.com/birimengo/calculator#readme",
|
|
40
17
|
"peerDependencies": {
|
|
41
18
|
"react": ">=18.0.0",
|
|
42
19
|
"react-dom": ">=18.0.0"
|
|
@@ -45,20 +22,16 @@
|
|
|
45
22
|
"lucide-react": "^0.577.0"
|
|
46
23
|
},
|
|
47
24
|
"devDependencies": {
|
|
48
|
-
"@eslint/js": "^9.29.0",
|
|
49
|
-
"@tailwindcss/vite": "^4.2.1",
|
|
50
|
-
"@types/react": "^19.1.8",
|
|
51
|
-
"@types/react-dom": "^19.1.6",
|
|
52
25
|
"@vitejs/plugin-react-swc": "^3.11.0",
|
|
53
|
-
"autoprefixer": "^10.4.21",
|
|
54
|
-
"eslint": "^9.29.0",
|
|
55
|
-
"eslint-plugin-react-hooks": "^5.2.0",
|
|
56
|
-
"eslint-plugin-react-refresh": "^0.4.20",
|
|
57
|
-
"globals": "^16.2.0",
|
|
58
|
-
"postcss": "^8.5.3",
|
|
59
26
|
"react": "^19.1.0",
|
|
60
27
|
"react-dom": "^19.1.0",
|
|
61
|
-
"tailwindcss": "^4.2.1",
|
|
62
28
|
"vite": "^7.0.0"
|
|
63
|
-
}
|
|
64
|
-
|
|
29
|
+
},
|
|
30
|
+
"keywords": [
|
|
31
|
+
"react",
|
|
32
|
+
"calculator",
|
|
33
|
+
"bizcore"
|
|
34
|
+
],
|
|
35
|
+
"author": "Your Name",
|
|
36
|
+
"license": "MIT"
|
|
37
|
+
}
|