@tradly/asset 1.0.13 → 1.0.15

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.
Files changed (76) hide show
  1. package/README.md +414 -13
  2. package/dist/components/FileUpload.js +8 -254
  3. package/dist/components/FileUpload.native.js +13 -0
  4. package/dist/components/Icons.js +10 -33
  5. package/dist/components/Icons.native.js +16 -0
  6. package/dist/components/ImagesSkeleton.js +7 -15
  7. package/dist/components/ImagesSkeleton.native.js +13 -0
  8. package/dist/components/MediaGallery.js +8 -148
  9. package/dist/components/MediaGallery.native.js +13 -0
  10. package/dist/components/MediaPopup.js +8 -99
  11. package/dist/components/MediaPopup.native.js +13 -0
  12. package/dist/components/MediaTab.js +7 -180
  13. package/dist/components/MediaTab.native.js +13 -0
  14. package/dist/components/Pagination.js +8 -136
  15. package/dist/components/Pagination.native.js +13 -0
  16. package/dist/components/VideosGallery.js +8 -148
  17. package/dist/components/VideosGallery.native.js +13 -0
  18. package/dist/core/MediaApiService.js +396 -0
  19. package/dist/esm/components/FileUpload.js +1 -253
  20. package/dist/esm/components/FileUpload.native.js +1 -0
  21. package/dist/esm/components/Icons.js +1 -32
  22. package/dist/esm/components/Icons.native.js +1 -0
  23. package/dist/esm/components/ImagesSkeleton.js +1 -14
  24. package/dist/esm/components/ImagesSkeleton.native.js +1 -0
  25. package/dist/esm/components/MediaGallery.js +1 -144
  26. package/dist/esm/components/MediaGallery.native.js +1 -0
  27. package/dist/esm/components/MediaPopup.js +1 -97
  28. package/dist/esm/components/MediaPopup.native.js +1 -0
  29. package/dist/esm/components/MediaTab.js +1 -177
  30. package/dist/esm/components/MediaTab.native.js +1 -0
  31. package/dist/esm/components/Pagination.js +1 -134
  32. package/dist/esm/components/Pagination.native.js +1 -0
  33. package/dist/esm/components/VideosGallery.js +1 -144
  34. package/dist/esm/components/VideosGallery.native.js +1 -0
  35. package/dist/esm/core/MediaApiService.js +390 -0
  36. package/dist/esm/index.js +4 -1
  37. package/dist/esm/native/FileUpload.native.js +310 -0
  38. package/dist/esm/native/Icons.native.js +51 -0
  39. package/dist/esm/native/ImagesSkeleton.native.js +45 -0
  40. package/dist/esm/native/MediaGallery.native.js +228 -0
  41. package/dist/esm/native/MediaPopup.native.js +170 -0
  42. package/dist/esm/native/MediaTab.native.js +192 -0
  43. package/dist/esm/native/Pagination.native.js +210 -0
  44. package/dist/esm/native/THEME_EXAMPLE.js +112 -0
  45. package/dist/esm/native/VideosGallery.native.js +240 -0
  46. package/dist/esm/native/theme.js +167 -0
  47. package/dist/esm/services/apiService.js +1 -372
  48. package/dist/esm/web/FileUpload.web.js +253 -0
  49. package/dist/esm/web/Icons.web.js +32 -0
  50. package/dist/esm/web/ImagesSkeleton.web.js +14 -0
  51. package/dist/esm/web/MediaGallery.web.js +144 -0
  52. package/dist/esm/web/MediaPopup.web.js +97 -0
  53. package/dist/esm/web/MediaTab.web.js +177 -0
  54. package/dist/esm/web/Pagination.web.js +134 -0
  55. package/dist/esm/web/VideosGallery.web.js +144 -0
  56. package/dist/index.js +16 -2
  57. package/dist/native/FileUpload.native.js +316 -0
  58. package/dist/native/Icons.native.js +59 -0
  59. package/dist/native/ImagesSkeleton.native.js +52 -0
  60. package/dist/native/MediaGallery.native.js +237 -0
  61. package/dist/native/MediaPopup.native.js +177 -0
  62. package/dist/native/MediaTab.native.js +201 -0
  63. package/dist/native/Pagination.native.js +217 -0
  64. package/dist/native/THEME_EXAMPLE.js +117 -0
  65. package/dist/native/VideosGallery.native.js +248 -0
  66. package/dist/native/theme.js +173 -0
  67. package/dist/services/apiService.js +2 -372
  68. package/dist/web/FileUpload.web.js +259 -0
  69. package/dist/web/Icons.web.js +39 -0
  70. package/dist/web/ImagesSkeleton.web.js +21 -0
  71. package/dist/web/MediaGallery.web.js +153 -0
  72. package/dist/web/MediaPopup.web.js +104 -0
  73. package/dist/web/MediaTab.web.js +186 -0
  74. package/dist/web/Pagination.web.js +141 -0
  75. package/dist/web/VideosGallery.web.js +153 -0
  76. package/package.json +3 -2
@@ -0,0 +1,240 @@
1
+ function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
2
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
4
+ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
5
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
6
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
7
+ function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
8
+ function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
9
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
10
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
11
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); 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; } }
12
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
13
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
14
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
15
+ import React, { useState, useEffect } from 'react';
16
+ import { View, FlatList, TouchableOpacity, StyleSheet, Dimensions, Text } from 'react-native';
17
+ import FileUpload from './FileUpload.native';
18
+ import ImagesSkeleton from './ImagesSkeleton.native';
19
+ import Pagination from './Pagination.native';
20
+ import { defaultTheme } from './theme';
21
+ // Note: You'll need to install react-native-video for video playback
22
+ // import Video from 'react-native-video'
23
+ import { jsx as _jsx } from "react/jsx-runtime";
24
+ var _Dimensions$get = Dimensions.get('window'),
25
+ SCREEN_WIDTH = _Dimensions$get.width;
26
+ var NUM_COLUMNS = 3;
27
+ var ITEM_MARGIN = 8;
28
+ var ITEM_SIZE = (SCREEN_WIDTH - 40 - ITEM_MARGIN * (NUM_COLUMNS - 1) * 2) / NUM_COLUMNS;
29
+ var VIDEO_MIME_TYPES = ['video/mp4', 'video/quicktime', 'video/x-ms-wmv', 'video/h265', 'video/hevc', 'video/webm'];
30
+ var VideosGallery = function VideosGallery(_ref) {
31
+ var update_data = _ref.update_data,
32
+ closePopup = _ref.closePopup,
33
+ apiService = _ref.apiService,
34
+ onError = _ref.onError,
35
+ picker = _ref.picker,
36
+ pickerOptions = _ref.pickerOptions,
37
+ _ref$theme = _ref.theme,
38
+ theme = _ref$theme === void 0 ? defaultTheme : _ref$theme,
39
+ containerStyle = _ref.containerStyle,
40
+ gridStyle = _ref.gridStyle,
41
+ videoItemStyle = _ref.videoItemStyle,
42
+ paginationContainerStyle = _ref.paginationContainerStyle;
43
+ var _useState = useState([]),
44
+ _useState2 = _slicedToArray(_useState, 2),
45
+ videos = _useState2[0],
46
+ setVideos = _useState2[1];
47
+ var _useState3 = useState(0),
48
+ _useState4 = _slicedToArray(_useState3, 2),
49
+ total_count = _useState4[0],
50
+ setTotalCount = _useState4[1];
51
+ var _useState5 = useState(1),
52
+ _useState6 = _slicedToArray(_useState5, 2),
53
+ currentPage = _useState6[0],
54
+ setCurrentPage = _useState6[1];
55
+ var _useState7 = useState(false),
56
+ _useState8 = _slicedToArray(_useState7, 2),
57
+ isLoading = _useState8[0],
58
+ setISLoading = _useState8[1];
59
+
60
+ // Fetch videos
61
+ useEffect(function () {
62
+ loadMedia();
63
+ }, []);
64
+ var loadMedia = /*#__PURE__*/function () {
65
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
66
+ var page_number,
67
+ _response$data,
68
+ _response$data2,
69
+ response,
70
+ mediaData,
71
+ count,
72
+ _args = arguments,
73
+ _t;
74
+ return _regenerator().w(function (_context) {
75
+ while (1) switch (_context.p = _context.n) {
76
+ case 0:
77
+ page_number = _args.length > 0 && _args[0] !== undefined ? _args[0] : 1;
78
+ _context.p = 1;
79
+ _context.n = 2;
80
+ return apiService.fetchMedia({
81
+ mimeTypes: VIDEO_MIME_TYPES,
82
+ page: page_number,
83
+ setISLoading: setISLoading,
84
+ isLoading: isLoading
85
+ });
86
+ case 2:
87
+ response = _context.v;
88
+ // Handle different response formats
89
+ mediaData = (response === null || response === void 0 ? void 0 : response.media) || (response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.media) || (response === null || response === void 0 ? void 0 : response.data) || response || [];
90
+ count = (response === null || response === void 0 ? void 0 : response.count) || (response === null || response === void 0 || (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : _response$data2.count) || (response === null || response === void 0 ? void 0 : response.total) || 0;
91
+ setVideos(Array.isArray(mediaData) ? mediaData : []);
92
+ setTotalCount(count);
93
+ setCurrentPage(page_number);
94
+ _context.n = 4;
95
+ break;
96
+ case 3:
97
+ _context.p = 3;
98
+ _t = _context.v;
99
+ console.error('Error loading videos:', _t);
100
+ if (onError) {
101
+ onError(_t);
102
+ }
103
+ case 4:
104
+ return _context.a(2);
105
+ }
106
+ }, _callee, null, [[1, 3]]);
107
+ }));
108
+ return function loadMedia() {
109
+ return _ref2.apply(this, arguments);
110
+ };
111
+ }();
112
+ var handleVideoClick = function handleVideoClick(video) {
113
+ if (update_data) {
114
+ update_data(video.url || video);
115
+ }
116
+ if (closePopup) {
117
+ closePopup();
118
+ }
119
+ };
120
+ var renderItem = function renderItem(_ref3) {
121
+ var item = _ref3.item,
122
+ index = _ref3.index;
123
+ // First item is the upload button
124
+ if (index === 0) {
125
+ return /*#__PURE__*/_jsx(View, {
126
+ style: [styles.uploadContainer, {
127
+ width: ITEM_SIZE,
128
+ height: ITEM_SIZE
129
+ }],
130
+ children: /*#__PURE__*/_jsx(FileUpload, {
131
+ loadMedia: loadMedia,
132
+ accept: "video/*",
133
+ title: "Add Video",
134
+ apiService: apiService,
135
+ onUploadError: onError,
136
+ picker: picker,
137
+ pickerOptions: pickerOptions,
138
+ theme: theme
139
+ })
140
+ });
141
+ }
142
+ var video = videos[index - 1];
143
+ var videoUrl = typeof video === 'string' ? video : video.url;
144
+ var videoKey = video.id || video.url || index;
145
+ return /*#__PURE__*/_jsx(TouchableOpacity, {
146
+ onPress: function onPress() {
147
+ return handleVideoClick(video);
148
+ },
149
+ style: [styles.videoItem, {
150
+ width: ITEM_SIZE,
151
+ height: ITEM_SIZE
152
+ }, videoItemStyle],
153
+ children: /*#__PURE__*/_jsx(View, {
154
+ style: styles.videoPlaceholder,
155
+ children: /*#__PURE__*/_jsx(Text, {
156
+ style: styles.playIcon,
157
+ children: "\u25B6"
158
+ })
159
+ })
160
+ });
161
+ };
162
+ var data = isLoading ? [] : [{
163
+ type: 'upload'
164
+ }].concat(_toConsumableArray(videos));
165
+ return /*#__PURE__*/_jsx(View, {
166
+ style: [styles.container, containerStyle],
167
+ children: isLoading ? /*#__PURE__*/_jsx(ImagesSkeleton, {}) : /*#__PURE__*/_jsx(FlatList, {
168
+ data: data,
169
+ renderItem: renderItem,
170
+ keyExtractor: function keyExtractor(item, index) {
171
+ if (index === 0) return 'upload';
172
+ var video = videos[index - 1];
173
+ return video.id || video.url || "video-".concat(index);
174
+ },
175
+ numColumns: NUM_COLUMNS,
176
+ contentContainerStyle: [styles.grid, gridStyle],
177
+ showsVerticalScrollIndicator: false,
178
+ ListFooterComponent: total_count > 0 ? /*#__PURE__*/_jsx(View, {
179
+ style: [styles.paginationContainer, {
180
+ backgroundColor: theme.colors.paginationBackground,
181
+ paddingVertical: theme.spacing.lg,
182
+ paddingHorizontal: theme.spacing.sm,
183
+ marginTop: theme.spacing.sm
184
+ }, paginationContainerStyle],
185
+ children: /*#__PURE__*/_jsx(Pagination, {
186
+ nextPage: function nextPage(value) {
187
+ return loadMedia(value);
188
+ },
189
+ pageCount: Math.ceil(total_count / 30),
190
+ current_page: currentPage,
191
+ theme: theme
192
+ })
193
+ }) : null
194
+ })
195
+ });
196
+ };
197
+ var styles = StyleSheet.create({
198
+ container: {
199
+ flex: 1
200
+ },
201
+ grid: {
202
+ padding: 4
203
+ },
204
+ uploadContainer: {
205
+ margin: ITEM_MARGIN
206
+ },
207
+ videoItem: {
208
+ margin: ITEM_MARGIN,
209
+ borderRadius: 8,
210
+ overflow: 'hidden',
211
+ backgroundColor: '#000000',
212
+ shadowColor: '#000',
213
+ shadowOffset: {
214
+ width: 0,
215
+ height: 2
216
+ },
217
+ shadowOpacity: 0.1,
218
+ shadowRadius: 3.84,
219
+ elevation: 5
220
+ },
221
+ videoPlaceholder: {
222
+ width: '100%',
223
+ height: '100%',
224
+ backgroundColor: '#1a1a1a',
225
+ justifyContent: 'center',
226
+ alignItems: 'center'
227
+ },
228
+ playIcon: {
229
+ fontSize: 32,
230
+ color: '#FFFFFF'
231
+ },
232
+ video: {
233
+ width: '100%',
234
+ height: '100%'
235
+ },
236
+ paginationContainer: {
237
+ // Styles applied via theme
238
+ }
239
+ });
240
+ export default VideosGallery;
@@ -0,0 +1,167 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ /**
8
+ * Theme configuration for React Native Media Gallery
9
+ * Provides easy customization for dark/light mode and brand colors
10
+ */
11
+
12
+ export var createTheme = function createTheme() {
13
+ var customTheme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
14
+ var isDark = customTheme.mode === "dark";
15
+
16
+ // Default light theme
17
+ var defaultLightTheme = {
18
+ mode: "light",
19
+ // Colors
20
+ colors: {
21
+ // Primary colors
22
+ primary: "#3B3269",
23
+ primaryLight: "#5A4A8A",
24
+ primaryDark: "#2A1F4A",
25
+ // Background colors
26
+ background: "#FFFFFF",
27
+ backgroundSecondary: "#F5F5F5",
28
+ backgroundTertiary: "#E5E5E5",
29
+ // Text colors
30
+ text: "#000000",
31
+ textSecondary: "#4F4F4F",
32
+ textTertiary: "#6B7280",
33
+ textInverse: "#FFFFFF",
34
+ // Border colors
35
+ border: "#E5E5E5",
36
+ borderLight: "#F0F0F0",
37
+ borderDark: "#D1D5DB",
38
+ // Overlay
39
+ overlay: "rgba(0, 0, 0, 0.5)",
40
+ // Tab colors
41
+ tabActive: "#3B3269",
42
+ tabInactive: "#4F4F4F",
43
+ tabIndicator: "#3B3269",
44
+ tabBackground: "#FFFFFF",
45
+ // Image/Video item
46
+ itemBackground: "#FFFFFF",
47
+ itemShadow: "#000000",
48
+ // Pagination
49
+ paginationBackground: "#F5F5F5",
50
+ paginationButton: "#FFFFFF",
51
+ paginationButtonActive: "#3B3269",
52
+ paginationText: "#6B7280",
53
+ paginationTextActive: "#FFFFFF",
54
+ paginationBorder: "#D1D5DB",
55
+ // Upload button
56
+ uploadBorder: "#3B3269",
57
+ uploadBackground: "#FFFFFF",
58
+ uploadIconBackground: "#3B3269",
59
+ uploadText: "#000000",
60
+ // Loading
61
+ loadingBackground: "#E5E5E5",
62
+ loadingText: "#666666"
63
+ },
64
+ // Spacing
65
+ spacing: {
66
+ xs: 4,
67
+ sm: 8,
68
+ md: 12,
69
+ lg: 16,
70
+ xl: 20,
71
+ xxl: 24
72
+ },
73
+ // Border radius
74
+ radius: {
75
+ sm: 6,
76
+ md: 8,
77
+ lg: 12,
78
+ xl: 16,
79
+ xxl: 20
80
+ },
81
+ // Typography
82
+ typography: {
83
+ title: {
84
+ fontSize: 24,
85
+ fontWeight: "bold"
86
+ },
87
+ subtitle: {
88
+ fontSize: 18,
89
+ fontWeight: "600"
90
+ },
91
+ body: {
92
+ fontSize: 16,
93
+ fontWeight: "500"
94
+ },
95
+ caption: {
96
+ fontSize: 14,
97
+ fontWeight: "400"
98
+ }
99
+ }
100
+ };
101
+
102
+ // Default dark theme
103
+ var defaultDarkTheme = {
104
+ mode: "dark",
105
+ colors: {
106
+ // Primary colors (can keep same or adjust)
107
+ primary: "#5A4A8A",
108
+ primaryLight: "#7A6AAA",
109
+ primaryDark: "#3B3269",
110
+ // Background colors
111
+ background: "#1A1A1A",
112
+ backgroundSecondary: "#2A2A2A",
113
+ backgroundTertiary: "#3A3A3A",
114
+ // Text colors
115
+ text: "#FFFFFF",
116
+ textSecondary: "#CCCCCC",
117
+ textTertiary: "#999999",
118
+ textInverse: "#000000",
119
+ // Border colors
120
+ border: "#3A3A3A",
121
+ borderLight: "#2A2A2A",
122
+ borderDark: "#4A4A4A",
123
+ // Overlay
124
+ overlay: "rgba(0, 0, 0, 0.7)",
125
+ // Tab colors
126
+ tabActive: "#7A6AAA",
127
+ tabInactive: "#CCCCCC",
128
+ tabIndicator: "#7A6AAA",
129
+ tabBackground: "#1A1A1A",
130
+ // Image/Video item
131
+ itemBackground: "#2A2A2A",
132
+ itemShadow: "#000000",
133
+ // Pagination
134
+ paginationBackground: "#2A2A2A",
135
+ paginationButton: "#1A1A1A",
136
+ paginationButtonActive: "#5A4A8A",
137
+ paginationText: "#CCCCCC",
138
+ paginationTextActive: "#FFFFFF",
139
+ paginationBorder: "#3A3A3A",
140
+ // Upload button
141
+ uploadBorder: "#5A4A8A",
142
+ uploadBackground: "#1A1A1A",
143
+ uploadIconBackground: "#5A4A8A",
144
+ uploadText: "#FFFFFF",
145
+ // Loading
146
+ loadingBackground: "#2A2A2A",
147
+ loadingText: "#999999"
148
+ },
149
+ spacing: defaultLightTheme.spacing,
150
+ radius: defaultLightTheme.radius,
151
+ typography: defaultLightTheme.typography
152
+ };
153
+
154
+ // Merge custom theme with defaults
155
+ var baseTheme = isDark ? defaultDarkTheme : defaultLightTheme;
156
+ return _objectSpread(_objectSpread({}, baseTheme), {}, {
157
+ colors: _objectSpread(_objectSpread({}, baseTheme.colors), customTheme.colors || {}),
158
+ spacing: _objectSpread(_objectSpread({}, baseTheme.spacing), customTheme.spacing || {}),
159
+ radius: _objectSpread(_objectSpread({}, baseTheme.radius), customTheme.radius || {}),
160
+ typography: _objectSpread(_objectSpread({}, baseTheme.typography), customTheme.typography || {}),
161
+ // Bottom sheet height (0.85 = 85% of screen, 0.9 = 90%, etc.)
162
+ bottomSheetHeight: customTheme.bottomSheetHeight || 0.9
163
+ });
164
+ };
165
+
166
+ // Export default light theme
167
+ export var defaultTheme = createTheme();