strivui 1.22.61 → 1.22.62

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,811 @@
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
+ return jsx("div", {
441
+ className: "space-y-4",
442
+ children: sections.map(function (section, i) {
443
+ return jsxs("div", {
444
+ children: [renderSectionHeader ? renderSectionHeader(section.title, i) : jsx("h4", {
445
+ className: "text-lg font-semibold mb-2",
446
+ children: section.title
447
+ }), jsx("div", {
448
+ className: "space-y-2",
449
+ children: section.data.map(function (item, j) {
450
+ return jsx("div", {
451
+ children: renderItem(item, j)
452
+ }, j);
453
+ })
454
+ })]
455
+ }, i);
456
+ })
457
+ });
458
+ }
459
+ var Overlay = function Overlay(_ref0) {
460
+ var visible = _ref0.visible,
461
+ onClick = _ref0.onClick,
462
+ children = _ref0.children;
463
+ if (!visible) return null;
464
+ return jsx("div", {
465
+ onClick: onClick,
466
+ className: "default_overlay",
467
+ children: children
468
+ });
469
+ };
470
+
471
+ var _excluded$2 = ["children", "className"],
472
+ _excluded2$1 = ["children", "className"],
473
+ _excluded3 = ["children", "className"],
474
+ _excluded4 = ["children", "className"],
475
+ _excluded5 = ["children", "className"],
476
+ _excluded6 = ["children", "className"],
477
+ _excluded7 = ["children", "className"],
478
+ _excluded8 = ["children", "className"],
479
+ _excluded9 = ["children", "className"],
480
+ _excluded0 = ["children", "className"],
481
+ _excluded1 = ["children", "className"];
482
+ var Table = function Table(_ref) {
483
+ var children = _ref.children,
484
+ _ref$className = _ref.className,
485
+ className = _ref$className === void 0 ? "" : _ref$className,
486
+ props = _objectWithoutProperties(_ref, _excluded$2);
487
+ return jsx("table", _objectSpread2(_objectSpread2({
488
+ className: clsx("default_table", className)
489
+ }, props), {}, {
490
+ children: children
491
+ }));
492
+ };
493
+ var TableHead = function TableHead(_ref2) {
494
+ var children = _ref2.children,
495
+ _ref2$className = _ref2.className,
496
+ className = _ref2$className === void 0 ? "" : _ref2$className,
497
+ props = _objectWithoutProperties(_ref2, _excluded2$1);
498
+ return jsx("thead", _objectSpread2(_objectSpread2({
499
+ className: clsx("default_table_head", className)
500
+ }, props), {}, {
501
+ children: children
502
+ }));
503
+ };
504
+ var TableBody = function TableBody(_ref3) {
505
+ var children = _ref3.children,
506
+ _ref3$className = _ref3.className,
507
+ className = _ref3$className === void 0 ? "" : _ref3$className,
508
+ props = _objectWithoutProperties(_ref3, _excluded3);
509
+ return jsx("tbody", _objectSpread2(_objectSpread2({
510
+ className: clsx("default_table_body", className)
511
+ }, props), {}, {
512
+ children: children
513
+ }));
514
+ };
515
+ var TableRow = function TableRow(_ref4) {
516
+ var children = _ref4.children,
517
+ _ref4$className = _ref4.className,
518
+ className = _ref4$className === void 0 ? "" : _ref4$className,
519
+ props = _objectWithoutProperties(_ref4, _excluded4);
520
+ return jsx("tr", _objectSpread2(_objectSpread2({
521
+ className: clsx("default_table_row", className)
522
+ }, props), {}, {
523
+ children: children
524
+ }));
525
+ };
526
+ var TableHeaderCell = function TableHeaderCell(_ref5) {
527
+ var children = _ref5.children,
528
+ _ref5$className = _ref5.className,
529
+ className = _ref5$className === void 0 ? "" : _ref5$className,
530
+ props = _objectWithoutProperties(_ref5, _excluded5);
531
+ return jsx("th", _objectSpread2(_objectSpread2({
532
+ className: clsx("default_th", className)
533
+ }, props), {}, {
534
+ children: children
535
+ }));
536
+ };
537
+ var TableDataCell = function TableDataCell(_ref6) {
538
+ var children = _ref6.children,
539
+ _ref6$className = _ref6.className,
540
+ className = _ref6$className === void 0 ? "" : _ref6$className,
541
+ props = _objectWithoutProperties(_ref6, _excluded6);
542
+ return jsx("td", _objectSpread2(_objectSpread2({
543
+ className: clsx("default_td", className)
544
+ }, props), {}, {
545
+ children: children
546
+ }));
547
+ };
548
+ var Header = function Header(_ref7) {
549
+ var children = _ref7.children,
550
+ _ref7$className = _ref7.className,
551
+ className = _ref7$className === void 0 ? "" : _ref7$className,
552
+ props = _objectWithoutProperties(_ref7, _excluded7);
553
+ return jsx("header", _objectSpread2(_objectSpread2({
554
+ className: clsx("default_header", className)
555
+ }, props), {}, {
556
+ children: children
557
+ }));
558
+ };
559
+ var Navigation = function Navigation(_ref8) {
560
+ var children = _ref8.children,
561
+ _ref8$className = _ref8.className,
562
+ className = _ref8$className === void 0 ? "" : _ref8$className,
563
+ props = _objectWithoutProperties(_ref8, _excluded8);
564
+ return jsx("nav", _objectSpread2(_objectSpread2({
565
+ className: clsx("default_nav", className)
566
+ }, props), {}, {
567
+ children: children
568
+ }));
569
+ };
570
+ var Section = function Section(_ref9) {
571
+ var children = _ref9.children,
572
+ _ref9$className = _ref9.className,
573
+ className = _ref9$className === void 0 ? "" : _ref9$className,
574
+ props = _objectWithoutProperties(_ref9, _excluded9);
575
+ return jsx("section", _objectSpread2(_objectSpread2({
576
+ className: clsx("default_section", className)
577
+ }, props), {}, {
578
+ children: children
579
+ }));
580
+ };
581
+ var Main = function Main(_ref0) {
582
+ var children = _ref0.children,
583
+ _ref0$className = _ref0.className,
584
+ className = _ref0$className === void 0 ? "" : _ref0$className,
585
+ props = _objectWithoutProperties(_ref0, _excluded0);
586
+ return jsx("main", _objectSpread2(_objectSpread2({
587
+ className: clsx("default_main", className)
588
+ }, props), {}, {
589
+ children: children
590
+ }));
591
+ };
592
+ var Footer = function Footer(_ref1) {
593
+ var children = _ref1.children,
594
+ _ref1$className = _ref1.className,
595
+ className = _ref1$className === void 0 ? "" : _ref1$className,
596
+ props = _objectWithoutProperties(_ref1, _excluded1);
597
+ return jsx("footer", _objectSpread2(_objectSpread2({
598
+ className: clsx("default_footer", className)
599
+ }, props), {}, {
600
+ children: children
601
+ }));
602
+ };
603
+
604
+ var _excluded$1 = ["children", "className"],
605
+ _excluded2 = ["children", "className"];
606
+ var Container = function Container(_ref) {
607
+ var children = _ref.children,
608
+ _ref$className = _ref.className,
609
+ className = _ref$className === void 0 ? "" : _ref$className,
610
+ props = _objectWithoutProperties(_ref, _excluded$1);
611
+ return jsx("div", _objectSpread2(_objectSpread2({
612
+ className: clsx("default_container", className)
613
+ }, props), {}, {
614
+ children: children
615
+ }));
616
+ };
617
+ var Card = function Card(_ref2) {
618
+ var children = _ref2.children,
619
+ _ref2$className = _ref2.className,
620
+ className = _ref2$className === void 0 ? "" : _ref2$className,
621
+ props = _objectWithoutProperties(_ref2, _excluded2);
622
+ return jsx("div", _objectSpread2(_objectSpread2({
623
+ className: clsx("default_card", className)
624
+ }, props), {}, {
625
+ children: children
626
+ }));
627
+ };
628
+
629
+ var _excluded = ["children", "className", "variant"];
630
+ var Modal = function Modal(_ref) {
631
+ var open = _ref.open,
632
+ onClose = _ref.onClose,
633
+ children = _ref.children;
634
+ if (!open) return null;
635
+ return jsx("div", {
636
+ className: "default_modal_overlay",
637
+ onClick: onClose,
638
+ children: jsx("div", {
639
+ className: "default_modal",
640
+ onClick: function onClick(e) {
641
+ return e.stopPropagation();
642
+ },
643
+ children: children
644
+ })
645
+ });
646
+ };
647
+ var Dropdown = function Dropdown(_ref2) {
648
+ var trigger = _ref2.trigger,
649
+ children = _ref2.children;
650
+ var _useState = useState(false),
651
+ _useState2 = _slicedToArray(_useState, 2),
652
+ open = _useState2[0],
653
+ setOpen = _useState2[1];
654
+ var ref = useRef(null);
655
+ useEffect(function () {
656
+ var handler = function handler(e) {
657
+ var _ref$current;
658
+ if (!((_ref$current = ref.current) !== null && _ref$current !== void 0 && _ref$current.contains(e.target))) {
659
+ setOpen(false);
660
+ }
661
+ };
662
+ document.addEventListener("mousedown", handler);
663
+ return function () {
664
+ return document.removeEventListener("mousedown", handler);
665
+ };
666
+ }, []);
667
+ return jsxs("div", {
668
+ className: "default_dropdown",
669
+ ref: ref,
670
+ children: [jsx("div", {
671
+ onClick: function onClick() {
672
+ return setOpen(function (p) {
673
+ return !p;
674
+ });
675
+ },
676
+ children: trigger
677
+ }), open && jsx("div", {
678
+ className: "default_dropdown_menu",
679
+ children: children
680
+ })]
681
+ });
682
+ };
683
+ var Accordion = function Accordion(_ref3) {
684
+ var items = _ref3.items;
685
+ var _useState3 = useState(null),
686
+ _useState4 = _slicedToArray(_useState3, 2),
687
+ active = _useState4[0],
688
+ setActive = _useState4[1];
689
+ return jsx("div", {
690
+ className: "default_accordion",
691
+ children: items.map(function (item, i) {
692
+ return jsxs("div", {
693
+ className: "default_accordion_item",
694
+ children: [jsx("button", {
695
+ className: "default_accordion_trigger",
696
+ onClick: function onClick() {
697
+ return setActive(active === i ? null : i);
698
+ },
699
+ children: item.title
700
+ }), active === i && jsx("div", {
701
+ className: "default_accordion_content",
702
+ children: item.content
703
+ })]
704
+ }, i);
705
+ })
706
+ });
707
+ };
708
+ var Tabs = function Tabs(_ref4) {
709
+ var tabs = _ref4.tabs;
710
+ var _useState5 = useState(0),
711
+ _useState6 = _slicedToArray(_useState5, 2),
712
+ active = _useState6[0],
713
+ setActive = _useState6[1];
714
+ return jsxs("div", {
715
+ className: "default_tabs",
716
+ children: [jsx("div", {
717
+ className: "default_tabs_list",
718
+ children: tabs.map(function (tab, i) {
719
+ return jsx("button", {
720
+ className: clsx("default_tab_trigger", active === i && "active"),
721
+ onClick: function onClick() {
722
+ return setActive(i);
723
+ },
724
+ children: tab.label
725
+ }, i);
726
+ })
727
+ }), jsx("div", {
728
+ className: "default_tab_content",
729
+ children: tabs[active].content
730
+ })]
731
+ });
732
+ };
733
+ var Tooltip = function Tooltip(_ref5) {
734
+ var text = _ref5.text,
735
+ children = _ref5.children;
736
+ return jsxs("div", {
737
+ className: "default_tooltip",
738
+ children: [children, jsx("span", {
739
+ className: "default_tooltip_text",
740
+ children: text
741
+ })]
742
+ });
743
+ };
744
+ var Avatar = function Avatar(_ref7) {
745
+ var src = _ref7.src,
746
+ alt = _ref7.alt,
747
+ fallback = _ref7.fallback;
748
+ return jsx("div", {
749
+ className: "default_avatar",
750
+ children: src ? jsx("img", {
751
+ src: src,
752
+ alt: alt
753
+ }) : fallback
754
+ });
755
+ };
756
+ var Alert = function Alert(_ref8) {
757
+ var children = _ref8.children,
758
+ _ref8$className = _ref8.className,
759
+ className = _ref8$className === void 0 ? "" : _ref8$className,
760
+ _ref8$variant = _ref8.variant,
761
+ variant = _ref8$variant === void 0 ? "info" : _ref8$variant,
762
+ props = _objectWithoutProperties(_ref8, _excluded);
763
+ return jsx("div", _objectSpread2(_objectSpread2({
764
+ className: clsx("default_alert", "default_alert_".concat(variant), className)
765
+ }, props), {}, {
766
+ children: children
767
+ }));
768
+ };
769
+ /* ------------------------ Skeleton ------------------------ */
770
+ var Skeleton = function Skeleton(_ref9) {
771
+ var _ref9$className = _ref9.className,
772
+ className = _ref9$className === void 0 ? "" : _ref9$className;
773
+ return jsx("div", {
774
+ className: clsx("default_skeleton", className)
775
+ });
776
+ };
777
+ var Switch = function Switch(_ref0) {
778
+ var _ref0$checked = _ref0.checked,
779
+ checked = _ref0$checked === void 0 ? false : _ref0$checked,
780
+ onChange = _ref0.onChange;
781
+ var _useState7 = useState(checked),
782
+ _useState8 = _slicedToArray(_useState7, 2),
783
+ enabled = _useState8[0],
784
+ setEnabled = _useState8[1];
785
+ var toggle = function toggle() {
786
+ setEnabled(!enabled);
787
+ onChange === null || onChange === void 0 || onChange(!enabled);
788
+ };
789
+ return jsx("button", {
790
+ onClick: toggle,
791
+ className: clsx("default_switch", enabled && "active"),
792
+ children: jsx("span", {
793
+ className: "default_switch_thumb"
794
+ })
795
+ });
796
+ };
797
+ var Progress = function Progress(_ref1) {
798
+ var value = _ref1.value;
799
+ return jsx("div", {
800
+ className: "default_progress",
801
+ children: jsx("div", {
802
+ className: "default_progress_bar",
803
+ style: {
804
+ width: "".concat(value, "%")
805
+ }
806
+ })
807
+ });
808
+ };
809
+
810
+ 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 };
811
+ //# sourceMappingURL=index.esm.js.map