aport-tools 4.0.32 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.esm.js CHANGED
@@ -1,385 +1,72 @@
1
- /*! aport-tools v4.0.32 | ISC */
1
+ /*! aport-tools v4.1.0 | ISC */
2
2
  import React, { createContext, useState, useEffect, useContext, useMemo } from 'react';
3
3
  import { Appearance, StyleSheet, View, Text, Switch, TouchableOpacity, Platform } from 'react-native';
4
4
  import { useAsyncStorage } from '@react-native-async-storage/async-storage';
5
- import * as Reanimated from 'react-native-reanimated';
6
5
 
7
- function _arrayLikeToArray(r, a) {
8
- (null == a || a > r.length) && (a = r.length);
9
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
10
- return n;
11
- }
12
- function _arrayWithHoles(r) {
13
- if (Array.isArray(r)) return r;
14
- }
15
- function asyncGeneratorStep(n, t, e, r, o, a, c) {
16
- try {
17
- var i = n[a](c),
18
- u = i.value;
19
- } catch (n) {
20
- return void e(n);
21
- }
22
- i.done ? t(u) : Promise.resolve(u).then(r, o);
23
- }
24
- function _asyncToGenerator(n) {
25
- return function () {
26
- var t = this,
27
- e = arguments;
28
- return new Promise(function (r, o) {
29
- var a = n.apply(t, e);
30
- function _next(n) {
31
- asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
32
- }
33
- function _throw(n) {
34
- asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
35
- }
36
- _next(void 0);
37
- });
38
- };
39
- }
40
- function _iterableToArrayLimit(r, l) {
41
- var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
42
- if (null != t) {
43
- var e,
44
- n,
45
- i,
46
- u,
47
- a = [],
48
- f = !0,
49
- o = !1;
50
- try {
51
- if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
52
- } catch (r) {
53
- o = !0, n = r;
54
- } finally {
55
- try {
56
- if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
57
- } finally {
58
- if (o) throw n;
59
- }
60
- }
61
- return a;
62
- }
63
- }
64
- function _nonIterableRest() {
65
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
66
- }
67
- function _regeneratorRuntime() {
68
- _regeneratorRuntime = function () {
69
- return e;
70
- };
71
- var t,
72
- e = {},
73
- r = Object.prototype,
74
- n = r.hasOwnProperty,
75
- o = Object.defineProperty || function (t, e, r) {
76
- t[e] = r.value;
77
- },
78
- i = "function" == typeof Symbol ? Symbol : {},
79
- a = i.iterator || "@@iterator",
80
- c = i.asyncIterator || "@@asyncIterator",
81
- u = i.toStringTag || "@@toStringTag";
82
- function define(t, e, r) {
83
- return Object.defineProperty(t, e, {
84
- value: r,
85
- enumerable: !0,
86
- configurable: !0,
87
- writable: !0
88
- }), t[e];
89
- }
90
- try {
91
- define({}, "");
92
- } catch (t) {
93
- define = function (t, e, r) {
94
- return t[e] = r;
95
- };
96
- }
97
- function wrap(t, e, r, n) {
98
- var i = e && e.prototype instanceof Generator ? e : Generator,
99
- a = Object.create(i.prototype),
100
- c = new Context(n || []);
101
- return o(a, "_invoke", {
102
- value: makeInvokeMethod(t, r, c)
103
- }), a;
104
- }
105
- function tryCatch(t, e, r) {
106
- try {
107
- return {
108
- type: "normal",
109
- arg: t.call(e, r)
110
- };
111
- } catch (t) {
112
- return {
113
- type: "throw",
114
- arg: t
115
- };
116
- }
117
- }
118
- e.wrap = wrap;
119
- var h = "suspendedStart",
120
- l = "suspendedYield",
121
- f = "executing",
122
- s = "completed",
123
- y = {};
124
- function Generator() {}
125
- function GeneratorFunction() {}
126
- function GeneratorFunctionPrototype() {}
127
- var p = {};
128
- define(p, a, function () {
129
- return this;
130
- });
131
- var d = Object.getPrototypeOf,
132
- v = d && d(d(values([])));
133
- v && v !== r && n.call(v, a) && (p = v);
134
- var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
135
- function defineIteratorMethods(t) {
136
- ["next", "throw", "return"].forEach(function (e) {
137
- define(t, e, function (t) {
138
- return this._invoke(e, t);
139
- });
140
- });
141
- }
142
- function AsyncIterator(t, e) {
143
- function invoke(r, o, i, a) {
144
- var c = tryCatch(t[r], t, o);
145
- if ("throw" !== c.type) {
146
- var u = c.arg,
147
- h = u.value;
148
- return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
149
- invoke("next", t, i, a);
150
- }, function (t) {
151
- invoke("throw", t, i, a);
152
- }) : e.resolve(h).then(function (t) {
153
- u.value = t, i(u);
154
- }, function (t) {
155
- return invoke("throw", t, i, a);
156
- });
157
- }
158
- a(c.arg);
159
- }
160
- var r;
161
- o(this, "_invoke", {
162
- value: function (t, n) {
163
- function callInvokeWithMethodAndArg() {
164
- return new e(function (e, r) {
165
- invoke(t, n, e, r);
166
- });
167
- }
168
- return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
169
- }
170
- });
171
- }
172
- function makeInvokeMethod(e, r, n) {
173
- var o = h;
174
- return function (i, a) {
175
- if (o === f) throw Error("Generator is already running");
176
- if (o === s) {
177
- if ("throw" === i) throw a;
178
- return {
179
- value: t,
180
- done: !0
181
- };
182
- }
183
- for (n.method = i, n.arg = a;;) {
184
- var c = n.delegate;
185
- if (c) {
186
- var u = maybeInvokeDelegate(c, n);
187
- if (u) {
188
- if (u === y) continue;
189
- return u;
190
- }
191
- }
192
- if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
193
- if (o === h) throw o = s, n.arg;
194
- n.dispatchException(n.arg);
195
- } else "return" === n.method && n.abrupt("return", n.arg);
196
- o = f;
197
- var p = tryCatch(e, r, n);
198
- if ("normal" === p.type) {
199
- if (o = n.done ? s : l, p.arg === y) continue;
200
- return {
201
- value: p.arg,
202
- done: n.done
203
- };
204
- }
205
- "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
206
- }
207
- };
208
- }
209
- function maybeInvokeDelegate(e, r) {
210
- var n = r.method,
211
- o = e.iterator[n];
212
- if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
213
- var i = tryCatch(o, e.iterator, r.arg);
214
- if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
215
- var a = i.arg;
216
- return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
217
- }
218
- function pushTryEntry(t) {
219
- var e = {
220
- tryLoc: t[0]
221
- };
222
- 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
223
- }
224
- function resetTryEntry(t) {
225
- var e = t.completion || {};
226
- e.type = "normal", delete e.arg, t.completion = e;
227
- }
228
- function Context(t) {
229
- this.tryEntries = [{
230
- tryLoc: "root"
231
- }], t.forEach(pushTryEntry, this), this.reset(!0);
232
- }
233
- function values(e) {
234
- if (e || "" === e) {
235
- var r = e[a];
236
- if (r) return r.call(e);
237
- if ("function" == typeof e.next) return e;
238
- if (!isNaN(e.length)) {
239
- var o = -1,
240
- i = function next() {
241
- for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
242
- return next.value = t, next.done = !0, next;
243
- };
244
- return i.next = i;
245
- }
246
- }
247
- throw new TypeError(typeof e + " is not iterable");
248
- }
249
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
250
- value: GeneratorFunctionPrototype,
251
- configurable: !0
252
- }), o(GeneratorFunctionPrototype, "constructor", {
253
- value: GeneratorFunction,
254
- configurable: !0
255
- }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
256
- var e = "function" == typeof t && t.constructor;
257
- return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
258
- }, e.mark = function (t) {
259
- return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
260
- }, e.awrap = function (t) {
261
- return {
262
- __await: t
263
- };
264
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
265
- return this;
266
- }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
267
- void 0 === i && (i = Promise);
268
- var a = new AsyncIterator(wrap(t, r, n, o), i);
269
- return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
270
- return t.done ? t.value : a.next();
271
- });
272
- }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
273
- return this;
274
- }), define(g, "toString", function () {
275
- return "[object Generator]";
276
- }), e.keys = function (t) {
277
- var e = Object(t),
278
- r = [];
279
- for (var n in e) r.push(n);
280
- return r.reverse(), function next() {
281
- for (; r.length;) {
282
- var t = r.pop();
283
- if (t in e) return next.value = t, next.done = !1, next;
284
- }
285
- return next.done = !0, next;
286
- };
287
- }, e.values = values, Context.prototype = {
288
- constructor: Context,
289
- reset: function (e) {
290
- if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
291
- },
292
- stop: function () {
293
- this.done = !0;
294
- var t = this.tryEntries[0].completion;
295
- if ("throw" === t.type) throw t.arg;
296
- return this.rval;
297
- },
298
- dispatchException: function (e) {
299
- if (this.done) throw e;
300
- var r = this;
301
- function handle(n, o) {
302
- return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
303
- }
304
- for (var o = this.tryEntries.length - 1; o >= 0; --o) {
305
- var i = this.tryEntries[o],
306
- a = i.completion;
307
- if ("root" === i.tryLoc) return handle("end");
308
- if (i.tryLoc <= this.prev) {
309
- var c = n.call(i, "catchLoc"),
310
- u = n.call(i, "finallyLoc");
311
- if (c && u) {
312
- if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
313
- if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
314
- } else if (c) {
315
- if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
316
- } else {
317
- if (!u) throw Error("try statement without catch or finally");
318
- if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
319
- }
320
- }
321
- }
322
- },
323
- abrupt: function (t, e) {
324
- for (var r = this.tryEntries.length - 1; r >= 0; --r) {
325
- var o = this.tryEntries[r];
326
- if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
327
- var i = o;
328
- break;
329
- }
330
- }
331
- i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
332
- var a = i ? i.completion : {};
333
- return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
334
- },
335
- complete: function (t, e) {
336
- if ("throw" === t.type) throw t.arg;
337
- return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
338
- },
339
- finish: function (t) {
340
- for (var e = this.tryEntries.length - 1; e >= 0; --e) {
341
- var r = this.tryEntries[e];
342
- if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
343
- }
344
- },
345
- catch: function (t) {
346
- for (var e = this.tryEntries.length - 1; e >= 0; --e) {
347
- var r = this.tryEntries[e];
348
- if (r.tryLoc === t) {
349
- var n = r.completion;
350
- if ("throw" === n.type) {
351
- var o = n.arg;
352
- resetTryEntry(r);
353
- }
354
- return o;
355
- }
356
- }
357
- throw Error("illegal catch attempt");
358
- },
359
- delegateYield: function (e, r, n) {
360
- return this.delegate = {
361
- iterator: values(e),
362
- resultName: r,
363
- nextLoc: n
364
- }, "next" === this.method && (this.arg = t), y;
365
- }
366
- }, e;
367
- }
368
- function _slicedToArray(r, e) {
369
- return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
370
- }
371
- function _unsupportedIterableToArray(r, a) {
372
- if (r) {
373
- if ("string" == typeof r) return _arrayLikeToArray(r, a);
374
- var t = {}.toString.call(r).slice(8, -1);
375
- return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
376
- }
377
- }
6
+ /******************************************************************************
7
+ Copyright (c) Microsoft Corporation.
8
+
9
+ Permission to use, copy, modify, and/or distribute this software for any
10
+ purpose with or without fee is hereby granted.
11
+
12
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
13
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
14
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
15
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
16
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
17
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
18
+ PERFORMANCE OF THIS SOFTWARE.
19
+ ***************************************************************************** */
20
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
21
+
22
+
23
+ function __awaiter(thisArg, _arguments, P, generator) {
24
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
25
+ return new (P || (P = Promise))(function (resolve, reject) {
26
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
27
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
28
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
29
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
30
+ });
31
+ }
32
+
33
+ function __generator(thisArg, body) {
34
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
35
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
36
+ function verb(n) { return function (v) { return step([n, v]); }; }
37
+ function step(op) {
38
+ if (f) throw new TypeError("Generator is already executing.");
39
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
40
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
41
+ if (y = 0, t) op = [op[0] & 2, t.value];
42
+ switch (op[0]) {
43
+ case 0: case 1: t = op; break;
44
+ case 4: _.label++; return { value: op[1], done: false };
45
+ case 5: _.label++; y = op[1]; op = [0]; continue;
46
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
47
+ default:
48
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
49
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
50
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
51
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
52
+ if (t[2]) _.ops.pop();
53
+ _.trys.pop(); continue;
54
+ }
55
+ op = body.call(thisArg, _);
56
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
57
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
58
+ }
59
+ }
60
+
61
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
62
+ var e = new Error(message);
63
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
64
+ };
378
65
 
379
66
  // src/styles/colors.ts
380
67
  var lightTheme = {
381
68
  primary: {
382
- hex: '#1A73E8',
69
+ hex: "#1A73E8",
383
70
  rgb: {
384
71
  r: 26,
385
72
  g: 115,
@@ -387,7 +74,7 @@ var lightTheme = {
387
74
  }
388
75
  },
389
76
  secondary: {
390
- hex: '#F0F6FF',
77
+ hex: "#F0F6FF",
391
78
  rgb: {
392
79
  r: 240,
393
80
  g: 246,
@@ -395,7 +82,7 @@ var lightTheme = {
395
82
  }
396
83
  },
397
84
  background: {
398
- hex: '#FFFFFF',
85
+ hex: "#FFFFFF",
399
86
  rgb: {
400
87
  r: 255,
401
88
  g: 255,
@@ -403,7 +90,7 @@ var lightTheme = {
403
90
  }
404
91
  },
405
92
  text: {
406
- hex: '#000000',
93
+ hex: "#000000",
407
94
  rgb: {
408
95
  r: 0,
409
96
  g: 0,
@@ -411,6 +98,39 @@ var lightTheme = {
411
98
  }
412
99
  },
413
100
  textButton: {
101
+ hex: "#FFFFFF",
102
+ rgb: {
103
+ r: 255,
104
+ g: 255,
105
+ b: 255
106
+ }
107
+ },
108
+ error: {
109
+ hex: "#FF5252",
110
+ rgb: {
111
+ r: 255,
112
+ g: 82,
113
+ b: 82
114
+ }
115
+ },
116
+ success: {
117
+ hex: "#4CAF50",
118
+ rgb: {
119
+ r: 76,
120
+ g: 175,
121
+ b: 80
122
+ }
123
+ },
124
+ warning: {
125
+ hex: "#FFC107",
126
+ rgb: {
127
+ r: 255,
128
+ g: 193,
129
+ b: 7
130
+ }
131
+ },
132
+ body: {
133
+ // Body color is the same as background in the light theme
414
134
  hex: '#FFFFFF',
415
135
  rgb: {
416
136
  r: 255,
@@ -421,7 +141,7 @@ var lightTheme = {
421
141
  };
422
142
  var darkTheme = {
423
143
  primary: {
424
- hex: '#BB86FC',
144
+ hex: "#BB86FC",
425
145
  rgb: {
426
146
  r: 187,
427
147
  g: 134,
@@ -429,7 +149,7 @@ var darkTheme = {
429
149
  }
430
150
  },
431
151
  secondary: {
432
- hex: '#03DAC6',
152
+ hex: "#03DAC6",
433
153
  rgb: {
434
154
  r: 3,
435
155
  g: 218,
@@ -437,7 +157,7 @@ var darkTheme = {
437
157
  }
438
158
  },
439
159
  background: {
440
- hex: '#121212',
160
+ hex: "#121212",
441
161
  rgb: {
442
162
  r: 18,
443
163
  g: 18,
@@ -445,7 +165,7 @@ var darkTheme = {
445
165
  }
446
166
  },
447
167
  text: {
448
- hex: '#FFFFFF',
168
+ hex: "#FFFFFF",
449
169
  rgb: {
450
170
  r: 255,
451
171
  g: 255,
@@ -453,14 +173,45 @@ var darkTheme = {
453
173
  }
454
174
  },
455
175
  textButton: {
456
- hex: '#FFFFFF',
176
+ hex: "#FFFFFF",
457
177
  rgb: {
458
178
  r: 255,
459
179
  g: 255,
460
180
  b: 255
461
181
  }
182
+ },
183
+ error: {
184
+ hex: "#CF6679",
185
+ rgb: {
186
+ r: 207,
187
+ g: 102,
188
+ b: 121
189
+ }
190
+ },
191
+ success: {
192
+ hex: "#03DAC6",
193
+ rgb: {
194
+ r: 3,
195
+ g: 218,
196
+ b: 198
197
+ }
198
+ },
199
+ warning: {
200
+ hex: "#FFB74D",
201
+ rgb: {
202
+ r: 255,
203
+ g: 183,
204
+ b: 77
205
+ }
206
+ },
207
+ body: {
208
+ hex: '#1C1C1E',
209
+ rgb: {
210
+ r: 28,
211
+ g: 28,
212
+ b: 30
213
+ }
462
214
  }
463
- // Add more categories as needed
464
215
  };
465
216
 
466
217
  /**
@@ -478,52 +229,43 @@ var ThemeContext = /*#__PURE__*/createContext({
478
229
  * @param children - The child components that will consume the theme context.
479
230
  * @param initialTheme - Optional prop to set the initial theme.
480
231
  */
481
- var ThemeProvider = function ThemeProvider(_ref) {
482
- var children = _ref.children,
483
- initialTheme = _ref.initialTheme;
484
- var _useState = useState(null),
485
- _useState2 = _slicedToArray(_useState, 2),
486
- colorScheme = _useState2[0],
487
- setColorScheme = _useState2[1];
232
+ var ThemeProvider = function ThemeProvider(_a) {
233
+ var children = _a.children,
234
+ initialTheme = _a.initialTheme;
235
+ var _b = useState(null),
236
+ colorScheme = _b[0],
237
+ setColorScheme = _b[1];
488
238
  // Use useAsyncStorage hook for managing the theme storage
489
- var _useAsyncStorage = useAsyncStorage('theme'),
490
- getItem = _useAsyncStorage.getItem,
491
- setItem = _useAsyncStorage.setItem;
239
+ var _c = useAsyncStorage('theme'),
240
+ getItem = _c.getItem,
241
+ setItem = _c.setItem;
492
242
  useEffect(function () {
493
- var loadTheme = /*#__PURE__*/function () {
494
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
243
+ var loadTheme = function loadTheme() {
244
+ return __awaiter(void 0, void 0, void 0, function () {
495
245
  var systemTheme;
496
- return _regeneratorRuntime().wrap(function _callee$(_context) {
497
- while (1) switch (_context.prev = _context.next) {
498
- case 0:
499
- try {
500
- // const storedTheme = await getItem();
501
- // if (storedTheme === 'dark' || storedTheme === 'light') {
502
- // setColorScheme(storedTheme);
503
- //}
504
- if (initialTheme) {
505
- setColorScheme(initialTheme);
506
- } else {
507
- systemTheme = Appearance.getColorScheme();
508
- setColorScheme(systemTheme);
509
- }
510
- } catch (error) {
511
- console.error('Failed to load theme.', error);
512
- setColorScheme(Appearance.getColorScheme());
513
- }
514
- case 1:
515
- case "end":
516
- return _context.stop();
246
+ return __generator(this, function (_a) {
247
+ try {
248
+ // const storedTheme = await getItem();
249
+ // if (storedTheme === 'dark' || storedTheme === 'light') {
250
+ // setColorScheme(storedTheme);
251
+ //}
252
+ if (initialTheme) {
253
+ setColorScheme(initialTheme);
254
+ } else {
255
+ systemTheme = Appearance.getColorScheme();
256
+ setColorScheme(systemTheme);
257
+ }
258
+ } catch (error) {
259
+ console.error('Failed to load theme.', error);
260
+ setColorScheme(Appearance.getColorScheme());
517
261
  }
518
- }, _callee);
519
- }));
520
- return function loadTheme() {
521
- return _ref2.apply(this, arguments);
522
- };
523
- }();
262
+ return [2 /*return*/];
263
+ });
264
+ });
265
+ };
524
266
  loadTheme();
525
- var subscription = Appearance.addChangeListener(function (_ref3) {
526
- var colorScheme = _ref3.colorScheme;
267
+ var subscription = Appearance.addChangeListener(function (_a) {
268
+ var colorScheme = _a.colorScheme;
527
269
  if (!colorScheme) return; // Prevent setting null
528
270
  setColorScheme(colorScheme);
529
271
  });
@@ -531,34 +273,29 @@ var ThemeProvider = function ThemeProvider(_ref) {
531
273
  return subscription.remove();
532
274
  };
533
275
  }, [initialTheme, getItem]);
534
- var toggleTheme = /*#__PURE__*/function () {
535
- var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
536
- var newTheme;
537
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
538
- while (1) switch (_context2.prev = _context2.next) {
276
+ var toggleTheme = function toggleTheme() {
277
+ return __awaiter(void 0, void 0, void 0, function () {
278
+ var newTheme, error_1;
279
+ return __generator(this, function (_a) {
280
+ switch (_a.label) {
539
281
  case 0:
540
- _context2.prev = 0;
282
+ _a.trys.push([0, 2,, 3]);
541
283
  newTheme = colorScheme === 'dark' ? 'light' : 'dark';
542
284
  setColorScheme(newTheme);
543
- _context2.next = 5;
544
- return setItem(newTheme);
545
- case 5:
546
- _context2.next = 10;
547
- break;
548
- case 7:
549
- _context2.prev = 7;
550
- _context2.t0 = _context2["catch"](0);
551
- console.error('Failed to toggle theme.', _context2.t0);
552
- case 10:
553
- case "end":
554
- return _context2.stop();
285
+ return [4 /*yield*/, setItem(newTheme)];
286
+ case 1:
287
+ _a.sent(); // Use setItem from useAsyncStorage
288
+ return [3 /*break*/, 3];
289
+ case 2:
290
+ error_1 = _a.sent();
291
+ console.error('Failed to toggle theme.', error_1);
292
+ return [3 /*break*/, 3];
293
+ case 3:
294
+ return [2 /*return*/];
555
295
  }
556
- }, _callee2, null, [[0, 7]]);
557
- }));
558
- return function toggleTheme() {
559
- return _ref4.apply(this, arguments);
560
- };
561
- }();
296
+ });
297
+ });
298
+ };
562
299
  var theme = {
563
300
  colors: colorScheme === 'dark' ? darkTheme : lightTheme
564
301
  };
@@ -571,9 +308,9 @@ var ThemeProvider = function ThemeProvider(_ref) {
571
308
  };
572
309
 
573
310
  var ThemeToggle = function ThemeToggle() {
574
- var _useContext = useContext(ThemeContext),
575
- theme = _useContext.theme,
576
- toggleTheme = _useContext.toggleTheme;
311
+ var _a = useContext(ThemeContext),
312
+ theme = _a.theme,
313
+ toggleTheme = _a.toggleTheme;
577
314
  var isDarkMode = theme.colors === darkTheme;
578
315
  return /*#__PURE__*/React.createElement(View, {
579
316
  style: styles$2.container
@@ -648,21 +385,20 @@ function typeStyles(type, disabled, themeColors) {
648
385
  * @param borderRadius - Custom border radius value. Overrides the `rounded` prop if provided.
649
386
  * @param type - Specifies the button type for styling ('submit', 'button', 'cancel').
650
387
  */
651
- var Button = function Button(_ref) {
652
- var children = _ref.children,
653
- _ref$disabled = _ref.disabled,
654
- disabled = _ref$disabled === void 0 ? false : _ref$disabled,
655
- _ref$type = _ref.type,
656
- type = _ref$type === void 0 ? 'button' : _ref$type,
657
- _ref$rounded = _ref.rounded,
658
- rounded = _ref$rounded === void 0 ? true : _ref$rounded,
659
- _ref$borderRadius = _ref.borderRadius,
660
- borderRadius = _ref$borderRadius === void 0 ? 30 : _ref$borderRadius,
661
- _ref$isFullWidth = _ref.isFullWidth,
662
- isFullWidth = _ref$isFullWidth === void 0 ? false : _ref$isFullWidth,
663
- onPress = _ref.onPress;
664
- var _useContext = useContext(ThemeContext),
665
- theme = _useContext.theme;
388
+ var Button = function Button(_a) {
389
+ var children = _a.children,
390
+ _b = _a.disabled,
391
+ disabled = _b === void 0 ? false : _b,
392
+ _c = _a.type,
393
+ type = _c === void 0 ? 'button' : _c,
394
+ _d = _a.rounded,
395
+ rounded = _d === void 0 ? true : _d,
396
+ _e = _a.borderRadius,
397
+ borderRadius = _e === void 0 ? 30 : _e,
398
+ _f = _a.isFullWidth,
399
+ isFullWidth = _f === void 0 ? false : _f,
400
+ onPress = _a.onPress;
401
+ var theme = useContext(ThemeContext).theme;
666
402
  var colors = theme.colors;
667
403
  var computedStyles = useMemo(function () {
668
404
  return StyleSheet.flatten([styles$1.button, typeStyles(type, disabled, colors), rounded && {
@@ -698,10 +434,6 @@ var styles$1 = StyleSheet.create({
698
434
  });
699
435
 
700
436
  // src/cards/Card.tsx
701
- var Animated = Reanimated["default"];
702
- var useAnimatedStyle = Reanimated.useAnimatedStyle,
703
- useSharedValue = Reanimated.useSharedValue,
704
- withSpring = Reanimated.withSpring;
705
437
  /**
706
438
  * Card component that adapts its styles based on the current theme.
707
439
  * Supports dynamic styling, shadows, and press animations.
@@ -714,36 +446,21 @@ var useAnimatedStyle = Reanimated.useAnimatedStyle,
714
446
  * @param elevation - Elevation for Android shadow. Overrides default.
715
447
  * @param shadowProps - Custom shadow properties for iOS. Overrides defaults.
716
448
  */
717
- var Card = function Card(_ref) {
718
- var children = _ref.children,
719
- style = _ref.style,
720
- onPress = _ref.onPress,
721
- _ref$pressable = _ref.pressable,
722
- pressable = _ref$pressable === void 0 ? false : _ref$pressable,
723
- _ref$borderRadius = _ref.borderRadius,
724
- borderRadius = _ref$borderRadius === void 0 ? 12 : _ref$borderRadius,
725
- _ref$elevation = _ref.elevation,
726
- elevation = _ref$elevation === void 0 ? 4 : _ref$elevation,
727
- _ref$shadowProps = _ref.shadowProps,
728
- shadowProps = _ref$shadowProps === void 0 ? {} : _ref$shadowProps;
729
- var _useContext = useContext(ThemeContext),
730
- theme = _useContext.theme;
449
+ var Card = function Card(_a) {
450
+ var children = _a.children,
451
+ style = _a.style,
452
+ onPress = _a.onPress,
453
+ _b = _a.pressable,
454
+ pressable = _b === void 0 ? false : _b,
455
+ _c = _a.borderRadius,
456
+ borderRadius = _c === void 0 ? 12 : _c,
457
+ _d = _a.elevation,
458
+ elevation = _d === void 0 ? 4 : _d,
459
+ _e = _a.shadowProps,
460
+ shadowProps = _e === void 0 ? {} : _e;
461
+ var theme = useContext(ThemeContext).theme;
731
462
  var colors = theme.colors;
732
463
  // Animation state for pressable effect
733
- var scale = useSharedValue(1);
734
- var animatedStyle = useAnimatedStyle(function () {
735
- return {
736
- transform: [{
737
- scale: scale.value
738
- }]
739
- };
740
- });
741
- var handlePressIn = function handlePressIn() {
742
- scale.value = withSpring(0.95);
743
- };
744
- var handlePressOut = function handlePressOut() {
745
- scale.value = withSpring(1);
746
- };
747
464
  // Default shadow styles (improved platform-specific handling)
748
465
  var defaultShadow = Platform.select({
749
466
  ios: {
@@ -762,7 +479,7 @@ var Card = function Card(_ref) {
762
479
  });
763
480
  var cardStyles = [styles.container, {
764
481
  borderRadius: borderRadius,
765
- backgroundColor: colors.background.hex
482
+ backgroundColor: colors.body.hex
766
483
  }, defaultShadow,
767
484
  // Dynamic shadows based on platform
768
485
  style // External styles
@@ -770,12 +487,8 @@ var Card = function Card(_ref) {
770
487
  return pressable ? (/*#__PURE__*/React.createElement(TouchableOpacity, {
771
488
  activeOpacity: 0.8,
772
489
  onPress: onPress,
773
- onPressIn: handlePressIn,
774
- onPressOut: handlePressOut,
775
490
  style: cardStyles
776
- }, /*#__PURE__*/React.createElement(Animated.View, {
777
- style: animatedStyle
778
- }, children))) : (/*#__PURE__*/React.createElement(View, {
491
+ }, children)) : (/*#__PURE__*/React.createElement(View, {
779
492
  style: cardStyles
780
493
  }, children));
781
494
  };