@beyondcorp/beyond-ui-native 0.1.3 → 0.1.4
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/dist/index.js +78 -61
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +78 -61
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/bottom-sheet/bottom-sheet.tsx +4 -4
- package/src/components/data-table/data-table.tsx +12 -13
- package/src/components/select/select.tsx +30 -28
- package/src/providers/BeyondUIProvider.tsx +23 -4
- package/src/templates/dashboard/DashboardTemplate.tsx +11 -12
package/package.json
CHANGED
|
@@ -193,14 +193,14 @@ export const BottomSheetContent = React.forwardRef<View, BottomSheetContentProps
|
|
|
193
193
|
ref={ref}
|
|
194
194
|
style={{ transform: [{ translateY }] }}
|
|
195
195
|
className={cn(
|
|
196
|
-
"w-full bg-
|
|
196
|
+
"w-full bg-white dark:bg-neutral-900 rounded-t-3xl border-t border-neutral-200 dark:border-neutral-800 shadow-2xl pt-2 pb-8 px-6 max-h-[85%]",
|
|
197
197
|
className
|
|
198
198
|
)}
|
|
199
199
|
{...props}
|
|
200
200
|
>
|
|
201
201
|
{/* Drag Handle Bar */}
|
|
202
202
|
<View {...panResponder.panHandlers} className="w-full py-2 items-center">
|
|
203
|
-
<View className="w-12 h-1.5 rounded-full bg-
|
|
203
|
+
<View className="w-12 h-1.5 rounded-full bg-neutral-300 dark:bg-neutral-700" />
|
|
204
204
|
</View>
|
|
205
205
|
|
|
206
206
|
{children}
|
|
@@ -240,7 +240,7 @@ export const BottomSheetTitle: React.FC<BottomSheetTitleProps> = ({
|
|
|
240
240
|
children,
|
|
241
241
|
}) => {
|
|
242
242
|
return (
|
|
243
|
-
<Heading level={4} className={cn("text-xl font-bold text-
|
|
243
|
+
<Heading level={4} className={cn("text-xl font-bold text-neutral-900 dark:text-neutral-50", className)}>
|
|
244
244
|
{children}
|
|
245
245
|
</Heading>
|
|
246
246
|
);
|
|
@@ -259,7 +259,7 @@ export const BottomSheetDescription: React.FC<BottomSheetDescriptionProps> = ({
|
|
|
259
259
|
children,
|
|
260
260
|
}) => {
|
|
261
261
|
return (
|
|
262
|
-
<Text className={cn("text-sm text-
|
|
262
|
+
<Text className={cn("text-sm text-neutral-500 dark:text-neutral-400", className)}>
|
|
263
263
|
{children}
|
|
264
264
|
</Text>
|
|
265
265
|
);
|
|
@@ -124,7 +124,6 @@ export function DataTable<T extends Record<string, any>>({
|
|
|
124
124
|
setSearch(val);
|
|
125
125
|
setCurrentPage(1);
|
|
126
126
|
}}
|
|
127
|
-
className="bg-card"
|
|
128
127
|
/>
|
|
129
128
|
)}
|
|
130
129
|
|
|
@@ -137,7 +136,7 @@ export function DataTable<T extends Record<string, any>>({
|
|
|
137
136
|
</View>
|
|
138
137
|
) : paginatedData.length === 0 ? (
|
|
139
138
|
<Card className="items-center justify-center p-8">
|
|
140
|
-
<Text className="text-
|
|
139
|
+
<Text className="text-neutral-500 dark:text-neutral-400 text-base">{emptyText}</Text>
|
|
141
140
|
</Card>
|
|
142
141
|
) : mode === "card" ? (
|
|
143
142
|
/* Mobile Card Mode */
|
|
@@ -157,14 +156,14 @@ export function DataTable<T extends Record<string, any>>({
|
|
|
157
156
|
return (
|
|
158
157
|
<View
|
|
159
158
|
key={String(col.key)}
|
|
160
|
-
className="flex-row items-center justify-between py-1 border-b border-border
|
|
159
|
+
className="flex-row items-center justify-between py-1 border-b border-neutral-200 dark:border-neutral-800 last:border-b-0"
|
|
161
160
|
>
|
|
162
|
-
<Text className="text-xs font-semibold text-
|
|
161
|
+
<Text className="text-xs font-semibold text-neutral-500 dark:text-neutral-400 uppercase tracking-wider">
|
|
163
162
|
{col.title}
|
|
164
163
|
</Text>
|
|
165
164
|
<View className="shrink">
|
|
166
165
|
{typeof renderedVal === "string" ? (
|
|
167
|
-
<Text className="text-sm font-medium text-
|
|
166
|
+
<Text className="text-sm font-medium text-neutral-900 dark:text-neutral-100">
|
|
168
167
|
{renderedVal}
|
|
169
168
|
</Text>
|
|
170
169
|
) : (
|
|
@@ -181,9 +180,9 @@ export function DataTable<T extends Record<string, any>>({
|
|
|
181
180
|
) : (
|
|
182
181
|
/* Horizontal Table Mode */
|
|
183
182
|
<ScrollView horizontal showsHorizontalScrollIndicator={false}>
|
|
184
|
-
<View className="rounded-2xl border border-border bg-
|
|
183
|
+
<View className="rounded-2xl border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 overflow-hidden">
|
|
185
184
|
{/* Header */}
|
|
186
|
-
<View className="flex-row bg-
|
|
185
|
+
<View className="flex-row bg-neutral-100 dark:bg-neutral-800/60 border-b border-neutral-200 dark:border-neutral-800">
|
|
187
186
|
{columns.map((col) => (
|
|
188
187
|
<Pressable
|
|
189
188
|
key={String(col.key)}
|
|
@@ -192,11 +191,11 @@ export function DataTable<T extends Record<string, any>>({
|
|
|
192
191
|
style={{ width: col.width || 120 }}
|
|
193
192
|
className="px-4 py-3 flex-row items-center justify-between"
|
|
194
193
|
>
|
|
195
|
-
<Text className="text-xs font-bold text-
|
|
194
|
+
<Text className="text-xs font-bold text-neutral-900 dark:text-neutral-100 uppercase tracking-wider">
|
|
196
195
|
{col.title}
|
|
197
196
|
</Text>
|
|
198
197
|
{col.sortable && (
|
|
199
|
-
<Text className="text-xs text-
|
|
198
|
+
<Text className="text-xs text-neutral-500 dark:text-neutral-400">
|
|
200
199
|
{sortKey === col.key
|
|
201
200
|
? sortDirection === "asc"
|
|
202
201
|
? "▲"
|
|
@@ -214,7 +213,7 @@ export function DataTable<T extends Record<string, any>>({
|
|
|
214
213
|
key={keyExtractor(item, idx)}
|
|
215
214
|
disabled={!onRowPress}
|
|
216
215
|
onPress={() => onRowPress?.(item)}
|
|
217
|
-
className="flex-row border-b border-border
|
|
216
|
+
className="flex-row border-b border-neutral-200 dark:border-neutral-800 active:bg-neutral-100 dark:active:bg-neutral-800"
|
|
218
217
|
>
|
|
219
218
|
{columns.map((col) => {
|
|
220
219
|
const rawVal = item[col.key as string];
|
|
@@ -227,7 +226,7 @@ export function DataTable<T extends Record<string, any>>({
|
|
|
227
226
|
className="px-4 py-3 justify-center"
|
|
228
227
|
>
|
|
229
228
|
{typeof renderedVal === "string" ? (
|
|
230
|
-
<Text className="text-sm text-
|
|
229
|
+
<Text className="text-sm text-neutral-900 dark:text-neutral-100">{renderedVal}</Text>
|
|
231
230
|
) : (
|
|
232
231
|
renderedVal
|
|
233
232
|
)}
|
|
@@ -243,7 +242,7 @@ export function DataTable<T extends Record<string, any>>({
|
|
|
243
242
|
{/* Pagination Footer */}
|
|
244
243
|
{totalPages > 1 && (
|
|
245
244
|
<View className="flex-row items-center justify-between pt-2">
|
|
246
|
-
<Text className="text-xs text-
|
|
245
|
+
<Text className="text-xs text-neutral-500 dark:text-neutral-400">
|
|
247
246
|
Showing {(currentPage - 1) * pageSize + 1} -{" "}
|
|
248
247
|
{Math.min(currentPage * pageSize, sortedData.length)} of{" "}
|
|
249
248
|
{sortedData.length}
|
|
@@ -258,7 +257,7 @@ export function DataTable<T extends Record<string, any>>({
|
|
|
258
257
|
>
|
|
259
258
|
Prev
|
|
260
259
|
</Button>
|
|
261
|
-
<Text className="text-xs font-medium text-
|
|
260
|
+
<Text className="text-xs font-medium text-neutral-900 dark:text-neutral-100 px-1">
|
|
262
261
|
{currentPage} / {totalPages}
|
|
263
262
|
</Text>
|
|
264
263
|
<Button
|
|
@@ -12,11 +12,11 @@ import { cn } from "../../utilities/cn";
|
|
|
12
12
|
import { Text } from "../text/text";
|
|
13
13
|
|
|
14
14
|
const selectTriggerVariants = cva(
|
|
15
|
-
"flex-row items-center justify-between rounded-xl border bg-
|
|
15
|
+
"flex-row items-center justify-between rounded-xl border bg-white dark:bg-neutral-900 px-4 py-3 active:opacity-80",
|
|
16
16
|
{
|
|
17
17
|
variants: {
|
|
18
18
|
variant: {
|
|
19
|
-
default: "border-border",
|
|
19
|
+
default: "border-neutral-300 dark:border-neutral-700",
|
|
20
20
|
error: "border-danger",
|
|
21
21
|
success: "border-success",
|
|
22
22
|
},
|
|
@@ -130,7 +130,7 @@ export const Select: React.FC<SelectProps> = ({
|
|
|
130
130
|
>
|
|
131
131
|
<View className={cn("w-full gap-1.5", className)}>
|
|
132
132
|
{label && (
|
|
133
|
-
<Text className="text-sm font-medium text-
|
|
133
|
+
<Text className="text-sm font-medium text-neutral-800 dark:text-neutral-200">{label}</Text>
|
|
134
134
|
)}
|
|
135
135
|
|
|
136
136
|
{children ? (
|
|
@@ -149,19 +149,21 @@ export const Select: React.FC<SelectProps> = ({
|
|
|
149
149
|
<Text
|
|
150
150
|
className={cn(
|
|
151
151
|
"text-base",
|
|
152
|
-
displayLabel
|
|
152
|
+
displayLabel
|
|
153
|
+
? "text-neutral-900 dark:text-neutral-100 font-medium"
|
|
154
|
+
: "text-neutral-500 dark:text-neutral-400 font-normal"
|
|
153
155
|
)}
|
|
154
156
|
>
|
|
155
157
|
{displayLabel || placeholder}
|
|
156
158
|
</Text>
|
|
157
|
-
<Text className="text-
|
|
159
|
+
<Text className="text-neutral-500 dark:text-neutral-400 text-xs">▼</Text>
|
|
158
160
|
</Pressable>
|
|
159
161
|
)}
|
|
160
162
|
|
|
161
163
|
{error ? (
|
|
162
164
|
<Text className="text-xs text-danger font-medium">{error}</Text>
|
|
163
165
|
) : helperText ? (
|
|
164
|
-
<Text className="text-xs text-
|
|
166
|
+
<Text className="text-xs text-neutral-500 dark:text-neutral-400">{helperText}</Text>
|
|
165
167
|
) : null}
|
|
166
168
|
|
|
167
169
|
{/* Modal Options Picker if options prop was passed */}
|
|
@@ -175,13 +177,13 @@ export const Select: React.FC<SelectProps> = ({
|
|
|
175
177
|
>
|
|
176
178
|
<View className="flex-1 justify-end bg-black/60">
|
|
177
179
|
<Pressable className="flex-1" onPress={() => setOpen(false)} />
|
|
178
|
-
<View className="w-full bg-
|
|
179
|
-
<View className="flex-row items-center justify-between pb-4 border-b border-border mb-3">
|
|
180
|
-
<Text className="text-lg font-bold text-
|
|
180
|
+
<View className="w-full bg-white dark:bg-neutral-900 rounded-t-3xl border-t border-neutral-200 dark:border-neutral-800 p-6 max-h-[75%]">
|
|
181
|
+
<View className="flex-row items-center justify-between pb-4 border-b border-neutral-200 dark:border-neutral-800 mb-3">
|
|
182
|
+
<Text className="text-lg font-bold text-neutral-900 dark:text-neutral-50">
|
|
181
183
|
{label || placeholder}
|
|
182
184
|
</Text>
|
|
183
185
|
<Pressable onPress={() => setOpen(false)} className="p-1">
|
|
184
|
-
<Text className="text-
|
|
186
|
+
<Text className="text-neutral-500 dark:text-neutral-400 text-lg font-semibold">✕</Text>
|
|
185
187
|
</Pressable>
|
|
186
188
|
</View>
|
|
187
189
|
|
|
@@ -192,7 +194,7 @@ export const Select: React.FC<SelectProps> = ({
|
|
|
192
194
|
onChangeText={setSearchQuery}
|
|
193
195
|
placeholder="Search options..."
|
|
194
196
|
placeholderTextColor="#9ca3af"
|
|
195
|
-
className="h-11 px-4 rounded-xl border border-border bg-
|
|
197
|
+
className="h-11 px-4 rounded-xl border border-neutral-300 dark:border-neutral-700 bg-neutral-50 dark:bg-neutral-800 text-neutral-900 dark:text-neutral-100 text-base"
|
|
196
198
|
/>
|
|
197
199
|
</View>
|
|
198
200
|
)}
|
|
@@ -200,7 +202,7 @@ export const Select: React.FC<SelectProps> = ({
|
|
|
200
202
|
<ScrollView className="max-h-80" showsVerticalScrollIndicator={false}>
|
|
201
203
|
{filteredOptions.length === 0 ? (
|
|
202
204
|
<View className="py-8 items-center">
|
|
203
|
-
<Text className="text-
|
|
205
|
+
<Text className="text-neutral-500 dark:text-neutral-400 text-sm">No options found</Text>
|
|
204
206
|
</View>
|
|
205
207
|
) : (
|
|
206
208
|
filteredOptions.map((opt) => {
|
|
@@ -211,8 +213,8 @@ export const Select: React.FC<SelectProps> = ({
|
|
|
211
213
|
disabled={opt.disabled}
|
|
212
214
|
onPress={() => handleSelect(opt.value)}
|
|
213
215
|
className={cn(
|
|
214
|
-
"flex-row items-center justify-between py-3.5 px-3 rounded-xl active:bg-
|
|
215
|
-
isSelected && "bg-primary/
|
|
216
|
+
"flex-row items-center justify-between py-3.5 px-3 rounded-xl active:bg-neutral-100 dark:active:bg-neutral-800",
|
|
217
|
+
isSelected && "bg-primary-50 dark:bg-primary-950/40",
|
|
216
218
|
opt.disabled && "opacity-40"
|
|
217
219
|
)}
|
|
218
220
|
>
|
|
@@ -220,14 +222,14 @@ export const Select: React.FC<SelectProps> = ({
|
|
|
220
222
|
className={cn(
|
|
221
223
|
"text-base",
|
|
222
224
|
isSelected
|
|
223
|
-
? "text-primary font-semibold"
|
|
224
|
-
: "text-
|
|
225
|
+
? "text-primary-600 dark:text-primary-400 font-semibold"
|
|
226
|
+
: "text-neutral-900 dark:text-neutral-100 font-normal"
|
|
225
227
|
)}
|
|
226
228
|
>
|
|
227
229
|
{opt.label}
|
|
228
230
|
</Text>
|
|
229
231
|
{isSelected && (
|
|
230
|
-
<Text className="text-primary font-bold text-base">✓</Text>
|
|
232
|
+
<Text className="text-primary-600 dark:text-primary-400 font-bold text-base">✓</Text>
|
|
231
233
|
)}
|
|
232
234
|
</Pressable>
|
|
233
235
|
);
|
|
@@ -263,13 +265,13 @@ export const SelectTrigger: React.FC<SelectTriggerProps> = ({
|
|
|
263
265
|
accessibilityRole="combobox"
|
|
264
266
|
accessibilityState={{ expanded: open }}
|
|
265
267
|
className={cn(
|
|
266
|
-
"flex-row items-center justify-between rounded-xl border border-border bg-
|
|
268
|
+
"flex-row items-center justify-between rounded-xl border border-neutral-300 dark:border-neutral-700 bg-white dark:bg-neutral-900 px-4 py-3 active:opacity-80",
|
|
267
269
|
className
|
|
268
270
|
)}
|
|
269
271
|
{...props}
|
|
270
272
|
>
|
|
271
273
|
{children}
|
|
272
|
-
<Text className="text-
|
|
274
|
+
<Text className="text-neutral-500 dark:text-neutral-400 text-xs">▼</Text>
|
|
273
275
|
</Pressable>
|
|
274
276
|
);
|
|
275
277
|
};
|
|
@@ -289,7 +291,7 @@ export const SelectValue: React.FC<SelectValueProps> = ({
|
|
|
289
291
|
<Text
|
|
290
292
|
className={cn(
|
|
291
293
|
"text-base",
|
|
292
|
-
value ? "text-
|
|
294
|
+
value ? "text-neutral-900 dark:text-neutral-100 font-medium" : "text-neutral-500 dark:text-neutral-400",
|
|
293
295
|
className
|
|
294
296
|
)}
|
|
295
297
|
>
|
|
@@ -318,11 +320,11 @@ export const SelectContent: React.FC<SelectContentProps> = ({ title, children })
|
|
|
318
320
|
>
|
|
319
321
|
<View className="flex-1 justify-end bg-black/60">
|
|
320
322
|
<Pressable className="flex-1" onPress={() => setOpen(false)} />
|
|
321
|
-
<View className="w-full bg-
|
|
322
|
-
<View className="flex-row items-center justify-between pb-3 border-b border-border mb-3">
|
|
323
|
-
<Text className="text-lg font-bold text-
|
|
323
|
+
<View className="w-full bg-white dark:bg-neutral-900 rounded-t-3xl border-t border-neutral-200 dark:border-neutral-800 p-6 max-h-[75%]">
|
|
324
|
+
<View className="flex-row items-center justify-between pb-3 border-b border-neutral-200 dark:border-neutral-800 mb-3">
|
|
325
|
+
<Text className="text-lg font-bold text-neutral-900 dark:text-neutral-100">{title || "Select"}</Text>
|
|
324
326
|
<Pressable onPress={() => setOpen(false)} className="p-1">
|
|
325
|
-
<Text className="text-
|
|
327
|
+
<Text className="text-neutral-500 dark:text-neutral-400 text-lg font-semibold">✕</Text>
|
|
326
328
|
</Pressable>
|
|
327
329
|
</View>
|
|
328
330
|
<ScrollView className="max-h-80">{children}</ScrollView>
|
|
@@ -351,8 +353,8 @@ export const SelectItem: React.FC<SelectItemProps> = ({
|
|
|
351
353
|
<Pressable
|
|
352
354
|
onPress={() => onSelect(itemValue)}
|
|
353
355
|
className={cn(
|
|
354
|
-
"flex-row items-center justify-between py-3.5 px-3 rounded-xl active:bg-
|
|
355
|
-
isSelected && "bg-primary/
|
|
356
|
+
"flex-row items-center justify-between py-3.5 px-3 rounded-xl active:bg-neutral-100 dark:active:bg-neutral-800",
|
|
357
|
+
isSelected && "bg-primary-50 dark:bg-primary-950/40",
|
|
356
358
|
className
|
|
357
359
|
)}
|
|
358
360
|
>
|
|
@@ -360,7 +362,7 @@ export const SelectItem: React.FC<SelectItemProps> = ({
|
|
|
360
362
|
<Text
|
|
361
363
|
className={cn(
|
|
362
364
|
"text-base",
|
|
363
|
-
isSelected ? "text-primary font-semibold" : "text-
|
|
365
|
+
isSelected ? "text-primary-600 dark:text-primary-400 font-semibold" : "text-neutral-900 dark:text-neutral-100 font-normal"
|
|
364
366
|
)}
|
|
365
367
|
>
|
|
366
368
|
{children}
|
|
@@ -368,7 +370,7 @@ export const SelectItem: React.FC<SelectItemProps> = ({
|
|
|
368
370
|
) : (
|
|
369
371
|
children
|
|
370
372
|
)}
|
|
371
|
-
{isSelected && <Text className="text-primary font-bold text-base">✓</Text>}
|
|
373
|
+
{isSelected && <Text className="text-primary-600 dark:text-primary-400 font-bold text-base">✓</Text>}
|
|
372
374
|
</Pressable>
|
|
373
375
|
);
|
|
374
376
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { View, useColorScheme as useRNColorScheme } from "react-native";
|
|
3
|
+
import { colorScheme as nwColorScheme } from "nativewind";
|
|
3
4
|
import { PortalHost } from "@rn-primitives/portal";
|
|
4
5
|
import { ToastContext, ToastItem, ToastContextValue } from "../components/toast/types";
|
|
5
6
|
import { ToastContainer } from "../components/toast/toast";
|
|
@@ -38,10 +39,28 @@ export function BeyondUIProvider({
|
|
|
38
39
|
const activeScheme: "light" | "dark" =
|
|
39
40
|
selectedScheme === "system" ? systemScheme : selectedScheme;
|
|
40
41
|
|
|
42
|
+
// Sync NativeWind colorScheme store with BeyondUIProvider active scheme
|
|
43
|
+
React.useEffect(() => {
|
|
44
|
+
try {
|
|
45
|
+
nwColorScheme.set(selectedScheme === "system" ? "system" : activeScheme);
|
|
46
|
+
} catch (_) {}
|
|
47
|
+
}, [selectedScheme, activeScheme]);
|
|
48
|
+
|
|
49
|
+
const handleSetColorScheme = React.useCallback((scheme: ColorScheme) => {
|
|
50
|
+
setSelectedScheme(scheme);
|
|
51
|
+
try {
|
|
52
|
+
nwColorScheme.set(scheme === "system" ? "system" : scheme);
|
|
53
|
+
} catch (_) {}
|
|
54
|
+
}, []);
|
|
55
|
+
|
|
41
56
|
const toggleColorScheme = React.useCallback(() => {
|
|
42
57
|
setSelectedScheme((prev) => {
|
|
43
58
|
const current = prev === "system" ? systemScheme : prev;
|
|
44
|
-
|
|
59
|
+
const next = current === "dark" ? "light" : "dark";
|
|
60
|
+
try {
|
|
61
|
+
nwColorScheme.set(next);
|
|
62
|
+
} catch (_) {}
|
|
63
|
+
return next;
|
|
45
64
|
});
|
|
46
65
|
}, [systemScheme]);
|
|
47
66
|
|
|
@@ -77,10 +96,10 @@ export function BeyondUIProvider({
|
|
|
77
96
|
const contextValue: BeyondUIContextValue = React.useMemo(
|
|
78
97
|
() => ({
|
|
79
98
|
colorScheme: activeScheme,
|
|
80
|
-
setColorScheme:
|
|
99
|
+
setColorScheme: handleSetColorScheme,
|
|
81
100
|
toggleColorScheme,
|
|
82
101
|
}),
|
|
83
|
-
[activeScheme, toggleColorScheme]
|
|
102
|
+
[activeScheme, handleSetColorScheme, toggleColorScheme]
|
|
84
103
|
);
|
|
85
104
|
|
|
86
105
|
return (
|
|
@@ -88,7 +107,7 @@ export function BeyondUIProvider({
|
|
|
88
107
|
<ToastContext.Provider value={toastContextValue}>
|
|
89
108
|
<View
|
|
90
109
|
style={{ flex: 1 }}
|
|
91
|
-
className={activeScheme === "dark" ? "dark flex-1" : "flex-1"}
|
|
110
|
+
className={activeScheme === "dark" ? "dark flex-1 bg-neutral-950" : "flex-1 bg-white"}
|
|
92
111
|
>
|
|
93
112
|
{children}
|
|
94
113
|
<PortalHost />
|
|
@@ -81,10 +81,10 @@ export const DashboardTemplate: React.FC<DashboardTemplateProps> = ({
|
|
|
81
81
|
<AvatarFallback text={userName.slice(0, 2).toUpperCase()} />
|
|
82
82
|
</Avatar>
|
|
83
83
|
<View>
|
|
84
|
-
<Text className="text-xs text-
|
|
84
|
+
<Text className="text-xs text-neutral-500 dark:text-neutral-400 font-medium uppercase tracking-wider">
|
|
85
85
|
{userRole}
|
|
86
86
|
</Text>
|
|
87
|
-
<Heading level={3} className="text-xl font-bold text-
|
|
87
|
+
<Heading level={3} className="text-xl font-bold text-neutral-900 dark:text-neutral-50">
|
|
88
88
|
Hello, {userName} 👋
|
|
89
89
|
</Heading>
|
|
90
90
|
</View>
|
|
@@ -93,9 +93,9 @@ export const DashboardTemplate: React.FC<DashboardTemplateProps> = ({
|
|
|
93
93
|
{onNotificationPress && (
|
|
94
94
|
<Pressable
|
|
95
95
|
onPress={onNotificationPress}
|
|
96
|
-
className="w-10 h-10 rounded-full border border-border bg-
|
|
96
|
+
className="w-10 h-10 rounded-full border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 items-center justify-center relative active:opacity-70"
|
|
97
97
|
>
|
|
98
|
-
<Text className="text-base text-
|
|
98
|
+
<Text className="text-base text-neutral-900 dark:text-neutral-100">🔔</Text>
|
|
99
99
|
{unreadNotificationsCount > 0 && (
|
|
100
100
|
<View className="absolute -top-1 -right-1 w-5 h-5 rounded-full bg-danger items-center justify-center">
|
|
101
101
|
<Text className="text-[10px] font-bold text-white">
|
|
@@ -111,7 +111,7 @@ export const DashboardTemplate: React.FC<DashboardTemplateProps> = ({
|
|
|
111
111
|
{/* Quick Actions */}
|
|
112
112
|
{quickActions && quickActions.length > 0 && (
|
|
113
113
|
<View className="gap-2">
|
|
114
|
-
<Text className="text-xs font-bold text-
|
|
114
|
+
<Text className="text-xs font-bold text-neutral-500 dark:text-neutral-400 uppercase tracking-wider">
|
|
115
115
|
Quick Actions
|
|
116
116
|
</Text>
|
|
117
117
|
<ScrollView
|
|
@@ -126,7 +126,6 @@ export const DashboardTemplate: React.FC<DashboardTemplateProps> = ({
|
|
|
126
126
|
variant="outline"
|
|
127
127
|
size="sm"
|
|
128
128
|
onPress={action.onPress}
|
|
129
|
-
className="bg-card shadow-sm"
|
|
130
129
|
>
|
|
131
130
|
{action.icon ? `${action.icon} ${action.label}` : action.label}
|
|
132
131
|
</Button>
|
|
@@ -138,7 +137,7 @@ export const DashboardTemplate: React.FC<DashboardTemplateProps> = ({
|
|
|
138
137
|
|
|
139
138
|
{/* Metrics Grid */}
|
|
140
139
|
<View className="gap-3">
|
|
141
|
-
<Text className="text-xs font-bold text-
|
|
140
|
+
<Text className="text-xs font-bold text-neutral-500 dark:text-neutral-400 uppercase tracking-wider">
|
|
142
141
|
Overview Performance
|
|
143
142
|
</Text>
|
|
144
143
|
<View className="gap-3">
|
|
@@ -155,7 +154,7 @@ export const DashboardTemplate: React.FC<DashboardTemplateProps> = ({
|
|
|
155
154
|
<CardTitle className="text-base font-bold">Recent Activity</CardTitle>
|
|
156
155
|
{onViewAllActivities && (
|
|
157
156
|
<Pressable onPress={onViewAllActivities}>
|
|
158
|
-
<Text className="text-xs font-semibold text-primary">View all</Text>
|
|
157
|
+
<Text className="text-xs font-semibold text-primary-600 dark:text-primary-400">View all</Text>
|
|
159
158
|
</Pressable>
|
|
160
159
|
)}
|
|
161
160
|
</CardHeader>
|
|
@@ -163,7 +162,7 @@ export const DashboardTemplate: React.FC<DashboardTemplateProps> = ({
|
|
|
163
162
|
{recentActivities.map((act) => (
|
|
164
163
|
<View
|
|
165
164
|
key={act.id}
|
|
166
|
-
className="flex-row items-center justify-between py-2 border-b border-border
|
|
165
|
+
className="flex-row items-center justify-between py-2 border-b border-neutral-200 dark:border-neutral-800 last:border-b-0"
|
|
167
166
|
>
|
|
168
167
|
<View className="flex-row items-center gap-3 flex-1 pr-2">
|
|
169
168
|
<Avatar size="sm">
|
|
@@ -173,10 +172,10 @@ export const DashboardTemplate: React.FC<DashboardTemplateProps> = ({
|
|
|
173
172
|
/>
|
|
174
173
|
</Avatar>
|
|
175
174
|
<View className="flex-1">
|
|
176
|
-
<Text className="text-sm font-semibold text-
|
|
175
|
+
<Text className="text-sm font-semibold text-neutral-900 dark:text-neutral-100" numberOfLines={1}>
|
|
177
176
|
{act.title}
|
|
178
177
|
</Text>
|
|
179
|
-
<Text className="text-xs text-
|
|
178
|
+
<Text className="text-xs text-neutral-500 dark:text-neutral-400" numberOfLines={1}>
|
|
180
179
|
{act.subtitle} • {act.timestamp}
|
|
181
180
|
</Text>
|
|
182
181
|
</View>
|
|
@@ -184,7 +183,7 @@ export const DashboardTemplate: React.FC<DashboardTemplateProps> = ({
|
|
|
184
183
|
|
|
185
184
|
<View className="items-end gap-1">
|
|
186
185
|
{act.amount && (
|
|
187
|
-
<Text className="text-sm font-bold text-
|
|
186
|
+
<Text className="text-sm font-bold text-neutral-900 dark:text-neutral-100">
|
|
188
187
|
{act.amount}
|
|
189
188
|
</Text>
|
|
190
189
|
)}
|