@beyondcorp/beyond-ui-native 0.1.5 → 0.1.7
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/chunk-BJTO5JO5.mjs +11 -0
- package/dist/chunk-BJTO5JO5.mjs.map +1 -0
- package/dist/index.d.mts +109 -1
- package/dist/index.d.ts +109 -1
- package/dist/index.js +749 -293
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +772 -307
- package/dist/index.mjs.map +1 -1
- package/dist/preset.mjs +1 -0
- package/dist/utilities.mjs +1 -0
- package/package.json +1 -1
- package/src/components/dashboard-layout/dashboard-layout.tsx +245 -0
- package/src/components/dashboard-layout/index.ts +1 -0
- package/src/components/modal/index.ts +1 -0
- package/src/components/modal/modal.tsx +227 -0
- package/src/components/night-mode-switch/index.ts +1 -0
- package/src/components/night-mode-switch/night-mode-switch.tsx +95 -0
- package/src/index.ts +3 -0
- package/src/providers/BeyondUIProvider.tsx +29 -0
package/dist/index.mjs
CHANGED
|
@@ -7,6 +7,9 @@ import {
|
|
|
7
7
|
getAccessibilityProps,
|
|
8
8
|
joinA11yLabels
|
|
9
9
|
} from "./chunk-UTNW3LJA.mjs";
|
|
10
|
+
import {
|
|
11
|
+
__require
|
|
12
|
+
} from "./chunk-BJTO5JO5.mjs";
|
|
10
13
|
|
|
11
14
|
// src/primitives/box.tsx
|
|
12
15
|
import * as React from "react";
|
|
@@ -2466,16 +2469,557 @@ function DataTable({
|
|
|
2466
2469
|
] });
|
|
2467
2470
|
}
|
|
2468
2471
|
|
|
2469
|
-
// src/
|
|
2472
|
+
// src/components/modal/modal.tsx
|
|
2470
2473
|
import * as React23 from "react";
|
|
2471
2474
|
import {
|
|
2475
|
+
Modal as RNModal,
|
|
2472
2476
|
View as View22,
|
|
2473
|
-
|
|
2477
|
+
Text as Text16,
|
|
2478
|
+
Pressable as Pressable13,
|
|
2479
|
+
StyleSheet as StyleSheet2,
|
|
2474
2480
|
KeyboardAvoidingView,
|
|
2475
2481
|
Platform,
|
|
2476
|
-
|
|
2482
|
+
ScrollView as ScrollView3
|
|
2477
2483
|
} from "react-native";
|
|
2484
|
+
import { cva as cva11 } from "class-variance-authority";
|
|
2478
2485
|
import { jsx as jsx26, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2486
|
+
var modalVariants = cva11(
|
|
2487
|
+
"w-full rounded-2xl border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 p-6 shadow-2xl relative",
|
|
2488
|
+
{
|
|
2489
|
+
variants: {
|
|
2490
|
+
size: {
|
|
2491
|
+
sm: "max-w-xs",
|
|
2492
|
+
md: "max-w-md",
|
|
2493
|
+
lg: "max-w-lg",
|
|
2494
|
+
xl: "max-w-xl",
|
|
2495
|
+
full: "max-w-[95%] max-h-[90%]"
|
|
2496
|
+
}
|
|
2497
|
+
},
|
|
2498
|
+
defaultVariants: {
|
|
2499
|
+
size: "md"
|
|
2500
|
+
}
|
|
2501
|
+
}
|
|
2502
|
+
);
|
|
2503
|
+
var ModalContext = React23.createContext(null);
|
|
2504
|
+
function useModalContext() {
|
|
2505
|
+
const context = React23.useContext(ModalContext);
|
|
2506
|
+
if (!context) {
|
|
2507
|
+
throw new Error("Modal compound components must be used within a Modal component");
|
|
2508
|
+
}
|
|
2509
|
+
return context;
|
|
2510
|
+
}
|
|
2511
|
+
function Modal4({
|
|
2512
|
+
open: controlledOpen,
|
|
2513
|
+
visible,
|
|
2514
|
+
onOpenChange,
|
|
2515
|
+
onRequestClose,
|
|
2516
|
+
showCloseButton = true,
|
|
2517
|
+
closeOnOverlayPress = true,
|
|
2518
|
+
size = "md",
|
|
2519
|
+
children,
|
|
2520
|
+
className,
|
|
2521
|
+
overlayClassName
|
|
2522
|
+
}) {
|
|
2523
|
+
const isOpen = (controlledOpen !== void 0 ? controlledOpen : visible) ?? false;
|
|
2524
|
+
const handleClose = React23.useCallback(() => {
|
|
2525
|
+
onOpenChange?.(false);
|
|
2526
|
+
onRequestClose?.();
|
|
2527
|
+
}, [onOpenChange, onRequestClose]);
|
|
2528
|
+
if (!isOpen) return null;
|
|
2529
|
+
return /* @__PURE__ */ jsx26(ModalContext.Provider, { value: { open: isOpen, onOpenChange: (o) => !o && handleClose() }, children: /* @__PURE__ */ jsx26(
|
|
2530
|
+
RNModal,
|
|
2531
|
+
{
|
|
2532
|
+
transparent: true,
|
|
2533
|
+
visible: isOpen,
|
|
2534
|
+
animationType: "fade",
|
|
2535
|
+
onRequestClose: handleClose,
|
|
2536
|
+
statusBarTranslucent: true,
|
|
2537
|
+
children: /* @__PURE__ */ jsxs13(
|
|
2538
|
+
KeyboardAvoidingView,
|
|
2539
|
+
{
|
|
2540
|
+
behavior: Platform.OS === "ios" ? "padding" : void 0,
|
|
2541
|
+
style: StyleSheet2.absoluteFill,
|
|
2542
|
+
children: [
|
|
2543
|
+
/* @__PURE__ */ jsx26(
|
|
2544
|
+
Pressable13,
|
|
2545
|
+
{
|
|
2546
|
+
style: StyleSheet2.absoluteFill,
|
|
2547
|
+
className: cn("bg-black/60", overlayClassName),
|
|
2548
|
+
onPress: closeOnOverlayPress ? handleClose : void 0,
|
|
2549
|
+
accessibilityRole: "button",
|
|
2550
|
+
accessibilityLabel: "Close modal overlay"
|
|
2551
|
+
}
|
|
2552
|
+
),
|
|
2553
|
+
/* @__PURE__ */ jsx26(
|
|
2554
|
+
View22,
|
|
2555
|
+
{
|
|
2556
|
+
pointerEvents: "box-none",
|
|
2557
|
+
style: StyleSheet2.absoluteFill,
|
|
2558
|
+
className: "items-center justify-center p-4 z-50",
|
|
2559
|
+
children: /* @__PURE__ */ jsxs13(
|
|
2560
|
+
View22,
|
|
2561
|
+
{
|
|
2562
|
+
role: "dialog",
|
|
2563
|
+
"aria-modal": true,
|
|
2564
|
+
className: cn(modalVariants({ size }), className),
|
|
2565
|
+
children: [
|
|
2566
|
+
showCloseButton && /* @__PURE__ */ jsx26(
|
|
2567
|
+
Pressable13,
|
|
2568
|
+
{
|
|
2569
|
+
onPress: handleClose,
|
|
2570
|
+
hitSlop: { top: 12, right: 12, bottom: 12, left: 12 },
|
|
2571
|
+
className: "absolute right-4 top-4 z-50 w-8 h-8 rounded-full bg-neutral-100 dark:bg-neutral-800 items-center justify-center active:opacity-70",
|
|
2572
|
+
accessibilityRole: "button",
|
|
2573
|
+
accessibilityLabel: "Close modal",
|
|
2574
|
+
children: /* @__PURE__ */ jsx26(Text16, { className: "text-neutral-500 dark:text-neutral-400 text-sm font-semibold leading-none", children: "\u2715" })
|
|
2575
|
+
}
|
|
2576
|
+
),
|
|
2577
|
+
children
|
|
2578
|
+
]
|
|
2579
|
+
}
|
|
2580
|
+
)
|
|
2581
|
+
}
|
|
2582
|
+
)
|
|
2583
|
+
]
|
|
2584
|
+
}
|
|
2585
|
+
)
|
|
2586
|
+
}
|
|
2587
|
+
) });
|
|
2588
|
+
}
|
|
2589
|
+
Modal4.displayName = "Modal";
|
|
2590
|
+
function ModalHeader({
|
|
2591
|
+
className,
|
|
2592
|
+
...props
|
|
2593
|
+
}) {
|
|
2594
|
+
return /* @__PURE__ */ jsx26(
|
|
2595
|
+
View22,
|
|
2596
|
+
{
|
|
2597
|
+
className: cn("flex-col space-y-1.5 pr-8", className),
|
|
2598
|
+
...props
|
|
2599
|
+
}
|
|
2600
|
+
);
|
|
2601
|
+
}
|
|
2602
|
+
ModalHeader.displayName = "ModalHeader";
|
|
2603
|
+
var ModalTitle = React23.forwardRef(
|
|
2604
|
+
function ModalTitle2({ className, ...props }, ref) {
|
|
2605
|
+
return /* @__PURE__ */ jsx26(
|
|
2606
|
+
Text16,
|
|
2607
|
+
{
|
|
2608
|
+
ref,
|
|
2609
|
+
role: "heading",
|
|
2610
|
+
"aria-level": 2,
|
|
2611
|
+
className: cn(
|
|
2612
|
+
"text-lg font-bold tracking-tight text-neutral-900 dark:text-neutral-50",
|
|
2613
|
+
className
|
|
2614
|
+
),
|
|
2615
|
+
...props
|
|
2616
|
+
}
|
|
2617
|
+
);
|
|
2618
|
+
}
|
|
2619
|
+
);
|
|
2620
|
+
ModalTitle.displayName = "ModalTitle";
|
|
2621
|
+
var ModalDescription = React23.forwardRef(
|
|
2622
|
+
function ModalDescription2({ className, ...props }, ref) {
|
|
2623
|
+
return /* @__PURE__ */ jsx26(
|
|
2624
|
+
Text16,
|
|
2625
|
+
{
|
|
2626
|
+
ref,
|
|
2627
|
+
className: cn(
|
|
2628
|
+
"text-sm text-neutral-500 dark:text-neutral-400 mt-1",
|
|
2629
|
+
className
|
|
2630
|
+
),
|
|
2631
|
+
...props
|
|
2632
|
+
}
|
|
2633
|
+
);
|
|
2634
|
+
}
|
|
2635
|
+
);
|
|
2636
|
+
ModalDescription.displayName = "ModalDescription";
|
|
2637
|
+
function ModalContent({
|
|
2638
|
+
className,
|
|
2639
|
+
children,
|
|
2640
|
+
scrollable = false,
|
|
2641
|
+
...props
|
|
2642
|
+
}) {
|
|
2643
|
+
if (scrollable) {
|
|
2644
|
+
return /* @__PURE__ */ jsx26(
|
|
2645
|
+
ScrollView3,
|
|
2646
|
+
{
|
|
2647
|
+
showsVerticalScrollIndicator: false,
|
|
2648
|
+
className: cn("py-3 max-h-[70vh]", className),
|
|
2649
|
+
...props,
|
|
2650
|
+
children
|
|
2651
|
+
}
|
|
2652
|
+
);
|
|
2653
|
+
}
|
|
2654
|
+
return /* @__PURE__ */ jsx26(View22, { className: cn("py-3", className), ...props, children });
|
|
2655
|
+
}
|
|
2656
|
+
ModalContent.displayName = "ModalContent";
|
|
2657
|
+
function ModalFooter({
|
|
2658
|
+
className,
|
|
2659
|
+
...props
|
|
2660
|
+
}) {
|
|
2661
|
+
return /* @__PURE__ */ jsx26(
|
|
2662
|
+
View22,
|
|
2663
|
+
{
|
|
2664
|
+
className: cn(
|
|
2665
|
+
"flex-row flex-wrap items-center justify-end gap-2 pt-3 border-t border-neutral-100 dark:border-neutral-800 mt-2",
|
|
2666
|
+
className
|
|
2667
|
+
),
|
|
2668
|
+
...props
|
|
2669
|
+
}
|
|
2670
|
+
);
|
|
2671
|
+
}
|
|
2672
|
+
ModalFooter.displayName = "ModalFooter";
|
|
2673
|
+
|
|
2674
|
+
// src/components/night-mode-switch/night-mode-switch.tsx
|
|
2675
|
+
import * as React25 from "react";
|
|
2676
|
+
import {
|
|
2677
|
+
Pressable as Pressable14,
|
|
2678
|
+
Text as Text17
|
|
2679
|
+
} from "react-native";
|
|
2680
|
+
import { cva as cva12 } from "class-variance-authority";
|
|
2681
|
+
|
|
2682
|
+
// src/providers/BeyondUIProvider.tsx
|
|
2683
|
+
import * as React24 from "react";
|
|
2684
|
+
import { View as View23, useColorScheme as useRNColorScheme } from "react-native";
|
|
2685
|
+
import { colorScheme as nwColorScheme } from "nativewind";
|
|
2686
|
+
import { PortalHost } from "@rn-primitives/portal";
|
|
2687
|
+
import { jsx as jsx27, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2688
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
2689
|
+
try {
|
|
2690
|
+
const { LogBox } = __require("react-native");
|
|
2691
|
+
LogBox?.ignoreLogs?.([
|
|
2692
|
+
"You are setting the style `{ shadowOffset: ... }` as a prop",
|
|
2693
|
+
"You are setting the style"
|
|
2694
|
+
]);
|
|
2695
|
+
if (!Boolean(console.error?.__beyond_ui_filtered)) {
|
|
2696
|
+
const originalError = console.error;
|
|
2697
|
+
const filteredError = (...args) => {
|
|
2698
|
+
const fullMessage = args.map((arg) => typeof arg === "string" ? arg : "").join(" ");
|
|
2699
|
+
if (fullMessage.includes("shadowOffset") || fullMessage.includes("You are setting the style")) {
|
|
2700
|
+
return;
|
|
2701
|
+
}
|
|
2702
|
+
originalError(...args);
|
|
2703
|
+
};
|
|
2704
|
+
filteredError.__beyond_ui_filtered = true;
|
|
2705
|
+
console.error = filteredError;
|
|
2706
|
+
}
|
|
2707
|
+
} catch (_) {
|
|
2708
|
+
}
|
|
2709
|
+
}
|
|
2710
|
+
var BeyondUIContext = React24.createContext({
|
|
2711
|
+
colorScheme: "light",
|
|
2712
|
+
setColorScheme: () => {
|
|
2713
|
+
},
|
|
2714
|
+
toggleColorScheme: () => {
|
|
2715
|
+
}
|
|
2716
|
+
});
|
|
2717
|
+
function useBeyondUI() {
|
|
2718
|
+
return React24.useContext(BeyondUIContext);
|
|
2719
|
+
}
|
|
2720
|
+
function BeyondUIProvider({
|
|
2721
|
+
children,
|
|
2722
|
+
defaultColorScheme = "system"
|
|
2723
|
+
}) {
|
|
2724
|
+
const systemScheme = useRNColorScheme() ?? "light";
|
|
2725
|
+
const [selectedScheme, setSelectedScheme] = React24.useState(defaultColorScheme);
|
|
2726
|
+
const [toasts, setToasts] = React24.useState([]);
|
|
2727
|
+
const activeScheme = selectedScheme === "system" ? systemScheme : selectedScheme;
|
|
2728
|
+
React24.useEffect(() => {
|
|
2729
|
+
try {
|
|
2730
|
+
nwColorScheme.set(selectedScheme === "system" ? "system" : activeScheme);
|
|
2731
|
+
} catch (_) {
|
|
2732
|
+
}
|
|
2733
|
+
}, [selectedScheme, activeScheme]);
|
|
2734
|
+
const handleSetColorScheme = React24.useCallback((scheme) => {
|
|
2735
|
+
setSelectedScheme(scheme);
|
|
2736
|
+
try {
|
|
2737
|
+
nwColorScheme.set(scheme === "system" ? "system" : scheme);
|
|
2738
|
+
} catch (_) {
|
|
2739
|
+
}
|
|
2740
|
+
}, []);
|
|
2741
|
+
const toggleColorScheme = React24.useCallback(() => {
|
|
2742
|
+
setSelectedScheme((prev) => {
|
|
2743
|
+
const current = prev === "system" ? systemScheme : prev;
|
|
2744
|
+
const next = current === "dark" ? "light" : "dark";
|
|
2745
|
+
try {
|
|
2746
|
+
nwColorScheme.set(next);
|
|
2747
|
+
} catch (_) {
|
|
2748
|
+
}
|
|
2749
|
+
return next;
|
|
2750
|
+
});
|
|
2751
|
+
}, [systemScheme]);
|
|
2752
|
+
const dismissToast = React24.useCallback((id) => {
|
|
2753
|
+
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
2754
|
+
}, []);
|
|
2755
|
+
const showToast = React24.useCallback((toast) => {
|
|
2756
|
+
const id = Math.random().toString(36).substring(2, 9);
|
|
2757
|
+
setToasts((prev) => [...prev, { ...toast, id }]);
|
|
2758
|
+
return id;
|
|
2759
|
+
}, []);
|
|
2760
|
+
const toastContextValue = React24.useMemo(
|
|
2761
|
+
() => ({
|
|
2762
|
+
toasts,
|
|
2763
|
+
show: showToast,
|
|
2764
|
+
dismiss: dismissToast,
|
|
2765
|
+
success: (title, description) => showToast({ title, description, variant: "success" }),
|
|
2766
|
+
danger: (title, description) => showToast({ title, description, variant: "danger" }),
|
|
2767
|
+
error: (title, description) => showToast({ title, description, variant: "danger" }),
|
|
2768
|
+
warning: (title, description) => showToast({ title, description, variant: "warning" }),
|
|
2769
|
+
info: (title, description) => showToast({ title, description, variant: "info" })
|
|
2770
|
+
}),
|
|
2771
|
+
[toasts, showToast, dismissToast]
|
|
2772
|
+
);
|
|
2773
|
+
const contextValue = React24.useMemo(
|
|
2774
|
+
() => ({
|
|
2775
|
+
colorScheme: activeScheme,
|
|
2776
|
+
setColorScheme: handleSetColorScheme,
|
|
2777
|
+
toggleColorScheme
|
|
2778
|
+
}),
|
|
2779
|
+
[activeScheme, handleSetColorScheme, toggleColorScheme]
|
|
2780
|
+
);
|
|
2781
|
+
return /* @__PURE__ */ jsx27(BeyondUIContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx27(ToastContext.Provider, { value: toastContextValue, children: /* @__PURE__ */ jsxs14(
|
|
2782
|
+
View23,
|
|
2783
|
+
{
|
|
2784
|
+
style: { flex: 1 },
|
|
2785
|
+
className: activeScheme === "dark" ? "dark flex-1 bg-neutral-950" : "flex-1 bg-white",
|
|
2786
|
+
children: [
|
|
2787
|
+
children,
|
|
2788
|
+
/* @__PURE__ */ jsx27(PortalHost, {}),
|
|
2789
|
+
/* @__PURE__ */ jsx27(ToastContainer, { toasts, onDismiss: dismissToast })
|
|
2790
|
+
]
|
|
2791
|
+
}
|
|
2792
|
+
) }) });
|
|
2793
|
+
}
|
|
2794
|
+
|
|
2795
|
+
// src/components/night-mode-switch/night-mode-switch.tsx
|
|
2796
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
2797
|
+
var nightModeSwitchVariants = cva12(
|
|
2798
|
+
"inline-flex items-center justify-center rounded-full active:opacity-75",
|
|
2799
|
+
{
|
|
2800
|
+
variants: {
|
|
2801
|
+
variant: {
|
|
2802
|
+
primary: "bg-primary-600 dark:bg-primary-500",
|
|
2803
|
+
secondary: "bg-secondary-600 dark:bg-secondary-500",
|
|
2804
|
+
ghost: "bg-transparent active:bg-neutral-100 dark:active:bg-neutral-800"
|
|
2805
|
+
},
|
|
2806
|
+
size: {
|
|
2807
|
+
sm: "w-8 h-8",
|
|
2808
|
+
md: "w-10 h-10",
|
|
2809
|
+
lg: "w-12 h-12"
|
|
2810
|
+
}
|
|
2811
|
+
},
|
|
2812
|
+
defaultVariants: {
|
|
2813
|
+
variant: "ghost",
|
|
2814
|
+
size: "md"
|
|
2815
|
+
}
|
|
2816
|
+
}
|
|
2817
|
+
);
|
|
2818
|
+
var NightModeSwitch = React25.forwardRef(
|
|
2819
|
+
function NightModeSwitch2({
|
|
2820
|
+
className,
|
|
2821
|
+
textClassName,
|
|
2822
|
+
variant,
|
|
2823
|
+
size,
|
|
2824
|
+
ariaLabel = "Toggle dark mode",
|
|
2825
|
+
onPress,
|
|
2826
|
+
...props
|
|
2827
|
+
}, ref) {
|
|
2828
|
+
const { colorScheme, toggleColorScheme } = useBeyondUI();
|
|
2829
|
+
const isDark = colorScheme === "dark";
|
|
2830
|
+
const handlePress = (e) => {
|
|
2831
|
+
toggleColorScheme();
|
|
2832
|
+
onPress?.(e);
|
|
2833
|
+
};
|
|
2834
|
+
const iconSizeClasses = {
|
|
2835
|
+
sm: "text-base",
|
|
2836
|
+
md: "text-lg",
|
|
2837
|
+
lg: "text-xl"
|
|
2838
|
+
}[size || "md"];
|
|
2839
|
+
return /* @__PURE__ */ jsx28(
|
|
2840
|
+
Pressable14,
|
|
2841
|
+
{
|
|
2842
|
+
ref,
|
|
2843
|
+
role: "button",
|
|
2844
|
+
accessibilityRole: "button",
|
|
2845
|
+
accessibilityLabel: ariaLabel,
|
|
2846
|
+
accessibilityState: { checked: isDark },
|
|
2847
|
+
className: cn(nightModeSwitchVariants({ variant, size }), className),
|
|
2848
|
+
onPress: handlePress,
|
|
2849
|
+
...props,
|
|
2850
|
+
children: /* @__PURE__ */ jsx28(
|
|
2851
|
+
Text17,
|
|
2852
|
+
{
|
|
2853
|
+
className: cn(
|
|
2854
|
+
iconSizeClasses,
|
|
2855
|
+
variant === "ghost" ? "text-neutral-700 dark:text-neutral-200" : "text-white",
|
|
2856
|
+
textClassName
|
|
2857
|
+
),
|
|
2858
|
+
children: isDark ? "\u{1F319}" : "\u2600\uFE0F"
|
|
2859
|
+
}
|
|
2860
|
+
)
|
|
2861
|
+
}
|
|
2862
|
+
);
|
|
2863
|
+
}
|
|
2864
|
+
);
|
|
2865
|
+
NightModeSwitch.displayName = "NightModeSwitch";
|
|
2866
|
+
|
|
2867
|
+
// src/components/dashboard-layout/dashboard-layout.tsx
|
|
2868
|
+
import * as React26 from "react";
|
|
2869
|
+
import {
|
|
2870
|
+
View as View24,
|
|
2871
|
+
ScrollView as ScrollView4,
|
|
2872
|
+
Pressable as Pressable15,
|
|
2873
|
+
TextInput as TextInput4,
|
|
2874
|
+
RefreshControl
|
|
2875
|
+
} from "react-native";
|
|
2876
|
+
import { jsx as jsx29, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2877
|
+
var DashboardLayout = ({
|
|
2878
|
+
title,
|
|
2879
|
+
subtitle,
|
|
2880
|
+
breadcrumbs,
|
|
2881
|
+
user,
|
|
2882
|
+
onProfilePress,
|
|
2883
|
+
onNotificationPress,
|
|
2884
|
+
unreadNotificationsCount = 0,
|
|
2885
|
+
showSearch = false,
|
|
2886
|
+
searchPlaceholder = "Search...",
|
|
2887
|
+
searchValue,
|
|
2888
|
+
onSearchChange,
|
|
2889
|
+
showNightModeSwitch = true,
|
|
2890
|
+
onBackPress,
|
|
2891
|
+
backIcon,
|
|
2892
|
+
headerActions,
|
|
2893
|
+
footer,
|
|
2894
|
+
scrollable = true,
|
|
2895
|
+
refreshing = false,
|
|
2896
|
+
onRefresh,
|
|
2897
|
+
contentClassName,
|
|
2898
|
+
className,
|
|
2899
|
+
children,
|
|
2900
|
+
...props
|
|
2901
|
+
}) => {
|
|
2902
|
+
return /* @__PURE__ */ jsxs15(
|
|
2903
|
+
View24,
|
|
2904
|
+
{
|
|
2905
|
+
className: cn("flex-1 bg-neutral-50 dark:bg-neutral-950", className),
|
|
2906
|
+
...props,
|
|
2907
|
+
children: [
|
|
2908
|
+
/* @__PURE__ */ jsxs15(View24, { className: "px-5 pt-3 pb-3 border-b border-neutral-200 dark:border-neutral-800 bg-white/90 dark:bg-neutral-900/90 flex-row items-center justify-between z-10", children: [
|
|
2909
|
+
/* @__PURE__ */ jsxs15(View24, { className: "flex-row items-center gap-3 flex-1 mr-2", children: [
|
|
2910
|
+
onBackPress && /* @__PURE__ */ jsx29(
|
|
2911
|
+
Pressable15,
|
|
2912
|
+
{
|
|
2913
|
+
onPress: onBackPress,
|
|
2914
|
+
className: "w-9 h-9 rounded-full bg-neutral-100 dark:bg-neutral-800 items-center justify-center active:opacity-70",
|
|
2915
|
+
accessibilityRole: "button",
|
|
2916
|
+
accessibilityLabel: "Back",
|
|
2917
|
+
children: backIcon || /* @__PURE__ */ jsx29(Text2, { className: "text-neutral-700 dark:text-neutral-200 font-bold text-base leading-none", children: "\u2190" })
|
|
2918
|
+
}
|
|
2919
|
+
),
|
|
2920
|
+
user && /* @__PURE__ */ jsxs15(
|
|
2921
|
+
Pressable15,
|
|
2922
|
+
{
|
|
2923
|
+
onPress: onProfilePress,
|
|
2924
|
+
className: "flex-row items-center gap-2 active:opacity-80",
|
|
2925
|
+
accessibilityRole: "button",
|
|
2926
|
+
accessibilityLabel: `User profile: ${user.name || "User"}`,
|
|
2927
|
+
children: [
|
|
2928
|
+
/* @__PURE__ */ jsxs15(Avatar, { size: "sm", children: [
|
|
2929
|
+
user.avatarUrl && /* @__PURE__ */ jsx29(AvatarImage, { source: { uri: user.avatarUrl } }),
|
|
2930
|
+
/* @__PURE__ */ jsx29(AvatarFallback, { text: (user.name || "U").slice(0, 2).toUpperCase() })
|
|
2931
|
+
] }),
|
|
2932
|
+
/* @__PURE__ */ jsxs15(View24, { className: "hidden sm:flex", children: [
|
|
2933
|
+
/* @__PURE__ */ jsx29(Text2, { className: "text-xs font-semibold text-neutral-800 dark:text-neutral-200 leading-tight", children: user.name }),
|
|
2934
|
+
user.role && /* @__PURE__ */ jsx29(Text2, { className: "text-[10px] text-neutral-500 dark:text-neutral-400 leading-tight", children: user.role })
|
|
2935
|
+
] })
|
|
2936
|
+
]
|
|
2937
|
+
}
|
|
2938
|
+
),
|
|
2939
|
+
(title || subtitle) && /* @__PURE__ */ jsxs15(View24, { className: "flex-1", children: [
|
|
2940
|
+
breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx29(View24, { className: "flex-row items-center gap-1 mb-0.5", children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxs15(React26.Fragment, { children: [
|
|
2941
|
+
idx > 0 && /* @__PURE__ */ jsx29(Text2, { className: "text-[11px] text-neutral-400 dark:text-neutral-500", children: "/" }),
|
|
2942
|
+
/* @__PURE__ */ jsx29(
|
|
2943
|
+
Text2,
|
|
2944
|
+
{
|
|
2945
|
+
onPress: crumb.onPress,
|
|
2946
|
+
className: cn(
|
|
2947
|
+
"text-[11px]",
|
|
2948
|
+
crumb.onPress ? "text-primary-600 dark:text-primary-400 font-medium" : "text-neutral-500 dark:text-neutral-400"
|
|
2949
|
+
),
|
|
2950
|
+
children: crumb.label
|
|
2951
|
+
}
|
|
2952
|
+
)
|
|
2953
|
+
] }, idx)) }),
|
|
2954
|
+
title && /* @__PURE__ */ jsx29(
|
|
2955
|
+
Heading,
|
|
2956
|
+
{
|
|
2957
|
+
level: 3,
|
|
2958
|
+
className: "text-lg font-bold text-neutral-900 dark:text-neutral-50 leading-tight",
|
|
2959
|
+
children: title
|
|
2960
|
+
}
|
|
2961
|
+
),
|
|
2962
|
+
subtitle && /* @__PURE__ */ jsx29(Text2, { className: "text-xs text-neutral-500 dark:text-neutral-400 leading-tight", children: subtitle })
|
|
2963
|
+
] })
|
|
2964
|
+
] }),
|
|
2965
|
+
/* @__PURE__ */ jsxs15(View24, { className: "flex-row items-center gap-2", children: [
|
|
2966
|
+
headerActions,
|
|
2967
|
+
showNightModeSwitch && /* @__PURE__ */ jsx29(NightModeSwitch, { size: "sm", variant: "ghost" }),
|
|
2968
|
+
onNotificationPress && /* @__PURE__ */ jsxs15(
|
|
2969
|
+
Pressable15,
|
|
2970
|
+
{
|
|
2971
|
+
onPress: onNotificationPress,
|
|
2972
|
+
className: "w-9 h-9 rounded-full bg-neutral-100 dark:bg-neutral-800 items-center justify-center relative active:opacity-70",
|
|
2973
|
+
accessibilityRole: "button",
|
|
2974
|
+
accessibilityLabel: "Notifications",
|
|
2975
|
+
children: [
|
|
2976
|
+
/* @__PURE__ */ jsx29(Text2, { className: "text-sm", children: "\u{1F514}" }),
|
|
2977
|
+
unreadNotificationsCount > 0 && /* @__PURE__ */ jsx29(View24, { className: "absolute -top-0.5 -right-0.5 min-w-[16px] h-4 px-1 rounded-full bg-danger items-center justify-center", children: /* @__PURE__ */ jsx29(Text2, { className: "text-[9px] font-bold text-white leading-none", children: unreadNotificationsCount > 9 ? "9+" : unreadNotificationsCount }) })
|
|
2978
|
+
]
|
|
2979
|
+
}
|
|
2980
|
+
)
|
|
2981
|
+
] })
|
|
2982
|
+
] }),
|
|
2983
|
+
showSearch && /* @__PURE__ */ jsx29(View24, { className: "px-5 py-2 border-b border-neutral-100 dark:border-neutral-800/60 bg-neutral-50/50 dark:bg-neutral-900/50", children: /* @__PURE__ */ jsxs15(View24, { className: "flex-row items-center bg-white dark:bg-neutral-800 border border-neutral-200 dark:border-neutral-700 rounded-xl px-3 py-2", children: [
|
|
2984
|
+
/* @__PURE__ */ jsx29(Text2, { className: "text-neutral-400 mr-2 text-sm", children: "\u{1F50D}" }),
|
|
2985
|
+
/* @__PURE__ */ jsx29(
|
|
2986
|
+
TextInput4,
|
|
2987
|
+
{
|
|
2988
|
+
value: searchValue,
|
|
2989
|
+
onChangeText: onSearchChange,
|
|
2990
|
+
placeholder: searchPlaceholder,
|
|
2991
|
+
placeholderTextColor: "#9ca3af",
|
|
2992
|
+
className: "flex-1 text-sm text-neutral-900 dark:text-neutral-100 p-0"
|
|
2993
|
+
}
|
|
2994
|
+
)
|
|
2995
|
+
] }) }),
|
|
2996
|
+
scrollable ? /* @__PURE__ */ jsx29(
|
|
2997
|
+
ScrollView4,
|
|
2998
|
+
{
|
|
2999
|
+
className: cn("flex-1", contentClassName),
|
|
3000
|
+
contentContainerStyle: { paddingBottom: 32 },
|
|
3001
|
+
showsVerticalScrollIndicator: false,
|
|
3002
|
+
refreshControl: onRefresh ? /* @__PURE__ */ jsx29(RefreshControl, { refreshing, onRefresh }) : void 0,
|
|
3003
|
+
children
|
|
3004
|
+
}
|
|
3005
|
+
) : /* @__PURE__ */ jsx29(View24, { className: cn("flex-1", contentClassName), children }),
|
|
3006
|
+
footer
|
|
3007
|
+
]
|
|
3008
|
+
}
|
|
3009
|
+
);
|
|
3010
|
+
};
|
|
3011
|
+
DashboardLayout.displayName = "DashboardLayout";
|
|
3012
|
+
|
|
3013
|
+
// src/templates/auth/SignInTemplate.tsx
|
|
3014
|
+
import * as React27 from "react";
|
|
3015
|
+
import {
|
|
3016
|
+
View as View25,
|
|
3017
|
+
ScrollView as ScrollView5,
|
|
3018
|
+
KeyboardAvoidingView as KeyboardAvoidingView2,
|
|
3019
|
+
Platform as Platform2,
|
|
3020
|
+
Pressable as Pressable16
|
|
3021
|
+
} from "react-native";
|
|
3022
|
+
import { jsx as jsx30, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2479
3023
|
var SignInTemplate = ({
|
|
2480
3024
|
title = "Welcome Back",
|
|
2481
3025
|
subtitle = "Sign in to your Beyond account to continue",
|
|
@@ -2489,12 +3033,12 @@ var SignInTemplate = ({
|
|
|
2489
3033
|
error,
|
|
2490
3034
|
className
|
|
2491
3035
|
}) => {
|
|
2492
|
-
const [email, setEmail] =
|
|
2493
|
-
const [password, setPassword] =
|
|
2494
|
-
const [showPassword, setShowPassword] =
|
|
2495
|
-
const [rememberMe, setRememberMe] =
|
|
2496
|
-
const [emailError, setEmailError] =
|
|
2497
|
-
const [passwordError, setPasswordError] =
|
|
3036
|
+
const [email, setEmail] = React27.useState("");
|
|
3037
|
+
const [password, setPassword] = React27.useState("");
|
|
3038
|
+
const [showPassword, setShowPassword] = React27.useState(false);
|
|
3039
|
+
const [rememberMe, setRememberMe] = React27.useState(false);
|
|
3040
|
+
const [emailError, setEmailError] = React27.useState();
|
|
3041
|
+
const [passwordError, setPasswordError] = React27.useState();
|
|
2498
3042
|
const handleSubmit = () => {
|
|
2499
3043
|
let valid = true;
|
|
2500
3044
|
setEmailError(void 0);
|
|
@@ -2511,29 +3055,29 @@ var SignInTemplate = ({
|
|
|
2511
3055
|
onSubmit?.({ email, password, rememberMe });
|
|
2512
3056
|
}
|
|
2513
3057
|
};
|
|
2514
|
-
return /* @__PURE__ */
|
|
2515
|
-
|
|
3058
|
+
return /* @__PURE__ */ jsx30(
|
|
3059
|
+
KeyboardAvoidingView2,
|
|
2516
3060
|
{
|
|
2517
|
-
behavior:
|
|
3061
|
+
behavior: Platform2.OS === "ios" ? "padding" : "height",
|
|
2518
3062
|
style: { flex: 1 },
|
|
2519
3063
|
className: cn("flex-1 bg-neutral-50 dark:bg-neutral-950", className),
|
|
2520
|
-
children: /* @__PURE__ */
|
|
2521
|
-
|
|
3064
|
+
children: /* @__PURE__ */ jsx30(
|
|
3065
|
+
ScrollView5,
|
|
2522
3066
|
{
|
|
2523
3067
|
style: { flex: 1 },
|
|
2524
3068
|
contentContainerStyle: { flexGrow: 1, justifyContent: "center" },
|
|
2525
3069
|
className: "px-6 py-8",
|
|
2526
3070
|
keyboardShouldPersistTaps: "handled",
|
|
2527
3071
|
showsVerticalScrollIndicator: false,
|
|
2528
|
-
children: /* @__PURE__ */
|
|
2529
|
-
/* @__PURE__ */
|
|
2530
|
-
logo && /* @__PURE__ */
|
|
2531
|
-
/* @__PURE__ */
|
|
2532
|
-
/* @__PURE__ */
|
|
3072
|
+
children: /* @__PURE__ */ jsxs16(View25, { className: "w-full max-w-md mx-auto gap-6", children: [
|
|
3073
|
+
/* @__PURE__ */ jsxs16(View25, { className: "items-center gap-2", children: [
|
|
3074
|
+
logo && /* @__PURE__ */ jsx30(View25, { className: "mb-2", children: logo }),
|
|
3075
|
+
/* @__PURE__ */ jsx30(Heading, { level: 2, className: "text-3xl font-extrabold text-neutral-900 dark:text-neutral-50 text-center", children: title }),
|
|
3076
|
+
/* @__PURE__ */ jsx30(Text2, { className: "text-neutral-500 dark:text-neutral-400 text-center text-base", children: subtitle })
|
|
2533
3077
|
] }),
|
|
2534
|
-
error && /* @__PURE__ */
|
|
2535
|
-
/* @__PURE__ */
|
|
2536
|
-
/* @__PURE__ */
|
|
3078
|
+
error && /* @__PURE__ */ jsx30(Alert, { variant: "danger", children: /* @__PURE__ */ jsx30(AlertDescription, { children: error }) }),
|
|
3079
|
+
/* @__PURE__ */ jsxs16(View25, { className: "gap-4", children: [
|
|
3080
|
+
/* @__PURE__ */ jsx30(
|
|
2537
3081
|
Input,
|
|
2538
3082
|
{
|
|
2539
3083
|
label: "Email Address",
|
|
@@ -2549,7 +3093,7 @@ var SignInTemplate = ({
|
|
|
2549
3093
|
error: emailError
|
|
2550
3094
|
}
|
|
2551
3095
|
),
|
|
2552
|
-
/* @__PURE__ */
|
|
3096
|
+
/* @__PURE__ */ jsx30(View25, { className: "gap-1", children: /* @__PURE__ */ jsx30(
|
|
2553
3097
|
Input,
|
|
2554
3098
|
{
|
|
2555
3099
|
label: "Password",
|
|
@@ -2561,17 +3105,17 @@ var SignInTemplate = ({
|
|
|
2561
3105
|
if (passwordError) setPasswordError(void 0);
|
|
2562
3106
|
},
|
|
2563
3107
|
error: passwordError,
|
|
2564
|
-
rightElement: /* @__PURE__ */
|
|
3108
|
+
rightElement: /* @__PURE__ */ jsx30(Pressable16, { onPress: () => setShowPassword((p) => !p), className: "p-1", children: /* @__PURE__ */ jsx30(Text2, { className: "text-xs text-neutral-500 dark:text-neutral-400 font-semibold", children: showPassword ? "HIDE" : "SHOW" }) })
|
|
2565
3109
|
}
|
|
2566
3110
|
) }),
|
|
2567
|
-
/* @__PURE__ */
|
|
2568
|
-
/* @__PURE__ */
|
|
2569
|
-
/* @__PURE__ */
|
|
2570
|
-
/* @__PURE__ */
|
|
3111
|
+
/* @__PURE__ */ jsxs16(View25, { className: "flex-row items-center justify-between py-1", children: [
|
|
3112
|
+
/* @__PURE__ */ jsxs16(View25, { className: "flex-row items-center gap-2", children: [
|
|
3113
|
+
/* @__PURE__ */ jsx30(Checkbox, { checked: rememberMe, onCheckedChange: setRememberMe }),
|
|
3114
|
+
/* @__PURE__ */ jsx30(Text2, { className: "text-sm text-neutral-900 dark:text-neutral-100", children: "Remember me" })
|
|
2571
3115
|
] }),
|
|
2572
|
-
onForgotPassword && /* @__PURE__ */
|
|
3116
|
+
onForgotPassword && /* @__PURE__ */ jsx30(Pressable16, { onPress: onForgotPassword, children: /* @__PURE__ */ jsx30(Text2, { className: "text-sm font-semibold text-primary-600 dark:text-primary-400", children: "Forgot password?" }) })
|
|
2573
3117
|
] }),
|
|
2574
|
-
/* @__PURE__ */
|
|
3118
|
+
/* @__PURE__ */ jsx30(
|
|
2575
3119
|
Button,
|
|
2576
3120
|
{
|
|
2577
3121
|
variant: "primary",
|
|
@@ -2583,14 +3127,14 @@ var SignInTemplate = ({
|
|
|
2583
3127
|
}
|
|
2584
3128
|
)
|
|
2585
3129
|
] }),
|
|
2586
|
-
(onGooglePress || onApplePress) && /* @__PURE__ */
|
|
2587
|
-
/* @__PURE__ */
|
|
2588
|
-
/* @__PURE__ */
|
|
2589
|
-
/* @__PURE__ */
|
|
2590
|
-
/* @__PURE__ */
|
|
3130
|
+
(onGooglePress || onApplePress) && /* @__PURE__ */ jsxs16(View25, { className: "gap-4", children: [
|
|
3131
|
+
/* @__PURE__ */ jsxs16(View25, { className: "flex-row items-center gap-3", children: [
|
|
3132
|
+
/* @__PURE__ */ jsx30(Separator, { className: "flex-1" }),
|
|
3133
|
+
/* @__PURE__ */ jsx30(Text2, { className: "text-xs text-neutral-500 dark:text-neutral-400 uppercase", children: "or continue with" }),
|
|
3134
|
+
/* @__PURE__ */ jsx30(Separator, { className: "flex-1" })
|
|
2591
3135
|
] }),
|
|
2592
|
-
/* @__PURE__ */
|
|
2593
|
-
onGooglePress && /* @__PURE__ */
|
|
3136
|
+
/* @__PURE__ */ jsxs16(View25, { className: "flex-row gap-3", children: [
|
|
3137
|
+
onGooglePress && /* @__PURE__ */ jsx30(
|
|
2594
3138
|
Button,
|
|
2595
3139
|
{
|
|
2596
3140
|
variant: "outline",
|
|
@@ -2599,7 +3143,7 @@ var SignInTemplate = ({
|
|
|
2599
3143
|
children: "Google"
|
|
2600
3144
|
}
|
|
2601
3145
|
),
|
|
2602
|
-
onApplePress && /* @__PURE__ */
|
|
3146
|
+
onApplePress && /* @__PURE__ */ jsx30(
|
|
2603
3147
|
Button,
|
|
2604
3148
|
{
|
|
2605
3149
|
variant: "outline",
|
|
@@ -2610,9 +3154,9 @@ var SignInTemplate = ({
|
|
|
2610
3154
|
)
|
|
2611
3155
|
] })
|
|
2612
3156
|
] }),
|
|
2613
|
-
onSignUpPress && /* @__PURE__ */
|
|
2614
|
-
/* @__PURE__ */
|
|
2615
|
-
/* @__PURE__ */
|
|
3157
|
+
onSignUpPress && /* @__PURE__ */ jsxs16(View25, { className: "flex-row justify-center items-center gap-1.5 pt-2", children: [
|
|
3158
|
+
/* @__PURE__ */ jsx30(Text2, { className: "text-sm text-neutral-500 dark:text-neutral-400", children: "Don't have an account?" }),
|
|
3159
|
+
/* @__PURE__ */ jsx30(Pressable16, { onPress: onSignUpPress, children: /* @__PURE__ */ jsx30(Text2, { className: "text-sm font-bold text-primary-600 dark:text-primary-400", children: "Sign Up" }) })
|
|
2616
3160
|
] })
|
|
2617
3161
|
] })
|
|
2618
3162
|
}
|
|
@@ -2622,15 +3166,15 @@ var SignInTemplate = ({
|
|
|
2622
3166
|
};
|
|
2623
3167
|
|
|
2624
3168
|
// src/templates/auth/SignUpTemplate.tsx
|
|
2625
|
-
import * as
|
|
3169
|
+
import * as React28 from "react";
|
|
2626
3170
|
import {
|
|
2627
|
-
View as
|
|
2628
|
-
ScrollView as
|
|
2629
|
-
KeyboardAvoidingView as
|
|
2630
|
-
Platform as
|
|
2631
|
-
Pressable as
|
|
3171
|
+
View as View26,
|
|
3172
|
+
ScrollView as ScrollView6,
|
|
3173
|
+
KeyboardAvoidingView as KeyboardAvoidingView3,
|
|
3174
|
+
Platform as Platform3,
|
|
3175
|
+
Pressable as Pressable17
|
|
2632
3176
|
} from "react-native";
|
|
2633
|
-
import { jsx as
|
|
3177
|
+
import { jsx as jsx31, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2634
3178
|
var SignUpTemplate = ({
|
|
2635
3179
|
title = "Create Account",
|
|
2636
3180
|
subtitle = "Get started with your free Beyond account",
|
|
@@ -2643,14 +3187,14 @@ var SignUpTemplate = ({
|
|
|
2643
3187
|
error,
|
|
2644
3188
|
className
|
|
2645
3189
|
}) => {
|
|
2646
|
-
const [fullName, setFullName] =
|
|
2647
|
-
const [email, setEmail] =
|
|
2648
|
-
const [password, setPassword] =
|
|
2649
|
-
const [agreeToTerms, setAgreeToTerms] =
|
|
2650
|
-
const [nameError, setNameError] =
|
|
2651
|
-
const [emailError, setEmailError] =
|
|
2652
|
-
const [passwordError, setPasswordError] =
|
|
2653
|
-
const [termsError, setTermsError] =
|
|
3190
|
+
const [fullName, setFullName] = React28.useState("");
|
|
3191
|
+
const [email, setEmail] = React28.useState("");
|
|
3192
|
+
const [password, setPassword] = React28.useState("");
|
|
3193
|
+
const [agreeToTerms, setAgreeToTerms] = React28.useState(false);
|
|
3194
|
+
const [nameError, setNameError] = React28.useState();
|
|
3195
|
+
const [emailError, setEmailError] = React28.useState();
|
|
3196
|
+
const [passwordError, setPasswordError] = React28.useState();
|
|
3197
|
+
const [termsError, setTermsError] = React28.useState();
|
|
2654
3198
|
const handleSubmit = () => {
|
|
2655
3199
|
let valid = true;
|
|
2656
3200
|
setNameError(void 0);
|
|
@@ -2677,29 +3221,29 @@ var SignUpTemplate = ({
|
|
|
2677
3221
|
onSubmit?.({ fullName, email, password, agreeToTerms });
|
|
2678
3222
|
}
|
|
2679
3223
|
};
|
|
2680
|
-
return /* @__PURE__ */
|
|
2681
|
-
|
|
3224
|
+
return /* @__PURE__ */ jsx31(
|
|
3225
|
+
KeyboardAvoidingView3,
|
|
2682
3226
|
{
|
|
2683
|
-
behavior:
|
|
3227
|
+
behavior: Platform3.OS === "ios" ? "padding" : "height",
|
|
2684
3228
|
style: { flex: 1 },
|
|
2685
3229
|
className: cn("flex-1 bg-neutral-50 dark:bg-neutral-950", className),
|
|
2686
|
-
children: /* @__PURE__ */
|
|
2687
|
-
|
|
3230
|
+
children: /* @__PURE__ */ jsx31(
|
|
3231
|
+
ScrollView6,
|
|
2688
3232
|
{
|
|
2689
3233
|
style: { flex: 1 },
|
|
2690
3234
|
contentContainerStyle: { flexGrow: 1, justifyContent: "center" },
|
|
2691
3235
|
className: "px-6 py-8",
|
|
2692
3236
|
keyboardShouldPersistTaps: "handled",
|
|
2693
3237
|
showsVerticalScrollIndicator: false,
|
|
2694
|
-
children: /* @__PURE__ */
|
|
2695
|
-
/* @__PURE__ */
|
|
2696
|
-
logo && /* @__PURE__ */
|
|
2697
|
-
/* @__PURE__ */
|
|
2698
|
-
/* @__PURE__ */
|
|
3238
|
+
children: /* @__PURE__ */ jsxs17(View26, { className: "w-full max-w-md mx-auto gap-6", children: [
|
|
3239
|
+
/* @__PURE__ */ jsxs17(View26, { className: "items-center gap-2", children: [
|
|
3240
|
+
logo && /* @__PURE__ */ jsx31(View26, { className: "mb-2", children: logo }),
|
|
3241
|
+
/* @__PURE__ */ jsx31(Heading, { level: 2, className: "text-3xl font-extrabold text-neutral-900 dark:text-neutral-50 text-center", children: title }),
|
|
3242
|
+
/* @__PURE__ */ jsx31(Text2, { className: "text-neutral-500 dark:text-neutral-400 text-center text-base", children: subtitle })
|
|
2699
3243
|
] }),
|
|
2700
|
-
error && /* @__PURE__ */
|
|
2701
|
-
/* @__PURE__ */
|
|
2702
|
-
/* @__PURE__ */
|
|
3244
|
+
error && /* @__PURE__ */ jsx31(Alert, { variant: "danger", children: /* @__PURE__ */ jsx31(AlertDescription, { children: error }) }),
|
|
3245
|
+
/* @__PURE__ */ jsxs17(View26, { className: "gap-4", children: [
|
|
3246
|
+
/* @__PURE__ */ jsx31(
|
|
2703
3247
|
Input,
|
|
2704
3248
|
{
|
|
2705
3249
|
label: "Full Name",
|
|
@@ -2712,7 +3256,7 @@ var SignUpTemplate = ({
|
|
|
2712
3256
|
error: nameError
|
|
2713
3257
|
}
|
|
2714
3258
|
),
|
|
2715
|
-
/* @__PURE__ */
|
|
3259
|
+
/* @__PURE__ */ jsx31(
|
|
2716
3260
|
Input,
|
|
2717
3261
|
{
|
|
2718
3262
|
label: "Email Address",
|
|
@@ -2727,7 +3271,7 @@ var SignUpTemplate = ({
|
|
|
2727
3271
|
error: emailError
|
|
2728
3272
|
}
|
|
2729
3273
|
),
|
|
2730
|
-
/* @__PURE__ */
|
|
3274
|
+
/* @__PURE__ */ jsx31(
|
|
2731
3275
|
Input,
|
|
2732
3276
|
{
|
|
2733
3277
|
label: "Password",
|
|
@@ -2741,9 +3285,9 @@ var SignUpTemplate = ({
|
|
|
2741
3285
|
error: passwordError
|
|
2742
3286
|
}
|
|
2743
3287
|
),
|
|
2744
|
-
/* @__PURE__ */
|
|
2745
|
-
/* @__PURE__ */
|
|
2746
|
-
/* @__PURE__ */
|
|
3288
|
+
/* @__PURE__ */ jsxs17(View26, { className: "gap-1", children: [
|
|
3289
|
+
/* @__PURE__ */ jsxs17(View26, { className: "flex-row items-center gap-2 pt-1", children: [
|
|
3290
|
+
/* @__PURE__ */ jsx31(
|
|
2747
3291
|
Checkbox,
|
|
2748
3292
|
{
|
|
2749
3293
|
checked: agreeToTerms,
|
|
@@ -2753,11 +3297,11 @@ var SignUpTemplate = ({
|
|
|
2753
3297
|
}
|
|
2754
3298
|
}
|
|
2755
3299
|
),
|
|
2756
|
-
/* @__PURE__ */
|
|
3300
|
+
/* @__PURE__ */ jsx31(Text2, { className: "text-sm text-neutral-900 dark:text-neutral-100 flex-1", children: "I agree to the Terms of Service & Privacy Policy" })
|
|
2757
3301
|
] }),
|
|
2758
|
-
termsError && /* @__PURE__ */
|
|
3302
|
+
termsError && /* @__PURE__ */ jsx31(Text2, { className: "text-xs text-danger font-medium", children: termsError })
|
|
2759
3303
|
] }),
|
|
2760
|
-
/* @__PURE__ */
|
|
3304
|
+
/* @__PURE__ */ jsx31(
|
|
2761
3305
|
Button,
|
|
2762
3306
|
{
|
|
2763
3307
|
variant: "primary",
|
|
@@ -2769,14 +3313,14 @@ var SignUpTemplate = ({
|
|
|
2769
3313
|
}
|
|
2770
3314
|
)
|
|
2771
3315
|
] }),
|
|
2772
|
-
(onGooglePress || onApplePress) && /* @__PURE__ */
|
|
2773
|
-
/* @__PURE__ */
|
|
2774
|
-
/* @__PURE__ */
|
|
2775
|
-
/* @__PURE__ */
|
|
2776
|
-
/* @__PURE__ */
|
|
3316
|
+
(onGooglePress || onApplePress) && /* @__PURE__ */ jsxs17(View26, { className: "gap-4", children: [
|
|
3317
|
+
/* @__PURE__ */ jsxs17(View26, { className: "flex-row items-center gap-3", children: [
|
|
3318
|
+
/* @__PURE__ */ jsx31(Separator, { className: "flex-1" }),
|
|
3319
|
+
/* @__PURE__ */ jsx31(Text2, { className: "text-xs text-neutral-500 dark:text-neutral-400 uppercase", children: "or continue with" }),
|
|
3320
|
+
/* @__PURE__ */ jsx31(Separator, { className: "flex-1" })
|
|
2777
3321
|
] }),
|
|
2778
|
-
/* @__PURE__ */
|
|
2779
|
-
onGooglePress && /* @__PURE__ */
|
|
3322
|
+
/* @__PURE__ */ jsxs17(View26, { className: "flex-row gap-3", children: [
|
|
3323
|
+
onGooglePress && /* @__PURE__ */ jsx31(
|
|
2780
3324
|
Button,
|
|
2781
3325
|
{
|
|
2782
3326
|
variant: "outline",
|
|
@@ -2785,7 +3329,7 @@ var SignUpTemplate = ({
|
|
|
2785
3329
|
children: "Google"
|
|
2786
3330
|
}
|
|
2787
3331
|
),
|
|
2788
|
-
onApplePress && /* @__PURE__ */
|
|
3332
|
+
onApplePress && /* @__PURE__ */ jsx31(
|
|
2789
3333
|
Button,
|
|
2790
3334
|
{
|
|
2791
3335
|
variant: "outline",
|
|
@@ -2796,9 +3340,9 @@ var SignUpTemplate = ({
|
|
|
2796
3340
|
)
|
|
2797
3341
|
] })
|
|
2798
3342
|
] }),
|
|
2799
|
-
onSignInPress && /* @__PURE__ */
|
|
2800
|
-
/* @__PURE__ */
|
|
2801
|
-
/* @__PURE__ */
|
|
3343
|
+
onSignInPress && /* @__PURE__ */ jsxs17(View26, { className: "flex-row justify-center items-center gap-1.5 pt-2", children: [
|
|
3344
|
+
/* @__PURE__ */ jsx31(Text2, { className: "text-sm text-neutral-500 dark:text-neutral-400", children: "Already have an account?" }),
|
|
3345
|
+
/* @__PURE__ */ jsx31(Pressable17, { onPress: onSignInPress, children: /* @__PURE__ */ jsx31(Text2, { className: "text-sm font-bold text-primary-600 dark:text-primary-400", children: "Sign In" }) })
|
|
2802
3346
|
] })
|
|
2803
3347
|
] })
|
|
2804
3348
|
}
|
|
@@ -2808,15 +3352,15 @@ var SignUpTemplate = ({
|
|
|
2808
3352
|
};
|
|
2809
3353
|
|
|
2810
3354
|
// src/templates/auth/ForgotPasswordTemplate.tsx
|
|
2811
|
-
import * as
|
|
3355
|
+
import * as React29 from "react";
|
|
2812
3356
|
import {
|
|
2813
|
-
View as
|
|
2814
|
-
ScrollView as
|
|
2815
|
-
KeyboardAvoidingView as
|
|
2816
|
-
Platform as
|
|
2817
|
-
Pressable as
|
|
3357
|
+
View as View27,
|
|
3358
|
+
ScrollView as ScrollView7,
|
|
3359
|
+
KeyboardAvoidingView as KeyboardAvoidingView4,
|
|
3360
|
+
Platform as Platform4,
|
|
3361
|
+
Pressable as Pressable18
|
|
2818
3362
|
} from "react-native";
|
|
2819
|
-
import { jsx as
|
|
3363
|
+
import { jsx as jsx32, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2820
3364
|
var ForgotPasswordTemplate = ({
|
|
2821
3365
|
title = "Reset Password",
|
|
2822
3366
|
subtitle = "Enter your email address and we'll send you recovery instructions",
|
|
@@ -2827,8 +3371,8 @@ var ForgotPasswordTemplate = ({
|
|
|
2827
3371
|
error,
|
|
2828
3372
|
className
|
|
2829
3373
|
}) => {
|
|
2830
|
-
const [email, setEmail] =
|
|
2831
|
-
const [emailError, setEmailError] =
|
|
3374
|
+
const [email, setEmail] = React29.useState("");
|
|
3375
|
+
const [emailError, setEmailError] = React29.useState();
|
|
2832
3376
|
const handleSubmit = () => {
|
|
2833
3377
|
if (!email || !email.includes("@")) {
|
|
2834
3378
|
setEmailError("Please enter a valid email address");
|
|
@@ -2837,31 +3381,31 @@ var ForgotPasswordTemplate = ({
|
|
|
2837
3381
|
setEmailError(void 0);
|
|
2838
3382
|
onSubmit?.({ email });
|
|
2839
3383
|
};
|
|
2840
|
-
return /* @__PURE__ */
|
|
2841
|
-
|
|
3384
|
+
return /* @__PURE__ */ jsx32(
|
|
3385
|
+
KeyboardAvoidingView4,
|
|
2842
3386
|
{
|
|
2843
|
-
behavior:
|
|
3387
|
+
behavior: Platform4.OS === "ios" ? "padding" : "height",
|
|
2844
3388
|
style: { flex: 1 },
|
|
2845
3389
|
className: cn("flex-1 bg-neutral-50 dark:bg-neutral-950", className),
|
|
2846
|
-
children: /* @__PURE__ */
|
|
2847
|
-
|
|
3390
|
+
children: /* @__PURE__ */ jsx32(
|
|
3391
|
+
ScrollView7,
|
|
2848
3392
|
{
|
|
2849
3393
|
style: { flex: 1 },
|
|
2850
3394
|
contentContainerStyle: { flexGrow: 1, justifyContent: "center" },
|
|
2851
3395
|
className: "px-6 py-8",
|
|
2852
3396
|
keyboardShouldPersistTaps: "handled",
|
|
2853
3397
|
showsVerticalScrollIndicator: false,
|
|
2854
|
-
children: /* @__PURE__ */
|
|
2855
|
-
/* @__PURE__ */
|
|
2856
|
-
/* @__PURE__ */
|
|
2857
|
-
/* @__PURE__ */
|
|
3398
|
+
children: /* @__PURE__ */ jsxs18(View27, { className: "w-full max-w-md mx-auto gap-6", children: [
|
|
3399
|
+
/* @__PURE__ */ jsxs18(View27, { className: "items-center gap-2", children: [
|
|
3400
|
+
/* @__PURE__ */ jsx32(Heading, { level: 2, className: "text-3xl font-extrabold text-neutral-900 dark:text-neutral-50 text-center", children: title }),
|
|
3401
|
+
/* @__PURE__ */ jsx32(Text2, { className: "text-neutral-500 dark:text-neutral-400 text-center text-base", children: subtitle })
|
|
2858
3402
|
] }),
|
|
2859
|
-
error && /* @__PURE__ */
|
|
2860
|
-
isSuccess ? /* @__PURE__ */
|
|
2861
|
-
/* @__PURE__ */
|
|
2862
|
-
onBackToSignIn && /* @__PURE__ */
|
|
2863
|
-
] }) : /* @__PURE__ */
|
|
2864
|
-
/* @__PURE__ */
|
|
3403
|
+
error && /* @__PURE__ */ jsx32(Alert, { variant: "danger", children: /* @__PURE__ */ jsx32(AlertDescription, { children: error }) }),
|
|
3404
|
+
isSuccess ? /* @__PURE__ */ jsxs18(View27, { className: "gap-4", children: [
|
|
3405
|
+
/* @__PURE__ */ jsx32(Alert, { variant: "success", children: /* @__PURE__ */ jsx32(AlertDescription, { children: "Password reset link sent! Check your email inbox." }) }),
|
|
3406
|
+
onBackToSignIn && /* @__PURE__ */ jsx32(Button, { variant: "primary", size: "lg", onPress: onBackToSignIn, children: "Back to Sign In" })
|
|
3407
|
+
] }) : /* @__PURE__ */ jsxs18(View27, { className: "gap-4", children: [
|
|
3408
|
+
/* @__PURE__ */ jsx32(
|
|
2865
3409
|
Input,
|
|
2866
3410
|
{
|
|
2867
3411
|
label: "Email Address",
|
|
@@ -2876,7 +3420,7 @@ var ForgotPasswordTemplate = ({
|
|
|
2876
3420
|
error: emailError
|
|
2877
3421
|
}
|
|
2878
3422
|
),
|
|
2879
|
-
/* @__PURE__ */
|
|
3423
|
+
/* @__PURE__ */ jsx32(
|
|
2880
3424
|
Button,
|
|
2881
3425
|
{
|
|
2882
3426
|
variant: "primary",
|
|
@@ -2887,7 +3431,7 @@ var ForgotPasswordTemplate = ({
|
|
|
2887
3431
|
children: "Send Reset Link"
|
|
2888
3432
|
}
|
|
2889
3433
|
),
|
|
2890
|
-
onBackToSignIn && /* @__PURE__ */
|
|
3434
|
+
onBackToSignIn && /* @__PURE__ */ jsx32(View27, { className: "flex-row justify-center items-center gap-1.5 pt-2", children: /* @__PURE__ */ jsx32(Pressable18, { onPress: onBackToSignIn, children: /* @__PURE__ */ jsx32(Text2, { className: "text-sm font-semibold text-primary-600 dark:text-primary-400", children: "Back to Sign In" }) }) })
|
|
2891
3435
|
] })
|
|
2892
3436
|
] })
|
|
2893
3437
|
}
|
|
@@ -2898,11 +3442,11 @@ var ForgotPasswordTemplate = ({
|
|
|
2898
3442
|
|
|
2899
3443
|
// src/templates/dashboard/DashboardTemplate.tsx
|
|
2900
3444
|
import {
|
|
2901
|
-
View as
|
|
2902
|
-
ScrollView as
|
|
2903
|
-
Pressable as
|
|
3445
|
+
View as View28,
|
|
3446
|
+
ScrollView as ScrollView8,
|
|
3447
|
+
Pressable as Pressable19
|
|
2904
3448
|
} from "react-native";
|
|
2905
|
-
import { jsx as
|
|
3449
|
+
import { jsx as jsx33, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2906
3450
|
var DashboardTemplate = ({
|
|
2907
3451
|
userName,
|
|
2908
3452
|
userRole = "Administrator",
|
|
@@ -2916,8 +3460,8 @@ var DashboardTemplate = ({
|
|
|
2916
3460
|
className,
|
|
2917
3461
|
...props
|
|
2918
3462
|
}) => {
|
|
2919
|
-
return /* @__PURE__ */
|
|
2920
|
-
|
|
3463
|
+
return /* @__PURE__ */ jsxs19(
|
|
3464
|
+
ScrollView8,
|
|
2921
3465
|
{
|
|
2922
3466
|
...props,
|
|
2923
3467
|
style: [{ flex: 1 }, props.style],
|
|
@@ -2925,43 +3469,43 @@ var DashboardTemplate = ({
|
|
|
2925
3469
|
contentContainerStyle: { paddingBottom: 40 },
|
|
2926
3470
|
showsVerticalScrollIndicator: false,
|
|
2927
3471
|
children: [
|
|
2928
|
-
/* @__PURE__ */
|
|
2929
|
-
/* @__PURE__ */
|
|
2930
|
-
/* @__PURE__ */
|
|
2931
|
-
userAvatarUrl && /* @__PURE__ */
|
|
2932
|
-
/* @__PURE__ */
|
|
3472
|
+
/* @__PURE__ */ jsxs19(View28, { className: "px-6 pt-6 pb-4 flex-row items-center justify-between border-b border-neutral-200 dark:border-neutral-800", children: [
|
|
3473
|
+
/* @__PURE__ */ jsxs19(View28, { className: "flex-row items-center gap-3", children: [
|
|
3474
|
+
/* @__PURE__ */ jsxs19(Avatar, { size: "lg", children: [
|
|
3475
|
+
userAvatarUrl && /* @__PURE__ */ jsx33(AvatarImage, { source: { uri: userAvatarUrl } }),
|
|
3476
|
+
/* @__PURE__ */ jsx33(AvatarFallback, { text: userName.slice(0, 2).toUpperCase() })
|
|
2933
3477
|
] }),
|
|
2934
|
-
/* @__PURE__ */
|
|
2935
|
-
/* @__PURE__ */
|
|
2936
|
-
/* @__PURE__ */
|
|
3478
|
+
/* @__PURE__ */ jsxs19(View28, { children: [
|
|
3479
|
+
/* @__PURE__ */ jsx33(Text2, { className: "text-xs text-neutral-500 dark:text-neutral-400 font-medium uppercase tracking-wider", children: userRole }),
|
|
3480
|
+
/* @__PURE__ */ jsxs19(Heading, { level: 3, className: "text-xl font-bold text-neutral-900 dark:text-neutral-50", children: [
|
|
2937
3481
|
"Hello, ",
|
|
2938
3482
|
userName,
|
|
2939
3483
|
" \u{1F44B}"
|
|
2940
3484
|
] })
|
|
2941
3485
|
] })
|
|
2942
3486
|
] }),
|
|
2943
|
-
onNotificationPress && /* @__PURE__ */
|
|
2944
|
-
|
|
3487
|
+
onNotificationPress && /* @__PURE__ */ jsxs19(
|
|
3488
|
+
Pressable19,
|
|
2945
3489
|
{
|
|
2946
3490
|
onPress: onNotificationPress,
|
|
2947
3491
|
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",
|
|
2948
3492
|
children: [
|
|
2949
|
-
/* @__PURE__ */
|
|
2950
|
-
unreadNotificationsCount > 0 && /* @__PURE__ */
|
|
3493
|
+
/* @__PURE__ */ jsx33(Text2, { className: "text-base text-neutral-900 dark:text-neutral-100", children: "\u{1F514}" }),
|
|
3494
|
+
unreadNotificationsCount > 0 && /* @__PURE__ */ jsx33(View28, { className: "absolute -top-1 -right-1 w-5 h-5 rounded-full bg-danger items-center justify-center", children: /* @__PURE__ */ jsx33(Text2, { className: "text-[10px] font-bold text-white", children: unreadNotificationsCount > 9 ? "9+" : unreadNotificationsCount }) })
|
|
2951
3495
|
]
|
|
2952
3496
|
}
|
|
2953
3497
|
)
|
|
2954
3498
|
] }),
|
|
2955
|
-
/* @__PURE__ */
|
|
2956
|
-
quickActions && quickActions.length > 0 && /* @__PURE__ */
|
|
2957
|
-
/* @__PURE__ */
|
|
2958
|
-
/* @__PURE__ */
|
|
2959
|
-
|
|
3499
|
+
/* @__PURE__ */ jsxs19(View28, { className: "px-6 pt-6 gap-6", children: [
|
|
3500
|
+
quickActions && quickActions.length > 0 && /* @__PURE__ */ jsxs19(View28, { className: "gap-2", children: [
|
|
3501
|
+
/* @__PURE__ */ jsx33(Text2, { className: "text-xs font-bold text-neutral-500 dark:text-neutral-400 uppercase tracking-wider", children: "Quick Actions" }),
|
|
3502
|
+
/* @__PURE__ */ jsx33(
|
|
3503
|
+
ScrollView8,
|
|
2960
3504
|
{
|
|
2961
3505
|
horizontal: true,
|
|
2962
3506
|
showsHorizontalScrollIndicator: false,
|
|
2963
3507
|
className: "-mx-6 px-6",
|
|
2964
|
-
children: /* @__PURE__ */
|
|
3508
|
+
children: /* @__PURE__ */ jsx33(View28, { className: "flex-row gap-3", children: quickActions.map((action) => /* @__PURE__ */ jsx33(
|
|
2965
3509
|
Button,
|
|
2966
3510
|
{
|
|
2967
3511
|
variant: "outline",
|
|
@@ -2974,42 +3518,42 @@ var DashboardTemplate = ({
|
|
|
2974
3518
|
}
|
|
2975
3519
|
)
|
|
2976
3520
|
] }),
|
|
2977
|
-
/* @__PURE__ */
|
|
2978
|
-
/* @__PURE__ */
|
|
2979
|
-
/* @__PURE__ */
|
|
3521
|
+
/* @__PURE__ */ jsxs19(View28, { className: "gap-3", children: [
|
|
3522
|
+
/* @__PURE__ */ jsx33(Text2, { className: "text-xs font-bold text-neutral-500 dark:text-neutral-400 uppercase tracking-wider", children: "Overview Performance" }),
|
|
3523
|
+
/* @__PURE__ */ jsx33(View28, { className: "gap-3", children: metrics.map((metric) => /* @__PURE__ */ jsx33(StatsCard, { ...metric }, metric.id)) })
|
|
2980
3524
|
] }),
|
|
2981
|
-
recentActivities && recentActivities.length > 0 && /* @__PURE__ */
|
|
2982
|
-
/* @__PURE__ */
|
|
2983
|
-
/* @__PURE__ */
|
|
2984
|
-
onViewAllActivities && /* @__PURE__ */
|
|
3525
|
+
recentActivities && recentActivities.length > 0 && /* @__PURE__ */ jsxs19(Card, { className: "gap-2", children: [
|
|
3526
|
+
/* @__PURE__ */ jsxs19(CardHeader, { className: "flex-row items-center justify-between pb-2", children: [
|
|
3527
|
+
/* @__PURE__ */ jsx33(CardTitle, { className: "text-base font-bold", children: "Recent Activity" }),
|
|
3528
|
+
onViewAllActivities && /* @__PURE__ */ jsx33(Pressable19, { onPress: onViewAllActivities, children: /* @__PURE__ */ jsx33(Text2, { className: "text-xs font-semibold text-primary-600 dark:text-primary-400", children: "View all" }) })
|
|
2985
3529
|
] }),
|
|
2986
|
-
/* @__PURE__ */
|
|
2987
|
-
|
|
3530
|
+
/* @__PURE__ */ jsx33(CardContent, { className: "gap-3 pt-0", children: recentActivities.map((act) => /* @__PURE__ */ jsxs19(
|
|
3531
|
+
View28,
|
|
2988
3532
|
{
|
|
2989
3533
|
className: "flex-row items-center justify-between py-2 border-b border-neutral-200 dark:border-neutral-800 last:border-b-0",
|
|
2990
3534
|
children: [
|
|
2991
|
-
/* @__PURE__ */
|
|
2992
|
-
/* @__PURE__ */
|
|
2993
|
-
act.avatarUrl && /* @__PURE__ */
|
|
2994
|
-
/* @__PURE__ */
|
|
3535
|
+
/* @__PURE__ */ jsxs19(View28, { className: "flex-row items-center gap-3 flex-1 pr-2", children: [
|
|
3536
|
+
/* @__PURE__ */ jsxs19(Avatar, { size: "sm", children: [
|
|
3537
|
+
act.avatarUrl && /* @__PURE__ */ jsx33(AvatarImage, { source: { uri: act.avatarUrl } }),
|
|
3538
|
+
/* @__PURE__ */ jsx33(
|
|
2995
3539
|
AvatarFallback,
|
|
2996
3540
|
{
|
|
2997
3541
|
text: act.avatarInitials || act.title.slice(0, 2).toUpperCase()
|
|
2998
3542
|
}
|
|
2999
3543
|
)
|
|
3000
3544
|
] }),
|
|
3001
|
-
/* @__PURE__ */
|
|
3002
|
-
/* @__PURE__ */
|
|
3003
|
-
/* @__PURE__ */
|
|
3545
|
+
/* @__PURE__ */ jsxs19(View28, { className: "flex-1", children: [
|
|
3546
|
+
/* @__PURE__ */ jsx33(Text2, { className: "text-sm font-semibold text-neutral-900 dark:text-neutral-100", numberOfLines: 1, children: act.title }),
|
|
3547
|
+
/* @__PURE__ */ jsxs19(Text2, { className: "text-xs text-neutral-500 dark:text-neutral-400", numberOfLines: 1, children: [
|
|
3004
3548
|
act.subtitle,
|
|
3005
3549
|
" \u2022 ",
|
|
3006
3550
|
act.timestamp
|
|
3007
3551
|
] })
|
|
3008
3552
|
] })
|
|
3009
3553
|
] }),
|
|
3010
|
-
/* @__PURE__ */
|
|
3011
|
-
act.amount && /* @__PURE__ */
|
|
3012
|
-
act.status && /* @__PURE__ */
|
|
3554
|
+
/* @__PURE__ */ jsxs19(View28, { className: "items-end gap-1", children: [
|
|
3555
|
+
act.amount && /* @__PURE__ */ jsx33(Text2, { className: "text-sm font-bold text-neutral-900 dark:text-neutral-100", children: act.amount }),
|
|
3556
|
+
act.status && /* @__PURE__ */ jsx33(Badge, { variant: act.status.variant, size: "sm", children: act.status.label })
|
|
3013
3557
|
] })
|
|
3014
3558
|
]
|
|
3015
3559
|
},
|
|
@@ -3024,11 +3568,11 @@ var DashboardTemplate = ({
|
|
|
3024
3568
|
|
|
3025
3569
|
// src/templates/settings/SettingsTemplate.tsx
|
|
3026
3570
|
import {
|
|
3027
|
-
View as
|
|
3028
|
-
ScrollView as
|
|
3029
|
-
Pressable as
|
|
3571
|
+
View as View29,
|
|
3572
|
+
ScrollView as ScrollView9,
|
|
3573
|
+
Pressable as Pressable20
|
|
3030
3574
|
} from "react-native";
|
|
3031
|
-
import { jsx as
|
|
3575
|
+
import { jsx as jsx34, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3032
3576
|
var SettingsTemplate = ({
|
|
3033
3577
|
user,
|
|
3034
3578
|
pushNotifications = true,
|
|
@@ -3048,39 +3592,39 @@ var SettingsTemplate = ({
|
|
|
3048
3592
|
className,
|
|
3049
3593
|
...props
|
|
3050
3594
|
}) => {
|
|
3051
|
-
return /* @__PURE__ */
|
|
3052
|
-
|
|
3595
|
+
return /* @__PURE__ */ jsx34(
|
|
3596
|
+
ScrollView9,
|
|
3053
3597
|
{
|
|
3054
3598
|
...props,
|
|
3055
3599
|
style: [{ flex: 1 }, props.style],
|
|
3056
3600
|
className: cn("flex-1 bg-neutral-50 dark:bg-neutral-950", className),
|
|
3057
3601
|
contentContainerStyle: { paddingBottom: 40 },
|
|
3058
3602
|
showsVerticalScrollIndicator: false,
|
|
3059
|
-
children: /* @__PURE__ */
|
|
3060
|
-
/* @__PURE__ */
|
|
3061
|
-
/* @__PURE__ */
|
|
3062
|
-
/* @__PURE__ */
|
|
3063
|
-
user.avatarUrl && /* @__PURE__ */
|
|
3064
|
-
/* @__PURE__ */
|
|
3603
|
+
children: /* @__PURE__ */ jsxs20(View29, { className: "px-6 pt-6 gap-6", children: [
|
|
3604
|
+
/* @__PURE__ */ jsx34(Heading, { level: 2, className: "text-2xl font-bold text-neutral-900 dark:text-neutral-50", children: "Settings & Profile" }),
|
|
3605
|
+
/* @__PURE__ */ jsxs20(Card, { className: "p-4 flex-row items-center gap-4", children: [
|
|
3606
|
+
/* @__PURE__ */ jsxs20(Avatar, { size: "lg", children: [
|
|
3607
|
+
user.avatarUrl && /* @__PURE__ */ jsx34(AvatarImage, { source: { uri: user.avatarUrl } }),
|
|
3608
|
+
/* @__PURE__ */ jsx34(AvatarFallback, { text: user.name.slice(0, 2).toUpperCase() })
|
|
3065
3609
|
] }),
|
|
3066
|
-
/* @__PURE__ */
|
|
3067
|
-
/* @__PURE__ */
|
|
3068
|
-
/* @__PURE__ */
|
|
3069
|
-
user.plan && /* @__PURE__ */
|
|
3610
|
+
/* @__PURE__ */ jsxs20(View29, { className: "flex-1", children: [
|
|
3611
|
+
/* @__PURE__ */ jsxs20(View29, { className: "flex-row items-center gap-2", children: [
|
|
3612
|
+
/* @__PURE__ */ jsx34(Text2, { className: "text-base font-bold text-neutral-900 dark:text-neutral-100", children: user.name }),
|
|
3613
|
+
user.plan && /* @__PURE__ */ jsx34(Badge, { variant: "primary", size: "sm", children: user.plan })
|
|
3070
3614
|
] }),
|
|
3071
|
-
/* @__PURE__ */
|
|
3615
|
+
/* @__PURE__ */ jsx34(Text2, { className: "text-xs text-neutral-500 dark:text-neutral-400", children: user.email })
|
|
3072
3616
|
] }),
|
|
3073
|
-
onEditProfile && /* @__PURE__ */
|
|
3617
|
+
onEditProfile && /* @__PURE__ */ jsx34(Button, { variant: "outline", size: "sm", onPress: onEditProfile, children: "Edit" })
|
|
3074
3618
|
] }),
|
|
3075
|
-
/* @__PURE__ */
|
|
3076
|
-
/* @__PURE__ */
|
|
3077
|
-
/* @__PURE__ */
|
|
3078
|
-
/* @__PURE__ */
|
|
3079
|
-
/* @__PURE__ */
|
|
3080
|
-
/* @__PURE__ */
|
|
3081
|
-
/* @__PURE__ */
|
|
3619
|
+
/* @__PURE__ */ jsxs20(View29, { className: "gap-2", children: [
|
|
3620
|
+
/* @__PURE__ */ jsx34(Text2, { className: "text-xs font-bold text-neutral-500 dark:text-neutral-400 uppercase tracking-wider px-1", children: "Preferences" }),
|
|
3621
|
+
/* @__PURE__ */ jsxs20(Card, { className: "divide-y divide-neutral-200 dark:divide-neutral-800", children: [
|
|
3622
|
+
/* @__PURE__ */ jsxs20(View29, { className: "p-4 flex-row items-center justify-between", children: [
|
|
3623
|
+
/* @__PURE__ */ jsxs20(View29, { className: "pr-4 flex-1", children: [
|
|
3624
|
+
/* @__PURE__ */ jsx34(Text2, { className: "text-sm font-semibold text-neutral-900 dark:text-neutral-100", children: "Push Notifications" }),
|
|
3625
|
+
/* @__PURE__ */ jsx34(Text2, { className: "text-xs text-neutral-500 dark:text-neutral-400", children: "Receive real-time alerts on your mobile device" })
|
|
3082
3626
|
] }),
|
|
3083
|
-
/* @__PURE__ */
|
|
3627
|
+
/* @__PURE__ */ jsx34(
|
|
3084
3628
|
Switch,
|
|
3085
3629
|
{
|
|
3086
3630
|
checked: pushNotifications,
|
|
@@ -3088,12 +3632,12 @@ var SettingsTemplate = ({
|
|
|
3088
3632
|
}
|
|
3089
3633
|
)
|
|
3090
3634
|
] }),
|
|
3091
|
-
/* @__PURE__ */
|
|
3092
|
-
/* @__PURE__ */
|
|
3093
|
-
/* @__PURE__ */
|
|
3094
|
-
/* @__PURE__ */
|
|
3635
|
+
/* @__PURE__ */ jsxs20(View29, { className: "p-4 flex-row items-center justify-between", children: [
|
|
3636
|
+
/* @__PURE__ */ jsxs20(View29, { className: "pr-4 flex-1", children: [
|
|
3637
|
+
/* @__PURE__ */ jsx34(Text2, { className: "text-sm font-semibold text-neutral-900 dark:text-neutral-100", children: "Email Notifications" }),
|
|
3638
|
+
/* @__PURE__ */ jsx34(Text2, { className: "text-xs text-neutral-500 dark:text-neutral-400", children: "Weekly digests and activity summaries" })
|
|
3095
3639
|
] }),
|
|
3096
|
-
/* @__PURE__ */
|
|
3640
|
+
/* @__PURE__ */ jsx34(
|
|
3097
3641
|
Switch,
|
|
3098
3642
|
{
|
|
3099
3643
|
checked: emailNotifications,
|
|
@@ -3101,19 +3645,19 @@ var SettingsTemplate = ({
|
|
|
3101
3645
|
}
|
|
3102
3646
|
)
|
|
3103
3647
|
] }),
|
|
3104
|
-
/* @__PURE__ */
|
|
3105
|
-
/* @__PURE__ */
|
|
3106
|
-
/* @__PURE__ */
|
|
3107
|
-
/* @__PURE__ */
|
|
3648
|
+
/* @__PURE__ */ jsxs20(View29, { className: "p-4 flex-row items-center justify-between", children: [
|
|
3649
|
+
/* @__PURE__ */ jsxs20(View29, { className: "pr-4 flex-1", children: [
|
|
3650
|
+
/* @__PURE__ */ jsx34(Text2, { className: "text-sm font-semibold text-neutral-900 dark:text-neutral-100", children: "Dark Theme" }),
|
|
3651
|
+
/* @__PURE__ */ jsx34(Text2, { className: "text-xs text-neutral-500 dark:text-neutral-400", children: "Enable high contrast dark mode appearance" })
|
|
3108
3652
|
] }),
|
|
3109
|
-
/* @__PURE__ */
|
|
3653
|
+
/* @__PURE__ */ jsx34(Switch, { checked: isDarkMode, onCheckedChange: onToggleDarkMode })
|
|
3110
3654
|
] }),
|
|
3111
|
-
/* @__PURE__ */
|
|
3112
|
-
/* @__PURE__ */
|
|
3113
|
-
/* @__PURE__ */
|
|
3114
|
-
/* @__PURE__ */
|
|
3655
|
+
/* @__PURE__ */ jsxs20(View29, { className: "p-4 flex-row items-center justify-between", children: [
|
|
3656
|
+
/* @__PURE__ */ jsxs20(View29, { className: "pr-4 flex-1", children: [
|
|
3657
|
+
/* @__PURE__ */ jsx34(Text2, { className: "text-sm font-semibold text-neutral-900 dark:text-neutral-100", children: "Biometric Login" }),
|
|
3658
|
+
/* @__PURE__ */ jsx34(Text2, { className: "text-xs text-neutral-500 dark:text-neutral-400", children: "Use Face ID or fingerprint to authenticate" })
|
|
3115
3659
|
] }),
|
|
3116
|
-
/* @__PURE__ */
|
|
3660
|
+
/* @__PURE__ */ jsx34(
|
|
3117
3661
|
Switch,
|
|
3118
3662
|
{
|
|
3119
3663
|
checked: biometricsEnabled,
|
|
@@ -3123,47 +3667,47 @@ var SettingsTemplate = ({
|
|
|
3123
3667
|
] })
|
|
3124
3668
|
] })
|
|
3125
3669
|
] }),
|
|
3126
|
-
/* @__PURE__ */
|
|
3127
|
-
/* @__PURE__ */
|
|
3128
|
-
/* @__PURE__ */
|
|
3129
|
-
onChangePassword && /* @__PURE__ */
|
|
3130
|
-
|
|
3670
|
+
/* @__PURE__ */ jsxs20(View29, { className: "gap-2", children: [
|
|
3671
|
+
/* @__PURE__ */ jsx34(Text2, { className: "text-xs font-bold text-neutral-500 dark:text-neutral-400 uppercase tracking-wider px-1", children: "Account & Security" }),
|
|
3672
|
+
/* @__PURE__ */ jsxs20(Card, { className: "divide-y divide-neutral-200 dark:divide-neutral-800", children: [
|
|
3673
|
+
onChangePassword && /* @__PURE__ */ jsxs20(
|
|
3674
|
+
Pressable20,
|
|
3131
3675
|
{
|
|
3132
3676
|
onPress: onChangePassword,
|
|
3133
3677
|
className: "p-4 flex-row items-center justify-between active:bg-neutral-100 dark:active:bg-neutral-800",
|
|
3134
3678
|
children: [
|
|
3135
|
-
/* @__PURE__ */
|
|
3136
|
-
/* @__PURE__ */
|
|
3679
|
+
/* @__PURE__ */ jsx34(Text2, { className: "text-sm font-semibold text-neutral-900 dark:text-neutral-100", children: "Change Password" }),
|
|
3680
|
+
/* @__PURE__ */ jsx34(Text2, { className: "text-neutral-400 dark:text-neutral-500 text-xs", children: "\u203A" })
|
|
3137
3681
|
]
|
|
3138
3682
|
}
|
|
3139
3683
|
),
|
|
3140
|
-
onViewTerms && /* @__PURE__ */
|
|
3141
|
-
|
|
3684
|
+
onViewTerms && /* @__PURE__ */ jsxs20(
|
|
3685
|
+
Pressable20,
|
|
3142
3686
|
{
|
|
3143
3687
|
onPress: onViewTerms,
|
|
3144
3688
|
className: "p-4 flex-row items-center justify-between active:bg-neutral-100 dark:active:bg-neutral-800",
|
|
3145
3689
|
children: [
|
|
3146
|
-
/* @__PURE__ */
|
|
3147
|
-
/* @__PURE__ */
|
|
3690
|
+
/* @__PURE__ */ jsx34(Text2, { className: "text-sm font-semibold text-neutral-900 dark:text-neutral-100", children: "Terms of Service" }),
|
|
3691
|
+
/* @__PURE__ */ jsx34(Text2, { className: "text-neutral-400 dark:text-neutral-500 text-xs", children: "\u203A" })
|
|
3148
3692
|
]
|
|
3149
3693
|
}
|
|
3150
3694
|
),
|
|
3151
|
-
onViewPrivacy && /* @__PURE__ */
|
|
3152
|
-
|
|
3695
|
+
onViewPrivacy && /* @__PURE__ */ jsxs20(
|
|
3696
|
+
Pressable20,
|
|
3153
3697
|
{
|
|
3154
3698
|
onPress: onViewPrivacy,
|
|
3155
3699
|
className: "p-4 flex-row items-center justify-between active:bg-neutral-100 dark:active:bg-neutral-800",
|
|
3156
3700
|
children: [
|
|
3157
|
-
/* @__PURE__ */
|
|
3158
|
-
/* @__PURE__ */
|
|
3701
|
+
/* @__PURE__ */ jsx34(Text2, { className: "text-sm font-semibold text-neutral-900 dark:text-neutral-100", children: "Privacy Policy" }),
|
|
3702
|
+
/* @__PURE__ */ jsx34(Text2, { className: "text-neutral-400 dark:text-neutral-500 text-xs", children: "\u203A" })
|
|
3159
3703
|
]
|
|
3160
3704
|
}
|
|
3161
3705
|
)
|
|
3162
3706
|
] })
|
|
3163
3707
|
] }),
|
|
3164
|
-
/* @__PURE__ */
|
|
3165
|
-
onLogout && /* @__PURE__ */
|
|
3166
|
-
onDeleteAccount && /* @__PURE__ */
|
|
3708
|
+
/* @__PURE__ */ jsxs20(View29, { className: "gap-3 pt-2", children: [
|
|
3709
|
+
onLogout && /* @__PURE__ */ jsx34(Button, { variant: "outline", size: "lg", onPress: onLogout, children: "Log Out" }),
|
|
3710
|
+
onDeleteAccount && /* @__PURE__ */ jsx34(
|
|
3167
3711
|
Button,
|
|
3168
3712
|
{
|
|
3169
3713
|
variant: "destructive",
|
|
@@ -3177,97 +3721,6 @@ var SettingsTemplate = ({
|
|
|
3177
3721
|
}
|
|
3178
3722
|
);
|
|
3179
3723
|
};
|
|
3180
|
-
|
|
3181
|
-
// src/providers/BeyondUIProvider.tsx
|
|
3182
|
-
import * as React26 from "react";
|
|
3183
|
-
import { View as View27, useColorScheme as useRNColorScheme } from "react-native";
|
|
3184
|
-
import { colorScheme as nwColorScheme } from "nativewind";
|
|
3185
|
-
import { PortalHost } from "@rn-primitives/portal";
|
|
3186
|
-
import { jsx as jsx31, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3187
|
-
var BeyondUIContext = React26.createContext({
|
|
3188
|
-
colorScheme: "light",
|
|
3189
|
-
setColorScheme: () => {
|
|
3190
|
-
},
|
|
3191
|
-
toggleColorScheme: () => {
|
|
3192
|
-
}
|
|
3193
|
-
});
|
|
3194
|
-
function useBeyondUI() {
|
|
3195
|
-
return React26.useContext(BeyondUIContext);
|
|
3196
|
-
}
|
|
3197
|
-
function BeyondUIProvider({
|
|
3198
|
-
children,
|
|
3199
|
-
defaultColorScheme = "system"
|
|
3200
|
-
}) {
|
|
3201
|
-
const systemScheme = useRNColorScheme() ?? "light";
|
|
3202
|
-
const [selectedScheme, setSelectedScheme] = React26.useState(defaultColorScheme);
|
|
3203
|
-
const [toasts, setToasts] = React26.useState([]);
|
|
3204
|
-
const activeScheme = selectedScheme === "system" ? systemScheme : selectedScheme;
|
|
3205
|
-
React26.useEffect(() => {
|
|
3206
|
-
try {
|
|
3207
|
-
nwColorScheme.set(selectedScheme === "system" ? "system" : activeScheme);
|
|
3208
|
-
} catch (_) {
|
|
3209
|
-
}
|
|
3210
|
-
}, [selectedScheme, activeScheme]);
|
|
3211
|
-
const handleSetColorScheme = React26.useCallback((scheme) => {
|
|
3212
|
-
setSelectedScheme(scheme);
|
|
3213
|
-
try {
|
|
3214
|
-
nwColorScheme.set(scheme === "system" ? "system" : scheme);
|
|
3215
|
-
} catch (_) {
|
|
3216
|
-
}
|
|
3217
|
-
}, []);
|
|
3218
|
-
const toggleColorScheme = React26.useCallback(() => {
|
|
3219
|
-
setSelectedScheme((prev) => {
|
|
3220
|
-
const current = prev === "system" ? systemScheme : prev;
|
|
3221
|
-
const next = current === "dark" ? "light" : "dark";
|
|
3222
|
-
try {
|
|
3223
|
-
nwColorScheme.set(next);
|
|
3224
|
-
} catch (_) {
|
|
3225
|
-
}
|
|
3226
|
-
return next;
|
|
3227
|
-
});
|
|
3228
|
-
}, [systemScheme]);
|
|
3229
|
-
const dismissToast = React26.useCallback((id) => {
|
|
3230
|
-
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
3231
|
-
}, []);
|
|
3232
|
-
const showToast = React26.useCallback((toast) => {
|
|
3233
|
-
const id = Math.random().toString(36).substring(2, 9);
|
|
3234
|
-
setToasts((prev) => [...prev, { ...toast, id }]);
|
|
3235
|
-
return id;
|
|
3236
|
-
}, []);
|
|
3237
|
-
const toastContextValue = React26.useMemo(
|
|
3238
|
-
() => ({
|
|
3239
|
-
toasts,
|
|
3240
|
-
show: showToast,
|
|
3241
|
-
dismiss: dismissToast,
|
|
3242
|
-
success: (title, description) => showToast({ title, description, variant: "success" }),
|
|
3243
|
-
danger: (title, description) => showToast({ title, description, variant: "danger" }),
|
|
3244
|
-
error: (title, description) => showToast({ title, description, variant: "danger" }),
|
|
3245
|
-
warning: (title, description) => showToast({ title, description, variant: "warning" }),
|
|
3246
|
-
info: (title, description) => showToast({ title, description, variant: "info" })
|
|
3247
|
-
}),
|
|
3248
|
-
[toasts, showToast, dismissToast]
|
|
3249
|
-
);
|
|
3250
|
-
const contextValue = React26.useMemo(
|
|
3251
|
-
() => ({
|
|
3252
|
-
colorScheme: activeScheme,
|
|
3253
|
-
setColorScheme: handleSetColorScheme,
|
|
3254
|
-
toggleColorScheme
|
|
3255
|
-
}),
|
|
3256
|
-
[activeScheme, handleSetColorScheme, toggleColorScheme]
|
|
3257
|
-
);
|
|
3258
|
-
return /* @__PURE__ */ jsx31(BeyondUIContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx31(ToastContext.Provider, { value: toastContextValue, children: /* @__PURE__ */ jsxs18(
|
|
3259
|
-
View27,
|
|
3260
|
-
{
|
|
3261
|
-
style: { flex: 1 },
|
|
3262
|
-
className: activeScheme === "dark" ? "dark flex-1 bg-neutral-950" : "flex-1 bg-white",
|
|
3263
|
-
children: [
|
|
3264
|
-
children,
|
|
3265
|
-
/* @__PURE__ */ jsx31(PortalHost, {}),
|
|
3266
|
-
/* @__PURE__ */ jsx31(ToastContainer, { toasts, onDismiss: dismissToast })
|
|
3267
|
-
]
|
|
3268
|
-
}
|
|
3269
|
-
) }) });
|
|
3270
|
-
}
|
|
3271
3724
|
export {
|
|
3272
3725
|
Accordion,
|
|
3273
3726
|
AccordionContent,
|
|
@@ -3301,6 +3754,7 @@ export {
|
|
|
3301
3754
|
CardHeader,
|
|
3302
3755
|
CardTitle,
|
|
3303
3756
|
Checkbox,
|
|
3757
|
+
DashboardLayout,
|
|
3304
3758
|
DashboardTemplate,
|
|
3305
3759
|
DataTable,
|
|
3306
3760
|
Dialog,
|
|
@@ -3317,6 +3771,14 @@ export {
|
|
|
3317
3771
|
ForgotPasswordTemplate,
|
|
3318
3772
|
Heading,
|
|
3319
3773
|
Input,
|
|
3774
|
+
Modal4 as Modal,
|
|
3775
|
+
ModalContent,
|
|
3776
|
+
ModalContext,
|
|
3777
|
+
ModalDescription,
|
|
3778
|
+
ModalFooter,
|
|
3779
|
+
ModalHeader,
|
|
3780
|
+
ModalTitle,
|
|
3781
|
+
NightModeSwitch,
|
|
3320
3782
|
Pressable,
|
|
3321
3783
|
Radio,
|
|
3322
3784
|
RadioGroup,
|
|
@@ -3359,10 +3821,13 @@ export {
|
|
|
3359
3821
|
headingVariants,
|
|
3360
3822
|
inputVariants,
|
|
3361
3823
|
joinA11yLabels,
|
|
3824
|
+
modalVariants,
|
|
3825
|
+
nightModeSwitchVariants,
|
|
3362
3826
|
textVariants,
|
|
3363
3827
|
tokens,
|
|
3364
3828
|
useBeyondUI,
|
|
3365
3829
|
useDialogContext,
|
|
3830
|
+
useModalContext,
|
|
3366
3831
|
useTabsContext,
|
|
3367
3832
|
useToast
|
|
3368
3833
|
};
|