strivui 1.22.61 → 1.22.63

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.
@@ -0,0 +1,823 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { useState, useRef, useEffect } from 'react';
3
+
4
+ function _arrayLikeToArray(r, a) {
5
+ (null == a || a > r.length) && (a = r.length);
6
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
7
+ return n;
8
+ }
9
+ function _arrayWithHoles(r) {
10
+ if (Array.isArray(r)) return r;
11
+ }
12
+ function _defineProperty(e, r, t) {
13
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
14
+ value: t,
15
+ enumerable: true,
16
+ configurable: true,
17
+ writable: true
18
+ }) : e[r] = t, e;
19
+ }
20
+ function _iterableToArrayLimit(r, l) {
21
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
22
+ if (null != t) {
23
+ var e,
24
+ n,
25
+ i,
26
+ u,
27
+ a = [],
28
+ f = true,
29
+ o = false;
30
+ try {
31
+ 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);
32
+ } catch (r) {
33
+ o = true, n = r;
34
+ } finally {
35
+ try {
36
+ if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
37
+ } finally {
38
+ if (o) throw n;
39
+ }
40
+ }
41
+ return a;
42
+ }
43
+ }
44
+ function _nonIterableRest() {
45
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
46
+ }
47
+ function ownKeys(e, r) {
48
+ var t = Object.keys(e);
49
+ if (Object.getOwnPropertySymbols) {
50
+ var o = Object.getOwnPropertySymbols(e);
51
+ r && (o = o.filter(function (r) {
52
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
53
+ })), t.push.apply(t, o);
54
+ }
55
+ return t;
56
+ }
57
+ function _objectSpread2(e) {
58
+ for (var r = 1; r < arguments.length; r++) {
59
+ var t = null != arguments[r] ? arguments[r] : {};
60
+ r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
61
+ _defineProperty(e, r, t[r]);
62
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
63
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
64
+ });
65
+ }
66
+ return e;
67
+ }
68
+ function _objectWithoutProperties(e, t) {
69
+ if (null == e) return {};
70
+ var o,
71
+ r,
72
+ i = _objectWithoutPropertiesLoose(e, t);
73
+ if (Object.getOwnPropertySymbols) {
74
+ var n = Object.getOwnPropertySymbols(e);
75
+ for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
76
+ }
77
+ return i;
78
+ }
79
+ function _objectWithoutPropertiesLoose(r, e) {
80
+ if (null == r) return {};
81
+ var t = {};
82
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
83
+ if (-1 !== e.indexOf(n)) continue;
84
+ t[n] = r[n];
85
+ }
86
+ return t;
87
+ }
88
+ function _slicedToArray(r, e) {
89
+ return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
90
+ }
91
+ function _toPrimitive(t, r) {
92
+ if ("object" != typeof t || !t) return t;
93
+ var e = t[Symbol.toPrimitive];
94
+ if (void 0 !== e) {
95
+ var i = e.call(t, r);
96
+ if ("object" != typeof i) return i;
97
+ throw new TypeError("@@toPrimitive must return a primitive value.");
98
+ }
99
+ return ("string" === r ? String : Number)(t);
100
+ }
101
+ function _toPropertyKey(t) {
102
+ var i = _toPrimitive(t, "string");
103
+ return "symbol" == typeof i ? i : i + "";
104
+ }
105
+ function _unsupportedIterableToArray(r, a) {
106
+ if (r) {
107
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
108
+ var t = {}.toString.call(r).slice(8, -1);
109
+ 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;
110
+ }
111
+ }
112
+
113
+ function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
114
+
115
+ var _excluded$4 = ["children", "className"],
116
+ _excluded2$3 = ["className"],
117
+ _excluded3$2 = ["children", "className"],
118
+ _excluded4$2 = ["children", "className"],
119
+ _excluded5$1 = ["children", "className"],
120
+ _excluded6$1 = ["children", "className"],
121
+ _excluded7$1 = ["children", "className"],
122
+ _excluded8$1 = ["children", "className"],
123
+ _excluded9$1 = ["children", "className"],
124
+ _excluded0$1 = ["children", "className"],
125
+ _excluded1$1 = ["children", "className"],
126
+ _excluded10 = ["children", "className"],
127
+ _excluded11 = ["children", "className"],
128
+ _excluded12 = ["children", "className"],
129
+ _excluded13 = ["children", "className"];
130
+ var Button = function Button(_ref) {
131
+ var children = _ref.children,
132
+ className = _ref.className,
133
+ props = _objectWithoutProperties(_ref, _excluded$4);
134
+ return jsx("button", _objectSpread2(_objectSpread2({
135
+ className: clsx('default_button', className)
136
+ }, props), {}, {
137
+ children: children
138
+ }));
139
+ };
140
+ var Input = function Input(_ref2) {
141
+ var className = _ref2.className,
142
+ props = _objectWithoutProperties(_ref2, _excluded2$3);
143
+ return jsx("input", _objectSpread2({
144
+ className: clsx('default_input', className)
145
+ }, props));
146
+ };
147
+ var Link = function Link(_ref3) {
148
+ var children = _ref3.children,
149
+ className = _ref3.className,
150
+ props = _objectWithoutProperties(_ref3, _excluded3$2);
151
+ return jsx("a", _objectSpread2(_objectSpread2({
152
+ className: clsx('default_link', className)
153
+ }, props), {}, {
154
+ children: children
155
+ }));
156
+ };
157
+ var TextArea = function TextArea(_ref4) {
158
+ var children = _ref4.children,
159
+ className = _ref4.className,
160
+ props = _objectWithoutProperties(_ref4, _excluded4$2);
161
+ return jsx("textarea", _objectSpread2(_objectSpread2({
162
+ className: clsx('default_textarea', className)
163
+ }, props), {}, {
164
+ children: children
165
+ }));
166
+ };
167
+ var Select = function Select(_ref5) {
168
+ var children = _ref5.children,
169
+ className = _ref5.className,
170
+ props = _objectWithoutProperties(_ref5, _excluded5$1);
171
+ return jsx("select", _objectSpread2(_objectSpread2({
172
+ className: clsx('default_select', className)
173
+ }, props), {}, {
174
+ children: children
175
+ }));
176
+ };
177
+ var View = function View(_ref6) {
178
+ var children = _ref6.children,
179
+ className = _ref6.className,
180
+ props = _objectWithoutProperties(_ref6, _excluded6$1);
181
+ return jsx("div", _objectSpread2(_objectSpread2({
182
+ className: clsx('default_view', className)
183
+ }, props), {}, {
184
+ children: children
185
+ }));
186
+ };
187
+ var Text = function Text(_ref7) {
188
+ var children = _ref7.children,
189
+ className = _ref7.className,
190
+ props = _objectWithoutProperties(_ref7, _excluded7$1);
191
+ return jsx("p", _objectSpread2(_objectSpread2({
192
+ className: clsx('default_text', className)
193
+ }, props), {}, {
194
+ children: children
195
+ }));
196
+ };
197
+ var Label = function Label(_ref8) {
198
+ var children = _ref8.children,
199
+ className = _ref8.className,
200
+ props = _objectWithoutProperties(_ref8, _excluded8$1);
201
+ return jsx("label", _objectSpread2(_objectSpread2({
202
+ className: clsx('default_label', className)
203
+ }, props), {}, {
204
+ children: children
205
+ }));
206
+ };
207
+ var Span = function Span(_ref9) {
208
+ var children = _ref9.children,
209
+ className = _ref9.className,
210
+ props = _objectWithoutProperties(_ref9, _excluded9$1);
211
+ return jsx("span", _objectSpread2(_objectSpread2({
212
+ className: clsx('default_span', className)
213
+ }, props), {}, {
214
+ children: children
215
+ }));
216
+ };
217
+ var H1 = function H1(_ref0) {
218
+ var children = _ref0.children,
219
+ className = _ref0.className,
220
+ props = _objectWithoutProperties(_ref0, _excluded0$1);
221
+ return jsx("h1", _objectSpread2(_objectSpread2({
222
+ className: clsx('default_h1', className)
223
+ }, props), {}, {
224
+ children: children
225
+ }));
226
+ };
227
+ var H2 = function H2(_ref1) {
228
+ var children = _ref1.children,
229
+ className = _ref1.className,
230
+ props = _objectWithoutProperties(_ref1, _excluded1$1);
231
+ return jsx("h2", _objectSpread2(_objectSpread2({
232
+ className: clsx('default_h2', className)
233
+ }, props), {}, {
234
+ children: children
235
+ }));
236
+ };
237
+ var H3 = function H3(_ref10) {
238
+ var children = _ref10.children,
239
+ className = _ref10.className,
240
+ props = _objectWithoutProperties(_ref10, _excluded10);
241
+ return jsx("h3", _objectSpread2(_objectSpread2({
242
+ className: clsx('default_h3', className)
243
+ }, props), {}, {
244
+ children: children
245
+ }));
246
+ };
247
+ var H4 = function H4(_ref11) {
248
+ var children = _ref11.children,
249
+ className = _ref11.className,
250
+ props = _objectWithoutProperties(_ref11, _excluded11);
251
+ return jsx("h4", _objectSpread2(_objectSpread2({
252
+ className: clsx('default_h4', className)
253
+ }, props), {}, {
254
+ children: children
255
+ }));
256
+ };
257
+ var H5 = function H5(_ref12) {
258
+ var children = _ref12.children,
259
+ className = _ref12.className,
260
+ props = _objectWithoutProperties(_ref12, _excluded12);
261
+ return jsx("h5", _objectSpread2(_objectSpread2({
262
+ className: clsx('default_h5', className)
263
+ }, props), {}, {
264
+ children: children
265
+ }));
266
+ };
267
+ var H6 = function H6(_ref13) {
268
+ var children = _ref13.children,
269
+ className = _ref13.className,
270
+ props = _objectWithoutProperties(_ref13, _excluded13);
271
+ return jsx("h6", _objectSpread2(_objectSpread2({
272
+ className: clsx('default_h6', className)
273
+ }, props), {}, {
274
+ children: children
275
+ }));
276
+ };
277
+
278
+ var _excluded$3 = ["children", "onPress", "style", "className"],
279
+ _excluded2$2 = ["children", "horizontal", "style", "onScroll", "className"],
280
+ _excluded3$1 = ["children", "onPress", "className"],
281
+ _excluded4$1 = ["source", "resizeMode", "children", "style", "className"];
282
+ var Pressable = function Pressable(_ref) {
283
+ var children = _ref.children,
284
+ onPress = _ref.onPress,
285
+ style = _ref.style,
286
+ className = _ref.className,
287
+ props = _objectWithoutProperties(_ref, _excluded$3);
288
+ return jsx("div", _objectSpread2(_objectSpread2({
289
+ role: "button",
290
+ tabIndex: 0,
291
+ className: clsx("default_pressable", className),
292
+ style: style,
293
+ onClick: onPress
294
+ }, props), {}, {
295
+ children: children
296
+ }));
297
+ };
298
+ var ScrollView = function ScrollView(_ref2) {
299
+ var children = _ref2.children,
300
+ horizontal = _ref2.horizontal,
301
+ style = _ref2.style,
302
+ onScroll = _ref2.onScroll,
303
+ className = _ref2.className,
304
+ props = _objectWithoutProperties(_ref2, _excluded2$2);
305
+ return jsx("div", _objectSpread2(_objectSpread2({
306
+ className: clsx("default_scrollview", className),
307
+ style: _objectSpread2({
308
+ overflowX: horizontal ? "auto" : "hidden",
309
+ overflowY: horizontal ? "hidden" : "auto"
310
+ }, style),
311
+ onScroll: onScroll
312
+ }, props), {}, {
313
+ children: children
314
+ }));
315
+ };
316
+ var Image = function Image(props) {
317
+ return jsx("img", _objectSpread2({
318
+ className: "default_image"
319
+ }, props));
320
+ };
321
+ // ActivityIndicator
322
+ var ActivityIndicator = function ActivityIndicator() {
323
+ return jsx("div", {
324
+ className: "default_activity_indicator"
325
+ });
326
+ };
327
+ var TouchableOpacity = function TouchableOpacity(_ref3) {
328
+ var children = _ref3.children,
329
+ onPress = _ref3.onPress,
330
+ className = _ref3.className,
331
+ props = _objectWithoutProperties(_ref3, _excluded3$1);
332
+ var _useState = useState(false),
333
+ _useState2 = _slicedToArray(_useState, 2),
334
+ active = _useState2[0],
335
+ setActive = _useState2[1];
336
+ return jsx("div", _objectSpread2(_objectSpread2({
337
+ role: "button",
338
+ tabIndex: 0,
339
+ className: clsx("default_touchable_opacity", active && "default_touchable_opacity_active ", className),
340
+ onMouseDown: function onMouseDown() {
341
+ return setActive(true);
342
+ },
343
+ onMouseUp: function onMouseUp() {
344
+ return setActive(false);
345
+ },
346
+ onMouseLeave: function onMouseLeave() {
347
+ return setActive(false);
348
+ },
349
+ onClick: onPress
350
+ }, props), {}, {
351
+ children: children
352
+ }));
353
+ };
354
+ function FlatList(_ref4) {
355
+ var data = _ref4.data,
356
+ renderItem = _ref4.renderItem,
357
+ keyExtractor = _ref4.keyExtractor;
358
+ return jsx("div", {
359
+ className: "default_flatlist",
360
+ children: data.map(function (item, index) {
361
+ var key = keyExtractor ? keyExtractor(item, index) : String(index);
362
+ return jsx("div", {
363
+ children: renderItem({
364
+ item: item,
365
+ index: index
366
+ })
367
+ }, key);
368
+ })
369
+ });
370
+ }
371
+ var ImageBackground = function ImageBackground(_ref5) {
372
+ var source = _ref5.source,
373
+ _ref5$resizeMode = _ref5.resizeMode,
374
+ resizeMode = _ref5$resizeMode === void 0 ? "cover" : _ref5$resizeMode,
375
+ children = _ref5.children,
376
+ style = _ref5.style,
377
+ className = _ref5.className,
378
+ props = _objectWithoutProperties(_ref5, _excluded4$1);
379
+ var backgroundSizeMap = {
380
+ cover: "cover",
381
+ contain: "contain",
382
+ stretch: "100% 100%",
383
+ center: "auto"
384
+ };
385
+ return jsx("div", _objectSpread2(_objectSpread2({
386
+ className: clsx("w-full h-full flex flex-col", className),
387
+ style: _objectSpread2({
388
+ backgroundImage: "url(".concat(source, ")"),
389
+ backgroundRepeat: "no-repeat",
390
+ backgroundPosition: "center",
391
+ backgroundSize: backgroundSizeMap[resizeMode]
392
+ }, style)
393
+ }, props), {}, {
394
+ children: children
395
+ }));
396
+ };
397
+ var Dialog = function Dialog(_ref7) {
398
+ var open = _ref7.open,
399
+ title = _ref7.title,
400
+ description = _ref7.description,
401
+ _ref7$confirmText = _ref7.confirmText,
402
+ confirmText = _ref7$confirmText === void 0 ? "OK" : _ref7$confirmText,
403
+ _ref7$cancelText = _ref7.cancelText,
404
+ cancelText = _ref7$cancelText === void 0 ? "Cancel" : _ref7$cancelText,
405
+ onConfirm = _ref7.onConfirm,
406
+ onCancel = _ref7.onCancel;
407
+ if (!open) return null;
408
+ return jsx("div", {
409
+ className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-[1000]",
410
+ children: jsxs("div", {
411
+ className: "bg-white p-6 rounded-md w-full max-w-sm shadow-lg",
412
+ onClick: function onClick(e) {
413
+ return e.stopPropagation();
414
+ },
415
+ children: [jsx("h3", {
416
+ className: "text-lg font-semibold mb-2",
417
+ children: title
418
+ }), jsx("p", {
419
+ className: "text-sm text-gray-600 mb-4",
420
+ children: description
421
+ }), jsxs("div", {
422
+ className: "flex justify-end gap-3",
423
+ children: [jsx("button", {
424
+ className: "px-4 py-2 rounded text-gray-600 hover:bg-gray-100",
425
+ onClick: onCancel,
426
+ children: cancelText
427
+ }), jsx("button", {
428
+ className: "px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700",
429
+ onClick: onConfirm,
430
+ children: confirmText
431
+ })]
432
+ })]
433
+ })
434
+ });
435
+ };
436
+ function SectionList(_ref9) {
437
+ var sections = _ref9.sections,
438
+ renderItem = _ref9.renderItem,
439
+ renderSectionHeader = _ref9.renderSectionHeader,
440
+ keyExtractor = _ref9.keyExtractor;
441
+ if (!renderItem) {
442
+ console.error("SectionList requires renderItem");
443
+ return null;
444
+ }
445
+ return jsx("div", {
446
+ className: "strivui-sectionlist",
447
+ children: sections.map(function (section, sectionIndex) {
448
+ return jsxs("div", {
449
+ children: [renderSectionHeader ? renderSectionHeader({
450
+ title: section.title,
451
+ sectionIndex: sectionIndex
452
+ }) : jsx("h4", {
453
+ className: "text-lg font-semibold mb-2",
454
+ children: section.title
455
+ }), jsx("div", {
456
+ className: "space-y-2",
457
+ children: section.data.map(function (item, index) {
458
+ var key = keyExtractor ? keyExtractor(item, index) : "".concat(sectionIndex, "-").concat(index);
459
+ return jsx("div", {
460
+ children: renderItem({
461
+ item: item,
462
+ index: index
463
+ })
464
+ }, key);
465
+ })
466
+ })]
467
+ }, sectionIndex);
468
+ })
469
+ });
470
+ }
471
+ var Overlay = function Overlay(_ref0) {
472
+ var visible = _ref0.visible,
473
+ onClick = _ref0.onClick,
474
+ children = _ref0.children;
475
+ if (!visible) return null;
476
+ return jsx("div", {
477
+ onClick: onClick,
478
+ className: "default_overlay",
479
+ children: children
480
+ });
481
+ };
482
+
483
+ var _excluded$2 = ["children", "className"],
484
+ _excluded2$1 = ["children", "className"],
485
+ _excluded3 = ["children", "className"],
486
+ _excluded4 = ["children", "className"],
487
+ _excluded5 = ["children", "className"],
488
+ _excluded6 = ["children", "className"],
489
+ _excluded7 = ["children", "className"],
490
+ _excluded8 = ["children", "className"],
491
+ _excluded9 = ["children", "className"],
492
+ _excluded0 = ["children", "className"],
493
+ _excluded1 = ["children", "className"];
494
+ var Table = function Table(_ref) {
495
+ var children = _ref.children,
496
+ _ref$className = _ref.className,
497
+ className = _ref$className === void 0 ? "" : _ref$className,
498
+ props = _objectWithoutProperties(_ref, _excluded$2);
499
+ return jsx("table", _objectSpread2(_objectSpread2({
500
+ className: clsx("default_table", className)
501
+ }, props), {}, {
502
+ children: children
503
+ }));
504
+ };
505
+ var TableHead = function TableHead(_ref2) {
506
+ var children = _ref2.children,
507
+ _ref2$className = _ref2.className,
508
+ className = _ref2$className === void 0 ? "" : _ref2$className,
509
+ props = _objectWithoutProperties(_ref2, _excluded2$1);
510
+ return jsx("thead", _objectSpread2(_objectSpread2({
511
+ className: clsx("default_table_head", className)
512
+ }, props), {}, {
513
+ children: children
514
+ }));
515
+ };
516
+ var TableBody = function TableBody(_ref3) {
517
+ var children = _ref3.children,
518
+ _ref3$className = _ref3.className,
519
+ className = _ref3$className === void 0 ? "" : _ref3$className,
520
+ props = _objectWithoutProperties(_ref3, _excluded3);
521
+ return jsx("tbody", _objectSpread2(_objectSpread2({
522
+ className: clsx("default_table_body", className)
523
+ }, props), {}, {
524
+ children: children
525
+ }));
526
+ };
527
+ var TableRow = function TableRow(_ref4) {
528
+ var children = _ref4.children,
529
+ _ref4$className = _ref4.className,
530
+ className = _ref4$className === void 0 ? "" : _ref4$className,
531
+ props = _objectWithoutProperties(_ref4, _excluded4);
532
+ return jsx("tr", _objectSpread2(_objectSpread2({
533
+ className: clsx("default_table_row", className)
534
+ }, props), {}, {
535
+ children: children
536
+ }));
537
+ };
538
+ var TableHeaderCell = function TableHeaderCell(_ref5) {
539
+ var children = _ref5.children,
540
+ _ref5$className = _ref5.className,
541
+ className = _ref5$className === void 0 ? "" : _ref5$className,
542
+ props = _objectWithoutProperties(_ref5, _excluded5);
543
+ return jsx("th", _objectSpread2(_objectSpread2({
544
+ className: clsx("default_th", className)
545
+ }, props), {}, {
546
+ children: children
547
+ }));
548
+ };
549
+ var TableDataCell = function TableDataCell(_ref6) {
550
+ var children = _ref6.children,
551
+ _ref6$className = _ref6.className,
552
+ className = _ref6$className === void 0 ? "" : _ref6$className,
553
+ props = _objectWithoutProperties(_ref6, _excluded6);
554
+ return jsx("td", _objectSpread2(_objectSpread2({
555
+ className: clsx("default_td", className)
556
+ }, props), {}, {
557
+ children: children
558
+ }));
559
+ };
560
+ var Header = function Header(_ref7) {
561
+ var children = _ref7.children,
562
+ _ref7$className = _ref7.className,
563
+ className = _ref7$className === void 0 ? "" : _ref7$className,
564
+ props = _objectWithoutProperties(_ref7, _excluded7);
565
+ return jsx("header", _objectSpread2(_objectSpread2({
566
+ className: clsx("default_header", className)
567
+ }, props), {}, {
568
+ children: children
569
+ }));
570
+ };
571
+ var Navigation = function Navigation(_ref8) {
572
+ var children = _ref8.children,
573
+ _ref8$className = _ref8.className,
574
+ className = _ref8$className === void 0 ? "" : _ref8$className,
575
+ props = _objectWithoutProperties(_ref8, _excluded8);
576
+ return jsx("nav", _objectSpread2(_objectSpread2({
577
+ className: clsx("default_nav", className)
578
+ }, props), {}, {
579
+ children: children
580
+ }));
581
+ };
582
+ var Section = function Section(_ref9) {
583
+ var children = _ref9.children,
584
+ _ref9$className = _ref9.className,
585
+ className = _ref9$className === void 0 ? "" : _ref9$className,
586
+ props = _objectWithoutProperties(_ref9, _excluded9);
587
+ return jsx("section", _objectSpread2(_objectSpread2({
588
+ className: clsx("default_section", className)
589
+ }, props), {}, {
590
+ children: children
591
+ }));
592
+ };
593
+ var Main = function Main(_ref0) {
594
+ var children = _ref0.children,
595
+ _ref0$className = _ref0.className,
596
+ className = _ref0$className === void 0 ? "" : _ref0$className,
597
+ props = _objectWithoutProperties(_ref0, _excluded0);
598
+ return jsx("main", _objectSpread2(_objectSpread2({
599
+ className: clsx("default_main", className)
600
+ }, props), {}, {
601
+ children: children
602
+ }));
603
+ };
604
+ var Footer = function Footer(_ref1) {
605
+ var children = _ref1.children,
606
+ _ref1$className = _ref1.className,
607
+ className = _ref1$className === void 0 ? "" : _ref1$className,
608
+ props = _objectWithoutProperties(_ref1, _excluded1);
609
+ return jsx("footer", _objectSpread2(_objectSpread2({
610
+ className: clsx("default_footer", className)
611
+ }, props), {}, {
612
+ children: children
613
+ }));
614
+ };
615
+
616
+ var _excluded$1 = ["children", "className"],
617
+ _excluded2 = ["children", "className"];
618
+ var Container = function Container(_ref) {
619
+ var children = _ref.children,
620
+ _ref$className = _ref.className,
621
+ className = _ref$className === void 0 ? "" : _ref$className,
622
+ props = _objectWithoutProperties(_ref, _excluded$1);
623
+ return jsx("div", _objectSpread2(_objectSpread2({
624
+ className: clsx("default_container", className)
625
+ }, props), {}, {
626
+ children: children
627
+ }));
628
+ };
629
+ var Card = function Card(_ref2) {
630
+ var children = _ref2.children,
631
+ _ref2$className = _ref2.className,
632
+ className = _ref2$className === void 0 ? "" : _ref2$className,
633
+ props = _objectWithoutProperties(_ref2, _excluded2);
634
+ return jsx("div", _objectSpread2(_objectSpread2({
635
+ className: clsx("default_card", className)
636
+ }, props), {}, {
637
+ children: children
638
+ }));
639
+ };
640
+
641
+ var _excluded = ["children", "className", "variant"];
642
+ var Modal = function Modal(_ref) {
643
+ var open = _ref.open,
644
+ onClose = _ref.onClose,
645
+ children = _ref.children;
646
+ if (!open) return null;
647
+ return jsx("div", {
648
+ className: "default_modal_overlay",
649
+ onClick: onClose,
650
+ children: jsx("div", {
651
+ className: "default_modal",
652
+ onClick: function onClick(e) {
653
+ return e.stopPropagation();
654
+ },
655
+ children: children
656
+ })
657
+ });
658
+ };
659
+ var Dropdown = function Dropdown(_ref2) {
660
+ var trigger = _ref2.trigger,
661
+ children = _ref2.children;
662
+ var _useState = useState(false),
663
+ _useState2 = _slicedToArray(_useState, 2),
664
+ open = _useState2[0],
665
+ setOpen = _useState2[1];
666
+ var ref = useRef(null);
667
+ useEffect(function () {
668
+ var handler = function handler(e) {
669
+ var _ref$current;
670
+ if (!((_ref$current = ref.current) !== null && _ref$current !== void 0 && _ref$current.contains(e.target))) {
671
+ setOpen(false);
672
+ }
673
+ };
674
+ document.addEventListener("mousedown", handler);
675
+ return function () {
676
+ return document.removeEventListener("mousedown", handler);
677
+ };
678
+ }, []);
679
+ return jsxs("div", {
680
+ className: "default_dropdown",
681
+ ref: ref,
682
+ children: [jsx("div", {
683
+ onClick: function onClick() {
684
+ return setOpen(function (p) {
685
+ return !p;
686
+ });
687
+ },
688
+ children: trigger
689
+ }), open && jsx("div", {
690
+ className: "default_dropdown_menu",
691
+ children: children
692
+ })]
693
+ });
694
+ };
695
+ var Accordion = function Accordion(_ref3) {
696
+ var items = _ref3.items;
697
+ var _useState3 = useState(null),
698
+ _useState4 = _slicedToArray(_useState3, 2),
699
+ active = _useState4[0],
700
+ setActive = _useState4[1];
701
+ return jsx("div", {
702
+ className: "default_accordion",
703
+ children: items.map(function (item, i) {
704
+ return jsxs("div", {
705
+ className: "default_accordion_item",
706
+ children: [jsx("button", {
707
+ className: "default_accordion_trigger",
708
+ onClick: function onClick() {
709
+ return setActive(active === i ? null : i);
710
+ },
711
+ children: item.title
712
+ }), active === i && jsx("div", {
713
+ className: "default_accordion_content",
714
+ children: item.content
715
+ })]
716
+ }, i);
717
+ })
718
+ });
719
+ };
720
+ var Tabs = function Tabs(_ref4) {
721
+ var tabs = _ref4.tabs;
722
+ var _useState5 = useState(0),
723
+ _useState6 = _slicedToArray(_useState5, 2),
724
+ active = _useState6[0],
725
+ setActive = _useState6[1];
726
+ return jsxs("div", {
727
+ className: "default_tabs",
728
+ children: [jsx("div", {
729
+ className: "default_tabs_list",
730
+ children: tabs.map(function (tab, i) {
731
+ return jsx("button", {
732
+ className: clsx("default_tab_trigger", active === i && "active"),
733
+ onClick: function onClick() {
734
+ return setActive(i);
735
+ },
736
+ children: tab.label
737
+ }, i);
738
+ })
739
+ }), jsx("div", {
740
+ className: "default_tab_content",
741
+ children: tabs[active].content
742
+ })]
743
+ });
744
+ };
745
+ var Tooltip = function Tooltip(_ref5) {
746
+ var text = _ref5.text,
747
+ children = _ref5.children;
748
+ return jsxs("div", {
749
+ className: "default_tooltip",
750
+ children: [children, jsx("span", {
751
+ className: "default_tooltip_text",
752
+ children: text
753
+ })]
754
+ });
755
+ };
756
+ var Avatar = function Avatar(_ref7) {
757
+ var src = _ref7.src,
758
+ alt = _ref7.alt,
759
+ fallback = _ref7.fallback;
760
+ return jsx("div", {
761
+ className: "default_avatar",
762
+ children: src ? jsx("img", {
763
+ src: src,
764
+ alt: alt
765
+ }) : fallback
766
+ });
767
+ };
768
+ var Alert = function Alert(_ref8) {
769
+ var children = _ref8.children,
770
+ _ref8$className = _ref8.className,
771
+ className = _ref8$className === void 0 ? "" : _ref8$className,
772
+ _ref8$variant = _ref8.variant,
773
+ variant = _ref8$variant === void 0 ? "info" : _ref8$variant,
774
+ props = _objectWithoutProperties(_ref8, _excluded);
775
+ return jsx("div", _objectSpread2(_objectSpread2({
776
+ className: clsx("default_alert", "default_alert_".concat(variant), className)
777
+ }, props), {}, {
778
+ children: children
779
+ }));
780
+ };
781
+ /* ------------------------ Skeleton ------------------------ */
782
+ var Skeleton = function Skeleton(_ref9) {
783
+ var _ref9$className = _ref9.className,
784
+ className = _ref9$className === void 0 ? "" : _ref9$className;
785
+ return jsx("div", {
786
+ className: clsx("default_skeleton", className)
787
+ });
788
+ };
789
+ var Switch = function Switch(_ref0) {
790
+ var _ref0$checked = _ref0.checked,
791
+ checked = _ref0$checked === void 0 ? false : _ref0$checked,
792
+ onChange = _ref0.onChange;
793
+ var _useState7 = useState(checked),
794
+ _useState8 = _slicedToArray(_useState7, 2),
795
+ enabled = _useState8[0],
796
+ setEnabled = _useState8[1];
797
+ var toggle = function toggle() {
798
+ setEnabled(!enabled);
799
+ onChange === null || onChange === void 0 || onChange(!enabled);
800
+ };
801
+ return jsx("button", {
802
+ onClick: toggle,
803
+ className: clsx("default_switch", enabled && "active"),
804
+ children: jsx("span", {
805
+ className: "default_switch_thumb"
806
+ })
807
+ });
808
+ };
809
+ var Progress = function Progress(_ref1) {
810
+ var value = _ref1.value;
811
+ return jsx("div", {
812
+ className: "default_progress",
813
+ children: jsx("div", {
814
+ className: "default_progress_bar",
815
+ style: {
816
+ width: "".concat(value, "%")
817
+ }
818
+ })
819
+ });
820
+ };
821
+
822
+ export { Accordion, ActivityIndicator, Alert, Avatar, Button, Card, Container, Dialog, Dropdown, FlatList, Footer, H1, H2, H3, H4, H5, H6, Header, Image, ImageBackground, Input, Label, Link, Main, Modal, Navigation, Overlay, Pressable, Progress, ScrollView, Section, SectionList, Select, Skeleton, Span, Switch, Table, TableBody, TableDataCell, TableHead, TableHeaderCell, TableRow, Tabs, Text, TextArea, Tooltip, TouchableOpacity, View };
823
+ //# sourceMappingURL=index.esm.js.map