aport-tools 4.0.29 → 4.0.31

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