@exyconn/common 2.0.0 → 2.1.0
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/client/index.d.mts +2 -1
- package/dist/client/index.d.ts +2 -1
- package/dist/client/index.js +2693 -19
- package/dist/client/index.js.map +1 -1
- package/dist/client/index.mjs +2634 -21
- package/dist/client/index.mjs.map +1 -1
- package/dist/index-BcxL4_V4.d.ts +2946 -0
- package/dist/index-bvvCev9Q.d.mts +2946 -0
- package/dist/index.d.mts +14 -163
- package/dist/index.d.ts +14 -163
- package/dist/index.js +2701 -27
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2683 -28
- package/dist/index.mjs.map +1 -1
- package/package.json +33 -3
- package/dist/index-BLltj-zN.d.ts +0 -1236
- package/dist/index-CIUdLBjA.d.mts +0 -1236
package/dist/client/index.mjs
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
|
-
import { useState, useCallback, useMemo, useRef, useEffect } from 'react';
|
|
2
|
+
import { createContext, useState, useCallback, useMemo, useRef, useEffect, useContext } from 'react';
|
|
3
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
|
+
import * as Yup from 'yup';
|
|
5
|
+
import { Formik, Form, Field, ErrorMessage } from 'formik';
|
|
3
6
|
|
|
4
7
|
// src/client/http/axios-instance.ts
|
|
5
8
|
var createHttpClient = (options) => {
|
|
@@ -830,11 +833,11 @@ function useDefault(initialValue, defaultValue) {
|
|
|
830
833
|
}
|
|
831
834
|
var useDefault_default = useDefault;
|
|
832
835
|
function usePrevious(value, initialValue) {
|
|
833
|
-
const
|
|
836
|
+
const ref2 = useRef(initialValue);
|
|
834
837
|
useEffect(() => {
|
|
835
|
-
|
|
838
|
+
ref2.current = value;
|
|
836
839
|
}, [value]);
|
|
837
|
-
return
|
|
840
|
+
return ref2.current;
|
|
838
841
|
}
|
|
839
842
|
var usePrevious_default = usePrevious;
|
|
840
843
|
function useObjectState(initialState) {
|
|
@@ -1760,7 +1763,7 @@ function useKeyPress(targetKey, callback, options = {}) {
|
|
|
1760
1763
|
var useKeyPress_default = useKeyPress;
|
|
1761
1764
|
function useHover(onHoverChange) {
|
|
1762
1765
|
const [isHovered, setIsHovered] = useState(false);
|
|
1763
|
-
const
|
|
1766
|
+
const ref2 = useRef(null);
|
|
1764
1767
|
const onMouseEnter = useCallback(() => {
|
|
1765
1768
|
setIsHovered(true);
|
|
1766
1769
|
onHoverChange?.(true);
|
|
@@ -1770,7 +1773,7 @@ function useHover(onHoverChange) {
|
|
|
1770
1773
|
onHoverChange?.(false);
|
|
1771
1774
|
}, [onHoverChange]);
|
|
1772
1775
|
return {
|
|
1773
|
-
ref,
|
|
1776
|
+
ref: ref2,
|
|
1774
1777
|
isHovered,
|
|
1775
1778
|
bind: {
|
|
1776
1779
|
onMouseEnter,
|
|
@@ -1780,13 +1783,13 @@ function useHover(onHoverChange) {
|
|
|
1780
1783
|
}
|
|
1781
1784
|
var useHover_default = useHover;
|
|
1782
1785
|
function useClickAway(callback, events = ["mousedown", "touchstart"]) {
|
|
1783
|
-
const
|
|
1786
|
+
const ref2 = useRef(null);
|
|
1784
1787
|
const savedCallback = useRef(callback);
|
|
1785
1788
|
useEffect(() => {
|
|
1786
1789
|
savedCallback.current = callback;
|
|
1787
1790
|
}, [callback]);
|
|
1788
1791
|
const handleClickAway = useCallback((event) => {
|
|
1789
|
-
const el =
|
|
1792
|
+
const el = ref2.current;
|
|
1790
1793
|
if (!el || el.contains(event.target)) {
|
|
1791
1794
|
return;
|
|
1792
1795
|
}
|
|
@@ -1803,14 +1806,14 @@ function useClickAway(callback, events = ["mousedown", "touchstart"]) {
|
|
|
1803
1806
|
});
|
|
1804
1807
|
};
|
|
1805
1808
|
}, [events, handleClickAway]);
|
|
1806
|
-
return
|
|
1809
|
+
return ref2;
|
|
1807
1810
|
}
|
|
1808
1811
|
var useClickAway_default = useClickAway;
|
|
1809
|
-
function useOnClickOutside(
|
|
1812
|
+
function useOnClickOutside(ref2, handler, enabled = true) {
|
|
1810
1813
|
useEffect(() => {
|
|
1811
1814
|
if (!enabled) return;
|
|
1812
1815
|
const listener = (event) => {
|
|
1813
|
-
const el =
|
|
1816
|
+
const el = ref2?.current;
|
|
1814
1817
|
if (!el || el.contains(event.target)) {
|
|
1815
1818
|
return;
|
|
1816
1819
|
}
|
|
@@ -1822,7 +1825,7 @@ function useOnClickOutside(ref, handler, enabled = true) {
|
|
|
1822
1825
|
document.removeEventListener("mousedown", listener);
|
|
1823
1826
|
document.removeEventListener("touchstart", listener);
|
|
1824
1827
|
};
|
|
1825
|
-
}, [
|
|
1828
|
+
}, [ref2, handler, enabled]);
|
|
1826
1829
|
}
|
|
1827
1830
|
var useOnClickOutside_default = useOnClickOutside;
|
|
1828
1831
|
function useLongPress(options = {}) {
|
|
@@ -1895,7 +1898,7 @@ function useLongPress(options = {}) {
|
|
|
1895
1898
|
var useLongPress_default = useLongPress;
|
|
1896
1899
|
function useMouse(options = {}) {
|
|
1897
1900
|
const { enabled = true } = options;
|
|
1898
|
-
const
|
|
1901
|
+
const ref2 = useRef(null);
|
|
1899
1902
|
const [position, setPosition] = useState({
|
|
1900
1903
|
x: 0,
|
|
1901
1904
|
y: 0,
|
|
@@ -1909,8 +1912,8 @@ function useMouse(options = {}) {
|
|
|
1909
1912
|
let elementX = 0;
|
|
1910
1913
|
let elementY = 0;
|
|
1911
1914
|
let isInElement = false;
|
|
1912
|
-
if (
|
|
1913
|
-
const rect =
|
|
1915
|
+
if (ref2.current) {
|
|
1916
|
+
const rect = ref2.current.getBoundingClientRect();
|
|
1914
1917
|
elementX = event.clientX - rect.left;
|
|
1915
1918
|
elementY = event.clientY - rect.top;
|
|
1916
1919
|
isInElement = elementX >= 0 && elementX <= rect.width && elementY >= 0 && elementY <= rect.height;
|
|
@@ -1933,7 +1936,7 @@ function useMouse(options = {}) {
|
|
|
1933
1936
|
};
|
|
1934
1937
|
}, [enabled, handleMouseMove]);
|
|
1935
1938
|
return {
|
|
1936
|
-
ref,
|
|
1939
|
+
ref: ref2,
|
|
1937
1940
|
...position
|
|
1938
1941
|
};
|
|
1939
1942
|
}
|
|
@@ -2845,7 +2848,7 @@ function useMeasure() {
|
|
|
2845
2848
|
y: rect.y
|
|
2846
2849
|
});
|
|
2847
2850
|
}, []);
|
|
2848
|
-
const
|
|
2851
|
+
const ref2 = useCallback((node) => {
|
|
2849
2852
|
if (observerRef.current) {
|
|
2850
2853
|
observerRef.current.disconnect();
|
|
2851
2854
|
observerRef.current = null;
|
|
@@ -2892,7 +2895,7 @@ function useMeasure() {
|
|
|
2892
2895
|
}
|
|
2893
2896
|
};
|
|
2894
2897
|
}, []);
|
|
2895
|
-
return { ref, dimensions, measure };
|
|
2898
|
+
return { ref: ref2, dimensions, measure };
|
|
2896
2899
|
}
|
|
2897
2900
|
var useMeasure_default = useMeasure;
|
|
2898
2901
|
function useIntersectionObserver(options = {}) {
|
|
@@ -2909,7 +2912,7 @@ function useIntersectionObserver(options = {}) {
|
|
|
2909
2912
|
const elementRef = useRef(null);
|
|
2910
2913
|
const observerRef = useRef(null);
|
|
2911
2914
|
const frozen = useRef(false);
|
|
2912
|
-
const
|
|
2915
|
+
const ref2 = useCallback(
|
|
2913
2916
|
(node) => {
|
|
2914
2917
|
if (observerRef.current) {
|
|
2915
2918
|
observerRef.current.disconnect();
|
|
@@ -2945,7 +2948,7 @@ function useIntersectionObserver(options = {}) {
|
|
|
2945
2948
|
}
|
|
2946
2949
|
};
|
|
2947
2950
|
}, []);
|
|
2948
|
-
return { ref, isIntersecting, entry };
|
|
2951
|
+
return { ref: ref2, isIntersecting, entry };
|
|
2949
2952
|
}
|
|
2950
2953
|
var useIntersectionObserver_default = useIntersectionObserver;
|
|
2951
2954
|
var DEFAULT_DURATION = 4e3;
|
|
@@ -2990,6 +2993,2616 @@ function useSnackbar(defaultDuration = DEFAULT_DURATION) {
|
|
|
2990
2993
|
}
|
|
2991
2994
|
var useSnackbar_default = useSnackbar;
|
|
2992
2995
|
|
|
2993
|
-
|
|
2996
|
+
// src/client/web/theme/default-light-theme.ts
|
|
2997
|
+
var defaultLightTheme = {
|
|
2998
|
+
name: "default-light",
|
|
2999
|
+
mode: "light",
|
|
3000
|
+
colors: {
|
|
3001
|
+
brand: {
|
|
3002
|
+
primary: "#3b82f6",
|
|
3003
|
+
secondary: "#6366f1",
|
|
3004
|
+
accent: "#f59e0b",
|
|
3005
|
+
background: "#ffffff",
|
|
3006
|
+
foreground: "#111827"
|
|
3007
|
+
},
|
|
3008
|
+
semantic: {
|
|
3009
|
+
primary: "#3b82f6",
|
|
3010
|
+
primaryHover: "#2563eb",
|
|
3011
|
+
primaryActive: "#1d4ed8",
|
|
3012
|
+
primaryDisabled: "#93c5fd",
|
|
3013
|
+
secondary: "#6366f1",
|
|
3014
|
+
secondaryHover: "#4f46e5",
|
|
3015
|
+
secondaryActive: "#4338ca",
|
|
3016
|
+
secondaryDisabled: "#a5b4fc",
|
|
3017
|
+
accent: "#f59e0b",
|
|
3018
|
+
accentHover: "#d97706",
|
|
3019
|
+
success: "#22c55e",
|
|
3020
|
+
successHover: "#16a34a",
|
|
3021
|
+
warning: "#f59e0b",
|
|
3022
|
+
warningHover: "#d97706",
|
|
3023
|
+
error: "#ef4444",
|
|
3024
|
+
errorHover: "#dc2626",
|
|
3025
|
+
info: "#3b82f6",
|
|
3026
|
+
infoHover: "#2563eb"
|
|
3027
|
+
},
|
|
3028
|
+
background: {
|
|
3029
|
+
default: "#ffffff",
|
|
3030
|
+
paper: "#f9fafb",
|
|
3031
|
+
card: "#ffffff",
|
|
3032
|
+
overlay: "rgba(0, 0, 0, 0.5)",
|
|
3033
|
+
input: "#ffffff",
|
|
3034
|
+
disabled: "#f3f4f6",
|
|
3035
|
+
hover: "#f3f4f6",
|
|
3036
|
+
selected: "#eff6ff"
|
|
3037
|
+
},
|
|
3038
|
+
surface: {
|
|
3039
|
+
light: "#f9fafb",
|
|
3040
|
+
main: "#f3f4f6",
|
|
3041
|
+
dark: "#e5e7eb"
|
|
3042
|
+
},
|
|
3043
|
+
text: {
|
|
3044
|
+
primary: "#111827",
|
|
3045
|
+
secondary: "#6b7280",
|
|
3046
|
+
disabled: "#9ca3af",
|
|
3047
|
+
placeholder: "#9ca3af",
|
|
3048
|
+
link: "#3b82f6",
|
|
3049
|
+
linkHover: "#2563eb",
|
|
3050
|
+
inverse: "#ffffff",
|
|
3051
|
+
onPrimary: "#ffffff",
|
|
3052
|
+
onSecondary: "#ffffff"
|
|
3053
|
+
},
|
|
3054
|
+
border: {
|
|
3055
|
+
default: "#e5e7eb",
|
|
3056
|
+
light: "#f3f4f6",
|
|
3057
|
+
dark: "#d1d5db",
|
|
3058
|
+
focus: "#3b82f6",
|
|
3059
|
+
error: "#ef4444",
|
|
3060
|
+
success: "#22c55e",
|
|
3061
|
+
disabled: "#e5e7eb"
|
|
3062
|
+
}
|
|
3063
|
+
},
|
|
3064
|
+
shadows: {
|
|
3065
|
+
none: "none",
|
|
3066
|
+
xs: "0 1px 2px 0 rgb(0 0 0 / 0.05)",
|
|
3067
|
+
sm: "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",
|
|
3068
|
+
md: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
|
|
3069
|
+
lg: "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",
|
|
3070
|
+
xl: "0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)",
|
|
3071
|
+
"2xl": "0 25px 50px -12px rgb(0 0 0 / 0.25)",
|
|
3072
|
+
inner: "inset 0 2px 4px 0 rgb(0 0 0 / 0.05)",
|
|
3073
|
+
button: "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",
|
|
3074
|
+
buttonHover: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
|
|
3075
|
+
card: "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",
|
|
3076
|
+
cardHover: "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",
|
|
3077
|
+
modal: "0 25px 50px -12px rgb(0 0 0 / 0.25)",
|
|
3078
|
+
dropdown: "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)"
|
|
3079
|
+
},
|
|
3080
|
+
typography: {
|
|
3081
|
+
fontFamily: {
|
|
3082
|
+
sans: 'Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
|
|
3083
|
+
serif: 'ui-serif, Georgia, Cambria, "Times New Roman", Times, serif',
|
|
3084
|
+
mono: 'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace',
|
|
3085
|
+
heading: 'Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
3086
|
+
body: 'Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'
|
|
3087
|
+
},
|
|
3088
|
+
fontSize: {
|
|
3089
|
+
xs: "0.75rem",
|
|
3090
|
+
sm: "0.875rem",
|
|
3091
|
+
base: "1rem",
|
|
3092
|
+
lg: "1.125rem",
|
|
3093
|
+
xl: "1.25rem",
|
|
3094
|
+
"2xl": "1.5rem",
|
|
3095
|
+
"3xl": "1.875rem",
|
|
3096
|
+
"4xl": "2.25rem",
|
|
3097
|
+
"5xl": "3rem",
|
|
3098
|
+
"6xl": "3.75rem"
|
|
3099
|
+
},
|
|
3100
|
+
fontWeight: {
|
|
3101
|
+
light: 300,
|
|
3102
|
+
normal: 400,
|
|
3103
|
+
medium: 500,
|
|
3104
|
+
semibold: 600,
|
|
3105
|
+
bold: 700,
|
|
3106
|
+
extrabold: 800
|
|
3107
|
+
},
|
|
3108
|
+
lineHeight: {
|
|
3109
|
+
none: 1,
|
|
3110
|
+
tight: 1.25,
|
|
3111
|
+
snug: 1.375,
|
|
3112
|
+
normal: 1.5,
|
|
3113
|
+
relaxed: 1.625,
|
|
3114
|
+
loose: 2
|
|
3115
|
+
}
|
|
3116
|
+
},
|
|
3117
|
+
spacing: {
|
|
3118
|
+
0: "0",
|
|
3119
|
+
px: "1px",
|
|
3120
|
+
0.5: "0.125rem",
|
|
3121
|
+
1: "0.25rem",
|
|
3122
|
+
1.5: "0.375rem",
|
|
3123
|
+
2: "0.5rem",
|
|
3124
|
+
2.5: "0.625rem",
|
|
3125
|
+
3: "0.75rem",
|
|
3126
|
+
3.5: "0.875rem",
|
|
3127
|
+
4: "1rem",
|
|
3128
|
+
5: "1.25rem",
|
|
3129
|
+
6: "1.5rem",
|
|
3130
|
+
7: "1.75rem",
|
|
3131
|
+
8: "2rem",
|
|
3132
|
+
9: "2.25rem",
|
|
3133
|
+
10: "2.5rem",
|
|
3134
|
+
11: "2.75rem",
|
|
3135
|
+
12: "3rem",
|
|
3136
|
+
14: "3.5rem",
|
|
3137
|
+
16: "4rem",
|
|
3138
|
+
20: "5rem",
|
|
3139
|
+
24: "6rem",
|
|
3140
|
+
28: "7rem",
|
|
3141
|
+
32: "8rem",
|
|
3142
|
+
36: "9rem",
|
|
3143
|
+
40: "10rem",
|
|
3144
|
+
44: "11rem",
|
|
3145
|
+
48: "12rem",
|
|
3146
|
+
52: "13rem",
|
|
3147
|
+
56: "14rem",
|
|
3148
|
+
60: "15rem",
|
|
3149
|
+
64: "16rem",
|
|
3150
|
+
72: "18rem",
|
|
3151
|
+
80: "20rem",
|
|
3152
|
+
96: "24rem"
|
|
3153
|
+
},
|
|
3154
|
+
borderRadius: {
|
|
3155
|
+
none: "0",
|
|
3156
|
+
sm: "0.125rem",
|
|
3157
|
+
default: "0.25rem",
|
|
3158
|
+
md: "0.375rem",
|
|
3159
|
+
lg: "0.5rem",
|
|
3160
|
+
xl: "0.75rem",
|
|
3161
|
+
"2xl": "1rem",
|
|
3162
|
+
"3xl": "1.5rem",
|
|
3163
|
+
full: "9999px"
|
|
3164
|
+
},
|
|
3165
|
+
breakpoints: {
|
|
3166
|
+
xs: "475px",
|
|
3167
|
+
sm: "640px",
|
|
3168
|
+
md: "768px",
|
|
3169
|
+
lg: "1024px",
|
|
3170
|
+
xl: "1280px",
|
|
3171
|
+
"2xl": "1536px"
|
|
3172
|
+
},
|
|
3173
|
+
zIndex: {
|
|
3174
|
+
hide: -1,
|
|
3175
|
+
auto: "auto",
|
|
3176
|
+
base: 0,
|
|
3177
|
+
dropdown: 1e3,
|
|
3178
|
+
sticky: 1020,
|
|
3179
|
+
fixed: 1030,
|
|
3180
|
+
modalBackdrop: 1040,
|
|
3181
|
+
modal: 1050,
|
|
3182
|
+
popover: 1060,
|
|
3183
|
+
tooltip: 1070,
|
|
3184
|
+
toast: 1080
|
|
3185
|
+
},
|
|
3186
|
+
transitions: {
|
|
3187
|
+
none: "none",
|
|
3188
|
+
fast: "150ms ease-in-out",
|
|
3189
|
+
normal: "200ms ease-in-out",
|
|
3190
|
+
slow: "300ms ease-in-out",
|
|
3191
|
+
slower: "500ms ease-in-out",
|
|
3192
|
+
colors: "color 200ms ease-in-out, background-color 200ms ease-in-out, border-color 200ms ease-in-out",
|
|
3193
|
+
transform: "transform 200ms ease-in-out",
|
|
3194
|
+
opacity: "opacity 200ms ease-in-out",
|
|
3195
|
+
shadow: "box-shadow 200ms ease-in-out",
|
|
3196
|
+
all: "all 200ms ease-in-out"
|
|
3197
|
+
},
|
|
3198
|
+
components: {
|
|
3199
|
+
button: {
|
|
3200
|
+
bg: "#3b82f6",
|
|
3201
|
+
bgHover: "#2563eb",
|
|
3202
|
+
bgActive: "#1d4ed8",
|
|
3203
|
+
bgDisabled: "#93c5fd",
|
|
3204
|
+
color: "#ffffff",
|
|
3205
|
+
colorHover: "#ffffff",
|
|
3206
|
+
colorDisabled: "#ffffff",
|
|
3207
|
+
border: "transparent",
|
|
3208
|
+
borderHover: "transparent",
|
|
3209
|
+
borderWidth: "1px",
|
|
3210
|
+
borderRadius: "0.375rem",
|
|
3211
|
+
shadow: "0 1px 3px 0 rgb(0 0 0 / 0.1)",
|
|
3212
|
+
shadowHover: "0 4px 6px -1px rgb(0 0 0 / 0.1)",
|
|
3213
|
+
paddingX: "1rem",
|
|
3214
|
+
paddingY: "0.5rem",
|
|
3215
|
+
fontSize: "0.875rem",
|
|
3216
|
+
fontWeight: 500,
|
|
3217
|
+
variants: {
|
|
3218
|
+
primary: {
|
|
3219
|
+
bg: "#3b82f6",
|
|
3220
|
+
bgHover: "#2563eb",
|
|
3221
|
+
color: "#ffffff"
|
|
3222
|
+
},
|
|
3223
|
+
secondary: {
|
|
3224
|
+
bg: "#6366f1",
|
|
3225
|
+
bgHover: "#4f46e5",
|
|
3226
|
+
color: "#ffffff"
|
|
3227
|
+
},
|
|
3228
|
+
outline: {
|
|
3229
|
+
bg: "transparent",
|
|
3230
|
+
bgHover: "#f3f4f6",
|
|
3231
|
+
color: "#374151",
|
|
3232
|
+
border: "#d1d5db",
|
|
3233
|
+
borderHover: "#9ca3af"
|
|
3234
|
+
},
|
|
3235
|
+
ghost: {
|
|
3236
|
+
bg: "transparent",
|
|
3237
|
+
bgHover: "#f3f4f6",
|
|
3238
|
+
color: "#374151",
|
|
3239
|
+
shadow: "none",
|
|
3240
|
+
shadowHover: "none"
|
|
3241
|
+
},
|
|
3242
|
+
link: {
|
|
3243
|
+
bg: "transparent",
|
|
3244
|
+
bgHover: "transparent",
|
|
3245
|
+
color: "#3b82f6",
|
|
3246
|
+
colorHover: "#2563eb",
|
|
3247
|
+
shadow: "none",
|
|
3248
|
+
shadowHover: "none",
|
|
3249
|
+
paddingX: "0",
|
|
3250
|
+
paddingY: "0"
|
|
3251
|
+
},
|
|
3252
|
+
danger: {
|
|
3253
|
+
bg: "#ef4444",
|
|
3254
|
+
bgHover: "#dc2626",
|
|
3255
|
+
color: "#ffffff"
|
|
3256
|
+
},
|
|
3257
|
+
success: {
|
|
3258
|
+
bg: "#22c55e",
|
|
3259
|
+
bgHover: "#16a34a",
|
|
3260
|
+
color: "#ffffff"
|
|
3261
|
+
}
|
|
3262
|
+
},
|
|
3263
|
+
sizes: {
|
|
3264
|
+
xs: {
|
|
3265
|
+
paddingX: "0.5rem",
|
|
3266
|
+
paddingY: "0.25rem",
|
|
3267
|
+
fontSize: "0.75rem"
|
|
3268
|
+
},
|
|
3269
|
+
sm: {
|
|
3270
|
+
paddingX: "0.75rem",
|
|
3271
|
+
paddingY: "0.375rem",
|
|
3272
|
+
fontSize: "0.875rem"
|
|
3273
|
+
},
|
|
3274
|
+
md: {
|
|
3275
|
+
paddingX: "1rem",
|
|
3276
|
+
paddingY: "0.5rem",
|
|
3277
|
+
fontSize: "0.875rem"
|
|
3278
|
+
},
|
|
3279
|
+
lg: {
|
|
3280
|
+
paddingX: "1.25rem",
|
|
3281
|
+
paddingY: "0.625rem",
|
|
3282
|
+
fontSize: "1rem"
|
|
3283
|
+
},
|
|
3284
|
+
xl: {
|
|
3285
|
+
paddingX: "1.5rem",
|
|
3286
|
+
paddingY: "0.75rem",
|
|
3287
|
+
fontSize: "1.125rem"
|
|
3288
|
+
}
|
|
3289
|
+
}
|
|
3290
|
+
},
|
|
3291
|
+
input: {
|
|
3292
|
+
bg: "#ffffff",
|
|
3293
|
+
bgFocus: "#ffffff",
|
|
3294
|
+
bgDisabled: "#f3f4f6",
|
|
3295
|
+
bgError: "#fef2f2",
|
|
3296
|
+
color: "#111827",
|
|
3297
|
+
colorPlaceholder: "#9ca3af",
|
|
3298
|
+
colorDisabled: "#9ca3af",
|
|
3299
|
+
border: "#d1d5db",
|
|
3300
|
+
borderFocus: "#3b82f6",
|
|
3301
|
+
borderError: "#ef4444",
|
|
3302
|
+
borderWidth: "1px",
|
|
3303
|
+
borderRadius: "0.375rem",
|
|
3304
|
+
shadow: "0 1px 2px 0 rgb(0 0 0 / 0.05)",
|
|
3305
|
+
shadowFocus: "0 0 0 3px rgb(59 130 246 / 0.1)",
|
|
3306
|
+
paddingX: "0.75rem",
|
|
3307
|
+
paddingY: "0.5rem",
|
|
3308
|
+
fontSize: "0.875rem",
|
|
3309
|
+
labelColor: "#374151",
|
|
3310
|
+
labelFontSize: "0.875rem",
|
|
3311
|
+
labelFontWeight: 500,
|
|
3312
|
+
helperColor: "#6b7280",
|
|
3313
|
+
errorColor: "#ef4444",
|
|
3314
|
+
sizes: {
|
|
3315
|
+
sm: {
|
|
3316
|
+
paddingX: "0.5rem",
|
|
3317
|
+
paddingY: "0.375rem",
|
|
3318
|
+
fontSize: "0.75rem"
|
|
3319
|
+
},
|
|
3320
|
+
md: {
|
|
3321
|
+
paddingX: "0.75rem",
|
|
3322
|
+
paddingY: "0.5rem",
|
|
3323
|
+
fontSize: "0.875rem"
|
|
3324
|
+
},
|
|
3325
|
+
lg: {
|
|
3326
|
+
paddingX: "1rem",
|
|
3327
|
+
paddingY: "0.625rem",
|
|
3328
|
+
fontSize: "1rem"
|
|
3329
|
+
}
|
|
3330
|
+
}
|
|
3331
|
+
},
|
|
3332
|
+
card: {
|
|
3333
|
+
bg: "#ffffff",
|
|
3334
|
+
bgHover: "#ffffff",
|
|
3335
|
+
border: "#e5e7eb",
|
|
3336
|
+
borderWidth: "1px",
|
|
3337
|
+
borderRadius: "0.5rem",
|
|
3338
|
+
shadow: "0 1px 3px 0 rgb(0 0 0 / 0.1)",
|
|
3339
|
+
shadowHover: "0 10px 15px -3px rgb(0 0 0 / 0.1)",
|
|
3340
|
+
padding: "1.5rem",
|
|
3341
|
+
headerBg: "#f9fafb",
|
|
3342
|
+
headerBorder: "#e5e7eb",
|
|
3343
|
+
headerPadding: "1rem 1.5rem",
|
|
3344
|
+
footerBg: "#f9fafb",
|
|
3345
|
+
footerBorder: "#e5e7eb",
|
|
3346
|
+
footerPadding: "1rem 1.5rem"
|
|
3347
|
+
},
|
|
3348
|
+
header: {
|
|
3349
|
+
bg: "#ffffff",
|
|
3350
|
+
bgScrolled: "rgba(255, 255, 255, 0.95)",
|
|
3351
|
+
color: "#111827",
|
|
3352
|
+
border: "#e5e7eb",
|
|
3353
|
+
shadow: "none",
|
|
3354
|
+
shadowScrolled: "0 1px 3px 0 rgb(0 0 0 / 0.1)",
|
|
3355
|
+
height: "4rem",
|
|
3356
|
+
paddingX: "1.5rem",
|
|
3357
|
+
logoHeight: "2rem",
|
|
3358
|
+
navColor: "#374151",
|
|
3359
|
+
navColorHover: "#111827",
|
|
3360
|
+
navColorActive: "#3b82f6",
|
|
3361
|
+
navFontSize: "0.875rem",
|
|
3362
|
+
navFontWeight: 500,
|
|
3363
|
+
mobileMenuBg: "#ffffff",
|
|
3364
|
+
mobileMenuShadow: "0 10px 15px -3px rgb(0 0 0 / 0.1)"
|
|
3365
|
+
},
|
|
3366
|
+
footer: {
|
|
3367
|
+
bg: "#111827",
|
|
3368
|
+
color: "#d1d5db",
|
|
3369
|
+
colorMuted: "#9ca3af",
|
|
3370
|
+
border: "#374151",
|
|
3371
|
+
padding: "4rem 1.5rem",
|
|
3372
|
+
linkColor: "#d1d5db",
|
|
3373
|
+
linkColorHover: "#ffffff",
|
|
3374
|
+
headingColor: "#ffffff",
|
|
3375
|
+
headingFontSize: "1rem",
|
|
3376
|
+
headingFontWeight: 600,
|
|
3377
|
+
copyrightBg: "#0f172a",
|
|
3378
|
+
copyrightColor: "#9ca3af"
|
|
3379
|
+
},
|
|
3380
|
+
banner: {
|
|
3381
|
+
bg: "#eff6ff",
|
|
3382
|
+
color: "#1e40af",
|
|
3383
|
+
border: "#bfdbfe",
|
|
3384
|
+
borderRadius: "0.5rem",
|
|
3385
|
+
padding: "1rem 1.5rem",
|
|
3386
|
+
shadow: "none",
|
|
3387
|
+
closeBg: "transparent",
|
|
3388
|
+
closeColor: "#1e40af",
|
|
3389
|
+
variants: {
|
|
3390
|
+
info: {
|
|
3391
|
+
bg: "#eff6ff",
|
|
3392
|
+
color: "#1e40af",
|
|
3393
|
+
border: "#bfdbfe"
|
|
3394
|
+
},
|
|
3395
|
+
success: {
|
|
3396
|
+
bg: "#f0fdf4",
|
|
3397
|
+
color: "#166534",
|
|
3398
|
+
border: "#bbf7d0"
|
|
3399
|
+
},
|
|
3400
|
+
warning: {
|
|
3401
|
+
bg: "#fffbeb",
|
|
3402
|
+
color: "#92400e",
|
|
3403
|
+
border: "#fde68a"
|
|
3404
|
+
},
|
|
3405
|
+
error: {
|
|
3406
|
+
bg: "#fef2f2",
|
|
3407
|
+
color: "#991b1b",
|
|
3408
|
+
border: "#fecaca"
|
|
3409
|
+
},
|
|
3410
|
+
promo: {
|
|
3411
|
+
bg: "#faf5ff",
|
|
3412
|
+
color: "#6b21a8",
|
|
3413
|
+
border: "#e9d5ff"
|
|
3414
|
+
}
|
|
3415
|
+
}
|
|
3416
|
+
},
|
|
3417
|
+
loader: {
|
|
3418
|
+
color: "#3b82f6",
|
|
3419
|
+
colorSecondary: "#e5e7eb",
|
|
3420
|
+
size: "2.5rem",
|
|
3421
|
+
borderWidth: "3px",
|
|
3422
|
+
overlayBg: "rgba(255, 255, 255, 0.8)",
|
|
3423
|
+
overlayOpacity: 1,
|
|
3424
|
+
sizes: {
|
|
3425
|
+
xs: "1rem",
|
|
3426
|
+
sm: "1.5rem",
|
|
3427
|
+
md: "2.5rem",
|
|
3428
|
+
lg: "3.5rem",
|
|
3429
|
+
xl: "5rem"
|
|
3430
|
+
}
|
|
3431
|
+
},
|
|
3432
|
+
modal: {
|
|
3433
|
+
bg: "#ffffff",
|
|
3434
|
+
color: "#111827",
|
|
3435
|
+
border: "#e5e7eb",
|
|
3436
|
+
borderRadius: "0.5rem",
|
|
3437
|
+
shadow: "0 25px 50px -12px rgb(0 0 0 / 0.25)",
|
|
3438
|
+
padding: "1.5rem",
|
|
3439
|
+
overlayBg: "rgba(0, 0, 0, 0.5)",
|
|
3440
|
+
overlayOpacity: 1,
|
|
3441
|
+
headerBg: "#ffffff",
|
|
3442
|
+
headerBorder: "#e5e7eb",
|
|
3443
|
+
headerPadding: "1rem 1.5rem",
|
|
3444
|
+
footerBg: "#f9fafb",
|
|
3445
|
+
footerBorder: "#e5e7eb",
|
|
3446
|
+
footerPadding: "1rem 1.5rem",
|
|
3447
|
+
closeBg: "transparent",
|
|
3448
|
+
closeColor: "#6b7280",
|
|
3449
|
+
closeHoverBg: "#f3f4f6",
|
|
3450
|
+
sizes: {
|
|
3451
|
+
sm: "24rem",
|
|
3452
|
+
md: "32rem",
|
|
3453
|
+
lg: "48rem",
|
|
3454
|
+
xl: "64rem",
|
|
3455
|
+
full: "100%"
|
|
3456
|
+
}
|
|
3457
|
+
},
|
|
3458
|
+
toast: {
|
|
3459
|
+
bg: "#ffffff",
|
|
3460
|
+
color: "#111827",
|
|
3461
|
+
border: "#e5e7eb",
|
|
3462
|
+
borderRadius: "0.5rem",
|
|
3463
|
+
shadow: "0 10px 15px -3px rgb(0 0 0 / 0.1)",
|
|
3464
|
+
padding: "1rem",
|
|
3465
|
+
variants: {
|
|
3466
|
+
success: {
|
|
3467
|
+
bg: "#f0fdf4",
|
|
3468
|
+
color: "#166534",
|
|
3469
|
+
border: "#bbf7d0"
|
|
3470
|
+
},
|
|
3471
|
+
error: {
|
|
3472
|
+
bg: "#fef2f2",
|
|
3473
|
+
color: "#991b1b",
|
|
3474
|
+
border: "#fecaca"
|
|
3475
|
+
},
|
|
3476
|
+
warning: {
|
|
3477
|
+
bg: "#fffbeb",
|
|
3478
|
+
color: "#92400e",
|
|
3479
|
+
border: "#fde68a"
|
|
3480
|
+
},
|
|
3481
|
+
info: {
|
|
3482
|
+
bg: "#eff6ff",
|
|
3483
|
+
color: "#1e40af",
|
|
3484
|
+
border: "#bfdbfe"
|
|
3485
|
+
}
|
|
3486
|
+
}
|
|
3487
|
+
},
|
|
3488
|
+
newsletter: {
|
|
3489
|
+
bg: "#f9fafb",
|
|
3490
|
+
color: "#111827",
|
|
3491
|
+
border: "#e5e7eb",
|
|
3492
|
+
borderRadius: "0.5rem",
|
|
3493
|
+
padding: "2rem",
|
|
3494
|
+
titleColor: "#111827",
|
|
3495
|
+
titleFontSize: "1.5rem",
|
|
3496
|
+
descColor: "#6b7280",
|
|
3497
|
+
descFontSize: "1rem",
|
|
3498
|
+
inputBg: "#ffffff",
|
|
3499
|
+
inputBorder: "#d1d5db",
|
|
3500
|
+
buttonBg: "#3b82f6",
|
|
3501
|
+
buttonColor: "#ffffff"
|
|
3502
|
+
}
|
|
3503
|
+
}
|
|
3504
|
+
};
|
|
3505
|
+
|
|
3506
|
+
// src/client/web/theme/default-dark-theme.ts
|
|
3507
|
+
var defaultDarkTheme = {
|
|
3508
|
+
name: "default-dark",
|
|
3509
|
+
mode: "dark",
|
|
3510
|
+
colors: {
|
|
3511
|
+
brand: {
|
|
3512
|
+
primary: "#60a5fa",
|
|
3513
|
+
secondary: "#818cf8",
|
|
3514
|
+
accent: "#fbbf24",
|
|
3515
|
+
background: "#0f172a",
|
|
3516
|
+
foreground: "#f8fafc"
|
|
3517
|
+
},
|
|
3518
|
+
semantic: {
|
|
3519
|
+
primary: "#60a5fa",
|
|
3520
|
+
primaryHover: "#3b82f6",
|
|
3521
|
+
primaryActive: "#2563eb",
|
|
3522
|
+
primaryDisabled: "#1e3a5f",
|
|
3523
|
+
secondary: "#818cf8",
|
|
3524
|
+
secondaryHover: "#6366f1",
|
|
3525
|
+
secondaryActive: "#4f46e5",
|
|
3526
|
+
secondaryDisabled: "#312e81",
|
|
3527
|
+
accent: "#fbbf24",
|
|
3528
|
+
accentHover: "#f59e0b",
|
|
3529
|
+
success: "#4ade80",
|
|
3530
|
+
successHover: "#22c55e",
|
|
3531
|
+
warning: "#fbbf24",
|
|
3532
|
+
warningHover: "#f59e0b",
|
|
3533
|
+
error: "#f87171",
|
|
3534
|
+
errorHover: "#ef4444",
|
|
3535
|
+
info: "#60a5fa",
|
|
3536
|
+
infoHover: "#3b82f6"
|
|
3537
|
+
},
|
|
3538
|
+
background: {
|
|
3539
|
+
default: "#0f172a",
|
|
3540
|
+
paper: "#1e293b",
|
|
3541
|
+
card: "#1e293b",
|
|
3542
|
+
overlay: "rgba(0, 0, 0, 0.7)",
|
|
3543
|
+
input: "#1e293b",
|
|
3544
|
+
disabled: "#334155",
|
|
3545
|
+
hover: "#334155",
|
|
3546
|
+
selected: "#1e3a5f"
|
|
3547
|
+
},
|
|
3548
|
+
surface: {
|
|
3549
|
+
light: "#334155",
|
|
3550
|
+
main: "#1e293b",
|
|
3551
|
+
dark: "#0f172a"
|
|
3552
|
+
},
|
|
3553
|
+
text: {
|
|
3554
|
+
primary: "#f8fafc",
|
|
3555
|
+
secondary: "#94a3b8",
|
|
3556
|
+
disabled: "#64748b",
|
|
3557
|
+
placeholder: "#64748b",
|
|
3558
|
+
link: "#60a5fa",
|
|
3559
|
+
linkHover: "#3b82f6",
|
|
3560
|
+
inverse: "#0f172a",
|
|
3561
|
+
onPrimary: "#0f172a",
|
|
3562
|
+
onSecondary: "#0f172a"
|
|
3563
|
+
},
|
|
3564
|
+
border: {
|
|
3565
|
+
default: "#334155",
|
|
3566
|
+
light: "#475569",
|
|
3567
|
+
dark: "#1e293b",
|
|
3568
|
+
focus: "#60a5fa",
|
|
3569
|
+
error: "#f87171",
|
|
3570
|
+
success: "#4ade80",
|
|
3571
|
+
disabled: "#334155"
|
|
3572
|
+
}
|
|
3573
|
+
},
|
|
3574
|
+
shadows: {
|
|
3575
|
+
none: "none",
|
|
3576
|
+
xs: "0 1px 2px 0 rgb(0 0 0 / 0.3)",
|
|
3577
|
+
sm: "0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.4)",
|
|
3578
|
+
md: "0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4)",
|
|
3579
|
+
lg: "0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4)",
|
|
3580
|
+
xl: "0 20px 25px -5px rgb(0 0 0 / 0.4), 0 8px 10px -6px rgb(0 0 0 / 0.4)",
|
|
3581
|
+
"2xl": "0 25px 50px -12px rgb(0 0 0 / 0.6)",
|
|
3582
|
+
inner: "inset 0 2px 4px 0 rgb(0 0 0 / 0.3)",
|
|
3583
|
+
button: "0 1px 3px 0 rgb(0 0 0 / 0.4)",
|
|
3584
|
+
buttonHover: "0 4px 6px -1px rgb(0 0 0 / 0.4)",
|
|
3585
|
+
card: "0 1px 3px 0 rgb(0 0 0 / 0.4)",
|
|
3586
|
+
cardHover: "0 10px 15px -3px rgb(0 0 0 / 0.4)",
|
|
3587
|
+
modal: "0 25px 50px -12px rgb(0 0 0 / 0.6)",
|
|
3588
|
+
dropdown: "0 10px 15px -3px rgb(0 0 0 / 0.4)"
|
|
3589
|
+
},
|
|
3590
|
+
typography: {
|
|
3591
|
+
fontFamily: {
|
|
3592
|
+
sans: 'Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
|
|
3593
|
+
serif: 'ui-serif, Georgia, Cambria, "Times New Roman", Times, serif',
|
|
3594
|
+
mono: 'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace',
|
|
3595
|
+
heading: 'Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
3596
|
+
body: 'Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'
|
|
3597
|
+
},
|
|
3598
|
+
fontSize: {
|
|
3599
|
+
xs: "0.75rem",
|
|
3600
|
+
sm: "0.875rem",
|
|
3601
|
+
base: "1rem",
|
|
3602
|
+
lg: "1.125rem",
|
|
3603
|
+
xl: "1.25rem",
|
|
3604
|
+
"2xl": "1.5rem",
|
|
3605
|
+
"3xl": "1.875rem",
|
|
3606
|
+
"4xl": "2.25rem",
|
|
3607
|
+
"5xl": "3rem",
|
|
3608
|
+
"6xl": "3.75rem"
|
|
3609
|
+
},
|
|
3610
|
+
fontWeight: {
|
|
3611
|
+
light: 300,
|
|
3612
|
+
normal: 400,
|
|
3613
|
+
medium: 500,
|
|
3614
|
+
semibold: 600,
|
|
3615
|
+
bold: 700,
|
|
3616
|
+
extrabold: 800
|
|
3617
|
+
},
|
|
3618
|
+
lineHeight: {
|
|
3619
|
+
none: 1,
|
|
3620
|
+
tight: 1.25,
|
|
3621
|
+
snug: 1.375,
|
|
3622
|
+
normal: 1.5,
|
|
3623
|
+
relaxed: 1.625,
|
|
3624
|
+
loose: 2
|
|
3625
|
+
}
|
|
3626
|
+
},
|
|
3627
|
+
spacing: {
|
|
3628
|
+
0: "0",
|
|
3629
|
+
px: "1px",
|
|
3630
|
+
0.5: "0.125rem",
|
|
3631
|
+
1: "0.25rem",
|
|
3632
|
+
1.5: "0.375rem",
|
|
3633
|
+
2: "0.5rem",
|
|
3634
|
+
2.5: "0.625rem",
|
|
3635
|
+
3: "0.75rem",
|
|
3636
|
+
3.5: "0.875rem",
|
|
3637
|
+
4: "1rem",
|
|
3638
|
+
5: "1.25rem",
|
|
3639
|
+
6: "1.5rem",
|
|
3640
|
+
7: "1.75rem",
|
|
3641
|
+
8: "2rem",
|
|
3642
|
+
9: "2.25rem",
|
|
3643
|
+
10: "2.5rem",
|
|
3644
|
+
11: "2.75rem",
|
|
3645
|
+
12: "3rem",
|
|
3646
|
+
14: "3.5rem",
|
|
3647
|
+
16: "4rem",
|
|
3648
|
+
20: "5rem",
|
|
3649
|
+
24: "6rem",
|
|
3650
|
+
28: "7rem",
|
|
3651
|
+
32: "8rem",
|
|
3652
|
+
36: "9rem",
|
|
3653
|
+
40: "10rem",
|
|
3654
|
+
44: "11rem",
|
|
3655
|
+
48: "12rem",
|
|
3656
|
+
52: "13rem",
|
|
3657
|
+
56: "14rem",
|
|
3658
|
+
60: "15rem",
|
|
3659
|
+
64: "16rem",
|
|
3660
|
+
72: "18rem",
|
|
3661
|
+
80: "20rem",
|
|
3662
|
+
96: "24rem"
|
|
3663
|
+
},
|
|
3664
|
+
borderRadius: {
|
|
3665
|
+
none: "0",
|
|
3666
|
+
sm: "0.125rem",
|
|
3667
|
+
default: "0.25rem",
|
|
3668
|
+
md: "0.375rem",
|
|
3669
|
+
lg: "0.5rem",
|
|
3670
|
+
xl: "0.75rem",
|
|
3671
|
+
"2xl": "1rem",
|
|
3672
|
+
"3xl": "1.5rem",
|
|
3673
|
+
full: "9999px"
|
|
3674
|
+
},
|
|
3675
|
+
breakpoints: {
|
|
3676
|
+
xs: "475px",
|
|
3677
|
+
sm: "640px",
|
|
3678
|
+
md: "768px",
|
|
3679
|
+
lg: "1024px",
|
|
3680
|
+
xl: "1280px",
|
|
3681
|
+
"2xl": "1536px"
|
|
3682
|
+
},
|
|
3683
|
+
zIndex: {
|
|
3684
|
+
hide: -1,
|
|
3685
|
+
auto: "auto",
|
|
3686
|
+
base: 0,
|
|
3687
|
+
dropdown: 1e3,
|
|
3688
|
+
sticky: 1020,
|
|
3689
|
+
fixed: 1030,
|
|
3690
|
+
modalBackdrop: 1040,
|
|
3691
|
+
modal: 1050,
|
|
3692
|
+
popover: 1060,
|
|
3693
|
+
tooltip: 1070,
|
|
3694
|
+
toast: 1080
|
|
3695
|
+
},
|
|
3696
|
+
transitions: {
|
|
3697
|
+
none: "none",
|
|
3698
|
+
fast: "150ms ease-in-out",
|
|
3699
|
+
normal: "200ms ease-in-out",
|
|
3700
|
+
slow: "300ms ease-in-out",
|
|
3701
|
+
slower: "500ms ease-in-out",
|
|
3702
|
+
colors: "color 200ms ease-in-out, background-color 200ms ease-in-out, border-color 200ms ease-in-out",
|
|
3703
|
+
transform: "transform 200ms ease-in-out",
|
|
3704
|
+
opacity: "opacity 200ms ease-in-out",
|
|
3705
|
+
shadow: "box-shadow 200ms ease-in-out",
|
|
3706
|
+
all: "all 200ms ease-in-out"
|
|
3707
|
+
},
|
|
3708
|
+
components: {
|
|
3709
|
+
button: {
|
|
3710
|
+
bg: "#60a5fa",
|
|
3711
|
+
bgHover: "#3b82f6",
|
|
3712
|
+
bgActive: "#2563eb",
|
|
3713
|
+
bgDisabled: "#1e3a5f",
|
|
3714
|
+
color: "#0f172a",
|
|
3715
|
+
colorHover: "#0f172a",
|
|
3716
|
+
colorDisabled: "#64748b",
|
|
3717
|
+
border: "transparent",
|
|
3718
|
+
borderHover: "transparent",
|
|
3719
|
+
borderWidth: "1px",
|
|
3720
|
+
borderRadius: "0.375rem",
|
|
3721
|
+
shadow: "0 1px 3px 0 rgb(0 0 0 / 0.4)",
|
|
3722
|
+
shadowHover: "0 4px 6px -1px rgb(0 0 0 / 0.4)",
|
|
3723
|
+
paddingX: "1rem",
|
|
3724
|
+
paddingY: "0.5rem",
|
|
3725
|
+
fontSize: "0.875rem",
|
|
3726
|
+
fontWeight: 500,
|
|
3727
|
+
variants: {
|
|
3728
|
+
primary: {
|
|
3729
|
+
bg: "#60a5fa",
|
|
3730
|
+
bgHover: "#3b82f6",
|
|
3731
|
+
color: "#0f172a"
|
|
3732
|
+
},
|
|
3733
|
+
secondary: {
|
|
3734
|
+
bg: "#818cf8",
|
|
3735
|
+
bgHover: "#6366f1",
|
|
3736
|
+
color: "#0f172a"
|
|
3737
|
+
},
|
|
3738
|
+
outline: {
|
|
3739
|
+
bg: "transparent",
|
|
3740
|
+
bgHover: "#334155",
|
|
3741
|
+
color: "#f8fafc",
|
|
3742
|
+
border: "#475569",
|
|
3743
|
+
borderHover: "#64748b"
|
|
3744
|
+
},
|
|
3745
|
+
ghost: {
|
|
3746
|
+
bg: "transparent",
|
|
3747
|
+
bgHover: "#334155",
|
|
3748
|
+
color: "#f8fafc",
|
|
3749
|
+
shadow: "none",
|
|
3750
|
+
shadowHover: "none"
|
|
3751
|
+
},
|
|
3752
|
+
link: {
|
|
3753
|
+
bg: "transparent",
|
|
3754
|
+
bgHover: "transparent",
|
|
3755
|
+
color: "#60a5fa",
|
|
3756
|
+
colorHover: "#3b82f6",
|
|
3757
|
+
shadow: "none",
|
|
3758
|
+
shadowHover: "none",
|
|
3759
|
+
paddingX: "0",
|
|
3760
|
+
paddingY: "0"
|
|
3761
|
+
},
|
|
3762
|
+
danger: {
|
|
3763
|
+
bg: "#f87171",
|
|
3764
|
+
bgHover: "#ef4444",
|
|
3765
|
+
color: "#0f172a"
|
|
3766
|
+
},
|
|
3767
|
+
success: {
|
|
3768
|
+
bg: "#4ade80",
|
|
3769
|
+
bgHover: "#22c55e",
|
|
3770
|
+
color: "#0f172a"
|
|
3771
|
+
}
|
|
3772
|
+
},
|
|
3773
|
+
sizes: {
|
|
3774
|
+
xs: {
|
|
3775
|
+
paddingX: "0.5rem",
|
|
3776
|
+
paddingY: "0.25rem",
|
|
3777
|
+
fontSize: "0.75rem"
|
|
3778
|
+
},
|
|
3779
|
+
sm: {
|
|
3780
|
+
paddingX: "0.75rem",
|
|
3781
|
+
paddingY: "0.375rem",
|
|
3782
|
+
fontSize: "0.875rem"
|
|
3783
|
+
},
|
|
3784
|
+
md: {
|
|
3785
|
+
paddingX: "1rem",
|
|
3786
|
+
paddingY: "0.5rem",
|
|
3787
|
+
fontSize: "0.875rem"
|
|
3788
|
+
},
|
|
3789
|
+
lg: {
|
|
3790
|
+
paddingX: "1.25rem",
|
|
3791
|
+
paddingY: "0.625rem",
|
|
3792
|
+
fontSize: "1rem"
|
|
3793
|
+
},
|
|
3794
|
+
xl: {
|
|
3795
|
+
paddingX: "1.5rem",
|
|
3796
|
+
paddingY: "0.75rem",
|
|
3797
|
+
fontSize: "1.125rem"
|
|
3798
|
+
}
|
|
3799
|
+
}
|
|
3800
|
+
},
|
|
3801
|
+
input: {
|
|
3802
|
+
bg: "#1e293b",
|
|
3803
|
+
bgFocus: "#1e293b",
|
|
3804
|
+
bgDisabled: "#334155",
|
|
3805
|
+
bgError: "#450a0a",
|
|
3806
|
+
color: "#f8fafc",
|
|
3807
|
+
colorPlaceholder: "#64748b",
|
|
3808
|
+
colorDisabled: "#64748b",
|
|
3809
|
+
border: "#475569",
|
|
3810
|
+
borderFocus: "#60a5fa",
|
|
3811
|
+
borderError: "#f87171",
|
|
3812
|
+
borderWidth: "1px",
|
|
3813
|
+
borderRadius: "0.375rem",
|
|
3814
|
+
shadow: "0 1px 2px 0 rgb(0 0 0 / 0.3)",
|
|
3815
|
+
shadowFocus: "0 0 0 3px rgb(96 165 250 / 0.2)",
|
|
3816
|
+
paddingX: "0.75rem",
|
|
3817
|
+
paddingY: "0.5rem",
|
|
3818
|
+
fontSize: "0.875rem",
|
|
3819
|
+
labelColor: "#e2e8f0",
|
|
3820
|
+
labelFontSize: "0.875rem",
|
|
3821
|
+
labelFontWeight: 500,
|
|
3822
|
+
helperColor: "#94a3b8",
|
|
3823
|
+
errorColor: "#f87171",
|
|
3824
|
+
sizes: {
|
|
3825
|
+
sm: {
|
|
3826
|
+
paddingX: "0.5rem",
|
|
3827
|
+
paddingY: "0.375rem",
|
|
3828
|
+
fontSize: "0.75rem"
|
|
3829
|
+
},
|
|
3830
|
+
md: {
|
|
3831
|
+
paddingX: "0.75rem",
|
|
3832
|
+
paddingY: "0.5rem",
|
|
3833
|
+
fontSize: "0.875rem"
|
|
3834
|
+
},
|
|
3835
|
+
lg: {
|
|
3836
|
+
paddingX: "1rem",
|
|
3837
|
+
paddingY: "0.625rem",
|
|
3838
|
+
fontSize: "1rem"
|
|
3839
|
+
}
|
|
3840
|
+
}
|
|
3841
|
+
},
|
|
3842
|
+
card: {
|
|
3843
|
+
bg: "#1e293b",
|
|
3844
|
+
bgHover: "#1e293b",
|
|
3845
|
+
border: "#334155",
|
|
3846
|
+
borderWidth: "1px",
|
|
3847
|
+
borderRadius: "0.5rem",
|
|
3848
|
+
shadow: "0 1px 3px 0 rgb(0 0 0 / 0.4)",
|
|
3849
|
+
shadowHover: "0 10px 15px -3px rgb(0 0 0 / 0.4)",
|
|
3850
|
+
padding: "1.5rem",
|
|
3851
|
+
headerBg: "#0f172a",
|
|
3852
|
+
headerBorder: "#334155",
|
|
3853
|
+
headerPadding: "1rem 1.5rem",
|
|
3854
|
+
footerBg: "#0f172a",
|
|
3855
|
+
footerBorder: "#334155",
|
|
3856
|
+
footerPadding: "1rem 1.5rem"
|
|
3857
|
+
},
|
|
3858
|
+
header: {
|
|
3859
|
+
bg: "#0f172a",
|
|
3860
|
+
bgScrolled: "rgba(15, 23, 42, 0.95)",
|
|
3861
|
+
color: "#f8fafc",
|
|
3862
|
+
border: "#334155",
|
|
3863
|
+
shadow: "none",
|
|
3864
|
+
shadowScrolled: "0 1px 3px 0 rgb(0 0 0 / 0.4)",
|
|
3865
|
+
height: "4rem",
|
|
3866
|
+
paddingX: "1.5rem",
|
|
3867
|
+
logoHeight: "2rem",
|
|
3868
|
+
navColor: "#94a3b8",
|
|
3869
|
+
navColorHover: "#f8fafc",
|
|
3870
|
+
navColorActive: "#60a5fa",
|
|
3871
|
+
navFontSize: "0.875rem",
|
|
3872
|
+
navFontWeight: 500,
|
|
3873
|
+
mobileMenuBg: "#1e293b",
|
|
3874
|
+
mobileMenuShadow: "0 10px 15px -3px rgb(0 0 0 / 0.4)"
|
|
3875
|
+
},
|
|
3876
|
+
footer: {
|
|
3877
|
+
bg: "#020617",
|
|
3878
|
+
color: "#94a3b8",
|
|
3879
|
+
colorMuted: "#64748b",
|
|
3880
|
+
border: "#1e293b",
|
|
3881
|
+
padding: "4rem 1.5rem",
|
|
3882
|
+
linkColor: "#94a3b8",
|
|
3883
|
+
linkColorHover: "#f8fafc",
|
|
3884
|
+
headingColor: "#f8fafc",
|
|
3885
|
+
headingFontSize: "1rem",
|
|
3886
|
+
headingFontWeight: 600,
|
|
3887
|
+
copyrightBg: "#0f172a",
|
|
3888
|
+
copyrightColor: "#64748b"
|
|
3889
|
+
},
|
|
3890
|
+
banner: {
|
|
3891
|
+
bg: "#1e3a5f",
|
|
3892
|
+
color: "#bfdbfe",
|
|
3893
|
+
border: "#3b82f6",
|
|
3894
|
+
borderRadius: "0.5rem",
|
|
3895
|
+
padding: "1rem 1.5rem",
|
|
3896
|
+
shadow: "none",
|
|
3897
|
+
closeBg: "transparent",
|
|
3898
|
+
closeColor: "#bfdbfe",
|
|
3899
|
+
variants: {
|
|
3900
|
+
info: {
|
|
3901
|
+
bg: "#1e3a5f",
|
|
3902
|
+
color: "#bfdbfe",
|
|
3903
|
+
border: "#3b82f6"
|
|
3904
|
+
},
|
|
3905
|
+
success: {
|
|
3906
|
+
bg: "#14532d",
|
|
3907
|
+
color: "#bbf7d0",
|
|
3908
|
+
border: "#22c55e"
|
|
3909
|
+
},
|
|
3910
|
+
warning: {
|
|
3911
|
+
bg: "#78350f",
|
|
3912
|
+
color: "#fde68a",
|
|
3913
|
+
border: "#f59e0b"
|
|
3914
|
+
},
|
|
3915
|
+
error: {
|
|
3916
|
+
bg: "#7f1d1d",
|
|
3917
|
+
color: "#fecaca",
|
|
3918
|
+
border: "#ef4444"
|
|
3919
|
+
},
|
|
3920
|
+
promo: {
|
|
3921
|
+
bg: "#581c87",
|
|
3922
|
+
color: "#e9d5ff",
|
|
3923
|
+
border: "#a855f7"
|
|
3924
|
+
}
|
|
3925
|
+
}
|
|
3926
|
+
},
|
|
3927
|
+
loader: {
|
|
3928
|
+
color: "#60a5fa",
|
|
3929
|
+
colorSecondary: "#334155",
|
|
3930
|
+
size: "2.5rem",
|
|
3931
|
+
borderWidth: "3px",
|
|
3932
|
+
overlayBg: "rgba(15, 23, 42, 0.8)",
|
|
3933
|
+
overlayOpacity: 1,
|
|
3934
|
+
sizes: {
|
|
3935
|
+
xs: "1rem",
|
|
3936
|
+
sm: "1.5rem",
|
|
3937
|
+
md: "2.5rem",
|
|
3938
|
+
lg: "3.5rem",
|
|
3939
|
+
xl: "5rem"
|
|
3940
|
+
}
|
|
3941
|
+
},
|
|
3942
|
+
modal: {
|
|
3943
|
+
bg: "#1e293b",
|
|
3944
|
+
color: "#f8fafc",
|
|
3945
|
+
border: "#334155",
|
|
3946
|
+
borderRadius: "0.5rem",
|
|
3947
|
+
shadow: "0 25px 50px -12px rgb(0 0 0 / 0.6)",
|
|
3948
|
+
padding: "1.5rem",
|
|
3949
|
+
overlayBg: "rgba(0, 0, 0, 0.7)",
|
|
3950
|
+
overlayOpacity: 1,
|
|
3951
|
+
headerBg: "#1e293b",
|
|
3952
|
+
headerBorder: "#334155",
|
|
3953
|
+
headerPadding: "1rem 1.5rem",
|
|
3954
|
+
footerBg: "#0f172a",
|
|
3955
|
+
footerBorder: "#334155",
|
|
3956
|
+
footerPadding: "1rem 1.5rem",
|
|
3957
|
+
closeBg: "transparent",
|
|
3958
|
+
closeColor: "#94a3b8",
|
|
3959
|
+
closeHoverBg: "#334155",
|
|
3960
|
+
sizes: {
|
|
3961
|
+
sm: "24rem",
|
|
3962
|
+
md: "32rem",
|
|
3963
|
+
lg: "48rem",
|
|
3964
|
+
xl: "64rem",
|
|
3965
|
+
full: "100%"
|
|
3966
|
+
}
|
|
3967
|
+
},
|
|
3968
|
+
toast: {
|
|
3969
|
+
bg: "#1e293b",
|
|
3970
|
+
color: "#f8fafc",
|
|
3971
|
+
border: "#334155",
|
|
3972
|
+
borderRadius: "0.5rem",
|
|
3973
|
+
shadow: "0 10px 15px -3px rgb(0 0 0 / 0.4)",
|
|
3974
|
+
padding: "1rem",
|
|
3975
|
+
variants: {
|
|
3976
|
+
success: {
|
|
3977
|
+
bg: "#14532d",
|
|
3978
|
+
color: "#bbf7d0",
|
|
3979
|
+
border: "#22c55e"
|
|
3980
|
+
},
|
|
3981
|
+
error: {
|
|
3982
|
+
bg: "#7f1d1d",
|
|
3983
|
+
color: "#fecaca",
|
|
3984
|
+
border: "#ef4444"
|
|
3985
|
+
},
|
|
3986
|
+
warning: {
|
|
3987
|
+
bg: "#78350f",
|
|
3988
|
+
color: "#fde68a",
|
|
3989
|
+
border: "#f59e0b"
|
|
3990
|
+
},
|
|
3991
|
+
info: {
|
|
3992
|
+
bg: "#1e3a5f",
|
|
3993
|
+
color: "#bfdbfe",
|
|
3994
|
+
border: "#3b82f6"
|
|
3995
|
+
}
|
|
3996
|
+
}
|
|
3997
|
+
},
|
|
3998
|
+
newsletter: {
|
|
3999
|
+
bg: "#1e293b",
|
|
4000
|
+
color: "#f8fafc",
|
|
4001
|
+
border: "#334155",
|
|
4002
|
+
borderRadius: "0.5rem",
|
|
4003
|
+
padding: "2rem",
|
|
4004
|
+
titleColor: "#f8fafc",
|
|
4005
|
+
titleFontSize: "1.5rem",
|
|
4006
|
+
descColor: "#94a3b8",
|
|
4007
|
+
descFontSize: "1rem",
|
|
4008
|
+
inputBg: "#0f172a",
|
|
4009
|
+
inputBorder: "#475569",
|
|
4010
|
+
buttonBg: "#60a5fa",
|
|
4011
|
+
buttonColor: "#0f172a"
|
|
4012
|
+
}
|
|
4013
|
+
}
|
|
4014
|
+
};
|
|
4015
|
+
|
|
4016
|
+
// src/client/web/theme/theme-utils.ts
|
|
4017
|
+
function deepMerge(target, source) {
|
|
4018
|
+
const output = { ...target };
|
|
4019
|
+
for (const key in source) {
|
|
4020
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
4021
|
+
const sourceValue = source[key];
|
|
4022
|
+
const targetValue = target[key];
|
|
4023
|
+
if (sourceValue && typeof sourceValue === "object" && !Array.isArray(sourceValue) && targetValue && typeof targetValue === "object" && !Array.isArray(targetValue)) {
|
|
4024
|
+
output[key] = deepMerge(
|
|
4025
|
+
targetValue,
|
|
4026
|
+
sourceValue
|
|
4027
|
+
);
|
|
4028
|
+
} else if (sourceValue !== void 0) {
|
|
4029
|
+
output[key] = sourceValue;
|
|
4030
|
+
}
|
|
4031
|
+
}
|
|
4032
|
+
}
|
|
4033
|
+
return output;
|
|
4034
|
+
}
|
|
4035
|
+
function createThemeFromBrand(brand, baseTheme = defaultLightTheme) {
|
|
4036
|
+
const { colors } = brand;
|
|
4037
|
+
const brandOverrides = {
|
|
4038
|
+
brand,
|
|
4039
|
+
colors: {
|
|
4040
|
+
brand: {
|
|
4041
|
+
primary: colors.primary,
|
|
4042
|
+
secondary: colors.secondary,
|
|
4043
|
+
accent: colors.accent || colors.primary,
|
|
4044
|
+
background: colors.background || baseTheme.colors.background.default,
|
|
4045
|
+
foreground: colors.foreground || baseTheme.colors.text.primary
|
|
4046
|
+
},
|
|
4047
|
+
semantic: {
|
|
4048
|
+
primary: colors.primary,
|
|
4049
|
+
primaryHover: adjustColor(colors.primary, -10),
|
|
4050
|
+
primaryActive: adjustColor(colors.primary, -20),
|
|
4051
|
+
primaryDisabled: adjustColor(colors.primary, 40),
|
|
4052
|
+
secondary: colors.secondary,
|
|
4053
|
+
secondaryHover: adjustColor(colors.secondary, -10),
|
|
4054
|
+
secondaryActive: adjustColor(colors.secondary, -20),
|
|
4055
|
+
secondaryDisabled: adjustColor(colors.secondary, 40),
|
|
4056
|
+
accent: colors.accent || colors.primary,
|
|
4057
|
+
accentHover: adjustColor(colors.accent || colors.primary, -10)
|
|
4058
|
+
}
|
|
4059
|
+
},
|
|
4060
|
+
components: {
|
|
4061
|
+
button: {
|
|
4062
|
+
bg: colors.primary,
|
|
4063
|
+
bgHover: adjustColor(colors.primary, -10),
|
|
4064
|
+
bgActive: adjustColor(colors.primary, -20),
|
|
4065
|
+
variants: {
|
|
4066
|
+
primary: {
|
|
4067
|
+
bg: colors.primary,
|
|
4068
|
+
bgHover: adjustColor(colors.primary, -10)
|
|
4069
|
+
},
|
|
4070
|
+
secondary: {
|
|
4071
|
+
bg: colors.secondary,
|
|
4072
|
+
bgHover: adjustColor(colors.secondary, -10)
|
|
4073
|
+
}
|
|
4074
|
+
}
|
|
4075
|
+
},
|
|
4076
|
+
input: {
|
|
4077
|
+
borderFocus: colors.primary
|
|
4078
|
+
},
|
|
4079
|
+
header: {
|
|
4080
|
+
navColorActive: colors.primary
|
|
4081
|
+
},
|
|
4082
|
+
loader: {
|
|
4083
|
+
color: colors.primary
|
|
4084
|
+
},
|
|
4085
|
+
newsletter: {
|
|
4086
|
+
buttonBg: colors.primary
|
|
4087
|
+
}
|
|
4088
|
+
}
|
|
4089
|
+
};
|
|
4090
|
+
return deepMerge(baseTheme, brandOverrides);
|
|
4091
|
+
}
|
|
4092
|
+
function adjustColor(hex, percent) {
|
|
4093
|
+
hex = hex.replace(/^#/, "");
|
|
4094
|
+
let r = parseInt(hex.substring(0, 2), 16);
|
|
4095
|
+
let g = parseInt(hex.substring(2, 4), 16);
|
|
4096
|
+
let b = parseInt(hex.substring(4, 6), 16);
|
|
4097
|
+
r = Math.min(255, Math.max(0, r + r * percent / 100));
|
|
4098
|
+
g = Math.min(255, Math.max(0, g + g * percent / 100));
|
|
4099
|
+
b = Math.min(255, Math.max(0, b + b * percent / 100));
|
|
4100
|
+
const toHex = (n) => Math.round(n).toString(16).padStart(2, "0");
|
|
4101
|
+
return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
|
|
4102
|
+
}
|
|
4103
|
+
function hexToRgba(hex, alpha = 1) {
|
|
4104
|
+
hex = hex.replace(/^#/, "");
|
|
4105
|
+
const r = parseInt(hex.substring(0, 2), 16);
|
|
4106
|
+
const g = parseInt(hex.substring(2, 4), 16);
|
|
4107
|
+
const b = parseInt(hex.substring(4, 6), 16);
|
|
4108
|
+
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
|
|
4109
|
+
}
|
|
4110
|
+
function getContrastColor(hex) {
|
|
4111
|
+
hex = hex.replace(/^#/, "");
|
|
4112
|
+
const r = parseInt(hex.substring(0, 2), 16);
|
|
4113
|
+
const g = parseInt(hex.substring(2, 4), 16);
|
|
4114
|
+
const b = parseInt(hex.substring(4, 6), 16);
|
|
4115
|
+
const luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255;
|
|
4116
|
+
return luminance > 0.5 ? "#000000" : "#ffffff";
|
|
4117
|
+
}
|
|
4118
|
+
function flattenToCssVars(obj, prefix = "--ec") {
|
|
4119
|
+
const result = {};
|
|
4120
|
+
function flatten(current, path = []) {
|
|
4121
|
+
for (const key in current) {
|
|
4122
|
+
if (Object.prototype.hasOwnProperty.call(current, key)) {
|
|
4123
|
+
const value = current[key];
|
|
4124
|
+
const newPath = [...path, key];
|
|
4125
|
+
const varName = `${prefix}-${newPath.join("-")}`;
|
|
4126
|
+
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
4127
|
+
flatten(value, newPath);
|
|
4128
|
+
} else if (typeof value === "string" || typeof value === "number") {
|
|
4129
|
+
result[varName] = String(value);
|
|
4130
|
+
}
|
|
4131
|
+
}
|
|
4132
|
+
}
|
|
4133
|
+
}
|
|
4134
|
+
flatten(obj);
|
|
4135
|
+
return result;
|
|
4136
|
+
}
|
|
4137
|
+
function generateCssVars(theme, prefix = "--ec") {
|
|
4138
|
+
const cssVars = flattenToCssVars(theme, prefix);
|
|
4139
|
+
return Object.entries(cssVars).map(([key, value]) => `${key}: ${value};`).join("\n");
|
|
4140
|
+
}
|
|
4141
|
+
function injectCssVars(theme, prefix = "--ec") {
|
|
4142
|
+
if (typeof document === "undefined") return;
|
|
4143
|
+
const cssVars = flattenToCssVars(theme, prefix);
|
|
4144
|
+
const root = document.documentElement;
|
|
4145
|
+
for (const [key, value] of Object.entries(cssVars)) {
|
|
4146
|
+
root.style.setProperty(key, value);
|
|
4147
|
+
}
|
|
4148
|
+
}
|
|
4149
|
+
function removeCssVars(prefix = "--ec") {
|
|
4150
|
+
if (typeof document === "undefined") return;
|
|
4151
|
+
const root = document.documentElement;
|
|
4152
|
+
const style = root.style;
|
|
4153
|
+
for (let i = style.length - 1; i >= 0; i--) {
|
|
4154
|
+
const name = style[i];
|
|
4155
|
+
if (name.startsWith(prefix)) {
|
|
4156
|
+
root.style.removeProperty(name);
|
|
4157
|
+
}
|
|
4158
|
+
}
|
|
4159
|
+
}
|
|
4160
|
+
async function loadThemeFromUrl(url) {
|
|
4161
|
+
try {
|
|
4162
|
+
const response = await fetch(url, {
|
|
4163
|
+
headers: {
|
|
4164
|
+
Accept: "application/json"
|
|
4165
|
+
}
|
|
4166
|
+
});
|
|
4167
|
+
if (!response.ok) {
|
|
4168
|
+
console.error(`Failed to load theme from ${url}: ${response.status}`);
|
|
4169
|
+
return null;
|
|
4170
|
+
}
|
|
4171
|
+
const themeData = await response.json();
|
|
4172
|
+
return themeData;
|
|
4173
|
+
} catch (error) {
|
|
4174
|
+
console.error(`Error loading theme from ${url}:`, error);
|
|
4175
|
+
return null;
|
|
4176
|
+
}
|
|
4177
|
+
}
|
|
4178
|
+
async function createTheme(config = {}) {
|
|
4179
|
+
let lightTheme = { ...defaultLightTheme };
|
|
4180
|
+
let darkTheme = { ...defaultDarkTheme };
|
|
4181
|
+
if (config.themeUrl) {
|
|
4182
|
+
const urlTheme = await loadThemeFromUrl(config.themeUrl);
|
|
4183
|
+
if (urlTheme) {
|
|
4184
|
+
lightTheme = deepMerge(lightTheme, urlTheme);
|
|
4185
|
+
darkTheme = deepMerge(darkTheme, urlTheme);
|
|
4186
|
+
}
|
|
4187
|
+
}
|
|
4188
|
+
if (config.brandIdentity) {
|
|
4189
|
+
lightTheme = createThemeFromBrand(config.brandIdentity, lightTheme);
|
|
4190
|
+
darkTheme = createThemeFromBrand(config.brandIdentity, darkTheme);
|
|
4191
|
+
}
|
|
4192
|
+
if (config.light) {
|
|
4193
|
+
lightTheme = deepMerge(lightTheme, config.light);
|
|
4194
|
+
}
|
|
4195
|
+
if (config.dark) {
|
|
4196
|
+
darkTheme = deepMerge(darkTheme, config.dark);
|
|
4197
|
+
}
|
|
4198
|
+
return { light: lightTheme, dark: darkTheme };
|
|
4199
|
+
}
|
|
4200
|
+
var DEFAULT_STORAGE_KEY = "ec-theme-mode";
|
|
4201
|
+
function saveThemeMode(mode, storageKey = DEFAULT_STORAGE_KEY) {
|
|
4202
|
+
if (typeof localStorage === "undefined") return;
|
|
4203
|
+
try {
|
|
4204
|
+
localStorage.setItem(storageKey, mode);
|
|
4205
|
+
} catch (error) {
|
|
4206
|
+
console.error("Failed to save theme mode:", error);
|
|
4207
|
+
}
|
|
4208
|
+
}
|
|
4209
|
+
function loadThemeMode(storageKey = DEFAULT_STORAGE_KEY) {
|
|
4210
|
+
if (typeof localStorage === "undefined") return null;
|
|
4211
|
+
try {
|
|
4212
|
+
const mode = localStorage.getItem(storageKey);
|
|
4213
|
+
if (mode === "light" || mode === "dark" || mode === "system") {
|
|
4214
|
+
return mode;
|
|
4215
|
+
}
|
|
4216
|
+
return null;
|
|
4217
|
+
} catch (error) {
|
|
4218
|
+
console.error("Failed to load theme mode:", error);
|
|
4219
|
+
return null;
|
|
4220
|
+
}
|
|
4221
|
+
}
|
|
4222
|
+
function getSystemColorScheme() {
|
|
4223
|
+
if (typeof window === "undefined") return "light";
|
|
4224
|
+
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
4225
|
+
}
|
|
4226
|
+
function resolveThemeMode(mode) {
|
|
4227
|
+
if (mode === "system") {
|
|
4228
|
+
return getSystemColorScheme();
|
|
4229
|
+
}
|
|
4230
|
+
return mode;
|
|
4231
|
+
}
|
|
4232
|
+
var ThemeContext = createContext(null);
|
|
4233
|
+
function useTheme() {
|
|
4234
|
+
const context = useContext(ThemeContext);
|
|
4235
|
+
if (!context) {
|
|
4236
|
+
throw new Error("useTheme must be used within a ThemeProvider");
|
|
4237
|
+
}
|
|
4238
|
+
return context;
|
|
4239
|
+
}
|
|
4240
|
+
function ThemeProvider({
|
|
4241
|
+
children,
|
|
4242
|
+
config = {},
|
|
4243
|
+
initialTheme
|
|
4244
|
+
}) {
|
|
4245
|
+
const {
|
|
4246
|
+
defaultMode = "system",
|
|
4247
|
+
themeUrl,
|
|
4248
|
+
light: lightOverrides,
|
|
4249
|
+
dark: darkOverrides,
|
|
4250
|
+
brandIdentity,
|
|
4251
|
+
enableSystemTheme = true,
|
|
4252
|
+
persistTheme = true,
|
|
4253
|
+
storageKey = "ec-theme-mode",
|
|
4254
|
+
cssVarPrefix = "--ec"
|
|
4255
|
+
} = config;
|
|
4256
|
+
const [mode, setModeState] = useState(() => {
|
|
4257
|
+
if (persistTheme && typeof window !== "undefined") {
|
|
4258
|
+
const savedMode = loadThemeMode(storageKey);
|
|
4259
|
+
if (savedMode) return savedMode;
|
|
4260
|
+
}
|
|
4261
|
+
return defaultMode;
|
|
4262
|
+
});
|
|
4263
|
+
const [lightTheme, setLightTheme] = useState(() => {
|
|
4264
|
+
if (initialTheme && initialTheme.mode === "light") return initialTheme;
|
|
4265
|
+
let theme2 = defaultLightTheme;
|
|
4266
|
+
if (brandIdentity) {
|
|
4267
|
+
theme2 = createThemeFromBrand(brandIdentity, theme2);
|
|
4268
|
+
}
|
|
4269
|
+
if (lightOverrides) {
|
|
4270
|
+
theme2 = deepMerge(theme2, lightOverrides);
|
|
4271
|
+
}
|
|
4272
|
+
return theme2;
|
|
4273
|
+
});
|
|
4274
|
+
const [darkTheme, setDarkTheme] = useState(() => {
|
|
4275
|
+
if (initialTheme && initialTheme.mode === "dark") return initialTheme;
|
|
4276
|
+
let theme2 = defaultDarkTheme;
|
|
4277
|
+
if (brandIdentity) {
|
|
4278
|
+
theme2 = createThemeFromBrand(brandIdentity, theme2);
|
|
4279
|
+
}
|
|
4280
|
+
if (darkOverrides) {
|
|
4281
|
+
theme2 = deepMerge(theme2, darkOverrides);
|
|
4282
|
+
}
|
|
4283
|
+
return theme2;
|
|
4284
|
+
});
|
|
4285
|
+
const [isLoading, setIsLoading] = useState(!!themeUrl);
|
|
4286
|
+
const [error, setError] = useState(null);
|
|
4287
|
+
const resolvedMode = useMemo(() => resolveThemeMode(mode), [mode]);
|
|
4288
|
+
const theme = useMemo(
|
|
4289
|
+
() => resolvedMode === "dark" ? darkTheme : lightTheme,
|
|
4290
|
+
[resolvedMode, lightTheme, darkTheme]
|
|
4291
|
+
);
|
|
4292
|
+
const isDark = resolvedMode === "dark";
|
|
4293
|
+
const isLight = resolvedMode === "light";
|
|
4294
|
+
useEffect(() => {
|
|
4295
|
+
if (!themeUrl) return;
|
|
4296
|
+
setIsLoading(true);
|
|
4297
|
+
setError(null);
|
|
4298
|
+
loadThemeFromUrl(themeUrl).then((urlTheme) => {
|
|
4299
|
+
if (urlTheme) {
|
|
4300
|
+
setLightTheme((prev) => deepMerge(prev, urlTheme));
|
|
4301
|
+
setDarkTheme((prev) => deepMerge(prev, urlTheme));
|
|
4302
|
+
}
|
|
4303
|
+
}).catch((err) => {
|
|
4304
|
+
setError(err instanceof Error ? err.message : "Failed to load theme");
|
|
4305
|
+
}).finally(() => {
|
|
4306
|
+
setIsLoading(false);
|
|
4307
|
+
});
|
|
4308
|
+
}, [themeUrl]);
|
|
4309
|
+
useEffect(() => {
|
|
4310
|
+
if (typeof window !== "undefined") {
|
|
4311
|
+
injectCssVars(theme, cssVarPrefix);
|
|
4312
|
+
}
|
|
4313
|
+
}, [theme, cssVarPrefix]);
|
|
4314
|
+
useEffect(() => {
|
|
4315
|
+
if (typeof document !== "undefined") {
|
|
4316
|
+
document.documentElement.setAttribute("data-theme", resolvedMode);
|
|
4317
|
+
document.documentElement.style.colorScheme = resolvedMode;
|
|
4318
|
+
}
|
|
4319
|
+
}, [resolvedMode]);
|
|
4320
|
+
useEffect(() => {
|
|
4321
|
+
if (!enableSystemTheme || typeof window === "undefined") return;
|
|
4322
|
+
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
4323
|
+
const handleChange = () => {
|
|
4324
|
+
if (mode === "system") {
|
|
4325
|
+
setModeState("system");
|
|
4326
|
+
}
|
|
4327
|
+
};
|
|
4328
|
+
mediaQuery.addEventListener("change", handleChange);
|
|
4329
|
+
return () => mediaQuery.removeEventListener("change", handleChange);
|
|
4330
|
+
}, [mode, enableSystemTheme]);
|
|
4331
|
+
useEffect(() => {
|
|
4332
|
+
if (persistTheme && typeof window !== "undefined") {
|
|
4333
|
+
saveThemeMode(mode, storageKey);
|
|
4334
|
+
}
|
|
4335
|
+
}, [mode, persistTheme, storageKey]);
|
|
4336
|
+
const setMode = useCallback((newMode) => {
|
|
4337
|
+
setModeState(newMode);
|
|
4338
|
+
}, []);
|
|
4339
|
+
const toggleMode = useCallback(() => {
|
|
4340
|
+
setModeState((prev) => {
|
|
4341
|
+
const current = resolveThemeMode(prev);
|
|
4342
|
+
return current === "dark" ? "light" : "dark";
|
|
4343
|
+
});
|
|
4344
|
+
}, []);
|
|
4345
|
+
const updateTheme = useCallback((updates) => {
|
|
4346
|
+
setLightTheme((prev) => deepMerge(prev, updates));
|
|
4347
|
+
setDarkTheme((prev) => deepMerge(prev, updates));
|
|
4348
|
+
}, []);
|
|
4349
|
+
const resetTheme = useCallback(() => {
|
|
4350
|
+
let light = defaultLightTheme;
|
|
4351
|
+
let dark = defaultDarkTheme;
|
|
4352
|
+
if (brandIdentity) {
|
|
4353
|
+
light = createThemeFromBrand(brandIdentity, light);
|
|
4354
|
+
dark = createThemeFromBrand(brandIdentity, dark);
|
|
4355
|
+
}
|
|
4356
|
+
if (lightOverrides) {
|
|
4357
|
+
light = deepMerge(light, lightOverrides);
|
|
4358
|
+
}
|
|
4359
|
+
if (darkOverrides) {
|
|
4360
|
+
dark = deepMerge(dark, darkOverrides);
|
|
4361
|
+
}
|
|
4362
|
+
setLightTheme(light);
|
|
4363
|
+
setDarkTheme(dark);
|
|
4364
|
+
}, [brandIdentity, lightOverrides, darkOverrides]);
|
|
4365
|
+
const contextValue = useMemo(
|
|
4366
|
+
() => ({
|
|
4367
|
+
theme,
|
|
4368
|
+
mode,
|
|
4369
|
+
setMode,
|
|
4370
|
+
toggleMode,
|
|
4371
|
+
updateTheme,
|
|
4372
|
+
resetTheme,
|
|
4373
|
+
isDark,
|
|
4374
|
+
isLight,
|
|
4375
|
+
isLoading,
|
|
4376
|
+
error
|
|
4377
|
+
}),
|
|
4378
|
+
[theme, mode, setMode, toggleMode, updateTheme, resetTheme, isDark, isLight, isLoading, error]
|
|
4379
|
+
);
|
|
4380
|
+
return /* @__PURE__ */ jsx(ThemeContext.Provider, { value: contextValue, children });
|
|
4381
|
+
}
|
|
4382
|
+
function cssVar(path, prefix = "--ec") {
|
|
4383
|
+
return `var(${prefix}-${path.replace(/\./g, "-")})`;
|
|
4384
|
+
}
|
|
4385
|
+
function useThemeValue(selector) {
|
|
4386
|
+
const { theme } = useTheme();
|
|
4387
|
+
return selector(theme);
|
|
4388
|
+
}
|
|
4389
|
+
function ThemeToggle({
|
|
4390
|
+
className = "",
|
|
4391
|
+
size = 24,
|
|
4392
|
+
showLabel = false,
|
|
4393
|
+
lightLabel = "Light",
|
|
4394
|
+
darkLabel = "Dark"
|
|
4395
|
+
}) {
|
|
4396
|
+
const { isDark, toggleMode } = useTheme();
|
|
4397
|
+
return /* @__PURE__ */ jsxs(
|
|
4398
|
+
"button",
|
|
4399
|
+
{
|
|
4400
|
+
type: "button",
|
|
4401
|
+
onClick: toggleMode,
|
|
4402
|
+
className: `ec-theme-toggle ${className}`,
|
|
4403
|
+
"aria-label": isDark ? "Switch to light mode" : "Switch to dark mode",
|
|
4404
|
+
style: {
|
|
4405
|
+
background: "none",
|
|
4406
|
+
border: "none",
|
|
4407
|
+
cursor: "pointer",
|
|
4408
|
+
display: "inline-flex",
|
|
4409
|
+
alignItems: "center",
|
|
4410
|
+
gap: "0.5rem",
|
|
4411
|
+
padding: "0.5rem",
|
|
4412
|
+
borderRadius: "0.375rem",
|
|
4413
|
+
transition: "background-color 200ms ease-in-out"
|
|
4414
|
+
},
|
|
4415
|
+
children: [
|
|
4416
|
+
isDark ? (
|
|
4417
|
+
// Sun icon for dark mode (click to go light)
|
|
4418
|
+
/* @__PURE__ */ jsxs(
|
|
4419
|
+
"svg",
|
|
4420
|
+
{
|
|
4421
|
+
width: size,
|
|
4422
|
+
height: size,
|
|
4423
|
+
viewBox: "0 0 24 24",
|
|
4424
|
+
fill: "none",
|
|
4425
|
+
stroke: "currentColor",
|
|
4426
|
+
strokeWidth: "2",
|
|
4427
|
+
strokeLinecap: "round",
|
|
4428
|
+
strokeLinejoin: "round",
|
|
4429
|
+
children: [
|
|
4430
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "5" }),
|
|
4431
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "1", x2: "12", y2: "3" }),
|
|
4432
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "21", x2: "12", y2: "23" }),
|
|
4433
|
+
/* @__PURE__ */ jsx("line", { x1: "4.22", y1: "4.22", x2: "5.64", y2: "5.64" }),
|
|
4434
|
+
/* @__PURE__ */ jsx("line", { x1: "18.36", y1: "18.36", x2: "19.78", y2: "19.78" }),
|
|
4435
|
+
/* @__PURE__ */ jsx("line", { x1: "1", y1: "12", x2: "3", y2: "12" }),
|
|
4436
|
+
/* @__PURE__ */ jsx("line", { x1: "21", y1: "12", x2: "23", y2: "12" }),
|
|
4437
|
+
/* @__PURE__ */ jsx("line", { x1: "4.22", y1: "19.78", x2: "5.64", y2: "18.36" }),
|
|
4438
|
+
/* @__PURE__ */ jsx("line", { x1: "18.36", y1: "5.64", x2: "19.78", y2: "4.22" })
|
|
4439
|
+
]
|
|
4440
|
+
}
|
|
4441
|
+
)
|
|
4442
|
+
) : (
|
|
4443
|
+
// Moon icon for light mode (click to go dark)
|
|
4444
|
+
/* @__PURE__ */ jsx(
|
|
4445
|
+
"svg",
|
|
4446
|
+
{
|
|
4447
|
+
width: size,
|
|
4448
|
+
height: size,
|
|
4449
|
+
viewBox: "0 0 24 24",
|
|
4450
|
+
fill: "none",
|
|
4451
|
+
stroke: "currentColor",
|
|
4452
|
+
strokeWidth: "2",
|
|
4453
|
+
strokeLinecap: "round",
|
|
4454
|
+
strokeLinejoin: "round",
|
|
4455
|
+
children: /* @__PURE__ */ jsx("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" })
|
|
4456
|
+
}
|
|
4457
|
+
)
|
|
4458
|
+
),
|
|
4459
|
+
showLabel && /* @__PURE__ */ jsx("span", { children: isDark ? darkLabel : lightLabel })
|
|
4460
|
+
]
|
|
4461
|
+
}
|
|
4462
|
+
);
|
|
4463
|
+
}
|
|
4464
|
+
|
|
4465
|
+
// src/client/web/astro/types.ts
|
|
4466
|
+
function dummyImage(width, height, text, bgColor = "cccccc", textColor = "969696") {
|
|
4467
|
+
const label = text ? `&text=${encodeURIComponent(text)}` : "";
|
|
4468
|
+
return `https://dummyimage.com/${width}x${height}/${bgColor}/${textColor}${label}`;
|
|
4469
|
+
}
|
|
4470
|
+
function loremIpsum(type = "paragraph", count = 1) {
|
|
4471
|
+
const words = [
|
|
4472
|
+
"lorem",
|
|
4473
|
+
"ipsum",
|
|
4474
|
+
"dolor",
|
|
4475
|
+
"sit",
|
|
4476
|
+
"amet",
|
|
4477
|
+
"consectetur",
|
|
4478
|
+
"adipiscing",
|
|
4479
|
+
"elit",
|
|
4480
|
+
"sed",
|
|
4481
|
+
"do",
|
|
4482
|
+
"eiusmod",
|
|
4483
|
+
"tempor",
|
|
4484
|
+
"incididunt",
|
|
4485
|
+
"ut",
|
|
4486
|
+
"labore",
|
|
4487
|
+
"et",
|
|
4488
|
+
"dolore",
|
|
4489
|
+
"magna",
|
|
4490
|
+
"aliqua",
|
|
4491
|
+
"enim",
|
|
4492
|
+
"ad",
|
|
4493
|
+
"minim",
|
|
4494
|
+
"veniam",
|
|
4495
|
+
"quis",
|
|
4496
|
+
"nostrud",
|
|
4497
|
+
"exercitation",
|
|
4498
|
+
"ullamco",
|
|
4499
|
+
"laboris",
|
|
4500
|
+
"nisi",
|
|
4501
|
+
"aliquip",
|
|
4502
|
+
"ex",
|
|
4503
|
+
"ea",
|
|
4504
|
+
"commodo",
|
|
4505
|
+
"consequat",
|
|
4506
|
+
"duis",
|
|
4507
|
+
"aute",
|
|
4508
|
+
"irure",
|
|
4509
|
+
"in",
|
|
4510
|
+
"reprehenderit",
|
|
4511
|
+
"voluptate",
|
|
4512
|
+
"velit",
|
|
4513
|
+
"esse",
|
|
4514
|
+
"cillum",
|
|
4515
|
+
"fugiat",
|
|
4516
|
+
"nulla",
|
|
4517
|
+
"pariatur",
|
|
4518
|
+
"excepteur",
|
|
4519
|
+
"sint",
|
|
4520
|
+
"occaecat",
|
|
4521
|
+
"cupidatat",
|
|
4522
|
+
"non",
|
|
4523
|
+
"proident",
|
|
4524
|
+
"sunt",
|
|
4525
|
+
"culpa",
|
|
4526
|
+
"qui",
|
|
4527
|
+
"officia",
|
|
4528
|
+
"deserunt",
|
|
4529
|
+
"mollit",
|
|
4530
|
+
"anim",
|
|
4531
|
+
"id",
|
|
4532
|
+
"est",
|
|
4533
|
+
"laborum"
|
|
4534
|
+
];
|
|
4535
|
+
const getWords = (n) => {
|
|
4536
|
+
const result = [];
|
|
4537
|
+
for (let i = 0; i < n; i++) {
|
|
4538
|
+
result.push(words[Math.floor(Math.random() * words.length)]);
|
|
4539
|
+
}
|
|
4540
|
+
return result;
|
|
4541
|
+
};
|
|
4542
|
+
const capitalize2 = (str) => str.charAt(0).toUpperCase() + str.slice(1);
|
|
4543
|
+
if (type === "word") {
|
|
4544
|
+
return getWords(count).join(" ");
|
|
4545
|
+
}
|
|
4546
|
+
if (type === "sentence") {
|
|
4547
|
+
const sentences = [];
|
|
4548
|
+
for (let i = 0; i < count; i++) {
|
|
4549
|
+
const sentence = capitalize2(getWords(Math.floor(Math.random() * 10) + 5).join(" ")) + ".";
|
|
4550
|
+
sentences.push(sentence);
|
|
4551
|
+
}
|
|
4552
|
+
return sentences.join(" ");
|
|
4553
|
+
}
|
|
4554
|
+
const paragraphs = [];
|
|
4555
|
+
for (let i = 0; i < count; i++) {
|
|
4556
|
+
const sentences = [];
|
|
4557
|
+
const sentenceCount = Math.floor(Math.random() * 4) + 3;
|
|
4558
|
+
for (let j = 0; j < sentenceCount; j++) {
|
|
4559
|
+
sentences.push(capitalize2(getWords(Math.floor(Math.random() * 10) + 5).join(" ")) + ".");
|
|
4560
|
+
}
|
|
4561
|
+
paragraphs.push(sentences.join(" "));
|
|
4562
|
+
}
|
|
4563
|
+
return paragraphs.join("\n\n");
|
|
4564
|
+
}
|
|
4565
|
+
var dummyHeaderData = {
|
|
4566
|
+
logo: dummyImage(120, 40, "Logo"),
|
|
4567
|
+
logoAlt: "Company Logo",
|
|
4568
|
+
navLinks: [
|
|
4569
|
+
{ text: "Home", href: "/", active: true },
|
|
4570
|
+
{ text: "About", href: "/about" },
|
|
4571
|
+
{ text: "Services", href: "/services" },
|
|
4572
|
+
{ text: "Blog", href: "/blog" },
|
|
4573
|
+
{ text: "Contact", href: "/contact" }
|
|
4574
|
+
],
|
|
4575
|
+
cta: {
|
|
4576
|
+
text: "Get Started",
|
|
4577
|
+
href: "/signup",
|
|
4578
|
+
variant: "primary"
|
|
4579
|
+
},
|
|
4580
|
+
sticky: true
|
|
4581
|
+
};
|
|
4582
|
+
var dummyFooterData = {
|
|
4583
|
+
logo: dummyImage(120, 40, "Logo"),
|
|
4584
|
+
logoAlt: "Company Logo",
|
|
4585
|
+
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore.",
|
|
4586
|
+
columns: [
|
|
4587
|
+
{
|
|
4588
|
+
title: "Product",
|
|
4589
|
+
links: [
|
|
4590
|
+
{ text: "Features", href: "/features" },
|
|
4591
|
+
{ text: "Pricing", href: "/pricing" },
|
|
4592
|
+
{ text: "Integrations", href: "/integrations" },
|
|
4593
|
+
{ text: "API", href: "/api" }
|
|
4594
|
+
]
|
|
4595
|
+
},
|
|
4596
|
+
{
|
|
4597
|
+
title: "Company",
|
|
4598
|
+
links: [
|
|
4599
|
+
{ text: "About", href: "/about" },
|
|
4600
|
+
{ text: "Blog", href: "/blog" },
|
|
4601
|
+
{ text: "Careers", href: "/careers" },
|
|
4602
|
+
{ text: "Contact", href: "/contact" }
|
|
4603
|
+
]
|
|
4604
|
+
},
|
|
4605
|
+
{
|
|
4606
|
+
title: "Legal",
|
|
4607
|
+
links: [
|
|
4608
|
+
{ text: "Privacy Policy", href: "/privacy" },
|
|
4609
|
+
{ text: "Terms of Service", href: "/terms" },
|
|
4610
|
+
{ text: "Cookie Policy", href: "/cookies" }
|
|
4611
|
+
]
|
|
4612
|
+
}
|
|
4613
|
+
],
|
|
4614
|
+
socialLinks: [
|
|
4615
|
+
{ platform: "twitter", href: "https://twitter.com" },
|
|
4616
|
+
{ platform: "facebook", href: "https://facebook.com" },
|
|
4617
|
+
{ platform: "instagram", href: "https://instagram.com" },
|
|
4618
|
+
{ platform: "linkedin", href: "https://linkedin.com" },
|
|
4619
|
+
{ platform: "github", href: "https://github.com" }
|
|
4620
|
+
],
|
|
4621
|
+
copyright: `\xA9 ${(/* @__PURE__ */ new Date()).getFullYear()} Company Name. All rights reserved.`
|
|
4622
|
+
};
|
|
4623
|
+
var dummyBannerData = {
|
|
4624
|
+
title: "Build Something Amazing Today",
|
|
4625
|
+
subtitle: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
|
|
4626
|
+
backgroundImage: dummyImage(1920, 800, "Hero+Background", "1e293b", "334155"),
|
|
4627
|
+
primaryCta: {
|
|
4628
|
+
text: "Get Started Free",
|
|
4629
|
+
href: "/signup",
|
|
4630
|
+
variant: "primary"
|
|
4631
|
+
},
|
|
4632
|
+
secondaryCta: {
|
|
4633
|
+
text: "Learn More",
|
|
4634
|
+
href: "/about",
|
|
4635
|
+
variant: "outline"
|
|
4636
|
+
},
|
|
4637
|
+
height: "lg",
|
|
4638
|
+
align: "center"
|
|
4639
|
+
};
|
|
4640
|
+
var dummyFeatures = [
|
|
4641
|
+
{
|
|
4642
|
+
title: "Lightning Fast",
|
|
4643
|
+
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
|
|
4644
|
+
icon: '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z" /></svg>'
|
|
4645
|
+
},
|
|
4646
|
+
{
|
|
4647
|
+
title: "Secure & Reliable",
|
|
4648
|
+
description: "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
|
|
4649
|
+
icon: '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z" /></svg>'
|
|
4650
|
+
},
|
|
4651
|
+
{
|
|
4652
|
+
title: "Easy to Use",
|
|
4653
|
+
description: "Ut enim ad minim veniam, quis nostrud exercitation ullamco.",
|
|
4654
|
+
icon: '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" /></svg>'
|
|
4655
|
+
}
|
|
4656
|
+
];
|
|
4657
|
+
var dummyTestimonials = [
|
|
4658
|
+
{
|
|
4659
|
+
name: "John Doe",
|
|
4660
|
+
role: "CEO",
|
|
4661
|
+
company: "Tech Corp",
|
|
4662
|
+
avatar: dummyImage(80, 80, "JD", "3b82f6", "ffffff"),
|
|
4663
|
+
text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
|
|
4664
|
+
rating: 5
|
|
4665
|
+
},
|
|
4666
|
+
{
|
|
4667
|
+
name: "Jane Smith",
|
|
4668
|
+
role: "CTO",
|
|
4669
|
+
company: "Startup Inc",
|
|
4670
|
+
avatar: dummyImage(80, 80, "JS", "10b981", "ffffff"),
|
|
4671
|
+
text: "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
|
|
4672
|
+
rating: 5
|
|
4673
|
+
},
|
|
4674
|
+
{
|
|
4675
|
+
name: "Bob Wilson",
|
|
4676
|
+
role: "Product Manager",
|
|
4677
|
+
company: "Enterprise Co",
|
|
4678
|
+
avatar: dummyImage(80, 80, "BW", "f59e0b", "ffffff"),
|
|
4679
|
+
text: "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.",
|
|
4680
|
+
rating: 4
|
|
4681
|
+
}
|
|
4682
|
+
];
|
|
4683
|
+
var dummyPricingPlans = [
|
|
4684
|
+
{
|
|
4685
|
+
name: "Starter",
|
|
4686
|
+
description: "Perfect for individuals",
|
|
4687
|
+
price: "$9",
|
|
4688
|
+
period: "/month",
|
|
4689
|
+
features: [
|
|
4690
|
+
{ text: "5 Projects", included: true },
|
|
4691
|
+
{ text: "10GB Storage", included: true },
|
|
4692
|
+
{ text: "Email Support", included: true },
|
|
4693
|
+
{ text: "API Access", included: false },
|
|
4694
|
+
{ text: "Custom Domain", included: false }
|
|
4695
|
+
],
|
|
4696
|
+
ctaText: "Start Free Trial",
|
|
4697
|
+
ctaHref: "/signup?plan=starter"
|
|
4698
|
+
},
|
|
4699
|
+
{
|
|
4700
|
+
name: "Professional",
|
|
4701
|
+
description: "Best for growing teams",
|
|
4702
|
+
price: "$29",
|
|
4703
|
+
period: "/month",
|
|
4704
|
+
features: [
|
|
4705
|
+
{ text: "Unlimited Projects", included: true },
|
|
4706
|
+
{ text: "100GB Storage", included: true },
|
|
4707
|
+
{ text: "Priority Support", included: true },
|
|
4708
|
+
{ text: "API Access", included: true },
|
|
4709
|
+
{ text: "Custom Domain", included: false }
|
|
4710
|
+
],
|
|
4711
|
+
ctaText: "Start Free Trial",
|
|
4712
|
+
ctaHref: "/signup?plan=pro",
|
|
4713
|
+
popular: true,
|
|
4714
|
+
badge: "Most Popular"
|
|
4715
|
+
},
|
|
4716
|
+
{
|
|
4717
|
+
name: "Enterprise",
|
|
4718
|
+
description: "For large organizations",
|
|
4719
|
+
price: "$99",
|
|
4720
|
+
period: "/month",
|
|
4721
|
+
features: [
|
|
4722
|
+
{ text: "Unlimited Projects", included: true },
|
|
4723
|
+
{ text: "Unlimited Storage", included: true },
|
|
4724
|
+
{ text: "24/7 Support", included: true },
|
|
4725
|
+
{ text: "API Access", included: true },
|
|
4726
|
+
{ text: "Custom Domain", included: true }
|
|
4727
|
+
],
|
|
4728
|
+
ctaText: "Contact Sales",
|
|
4729
|
+
ctaHref: "/contact?plan=enterprise"
|
|
4730
|
+
}
|
|
4731
|
+
];
|
|
4732
|
+
var dummyFaqItems = [
|
|
4733
|
+
{
|
|
4734
|
+
question: "What is your refund policy?",
|
|
4735
|
+
answer: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
|
|
4736
|
+
},
|
|
4737
|
+
{
|
|
4738
|
+
question: "How do I cancel my subscription?",
|
|
4739
|
+
answer: "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."
|
|
4740
|
+
},
|
|
4741
|
+
{
|
|
4742
|
+
question: "Can I change my plan later?",
|
|
4743
|
+
answer: "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur."
|
|
4744
|
+
},
|
|
4745
|
+
{
|
|
4746
|
+
question: "Do you offer discounts for non-profits?",
|
|
4747
|
+
answer: "Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
|
|
4748
|
+
}
|
|
4749
|
+
];
|
|
4750
|
+
|
|
4751
|
+
// src/client/web/forms/types.ts
|
|
4752
|
+
var VALIDATION_MESSAGES = {
|
|
4753
|
+
required: "This field is required",
|
|
4754
|
+
email: "Please enter a valid email address",
|
|
4755
|
+
phone: "Please enter a valid phone number",
|
|
4756
|
+
minLength: (min) => `Must be at least ${min} characters`,
|
|
4757
|
+
maxLength: (max) => `Must be no more than ${max} characters`,
|
|
4758
|
+
passwordMatch: "Passwords must match",
|
|
4759
|
+
acceptTerms: "You must accept the terms and conditions",
|
|
4760
|
+
passwordUppercase: "Password must contain at least one uppercase letter",
|
|
4761
|
+
passwordLowercase: "Password must contain at least one lowercase letter",
|
|
4762
|
+
passwordNumber: "Password must contain at least one number",
|
|
4763
|
+
passwordSpecial: "Password must contain at least one special character"
|
|
4764
|
+
};
|
|
4765
|
+
var contactFormSchema = Yup.object().shape({
|
|
4766
|
+
name: Yup.string().required(VALIDATION_MESSAGES.required).min(2, VALIDATION_MESSAGES.minLength(2)).max(100, VALIDATION_MESSAGES.maxLength(100)),
|
|
4767
|
+
email: Yup.string().required(VALIDATION_MESSAGES.required).email(VALIDATION_MESSAGES.email),
|
|
4768
|
+
phone: Yup.string().matches(
|
|
4769
|
+
/^[+]?[(]?[0-9]{1,4}[)]?[-\s./0-9]*$/,
|
|
4770
|
+
VALIDATION_MESSAGES.phone
|
|
4771
|
+
).nullable(),
|
|
4772
|
+
subject: Yup.string().max(200, VALIDATION_MESSAGES.maxLength(200)).nullable(),
|
|
4773
|
+
message: Yup.string().required(VALIDATION_MESSAGES.required).min(10, VALIDATION_MESSAGES.minLength(10)).max(2e3, VALIDATION_MESSAGES.maxLength(2e3))
|
|
4774
|
+
});
|
|
4775
|
+
var newsletterFormSchema = Yup.object().shape({
|
|
4776
|
+
email: Yup.string().required(VALIDATION_MESSAGES.required).email(VALIDATION_MESSAGES.email),
|
|
4777
|
+
firstName: Yup.string().min(2, VALIDATION_MESSAGES.minLength(2)).max(50, VALIDATION_MESSAGES.maxLength(50)).nullable(),
|
|
4778
|
+
lastName: Yup.string().min(2, VALIDATION_MESSAGES.minLength(2)).max(50, VALIDATION_MESSAGES.maxLength(50)).nullable()
|
|
4779
|
+
});
|
|
4780
|
+
var loginFormSchema = Yup.object().shape({
|
|
4781
|
+
email: Yup.string().required(VALIDATION_MESSAGES.required).email(VALIDATION_MESSAGES.email),
|
|
4782
|
+
password: Yup.string().required(VALIDATION_MESSAGES.required).min(8, VALIDATION_MESSAGES.minLength(8)),
|
|
4783
|
+
rememberMe: Yup.boolean()
|
|
4784
|
+
});
|
|
4785
|
+
function createRegisterFormSchema(requirements = {}) {
|
|
4786
|
+
const {
|
|
4787
|
+
minLength = 8,
|
|
4788
|
+
requireUppercase = true,
|
|
4789
|
+
requireLowercase = true,
|
|
4790
|
+
requireNumber = true,
|
|
4791
|
+
requireSpecial = false
|
|
4792
|
+
} = requirements;
|
|
4793
|
+
let passwordSchema = Yup.string().required(VALIDATION_MESSAGES.required).min(minLength, VALIDATION_MESSAGES.minLength(minLength));
|
|
4794
|
+
if (requireUppercase) {
|
|
4795
|
+
passwordSchema = passwordSchema.matches(
|
|
4796
|
+
/[A-Z]/,
|
|
4797
|
+
VALIDATION_MESSAGES.passwordUppercase
|
|
4798
|
+
);
|
|
4799
|
+
}
|
|
4800
|
+
if (requireLowercase) {
|
|
4801
|
+
passwordSchema = passwordSchema.matches(
|
|
4802
|
+
/[a-z]/,
|
|
4803
|
+
VALIDATION_MESSAGES.passwordLowercase
|
|
4804
|
+
);
|
|
4805
|
+
}
|
|
4806
|
+
if (requireNumber) {
|
|
4807
|
+
passwordSchema = passwordSchema.matches(
|
|
4808
|
+
/[0-9]/,
|
|
4809
|
+
VALIDATION_MESSAGES.passwordNumber
|
|
4810
|
+
);
|
|
4811
|
+
}
|
|
4812
|
+
if (requireSpecial) {
|
|
4813
|
+
passwordSchema = passwordSchema.matches(
|
|
4814
|
+
/[!@#$%^&*(),.?":{}|<>]/,
|
|
4815
|
+
VALIDATION_MESSAGES.passwordSpecial
|
|
4816
|
+
);
|
|
4817
|
+
}
|
|
4818
|
+
return Yup.object().shape({
|
|
4819
|
+
firstName: Yup.string().required(VALIDATION_MESSAGES.required).min(2, VALIDATION_MESSAGES.minLength(2)).max(50, VALIDATION_MESSAGES.maxLength(50)),
|
|
4820
|
+
lastName: Yup.string().required(VALIDATION_MESSAGES.required).min(2, VALIDATION_MESSAGES.minLength(2)).max(50, VALIDATION_MESSAGES.maxLength(50)),
|
|
4821
|
+
email: Yup.string().required(VALIDATION_MESSAGES.required).email(VALIDATION_MESSAGES.email),
|
|
4822
|
+
password: passwordSchema,
|
|
4823
|
+
confirmPassword: Yup.string().required(VALIDATION_MESSAGES.required).oneOf([Yup.ref("password")], VALIDATION_MESSAGES.passwordMatch),
|
|
4824
|
+
acceptTerms: Yup.boolean().oneOf([true], VALIDATION_MESSAGES.acceptTerms)
|
|
4825
|
+
});
|
|
4826
|
+
}
|
|
4827
|
+
var registerFormSchema = createRegisterFormSchema();
|
|
4828
|
+
var defaultInitialValues = {
|
|
4829
|
+
name: "",
|
|
4830
|
+
email: "",
|
|
4831
|
+
phone: "",
|
|
4832
|
+
subject: "",
|
|
4833
|
+
message: ""
|
|
4834
|
+
};
|
|
4835
|
+
var defaultSubjectOptions = [
|
|
4836
|
+
"General Inquiry",
|
|
4837
|
+
"Support Request",
|
|
4838
|
+
"Sales Question",
|
|
4839
|
+
"Partnership",
|
|
4840
|
+
"Feedback",
|
|
4841
|
+
"Other"
|
|
4842
|
+
];
|
|
4843
|
+
function ContactForm({
|
|
4844
|
+
actionUrl,
|
|
4845
|
+
onSubmit,
|
|
4846
|
+
initialValues,
|
|
4847
|
+
showPhone = true,
|
|
4848
|
+
showSubject = true,
|
|
4849
|
+
subjectOptions = defaultSubjectOptions,
|
|
4850
|
+
submitText = "Send Message",
|
|
4851
|
+
successMessage = "Thank you! Your message has been sent successfully.",
|
|
4852
|
+
className = "",
|
|
4853
|
+
formClass = "",
|
|
4854
|
+
inputClass = "",
|
|
4855
|
+
labelClass = "",
|
|
4856
|
+
buttonClass = "",
|
|
4857
|
+
errorClass = ""
|
|
4858
|
+
}) {
|
|
4859
|
+
const [submitStatus, setSubmitStatus] = useState("idle");
|
|
4860
|
+
const [submitMessage, setSubmitMessage] = useState("");
|
|
4861
|
+
const mergedInitialValues = {
|
|
4862
|
+
...defaultInitialValues,
|
|
4863
|
+
...initialValues
|
|
4864
|
+
};
|
|
4865
|
+
const baseInputClass = "w-full px-4 py-3 rounded-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-colors";
|
|
4866
|
+
const baseLabelClass = "block text-sm font-medium text-gray-700 mb-1";
|
|
4867
|
+
const baseErrorClass = "text-sm text-red-600 mt-1";
|
|
4868
|
+
const baseButtonClass = "w-full px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed";
|
|
4869
|
+
const handleSubmit = async (values, { setSubmitting, resetForm }) => {
|
|
4870
|
+
try {
|
|
4871
|
+
let result;
|
|
4872
|
+
if (onSubmit) {
|
|
4873
|
+
result = await onSubmit(values);
|
|
4874
|
+
} else if (actionUrl) {
|
|
4875
|
+
const response = await fetch(actionUrl, {
|
|
4876
|
+
method: "POST",
|
|
4877
|
+
headers: { "Content-Type": "application/json" },
|
|
4878
|
+
body: JSON.stringify(values)
|
|
4879
|
+
});
|
|
4880
|
+
result = await response.json();
|
|
4881
|
+
} else {
|
|
4882
|
+
await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
4883
|
+
result = { success: true };
|
|
4884
|
+
}
|
|
4885
|
+
if (result.success) {
|
|
4886
|
+
setSubmitStatus("success");
|
|
4887
|
+
setSubmitMessage(result.message || successMessage);
|
|
4888
|
+
resetForm();
|
|
4889
|
+
} else {
|
|
4890
|
+
setSubmitStatus("error");
|
|
4891
|
+
setSubmitMessage(result.message || "Something went wrong. Please try again.");
|
|
4892
|
+
}
|
|
4893
|
+
} catch (error) {
|
|
4894
|
+
setSubmitStatus("error");
|
|
4895
|
+
setSubmitMessage("An error occurred. Please try again later.");
|
|
4896
|
+
} finally {
|
|
4897
|
+
setSubmitting(false);
|
|
4898
|
+
}
|
|
4899
|
+
};
|
|
4900
|
+
return /* @__PURE__ */ jsx("div", { className: `ec-contact-form ${className}`, children: submitStatus === "success" ? /* @__PURE__ */ jsxs("div", { className: "p-6 bg-green-50 border border-green-200 rounded-lg text-center", children: [
|
|
4901
|
+
/* @__PURE__ */ jsx("svg", { className: "w-12 h-12 text-green-500 mx-auto mb-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" }) }),
|
|
4902
|
+
/* @__PURE__ */ jsx("p", { className: "text-green-800 font-medium", children: submitMessage }),
|
|
4903
|
+
/* @__PURE__ */ jsx(
|
|
4904
|
+
"button",
|
|
4905
|
+
{
|
|
4906
|
+
type: "button",
|
|
4907
|
+
onClick: () => setSubmitStatus("idle"),
|
|
4908
|
+
className: "mt-4 text-green-600 hover:text-green-700 text-sm font-medium",
|
|
4909
|
+
children: "Send another message"
|
|
4910
|
+
}
|
|
4911
|
+
)
|
|
4912
|
+
] }) : /* @__PURE__ */ jsx(
|
|
4913
|
+
Formik,
|
|
4914
|
+
{
|
|
4915
|
+
initialValues: mergedInitialValues,
|
|
4916
|
+
validationSchema: contactFormSchema,
|
|
4917
|
+
onSubmit: handleSubmit,
|
|
4918
|
+
children: ({ isSubmitting, errors, touched }) => /* @__PURE__ */ jsxs(Form, { className: `space-y-4 ${formClass}`, noValidate: true, children: [
|
|
4919
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
4920
|
+
/* @__PURE__ */ jsxs("label", { htmlFor: "contact-name", className: `${baseLabelClass} ${labelClass}`, children: [
|
|
4921
|
+
"Name ",
|
|
4922
|
+
/* @__PURE__ */ jsx("span", { className: "text-red-500", children: "*" })
|
|
4923
|
+
] }),
|
|
4924
|
+
/* @__PURE__ */ jsx(
|
|
4925
|
+
Field,
|
|
4926
|
+
{
|
|
4927
|
+
type: "text",
|
|
4928
|
+
id: "contact-name",
|
|
4929
|
+
name: "name",
|
|
4930
|
+
placeholder: "John Doe",
|
|
4931
|
+
className: `${baseInputClass} ${inputClass} ${errors.name && touched.name ? "border-red-500 focus:ring-red-500" : ""}`
|
|
4932
|
+
}
|
|
4933
|
+
),
|
|
4934
|
+
/* @__PURE__ */ jsx(ErrorMessage, { name: "name", component: "p", className: `${baseErrorClass} ${errorClass}` })
|
|
4935
|
+
] }),
|
|
4936
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
4937
|
+
/* @__PURE__ */ jsxs("label", { htmlFor: "contact-email", className: `${baseLabelClass} ${labelClass}`, children: [
|
|
4938
|
+
"Email ",
|
|
4939
|
+
/* @__PURE__ */ jsx("span", { className: "text-red-500", children: "*" })
|
|
4940
|
+
] }),
|
|
4941
|
+
/* @__PURE__ */ jsx(
|
|
4942
|
+
Field,
|
|
4943
|
+
{
|
|
4944
|
+
type: "email",
|
|
4945
|
+
id: "contact-email",
|
|
4946
|
+
name: "email",
|
|
4947
|
+
placeholder: "john@example.com",
|
|
4948
|
+
className: `${baseInputClass} ${inputClass} ${errors.email && touched.email ? "border-red-500 focus:ring-red-500" : ""}`
|
|
4949
|
+
}
|
|
4950
|
+
),
|
|
4951
|
+
/* @__PURE__ */ jsx(ErrorMessage, { name: "email", component: "p", className: `${baseErrorClass} ${errorClass}` })
|
|
4952
|
+
] }),
|
|
4953
|
+
showPhone && /* @__PURE__ */ jsxs("div", { children: [
|
|
4954
|
+
/* @__PURE__ */ jsx("label", { htmlFor: "contact-phone", className: `${baseLabelClass} ${labelClass}`, children: "Phone" }),
|
|
4955
|
+
/* @__PURE__ */ jsx(
|
|
4956
|
+
Field,
|
|
4957
|
+
{
|
|
4958
|
+
type: "tel",
|
|
4959
|
+
id: "contact-phone",
|
|
4960
|
+
name: "phone",
|
|
4961
|
+
placeholder: "+1 (555) 000-0000",
|
|
4962
|
+
className: `${baseInputClass} ${inputClass} ${errors.phone && touched.phone ? "border-red-500 focus:ring-red-500" : ""}`
|
|
4963
|
+
}
|
|
4964
|
+
),
|
|
4965
|
+
/* @__PURE__ */ jsx(ErrorMessage, { name: "phone", component: "p", className: `${baseErrorClass} ${errorClass}` })
|
|
4966
|
+
] }),
|
|
4967
|
+
showSubject && /* @__PURE__ */ jsxs("div", { children: [
|
|
4968
|
+
/* @__PURE__ */ jsx("label", { htmlFor: "contact-subject", className: `${baseLabelClass} ${labelClass}`, children: "Subject" }),
|
|
4969
|
+
/* @__PURE__ */ jsxs(
|
|
4970
|
+
Field,
|
|
4971
|
+
{
|
|
4972
|
+
as: "select",
|
|
4973
|
+
id: "contact-subject",
|
|
4974
|
+
name: "subject",
|
|
4975
|
+
className: `${baseInputClass} ${inputClass}`,
|
|
4976
|
+
children: [
|
|
4977
|
+
/* @__PURE__ */ jsx("option", { value: "", children: "Select a subject..." }),
|
|
4978
|
+
subjectOptions.map((option) => /* @__PURE__ */ jsx("option", { value: option, children: option }, option))
|
|
4979
|
+
]
|
|
4980
|
+
}
|
|
4981
|
+
),
|
|
4982
|
+
/* @__PURE__ */ jsx(ErrorMessage, { name: "subject", component: "p", className: `${baseErrorClass} ${errorClass}` })
|
|
4983
|
+
] }),
|
|
4984
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
4985
|
+
/* @__PURE__ */ jsxs("label", { htmlFor: "contact-message", className: `${baseLabelClass} ${labelClass}`, children: [
|
|
4986
|
+
"Message ",
|
|
4987
|
+
/* @__PURE__ */ jsx("span", { className: "text-red-500", children: "*" })
|
|
4988
|
+
] }),
|
|
4989
|
+
/* @__PURE__ */ jsx(
|
|
4990
|
+
Field,
|
|
4991
|
+
{
|
|
4992
|
+
as: "textarea",
|
|
4993
|
+
id: "contact-message",
|
|
4994
|
+
name: "message",
|
|
4995
|
+
rows: 5,
|
|
4996
|
+
placeholder: "Your message...",
|
|
4997
|
+
className: `${baseInputClass} ${inputClass} resize-none ${errors.message && touched.message ? "border-red-500 focus:ring-red-500" : ""}`
|
|
4998
|
+
}
|
|
4999
|
+
),
|
|
5000
|
+
/* @__PURE__ */ jsx(ErrorMessage, { name: "message", component: "p", className: `${baseErrorClass} ${errorClass}` })
|
|
5001
|
+
] }),
|
|
5002
|
+
submitStatus === "error" && /* @__PURE__ */ jsx("div", { className: "p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ jsx("p", { className: "text-red-800 text-sm", children: submitMessage }) }),
|
|
5003
|
+
/* @__PURE__ */ jsx(
|
|
5004
|
+
"button",
|
|
5005
|
+
{
|
|
5006
|
+
type: "submit",
|
|
5007
|
+
disabled: isSubmitting,
|
|
5008
|
+
className: `${baseButtonClass} ${buttonClass}`,
|
|
5009
|
+
children: isSubmitting ? /* @__PURE__ */ jsxs("span", { className: "flex items-center justify-center gap-2", children: [
|
|
5010
|
+
/* @__PURE__ */ jsxs("svg", { className: "animate-spin w-5 h-5", fill: "none", viewBox: "0 0 24 24", children: [
|
|
5011
|
+
/* @__PURE__ */ jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
5012
|
+
/* @__PURE__ */ jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
|
|
5013
|
+
] }),
|
|
5014
|
+
"Sending..."
|
|
5015
|
+
] }) : submitText
|
|
5016
|
+
}
|
|
5017
|
+
)
|
|
5018
|
+
] })
|
|
5019
|
+
}
|
|
5020
|
+
) });
|
|
5021
|
+
}
|
|
5022
|
+
var defaultInitialValues2 = {
|
|
5023
|
+
email: "",
|
|
5024
|
+
firstName: "",
|
|
5025
|
+
lastName: ""
|
|
5026
|
+
};
|
|
5027
|
+
function NewsletterForm({
|
|
5028
|
+
actionUrl,
|
|
5029
|
+
onSubmit,
|
|
5030
|
+
initialValues,
|
|
5031
|
+
showName = false,
|
|
5032
|
+
placeholder = "Enter your email",
|
|
5033
|
+
submitText = "Subscribe",
|
|
5034
|
+
successMessage = "Thank you for subscribing!",
|
|
5035
|
+
layout = "inline",
|
|
5036
|
+
className = "",
|
|
5037
|
+
formClass = "",
|
|
5038
|
+
inputClass = "",
|
|
5039
|
+
buttonClass = ""
|
|
5040
|
+
}) {
|
|
5041
|
+
const [submitStatus, setSubmitStatus] = useState("idle");
|
|
5042
|
+
const [submitMessage, setSubmitMessage] = useState("");
|
|
5043
|
+
const mergedInitialValues = {
|
|
5044
|
+
...defaultInitialValues2,
|
|
5045
|
+
...initialValues
|
|
5046
|
+
};
|
|
5047
|
+
const baseInputClass = "px-4 py-3 rounded-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-colors";
|
|
5048
|
+
const baseButtonClass = "px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed";
|
|
5049
|
+
const handleSubmit = async (values, { setSubmitting, resetForm }) => {
|
|
5050
|
+
try {
|
|
5051
|
+
let result;
|
|
5052
|
+
if (onSubmit) {
|
|
5053
|
+
result = await onSubmit(values);
|
|
5054
|
+
} else if (actionUrl) {
|
|
5055
|
+
const response = await fetch(actionUrl, {
|
|
5056
|
+
method: "POST",
|
|
5057
|
+
headers: { "Content-Type": "application/json" },
|
|
5058
|
+
body: JSON.stringify(values)
|
|
5059
|
+
});
|
|
5060
|
+
result = await response.json();
|
|
5061
|
+
} else {
|
|
5062
|
+
await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
5063
|
+
result = { success: true };
|
|
5064
|
+
}
|
|
5065
|
+
if (result.success) {
|
|
5066
|
+
setSubmitStatus("success");
|
|
5067
|
+
setSubmitMessage(result.message || successMessage);
|
|
5068
|
+
resetForm();
|
|
5069
|
+
} else {
|
|
5070
|
+
setSubmitStatus("error");
|
|
5071
|
+
setSubmitMessage(result.message || "Something went wrong. Please try again.");
|
|
5072
|
+
}
|
|
5073
|
+
} catch (error) {
|
|
5074
|
+
setSubmitStatus("error");
|
|
5075
|
+
setSubmitMessage("An error occurred. Please try again later.");
|
|
5076
|
+
} finally {
|
|
5077
|
+
setSubmitting(false);
|
|
5078
|
+
}
|
|
5079
|
+
};
|
|
5080
|
+
if (submitStatus === "success") {
|
|
5081
|
+
return /* @__PURE__ */ jsx("div", { className: `ec-newsletter-form ${className}`, children: /* @__PURE__ */ jsxs("div", { className: "p-4 bg-green-50 border border-green-200 rounded-lg text-center", children: [
|
|
5082
|
+
/* @__PURE__ */ jsx("p", { className: "text-green-800 font-medium", children: submitMessage }),
|
|
5083
|
+
/* @__PURE__ */ jsx(
|
|
5084
|
+
"button",
|
|
5085
|
+
{
|
|
5086
|
+
type: "button",
|
|
5087
|
+
onClick: () => setSubmitStatus("idle"),
|
|
5088
|
+
className: "mt-2 text-green-600 hover:text-green-700 text-sm",
|
|
5089
|
+
children: "Subscribe another email"
|
|
5090
|
+
}
|
|
5091
|
+
)
|
|
5092
|
+
] }) });
|
|
5093
|
+
}
|
|
5094
|
+
return /* @__PURE__ */ jsxs("div", { className: `ec-newsletter-form ${className}`, children: [
|
|
5095
|
+
/* @__PURE__ */ jsx(
|
|
5096
|
+
Formik,
|
|
5097
|
+
{
|
|
5098
|
+
initialValues: mergedInitialValues,
|
|
5099
|
+
validationSchema: newsletterFormSchema,
|
|
5100
|
+
onSubmit: handleSubmit,
|
|
5101
|
+
children: ({ isSubmitting, errors, touched }) => /* @__PURE__ */ jsxs(
|
|
5102
|
+
Form,
|
|
5103
|
+
{
|
|
5104
|
+
className: `${layout === "inline" ? "flex flex-col sm:flex-row gap-3" : "space-y-4"} ${formClass}`,
|
|
5105
|
+
noValidate: true,
|
|
5106
|
+
children: [
|
|
5107
|
+
showName && /* @__PURE__ */ jsxs("div", { className: layout === "inline" ? "flex gap-3 flex-1" : "grid grid-cols-2 gap-4", children: [
|
|
5108
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
|
|
5109
|
+
/* @__PURE__ */ jsx(
|
|
5110
|
+
Field,
|
|
5111
|
+
{
|
|
5112
|
+
type: "text",
|
|
5113
|
+
name: "firstName",
|
|
5114
|
+
placeholder: "First name",
|
|
5115
|
+
className: `w-full ${baseInputClass} ${inputClass} ${errors.firstName && touched.firstName ? "border-red-500" : ""}`
|
|
5116
|
+
}
|
|
5117
|
+
),
|
|
5118
|
+
layout === "stacked" && /* @__PURE__ */ jsx(ErrorMessage, { name: "firstName", component: "p", className: "text-sm text-red-600 mt-1" })
|
|
5119
|
+
] }),
|
|
5120
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
|
|
5121
|
+
/* @__PURE__ */ jsx(
|
|
5122
|
+
Field,
|
|
5123
|
+
{
|
|
5124
|
+
type: "text",
|
|
5125
|
+
name: "lastName",
|
|
5126
|
+
placeholder: "Last name",
|
|
5127
|
+
className: `w-full ${baseInputClass} ${inputClass} ${errors.lastName && touched.lastName ? "border-red-500" : ""}`
|
|
5128
|
+
}
|
|
5129
|
+
),
|
|
5130
|
+
layout === "stacked" && /* @__PURE__ */ jsx(ErrorMessage, { name: "lastName", component: "p", className: "text-sm text-red-600 mt-1" })
|
|
5131
|
+
] })
|
|
5132
|
+
] }),
|
|
5133
|
+
/* @__PURE__ */ jsxs("div", { className: layout === "inline" ? "flex-1" : "", children: [
|
|
5134
|
+
/* @__PURE__ */ jsx(
|
|
5135
|
+
Field,
|
|
5136
|
+
{
|
|
5137
|
+
type: "email",
|
|
5138
|
+
name: "email",
|
|
5139
|
+
placeholder,
|
|
5140
|
+
className: `w-full ${baseInputClass} ${inputClass} ${errors.email && touched.email ? "border-red-500" : ""}`
|
|
5141
|
+
}
|
|
5142
|
+
),
|
|
5143
|
+
layout === "stacked" && /* @__PURE__ */ jsx(ErrorMessage, { name: "email", component: "p", className: "text-sm text-red-600 mt-1" })
|
|
5144
|
+
] }),
|
|
5145
|
+
/* @__PURE__ */ jsx(
|
|
5146
|
+
"button",
|
|
5147
|
+
{
|
|
5148
|
+
type: "submit",
|
|
5149
|
+
disabled: isSubmitting,
|
|
5150
|
+
className: `${baseButtonClass} ${buttonClass} ${layout === "stacked" ? "w-full" : ""}`,
|
|
5151
|
+
children: isSubmitting ? /* @__PURE__ */ jsxs("span", { className: "flex items-center justify-center gap-2", children: [
|
|
5152
|
+
/* @__PURE__ */ jsxs("svg", { className: "animate-spin w-5 h-5", fill: "none", viewBox: "0 0 24 24", children: [
|
|
5153
|
+
/* @__PURE__ */ jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
5154
|
+
/* @__PURE__ */ jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
|
|
5155
|
+
] }),
|
|
5156
|
+
"Subscribing..."
|
|
5157
|
+
] }) : submitText
|
|
5158
|
+
}
|
|
5159
|
+
),
|
|
5160
|
+
layout === "inline" && errors.email && touched.email && /* @__PURE__ */ jsx("div", { className: "w-full sm:w-auto", children: /* @__PURE__ */ jsx("p", { className: "text-sm text-red-600", children: errors.email }) })
|
|
5161
|
+
]
|
|
5162
|
+
}
|
|
5163
|
+
)
|
|
5164
|
+
}
|
|
5165
|
+
),
|
|
5166
|
+
submitStatus === "error" && /* @__PURE__ */ jsx("div", { className: "mt-4 p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ jsx("p", { className: "text-red-800 text-sm", children: submitMessage }) })
|
|
5167
|
+
] });
|
|
5168
|
+
}
|
|
5169
|
+
var defaultInitialValues3 = {
|
|
5170
|
+
email: "",
|
|
5171
|
+
password: "",
|
|
5172
|
+
rememberMe: false
|
|
5173
|
+
};
|
|
5174
|
+
function LoginForm({
|
|
5175
|
+
actionUrl,
|
|
5176
|
+
onSubmit,
|
|
5177
|
+
initialValues,
|
|
5178
|
+
showRememberMe = true,
|
|
5179
|
+
forgotPasswordLink = "/forgot-password",
|
|
5180
|
+
registerLink = "/register",
|
|
5181
|
+
submitText = "Sign In",
|
|
5182
|
+
successRedirect,
|
|
5183
|
+
className = "",
|
|
5184
|
+
formClass = "",
|
|
5185
|
+
inputClass = "",
|
|
5186
|
+
buttonClass = ""
|
|
5187
|
+
}) {
|
|
5188
|
+
const [submitStatus, setSubmitStatus] = useState("idle");
|
|
5189
|
+
const [submitMessage, setSubmitMessage] = useState("");
|
|
5190
|
+
const [showPassword, setShowPassword] = useState(false);
|
|
5191
|
+
const mergedInitialValues = {
|
|
5192
|
+
...defaultInitialValues3,
|
|
5193
|
+
...initialValues
|
|
5194
|
+
};
|
|
5195
|
+
const baseInputClass = "w-full px-4 py-3 rounded-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-colors";
|
|
5196
|
+
const baseLabelClass = "block text-sm font-medium text-gray-700 mb-1";
|
|
5197
|
+
const baseErrorClass = "text-sm text-red-600 mt-1";
|
|
5198
|
+
const baseButtonClass = "w-full px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed";
|
|
5199
|
+
const handleSubmit = async (values, { setSubmitting }) => {
|
|
5200
|
+
try {
|
|
5201
|
+
let result;
|
|
5202
|
+
if (onSubmit) {
|
|
5203
|
+
result = await onSubmit(values);
|
|
5204
|
+
} else if (actionUrl) {
|
|
5205
|
+
const response = await fetch(actionUrl, {
|
|
5206
|
+
method: "POST",
|
|
5207
|
+
headers: { "Content-Type": "application/json" },
|
|
5208
|
+
body: JSON.stringify(values)
|
|
5209
|
+
});
|
|
5210
|
+
result = await response.json();
|
|
5211
|
+
} else {
|
|
5212
|
+
await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
5213
|
+
result = { success: true };
|
|
5214
|
+
}
|
|
5215
|
+
if (result.success) {
|
|
5216
|
+
setSubmitStatus("success");
|
|
5217
|
+
setSubmitMessage(result.message || "Login successful!");
|
|
5218
|
+
if (successRedirect && typeof window !== "undefined") {
|
|
5219
|
+
window.location.href = successRedirect;
|
|
5220
|
+
}
|
|
5221
|
+
} else {
|
|
5222
|
+
setSubmitStatus("error");
|
|
5223
|
+
setSubmitMessage(result.message || "Invalid email or password.");
|
|
5224
|
+
}
|
|
5225
|
+
} catch (error) {
|
|
5226
|
+
setSubmitStatus("error");
|
|
5227
|
+
setSubmitMessage("An error occurred. Please try again later.");
|
|
5228
|
+
} finally {
|
|
5229
|
+
setSubmitting(false);
|
|
5230
|
+
}
|
|
5231
|
+
};
|
|
5232
|
+
return /* @__PURE__ */ jsx("div", { className: `ec-login-form ${className}`, children: /* @__PURE__ */ jsx(
|
|
5233
|
+
Formik,
|
|
5234
|
+
{
|
|
5235
|
+
initialValues: mergedInitialValues,
|
|
5236
|
+
validationSchema: loginFormSchema,
|
|
5237
|
+
onSubmit: handleSubmit,
|
|
5238
|
+
children: ({ isSubmitting, errors, touched }) => /* @__PURE__ */ jsxs(Form, { className: `space-y-4 ${formClass}`, noValidate: true, children: [
|
|
5239
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
5240
|
+
/* @__PURE__ */ jsx("label", { htmlFor: "login-email", className: baseLabelClass, children: "Email" }),
|
|
5241
|
+
/* @__PURE__ */ jsx(
|
|
5242
|
+
Field,
|
|
5243
|
+
{
|
|
5244
|
+
type: "email",
|
|
5245
|
+
id: "login-email",
|
|
5246
|
+
name: "email",
|
|
5247
|
+
placeholder: "you@example.com",
|
|
5248
|
+
autoComplete: "email",
|
|
5249
|
+
className: `${baseInputClass} ${inputClass} ${errors.email && touched.email ? "border-red-500 focus:ring-red-500" : ""}`
|
|
5250
|
+
}
|
|
5251
|
+
),
|
|
5252
|
+
/* @__PURE__ */ jsx(ErrorMessage, { name: "email", component: "p", className: baseErrorClass })
|
|
5253
|
+
] }),
|
|
5254
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
5255
|
+
/* @__PURE__ */ jsx("label", { htmlFor: "login-password", className: baseLabelClass, children: "Password" }),
|
|
5256
|
+
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
5257
|
+
/* @__PURE__ */ jsx(
|
|
5258
|
+
Field,
|
|
5259
|
+
{
|
|
5260
|
+
type: showPassword ? "text" : "password",
|
|
5261
|
+
id: "login-password",
|
|
5262
|
+
name: "password",
|
|
5263
|
+
placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",
|
|
5264
|
+
autoComplete: "current-password",
|
|
5265
|
+
className: `${baseInputClass} ${inputClass} pr-12 ${errors.password && touched.password ? "border-red-500 focus:ring-red-500" : ""}`
|
|
5266
|
+
}
|
|
5267
|
+
),
|
|
5268
|
+
/* @__PURE__ */ jsx(
|
|
5269
|
+
"button",
|
|
5270
|
+
{
|
|
5271
|
+
type: "button",
|
|
5272
|
+
onClick: () => setShowPassword(!showPassword),
|
|
5273
|
+
className: "absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700",
|
|
5274
|
+
tabIndex: -1,
|
|
5275
|
+
children: showPassword ? /* @__PURE__ */ jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21" }) }) : /* @__PURE__ */ jsxs("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: [
|
|
5276
|
+
/* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }),
|
|
5277
|
+
/* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" })
|
|
5278
|
+
] })
|
|
5279
|
+
}
|
|
5280
|
+
)
|
|
5281
|
+
] }),
|
|
5282
|
+
/* @__PURE__ */ jsx(ErrorMessage, { name: "password", component: "p", className: baseErrorClass })
|
|
5283
|
+
] }),
|
|
5284
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
5285
|
+
showRememberMe && /* @__PURE__ */ jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [
|
|
5286
|
+
/* @__PURE__ */ jsx(
|
|
5287
|
+
Field,
|
|
5288
|
+
{
|
|
5289
|
+
type: "checkbox",
|
|
5290
|
+
name: "rememberMe",
|
|
5291
|
+
className: "w-4 h-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500"
|
|
5292
|
+
}
|
|
5293
|
+
),
|
|
5294
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm text-gray-600", children: "Remember me" })
|
|
5295
|
+
] }),
|
|
5296
|
+
forgotPasswordLink && /* @__PURE__ */ jsx(
|
|
5297
|
+
"a",
|
|
5298
|
+
{
|
|
5299
|
+
href: forgotPasswordLink,
|
|
5300
|
+
className: "text-sm text-blue-600 hover:text-blue-700 font-medium",
|
|
5301
|
+
children: "Forgot password?"
|
|
5302
|
+
}
|
|
5303
|
+
)
|
|
5304
|
+
] }),
|
|
5305
|
+
submitStatus === "error" && /* @__PURE__ */ jsx("div", { className: "p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ jsx("p", { className: "text-red-800 text-sm", children: submitMessage }) }),
|
|
5306
|
+
/* @__PURE__ */ jsx(
|
|
5307
|
+
"button",
|
|
5308
|
+
{
|
|
5309
|
+
type: "submit",
|
|
5310
|
+
disabled: isSubmitting,
|
|
5311
|
+
className: `${baseButtonClass} ${buttonClass}`,
|
|
5312
|
+
children: isSubmitting ? /* @__PURE__ */ jsxs("span", { className: "flex items-center justify-center gap-2", children: [
|
|
5313
|
+
/* @__PURE__ */ jsxs("svg", { className: "animate-spin w-5 h-5", fill: "none", viewBox: "0 0 24 24", children: [
|
|
5314
|
+
/* @__PURE__ */ jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
5315
|
+
/* @__PURE__ */ jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
|
|
5316
|
+
] }),
|
|
5317
|
+
"Signing in..."
|
|
5318
|
+
] }) : submitText
|
|
5319
|
+
}
|
|
5320
|
+
),
|
|
5321
|
+
registerLink && /* @__PURE__ */ jsxs("p", { className: "text-center text-sm text-gray-600", children: [
|
|
5322
|
+
"Don't have an account?",
|
|
5323
|
+
" ",
|
|
5324
|
+
/* @__PURE__ */ jsx("a", { href: registerLink, className: "text-blue-600 hover:text-blue-700 font-medium", children: "Sign up" })
|
|
5325
|
+
] })
|
|
5326
|
+
] })
|
|
5327
|
+
}
|
|
5328
|
+
) });
|
|
5329
|
+
}
|
|
5330
|
+
var defaultInitialValues4 = {
|
|
5331
|
+
firstName: "",
|
|
5332
|
+
lastName: "",
|
|
5333
|
+
email: "",
|
|
5334
|
+
password: "",
|
|
5335
|
+
confirmPassword: "",
|
|
5336
|
+
acceptTerms: false
|
|
5337
|
+
};
|
|
5338
|
+
function RegisterForm({
|
|
5339
|
+
actionUrl,
|
|
5340
|
+
onSubmit,
|
|
5341
|
+
initialValues,
|
|
5342
|
+
termsLink = "/terms",
|
|
5343
|
+
privacyLink = "/privacy",
|
|
5344
|
+
loginLink = "/login",
|
|
5345
|
+
submitText = "Create Account",
|
|
5346
|
+
successRedirect,
|
|
5347
|
+
passwordRequirements = {
|
|
5348
|
+
minLength: 8,
|
|
5349
|
+
requireUppercase: true,
|
|
5350
|
+
requireLowercase: true,
|
|
5351
|
+
requireNumber: true,
|
|
5352
|
+
requireSpecial: false
|
|
5353
|
+
},
|
|
5354
|
+
className = "",
|
|
5355
|
+
formClass = "",
|
|
5356
|
+
inputClass = "",
|
|
5357
|
+
buttonClass = ""
|
|
5358
|
+
}) {
|
|
5359
|
+
const [submitStatus, setSubmitStatus] = useState("idle");
|
|
5360
|
+
const [submitMessage, setSubmitMessage] = useState("");
|
|
5361
|
+
const [showPassword, setShowPassword] = useState(false);
|
|
5362
|
+
const [showConfirmPassword, setShowConfirmPassword] = useState(false);
|
|
5363
|
+
const mergedInitialValues = {
|
|
5364
|
+
...defaultInitialValues4,
|
|
5365
|
+
...initialValues
|
|
5366
|
+
};
|
|
5367
|
+
const validationSchema = createRegisterFormSchema(passwordRequirements);
|
|
5368
|
+
const baseInputClass = "w-full px-4 py-3 rounded-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-colors";
|
|
5369
|
+
const baseLabelClass = "block text-sm font-medium text-gray-700 mb-1";
|
|
5370
|
+
const baseErrorClass = "text-sm text-red-600 mt-1";
|
|
5371
|
+
const baseButtonClass = "w-full px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed";
|
|
5372
|
+
const handleSubmit = async (values, { setSubmitting }) => {
|
|
5373
|
+
try {
|
|
5374
|
+
let result;
|
|
5375
|
+
if (onSubmit) {
|
|
5376
|
+
result = await onSubmit(values);
|
|
5377
|
+
} else if (actionUrl) {
|
|
5378
|
+
const response = await fetch(actionUrl, {
|
|
5379
|
+
method: "POST",
|
|
5380
|
+
headers: { "Content-Type": "application/json" },
|
|
5381
|
+
body: JSON.stringify(values)
|
|
5382
|
+
});
|
|
5383
|
+
result = await response.json();
|
|
5384
|
+
} else {
|
|
5385
|
+
await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
5386
|
+
result = { success: true };
|
|
5387
|
+
}
|
|
5388
|
+
if (result.success) {
|
|
5389
|
+
setSubmitStatus("success");
|
|
5390
|
+
setSubmitMessage(result.message || "Account created successfully!");
|
|
5391
|
+
if (successRedirect && typeof window !== "undefined") {
|
|
5392
|
+
window.location.href = successRedirect;
|
|
5393
|
+
}
|
|
5394
|
+
} else {
|
|
5395
|
+
setSubmitStatus("error");
|
|
5396
|
+
setSubmitMessage(result.message || "Registration failed. Please try again.");
|
|
5397
|
+
}
|
|
5398
|
+
} catch (error) {
|
|
5399
|
+
setSubmitStatus("error");
|
|
5400
|
+
setSubmitMessage("An error occurred. Please try again later.");
|
|
5401
|
+
} finally {
|
|
5402
|
+
setSubmitting(false);
|
|
5403
|
+
}
|
|
5404
|
+
};
|
|
5405
|
+
if (submitStatus === "success") {
|
|
5406
|
+
return /* @__PURE__ */ jsx("div", { className: `ec-register-form ${className}`, children: /* @__PURE__ */ jsxs("div", { className: "p-6 bg-green-50 border border-green-200 rounded-lg text-center", children: [
|
|
5407
|
+
/* @__PURE__ */ jsx("svg", { className: "w-12 h-12 text-green-500 mx-auto mb-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" }) }),
|
|
5408
|
+
/* @__PURE__ */ jsx("p", { className: "text-green-800 font-medium", children: submitMessage }),
|
|
5409
|
+
loginLink && /* @__PURE__ */ jsx(
|
|
5410
|
+
"a",
|
|
5411
|
+
{
|
|
5412
|
+
href: loginLink,
|
|
5413
|
+
className: "inline-block mt-4 text-green-600 hover:text-green-700 font-medium",
|
|
5414
|
+
children: "Sign in to your account"
|
|
5415
|
+
}
|
|
5416
|
+
)
|
|
5417
|
+
] }) });
|
|
5418
|
+
}
|
|
5419
|
+
return /* @__PURE__ */ jsx("div", { className: `ec-register-form ${className}`, children: /* @__PURE__ */ jsx(
|
|
5420
|
+
Formik,
|
|
5421
|
+
{
|
|
5422
|
+
initialValues: mergedInitialValues,
|
|
5423
|
+
validationSchema,
|
|
5424
|
+
onSubmit: handleSubmit,
|
|
5425
|
+
children: ({ isSubmitting, errors, touched }) => /* @__PURE__ */ jsxs(Form, { className: `space-y-4 ${formClass}`, noValidate: true, children: [
|
|
5426
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
5427
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
5428
|
+
/* @__PURE__ */ jsxs("label", { htmlFor: "register-firstName", className: baseLabelClass, children: [
|
|
5429
|
+
"First Name ",
|
|
5430
|
+
/* @__PURE__ */ jsx("span", { className: "text-red-500", children: "*" })
|
|
5431
|
+
] }),
|
|
5432
|
+
/* @__PURE__ */ jsx(
|
|
5433
|
+
Field,
|
|
5434
|
+
{
|
|
5435
|
+
type: "text",
|
|
5436
|
+
id: "register-firstName",
|
|
5437
|
+
name: "firstName",
|
|
5438
|
+
placeholder: "John",
|
|
5439
|
+
autoComplete: "given-name",
|
|
5440
|
+
className: `${baseInputClass} ${inputClass} ${errors.firstName && touched.firstName ? "border-red-500 focus:ring-red-500" : ""}`
|
|
5441
|
+
}
|
|
5442
|
+
),
|
|
5443
|
+
/* @__PURE__ */ jsx(ErrorMessage, { name: "firstName", component: "p", className: baseErrorClass })
|
|
5444
|
+
] }),
|
|
5445
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
5446
|
+
/* @__PURE__ */ jsxs("label", { htmlFor: "register-lastName", className: baseLabelClass, children: [
|
|
5447
|
+
"Last Name ",
|
|
5448
|
+
/* @__PURE__ */ jsx("span", { className: "text-red-500", children: "*" })
|
|
5449
|
+
] }),
|
|
5450
|
+
/* @__PURE__ */ jsx(
|
|
5451
|
+
Field,
|
|
5452
|
+
{
|
|
5453
|
+
type: "text",
|
|
5454
|
+
id: "register-lastName",
|
|
5455
|
+
name: "lastName",
|
|
5456
|
+
placeholder: "Doe",
|
|
5457
|
+
autoComplete: "family-name",
|
|
5458
|
+
className: `${baseInputClass} ${inputClass} ${errors.lastName && touched.lastName ? "border-red-500 focus:ring-red-500" : ""}`
|
|
5459
|
+
}
|
|
5460
|
+
),
|
|
5461
|
+
/* @__PURE__ */ jsx(ErrorMessage, { name: "lastName", component: "p", className: baseErrorClass })
|
|
5462
|
+
] })
|
|
5463
|
+
] }),
|
|
5464
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
5465
|
+
/* @__PURE__ */ jsxs("label", { htmlFor: "register-email", className: baseLabelClass, children: [
|
|
5466
|
+
"Email ",
|
|
5467
|
+
/* @__PURE__ */ jsx("span", { className: "text-red-500", children: "*" })
|
|
5468
|
+
] }),
|
|
5469
|
+
/* @__PURE__ */ jsx(
|
|
5470
|
+
Field,
|
|
5471
|
+
{
|
|
5472
|
+
type: "email",
|
|
5473
|
+
id: "register-email",
|
|
5474
|
+
name: "email",
|
|
5475
|
+
placeholder: "you@example.com",
|
|
5476
|
+
autoComplete: "email",
|
|
5477
|
+
className: `${baseInputClass} ${inputClass} ${errors.email && touched.email ? "border-red-500 focus:ring-red-500" : ""}`
|
|
5478
|
+
}
|
|
5479
|
+
),
|
|
5480
|
+
/* @__PURE__ */ jsx(ErrorMessage, { name: "email", component: "p", className: baseErrorClass })
|
|
5481
|
+
] }),
|
|
5482
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
5483
|
+
/* @__PURE__ */ jsxs("label", { htmlFor: "register-password", className: baseLabelClass, children: [
|
|
5484
|
+
"Password ",
|
|
5485
|
+
/* @__PURE__ */ jsx("span", { className: "text-red-500", children: "*" })
|
|
5486
|
+
] }),
|
|
5487
|
+
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
5488
|
+
/* @__PURE__ */ jsx(
|
|
5489
|
+
Field,
|
|
5490
|
+
{
|
|
5491
|
+
type: showPassword ? "text" : "password",
|
|
5492
|
+
id: "register-password",
|
|
5493
|
+
name: "password",
|
|
5494
|
+
placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",
|
|
5495
|
+
autoComplete: "new-password",
|
|
5496
|
+
className: `${baseInputClass} ${inputClass} pr-12 ${errors.password && touched.password ? "border-red-500 focus:ring-red-500" : ""}`
|
|
5497
|
+
}
|
|
5498
|
+
),
|
|
5499
|
+
/* @__PURE__ */ jsx(
|
|
5500
|
+
"button",
|
|
5501
|
+
{
|
|
5502
|
+
type: "button",
|
|
5503
|
+
onClick: () => setShowPassword(!showPassword),
|
|
5504
|
+
className: "absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700",
|
|
5505
|
+
tabIndex: -1,
|
|
5506
|
+
children: showPassword ? /* @__PURE__ */ jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21" }) }) : /* @__PURE__ */ jsxs("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: [
|
|
5507
|
+
/* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }),
|
|
5508
|
+
/* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" })
|
|
5509
|
+
] })
|
|
5510
|
+
}
|
|
5511
|
+
)
|
|
5512
|
+
] }),
|
|
5513
|
+
/* @__PURE__ */ jsx(ErrorMessage, { name: "password", component: "p", className: baseErrorClass }),
|
|
5514
|
+
/* @__PURE__ */ jsxs("p", { className: "text-xs text-gray-500 mt-1", children: [
|
|
5515
|
+
"Min ",
|
|
5516
|
+
passwordRequirements.minLength,
|
|
5517
|
+
" characters",
|
|
5518
|
+
passwordRequirements.requireUppercase && ", uppercase",
|
|
5519
|
+
passwordRequirements.requireLowercase && ", lowercase",
|
|
5520
|
+
passwordRequirements.requireNumber && ", number",
|
|
5521
|
+
passwordRequirements.requireSpecial && ", special character"
|
|
5522
|
+
] })
|
|
5523
|
+
] }),
|
|
5524
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
5525
|
+
/* @__PURE__ */ jsxs("label", { htmlFor: "register-confirmPassword", className: baseLabelClass, children: [
|
|
5526
|
+
"Confirm Password ",
|
|
5527
|
+
/* @__PURE__ */ jsx("span", { className: "text-red-500", children: "*" })
|
|
5528
|
+
] }),
|
|
5529
|
+
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
5530
|
+
/* @__PURE__ */ jsx(
|
|
5531
|
+
Field,
|
|
5532
|
+
{
|
|
5533
|
+
type: showConfirmPassword ? "text" : "password",
|
|
5534
|
+
id: "register-confirmPassword",
|
|
5535
|
+
name: "confirmPassword",
|
|
5536
|
+
placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",
|
|
5537
|
+
autoComplete: "new-password",
|
|
5538
|
+
className: `${baseInputClass} ${inputClass} pr-12 ${errors.confirmPassword && touched.confirmPassword ? "border-red-500 focus:ring-red-500" : ""}`
|
|
5539
|
+
}
|
|
5540
|
+
),
|
|
5541
|
+
/* @__PURE__ */ jsx(
|
|
5542
|
+
"button",
|
|
5543
|
+
{
|
|
5544
|
+
type: "button",
|
|
5545
|
+
onClick: () => setShowConfirmPassword(!showConfirmPassword),
|
|
5546
|
+
className: "absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700",
|
|
5547
|
+
tabIndex: -1,
|
|
5548
|
+
children: showConfirmPassword ? /* @__PURE__ */ jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21" }) }) : /* @__PURE__ */ jsxs("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: [
|
|
5549
|
+
/* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }),
|
|
5550
|
+
/* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" })
|
|
5551
|
+
] })
|
|
5552
|
+
}
|
|
5553
|
+
)
|
|
5554
|
+
] }),
|
|
5555
|
+
/* @__PURE__ */ jsx(ErrorMessage, { name: "confirmPassword", component: "p", className: baseErrorClass })
|
|
5556
|
+
] }),
|
|
5557
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
5558
|
+
/* @__PURE__ */ jsxs("label", { className: "flex items-start gap-2 cursor-pointer", children: [
|
|
5559
|
+
/* @__PURE__ */ jsx(
|
|
5560
|
+
Field,
|
|
5561
|
+
{
|
|
5562
|
+
type: "checkbox",
|
|
5563
|
+
name: "acceptTerms",
|
|
5564
|
+
className: "w-4 h-4 mt-1 rounded border-gray-300 text-blue-600 focus:ring-blue-500"
|
|
5565
|
+
}
|
|
5566
|
+
),
|
|
5567
|
+
/* @__PURE__ */ jsxs("span", { className: "text-sm text-gray-600", children: [
|
|
5568
|
+
"I agree to the",
|
|
5569
|
+
" ",
|
|
5570
|
+
/* @__PURE__ */ jsx("a", { href: termsLink, className: "text-blue-600 hover:underline", target: "_blank", rel: "noopener noreferrer", children: "Terms of Service" }),
|
|
5571
|
+
" ",
|
|
5572
|
+
"and",
|
|
5573
|
+
" ",
|
|
5574
|
+
/* @__PURE__ */ jsx("a", { href: privacyLink, className: "text-blue-600 hover:underline", target: "_blank", rel: "noopener noreferrer", children: "Privacy Policy" }),
|
|
5575
|
+
/* @__PURE__ */ jsx("span", { className: "text-red-500", children: " *" })
|
|
5576
|
+
] })
|
|
5577
|
+
] }),
|
|
5578
|
+
/* @__PURE__ */ jsx(ErrorMessage, { name: "acceptTerms", component: "p", className: baseErrorClass })
|
|
5579
|
+
] }),
|
|
5580
|
+
submitStatus === "error" && /* @__PURE__ */ jsx("div", { className: "p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ jsx("p", { className: "text-red-800 text-sm", children: submitMessage }) }),
|
|
5581
|
+
/* @__PURE__ */ jsx(
|
|
5582
|
+
"button",
|
|
5583
|
+
{
|
|
5584
|
+
type: "submit",
|
|
5585
|
+
disabled: isSubmitting,
|
|
5586
|
+
className: `${baseButtonClass} ${buttonClass}`,
|
|
5587
|
+
children: isSubmitting ? /* @__PURE__ */ jsxs("span", { className: "flex items-center justify-center gap-2", children: [
|
|
5588
|
+
/* @__PURE__ */ jsxs("svg", { className: "animate-spin w-5 h-5", fill: "none", viewBox: "0 0 24 24", children: [
|
|
5589
|
+
/* @__PURE__ */ jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
5590
|
+
/* @__PURE__ */ jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
|
|
5591
|
+
] }),
|
|
5592
|
+
"Creating account..."
|
|
5593
|
+
] }) : submitText
|
|
5594
|
+
}
|
|
5595
|
+
),
|
|
5596
|
+
loginLink && /* @__PURE__ */ jsxs("p", { className: "text-center text-sm text-gray-600", children: [
|
|
5597
|
+
"Already have an account?",
|
|
5598
|
+
" ",
|
|
5599
|
+
/* @__PURE__ */ jsx("a", { href: loginLink, className: "text-blue-600 hover:text-blue-700 font-medium", children: "Sign in" })
|
|
5600
|
+
] })
|
|
5601
|
+
] })
|
|
5602
|
+
}
|
|
5603
|
+
) });
|
|
5604
|
+
}
|
|
5605
|
+
|
|
5606
|
+
export { ApiUrlBuilder, ClientLogger, ContactForm, EventEmitter, LoginForm, NewsletterForm, RegisterForm, ThemeContext, ThemeProvider, ThemeToggle, VALIDATION_MESSAGES, addDays, adjustColor, appEvents, camelToKebab, capitalize, capitalizeWords, checkPackage, clientLogger, contactFormSchema, copyToClipboard, createApiEndpoints, createApiUrlBuilder, createClientLogger, createEmptyPaginationMeta, createErrorResponse, createEventEmitter, createHttpClient, createRegisterFormSchema, createSuccessResponse, createTheme, createThemeFromBrand, cssVar, deepMerge, defaultDarkTheme, defaultLightTheme, dummyBannerData, dummyFaqItems, dummyFeatures, dummyFooterData, dummyHeaderData, dummyImage, dummyPricingPlans, dummyTestimonials, endOfDay, flattenToCssVars, formatDate, formatDateForInput, formatDateTime, formatDateTimeForInput, formatPackageCheckResult, formatRelativeTime, generateCssVars, generateNcuCommand, getContrastColor, getErrorMessage, getNextPage, getPrevPage, getResponseData, getSystemColorScheme, hasData, hasMorePages, hexToRgba, injectCssVars, isClipboardAvailable, isErrorResponse, isForbidden, isFuture, isNotFound, isPast, isServerError, isStatusError, isSuccess, isSuccessResponse, isToday, isUnauthorized, kebabToCamel, loadThemeFromUrl, loadThemeMode, loginFormSchema, loremIpsum, newsletterFormSchema, packageCheck, parseError, parseFullResponse, parseResponse, readFromClipboard, registerFormSchema, removeCssVars, resolveThemeMode, saveThemeMode, slugify, slugifyUnique, startOfDay, truncate, truncateWords, unslugify, useBattery_default as useBattery, useClickAway_default as useClickAway, useContinuousRetry_default as useContinuousRetry, useCopyToClipboard_default as useCopyToClipboard, useCountdown_default as useCountdown, useCounter_default as useCounter, useDebounce_default as useDebounce, useDefault_default as useDefault, useDocumentTitle_default as useDocumentTitle, useEventListener_default as useEventListener, useFavicon_default as useFavicon, useFetch_default as useFetch, useGeolocation_default as useGeolocation, useHistoryState_default as useHistoryState, useHover_default as useHover, useIdle_default as useIdle, useIntersectionObserver_default as useIntersectionObserver, useInterval_default as useInterval, useIntervalWhen_default as useIntervalWhen, useIsClient_default as useIsClient, useIsDesktop, useIsFirstRender_default as useIsFirstRender, useIsMobile, useIsMobileOrTablet, useIsTablet, useKeyPress_default as useKeyPress, useList_default as useList, useLocalStorage_default as useLocalStorage, useLockBodyScroll_default as useLockBodyScroll, useLogger_default as useLogger, useLongPress_default as useLongPress, useMap_default as useMap, useMeasure_default as useMeasure, useMediaQuery_default as useMediaQuery, useMouse_default as useMouse, useNetworkState_default as useNetworkState, useObjectState_default as useObjectState, useOnClickOutside_default as useOnClickOutside, useOrientation_default as useOrientation, usePageLeave_default as usePageLeave, usePageTitle_default as usePageTitle, usePreferredLanguage_default as usePreferredLanguage, usePrevious_default as usePrevious, useQueue_default as useQueue, useRandomInterval_default as useRandomInterval, useRenderCount_default as useRenderCount, useRenderInfo_default as useRenderInfo, useScript_default as useScript, useSessionStorage_default as useSessionStorage, useSet_default as useSet, useSnackbar_default as useSnackbar, useTheme, useThemeDetector_default as useThemeDetector, useThemeValue, useThrottle_default as useThrottle, useTimeout_default as useTimeout, useToggle_default as useToggle, useVisibilityChange_default as useVisibilityChange, useWindowScroll_default as useWindowScroll, useWindowSize_default as useWindowSize, withAbortSignal, withFormData, withTimeout };
|
|
2994
5607
|
//# sourceMappingURL=index.mjs.map
|
|
2995
5608
|
//# sourceMappingURL=index.mjs.map
|