@tradly/asset 1.0.14 → 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.
- package/README.md +172 -15
- package/dist/esm/index.js +3 -0
- package/dist/esm/native/FileUpload.native.js +35 -23
- package/dist/esm/native/MediaGallery.native.js +17 -10
- package/dist/esm/native/MediaPopup.native.js +40 -21
- package/dist/esm/native/MediaTab.native.js +37 -20
- package/dist/esm/native/Pagination.native.js +43 -19
- package/dist/esm/native/THEME_EXAMPLE.js +112 -0
- package/dist/esm/native/VideosGallery.native.js +14 -7
- package/dist/esm/native/theme.js +167 -0
- package/dist/index.js +14 -0
- package/dist/native/FileUpload.native.js +35 -23
- package/dist/native/MediaGallery.native.js +17 -10
- package/dist/native/MediaPopup.native.js +40 -21
- package/dist/native/MediaTab.native.js +36 -19
- package/dist/native/Pagination.native.js +43 -19
- package/dist/native/THEME_EXAMPLE.js +117 -0
- package/dist/native/VideosGallery.native.js +14 -7
- package/dist/native/theme.js +173 -0
- package/package.json +2 -2
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.defaultTheme = exports.createTheme = void 0;
|
|
7
|
+
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); }
|
|
8
|
+
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; }
|
|
9
|
+
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; }
|
|
10
|
+
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; }
|
|
11
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
12
|
+
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); }
|
|
13
|
+
/**
|
|
14
|
+
* Theme configuration for React Native Media Gallery
|
|
15
|
+
* Provides easy customization for dark/light mode and brand colors
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
var createTheme = exports.createTheme = function createTheme() {
|
|
19
|
+
var customTheme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
20
|
+
var isDark = customTheme.mode === "dark";
|
|
21
|
+
|
|
22
|
+
// Default light theme
|
|
23
|
+
var defaultLightTheme = {
|
|
24
|
+
mode: "light",
|
|
25
|
+
// Colors
|
|
26
|
+
colors: {
|
|
27
|
+
// Primary colors
|
|
28
|
+
primary: "#3B3269",
|
|
29
|
+
primaryLight: "#5A4A8A",
|
|
30
|
+
primaryDark: "#2A1F4A",
|
|
31
|
+
// Background colors
|
|
32
|
+
background: "#FFFFFF",
|
|
33
|
+
backgroundSecondary: "#F5F5F5",
|
|
34
|
+
backgroundTertiary: "#E5E5E5",
|
|
35
|
+
// Text colors
|
|
36
|
+
text: "#000000",
|
|
37
|
+
textSecondary: "#4F4F4F",
|
|
38
|
+
textTertiary: "#6B7280",
|
|
39
|
+
textInverse: "#FFFFFF",
|
|
40
|
+
// Border colors
|
|
41
|
+
border: "#E5E5E5",
|
|
42
|
+
borderLight: "#F0F0F0",
|
|
43
|
+
borderDark: "#D1D5DB",
|
|
44
|
+
// Overlay
|
|
45
|
+
overlay: "rgba(0, 0, 0, 0.5)",
|
|
46
|
+
// Tab colors
|
|
47
|
+
tabActive: "#3B3269",
|
|
48
|
+
tabInactive: "#4F4F4F",
|
|
49
|
+
tabIndicator: "#3B3269",
|
|
50
|
+
tabBackground: "#FFFFFF",
|
|
51
|
+
// Image/Video item
|
|
52
|
+
itemBackground: "#FFFFFF",
|
|
53
|
+
itemShadow: "#000000",
|
|
54
|
+
// Pagination
|
|
55
|
+
paginationBackground: "#F5F5F5",
|
|
56
|
+
paginationButton: "#FFFFFF",
|
|
57
|
+
paginationButtonActive: "#3B3269",
|
|
58
|
+
paginationText: "#6B7280",
|
|
59
|
+
paginationTextActive: "#FFFFFF",
|
|
60
|
+
paginationBorder: "#D1D5DB",
|
|
61
|
+
// Upload button
|
|
62
|
+
uploadBorder: "#3B3269",
|
|
63
|
+
uploadBackground: "#FFFFFF",
|
|
64
|
+
uploadIconBackground: "#3B3269",
|
|
65
|
+
uploadText: "#000000",
|
|
66
|
+
// Loading
|
|
67
|
+
loadingBackground: "#E5E5E5",
|
|
68
|
+
loadingText: "#666666"
|
|
69
|
+
},
|
|
70
|
+
// Spacing
|
|
71
|
+
spacing: {
|
|
72
|
+
xs: 4,
|
|
73
|
+
sm: 8,
|
|
74
|
+
md: 12,
|
|
75
|
+
lg: 16,
|
|
76
|
+
xl: 20,
|
|
77
|
+
xxl: 24
|
|
78
|
+
},
|
|
79
|
+
// Border radius
|
|
80
|
+
radius: {
|
|
81
|
+
sm: 6,
|
|
82
|
+
md: 8,
|
|
83
|
+
lg: 12,
|
|
84
|
+
xl: 16,
|
|
85
|
+
xxl: 20
|
|
86
|
+
},
|
|
87
|
+
// Typography
|
|
88
|
+
typography: {
|
|
89
|
+
title: {
|
|
90
|
+
fontSize: 24,
|
|
91
|
+
fontWeight: "bold"
|
|
92
|
+
},
|
|
93
|
+
subtitle: {
|
|
94
|
+
fontSize: 18,
|
|
95
|
+
fontWeight: "600"
|
|
96
|
+
},
|
|
97
|
+
body: {
|
|
98
|
+
fontSize: 16,
|
|
99
|
+
fontWeight: "500"
|
|
100
|
+
},
|
|
101
|
+
caption: {
|
|
102
|
+
fontSize: 14,
|
|
103
|
+
fontWeight: "400"
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
// Default dark theme
|
|
109
|
+
var defaultDarkTheme = {
|
|
110
|
+
mode: "dark",
|
|
111
|
+
colors: {
|
|
112
|
+
// Primary colors (can keep same or adjust)
|
|
113
|
+
primary: "#5A4A8A",
|
|
114
|
+
primaryLight: "#7A6AAA",
|
|
115
|
+
primaryDark: "#3B3269",
|
|
116
|
+
// Background colors
|
|
117
|
+
background: "#1A1A1A",
|
|
118
|
+
backgroundSecondary: "#2A2A2A",
|
|
119
|
+
backgroundTertiary: "#3A3A3A",
|
|
120
|
+
// Text colors
|
|
121
|
+
text: "#FFFFFF",
|
|
122
|
+
textSecondary: "#CCCCCC",
|
|
123
|
+
textTertiary: "#999999",
|
|
124
|
+
textInverse: "#000000",
|
|
125
|
+
// Border colors
|
|
126
|
+
border: "#3A3A3A",
|
|
127
|
+
borderLight: "#2A2A2A",
|
|
128
|
+
borderDark: "#4A4A4A",
|
|
129
|
+
// Overlay
|
|
130
|
+
overlay: "rgba(0, 0, 0, 0.7)",
|
|
131
|
+
// Tab colors
|
|
132
|
+
tabActive: "#7A6AAA",
|
|
133
|
+
tabInactive: "#CCCCCC",
|
|
134
|
+
tabIndicator: "#7A6AAA",
|
|
135
|
+
tabBackground: "#1A1A1A",
|
|
136
|
+
// Image/Video item
|
|
137
|
+
itemBackground: "#2A2A2A",
|
|
138
|
+
itemShadow: "#000000",
|
|
139
|
+
// Pagination
|
|
140
|
+
paginationBackground: "#2A2A2A",
|
|
141
|
+
paginationButton: "#1A1A1A",
|
|
142
|
+
paginationButtonActive: "#5A4A8A",
|
|
143
|
+
paginationText: "#CCCCCC",
|
|
144
|
+
paginationTextActive: "#FFFFFF",
|
|
145
|
+
paginationBorder: "#3A3A3A",
|
|
146
|
+
// Upload button
|
|
147
|
+
uploadBorder: "#5A4A8A",
|
|
148
|
+
uploadBackground: "#1A1A1A",
|
|
149
|
+
uploadIconBackground: "#5A4A8A",
|
|
150
|
+
uploadText: "#FFFFFF",
|
|
151
|
+
// Loading
|
|
152
|
+
loadingBackground: "#2A2A2A",
|
|
153
|
+
loadingText: "#999999"
|
|
154
|
+
},
|
|
155
|
+
spacing: defaultLightTheme.spacing,
|
|
156
|
+
radius: defaultLightTheme.radius,
|
|
157
|
+
typography: defaultLightTheme.typography
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
// Merge custom theme with defaults
|
|
161
|
+
var baseTheme = isDark ? defaultDarkTheme : defaultLightTheme;
|
|
162
|
+
return _objectSpread(_objectSpread({}, baseTheme), {}, {
|
|
163
|
+
colors: _objectSpread(_objectSpread({}, baseTheme.colors), customTheme.colors || {}),
|
|
164
|
+
spacing: _objectSpread(_objectSpread({}, baseTheme.spacing), customTheme.spacing || {}),
|
|
165
|
+
radius: _objectSpread(_objectSpread({}, baseTheme.radius), customTheme.radius || {}),
|
|
166
|
+
typography: _objectSpread(_objectSpread({}, baseTheme.typography), customTheme.typography || {}),
|
|
167
|
+
// Bottom sheet height (0.85 = 85% of screen, 0.9 = 90%, etc.)
|
|
168
|
+
bottomSheetHeight: customTheme.bottomSheetHeight || 0.9
|
|
169
|
+
});
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
// Export default light theme
|
|
173
|
+
var defaultTheme = exports.defaultTheme = createTheme();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tradly/asset",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.15",
|
|
4
4
|
"description": "A reusable media gallery component for uploading and selecting images, videos, and files with Tradly authentication",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -47,4 +47,4 @@
|
|
|
47
47
|
"@babel/preset-env": "^7.28.5",
|
|
48
48
|
"@babel/preset-react": "^7.28.5"
|
|
49
49
|
}
|
|
50
|
-
}
|
|
50
|
+
}
|