@exyconn/common 2.1.0 → 2.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +864 -261
- package/dist/client/hooks/index.d.mts +1042 -0
- package/dist/client/hooks/index.d.ts +1042 -0
- package/dist/client/hooks/index.js +2276 -0
- package/dist/client/hooks/index.js.map +1 -0
- package/dist/client/hooks/index.mjs +2217 -0
- package/dist/client/hooks/index.mjs.map +1 -0
- package/dist/client/index.d.mts +3 -1
- package/dist/client/index.d.ts +3 -1
- package/dist/client/web/index.d.mts +1461 -0
- package/dist/client/web/index.d.ts +1461 -0
- package/dist/client/web/index.js +2681 -0
- package/dist/client/web/index.js.map +1 -0
- package/dist/client/web/index.mjs +2618 -0
- package/dist/client/web/index.mjs.map +1 -0
- package/dist/data/brand-identity.d.mts +149 -0
- package/dist/data/brand-identity.d.ts +149 -0
- package/dist/data/brand-identity.js +235 -0
- package/dist/data/brand-identity.js.map +1 -0
- package/dist/data/brand-identity.mjs +220 -0
- package/dist/data/brand-identity.mjs.map +1 -0
- package/dist/data/countries.d.mts +61 -0
- package/dist/data/countries.d.ts +61 -0
- package/dist/data/countries.js +987 -0
- package/dist/data/countries.js.map +1 -0
- package/dist/data/countries.mjs +971 -0
- package/dist/data/countries.mjs.map +1 -0
- package/dist/data/currencies.d.mts +19 -0
- package/dist/data/currencies.d.ts +19 -0
- package/dist/data/currencies.js +162 -0
- package/dist/data/currencies.js.map +1 -0
- package/dist/data/currencies.mjs +153 -0
- package/dist/data/currencies.mjs.map +1 -0
- package/dist/data/index.d.mts +7 -0
- package/dist/data/index.d.ts +7 -0
- package/dist/data/index.js +2087 -0
- package/dist/data/index.js.map +1 -0
- package/dist/data/index.mjs +1948 -0
- package/dist/data/index.mjs.map +1 -0
- package/dist/data/phone-codes.d.mts +15 -0
- package/dist/data/phone-codes.d.ts +15 -0
- package/dist/data/phone-codes.js +219 -0
- package/dist/data/phone-codes.js.map +1 -0
- package/dist/data/phone-codes.mjs +211 -0
- package/dist/data/phone-codes.mjs.map +1 -0
- package/dist/data/regex.d.mts +287 -0
- package/dist/data/regex.d.ts +287 -0
- package/dist/data/regex.js +306 -0
- package/dist/data/regex.js.map +1 -0
- package/dist/data/regex.mjs +208 -0
- package/dist/data/regex.mjs.map +1 -0
- package/dist/data/timezones.d.mts +16 -0
- package/dist/data/timezones.d.ts +16 -0
- package/dist/data/timezones.js +98 -0
- package/dist/data/timezones.js.map +1 -0
- package/dist/data/timezones.mjs +89 -0
- package/dist/data/timezones.mjs.map +1 -0
- package/dist/index-01hoqibP.d.ts +119 -0
- package/dist/index-D3yCCjBZ.d.mts +119 -0
- package/dist/index-D9a9oxQy.d.ts +305 -0
- package/dist/index-DKn4raO7.d.ts +222 -0
- package/dist/index-DuxL84IW.d.mts +305 -0
- package/dist/index-NS8dS0p9.d.mts +222 -0
- package/dist/index-Nqm5_lwT.d.ts +188 -0
- package/dist/index-jBi3V6e5.d.mts +188 -0
- package/dist/index.d.mts +20 -579
- package/dist/index.d.ts +20 -579
- package/dist/index.js +717 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +716 -18
- package/dist/index.mjs.map +1 -1
- package/dist/server/configs/index.d.mts +602 -0
- package/dist/server/configs/index.d.ts +602 -0
- package/dist/server/configs/index.js +707 -0
- package/dist/server/configs/index.js.map +1 -0
- package/dist/server/configs/index.mjs +665 -0
- package/dist/server/configs/index.mjs.map +1 -0
- package/dist/server/index.d.mts +3 -0
- package/dist/server/index.d.ts +3 -0
- package/dist/server/index.js +699 -0
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +662 -1
- package/dist/server/index.mjs.map +1 -1
- package/dist/shared/config/index.d.mts +40 -0
- package/dist/shared/config/index.d.ts +40 -0
- package/dist/shared/config/index.js +58 -0
- package/dist/shared/config/index.js.map +1 -0
- package/dist/shared/config/index.mjs +51 -0
- package/dist/shared/config/index.mjs.map +1 -0
- package/dist/shared/constants/index.d.mts +593 -0
- package/dist/shared/constants/index.d.ts +593 -0
- package/dist/shared/constants/index.js +391 -0
- package/dist/shared/constants/index.js.map +1 -0
- package/dist/shared/constants/index.mjs +360 -0
- package/dist/shared/constants/index.mjs.map +1 -0
- package/dist/shared/index.d.mts +5 -1
- package/dist/shared/index.d.ts +5 -1
- package/dist/shared/types/index.d.mts +140 -0
- package/dist/shared/types/index.d.ts +140 -0
- package/dist/shared/types/index.js +4 -0
- package/dist/shared/types/index.js.map +1 -0
- package/dist/shared/types/index.mjs +3 -0
- package/dist/shared/types/index.mjs.map +1 -0
- package/dist/shared/utils/index.d.mts +255 -0
- package/dist/shared/utils/index.d.ts +255 -0
- package/dist/shared/utils/index.js +623 -0
- package/dist/shared/utils/index.js.map +1 -0
- package/dist/shared/utils/index.mjs +324 -0
- package/dist/shared/utils/index.mjs.map +1 -0
- package/dist/shared/validation/index.d.mts +258 -0
- package/dist/shared/validation/index.d.ts +258 -0
- package/dist/shared/validation/index.js +185 -0
- package/dist/shared/validation/index.js.map +1 -0
- package/dist/shared/validation/index.mjs +172 -0
- package/dist/shared/validation/index.mjs.map +1 -0
- package/package.json +127 -62
- package/dist/index-BcxL4_V4.d.ts +0 -2946
- package/dist/index-DEzgM15j.d.ts +0 -67
- package/dist/index-DNFVgQx8.d.ts +0 -1375
- package/dist/index-DbV04Dx8.d.mts +0 -67
- package/dist/index-DfqEP6Oe.d.mts +0 -1375
- package/dist/index-bvvCev9Q.d.mts +0 -2946
|
@@ -0,0 +1,2681 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var react = require('react');
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var Yup = require('yup');
|
|
6
|
+
var formik = require('formik');
|
|
7
|
+
|
|
8
|
+
function _interopNamespace(e) {
|
|
9
|
+
if (e && e.__esModule) return e;
|
|
10
|
+
var n = Object.create(null);
|
|
11
|
+
if (e) {
|
|
12
|
+
Object.keys(e).forEach(function (k) {
|
|
13
|
+
if (k !== 'default') {
|
|
14
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return e[k]; }
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
n.default = e;
|
|
23
|
+
return Object.freeze(n);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
var Yup__namespace = /*#__PURE__*/_interopNamespace(Yup);
|
|
27
|
+
|
|
28
|
+
// src/client/web/theme/default-light-theme.ts
|
|
29
|
+
var defaultLightTheme = {
|
|
30
|
+
name: "default-light",
|
|
31
|
+
mode: "light",
|
|
32
|
+
colors: {
|
|
33
|
+
brand: {
|
|
34
|
+
primary: "#3b82f6",
|
|
35
|
+
secondary: "#6366f1",
|
|
36
|
+
accent: "#f59e0b",
|
|
37
|
+
background: "#ffffff",
|
|
38
|
+
foreground: "#111827"
|
|
39
|
+
},
|
|
40
|
+
semantic: {
|
|
41
|
+
primary: "#3b82f6",
|
|
42
|
+
primaryHover: "#2563eb",
|
|
43
|
+
primaryActive: "#1d4ed8",
|
|
44
|
+
primaryDisabled: "#93c5fd",
|
|
45
|
+
secondary: "#6366f1",
|
|
46
|
+
secondaryHover: "#4f46e5",
|
|
47
|
+
secondaryActive: "#4338ca",
|
|
48
|
+
secondaryDisabled: "#a5b4fc",
|
|
49
|
+
accent: "#f59e0b",
|
|
50
|
+
accentHover: "#d97706",
|
|
51
|
+
success: "#22c55e",
|
|
52
|
+
successHover: "#16a34a",
|
|
53
|
+
warning: "#f59e0b",
|
|
54
|
+
warningHover: "#d97706",
|
|
55
|
+
error: "#ef4444",
|
|
56
|
+
errorHover: "#dc2626",
|
|
57
|
+
info: "#3b82f6",
|
|
58
|
+
infoHover: "#2563eb"
|
|
59
|
+
},
|
|
60
|
+
background: {
|
|
61
|
+
default: "#ffffff",
|
|
62
|
+
paper: "#f9fafb",
|
|
63
|
+
card: "#ffffff",
|
|
64
|
+
overlay: "rgba(0, 0, 0, 0.5)",
|
|
65
|
+
input: "#ffffff",
|
|
66
|
+
disabled: "#f3f4f6",
|
|
67
|
+
hover: "#f3f4f6",
|
|
68
|
+
selected: "#eff6ff"
|
|
69
|
+
},
|
|
70
|
+
surface: {
|
|
71
|
+
light: "#f9fafb",
|
|
72
|
+
main: "#f3f4f6",
|
|
73
|
+
dark: "#e5e7eb"
|
|
74
|
+
},
|
|
75
|
+
text: {
|
|
76
|
+
primary: "#111827",
|
|
77
|
+
secondary: "#6b7280",
|
|
78
|
+
disabled: "#9ca3af",
|
|
79
|
+
placeholder: "#9ca3af",
|
|
80
|
+
link: "#3b82f6",
|
|
81
|
+
linkHover: "#2563eb",
|
|
82
|
+
inverse: "#ffffff",
|
|
83
|
+
onPrimary: "#ffffff",
|
|
84
|
+
onSecondary: "#ffffff"
|
|
85
|
+
},
|
|
86
|
+
border: {
|
|
87
|
+
default: "#e5e7eb",
|
|
88
|
+
light: "#f3f4f6",
|
|
89
|
+
dark: "#d1d5db",
|
|
90
|
+
focus: "#3b82f6",
|
|
91
|
+
error: "#ef4444",
|
|
92
|
+
success: "#22c55e",
|
|
93
|
+
disabled: "#e5e7eb"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
shadows: {
|
|
97
|
+
none: "none",
|
|
98
|
+
xs: "0 1px 2px 0 rgb(0 0 0 / 0.05)",
|
|
99
|
+
sm: "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",
|
|
100
|
+
md: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
|
|
101
|
+
lg: "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",
|
|
102
|
+
xl: "0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)",
|
|
103
|
+
"2xl": "0 25px 50px -12px rgb(0 0 0 / 0.25)",
|
|
104
|
+
inner: "inset 0 2px 4px 0 rgb(0 0 0 / 0.05)",
|
|
105
|
+
button: "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",
|
|
106
|
+
buttonHover: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
|
|
107
|
+
card: "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",
|
|
108
|
+
cardHover: "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",
|
|
109
|
+
modal: "0 25px 50px -12px rgb(0 0 0 / 0.25)",
|
|
110
|
+
dropdown: "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)"
|
|
111
|
+
},
|
|
112
|
+
typography: {
|
|
113
|
+
fontFamily: {
|
|
114
|
+
sans: 'Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
|
|
115
|
+
serif: 'ui-serif, Georgia, Cambria, "Times New Roman", Times, serif',
|
|
116
|
+
mono: 'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace',
|
|
117
|
+
heading: 'Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
118
|
+
body: 'Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'
|
|
119
|
+
},
|
|
120
|
+
fontSize: {
|
|
121
|
+
xs: "0.75rem",
|
|
122
|
+
sm: "0.875rem",
|
|
123
|
+
base: "1rem",
|
|
124
|
+
lg: "1.125rem",
|
|
125
|
+
xl: "1.25rem",
|
|
126
|
+
"2xl": "1.5rem",
|
|
127
|
+
"3xl": "1.875rem",
|
|
128
|
+
"4xl": "2.25rem",
|
|
129
|
+
"5xl": "3rem",
|
|
130
|
+
"6xl": "3.75rem"
|
|
131
|
+
},
|
|
132
|
+
fontWeight: {
|
|
133
|
+
light: 300,
|
|
134
|
+
normal: 400,
|
|
135
|
+
medium: 500,
|
|
136
|
+
semibold: 600,
|
|
137
|
+
bold: 700,
|
|
138
|
+
extrabold: 800
|
|
139
|
+
},
|
|
140
|
+
lineHeight: {
|
|
141
|
+
none: 1,
|
|
142
|
+
tight: 1.25,
|
|
143
|
+
snug: 1.375,
|
|
144
|
+
normal: 1.5,
|
|
145
|
+
relaxed: 1.625,
|
|
146
|
+
loose: 2
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
spacing: {
|
|
150
|
+
0: "0",
|
|
151
|
+
px: "1px",
|
|
152
|
+
0.5: "0.125rem",
|
|
153
|
+
1: "0.25rem",
|
|
154
|
+
1.5: "0.375rem",
|
|
155
|
+
2: "0.5rem",
|
|
156
|
+
2.5: "0.625rem",
|
|
157
|
+
3: "0.75rem",
|
|
158
|
+
3.5: "0.875rem",
|
|
159
|
+
4: "1rem",
|
|
160
|
+
5: "1.25rem",
|
|
161
|
+
6: "1.5rem",
|
|
162
|
+
7: "1.75rem",
|
|
163
|
+
8: "2rem",
|
|
164
|
+
9: "2.25rem",
|
|
165
|
+
10: "2.5rem",
|
|
166
|
+
11: "2.75rem",
|
|
167
|
+
12: "3rem",
|
|
168
|
+
14: "3.5rem",
|
|
169
|
+
16: "4rem",
|
|
170
|
+
20: "5rem",
|
|
171
|
+
24: "6rem",
|
|
172
|
+
28: "7rem",
|
|
173
|
+
32: "8rem",
|
|
174
|
+
36: "9rem",
|
|
175
|
+
40: "10rem",
|
|
176
|
+
44: "11rem",
|
|
177
|
+
48: "12rem",
|
|
178
|
+
52: "13rem",
|
|
179
|
+
56: "14rem",
|
|
180
|
+
60: "15rem",
|
|
181
|
+
64: "16rem",
|
|
182
|
+
72: "18rem",
|
|
183
|
+
80: "20rem",
|
|
184
|
+
96: "24rem"
|
|
185
|
+
},
|
|
186
|
+
borderRadius: {
|
|
187
|
+
none: "0",
|
|
188
|
+
sm: "0.125rem",
|
|
189
|
+
default: "0.25rem",
|
|
190
|
+
md: "0.375rem",
|
|
191
|
+
lg: "0.5rem",
|
|
192
|
+
xl: "0.75rem",
|
|
193
|
+
"2xl": "1rem",
|
|
194
|
+
"3xl": "1.5rem",
|
|
195
|
+
full: "9999px"
|
|
196
|
+
},
|
|
197
|
+
breakpoints: {
|
|
198
|
+
xs: "475px",
|
|
199
|
+
sm: "640px",
|
|
200
|
+
md: "768px",
|
|
201
|
+
lg: "1024px",
|
|
202
|
+
xl: "1280px",
|
|
203
|
+
"2xl": "1536px"
|
|
204
|
+
},
|
|
205
|
+
zIndex: {
|
|
206
|
+
hide: -1,
|
|
207
|
+
auto: "auto",
|
|
208
|
+
base: 0,
|
|
209
|
+
dropdown: 1e3,
|
|
210
|
+
sticky: 1020,
|
|
211
|
+
fixed: 1030,
|
|
212
|
+
modalBackdrop: 1040,
|
|
213
|
+
modal: 1050,
|
|
214
|
+
popover: 1060,
|
|
215
|
+
tooltip: 1070,
|
|
216
|
+
toast: 1080
|
|
217
|
+
},
|
|
218
|
+
transitions: {
|
|
219
|
+
none: "none",
|
|
220
|
+
fast: "150ms ease-in-out",
|
|
221
|
+
normal: "200ms ease-in-out",
|
|
222
|
+
slow: "300ms ease-in-out",
|
|
223
|
+
slower: "500ms ease-in-out",
|
|
224
|
+
colors: "color 200ms ease-in-out, background-color 200ms ease-in-out, border-color 200ms ease-in-out",
|
|
225
|
+
transform: "transform 200ms ease-in-out",
|
|
226
|
+
opacity: "opacity 200ms ease-in-out",
|
|
227
|
+
shadow: "box-shadow 200ms ease-in-out",
|
|
228
|
+
all: "all 200ms ease-in-out"
|
|
229
|
+
},
|
|
230
|
+
components: {
|
|
231
|
+
button: {
|
|
232
|
+
bg: "#3b82f6",
|
|
233
|
+
bgHover: "#2563eb",
|
|
234
|
+
bgActive: "#1d4ed8",
|
|
235
|
+
bgDisabled: "#93c5fd",
|
|
236
|
+
color: "#ffffff",
|
|
237
|
+
colorHover: "#ffffff",
|
|
238
|
+
colorDisabled: "#ffffff",
|
|
239
|
+
border: "transparent",
|
|
240
|
+
borderHover: "transparent",
|
|
241
|
+
borderWidth: "1px",
|
|
242
|
+
borderRadius: "0.375rem",
|
|
243
|
+
shadow: "0 1px 3px 0 rgb(0 0 0 / 0.1)",
|
|
244
|
+
shadowHover: "0 4px 6px -1px rgb(0 0 0 / 0.1)",
|
|
245
|
+
paddingX: "1rem",
|
|
246
|
+
paddingY: "0.5rem",
|
|
247
|
+
fontSize: "0.875rem",
|
|
248
|
+
fontWeight: 500,
|
|
249
|
+
variants: {
|
|
250
|
+
primary: {
|
|
251
|
+
bg: "#3b82f6",
|
|
252
|
+
bgHover: "#2563eb",
|
|
253
|
+
color: "#ffffff"
|
|
254
|
+
},
|
|
255
|
+
secondary: {
|
|
256
|
+
bg: "#6366f1",
|
|
257
|
+
bgHover: "#4f46e5",
|
|
258
|
+
color: "#ffffff"
|
|
259
|
+
},
|
|
260
|
+
outline: {
|
|
261
|
+
bg: "transparent",
|
|
262
|
+
bgHover: "#f3f4f6",
|
|
263
|
+
color: "#374151",
|
|
264
|
+
border: "#d1d5db",
|
|
265
|
+
borderHover: "#9ca3af"
|
|
266
|
+
},
|
|
267
|
+
ghost: {
|
|
268
|
+
bg: "transparent",
|
|
269
|
+
bgHover: "#f3f4f6",
|
|
270
|
+
color: "#374151",
|
|
271
|
+
shadow: "none",
|
|
272
|
+
shadowHover: "none"
|
|
273
|
+
},
|
|
274
|
+
link: {
|
|
275
|
+
bg: "transparent",
|
|
276
|
+
bgHover: "transparent",
|
|
277
|
+
color: "#3b82f6",
|
|
278
|
+
colorHover: "#2563eb",
|
|
279
|
+
shadow: "none",
|
|
280
|
+
shadowHover: "none",
|
|
281
|
+
paddingX: "0",
|
|
282
|
+
paddingY: "0"
|
|
283
|
+
},
|
|
284
|
+
danger: {
|
|
285
|
+
bg: "#ef4444",
|
|
286
|
+
bgHover: "#dc2626",
|
|
287
|
+
color: "#ffffff"
|
|
288
|
+
},
|
|
289
|
+
success: {
|
|
290
|
+
bg: "#22c55e",
|
|
291
|
+
bgHover: "#16a34a",
|
|
292
|
+
color: "#ffffff"
|
|
293
|
+
}
|
|
294
|
+
},
|
|
295
|
+
sizes: {
|
|
296
|
+
xs: {
|
|
297
|
+
paddingX: "0.5rem",
|
|
298
|
+
paddingY: "0.25rem",
|
|
299
|
+
fontSize: "0.75rem"
|
|
300
|
+
},
|
|
301
|
+
sm: {
|
|
302
|
+
paddingX: "0.75rem",
|
|
303
|
+
paddingY: "0.375rem",
|
|
304
|
+
fontSize: "0.875rem"
|
|
305
|
+
},
|
|
306
|
+
md: {
|
|
307
|
+
paddingX: "1rem",
|
|
308
|
+
paddingY: "0.5rem",
|
|
309
|
+
fontSize: "0.875rem"
|
|
310
|
+
},
|
|
311
|
+
lg: {
|
|
312
|
+
paddingX: "1.25rem",
|
|
313
|
+
paddingY: "0.625rem",
|
|
314
|
+
fontSize: "1rem"
|
|
315
|
+
},
|
|
316
|
+
xl: {
|
|
317
|
+
paddingX: "1.5rem",
|
|
318
|
+
paddingY: "0.75rem",
|
|
319
|
+
fontSize: "1.125rem"
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
},
|
|
323
|
+
input: {
|
|
324
|
+
bg: "#ffffff",
|
|
325
|
+
bgFocus: "#ffffff",
|
|
326
|
+
bgDisabled: "#f3f4f6",
|
|
327
|
+
bgError: "#fef2f2",
|
|
328
|
+
color: "#111827",
|
|
329
|
+
colorPlaceholder: "#9ca3af",
|
|
330
|
+
colorDisabled: "#9ca3af",
|
|
331
|
+
border: "#d1d5db",
|
|
332
|
+
borderFocus: "#3b82f6",
|
|
333
|
+
borderError: "#ef4444",
|
|
334
|
+
borderWidth: "1px",
|
|
335
|
+
borderRadius: "0.375rem",
|
|
336
|
+
shadow: "0 1px 2px 0 rgb(0 0 0 / 0.05)",
|
|
337
|
+
shadowFocus: "0 0 0 3px rgb(59 130 246 / 0.1)",
|
|
338
|
+
paddingX: "0.75rem",
|
|
339
|
+
paddingY: "0.5rem",
|
|
340
|
+
fontSize: "0.875rem",
|
|
341
|
+
labelColor: "#374151",
|
|
342
|
+
labelFontSize: "0.875rem",
|
|
343
|
+
labelFontWeight: 500,
|
|
344
|
+
helperColor: "#6b7280",
|
|
345
|
+
errorColor: "#ef4444",
|
|
346
|
+
sizes: {
|
|
347
|
+
sm: {
|
|
348
|
+
paddingX: "0.5rem",
|
|
349
|
+
paddingY: "0.375rem",
|
|
350
|
+
fontSize: "0.75rem"
|
|
351
|
+
},
|
|
352
|
+
md: {
|
|
353
|
+
paddingX: "0.75rem",
|
|
354
|
+
paddingY: "0.5rem",
|
|
355
|
+
fontSize: "0.875rem"
|
|
356
|
+
},
|
|
357
|
+
lg: {
|
|
358
|
+
paddingX: "1rem",
|
|
359
|
+
paddingY: "0.625rem",
|
|
360
|
+
fontSize: "1rem"
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
card: {
|
|
365
|
+
bg: "#ffffff",
|
|
366
|
+
bgHover: "#ffffff",
|
|
367
|
+
border: "#e5e7eb",
|
|
368
|
+
borderWidth: "1px",
|
|
369
|
+
borderRadius: "0.5rem",
|
|
370
|
+
shadow: "0 1px 3px 0 rgb(0 0 0 / 0.1)",
|
|
371
|
+
shadowHover: "0 10px 15px -3px rgb(0 0 0 / 0.1)",
|
|
372
|
+
padding: "1.5rem",
|
|
373
|
+
headerBg: "#f9fafb",
|
|
374
|
+
headerBorder: "#e5e7eb",
|
|
375
|
+
headerPadding: "1rem 1.5rem",
|
|
376
|
+
footerBg: "#f9fafb",
|
|
377
|
+
footerBorder: "#e5e7eb",
|
|
378
|
+
footerPadding: "1rem 1.5rem"
|
|
379
|
+
},
|
|
380
|
+
header: {
|
|
381
|
+
bg: "#ffffff",
|
|
382
|
+
bgScrolled: "rgba(255, 255, 255, 0.95)",
|
|
383
|
+
color: "#111827",
|
|
384
|
+
border: "#e5e7eb",
|
|
385
|
+
shadow: "none",
|
|
386
|
+
shadowScrolled: "0 1px 3px 0 rgb(0 0 0 / 0.1)",
|
|
387
|
+
height: "4rem",
|
|
388
|
+
paddingX: "1.5rem",
|
|
389
|
+
logoHeight: "2rem",
|
|
390
|
+
navColor: "#374151",
|
|
391
|
+
navColorHover: "#111827",
|
|
392
|
+
navColorActive: "#3b82f6",
|
|
393
|
+
navFontSize: "0.875rem",
|
|
394
|
+
navFontWeight: 500,
|
|
395
|
+
mobileMenuBg: "#ffffff",
|
|
396
|
+
mobileMenuShadow: "0 10px 15px -3px rgb(0 0 0 / 0.1)"
|
|
397
|
+
},
|
|
398
|
+
footer: {
|
|
399
|
+
bg: "#111827",
|
|
400
|
+
color: "#d1d5db",
|
|
401
|
+
colorMuted: "#9ca3af",
|
|
402
|
+
border: "#374151",
|
|
403
|
+
padding: "4rem 1.5rem",
|
|
404
|
+
linkColor: "#d1d5db",
|
|
405
|
+
linkColorHover: "#ffffff",
|
|
406
|
+
headingColor: "#ffffff",
|
|
407
|
+
headingFontSize: "1rem",
|
|
408
|
+
headingFontWeight: 600,
|
|
409
|
+
copyrightBg: "#0f172a",
|
|
410
|
+
copyrightColor: "#9ca3af"
|
|
411
|
+
},
|
|
412
|
+
banner: {
|
|
413
|
+
bg: "#eff6ff",
|
|
414
|
+
color: "#1e40af",
|
|
415
|
+
border: "#bfdbfe",
|
|
416
|
+
borderRadius: "0.5rem",
|
|
417
|
+
padding: "1rem 1.5rem",
|
|
418
|
+
shadow: "none",
|
|
419
|
+
closeBg: "transparent",
|
|
420
|
+
closeColor: "#1e40af",
|
|
421
|
+
variants: {
|
|
422
|
+
info: {
|
|
423
|
+
bg: "#eff6ff",
|
|
424
|
+
color: "#1e40af",
|
|
425
|
+
border: "#bfdbfe"
|
|
426
|
+
},
|
|
427
|
+
success: {
|
|
428
|
+
bg: "#f0fdf4",
|
|
429
|
+
color: "#166534",
|
|
430
|
+
border: "#bbf7d0"
|
|
431
|
+
},
|
|
432
|
+
warning: {
|
|
433
|
+
bg: "#fffbeb",
|
|
434
|
+
color: "#92400e",
|
|
435
|
+
border: "#fde68a"
|
|
436
|
+
},
|
|
437
|
+
error: {
|
|
438
|
+
bg: "#fef2f2",
|
|
439
|
+
color: "#991b1b",
|
|
440
|
+
border: "#fecaca"
|
|
441
|
+
},
|
|
442
|
+
promo: {
|
|
443
|
+
bg: "#faf5ff",
|
|
444
|
+
color: "#6b21a8",
|
|
445
|
+
border: "#e9d5ff"
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
},
|
|
449
|
+
loader: {
|
|
450
|
+
color: "#3b82f6",
|
|
451
|
+
colorSecondary: "#e5e7eb",
|
|
452
|
+
size: "2.5rem",
|
|
453
|
+
borderWidth: "3px",
|
|
454
|
+
overlayBg: "rgba(255, 255, 255, 0.8)",
|
|
455
|
+
overlayOpacity: 1,
|
|
456
|
+
sizes: {
|
|
457
|
+
xs: "1rem",
|
|
458
|
+
sm: "1.5rem",
|
|
459
|
+
md: "2.5rem",
|
|
460
|
+
lg: "3.5rem",
|
|
461
|
+
xl: "5rem"
|
|
462
|
+
}
|
|
463
|
+
},
|
|
464
|
+
modal: {
|
|
465
|
+
bg: "#ffffff",
|
|
466
|
+
color: "#111827",
|
|
467
|
+
border: "#e5e7eb",
|
|
468
|
+
borderRadius: "0.5rem",
|
|
469
|
+
shadow: "0 25px 50px -12px rgb(0 0 0 / 0.25)",
|
|
470
|
+
padding: "1.5rem",
|
|
471
|
+
overlayBg: "rgba(0, 0, 0, 0.5)",
|
|
472
|
+
overlayOpacity: 1,
|
|
473
|
+
headerBg: "#ffffff",
|
|
474
|
+
headerBorder: "#e5e7eb",
|
|
475
|
+
headerPadding: "1rem 1.5rem",
|
|
476
|
+
footerBg: "#f9fafb",
|
|
477
|
+
footerBorder: "#e5e7eb",
|
|
478
|
+
footerPadding: "1rem 1.5rem",
|
|
479
|
+
closeBg: "transparent",
|
|
480
|
+
closeColor: "#6b7280",
|
|
481
|
+
closeHoverBg: "#f3f4f6",
|
|
482
|
+
sizes: {
|
|
483
|
+
sm: "24rem",
|
|
484
|
+
md: "32rem",
|
|
485
|
+
lg: "48rem",
|
|
486
|
+
xl: "64rem",
|
|
487
|
+
full: "100%"
|
|
488
|
+
}
|
|
489
|
+
},
|
|
490
|
+
toast: {
|
|
491
|
+
bg: "#ffffff",
|
|
492
|
+
color: "#111827",
|
|
493
|
+
border: "#e5e7eb",
|
|
494
|
+
borderRadius: "0.5rem",
|
|
495
|
+
shadow: "0 10px 15px -3px rgb(0 0 0 / 0.1)",
|
|
496
|
+
padding: "1rem",
|
|
497
|
+
variants: {
|
|
498
|
+
success: {
|
|
499
|
+
bg: "#f0fdf4",
|
|
500
|
+
color: "#166534",
|
|
501
|
+
border: "#bbf7d0"
|
|
502
|
+
},
|
|
503
|
+
error: {
|
|
504
|
+
bg: "#fef2f2",
|
|
505
|
+
color: "#991b1b",
|
|
506
|
+
border: "#fecaca"
|
|
507
|
+
},
|
|
508
|
+
warning: {
|
|
509
|
+
bg: "#fffbeb",
|
|
510
|
+
color: "#92400e",
|
|
511
|
+
border: "#fde68a"
|
|
512
|
+
},
|
|
513
|
+
info: {
|
|
514
|
+
bg: "#eff6ff",
|
|
515
|
+
color: "#1e40af",
|
|
516
|
+
border: "#bfdbfe"
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
},
|
|
520
|
+
newsletter: {
|
|
521
|
+
bg: "#f9fafb",
|
|
522
|
+
color: "#111827",
|
|
523
|
+
border: "#e5e7eb",
|
|
524
|
+
borderRadius: "0.5rem",
|
|
525
|
+
padding: "2rem",
|
|
526
|
+
titleColor: "#111827",
|
|
527
|
+
titleFontSize: "1.5rem",
|
|
528
|
+
descColor: "#6b7280",
|
|
529
|
+
descFontSize: "1rem",
|
|
530
|
+
inputBg: "#ffffff",
|
|
531
|
+
inputBorder: "#d1d5db",
|
|
532
|
+
buttonBg: "#3b82f6",
|
|
533
|
+
buttonColor: "#ffffff"
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
};
|
|
537
|
+
|
|
538
|
+
// src/client/web/theme/default-dark-theme.ts
|
|
539
|
+
var defaultDarkTheme = {
|
|
540
|
+
name: "default-dark",
|
|
541
|
+
mode: "dark",
|
|
542
|
+
colors: {
|
|
543
|
+
brand: {
|
|
544
|
+
primary: "#60a5fa",
|
|
545
|
+
secondary: "#818cf8",
|
|
546
|
+
accent: "#fbbf24",
|
|
547
|
+
background: "#0f172a",
|
|
548
|
+
foreground: "#f8fafc"
|
|
549
|
+
},
|
|
550
|
+
semantic: {
|
|
551
|
+
primary: "#60a5fa",
|
|
552
|
+
primaryHover: "#3b82f6",
|
|
553
|
+
primaryActive: "#2563eb",
|
|
554
|
+
primaryDisabled: "#1e3a5f",
|
|
555
|
+
secondary: "#818cf8",
|
|
556
|
+
secondaryHover: "#6366f1",
|
|
557
|
+
secondaryActive: "#4f46e5",
|
|
558
|
+
secondaryDisabled: "#312e81",
|
|
559
|
+
accent: "#fbbf24",
|
|
560
|
+
accentHover: "#f59e0b",
|
|
561
|
+
success: "#4ade80",
|
|
562
|
+
successHover: "#22c55e",
|
|
563
|
+
warning: "#fbbf24",
|
|
564
|
+
warningHover: "#f59e0b",
|
|
565
|
+
error: "#f87171",
|
|
566
|
+
errorHover: "#ef4444",
|
|
567
|
+
info: "#60a5fa",
|
|
568
|
+
infoHover: "#3b82f6"
|
|
569
|
+
},
|
|
570
|
+
background: {
|
|
571
|
+
default: "#0f172a",
|
|
572
|
+
paper: "#1e293b",
|
|
573
|
+
card: "#1e293b",
|
|
574
|
+
overlay: "rgba(0, 0, 0, 0.7)",
|
|
575
|
+
input: "#1e293b",
|
|
576
|
+
disabled: "#334155",
|
|
577
|
+
hover: "#334155",
|
|
578
|
+
selected: "#1e3a5f"
|
|
579
|
+
},
|
|
580
|
+
surface: {
|
|
581
|
+
light: "#334155",
|
|
582
|
+
main: "#1e293b",
|
|
583
|
+
dark: "#0f172a"
|
|
584
|
+
},
|
|
585
|
+
text: {
|
|
586
|
+
primary: "#f8fafc",
|
|
587
|
+
secondary: "#94a3b8",
|
|
588
|
+
disabled: "#64748b",
|
|
589
|
+
placeholder: "#64748b",
|
|
590
|
+
link: "#60a5fa",
|
|
591
|
+
linkHover: "#3b82f6",
|
|
592
|
+
inverse: "#0f172a",
|
|
593
|
+
onPrimary: "#0f172a",
|
|
594
|
+
onSecondary: "#0f172a"
|
|
595
|
+
},
|
|
596
|
+
border: {
|
|
597
|
+
default: "#334155",
|
|
598
|
+
light: "#475569",
|
|
599
|
+
dark: "#1e293b",
|
|
600
|
+
focus: "#60a5fa",
|
|
601
|
+
error: "#f87171",
|
|
602
|
+
success: "#4ade80",
|
|
603
|
+
disabled: "#334155"
|
|
604
|
+
}
|
|
605
|
+
},
|
|
606
|
+
shadows: {
|
|
607
|
+
none: "none",
|
|
608
|
+
xs: "0 1px 2px 0 rgb(0 0 0 / 0.3)",
|
|
609
|
+
sm: "0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.4)",
|
|
610
|
+
md: "0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4)",
|
|
611
|
+
lg: "0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4)",
|
|
612
|
+
xl: "0 20px 25px -5px rgb(0 0 0 / 0.4), 0 8px 10px -6px rgb(0 0 0 / 0.4)",
|
|
613
|
+
"2xl": "0 25px 50px -12px rgb(0 0 0 / 0.6)",
|
|
614
|
+
inner: "inset 0 2px 4px 0 rgb(0 0 0 / 0.3)",
|
|
615
|
+
button: "0 1px 3px 0 rgb(0 0 0 / 0.4)",
|
|
616
|
+
buttonHover: "0 4px 6px -1px rgb(0 0 0 / 0.4)",
|
|
617
|
+
card: "0 1px 3px 0 rgb(0 0 0 / 0.4)",
|
|
618
|
+
cardHover: "0 10px 15px -3px rgb(0 0 0 / 0.4)",
|
|
619
|
+
modal: "0 25px 50px -12px rgb(0 0 0 / 0.6)",
|
|
620
|
+
dropdown: "0 10px 15px -3px rgb(0 0 0 / 0.4)"
|
|
621
|
+
},
|
|
622
|
+
typography: {
|
|
623
|
+
fontFamily: {
|
|
624
|
+
sans: 'Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
|
|
625
|
+
serif: 'ui-serif, Georgia, Cambria, "Times New Roman", Times, serif',
|
|
626
|
+
mono: 'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace',
|
|
627
|
+
heading: 'Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
628
|
+
body: 'Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'
|
|
629
|
+
},
|
|
630
|
+
fontSize: {
|
|
631
|
+
xs: "0.75rem",
|
|
632
|
+
sm: "0.875rem",
|
|
633
|
+
base: "1rem",
|
|
634
|
+
lg: "1.125rem",
|
|
635
|
+
xl: "1.25rem",
|
|
636
|
+
"2xl": "1.5rem",
|
|
637
|
+
"3xl": "1.875rem",
|
|
638
|
+
"4xl": "2.25rem",
|
|
639
|
+
"5xl": "3rem",
|
|
640
|
+
"6xl": "3.75rem"
|
|
641
|
+
},
|
|
642
|
+
fontWeight: {
|
|
643
|
+
light: 300,
|
|
644
|
+
normal: 400,
|
|
645
|
+
medium: 500,
|
|
646
|
+
semibold: 600,
|
|
647
|
+
bold: 700,
|
|
648
|
+
extrabold: 800
|
|
649
|
+
},
|
|
650
|
+
lineHeight: {
|
|
651
|
+
none: 1,
|
|
652
|
+
tight: 1.25,
|
|
653
|
+
snug: 1.375,
|
|
654
|
+
normal: 1.5,
|
|
655
|
+
relaxed: 1.625,
|
|
656
|
+
loose: 2
|
|
657
|
+
}
|
|
658
|
+
},
|
|
659
|
+
spacing: {
|
|
660
|
+
0: "0",
|
|
661
|
+
px: "1px",
|
|
662
|
+
0.5: "0.125rem",
|
|
663
|
+
1: "0.25rem",
|
|
664
|
+
1.5: "0.375rem",
|
|
665
|
+
2: "0.5rem",
|
|
666
|
+
2.5: "0.625rem",
|
|
667
|
+
3: "0.75rem",
|
|
668
|
+
3.5: "0.875rem",
|
|
669
|
+
4: "1rem",
|
|
670
|
+
5: "1.25rem",
|
|
671
|
+
6: "1.5rem",
|
|
672
|
+
7: "1.75rem",
|
|
673
|
+
8: "2rem",
|
|
674
|
+
9: "2.25rem",
|
|
675
|
+
10: "2.5rem",
|
|
676
|
+
11: "2.75rem",
|
|
677
|
+
12: "3rem",
|
|
678
|
+
14: "3.5rem",
|
|
679
|
+
16: "4rem",
|
|
680
|
+
20: "5rem",
|
|
681
|
+
24: "6rem",
|
|
682
|
+
28: "7rem",
|
|
683
|
+
32: "8rem",
|
|
684
|
+
36: "9rem",
|
|
685
|
+
40: "10rem",
|
|
686
|
+
44: "11rem",
|
|
687
|
+
48: "12rem",
|
|
688
|
+
52: "13rem",
|
|
689
|
+
56: "14rem",
|
|
690
|
+
60: "15rem",
|
|
691
|
+
64: "16rem",
|
|
692
|
+
72: "18rem",
|
|
693
|
+
80: "20rem",
|
|
694
|
+
96: "24rem"
|
|
695
|
+
},
|
|
696
|
+
borderRadius: {
|
|
697
|
+
none: "0",
|
|
698
|
+
sm: "0.125rem",
|
|
699
|
+
default: "0.25rem",
|
|
700
|
+
md: "0.375rem",
|
|
701
|
+
lg: "0.5rem",
|
|
702
|
+
xl: "0.75rem",
|
|
703
|
+
"2xl": "1rem",
|
|
704
|
+
"3xl": "1.5rem",
|
|
705
|
+
full: "9999px"
|
|
706
|
+
},
|
|
707
|
+
breakpoints: {
|
|
708
|
+
xs: "475px",
|
|
709
|
+
sm: "640px",
|
|
710
|
+
md: "768px",
|
|
711
|
+
lg: "1024px",
|
|
712
|
+
xl: "1280px",
|
|
713
|
+
"2xl": "1536px"
|
|
714
|
+
},
|
|
715
|
+
zIndex: {
|
|
716
|
+
hide: -1,
|
|
717
|
+
auto: "auto",
|
|
718
|
+
base: 0,
|
|
719
|
+
dropdown: 1e3,
|
|
720
|
+
sticky: 1020,
|
|
721
|
+
fixed: 1030,
|
|
722
|
+
modalBackdrop: 1040,
|
|
723
|
+
modal: 1050,
|
|
724
|
+
popover: 1060,
|
|
725
|
+
tooltip: 1070,
|
|
726
|
+
toast: 1080
|
|
727
|
+
},
|
|
728
|
+
transitions: {
|
|
729
|
+
none: "none",
|
|
730
|
+
fast: "150ms ease-in-out",
|
|
731
|
+
normal: "200ms ease-in-out",
|
|
732
|
+
slow: "300ms ease-in-out",
|
|
733
|
+
slower: "500ms ease-in-out",
|
|
734
|
+
colors: "color 200ms ease-in-out, background-color 200ms ease-in-out, border-color 200ms ease-in-out",
|
|
735
|
+
transform: "transform 200ms ease-in-out",
|
|
736
|
+
opacity: "opacity 200ms ease-in-out",
|
|
737
|
+
shadow: "box-shadow 200ms ease-in-out",
|
|
738
|
+
all: "all 200ms ease-in-out"
|
|
739
|
+
},
|
|
740
|
+
components: {
|
|
741
|
+
button: {
|
|
742
|
+
bg: "#60a5fa",
|
|
743
|
+
bgHover: "#3b82f6",
|
|
744
|
+
bgActive: "#2563eb",
|
|
745
|
+
bgDisabled: "#1e3a5f",
|
|
746
|
+
color: "#0f172a",
|
|
747
|
+
colorHover: "#0f172a",
|
|
748
|
+
colorDisabled: "#64748b",
|
|
749
|
+
border: "transparent",
|
|
750
|
+
borderHover: "transparent",
|
|
751
|
+
borderWidth: "1px",
|
|
752
|
+
borderRadius: "0.375rem",
|
|
753
|
+
shadow: "0 1px 3px 0 rgb(0 0 0 / 0.4)",
|
|
754
|
+
shadowHover: "0 4px 6px -1px rgb(0 0 0 / 0.4)",
|
|
755
|
+
paddingX: "1rem",
|
|
756
|
+
paddingY: "0.5rem",
|
|
757
|
+
fontSize: "0.875rem",
|
|
758
|
+
fontWeight: 500,
|
|
759
|
+
variants: {
|
|
760
|
+
primary: {
|
|
761
|
+
bg: "#60a5fa",
|
|
762
|
+
bgHover: "#3b82f6",
|
|
763
|
+
color: "#0f172a"
|
|
764
|
+
},
|
|
765
|
+
secondary: {
|
|
766
|
+
bg: "#818cf8",
|
|
767
|
+
bgHover: "#6366f1",
|
|
768
|
+
color: "#0f172a"
|
|
769
|
+
},
|
|
770
|
+
outline: {
|
|
771
|
+
bg: "transparent",
|
|
772
|
+
bgHover: "#334155",
|
|
773
|
+
color: "#f8fafc",
|
|
774
|
+
border: "#475569",
|
|
775
|
+
borderHover: "#64748b"
|
|
776
|
+
},
|
|
777
|
+
ghost: {
|
|
778
|
+
bg: "transparent",
|
|
779
|
+
bgHover: "#334155",
|
|
780
|
+
color: "#f8fafc",
|
|
781
|
+
shadow: "none",
|
|
782
|
+
shadowHover: "none"
|
|
783
|
+
},
|
|
784
|
+
link: {
|
|
785
|
+
bg: "transparent",
|
|
786
|
+
bgHover: "transparent",
|
|
787
|
+
color: "#60a5fa",
|
|
788
|
+
colorHover: "#3b82f6",
|
|
789
|
+
shadow: "none",
|
|
790
|
+
shadowHover: "none",
|
|
791
|
+
paddingX: "0",
|
|
792
|
+
paddingY: "0"
|
|
793
|
+
},
|
|
794
|
+
danger: {
|
|
795
|
+
bg: "#f87171",
|
|
796
|
+
bgHover: "#ef4444",
|
|
797
|
+
color: "#0f172a"
|
|
798
|
+
},
|
|
799
|
+
success: {
|
|
800
|
+
bg: "#4ade80",
|
|
801
|
+
bgHover: "#22c55e",
|
|
802
|
+
color: "#0f172a"
|
|
803
|
+
}
|
|
804
|
+
},
|
|
805
|
+
sizes: {
|
|
806
|
+
xs: {
|
|
807
|
+
paddingX: "0.5rem",
|
|
808
|
+
paddingY: "0.25rem",
|
|
809
|
+
fontSize: "0.75rem"
|
|
810
|
+
},
|
|
811
|
+
sm: {
|
|
812
|
+
paddingX: "0.75rem",
|
|
813
|
+
paddingY: "0.375rem",
|
|
814
|
+
fontSize: "0.875rem"
|
|
815
|
+
},
|
|
816
|
+
md: {
|
|
817
|
+
paddingX: "1rem",
|
|
818
|
+
paddingY: "0.5rem",
|
|
819
|
+
fontSize: "0.875rem"
|
|
820
|
+
},
|
|
821
|
+
lg: {
|
|
822
|
+
paddingX: "1.25rem",
|
|
823
|
+
paddingY: "0.625rem",
|
|
824
|
+
fontSize: "1rem"
|
|
825
|
+
},
|
|
826
|
+
xl: {
|
|
827
|
+
paddingX: "1.5rem",
|
|
828
|
+
paddingY: "0.75rem",
|
|
829
|
+
fontSize: "1.125rem"
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
},
|
|
833
|
+
input: {
|
|
834
|
+
bg: "#1e293b",
|
|
835
|
+
bgFocus: "#1e293b",
|
|
836
|
+
bgDisabled: "#334155",
|
|
837
|
+
bgError: "#450a0a",
|
|
838
|
+
color: "#f8fafc",
|
|
839
|
+
colorPlaceholder: "#64748b",
|
|
840
|
+
colorDisabled: "#64748b",
|
|
841
|
+
border: "#475569",
|
|
842
|
+
borderFocus: "#60a5fa",
|
|
843
|
+
borderError: "#f87171",
|
|
844
|
+
borderWidth: "1px",
|
|
845
|
+
borderRadius: "0.375rem",
|
|
846
|
+
shadow: "0 1px 2px 0 rgb(0 0 0 / 0.3)",
|
|
847
|
+
shadowFocus: "0 0 0 3px rgb(96 165 250 / 0.2)",
|
|
848
|
+
paddingX: "0.75rem",
|
|
849
|
+
paddingY: "0.5rem",
|
|
850
|
+
fontSize: "0.875rem",
|
|
851
|
+
labelColor: "#e2e8f0",
|
|
852
|
+
labelFontSize: "0.875rem",
|
|
853
|
+
labelFontWeight: 500,
|
|
854
|
+
helperColor: "#94a3b8",
|
|
855
|
+
errorColor: "#f87171",
|
|
856
|
+
sizes: {
|
|
857
|
+
sm: {
|
|
858
|
+
paddingX: "0.5rem",
|
|
859
|
+
paddingY: "0.375rem",
|
|
860
|
+
fontSize: "0.75rem"
|
|
861
|
+
},
|
|
862
|
+
md: {
|
|
863
|
+
paddingX: "0.75rem",
|
|
864
|
+
paddingY: "0.5rem",
|
|
865
|
+
fontSize: "0.875rem"
|
|
866
|
+
},
|
|
867
|
+
lg: {
|
|
868
|
+
paddingX: "1rem",
|
|
869
|
+
paddingY: "0.625rem",
|
|
870
|
+
fontSize: "1rem"
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
},
|
|
874
|
+
card: {
|
|
875
|
+
bg: "#1e293b",
|
|
876
|
+
bgHover: "#1e293b",
|
|
877
|
+
border: "#334155",
|
|
878
|
+
borderWidth: "1px",
|
|
879
|
+
borderRadius: "0.5rem",
|
|
880
|
+
shadow: "0 1px 3px 0 rgb(0 0 0 / 0.4)",
|
|
881
|
+
shadowHover: "0 10px 15px -3px rgb(0 0 0 / 0.4)",
|
|
882
|
+
padding: "1.5rem",
|
|
883
|
+
headerBg: "#0f172a",
|
|
884
|
+
headerBorder: "#334155",
|
|
885
|
+
headerPadding: "1rem 1.5rem",
|
|
886
|
+
footerBg: "#0f172a",
|
|
887
|
+
footerBorder: "#334155",
|
|
888
|
+
footerPadding: "1rem 1.5rem"
|
|
889
|
+
},
|
|
890
|
+
header: {
|
|
891
|
+
bg: "#0f172a",
|
|
892
|
+
bgScrolled: "rgba(15, 23, 42, 0.95)",
|
|
893
|
+
color: "#f8fafc",
|
|
894
|
+
border: "#334155",
|
|
895
|
+
shadow: "none",
|
|
896
|
+
shadowScrolled: "0 1px 3px 0 rgb(0 0 0 / 0.4)",
|
|
897
|
+
height: "4rem",
|
|
898
|
+
paddingX: "1.5rem",
|
|
899
|
+
logoHeight: "2rem",
|
|
900
|
+
navColor: "#94a3b8",
|
|
901
|
+
navColorHover: "#f8fafc",
|
|
902
|
+
navColorActive: "#60a5fa",
|
|
903
|
+
navFontSize: "0.875rem",
|
|
904
|
+
navFontWeight: 500,
|
|
905
|
+
mobileMenuBg: "#1e293b",
|
|
906
|
+
mobileMenuShadow: "0 10px 15px -3px rgb(0 0 0 / 0.4)"
|
|
907
|
+
},
|
|
908
|
+
footer: {
|
|
909
|
+
bg: "#020617",
|
|
910
|
+
color: "#94a3b8",
|
|
911
|
+
colorMuted: "#64748b",
|
|
912
|
+
border: "#1e293b",
|
|
913
|
+
padding: "4rem 1.5rem",
|
|
914
|
+
linkColor: "#94a3b8",
|
|
915
|
+
linkColorHover: "#f8fafc",
|
|
916
|
+
headingColor: "#f8fafc",
|
|
917
|
+
headingFontSize: "1rem",
|
|
918
|
+
headingFontWeight: 600,
|
|
919
|
+
copyrightBg: "#0f172a",
|
|
920
|
+
copyrightColor: "#64748b"
|
|
921
|
+
},
|
|
922
|
+
banner: {
|
|
923
|
+
bg: "#1e3a5f",
|
|
924
|
+
color: "#bfdbfe",
|
|
925
|
+
border: "#3b82f6",
|
|
926
|
+
borderRadius: "0.5rem",
|
|
927
|
+
padding: "1rem 1.5rem",
|
|
928
|
+
shadow: "none",
|
|
929
|
+
closeBg: "transparent",
|
|
930
|
+
closeColor: "#bfdbfe",
|
|
931
|
+
variants: {
|
|
932
|
+
info: {
|
|
933
|
+
bg: "#1e3a5f",
|
|
934
|
+
color: "#bfdbfe",
|
|
935
|
+
border: "#3b82f6"
|
|
936
|
+
},
|
|
937
|
+
success: {
|
|
938
|
+
bg: "#14532d",
|
|
939
|
+
color: "#bbf7d0",
|
|
940
|
+
border: "#22c55e"
|
|
941
|
+
},
|
|
942
|
+
warning: {
|
|
943
|
+
bg: "#78350f",
|
|
944
|
+
color: "#fde68a",
|
|
945
|
+
border: "#f59e0b"
|
|
946
|
+
},
|
|
947
|
+
error: {
|
|
948
|
+
bg: "#7f1d1d",
|
|
949
|
+
color: "#fecaca",
|
|
950
|
+
border: "#ef4444"
|
|
951
|
+
},
|
|
952
|
+
promo: {
|
|
953
|
+
bg: "#581c87",
|
|
954
|
+
color: "#e9d5ff",
|
|
955
|
+
border: "#a855f7"
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
},
|
|
959
|
+
loader: {
|
|
960
|
+
color: "#60a5fa",
|
|
961
|
+
colorSecondary: "#334155",
|
|
962
|
+
size: "2.5rem",
|
|
963
|
+
borderWidth: "3px",
|
|
964
|
+
overlayBg: "rgba(15, 23, 42, 0.8)",
|
|
965
|
+
overlayOpacity: 1,
|
|
966
|
+
sizes: {
|
|
967
|
+
xs: "1rem",
|
|
968
|
+
sm: "1.5rem",
|
|
969
|
+
md: "2.5rem",
|
|
970
|
+
lg: "3.5rem",
|
|
971
|
+
xl: "5rem"
|
|
972
|
+
}
|
|
973
|
+
},
|
|
974
|
+
modal: {
|
|
975
|
+
bg: "#1e293b",
|
|
976
|
+
color: "#f8fafc",
|
|
977
|
+
border: "#334155",
|
|
978
|
+
borderRadius: "0.5rem",
|
|
979
|
+
shadow: "0 25px 50px -12px rgb(0 0 0 / 0.6)",
|
|
980
|
+
padding: "1.5rem",
|
|
981
|
+
overlayBg: "rgba(0, 0, 0, 0.7)",
|
|
982
|
+
overlayOpacity: 1,
|
|
983
|
+
headerBg: "#1e293b",
|
|
984
|
+
headerBorder: "#334155",
|
|
985
|
+
headerPadding: "1rem 1.5rem",
|
|
986
|
+
footerBg: "#0f172a",
|
|
987
|
+
footerBorder: "#334155",
|
|
988
|
+
footerPadding: "1rem 1.5rem",
|
|
989
|
+
closeBg: "transparent",
|
|
990
|
+
closeColor: "#94a3b8",
|
|
991
|
+
closeHoverBg: "#334155",
|
|
992
|
+
sizes: {
|
|
993
|
+
sm: "24rem",
|
|
994
|
+
md: "32rem",
|
|
995
|
+
lg: "48rem",
|
|
996
|
+
xl: "64rem",
|
|
997
|
+
full: "100%"
|
|
998
|
+
}
|
|
999
|
+
},
|
|
1000
|
+
toast: {
|
|
1001
|
+
bg: "#1e293b",
|
|
1002
|
+
color: "#f8fafc",
|
|
1003
|
+
border: "#334155",
|
|
1004
|
+
borderRadius: "0.5rem",
|
|
1005
|
+
shadow: "0 10px 15px -3px rgb(0 0 0 / 0.4)",
|
|
1006
|
+
padding: "1rem",
|
|
1007
|
+
variants: {
|
|
1008
|
+
success: {
|
|
1009
|
+
bg: "#14532d",
|
|
1010
|
+
color: "#bbf7d0",
|
|
1011
|
+
border: "#22c55e"
|
|
1012
|
+
},
|
|
1013
|
+
error: {
|
|
1014
|
+
bg: "#7f1d1d",
|
|
1015
|
+
color: "#fecaca",
|
|
1016
|
+
border: "#ef4444"
|
|
1017
|
+
},
|
|
1018
|
+
warning: {
|
|
1019
|
+
bg: "#78350f",
|
|
1020
|
+
color: "#fde68a",
|
|
1021
|
+
border: "#f59e0b"
|
|
1022
|
+
},
|
|
1023
|
+
info: {
|
|
1024
|
+
bg: "#1e3a5f",
|
|
1025
|
+
color: "#bfdbfe",
|
|
1026
|
+
border: "#3b82f6"
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
},
|
|
1030
|
+
newsletter: {
|
|
1031
|
+
bg: "#1e293b",
|
|
1032
|
+
color: "#f8fafc",
|
|
1033
|
+
border: "#334155",
|
|
1034
|
+
borderRadius: "0.5rem",
|
|
1035
|
+
padding: "2rem",
|
|
1036
|
+
titleColor: "#f8fafc",
|
|
1037
|
+
titleFontSize: "1.5rem",
|
|
1038
|
+
descColor: "#94a3b8",
|
|
1039
|
+
descFontSize: "1rem",
|
|
1040
|
+
inputBg: "#0f172a",
|
|
1041
|
+
inputBorder: "#475569",
|
|
1042
|
+
buttonBg: "#60a5fa",
|
|
1043
|
+
buttonColor: "#0f172a"
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
};
|
|
1047
|
+
|
|
1048
|
+
// src/client/web/theme/theme-utils.ts
|
|
1049
|
+
function deepMerge(target, source) {
|
|
1050
|
+
const output = { ...target };
|
|
1051
|
+
for (const key in source) {
|
|
1052
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
1053
|
+
const sourceValue = source[key];
|
|
1054
|
+
const targetValue = target[key];
|
|
1055
|
+
if (sourceValue && typeof sourceValue === "object" && !Array.isArray(sourceValue) && targetValue && typeof targetValue === "object" && !Array.isArray(targetValue)) {
|
|
1056
|
+
output[key] = deepMerge(
|
|
1057
|
+
targetValue,
|
|
1058
|
+
sourceValue
|
|
1059
|
+
);
|
|
1060
|
+
} else if (sourceValue !== void 0) {
|
|
1061
|
+
output[key] = sourceValue;
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
return output;
|
|
1066
|
+
}
|
|
1067
|
+
function createThemeFromBrand(brand, baseTheme = defaultLightTheme) {
|
|
1068
|
+
const { colors } = brand;
|
|
1069
|
+
const brandOverrides = {
|
|
1070
|
+
brand,
|
|
1071
|
+
colors: {
|
|
1072
|
+
brand: {
|
|
1073
|
+
primary: colors.primary,
|
|
1074
|
+
secondary: colors.secondary,
|
|
1075
|
+
accent: colors.accent || colors.primary,
|
|
1076
|
+
background: colors.background || baseTheme.colors.background.default,
|
|
1077
|
+
foreground: colors.foreground || baseTheme.colors.text.primary
|
|
1078
|
+
},
|
|
1079
|
+
semantic: {
|
|
1080
|
+
primary: colors.primary,
|
|
1081
|
+
primaryHover: adjustColor(colors.primary, -10),
|
|
1082
|
+
primaryActive: adjustColor(colors.primary, -20),
|
|
1083
|
+
primaryDisabled: adjustColor(colors.primary, 40),
|
|
1084
|
+
secondary: colors.secondary,
|
|
1085
|
+
secondaryHover: adjustColor(colors.secondary, -10),
|
|
1086
|
+
secondaryActive: adjustColor(colors.secondary, -20),
|
|
1087
|
+
secondaryDisabled: adjustColor(colors.secondary, 40),
|
|
1088
|
+
accent: colors.accent || colors.primary,
|
|
1089
|
+
accentHover: adjustColor(colors.accent || colors.primary, -10)
|
|
1090
|
+
}
|
|
1091
|
+
},
|
|
1092
|
+
components: {
|
|
1093
|
+
button: {
|
|
1094
|
+
bg: colors.primary,
|
|
1095
|
+
bgHover: adjustColor(colors.primary, -10),
|
|
1096
|
+
bgActive: adjustColor(colors.primary, -20),
|
|
1097
|
+
variants: {
|
|
1098
|
+
primary: {
|
|
1099
|
+
bg: colors.primary,
|
|
1100
|
+
bgHover: adjustColor(colors.primary, -10)
|
|
1101
|
+
},
|
|
1102
|
+
secondary: {
|
|
1103
|
+
bg: colors.secondary,
|
|
1104
|
+
bgHover: adjustColor(colors.secondary, -10)
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
},
|
|
1108
|
+
input: {
|
|
1109
|
+
borderFocus: colors.primary
|
|
1110
|
+
},
|
|
1111
|
+
header: {
|
|
1112
|
+
navColorActive: colors.primary
|
|
1113
|
+
},
|
|
1114
|
+
loader: {
|
|
1115
|
+
color: colors.primary
|
|
1116
|
+
},
|
|
1117
|
+
newsletter: {
|
|
1118
|
+
buttonBg: colors.primary
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
};
|
|
1122
|
+
return deepMerge(baseTheme, brandOverrides);
|
|
1123
|
+
}
|
|
1124
|
+
function adjustColor(hex, percent) {
|
|
1125
|
+
hex = hex.replace(/^#/, "");
|
|
1126
|
+
let r = parseInt(hex.substring(0, 2), 16);
|
|
1127
|
+
let g = parseInt(hex.substring(2, 4), 16);
|
|
1128
|
+
let b = parseInt(hex.substring(4, 6), 16);
|
|
1129
|
+
r = Math.min(255, Math.max(0, r + r * percent / 100));
|
|
1130
|
+
g = Math.min(255, Math.max(0, g + g * percent / 100));
|
|
1131
|
+
b = Math.min(255, Math.max(0, b + b * percent / 100));
|
|
1132
|
+
const toHex = (n) => Math.round(n).toString(16).padStart(2, "0");
|
|
1133
|
+
return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
|
|
1134
|
+
}
|
|
1135
|
+
function hexToRgba(hex, alpha = 1) {
|
|
1136
|
+
hex = hex.replace(/^#/, "");
|
|
1137
|
+
const r = parseInt(hex.substring(0, 2), 16);
|
|
1138
|
+
const g = parseInt(hex.substring(2, 4), 16);
|
|
1139
|
+
const b = parseInt(hex.substring(4, 6), 16);
|
|
1140
|
+
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
|
|
1141
|
+
}
|
|
1142
|
+
function getContrastColor(hex) {
|
|
1143
|
+
hex = hex.replace(/^#/, "");
|
|
1144
|
+
const r = parseInt(hex.substring(0, 2), 16);
|
|
1145
|
+
const g = parseInt(hex.substring(2, 4), 16);
|
|
1146
|
+
const b = parseInt(hex.substring(4, 6), 16);
|
|
1147
|
+
const luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255;
|
|
1148
|
+
return luminance > 0.5 ? "#000000" : "#ffffff";
|
|
1149
|
+
}
|
|
1150
|
+
function flattenToCssVars(obj, prefix = "--ec") {
|
|
1151
|
+
const result = {};
|
|
1152
|
+
function flatten(current, path = []) {
|
|
1153
|
+
for (const key in current) {
|
|
1154
|
+
if (Object.prototype.hasOwnProperty.call(current, key)) {
|
|
1155
|
+
const value = current[key];
|
|
1156
|
+
const newPath = [...path, key];
|
|
1157
|
+
const varName = `${prefix}-${newPath.join("-")}`;
|
|
1158
|
+
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
1159
|
+
flatten(value, newPath);
|
|
1160
|
+
} else if (typeof value === "string" || typeof value === "number") {
|
|
1161
|
+
result[varName] = String(value);
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
}
|
|
1165
|
+
}
|
|
1166
|
+
flatten(obj);
|
|
1167
|
+
return result;
|
|
1168
|
+
}
|
|
1169
|
+
function generateCssVars(theme, prefix = "--ec") {
|
|
1170
|
+
const cssVars = flattenToCssVars(theme, prefix);
|
|
1171
|
+
return Object.entries(cssVars).map(([key, value]) => `${key}: ${value};`).join("\n");
|
|
1172
|
+
}
|
|
1173
|
+
function injectCssVars(theme, prefix = "--ec") {
|
|
1174
|
+
if (typeof document === "undefined") return;
|
|
1175
|
+
const cssVars = flattenToCssVars(theme, prefix);
|
|
1176
|
+
const root = document.documentElement;
|
|
1177
|
+
for (const [key, value] of Object.entries(cssVars)) {
|
|
1178
|
+
root.style.setProperty(key, value);
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
function removeCssVars(prefix = "--ec") {
|
|
1182
|
+
if (typeof document === "undefined") return;
|
|
1183
|
+
const root = document.documentElement;
|
|
1184
|
+
const style = root.style;
|
|
1185
|
+
for (let i = style.length - 1; i >= 0; i--) {
|
|
1186
|
+
const name = style[i];
|
|
1187
|
+
if (name.startsWith(prefix)) {
|
|
1188
|
+
root.style.removeProperty(name);
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
async function loadThemeFromUrl(url) {
|
|
1193
|
+
try {
|
|
1194
|
+
const response = await fetch(url, {
|
|
1195
|
+
headers: {
|
|
1196
|
+
Accept: "application/json"
|
|
1197
|
+
}
|
|
1198
|
+
});
|
|
1199
|
+
if (!response.ok) {
|
|
1200
|
+
console.error(`Failed to load theme from ${url}: ${response.status}`);
|
|
1201
|
+
return null;
|
|
1202
|
+
}
|
|
1203
|
+
const themeData = await response.json();
|
|
1204
|
+
return themeData;
|
|
1205
|
+
} catch (error) {
|
|
1206
|
+
console.error(`Error loading theme from ${url}:`, error);
|
|
1207
|
+
return null;
|
|
1208
|
+
}
|
|
1209
|
+
}
|
|
1210
|
+
async function createTheme(config = {}) {
|
|
1211
|
+
let lightTheme = { ...defaultLightTheme };
|
|
1212
|
+
let darkTheme = { ...defaultDarkTheme };
|
|
1213
|
+
if (config.themeUrl) {
|
|
1214
|
+
const urlTheme = await loadThemeFromUrl(config.themeUrl);
|
|
1215
|
+
if (urlTheme) {
|
|
1216
|
+
lightTheme = deepMerge(lightTheme, urlTheme);
|
|
1217
|
+
darkTheme = deepMerge(darkTheme, urlTheme);
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
if (config.brandIdentity) {
|
|
1221
|
+
lightTheme = createThemeFromBrand(config.brandIdentity, lightTheme);
|
|
1222
|
+
darkTheme = createThemeFromBrand(config.brandIdentity, darkTheme);
|
|
1223
|
+
}
|
|
1224
|
+
if (config.light) {
|
|
1225
|
+
lightTheme = deepMerge(lightTheme, config.light);
|
|
1226
|
+
}
|
|
1227
|
+
if (config.dark) {
|
|
1228
|
+
darkTheme = deepMerge(darkTheme, config.dark);
|
|
1229
|
+
}
|
|
1230
|
+
return { light: lightTheme, dark: darkTheme };
|
|
1231
|
+
}
|
|
1232
|
+
var DEFAULT_STORAGE_KEY = "ec-theme-mode";
|
|
1233
|
+
function saveThemeMode(mode, storageKey = DEFAULT_STORAGE_KEY) {
|
|
1234
|
+
if (typeof localStorage === "undefined") return;
|
|
1235
|
+
try {
|
|
1236
|
+
localStorage.setItem(storageKey, mode);
|
|
1237
|
+
} catch (error) {
|
|
1238
|
+
console.error("Failed to save theme mode:", error);
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
function loadThemeMode(storageKey = DEFAULT_STORAGE_KEY) {
|
|
1242
|
+
if (typeof localStorage === "undefined") return null;
|
|
1243
|
+
try {
|
|
1244
|
+
const mode = localStorage.getItem(storageKey);
|
|
1245
|
+
if (mode === "light" || mode === "dark" || mode === "system") {
|
|
1246
|
+
return mode;
|
|
1247
|
+
}
|
|
1248
|
+
return null;
|
|
1249
|
+
} catch (error) {
|
|
1250
|
+
console.error("Failed to load theme mode:", error);
|
|
1251
|
+
return null;
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
function getSystemColorScheme() {
|
|
1255
|
+
if (typeof window === "undefined") return "light";
|
|
1256
|
+
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
1257
|
+
}
|
|
1258
|
+
function resolveThemeMode(mode) {
|
|
1259
|
+
if (mode === "system") {
|
|
1260
|
+
return getSystemColorScheme();
|
|
1261
|
+
}
|
|
1262
|
+
return mode;
|
|
1263
|
+
}
|
|
1264
|
+
var ThemeContext = react.createContext(null);
|
|
1265
|
+
function useTheme() {
|
|
1266
|
+
const context = react.useContext(ThemeContext);
|
|
1267
|
+
if (!context) {
|
|
1268
|
+
throw new Error("useTheme must be used within a ThemeProvider");
|
|
1269
|
+
}
|
|
1270
|
+
return context;
|
|
1271
|
+
}
|
|
1272
|
+
function ThemeProvider({
|
|
1273
|
+
children,
|
|
1274
|
+
config = {},
|
|
1275
|
+
initialTheme
|
|
1276
|
+
}) {
|
|
1277
|
+
const {
|
|
1278
|
+
defaultMode = "system",
|
|
1279
|
+
themeUrl,
|
|
1280
|
+
light: lightOverrides,
|
|
1281
|
+
dark: darkOverrides,
|
|
1282
|
+
brandIdentity,
|
|
1283
|
+
enableSystemTheme = true,
|
|
1284
|
+
persistTheme = true,
|
|
1285
|
+
storageKey = "ec-theme-mode",
|
|
1286
|
+
cssVarPrefix = "--ec"
|
|
1287
|
+
} = config;
|
|
1288
|
+
const [mode, setModeState] = react.useState(() => {
|
|
1289
|
+
if (persistTheme && typeof window !== "undefined") {
|
|
1290
|
+
const savedMode = loadThemeMode(storageKey);
|
|
1291
|
+
if (savedMode) return savedMode;
|
|
1292
|
+
}
|
|
1293
|
+
return defaultMode;
|
|
1294
|
+
});
|
|
1295
|
+
const [lightTheme, setLightTheme] = react.useState(() => {
|
|
1296
|
+
if (initialTheme && initialTheme.mode === "light") return initialTheme;
|
|
1297
|
+
let theme2 = defaultLightTheme;
|
|
1298
|
+
if (brandIdentity) {
|
|
1299
|
+
theme2 = createThemeFromBrand(brandIdentity, theme2);
|
|
1300
|
+
}
|
|
1301
|
+
if (lightOverrides) {
|
|
1302
|
+
theme2 = deepMerge(theme2, lightOverrides);
|
|
1303
|
+
}
|
|
1304
|
+
return theme2;
|
|
1305
|
+
});
|
|
1306
|
+
const [darkTheme, setDarkTheme] = react.useState(() => {
|
|
1307
|
+
if (initialTheme && initialTheme.mode === "dark") return initialTheme;
|
|
1308
|
+
let theme2 = defaultDarkTheme;
|
|
1309
|
+
if (brandIdentity) {
|
|
1310
|
+
theme2 = createThemeFromBrand(brandIdentity, theme2);
|
|
1311
|
+
}
|
|
1312
|
+
if (darkOverrides) {
|
|
1313
|
+
theme2 = deepMerge(theme2, darkOverrides);
|
|
1314
|
+
}
|
|
1315
|
+
return theme2;
|
|
1316
|
+
});
|
|
1317
|
+
const [isLoading, setIsLoading] = react.useState(!!themeUrl);
|
|
1318
|
+
const [error, setError] = react.useState(null);
|
|
1319
|
+
const resolvedMode = react.useMemo(() => resolveThemeMode(mode), [mode]);
|
|
1320
|
+
const theme = react.useMemo(
|
|
1321
|
+
() => resolvedMode === "dark" ? darkTheme : lightTheme,
|
|
1322
|
+
[resolvedMode, lightTheme, darkTheme]
|
|
1323
|
+
);
|
|
1324
|
+
const isDark = resolvedMode === "dark";
|
|
1325
|
+
const isLight = resolvedMode === "light";
|
|
1326
|
+
react.useEffect(() => {
|
|
1327
|
+
if (!themeUrl) return;
|
|
1328
|
+
setIsLoading(true);
|
|
1329
|
+
setError(null);
|
|
1330
|
+
loadThemeFromUrl(themeUrl).then((urlTheme) => {
|
|
1331
|
+
if (urlTheme) {
|
|
1332
|
+
setLightTheme((prev) => deepMerge(prev, urlTheme));
|
|
1333
|
+
setDarkTheme((prev) => deepMerge(prev, urlTheme));
|
|
1334
|
+
}
|
|
1335
|
+
}).catch((err) => {
|
|
1336
|
+
setError(err instanceof Error ? err.message : "Failed to load theme");
|
|
1337
|
+
}).finally(() => {
|
|
1338
|
+
setIsLoading(false);
|
|
1339
|
+
});
|
|
1340
|
+
}, [themeUrl]);
|
|
1341
|
+
react.useEffect(() => {
|
|
1342
|
+
if (typeof window !== "undefined") {
|
|
1343
|
+
injectCssVars(theme, cssVarPrefix);
|
|
1344
|
+
}
|
|
1345
|
+
}, [theme, cssVarPrefix]);
|
|
1346
|
+
react.useEffect(() => {
|
|
1347
|
+
if (typeof document !== "undefined") {
|
|
1348
|
+
document.documentElement.setAttribute("data-theme", resolvedMode);
|
|
1349
|
+
document.documentElement.style.colorScheme = resolvedMode;
|
|
1350
|
+
}
|
|
1351
|
+
}, [resolvedMode]);
|
|
1352
|
+
react.useEffect(() => {
|
|
1353
|
+
if (!enableSystemTheme || typeof window === "undefined") return;
|
|
1354
|
+
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
1355
|
+
const handleChange = () => {
|
|
1356
|
+
if (mode === "system") {
|
|
1357
|
+
setModeState("system");
|
|
1358
|
+
}
|
|
1359
|
+
};
|
|
1360
|
+
mediaQuery.addEventListener("change", handleChange);
|
|
1361
|
+
return () => mediaQuery.removeEventListener("change", handleChange);
|
|
1362
|
+
}, [mode, enableSystemTheme]);
|
|
1363
|
+
react.useEffect(() => {
|
|
1364
|
+
if (persistTheme && typeof window !== "undefined") {
|
|
1365
|
+
saveThemeMode(mode, storageKey);
|
|
1366
|
+
}
|
|
1367
|
+
}, [mode, persistTheme, storageKey]);
|
|
1368
|
+
const setMode = react.useCallback((newMode) => {
|
|
1369
|
+
setModeState(newMode);
|
|
1370
|
+
}, []);
|
|
1371
|
+
const toggleMode = react.useCallback(() => {
|
|
1372
|
+
setModeState((prev) => {
|
|
1373
|
+
const current = resolveThemeMode(prev);
|
|
1374
|
+
return current === "dark" ? "light" : "dark";
|
|
1375
|
+
});
|
|
1376
|
+
}, []);
|
|
1377
|
+
const updateTheme = react.useCallback((updates) => {
|
|
1378
|
+
setLightTheme((prev) => deepMerge(prev, updates));
|
|
1379
|
+
setDarkTheme((prev) => deepMerge(prev, updates));
|
|
1380
|
+
}, []);
|
|
1381
|
+
const resetTheme = react.useCallback(() => {
|
|
1382
|
+
let light = defaultLightTheme;
|
|
1383
|
+
let dark = defaultDarkTheme;
|
|
1384
|
+
if (brandIdentity) {
|
|
1385
|
+
light = createThemeFromBrand(brandIdentity, light);
|
|
1386
|
+
dark = createThemeFromBrand(brandIdentity, dark);
|
|
1387
|
+
}
|
|
1388
|
+
if (lightOverrides) {
|
|
1389
|
+
light = deepMerge(light, lightOverrides);
|
|
1390
|
+
}
|
|
1391
|
+
if (darkOverrides) {
|
|
1392
|
+
dark = deepMerge(dark, darkOverrides);
|
|
1393
|
+
}
|
|
1394
|
+
setLightTheme(light);
|
|
1395
|
+
setDarkTheme(dark);
|
|
1396
|
+
}, [brandIdentity, lightOverrides, darkOverrides]);
|
|
1397
|
+
const contextValue = react.useMemo(
|
|
1398
|
+
() => ({
|
|
1399
|
+
theme,
|
|
1400
|
+
mode,
|
|
1401
|
+
setMode,
|
|
1402
|
+
toggleMode,
|
|
1403
|
+
updateTheme,
|
|
1404
|
+
resetTheme,
|
|
1405
|
+
isDark,
|
|
1406
|
+
isLight,
|
|
1407
|
+
isLoading,
|
|
1408
|
+
error
|
|
1409
|
+
}),
|
|
1410
|
+
[theme, mode, setMode, toggleMode, updateTheme, resetTheme, isDark, isLight, isLoading, error]
|
|
1411
|
+
);
|
|
1412
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ThemeContext.Provider, { value: contextValue, children });
|
|
1413
|
+
}
|
|
1414
|
+
function cssVar(path, prefix = "--ec") {
|
|
1415
|
+
return `var(${prefix}-${path.replace(/\./g, "-")})`;
|
|
1416
|
+
}
|
|
1417
|
+
function useThemeValue(selector) {
|
|
1418
|
+
const { theme } = useTheme();
|
|
1419
|
+
return selector(theme);
|
|
1420
|
+
}
|
|
1421
|
+
function ThemeToggle({
|
|
1422
|
+
className = "",
|
|
1423
|
+
size = 24,
|
|
1424
|
+
showLabel = false,
|
|
1425
|
+
lightLabel = "Light",
|
|
1426
|
+
darkLabel = "Dark"
|
|
1427
|
+
}) {
|
|
1428
|
+
const { isDark, toggleMode } = useTheme();
|
|
1429
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1430
|
+
"button",
|
|
1431
|
+
{
|
|
1432
|
+
type: "button",
|
|
1433
|
+
onClick: toggleMode,
|
|
1434
|
+
className: `ec-theme-toggle ${className}`,
|
|
1435
|
+
"aria-label": isDark ? "Switch to light mode" : "Switch to dark mode",
|
|
1436
|
+
style: {
|
|
1437
|
+
background: "none",
|
|
1438
|
+
border: "none",
|
|
1439
|
+
cursor: "pointer",
|
|
1440
|
+
display: "inline-flex",
|
|
1441
|
+
alignItems: "center",
|
|
1442
|
+
gap: "0.5rem",
|
|
1443
|
+
padding: "0.5rem",
|
|
1444
|
+
borderRadius: "0.375rem",
|
|
1445
|
+
transition: "background-color 200ms ease-in-out"
|
|
1446
|
+
},
|
|
1447
|
+
children: [
|
|
1448
|
+
isDark ? (
|
|
1449
|
+
// Sun icon for dark mode (click to go light)
|
|
1450
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1451
|
+
"svg",
|
|
1452
|
+
{
|
|
1453
|
+
width: size,
|
|
1454
|
+
height: size,
|
|
1455
|
+
viewBox: "0 0 24 24",
|
|
1456
|
+
fill: "none",
|
|
1457
|
+
stroke: "currentColor",
|
|
1458
|
+
strokeWidth: "2",
|
|
1459
|
+
strokeLinecap: "round",
|
|
1460
|
+
strokeLinejoin: "round",
|
|
1461
|
+
children: [
|
|
1462
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "5" }),
|
|
1463
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", y1: "1", x2: "12", y2: "3" }),
|
|
1464
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", y1: "21", x2: "12", y2: "23" }),
|
|
1465
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "4.22", y1: "4.22", x2: "5.64", y2: "5.64" }),
|
|
1466
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "18.36", y1: "18.36", x2: "19.78", y2: "19.78" }),
|
|
1467
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "1", y1: "12", x2: "3", y2: "12" }),
|
|
1468
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "21", y1: "12", x2: "23", y2: "12" }),
|
|
1469
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "4.22", y1: "19.78", x2: "5.64", y2: "18.36" }),
|
|
1470
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "18.36", y1: "5.64", x2: "19.78", y2: "4.22" })
|
|
1471
|
+
]
|
|
1472
|
+
}
|
|
1473
|
+
)
|
|
1474
|
+
) : (
|
|
1475
|
+
// Moon icon for light mode (click to go dark)
|
|
1476
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1477
|
+
"svg",
|
|
1478
|
+
{
|
|
1479
|
+
width: size,
|
|
1480
|
+
height: size,
|
|
1481
|
+
viewBox: "0 0 24 24",
|
|
1482
|
+
fill: "none",
|
|
1483
|
+
stroke: "currentColor",
|
|
1484
|
+
strokeWidth: "2",
|
|
1485
|
+
strokeLinecap: "round",
|
|
1486
|
+
strokeLinejoin: "round",
|
|
1487
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" })
|
|
1488
|
+
}
|
|
1489
|
+
)
|
|
1490
|
+
),
|
|
1491
|
+
showLabel && /* @__PURE__ */ jsxRuntime.jsx("span", { children: isDark ? darkLabel : lightLabel })
|
|
1492
|
+
]
|
|
1493
|
+
}
|
|
1494
|
+
);
|
|
1495
|
+
}
|
|
1496
|
+
|
|
1497
|
+
// src/client/web/astro/types.ts
|
|
1498
|
+
function dummyImage(width, height, text, bgColor = "cccccc", textColor = "969696") {
|
|
1499
|
+
const label = text ? `&text=${encodeURIComponent(text)}` : "";
|
|
1500
|
+
return `https://dummyimage.com/${width}x${height}/${bgColor}/${textColor}${label}`;
|
|
1501
|
+
}
|
|
1502
|
+
function loremIpsum(type = "paragraph", count = 1) {
|
|
1503
|
+
const words = [
|
|
1504
|
+
"lorem",
|
|
1505
|
+
"ipsum",
|
|
1506
|
+
"dolor",
|
|
1507
|
+
"sit",
|
|
1508
|
+
"amet",
|
|
1509
|
+
"consectetur",
|
|
1510
|
+
"adipiscing",
|
|
1511
|
+
"elit",
|
|
1512
|
+
"sed",
|
|
1513
|
+
"do",
|
|
1514
|
+
"eiusmod",
|
|
1515
|
+
"tempor",
|
|
1516
|
+
"incididunt",
|
|
1517
|
+
"ut",
|
|
1518
|
+
"labore",
|
|
1519
|
+
"et",
|
|
1520
|
+
"dolore",
|
|
1521
|
+
"magna",
|
|
1522
|
+
"aliqua",
|
|
1523
|
+
"enim",
|
|
1524
|
+
"ad",
|
|
1525
|
+
"minim",
|
|
1526
|
+
"veniam",
|
|
1527
|
+
"quis",
|
|
1528
|
+
"nostrud",
|
|
1529
|
+
"exercitation",
|
|
1530
|
+
"ullamco",
|
|
1531
|
+
"laboris",
|
|
1532
|
+
"nisi",
|
|
1533
|
+
"aliquip",
|
|
1534
|
+
"ex",
|
|
1535
|
+
"ea",
|
|
1536
|
+
"commodo",
|
|
1537
|
+
"consequat",
|
|
1538
|
+
"duis",
|
|
1539
|
+
"aute",
|
|
1540
|
+
"irure",
|
|
1541
|
+
"in",
|
|
1542
|
+
"reprehenderit",
|
|
1543
|
+
"voluptate",
|
|
1544
|
+
"velit",
|
|
1545
|
+
"esse",
|
|
1546
|
+
"cillum",
|
|
1547
|
+
"fugiat",
|
|
1548
|
+
"nulla",
|
|
1549
|
+
"pariatur",
|
|
1550
|
+
"excepteur",
|
|
1551
|
+
"sint",
|
|
1552
|
+
"occaecat",
|
|
1553
|
+
"cupidatat",
|
|
1554
|
+
"non",
|
|
1555
|
+
"proident",
|
|
1556
|
+
"sunt",
|
|
1557
|
+
"culpa",
|
|
1558
|
+
"qui",
|
|
1559
|
+
"officia",
|
|
1560
|
+
"deserunt",
|
|
1561
|
+
"mollit",
|
|
1562
|
+
"anim",
|
|
1563
|
+
"id",
|
|
1564
|
+
"est",
|
|
1565
|
+
"laborum"
|
|
1566
|
+
];
|
|
1567
|
+
const getWords = (n) => {
|
|
1568
|
+
const result = [];
|
|
1569
|
+
for (let i = 0; i < n; i++) {
|
|
1570
|
+
result.push(words[Math.floor(Math.random() * words.length)]);
|
|
1571
|
+
}
|
|
1572
|
+
return result;
|
|
1573
|
+
};
|
|
1574
|
+
const capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1);
|
|
1575
|
+
if (type === "word") {
|
|
1576
|
+
return getWords(count).join(" ");
|
|
1577
|
+
}
|
|
1578
|
+
if (type === "sentence") {
|
|
1579
|
+
const sentences = [];
|
|
1580
|
+
for (let i = 0; i < count; i++) {
|
|
1581
|
+
const sentence = capitalize(getWords(Math.floor(Math.random() * 10) + 5).join(" ")) + ".";
|
|
1582
|
+
sentences.push(sentence);
|
|
1583
|
+
}
|
|
1584
|
+
return sentences.join(" ");
|
|
1585
|
+
}
|
|
1586
|
+
const paragraphs = [];
|
|
1587
|
+
for (let i = 0; i < count; i++) {
|
|
1588
|
+
const sentences = [];
|
|
1589
|
+
const sentenceCount = Math.floor(Math.random() * 4) + 3;
|
|
1590
|
+
for (let j = 0; j < sentenceCount; j++) {
|
|
1591
|
+
sentences.push(capitalize(getWords(Math.floor(Math.random() * 10) + 5).join(" ")) + ".");
|
|
1592
|
+
}
|
|
1593
|
+
paragraphs.push(sentences.join(" "));
|
|
1594
|
+
}
|
|
1595
|
+
return paragraphs.join("\n\n");
|
|
1596
|
+
}
|
|
1597
|
+
var dummyHeaderData = {
|
|
1598
|
+
logo: dummyImage(120, 40, "Logo"),
|
|
1599
|
+
logoAlt: "Company Logo",
|
|
1600
|
+
navLinks: [
|
|
1601
|
+
{ text: "Home", href: "/", active: true },
|
|
1602
|
+
{ text: "About", href: "/about" },
|
|
1603
|
+
{ text: "Services", href: "/services" },
|
|
1604
|
+
{ text: "Blog", href: "/blog" },
|
|
1605
|
+
{ text: "Contact", href: "/contact" }
|
|
1606
|
+
],
|
|
1607
|
+
cta: {
|
|
1608
|
+
text: "Get Started",
|
|
1609
|
+
href: "/signup",
|
|
1610
|
+
variant: "primary"
|
|
1611
|
+
},
|
|
1612
|
+
sticky: true
|
|
1613
|
+
};
|
|
1614
|
+
var dummyFooterData = {
|
|
1615
|
+
logo: dummyImage(120, 40, "Logo"),
|
|
1616
|
+
logoAlt: "Company Logo",
|
|
1617
|
+
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore.",
|
|
1618
|
+
columns: [
|
|
1619
|
+
{
|
|
1620
|
+
title: "Product",
|
|
1621
|
+
links: [
|
|
1622
|
+
{ text: "Features", href: "/features" },
|
|
1623
|
+
{ text: "Pricing", href: "/pricing" },
|
|
1624
|
+
{ text: "Integrations", href: "/integrations" },
|
|
1625
|
+
{ text: "API", href: "/api" }
|
|
1626
|
+
]
|
|
1627
|
+
},
|
|
1628
|
+
{
|
|
1629
|
+
title: "Company",
|
|
1630
|
+
links: [
|
|
1631
|
+
{ text: "About", href: "/about" },
|
|
1632
|
+
{ text: "Blog", href: "/blog" },
|
|
1633
|
+
{ text: "Careers", href: "/careers" },
|
|
1634
|
+
{ text: "Contact", href: "/contact" }
|
|
1635
|
+
]
|
|
1636
|
+
},
|
|
1637
|
+
{
|
|
1638
|
+
title: "Legal",
|
|
1639
|
+
links: [
|
|
1640
|
+
{ text: "Privacy Policy", href: "/privacy" },
|
|
1641
|
+
{ text: "Terms of Service", href: "/terms" },
|
|
1642
|
+
{ text: "Cookie Policy", href: "/cookies" }
|
|
1643
|
+
]
|
|
1644
|
+
}
|
|
1645
|
+
],
|
|
1646
|
+
socialLinks: [
|
|
1647
|
+
{ platform: "twitter", href: "https://twitter.com" },
|
|
1648
|
+
{ platform: "facebook", href: "https://facebook.com" },
|
|
1649
|
+
{ platform: "instagram", href: "https://instagram.com" },
|
|
1650
|
+
{ platform: "linkedin", href: "https://linkedin.com" },
|
|
1651
|
+
{ platform: "github", href: "https://github.com" }
|
|
1652
|
+
],
|
|
1653
|
+
copyright: `\xA9 ${(/* @__PURE__ */ new Date()).getFullYear()} Company Name. All rights reserved.`
|
|
1654
|
+
};
|
|
1655
|
+
var dummyBannerData = {
|
|
1656
|
+
title: "Build Something Amazing Today",
|
|
1657
|
+
subtitle: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
|
|
1658
|
+
backgroundImage: dummyImage(1920, 800, "Hero+Background", "1e293b", "334155"),
|
|
1659
|
+
primaryCta: {
|
|
1660
|
+
text: "Get Started Free",
|
|
1661
|
+
href: "/signup",
|
|
1662
|
+
variant: "primary"
|
|
1663
|
+
},
|
|
1664
|
+
secondaryCta: {
|
|
1665
|
+
text: "Learn More",
|
|
1666
|
+
href: "/about",
|
|
1667
|
+
variant: "outline"
|
|
1668
|
+
},
|
|
1669
|
+
height: "lg",
|
|
1670
|
+
align: "center"
|
|
1671
|
+
};
|
|
1672
|
+
var dummyFeatures = [
|
|
1673
|
+
{
|
|
1674
|
+
title: "Lightning Fast",
|
|
1675
|
+
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
|
|
1676
|
+
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>'
|
|
1677
|
+
},
|
|
1678
|
+
{
|
|
1679
|
+
title: "Secure & Reliable",
|
|
1680
|
+
description: "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
|
|
1681
|
+
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>'
|
|
1682
|
+
},
|
|
1683
|
+
{
|
|
1684
|
+
title: "Easy to Use",
|
|
1685
|
+
description: "Ut enim ad minim veniam, quis nostrud exercitation ullamco.",
|
|
1686
|
+
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>'
|
|
1687
|
+
}
|
|
1688
|
+
];
|
|
1689
|
+
var dummyTestimonials = [
|
|
1690
|
+
{
|
|
1691
|
+
name: "John Doe",
|
|
1692
|
+
role: "CEO",
|
|
1693
|
+
company: "Tech Corp",
|
|
1694
|
+
avatar: dummyImage(80, 80, "JD", "3b82f6", "ffffff"),
|
|
1695
|
+
text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
|
|
1696
|
+
rating: 5
|
|
1697
|
+
},
|
|
1698
|
+
{
|
|
1699
|
+
name: "Jane Smith",
|
|
1700
|
+
role: "CTO",
|
|
1701
|
+
company: "Startup Inc",
|
|
1702
|
+
avatar: dummyImage(80, 80, "JS", "10b981", "ffffff"),
|
|
1703
|
+
text: "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
|
|
1704
|
+
rating: 5
|
|
1705
|
+
},
|
|
1706
|
+
{
|
|
1707
|
+
name: "Bob Wilson",
|
|
1708
|
+
role: "Product Manager",
|
|
1709
|
+
company: "Enterprise Co",
|
|
1710
|
+
avatar: dummyImage(80, 80, "BW", "f59e0b", "ffffff"),
|
|
1711
|
+
text: "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.",
|
|
1712
|
+
rating: 4
|
|
1713
|
+
}
|
|
1714
|
+
];
|
|
1715
|
+
var dummyPricingPlans = [
|
|
1716
|
+
{
|
|
1717
|
+
name: "Starter",
|
|
1718
|
+
description: "Perfect for individuals",
|
|
1719
|
+
price: "$9",
|
|
1720
|
+
period: "/month",
|
|
1721
|
+
features: [
|
|
1722
|
+
{ text: "5 Projects", included: true },
|
|
1723
|
+
{ text: "10GB Storage", included: true },
|
|
1724
|
+
{ text: "Email Support", included: true },
|
|
1725
|
+
{ text: "API Access", included: false },
|
|
1726
|
+
{ text: "Custom Domain", included: false }
|
|
1727
|
+
],
|
|
1728
|
+
ctaText: "Start Free Trial",
|
|
1729
|
+
ctaHref: "/signup?plan=starter"
|
|
1730
|
+
},
|
|
1731
|
+
{
|
|
1732
|
+
name: "Professional",
|
|
1733
|
+
description: "Best for growing teams",
|
|
1734
|
+
price: "$29",
|
|
1735
|
+
period: "/month",
|
|
1736
|
+
features: [
|
|
1737
|
+
{ text: "Unlimited Projects", included: true },
|
|
1738
|
+
{ text: "100GB Storage", included: true },
|
|
1739
|
+
{ text: "Priority Support", included: true },
|
|
1740
|
+
{ text: "API Access", included: true },
|
|
1741
|
+
{ text: "Custom Domain", included: false }
|
|
1742
|
+
],
|
|
1743
|
+
ctaText: "Start Free Trial",
|
|
1744
|
+
ctaHref: "/signup?plan=pro",
|
|
1745
|
+
popular: true,
|
|
1746
|
+
badge: "Most Popular"
|
|
1747
|
+
},
|
|
1748
|
+
{
|
|
1749
|
+
name: "Enterprise",
|
|
1750
|
+
description: "For large organizations",
|
|
1751
|
+
price: "$99",
|
|
1752
|
+
period: "/month",
|
|
1753
|
+
features: [
|
|
1754
|
+
{ text: "Unlimited Projects", included: true },
|
|
1755
|
+
{ text: "Unlimited Storage", included: true },
|
|
1756
|
+
{ text: "24/7 Support", included: true },
|
|
1757
|
+
{ text: "API Access", included: true },
|
|
1758
|
+
{ text: "Custom Domain", included: true }
|
|
1759
|
+
],
|
|
1760
|
+
ctaText: "Contact Sales",
|
|
1761
|
+
ctaHref: "/contact?plan=enterprise"
|
|
1762
|
+
}
|
|
1763
|
+
];
|
|
1764
|
+
var dummyFaqItems = [
|
|
1765
|
+
{
|
|
1766
|
+
question: "What is your refund policy?",
|
|
1767
|
+
answer: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
|
|
1768
|
+
},
|
|
1769
|
+
{
|
|
1770
|
+
question: "How do I cancel my subscription?",
|
|
1771
|
+
answer: "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."
|
|
1772
|
+
},
|
|
1773
|
+
{
|
|
1774
|
+
question: "Can I change my plan later?",
|
|
1775
|
+
answer: "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur."
|
|
1776
|
+
},
|
|
1777
|
+
{
|
|
1778
|
+
question: "Do you offer discounts for non-profits?",
|
|
1779
|
+
answer: "Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
|
|
1780
|
+
}
|
|
1781
|
+
];
|
|
1782
|
+
|
|
1783
|
+
// src/client/web/forms/types.ts
|
|
1784
|
+
var VALIDATION_MESSAGES = {
|
|
1785
|
+
required: "This field is required",
|
|
1786
|
+
email: "Please enter a valid email address",
|
|
1787
|
+
phone: "Please enter a valid phone number",
|
|
1788
|
+
minLength: (min) => `Must be at least ${min} characters`,
|
|
1789
|
+
maxLength: (max) => `Must be no more than ${max} characters`,
|
|
1790
|
+
passwordMatch: "Passwords must match",
|
|
1791
|
+
acceptTerms: "You must accept the terms and conditions",
|
|
1792
|
+
passwordUppercase: "Password must contain at least one uppercase letter",
|
|
1793
|
+
passwordLowercase: "Password must contain at least one lowercase letter",
|
|
1794
|
+
passwordNumber: "Password must contain at least one number",
|
|
1795
|
+
passwordSpecial: "Password must contain at least one special character"
|
|
1796
|
+
};
|
|
1797
|
+
var contactFormSchema = Yup__namespace.object().shape({
|
|
1798
|
+
name: Yup__namespace.string().required(VALIDATION_MESSAGES.required).min(2, VALIDATION_MESSAGES.minLength(2)).max(100, VALIDATION_MESSAGES.maxLength(100)),
|
|
1799
|
+
email: Yup__namespace.string().required(VALIDATION_MESSAGES.required).email(VALIDATION_MESSAGES.email),
|
|
1800
|
+
phone: Yup__namespace.string().matches(
|
|
1801
|
+
/^[+]?[(]?[0-9]{1,4}[)]?[-\s./0-9]*$/,
|
|
1802
|
+
VALIDATION_MESSAGES.phone
|
|
1803
|
+
).nullable(),
|
|
1804
|
+
subject: Yup__namespace.string().max(200, VALIDATION_MESSAGES.maxLength(200)).nullable(),
|
|
1805
|
+
message: Yup__namespace.string().required(VALIDATION_MESSAGES.required).min(10, VALIDATION_MESSAGES.minLength(10)).max(2e3, VALIDATION_MESSAGES.maxLength(2e3))
|
|
1806
|
+
});
|
|
1807
|
+
var newsletterFormSchema = Yup__namespace.object().shape({
|
|
1808
|
+
email: Yup__namespace.string().required(VALIDATION_MESSAGES.required).email(VALIDATION_MESSAGES.email),
|
|
1809
|
+
firstName: Yup__namespace.string().min(2, VALIDATION_MESSAGES.minLength(2)).max(50, VALIDATION_MESSAGES.maxLength(50)).nullable(),
|
|
1810
|
+
lastName: Yup__namespace.string().min(2, VALIDATION_MESSAGES.minLength(2)).max(50, VALIDATION_MESSAGES.maxLength(50)).nullable()
|
|
1811
|
+
});
|
|
1812
|
+
var loginFormSchema = Yup__namespace.object().shape({
|
|
1813
|
+
email: Yup__namespace.string().required(VALIDATION_MESSAGES.required).email(VALIDATION_MESSAGES.email),
|
|
1814
|
+
password: Yup__namespace.string().required(VALIDATION_MESSAGES.required).min(8, VALIDATION_MESSAGES.minLength(8)),
|
|
1815
|
+
rememberMe: Yup__namespace.boolean()
|
|
1816
|
+
});
|
|
1817
|
+
function createRegisterFormSchema(requirements = {}) {
|
|
1818
|
+
const {
|
|
1819
|
+
minLength = 8,
|
|
1820
|
+
requireUppercase = true,
|
|
1821
|
+
requireLowercase = true,
|
|
1822
|
+
requireNumber = true,
|
|
1823
|
+
requireSpecial = false
|
|
1824
|
+
} = requirements;
|
|
1825
|
+
let passwordSchema = Yup__namespace.string().required(VALIDATION_MESSAGES.required).min(minLength, VALIDATION_MESSAGES.minLength(minLength));
|
|
1826
|
+
if (requireUppercase) {
|
|
1827
|
+
passwordSchema = passwordSchema.matches(
|
|
1828
|
+
/[A-Z]/,
|
|
1829
|
+
VALIDATION_MESSAGES.passwordUppercase
|
|
1830
|
+
);
|
|
1831
|
+
}
|
|
1832
|
+
if (requireLowercase) {
|
|
1833
|
+
passwordSchema = passwordSchema.matches(
|
|
1834
|
+
/[a-z]/,
|
|
1835
|
+
VALIDATION_MESSAGES.passwordLowercase
|
|
1836
|
+
);
|
|
1837
|
+
}
|
|
1838
|
+
if (requireNumber) {
|
|
1839
|
+
passwordSchema = passwordSchema.matches(
|
|
1840
|
+
/[0-9]/,
|
|
1841
|
+
VALIDATION_MESSAGES.passwordNumber
|
|
1842
|
+
);
|
|
1843
|
+
}
|
|
1844
|
+
if (requireSpecial) {
|
|
1845
|
+
passwordSchema = passwordSchema.matches(
|
|
1846
|
+
/[!@#$%^&*(),.?":{}|<>]/,
|
|
1847
|
+
VALIDATION_MESSAGES.passwordSpecial
|
|
1848
|
+
);
|
|
1849
|
+
}
|
|
1850
|
+
return Yup__namespace.object().shape({
|
|
1851
|
+
firstName: Yup__namespace.string().required(VALIDATION_MESSAGES.required).min(2, VALIDATION_MESSAGES.minLength(2)).max(50, VALIDATION_MESSAGES.maxLength(50)),
|
|
1852
|
+
lastName: Yup__namespace.string().required(VALIDATION_MESSAGES.required).min(2, VALIDATION_MESSAGES.minLength(2)).max(50, VALIDATION_MESSAGES.maxLength(50)),
|
|
1853
|
+
email: Yup__namespace.string().required(VALIDATION_MESSAGES.required).email(VALIDATION_MESSAGES.email),
|
|
1854
|
+
password: passwordSchema,
|
|
1855
|
+
confirmPassword: Yup__namespace.string().required(VALIDATION_MESSAGES.required).oneOf([Yup__namespace.ref("password")], VALIDATION_MESSAGES.passwordMatch),
|
|
1856
|
+
acceptTerms: Yup__namespace.boolean().oneOf([true], VALIDATION_MESSAGES.acceptTerms)
|
|
1857
|
+
});
|
|
1858
|
+
}
|
|
1859
|
+
var registerFormSchema = createRegisterFormSchema();
|
|
1860
|
+
var defaultInitialValues = {
|
|
1861
|
+
name: "",
|
|
1862
|
+
email: "",
|
|
1863
|
+
phone: "",
|
|
1864
|
+
subject: "",
|
|
1865
|
+
message: ""
|
|
1866
|
+
};
|
|
1867
|
+
var defaultSubjectOptions = [
|
|
1868
|
+
"General Inquiry",
|
|
1869
|
+
"Support Request",
|
|
1870
|
+
"Sales Question",
|
|
1871
|
+
"Partnership",
|
|
1872
|
+
"Feedback",
|
|
1873
|
+
"Other"
|
|
1874
|
+
];
|
|
1875
|
+
function ContactForm({
|
|
1876
|
+
actionUrl,
|
|
1877
|
+
onSubmit,
|
|
1878
|
+
initialValues,
|
|
1879
|
+
showPhone = true,
|
|
1880
|
+
showSubject = true,
|
|
1881
|
+
subjectOptions = defaultSubjectOptions,
|
|
1882
|
+
submitText = "Send Message",
|
|
1883
|
+
successMessage = "Thank you! Your message has been sent successfully.",
|
|
1884
|
+
className = "",
|
|
1885
|
+
formClass = "",
|
|
1886
|
+
inputClass = "",
|
|
1887
|
+
labelClass = "",
|
|
1888
|
+
buttonClass = "",
|
|
1889
|
+
errorClass = ""
|
|
1890
|
+
}) {
|
|
1891
|
+
const [submitStatus, setSubmitStatus] = react.useState("idle");
|
|
1892
|
+
const [submitMessage, setSubmitMessage] = react.useState("");
|
|
1893
|
+
const mergedInitialValues = {
|
|
1894
|
+
...defaultInitialValues,
|
|
1895
|
+
...initialValues
|
|
1896
|
+
};
|
|
1897
|
+
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";
|
|
1898
|
+
const baseLabelClass = "block text-sm font-medium text-gray-700 mb-1";
|
|
1899
|
+
const baseErrorClass = "text-sm text-red-600 mt-1";
|
|
1900
|
+
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";
|
|
1901
|
+
const handleSubmit = async (values, { setSubmitting, resetForm }) => {
|
|
1902
|
+
try {
|
|
1903
|
+
let result;
|
|
1904
|
+
if (onSubmit) {
|
|
1905
|
+
result = await onSubmit(values);
|
|
1906
|
+
} else if (actionUrl) {
|
|
1907
|
+
const response = await fetch(actionUrl, {
|
|
1908
|
+
method: "POST",
|
|
1909
|
+
headers: { "Content-Type": "application/json" },
|
|
1910
|
+
body: JSON.stringify(values)
|
|
1911
|
+
});
|
|
1912
|
+
result = await response.json();
|
|
1913
|
+
} else {
|
|
1914
|
+
await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
1915
|
+
result = { success: true };
|
|
1916
|
+
}
|
|
1917
|
+
if (result.success) {
|
|
1918
|
+
setSubmitStatus("success");
|
|
1919
|
+
setSubmitMessage(result.message || successMessage);
|
|
1920
|
+
resetForm();
|
|
1921
|
+
} else {
|
|
1922
|
+
setSubmitStatus("error");
|
|
1923
|
+
setSubmitMessage(result.message || "Something went wrong. Please try again.");
|
|
1924
|
+
}
|
|
1925
|
+
} catch (error) {
|
|
1926
|
+
setSubmitStatus("error");
|
|
1927
|
+
setSubmitMessage("An error occurred. Please try again later.");
|
|
1928
|
+
} finally {
|
|
1929
|
+
setSubmitting(false);
|
|
1930
|
+
}
|
|
1931
|
+
};
|
|
1932
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `ec-contact-form ${className}`, children: submitStatus === "success" ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-6 bg-green-50 border border-green-200 rounded-lg text-center", children: [
|
|
1933
|
+
/* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.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" }) }),
|
|
1934
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-green-800 font-medium", children: submitMessage }),
|
|
1935
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1936
|
+
"button",
|
|
1937
|
+
{
|
|
1938
|
+
type: "button",
|
|
1939
|
+
onClick: () => setSubmitStatus("idle"),
|
|
1940
|
+
className: "mt-4 text-green-600 hover:text-green-700 text-sm font-medium",
|
|
1941
|
+
children: "Send another message"
|
|
1942
|
+
}
|
|
1943
|
+
)
|
|
1944
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1945
|
+
formik.Formik,
|
|
1946
|
+
{
|
|
1947
|
+
initialValues: mergedInitialValues,
|
|
1948
|
+
validationSchema: contactFormSchema,
|
|
1949
|
+
onSubmit: handleSubmit,
|
|
1950
|
+
children: ({ isSubmitting, errors, touched }) => /* @__PURE__ */ jsxRuntime.jsxs(formik.Form, { className: `space-y-4 ${formClass}`, noValidate: true, children: [
|
|
1951
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
1952
|
+
/* @__PURE__ */ jsxRuntime.jsxs("label", { htmlFor: "contact-name", className: `${baseLabelClass} ${labelClass}`, children: [
|
|
1953
|
+
"Name ",
|
|
1954
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-red-500", children: "*" })
|
|
1955
|
+
] }),
|
|
1956
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1957
|
+
formik.Field,
|
|
1958
|
+
{
|
|
1959
|
+
type: "text",
|
|
1960
|
+
id: "contact-name",
|
|
1961
|
+
name: "name",
|
|
1962
|
+
placeholder: "John Doe",
|
|
1963
|
+
className: `${baseInputClass} ${inputClass} ${errors.name && touched.name ? "border-red-500 focus:ring-red-500" : ""}`
|
|
1964
|
+
}
|
|
1965
|
+
),
|
|
1966
|
+
/* @__PURE__ */ jsxRuntime.jsx(formik.ErrorMessage, { name: "name", component: "p", className: `${baseErrorClass} ${errorClass}` })
|
|
1967
|
+
] }),
|
|
1968
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
1969
|
+
/* @__PURE__ */ jsxRuntime.jsxs("label", { htmlFor: "contact-email", className: `${baseLabelClass} ${labelClass}`, children: [
|
|
1970
|
+
"Email ",
|
|
1971
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-red-500", children: "*" })
|
|
1972
|
+
] }),
|
|
1973
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1974
|
+
formik.Field,
|
|
1975
|
+
{
|
|
1976
|
+
type: "email",
|
|
1977
|
+
id: "contact-email",
|
|
1978
|
+
name: "email",
|
|
1979
|
+
placeholder: "john@example.com",
|
|
1980
|
+
className: `${baseInputClass} ${inputClass} ${errors.email && touched.email ? "border-red-500 focus:ring-red-500" : ""}`
|
|
1981
|
+
}
|
|
1982
|
+
),
|
|
1983
|
+
/* @__PURE__ */ jsxRuntime.jsx(formik.ErrorMessage, { name: "email", component: "p", className: `${baseErrorClass} ${errorClass}` })
|
|
1984
|
+
] }),
|
|
1985
|
+
showPhone && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
1986
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: "contact-phone", className: `${baseLabelClass} ${labelClass}`, children: "Phone" }),
|
|
1987
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1988
|
+
formik.Field,
|
|
1989
|
+
{
|
|
1990
|
+
type: "tel",
|
|
1991
|
+
id: "contact-phone",
|
|
1992
|
+
name: "phone",
|
|
1993
|
+
placeholder: "+1 (555) 000-0000",
|
|
1994
|
+
className: `${baseInputClass} ${inputClass} ${errors.phone && touched.phone ? "border-red-500 focus:ring-red-500" : ""}`
|
|
1995
|
+
}
|
|
1996
|
+
),
|
|
1997
|
+
/* @__PURE__ */ jsxRuntime.jsx(formik.ErrorMessage, { name: "phone", component: "p", className: `${baseErrorClass} ${errorClass}` })
|
|
1998
|
+
] }),
|
|
1999
|
+
showSubject && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2000
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: "contact-subject", className: `${baseLabelClass} ${labelClass}`, children: "Subject" }),
|
|
2001
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2002
|
+
formik.Field,
|
|
2003
|
+
{
|
|
2004
|
+
as: "select",
|
|
2005
|
+
id: "contact-subject",
|
|
2006
|
+
name: "subject",
|
|
2007
|
+
className: `${baseInputClass} ${inputClass}`,
|
|
2008
|
+
children: [
|
|
2009
|
+
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "", children: "Select a subject..." }),
|
|
2010
|
+
subjectOptions.map((option) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: option, children: option }, option))
|
|
2011
|
+
]
|
|
2012
|
+
}
|
|
2013
|
+
),
|
|
2014
|
+
/* @__PURE__ */ jsxRuntime.jsx(formik.ErrorMessage, { name: "subject", component: "p", className: `${baseErrorClass} ${errorClass}` })
|
|
2015
|
+
] }),
|
|
2016
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2017
|
+
/* @__PURE__ */ jsxRuntime.jsxs("label", { htmlFor: "contact-message", className: `${baseLabelClass} ${labelClass}`, children: [
|
|
2018
|
+
"Message ",
|
|
2019
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-red-500", children: "*" })
|
|
2020
|
+
] }),
|
|
2021
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2022
|
+
formik.Field,
|
|
2023
|
+
{
|
|
2024
|
+
as: "textarea",
|
|
2025
|
+
id: "contact-message",
|
|
2026
|
+
name: "message",
|
|
2027
|
+
rows: 5,
|
|
2028
|
+
placeholder: "Your message...",
|
|
2029
|
+
className: `${baseInputClass} ${inputClass} resize-none ${errors.message && touched.message ? "border-red-500 focus:ring-red-500" : ""}`
|
|
2030
|
+
}
|
|
2031
|
+
),
|
|
2032
|
+
/* @__PURE__ */ jsxRuntime.jsx(formik.ErrorMessage, { name: "message", component: "p", className: `${baseErrorClass} ${errorClass}` })
|
|
2033
|
+
] }),
|
|
2034
|
+
submitStatus === "error" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-red-800 text-sm", children: submitMessage }) }),
|
|
2035
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2036
|
+
"button",
|
|
2037
|
+
{
|
|
2038
|
+
type: "submit",
|
|
2039
|
+
disabled: isSubmitting,
|
|
2040
|
+
className: `${baseButtonClass} ${buttonClass}`,
|
|
2041
|
+
children: isSubmitting ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center justify-center gap-2", children: [
|
|
2042
|
+
/* @__PURE__ */ jsxRuntime.jsxs("svg", { className: "animate-spin w-5 h-5", fill: "none", viewBox: "0 0 24 24", children: [
|
|
2043
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
2044
|
+
/* @__PURE__ */ jsxRuntime.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" })
|
|
2045
|
+
] }),
|
|
2046
|
+
"Sending..."
|
|
2047
|
+
] }) : submitText
|
|
2048
|
+
}
|
|
2049
|
+
)
|
|
2050
|
+
] })
|
|
2051
|
+
}
|
|
2052
|
+
) });
|
|
2053
|
+
}
|
|
2054
|
+
var defaultInitialValues2 = {
|
|
2055
|
+
email: "",
|
|
2056
|
+
firstName: "",
|
|
2057
|
+
lastName: ""
|
|
2058
|
+
};
|
|
2059
|
+
function NewsletterForm({
|
|
2060
|
+
actionUrl,
|
|
2061
|
+
onSubmit,
|
|
2062
|
+
initialValues,
|
|
2063
|
+
showName = false,
|
|
2064
|
+
placeholder = "Enter your email",
|
|
2065
|
+
submitText = "Subscribe",
|
|
2066
|
+
successMessage = "Thank you for subscribing!",
|
|
2067
|
+
layout = "inline",
|
|
2068
|
+
className = "",
|
|
2069
|
+
formClass = "",
|
|
2070
|
+
inputClass = "",
|
|
2071
|
+
buttonClass = ""
|
|
2072
|
+
}) {
|
|
2073
|
+
const [submitStatus, setSubmitStatus] = react.useState("idle");
|
|
2074
|
+
const [submitMessage, setSubmitMessage] = react.useState("");
|
|
2075
|
+
const mergedInitialValues = {
|
|
2076
|
+
...defaultInitialValues2,
|
|
2077
|
+
...initialValues
|
|
2078
|
+
};
|
|
2079
|
+
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";
|
|
2080
|
+
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";
|
|
2081
|
+
const handleSubmit = async (values, { setSubmitting, resetForm }) => {
|
|
2082
|
+
try {
|
|
2083
|
+
let result;
|
|
2084
|
+
if (onSubmit) {
|
|
2085
|
+
result = await onSubmit(values);
|
|
2086
|
+
} else if (actionUrl) {
|
|
2087
|
+
const response = await fetch(actionUrl, {
|
|
2088
|
+
method: "POST",
|
|
2089
|
+
headers: { "Content-Type": "application/json" },
|
|
2090
|
+
body: JSON.stringify(values)
|
|
2091
|
+
});
|
|
2092
|
+
result = await response.json();
|
|
2093
|
+
} else {
|
|
2094
|
+
await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
2095
|
+
result = { success: true };
|
|
2096
|
+
}
|
|
2097
|
+
if (result.success) {
|
|
2098
|
+
setSubmitStatus("success");
|
|
2099
|
+
setSubmitMessage(result.message || successMessage);
|
|
2100
|
+
resetForm();
|
|
2101
|
+
} else {
|
|
2102
|
+
setSubmitStatus("error");
|
|
2103
|
+
setSubmitMessage(result.message || "Something went wrong. Please try again.");
|
|
2104
|
+
}
|
|
2105
|
+
} catch (error) {
|
|
2106
|
+
setSubmitStatus("error");
|
|
2107
|
+
setSubmitMessage("An error occurred. Please try again later.");
|
|
2108
|
+
} finally {
|
|
2109
|
+
setSubmitting(false);
|
|
2110
|
+
}
|
|
2111
|
+
};
|
|
2112
|
+
if (submitStatus === "success") {
|
|
2113
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `ec-newsletter-form ${className}`, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-4 bg-green-50 border border-green-200 rounded-lg text-center", children: [
|
|
2114
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-green-800 font-medium", children: submitMessage }),
|
|
2115
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2116
|
+
"button",
|
|
2117
|
+
{
|
|
2118
|
+
type: "button",
|
|
2119
|
+
onClick: () => setSubmitStatus("idle"),
|
|
2120
|
+
className: "mt-2 text-green-600 hover:text-green-700 text-sm",
|
|
2121
|
+
children: "Subscribe another email"
|
|
2122
|
+
}
|
|
2123
|
+
)
|
|
2124
|
+
] }) });
|
|
2125
|
+
}
|
|
2126
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `ec-newsletter-form ${className}`, children: [
|
|
2127
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2128
|
+
formik.Formik,
|
|
2129
|
+
{
|
|
2130
|
+
initialValues: mergedInitialValues,
|
|
2131
|
+
validationSchema: newsletterFormSchema,
|
|
2132
|
+
onSubmit: handleSubmit,
|
|
2133
|
+
children: ({ isSubmitting, errors, touched }) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2134
|
+
formik.Form,
|
|
2135
|
+
{
|
|
2136
|
+
className: `${layout === "inline" ? "flex flex-col sm:flex-row gap-3" : "space-y-4"} ${formClass}`,
|
|
2137
|
+
noValidate: true,
|
|
2138
|
+
children: [
|
|
2139
|
+
showName && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: layout === "inline" ? "flex gap-3 flex-1" : "grid grid-cols-2 gap-4", children: [
|
|
2140
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1", children: [
|
|
2141
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2142
|
+
formik.Field,
|
|
2143
|
+
{
|
|
2144
|
+
type: "text",
|
|
2145
|
+
name: "firstName",
|
|
2146
|
+
placeholder: "First name",
|
|
2147
|
+
className: `w-full ${baseInputClass} ${inputClass} ${errors.firstName && touched.firstName ? "border-red-500" : ""}`
|
|
2148
|
+
}
|
|
2149
|
+
),
|
|
2150
|
+
layout === "stacked" && /* @__PURE__ */ jsxRuntime.jsx(formik.ErrorMessage, { name: "firstName", component: "p", className: "text-sm text-red-600 mt-1" })
|
|
2151
|
+
] }),
|
|
2152
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1", children: [
|
|
2153
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2154
|
+
formik.Field,
|
|
2155
|
+
{
|
|
2156
|
+
type: "text",
|
|
2157
|
+
name: "lastName",
|
|
2158
|
+
placeholder: "Last name",
|
|
2159
|
+
className: `w-full ${baseInputClass} ${inputClass} ${errors.lastName && touched.lastName ? "border-red-500" : ""}`
|
|
2160
|
+
}
|
|
2161
|
+
),
|
|
2162
|
+
layout === "stacked" && /* @__PURE__ */ jsxRuntime.jsx(formik.ErrorMessage, { name: "lastName", component: "p", className: "text-sm text-red-600 mt-1" })
|
|
2163
|
+
] })
|
|
2164
|
+
] }),
|
|
2165
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: layout === "inline" ? "flex-1" : "", children: [
|
|
2166
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2167
|
+
formik.Field,
|
|
2168
|
+
{
|
|
2169
|
+
type: "email",
|
|
2170
|
+
name: "email",
|
|
2171
|
+
placeholder,
|
|
2172
|
+
className: `w-full ${baseInputClass} ${inputClass} ${errors.email && touched.email ? "border-red-500" : ""}`
|
|
2173
|
+
}
|
|
2174
|
+
),
|
|
2175
|
+
layout === "stacked" && /* @__PURE__ */ jsxRuntime.jsx(formik.ErrorMessage, { name: "email", component: "p", className: "text-sm text-red-600 mt-1" })
|
|
2176
|
+
] }),
|
|
2177
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2178
|
+
"button",
|
|
2179
|
+
{
|
|
2180
|
+
type: "submit",
|
|
2181
|
+
disabled: isSubmitting,
|
|
2182
|
+
className: `${baseButtonClass} ${buttonClass} ${layout === "stacked" ? "w-full" : ""}`,
|
|
2183
|
+
children: isSubmitting ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center justify-center gap-2", children: [
|
|
2184
|
+
/* @__PURE__ */ jsxRuntime.jsxs("svg", { className: "animate-spin w-5 h-5", fill: "none", viewBox: "0 0 24 24", children: [
|
|
2185
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
2186
|
+
/* @__PURE__ */ jsxRuntime.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" })
|
|
2187
|
+
] }),
|
|
2188
|
+
"Subscribing..."
|
|
2189
|
+
] }) : submitText
|
|
2190
|
+
}
|
|
2191
|
+
),
|
|
2192
|
+
layout === "inline" && errors.email && touched.email && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full sm:w-auto", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-red-600", children: errors.email }) })
|
|
2193
|
+
]
|
|
2194
|
+
}
|
|
2195
|
+
)
|
|
2196
|
+
}
|
|
2197
|
+
),
|
|
2198
|
+
submitStatus === "error" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-4 p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-red-800 text-sm", children: submitMessage }) })
|
|
2199
|
+
] });
|
|
2200
|
+
}
|
|
2201
|
+
var defaultInitialValues3 = {
|
|
2202
|
+
email: "",
|
|
2203
|
+
password: "",
|
|
2204
|
+
rememberMe: false
|
|
2205
|
+
};
|
|
2206
|
+
function LoginForm({
|
|
2207
|
+
actionUrl,
|
|
2208
|
+
onSubmit,
|
|
2209
|
+
initialValues,
|
|
2210
|
+
showRememberMe = true,
|
|
2211
|
+
forgotPasswordLink = "/forgot-password",
|
|
2212
|
+
registerLink = "/register",
|
|
2213
|
+
submitText = "Sign In",
|
|
2214
|
+
successRedirect,
|
|
2215
|
+
className = "",
|
|
2216
|
+
formClass = "",
|
|
2217
|
+
inputClass = "",
|
|
2218
|
+
buttonClass = ""
|
|
2219
|
+
}) {
|
|
2220
|
+
const [submitStatus, setSubmitStatus] = react.useState("idle");
|
|
2221
|
+
const [submitMessage, setSubmitMessage] = react.useState("");
|
|
2222
|
+
const [showPassword, setShowPassword] = react.useState(false);
|
|
2223
|
+
const mergedInitialValues = {
|
|
2224
|
+
...defaultInitialValues3,
|
|
2225
|
+
...initialValues
|
|
2226
|
+
};
|
|
2227
|
+
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";
|
|
2228
|
+
const baseLabelClass = "block text-sm font-medium text-gray-700 mb-1";
|
|
2229
|
+
const baseErrorClass = "text-sm text-red-600 mt-1";
|
|
2230
|
+
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";
|
|
2231
|
+
const handleSubmit = async (values, { setSubmitting }) => {
|
|
2232
|
+
try {
|
|
2233
|
+
let result;
|
|
2234
|
+
if (onSubmit) {
|
|
2235
|
+
result = await onSubmit(values);
|
|
2236
|
+
} else if (actionUrl) {
|
|
2237
|
+
const response = await fetch(actionUrl, {
|
|
2238
|
+
method: "POST",
|
|
2239
|
+
headers: { "Content-Type": "application/json" },
|
|
2240
|
+
body: JSON.stringify(values)
|
|
2241
|
+
});
|
|
2242
|
+
result = await response.json();
|
|
2243
|
+
} else {
|
|
2244
|
+
await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
2245
|
+
result = { success: true };
|
|
2246
|
+
}
|
|
2247
|
+
if (result.success) {
|
|
2248
|
+
setSubmitStatus("success");
|
|
2249
|
+
setSubmitMessage(result.message || "Login successful!");
|
|
2250
|
+
if (successRedirect && typeof window !== "undefined") {
|
|
2251
|
+
window.location.href = successRedirect;
|
|
2252
|
+
}
|
|
2253
|
+
} else {
|
|
2254
|
+
setSubmitStatus("error");
|
|
2255
|
+
setSubmitMessage(result.message || "Invalid email or password.");
|
|
2256
|
+
}
|
|
2257
|
+
} catch (error) {
|
|
2258
|
+
setSubmitStatus("error");
|
|
2259
|
+
setSubmitMessage("An error occurred. Please try again later.");
|
|
2260
|
+
} finally {
|
|
2261
|
+
setSubmitting(false);
|
|
2262
|
+
}
|
|
2263
|
+
};
|
|
2264
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `ec-login-form ${className}`, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2265
|
+
formik.Formik,
|
|
2266
|
+
{
|
|
2267
|
+
initialValues: mergedInitialValues,
|
|
2268
|
+
validationSchema: loginFormSchema,
|
|
2269
|
+
onSubmit: handleSubmit,
|
|
2270
|
+
children: ({ isSubmitting, errors, touched }) => /* @__PURE__ */ jsxRuntime.jsxs(formik.Form, { className: `space-y-4 ${formClass}`, noValidate: true, children: [
|
|
2271
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2272
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: "login-email", className: baseLabelClass, children: "Email" }),
|
|
2273
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2274
|
+
formik.Field,
|
|
2275
|
+
{
|
|
2276
|
+
type: "email",
|
|
2277
|
+
id: "login-email",
|
|
2278
|
+
name: "email",
|
|
2279
|
+
placeholder: "you@example.com",
|
|
2280
|
+
autoComplete: "email",
|
|
2281
|
+
className: `${baseInputClass} ${inputClass} ${errors.email && touched.email ? "border-red-500 focus:ring-red-500" : ""}`
|
|
2282
|
+
}
|
|
2283
|
+
),
|
|
2284
|
+
/* @__PURE__ */ jsxRuntime.jsx(formik.ErrorMessage, { name: "email", component: "p", className: baseErrorClass })
|
|
2285
|
+
] }),
|
|
2286
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2287
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: "login-password", className: baseLabelClass, children: "Password" }),
|
|
2288
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
2289
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2290
|
+
formik.Field,
|
|
2291
|
+
{
|
|
2292
|
+
type: showPassword ? "text" : "password",
|
|
2293
|
+
id: "login-password",
|
|
2294
|
+
name: "password",
|
|
2295
|
+
placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",
|
|
2296
|
+
autoComplete: "current-password",
|
|
2297
|
+
className: `${baseInputClass} ${inputClass} pr-12 ${errors.password && touched.password ? "border-red-500 focus:ring-red-500" : ""}`
|
|
2298
|
+
}
|
|
2299
|
+
),
|
|
2300
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2301
|
+
"button",
|
|
2302
|
+
{
|
|
2303
|
+
type: "button",
|
|
2304
|
+
onClick: () => setShowPassword(!showPassword),
|
|
2305
|
+
className: "absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700",
|
|
2306
|
+
tabIndex: -1,
|
|
2307
|
+
children: showPassword ? /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.jsxs("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: [
|
|
2308
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }),
|
|
2309
|
+
/* @__PURE__ */ jsxRuntime.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" })
|
|
2310
|
+
] })
|
|
2311
|
+
}
|
|
2312
|
+
)
|
|
2313
|
+
] }),
|
|
2314
|
+
/* @__PURE__ */ jsxRuntime.jsx(formik.ErrorMessage, { name: "password", component: "p", className: baseErrorClass })
|
|
2315
|
+
] }),
|
|
2316
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
2317
|
+
showRememberMe && /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [
|
|
2318
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2319
|
+
formik.Field,
|
|
2320
|
+
{
|
|
2321
|
+
type: "checkbox",
|
|
2322
|
+
name: "rememberMe",
|
|
2323
|
+
className: "w-4 h-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500"
|
|
2324
|
+
}
|
|
2325
|
+
),
|
|
2326
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-gray-600", children: "Remember me" })
|
|
2327
|
+
] }),
|
|
2328
|
+
forgotPasswordLink && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2329
|
+
"a",
|
|
2330
|
+
{
|
|
2331
|
+
href: forgotPasswordLink,
|
|
2332
|
+
className: "text-sm text-blue-600 hover:text-blue-700 font-medium",
|
|
2333
|
+
children: "Forgot password?"
|
|
2334
|
+
}
|
|
2335
|
+
)
|
|
2336
|
+
] }),
|
|
2337
|
+
submitStatus === "error" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-red-800 text-sm", children: submitMessage }) }),
|
|
2338
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2339
|
+
"button",
|
|
2340
|
+
{
|
|
2341
|
+
type: "submit",
|
|
2342
|
+
disabled: isSubmitting,
|
|
2343
|
+
className: `${baseButtonClass} ${buttonClass}`,
|
|
2344
|
+
children: isSubmitting ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center justify-center gap-2", children: [
|
|
2345
|
+
/* @__PURE__ */ jsxRuntime.jsxs("svg", { className: "animate-spin w-5 h-5", fill: "none", viewBox: "0 0 24 24", children: [
|
|
2346
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
2347
|
+
/* @__PURE__ */ jsxRuntime.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" })
|
|
2348
|
+
] }),
|
|
2349
|
+
"Signing in..."
|
|
2350
|
+
] }) : submitText
|
|
2351
|
+
}
|
|
2352
|
+
),
|
|
2353
|
+
registerLink && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-center text-sm text-gray-600", children: [
|
|
2354
|
+
"Don't have an account?",
|
|
2355
|
+
" ",
|
|
2356
|
+
/* @__PURE__ */ jsxRuntime.jsx("a", { href: registerLink, className: "text-blue-600 hover:text-blue-700 font-medium", children: "Sign up" })
|
|
2357
|
+
] })
|
|
2358
|
+
] })
|
|
2359
|
+
}
|
|
2360
|
+
) });
|
|
2361
|
+
}
|
|
2362
|
+
var defaultInitialValues4 = {
|
|
2363
|
+
firstName: "",
|
|
2364
|
+
lastName: "",
|
|
2365
|
+
email: "",
|
|
2366
|
+
password: "",
|
|
2367
|
+
confirmPassword: "",
|
|
2368
|
+
acceptTerms: false
|
|
2369
|
+
};
|
|
2370
|
+
function RegisterForm({
|
|
2371
|
+
actionUrl,
|
|
2372
|
+
onSubmit,
|
|
2373
|
+
initialValues,
|
|
2374
|
+
termsLink = "/terms",
|
|
2375
|
+
privacyLink = "/privacy",
|
|
2376
|
+
loginLink = "/login",
|
|
2377
|
+
submitText = "Create Account",
|
|
2378
|
+
successRedirect,
|
|
2379
|
+
passwordRequirements = {
|
|
2380
|
+
minLength: 8,
|
|
2381
|
+
requireUppercase: true,
|
|
2382
|
+
requireLowercase: true,
|
|
2383
|
+
requireNumber: true,
|
|
2384
|
+
requireSpecial: false
|
|
2385
|
+
},
|
|
2386
|
+
className = "",
|
|
2387
|
+
formClass = "",
|
|
2388
|
+
inputClass = "",
|
|
2389
|
+
buttonClass = ""
|
|
2390
|
+
}) {
|
|
2391
|
+
const [submitStatus, setSubmitStatus] = react.useState("idle");
|
|
2392
|
+
const [submitMessage, setSubmitMessage] = react.useState("");
|
|
2393
|
+
const [showPassword, setShowPassword] = react.useState(false);
|
|
2394
|
+
const [showConfirmPassword, setShowConfirmPassword] = react.useState(false);
|
|
2395
|
+
const mergedInitialValues = {
|
|
2396
|
+
...defaultInitialValues4,
|
|
2397
|
+
...initialValues
|
|
2398
|
+
};
|
|
2399
|
+
const validationSchema = createRegisterFormSchema(passwordRequirements);
|
|
2400
|
+
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";
|
|
2401
|
+
const baseLabelClass = "block text-sm font-medium text-gray-700 mb-1";
|
|
2402
|
+
const baseErrorClass = "text-sm text-red-600 mt-1";
|
|
2403
|
+
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";
|
|
2404
|
+
const handleSubmit = async (values, { setSubmitting }) => {
|
|
2405
|
+
try {
|
|
2406
|
+
let result;
|
|
2407
|
+
if (onSubmit) {
|
|
2408
|
+
result = await onSubmit(values);
|
|
2409
|
+
} else if (actionUrl) {
|
|
2410
|
+
const response = await fetch(actionUrl, {
|
|
2411
|
+
method: "POST",
|
|
2412
|
+
headers: { "Content-Type": "application/json" },
|
|
2413
|
+
body: JSON.stringify(values)
|
|
2414
|
+
});
|
|
2415
|
+
result = await response.json();
|
|
2416
|
+
} else {
|
|
2417
|
+
await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
2418
|
+
result = { success: true };
|
|
2419
|
+
}
|
|
2420
|
+
if (result.success) {
|
|
2421
|
+
setSubmitStatus("success");
|
|
2422
|
+
setSubmitMessage(result.message || "Account created successfully!");
|
|
2423
|
+
if (successRedirect && typeof window !== "undefined") {
|
|
2424
|
+
window.location.href = successRedirect;
|
|
2425
|
+
}
|
|
2426
|
+
} else {
|
|
2427
|
+
setSubmitStatus("error");
|
|
2428
|
+
setSubmitMessage(result.message || "Registration failed. Please try again.");
|
|
2429
|
+
}
|
|
2430
|
+
} catch (error) {
|
|
2431
|
+
setSubmitStatus("error");
|
|
2432
|
+
setSubmitMessage("An error occurred. Please try again later.");
|
|
2433
|
+
} finally {
|
|
2434
|
+
setSubmitting(false);
|
|
2435
|
+
}
|
|
2436
|
+
};
|
|
2437
|
+
if (submitStatus === "success") {
|
|
2438
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `ec-register-form ${className}`, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-6 bg-green-50 border border-green-200 rounded-lg text-center", children: [
|
|
2439
|
+
/* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.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" }) }),
|
|
2440
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-green-800 font-medium", children: submitMessage }),
|
|
2441
|
+
loginLink && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2442
|
+
"a",
|
|
2443
|
+
{
|
|
2444
|
+
href: loginLink,
|
|
2445
|
+
className: "inline-block mt-4 text-green-600 hover:text-green-700 font-medium",
|
|
2446
|
+
children: "Sign in to your account"
|
|
2447
|
+
}
|
|
2448
|
+
)
|
|
2449
|
+
] }) });
|
|
2450
|
+
}
|
|
2451
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `ec-register-form ${className}`, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2452
|
+
formik.Formik,
|
|
2453
|
+
{
|
|
2454
|
+
initialValues: mergedInitialValues,
|
|
2455
|
+
validationSchema,
|
|
2456
|
+
onSubmit: handleSubmit,
|
|
2457
|
+
children: ({ isSubmitting, errors, touched }) => /* @__PURE__ */ jsxRuntime.jsxs(formik.Form, { className: `space-y-4 ${formClass}`, noValidate: true, children: [
|
|
2458
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
2459
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2460
|
+
/* @__PURE__ */ jsxRuntime.jsxs("label", { htmlFor: "register-firstName", className: baseLabelClass, children: [
|
|
2461
|
+
"First Name ",
|
|
2462
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-red-500", children: "*" })
|
|
2463
|
+
] }),
|
|
2464
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2465
|
+
formik.Field,
|
|
2466
|
+
{
|
|
2467
|
+
type: "text",
|
|
2468
|
+
id: "register-firstName",
|
|
2469
|
+
name: "firstName",
|
|
2470
|
+
placeholder: "John",
|
|
2471
|
+
autoComplete: "given-name",
|
|
2472
|
+
className: `${baseInputClass} ${inputClass} ${errors.firstName && touched.firstName ? "border-red-500 focus:ring-red-500" : ""}`
|
|
2473
|
+
}
|
|
2474
|
+
),
|
|
2475
|
+
/* @__PURE__ */ jsxRuntime.jsx(formik.ErrorMessage, { name: "firstName", component: "p", className: baseErrorClass })
|
|
2476
|
+
] }),
|
|
2477
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2478
|
+
/* @__PURE__ */ jsxRuntime.jsxs("label", { htmlFor: "register-lastName", className: baseLabelClass, children: [
|
|
2479
|
+
"Last Name ",
|
|
2480
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-red-500", children: "*" })
|
|
2481
|
+
] }),
|
|
2482
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2483
|
+
formik.Field,
|
|
2484
|
+
{
|
|
2485
|
+
type: "text",
|
|
2486
|
+
id: "register-lastName",
|
|
2487
|
+
name: "lastName",
|
|
2488
|
+
placeholder: "Doe",
|
|
2489
|
+
autoComplete: "family-name",
|
|
2490
|
+
className: `${baseInputClass} ${inputClass} ${errors.lastName && touched.lastName ? "border-red-500 focus:ring-red-500" : ""}`
|
|
2491
|
+
}
|
|
2492
|
+
),
|
|
2493
|
+
/* @__PURE__ */ jsxRuntime.jsx(formik.ErrorMessage, { name: "lastName", component: "p", className: baseErrorClass })
|
|
2494
|
+
] })
|
|
2495
|
+
] }),
|
|
2496
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2497
|
+
/* @__PURE__ */ jsxRuntime.jsxs("label", { htmlFor: "register-email", className: baseLabelClass, children: [
|
|
2498
|
+
"Email ",
|
|
2499
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-red-500", children: "*" })
|
|
2500
|
+
] }),
|
|
2501
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2502
|
+
formik.Field,
|
|
2503
|
+
{
|
|
2504
|
+
type: "email",
|
|
2505
|
+
id: "register-email",
|
|
2506
|
+
name: "email",
|
|
2507
|
+
placeholder: "you@example.com",
|
|
2508
|
+
autoComplete: "email",
|
|
2509
|
+
className: `${baseInputClass} ${inputClass} ${errors.email && touched.email ? "border-red-500 focus:ring-red-500" : ""}`
|
|
2510
|
+
}
|
|
2511
|
+
),
|
|
2512
|
+
/* @__PURE__ */ jsxRuntime.jsx(formik.ErrorMessage, { name: "email", component: "p", className: baseErrorClass })
|
|
2513
|
+
] }),
|
|
2514
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2515
|
+
/* @__PURE__ */ jsxRuntime.jsxs("label", { htmlFor: "register-password", className: baseLabelClass, children: [
|
|
2516
|
+
"Password ",
|
|
2517
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-red-500", children: "*" })
|
|
2518
|
+
] }),
|
|
2519
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
2520
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2521
|
+
formik.Field,
|
|
2522
|
+
{
|
|
2523
|
+
type: showPassword ? "text" : "password",
|
|
2524
|
+
id: "register-password",
|
|
2525
|
+
name: "password",
|
|
2526
|
+
placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",
|
|
2527
|
+
autoComplete: "new-password",
|
|
2528
|
+
className: `${baseInputClass} ${inputClass} pr-12 ${errors.password && touched.password ? "border-red-500 focus:ring-red-500" : ""}`
|
|
2529
|
+
}
|
|
2530
|
+
),
|
|
2531
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2532
|
+
"button",
|
|
2533
|
+
{
|
|
2534
|
+
type: "button",
|
|
2535
|
+
onClick: () => setShowPassword(!showPassword),
|
|
2536
|
+
className: "absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700",
|
|
2537
|
+
tabIndex: -1,
|
|
2538
|
+
children: showPassword ? /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.jsxs("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: [
|
|
2539
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }),
|
|
2540
|
+
/* @__PURE__ */ jsxRuntime.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" })
|
|
2541
|
+
] })
|
|
2542
|
+
}
|
|
2543
|
+
)
|
|
2544
|
+
] }),
|
|
2545
|
+
/* @__PURE__ */ jsxRuntime.jsx(formik.ErrorMessage, { name: "password", component: "p", className: baseErrorClass }),
|
|
2546
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-gray-500 mt-1", children: [
|
|
2547
|
+
"Min ",
|
|
2548
|
+
passwordRequirements.minLength,
|
|
2549
|
+
" characters",
|
|
2550
|
+
passwordRequirements.requireUppercase && ", uppercase",
|
|
2551
|
+
passwordRequirements.requireLowercase && ", lowercase",
|
|
2552
|
+
passwordRequirements.requireNumber && ", number",
|
|
2553
|
+
passwordRequirements.requireSpecial && ", special character"
|
|
2554
|
+
] })
|
|
2555
|
+
] }),
|
|
2556
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2557
|
+
/* @__PURE__ */ jsxRuntime.jsxs("label", { htmlFor: "register-confirmPassword", className: baseLabelClass, children: [
|
|
2558
|
+
"Confirm Password ",
|
|
2559
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-red-500", children: "*" })
|
|
2560
|
+
] }),
|
|
2561
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
2562
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2563
|
+
formik.Field,
|
|
2564
|
+
{
|
|
2565
|
+
type: showConfirmPassword ? "text" : "password",
|
|
2566
|
+
id: "register-confirmPassword",
|
|
2567
|
+
name: "confirmPassword",
|
|
2568
|
+
placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",
|
|
2569
|
+
autoComplete: "new-password",
|
|
2570
|
+
className: `${baseInputClass} ${inputClass} pr-12 ${errors.confirmPassword && touched.confirmPassword ? "border-red-500 focus:ring-red-500" : ""}`
|
|
2571
|
+
}
|
|
2572
|
+
),
|
|
2573
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2574
|
+
"button",
|
|
2575
|
+
{
|
|
2576
|
+
type: "button",
|
|
2577
|
+
onClick: () => setShowConfirmPassword(!showConfirmPassword),
|
|
2578
|
+
className: "absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700",
|
|
2579
|
+
tabIndex: -1,
|
|
2580
|
+
children: showConfirmPassword ? /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.jsxs("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: [
|
|
2581
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }),
|
|
2582
|
+
/* @__PURE__ */ jsxRuntime.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" })
|
|
2583
|
+
] })
|
|
2584
|
+
}
|
|
2585
|
+
)
|
|
2586
|
+
] }),
|
|
2587
|
+
/* @__PURE__ */ jsxRuntime.jsx(formik.ErrorMessage, { name: "confirmPassword", component: "p", className: baseErrorClass })
|
|
2588
|
+
] }),
|
|
2589
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2590
|
+
/* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex items-start gap-2 cursor-pointer", children: [
|
|
2591
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2592
|
+
formik.Field,
|
|
2593
|
+
{
|
|
2594
|
+
type: "checkbox",
|
|
2595
|
+
name: "acceptTerms",
|
|
2596
|
+
className: "w-4 h-4 mt-1 rounded border-gray-300 text-blue-600 focus:ring-blue-500"
|
|
2597
|
+
}
|
|
2598
|
+
),
|
|
2599
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm text-gray-600", children: [
|
|
2600
|
+
"I agree to the",
|
|
2601
|
+
" ",
|
|
2602
|
+
/* @__PURE__ */ jsxRuntime.jsx("a", { href: termsLink, className: "text-blue-600 hover:underline", target: "_blank", rel: "noopener noreferrer", children: "Terms of Service" }),
|
|
2603
|
+
" ",
|
|
2604
|
+
"and",
|
|
2605
|
+
" ",
|
|
2606
|
+
/* @__PURE__ */ jsxRuntime.jsx("a", { href: privacyLink, className: "text-blue-600 hover:underline", target: "_blank", rel: "noopener noreferrer", children: "Privacy Policy" }),
|
|
2607
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-red-500", children: " *" })
|
|
2608
|
+
] })
|
|
2609
|
+
] }),
|
|
2610
|
+
/* @__PURE__ */ jsxRuntime.jsx(formik.ErrorMessage, { name: "acceptTerms", component: "p", className: baseErrorClass })
|
|
2611
|
+
] }),
|
|
2612
|
+
submitStatus === "error" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-red-800 text-sm", children: submitMessage }) }),
|
|
2613
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2614
|
+
"button",
|
|
2615
|
+
{
|
|
2616
|
+
type: "submit",
|
|
2617
|
+
disabled: isSubmitting,
|
|
2618
|
+
className: `${baseButtonClass} ${buttonClass}`,
|
|
2619
|
+
children: isSubmitting ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center justify-center gap-2", children: [
|
|
2620
|
+
/* @__PURE__ */ jsxRuntime.jsxs("svg", { className: "animate-spin w-5 h-5", fill: "none", viewBox: "0 0 24 24", children: [
|
|
2621
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
2622
|
+
/* @__PURE__ */ jsxRuntime.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" })
|
|
2623
|
+
] }),
|
|
2624
|
+
"Creating account..."
|
|
2625
|
+
] }) : submitText
|
|
2626
|
+
}
|
|
2627
|
+
),
|
|
2628
|
+
loginLink && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-center text-sm text-gray-600", children: [
|
|
2629
|
+
"Already have an account?",
|
|
2630
|
+
" ",
|
|
2631
|
+
/* @__PURE__ */ jsxRuntime.jsx("a", { href: loginLink, className: "text-blue-600 hover:text-blue-700 font-medium", children: "Sign in" })
|
|
2632
|
+
] })
|
|
2633
|
+
] })
|
|
2634
|
+
}
|
|
2635
|
+
) });
|
|
2636
|
+
}
|
|
2637
|
+
|
|
2638
|
+
exports.ContactForm = ContactForm;
|
|
2639
|
+
exports.LoginForm = LoginForm;
|
|
2640
|
+
exports.NewsletterForm = NewsletterForm;
|
|
2641
|
+
exports.RegisterForm = RegisterForm;
|
|
2642
|
+
exports.ThemeContext = ThemeContext;
|
|
2643
|
+
exports.ThemeProvider = ThemeProvider;
|
|
2644
|
+
exports.ThemeToggle = ThemeToggle;
|
|
2645
|
+
exports.VALIDATION_MESSAGES = VALIDATION_MESSAGES;
|
|
2646
|
+
exports.adjustColor = adjustColor;
|
|
2647
|
+
exports.contactFormSchema = contactFormSchema;
|
|
2648
|
+
exports.createRegisterFormSchema = createRegisterFormSchema;
|
|
2649
|
+
exports.createTheme = createTheme;
|
|
2650
|
+
exports.createThemeFromBrand = createThemeFromBrand;
|
|
2651
|
+
exports.cssVar = cssVar;
|
|
2652
|
+
exports.deepMerge = deepMerge;
|
|
2653
|
+
exports.defaultDarkTheme = defaultDarkTheme;
|
|
2654
|
+
exports.defaultLightTheme = defaultLightTheme;
|
|
2655
|
+
exports.dummyBannerData = dummyBannerData;
|
|
2656
|
+
exports.dummyFaqItems = dummyFaqItems;
|
|
2657
|
+
exports.dummyFeatures = dummyFeatures;
|
|
2658
|
+
exports.dummyFooterData = dummyFooterData;
|
|
2659
|
+
exports.dummyHeaderData = dummyHeaderData;
|
|
2660
|
+
exports.dummyImage = dummyImage;
|
|
2661
|
+
exports.dummyPricingPlans = dummyPricingPlans;
|
|
2662
|
+
exports.dummyTestimonials = dummyTestimonials;
|
|
2663
|
+
exports.flattenToCssVars = flattenToCssVars;
|
|
2664
|
+
exports.generateCssVars = generateCssVars;
|
|
2665
|
+
exports.getContrastColor = getContrastColor;
|
|
2666
|
+
exports.getSystemColorScheme = getSystemColorScheme;
|
|
2667
|
+
exports.hexToRgba = hexToRgba;
|
|
2668
|
+
exports.injectCssVars = injectCssVars;
|
|
2669
|
+
exports.loadThemeFromUrl = loadThemeFromUrl;
|
|
2670
|
+
exports.loadThemeMode = loadThemeMode;
|
|
2671
|
+
exports.loginFormSchema = loginFormSchema;
|
|
2672
|
+
exports.loremIpsum = loremIpsum;
|
|
2673
|
+
exports.newsletterFormSchema = newsletterFormSchema;
|
|
2674
|
+
exports.registerFormSchema = registerFormSchema;
|
|
2675
|
+
exports.removeCssVars = removeCssVars;
|
|
2676
|
+
exports.resolveThemeMode = resolveThemeMode;
|
|
2677
|
+
exports.saveThemeMode = saveThemeMode;
|
|
2678
|
+
exports.useTheme = useTheme;
|
|
2679
|
+
exports.useThemeValue = useThemeValue;
|
|
2680
|
+
//# sourceMappingURL=index.js.map
|
|
2681
|
+
//# sourceMappingURL=index.js.map
|