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