medos-sdk 1.0.3 → 1.1.1

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.
Files changed (95) hide show
  1. package/README.md +80 -8
  2. package/dist/client/MedosClient.d.ts +2 -4
  3. package/dist/client/MedosClient.js +4 -4
  4. package/dist/components/AppointmentCalender.js +43 -2
  5. package/dist/components/AppointmentDateTimeModal.js +45 -31
  6. package/dist/components/ContactInformationStep.d.ts +13 -0
  7. package/dist/components/ContactInformationStep.js +14 -0
  8. package/dist/components/ContactPreferenceStep.d.ts +9 -0
  9. package/dist/components/ContactPreferenceStep.js +16 -0
  10. package/dist/components/DoctorSelectModal.js +30 -17
  11. package/dist/components/EnquiryForm.d.ts +7 -0
  12. package/dist/components/EnquiryForm.js +212 -0
  13. package/dist/components/Icons/ConsultationType.js +1 -1
  14. package/dist/components/Icons/Date&TimeIcon.js +1 -1
  15. package/dist/components/Icons/MapIcon.js +1 -1
  16. package/dist/components/Icons/PaymentMethodIcon.js +1 -1
  17. package/dist/components/Icons/UserIcon.js +1 -1
  18. package/dist/components/InquiryDetailsStep.d.ts +10 -0
  19. package/dist/components/InquiryDetailsStep.js +15 -0
  20. package/dist/components/PatientDetailsStep.js +9 -1
  21. package/dist/components/PhoneVerificationStep.js +22 -12
  22. package/dist/components/SuccessStep.d.ts +3 -1
  23. package/dist/components/SuccessStep.js +7 -15
  24. package/dist/components/custom-calendar.js +42 -24
  25. package/dist/components/theme-styles.d.ts +12 -0
  26. package/dist/components/theme-styles.js +319 -0
  27. package/dist/components/types.d.ts +0 -1
  28. package/dist/core/index.d.ts +4 -0
  29. package/dist/core/index.js +4 -0
  30. package/dist/core/theme/index.d.ts +3 -0
  31. package/dist/core/theme/index.js +3 -0
  32. package/dist/core/theme/themes.d.ts +8 -0
  33. package/dist/core/theme/themes.js +178 -0
  34. package/dist/core/theme/types.d.ts +106 -0
  35. package/dist/core/theme/types.js +1 -0
  36. package/dist/core/theme/utils.d.ts +8 -0
  37. package/dist/core/theme/utils.js +135 -0
  38. package/dist/enquiry-form/index.d.ts +4 -0
  39. package/dist/enquiry-form/index.js +4 -0
  40. package/dist/enquiry-form/provider.d.ts +3 -0
  41. package/dist/enquiry-form/provider.js +9 -0
  42. package/dist/enquiry-form/serialization.d.ts +4 -0
  43. package/dist/enquiry-form/serialization.js +57 -0
  44. package/dist/enquiry-form/types.d.ts +38 -0
  45. package/dist/enquiry-form/types.js +1 -0
  46. package/dist/enquiry-form/validation.d.ts +6 -0
  47. package/dist/enquiry-form/validation.js +21 -0
  48. package/dist/index.d.ts +9 -0
  49. package/dist/index.js +7 -0
  50. package/dist/react/ThemeProvider.d.ts +18 -0
  51. package/dist/react/ThemeProvider.js +45 -0
  52. package/dist/react/hooks/useTheme.d.ts +1 -0
  53. package/dist/react/hooks/useTheme.js +1 -0
  54. package/dist/react/index.d.ts +5 -0
  55. package/dist/react/index.js +3 -0
  56. package/dist/services/EnquiryService.d.ts +5 -0
  57. package/dist/services/EnquiryService.js +30 -0
  58. package/dist/vanilla/AppointmentCalendarWidget.js +0 -2
  59. package/dist/vanilla/EnquiryFormWidget.d.ts +35 -0
  60. package/dist/vanilla/EnquiryFormWidget.js +425 -0
  61. package/dist/vanilla/client/MedosClient.d.ts +2 -4
  62. package/dist/vanilla/components/ContactInformationStep.d.ts +13 -0
  63. package/dist/vanilla/components/ContactPreferenceStep.d.ts +9 -0
  64. package/dist/vanilla/components/EnquiryForm.d.ts +7 -0
  65. package/dist/vanilla/components/InquiryDetailsStep.d.ts +10 -0
  66. package/dist/vanilla/components/SuccessStep.d.ts +3 -1
  67. package/dist/vanilla/components/theme-styles.d.ts +12 -0
  68. package/dist/vanilla/components/types.d.ts +0 -1
  69. package/dist/vanilla/core/index.d.ts +4 -0
  70. package/dist/vanilla/core/theme/index.d.ts +3 -0
  71. package/dist/vanilla/core/theme/themes.d.ts +8 -0
  72. package/dist/vanilla/core/theme/types.d.ts +106 -0
  73. package/dist/vanilla/core/theme/utils.d.ts +8 -0
  74. package/dist/vanilla/enquiry-form/index.d.ts +4 -0
  75. package/dist/vanilla/enquiry-form/provider.d.ts +3 -0
  76. package/dist/vanilla/enquiry-form/serialization.d.ts +4 -0
  77. package/dist/vanilla/enquiry-form/types.d.ts +38 -0
  78. package/dist/vanilla/enquiry-form/validation.d.ts +6 -0
  79. package/dist/vanilla/enquiry-widget.js +4650 -0
  80. package/dist/vanilla/index.d.ts +9 -0
  81. package/dist/vanilla/index.js +3 -1
  82. package/dist/vanilla/react/ThemeProvider.d.ts +18 -0
  83. package/dist/vanilla/react/hooks/useTheme.d.ts +1 -0
  84. package/dist/vanilla/react/index.d.ts +5 -0
  85. package/dist/vanilla/services/EnquiryService.d.ts +5 -0
  86. package/dist/vanilla/theme-injector.d.ts +6 -0
  87. package/dist/vanilla/theme-injector.js +44 -0
  88. package/dist/vanilla/vanilla/EnquiryFormWidget.d.ts +35 -0
  89. package/dist/vanilla/vanilla/index.d.ts +3 -1
  90. package/dist/vanilla/vanilla/theme-injector.d.ts +6 -0
  91. package/dist/vanilla/vanilla/widget.d.ts +6 -1
  92. package/dist/vanilla/widget.css +173 -0
  93. package/dist/vanilla/widget.d.ts +6 -1
  94. package/dist/vanilla/widget.js +489 -12
  95. package/package.json +13 -2
@@ -0,0 +1,319 @@
1
+ export function getContainerStyles(theme, prefix = "medos") {
2
+ return {
3
+ container: {
4
+ display: "flex",
5
+ justifyContent: "center",
6
+ padding: theme.spacing.xl,
7
+ fontFamily: theme.typography.fontFamily,
8
+ background: theme.colors.background,
9
+ },
10
+ card: {
11
+ width: "100%",
12
+ maxWidth: 720,
13
+ background: theme.colors.surface,
14
+ borderRadius: theme.radii.lg,
15
+ boxShadow: theme.shadows.lg,
16
+ padding: theme.spacing["2xl"],
17
+ boxSizing: "border-box",
18
+ },
19
+ header: {
20
+ display: "flex",
21
+ alignItems: "center",
22
+ justifyContent: "space-between",
23
+ marginBottom: theme.spacing.lg,
24
+ },
25
+ title: {
26
+ marginLeft: 10,
27
+ fontSize: theme.typography.fontSizeXl,
28
+ fontWeight: theme.typography.fontWeightSemibold,
29
+ color: theme.colors.text,
30
+ },
31
+ section: {
32
+ marginTop: theme.spacing.md,
33
+ },
34
+ errorMessage: {
35
+ marginBottom: theme.spacing.md,
36
+ color: theme.colors.error,
37
+ fontWeight: theme.typography.fontWeightSemibold,
38
+ },
39
+ actions: {
40
+ display: "flex",
41
+ gap: theme.spacing.sm,
42
+ marginTop: theme.spacing.lg,
43
+ justifyContent: "flex-end",
44
+ },
45
+ };
46
+ }
47
+ export function getButtonStyles(theme, prefix = "medos") {
48
+ return {
49
+ primary: {
50
+ background: theme.colors.secondary,
51
+ color: theme.colors.textOnSecondary,
52
+ border: "none",
53
+ padding: `${theme.spacing.sm} ${theme.spacing.md}`,
54
+ borderRadius: theme.radii.md,
55
+ cursor: "pointer",
56
+ fontWeight: theme.typography.fontWeightSemibold,
57
+ fontSize: theme.typography.fontSizeSm,
58
+ transition: theme.transitions.normal,
59
+ },
60
+ primaryHover: {
61
+ background: theme.colors.secondaryHover,
62
+ },
63
+ secondary: {
64
+ background: theme.colors.surface,
65
+ color: theme.colors.primary,
66
+ border: `1px solid ${theme.colors.primary}`,
67
+ padding: `${theme.spacing.sm} ${theme.spacing.md}`,
68
+ borderRadius: theme.radii.md,
69
+ cursor: "pointer",
70
+ fontSize: theme.typography.fontSizeSm,
71
+ transition: theme.transitions.normal,
72
+ },
73
+ secondaryHover: {
74
+ background: theme.colors.surfaceHover,
75
+ },
76
+ };
77
+ }
78
+ export function getPhoneVerifyStyles(theme, prefix = "medos") {
79
+ return {
80
+ container: {
81
+ border: `1px solid ${theme.colors.border}`,
82
+ borderRadius: theme.radii.lg,
83
+ overflow: "hidden",
84
+ backgroundColor: theme.colors.surface,
85
+ },
86
+ header: {
87
+ padding: "20px 24px 10px 24px",
88
+ },
89
+ title: { fontSize: 20, fontWeight: 600, margin: 0 },
90
+ content: {
91
+ padding: theme.spacing["2xl"],
92
+ },
93
+ label: {
94
+ display: "block",
95
+ fontSize: theme.typography.fontSizeSm,
96
+ fontWeight: theme.typography.fontWeightMedium,
97
+ color: theme.colors.text,
98
+ marginBottom: theme.spacing.sm,
99
+ },
100
+ phoneInputContainer: {
101
+ display: "flex",
102
+ gap: theme.spacing.sm,
103
+ },
104
+ phoneInput: {
105
+ flex: 1,
106
+ width: "100%",
107
+ padding: `${theme.spacing.sm} ${theme.spacing.md}`,
108
+ borderRadius: theme.radii.md,
109
+ border: `1px solid ${theme.colors.border}`,
110
+ fontSize: theme.typography.fontSizeSm,
111
+ outline: "none",
112
+ color: theme.colors.text,
113
+ boxSizing: "border-box",
114
+ transition: theme.transitions.normal,
115
+ },
116
+ phoneInputFocus: {
117
+ borderColor: theme.colors.borderFocus,
118
+ outline: `2px solid ${theme.colors.borderFocus}20`,
119
+ },
120
+ phoneDisplay: {
121
+ padding: `${theme.spacing.sm} ${theme.spacing.md}`,
122
+ background: theme.colors.backgroundSecondary,
123
+ borderRadius: theme.radii.md,
124
+ fontSize: theme.typography.fontSizeSm,
125
+ color: theme.colors.textSecondary,
126
+ fontWeight: theme.typography.fontWeightMedium,
127
+ },
128
+ otpInput: {
129
+ width: "100%",
130
+ padding: `${theme.spacing.sm} ${theme.spacing.md}`,
131
+ border: `1px solid ${theme.colors.borderHover}`,
132
+ borderRadius: theme.radii.md,
133
+ fontSize: theme.typography.fontSizeSm,
134
+ outline: "none",
135
+ color: theme.colors.text,
136
+ boxSizing: "border-box",
137
+ transition: theme.transitions.normal,
138
+ },
139
+ otpInputFocus: {
140
+ borderColor: theme.colors.borderFocus,
141
+ outline: `2px solid ${theme.colors.borderFocus}20`,
142
+ },
143
+ otpHint: {
144
+ marginTop: theme.spacing.sm,
145
+ fontSize: theme.typography.fontSizeXs,
146
+ color: theme.colors.textTertiary,
147
+ },
148
+ successMessage: {
149
+ marginTop: theme.spacing.xl,
150
+ padding: theme.spacing.lg,
151
+ borderRadius: theme.radii.md,
152
+ backgroundColor: theme.colors.successBackground,
153
+ border: `1px solid ${theme.colors.success}`,
154
+ display: "flex",
155
+ alignItems: "center",
156
+ gap: theme.spacing.md,
157
+ },
158
+ successIcon: {
159
+ fontSize: theme.typography.fontSize2xl,
160
+ color: theme.colors.success,
161
+ },
162
+ successTitle: {
163
+ fontSize: theme.typography.fontSizeSm,
164
+ fontWeight: theme.typography.fontWeightSemibold,
165
+ color: theme.colors.success,
166
+ },
167
+ successSubtitle: {
168
+ fontSize: theme.typography.fontSizeXs,
169
+ color: theme.colors.textTertiary,
170
+ marginTop: 2,
171
+ },
172
+ footer: {
173
+ padding: `${theme.spacing.lg} ${theme.spacing["2xl"]}`,
174
+ borderTop: `1px solid ${theme.colors.border}`,
175
+ backgroundColor: theme.colors.surface,
176
+ display: "flex",
177
+ gap: theme.spacing.md,
178
+ justifyContent: "flex-end",
179
+ },
180
+ };
181
+ }
182
+ export function getPatientDetailsStyles(theme, prefix = "medos") {
183
+ return {
184
+ sectionCard: {
185
+ border: `1px solid ${theme.colors.border}`,
186
+ borderRadius: theme.radii.lg,
187
+ marginBottom: theme.spacing["2xl"],
188
+ },
189
+ sectionHeader: {
190
+ backgroundColor: theme.colors.primary,
191
+ padding: `${theme.spacing.lg} ${theme.spacing.xl}`,
192
+ display: "flex",
193
+ alignItems: "center",
194
+ gap: theme.spacing.md,
195
+ borderBottom: `1px solid ${theme.colors.border}`,
196
+ color: theme.colors.textOnPrimary,
197
+ },
198
+ sectionTitle: {
199
+ fontSize: theme.typography.fontSizeLg,
200
+ fontWeight: theme.typography.fontWeightSemibold,
201
+ margin: 0,
202
+ color: theme.colors.textOnPrimary,
203
+ },
204
+ sectionBody: {
205
+ padding: theme.spacing["2xl"],
206
+ },
207
+ gridRow: {
208
+ display: "grid",
209
+ gridTemplateColumns: "1fr 1fr",
210
+ gap: theme.spacing.xl,
211
+ marginTop: theme.spacing.xl,
212
+ },
213
+ label: {
214
+ display: "block",
215
+ fontSize: theme.typography.fontSizeXs,
216
+ marginBottom: theme.spacing.xs,
217
+ color: theme.colors.textSecondary,
218
+ fontWeight: theme.typography.fontWeightMedium,
219
+ },
220
+ input: {
221
+ width: "100%",
222
+ padding: `${theme.spacing.sm} ${theme.spacing.md}`,
223
+ borderRadius: theme.radii.md,
224
+ border: `1px solid ${theme.colors.border}`,
225
+ outline: "none",
226
+ fontSize: theme.typography.fontSizeSm,
227
+ boxSizing: "border-box",
228
+ color: theme.colors.text,
229
+ transition: theme.transitions.normal,
230
+ },
231
+ inputFocus: {
232
+ borderColor: theme.colors.borderFocus,
233
+ outline: `2px solid ${theme.colors.borderFocus}20`,
234
+ },
235
+ phoneDisplay: {
236
+ display: "flex",
237
+ gap: theme.spacing.sm,
238
+ },
239
+ phoneCode: {
240
+ width: "100px",
241
+ padding: `${theme.spacing.sm} ${theme.spacing.md}`,
242
+ borderRadius: theme.radii.md,
243
+ border: `1px solid ${theme.colors.border}`,
244
+ backgroundColor: theme.colors.backgroundSecondary,
245
+ fontSize: theme.typography.fontSizeSm,
246
+ boxSizing: "border-box",
247
+ color: theme.colors.textSecondary,
248
+ },
249
+ phoneNumber: {
250
+ flex: 1,
251
+ padding: `${theme.spacing.sm} ${theme.spacing.md}`,
252
+ borderRadius: theme.radii.md,
253
+ border: `1px solid ${theme.colors.border}`,
254
+ backgroundColor: theme.colors.backgroundSecondary,
255
+ fontSize: theme.typography.fontSizeSm,
256
+ boxSizing: "border-box",
257
+ color: theme.colors.textSecondary,
258
+ },
259
+ };
260
+ }
261
+ export function getSuccessStyles(theme, prefix = "medos") {
262
+ return {
263
+ container: {
264
+ display: "flex",
265
+ flexDirection: "column",
266
+ height: "100%",
267
+ },
268
+ header: {
269
+ marginTop: `-${theme.spacing.lg}`,
270
+ alignItems: "center",
271
+ textAlign: "center",
272
+ color: theme.colors.success,
273
+ fontWeight: theme.typography.fontWeightBold,
274
+ fontSize: theme.typography.fontSizeLg,
275
+ marginBottom: theme.spacing.xl,
276
+ },
277
+ iconContainer: {
278
+ display: "flex",
279
+ alignItems: "center",
280
+ justifyContent: "center",
281
+ padding: `${theme.spacing.md} 0`,
282
+ },
283
+ detailsContainer: {
284
+ display: "flex",
285
+ flexDirection: "column",
286
+ alignItems: "center",
287
+ gap: theme.spacing.md,
288
+ textAlign: "center",
289
+ color: theme.colors.success,
290
+ },
291
+ detailsTitle: {
292
+ fontWeight: theme.typography.fontWeightSemibold,
293
+ fontSize: theme.typography.fontSizeMd,
294
+ },
295
+ detailsList: {
296
+ display: "flex",
297
+ flexDirection: "column",
298
+ gap: theme.spacing.xs,
299
+ fontSize: theme.typography.fontSizeSm,
300
+ width: "100%",
301
+ maxWidth: "28rem",
302
+ textAlign: "center",
303
+ },
304
+ confirmationNote: {
305
+ marginTop: theme.spacing.sm,
306
+ fontSize: theme.typography.fontSizeXs,
307
+ color: theme.colors.textTertiary,
308
+ },
309
+ actionContainer: {
310
+ marginTop: theme.spacing["2xl"],
311
+ },
312
+ };
313
+ }
314
+ import { defaultTheme } from "../core/theme/themes";
315
+ export const CONTAINER_STYLES = getContainerStyles(defaultTheme);
316
+ export const BUTTON_STYLES = getButtonStyles(defaultTheme);
317
+ export const PHONE_VERIFY_STYLES = getPhoneVerifyStyles(defaultTheme);
318
+ export const PATIENT_DETAILS_STYLES = getPatientDetailsStyles(defaultTheme);
319
+ export const SUCCESS_STYLES = getSuccessStyles(defaultTheme);
@@ -17,7 +17,6 @@ export type PatientDetailsStepProps = {
17
17
  onSubmit: () => Promise<void>;
18
18
  };
19
19
  export type SuccessStepProps = {
20
- state: AppointmentState;
21
20
  onReset: () => void;
22
21
  };
23
22
  export type PhoneInputSectionProps = {
@@ -1,8 +1,12 @@
1
1
  export { MedosClient } from "../client/MedosClient";
2
+ export * from "./theme";
2
3
  export * from "../appointments/provider";
3
4
  export * from "../appointments/types";
4
5
  export * from "../appointment-calendar/provider";
5
6
  export * from "../appointment-calendar/types";
7
+ export * from "../enquiry-form/provider";
8
+ export * from "../enquiry-form/types";
6
9
  export { PatientService, SendPhoneVerificationOtpPayload, VerifyPhoneVerificationOtpPayload, } from "../services/PatientService";
7
10
  export { AppointmentService, type BookAppointmentPayload, type PatientPayload, type PatientAddressPayload, type AddressesResponse, type AddressItem, } from "../services/AppointmentService";
8
11
  export { AuthService } from "../services/AuthService";
12
+ export { EnquiryService } from "../services/EnquiryService";
@@ -1,8 +1,12 @@
1
1
  export { MedosClient } from "../client/MedosClient";
2
+ export * from "./theme";
2
3
  export * from "../appointments/provider";
3
4
  export * from "../appointments/types";
4
5
  export * from "../appointment-calendar/provider";
5
6
  export * from "../appointment-calendar/types";
7
+ export * from "../enquiry-form/provider";
8
+ export * from "../enquiry-form/types";
6
9
  export { PatientService, } from "../services/PatientService";
7
10
  export { AppointmentService, } from "../services/AppointmentService";
8
11
  export { AuthService } from "../services/AuthService";
12
+ export { EnquiryService } from "../services/EnquiryService";
@@ -0,0 +1,3 @@
1
+ export * from "./types";
2
+ export * from "./themes";
3
+ export * from "./utils";
@@ -0,0 +1,3 @@
1
+ export * from "./types";
2
+ export * from "./themes";
3
+ export * from "./utils";
@@ -0,0 +1,8 @@
1
+ import { MedosTheme } from "./types";
2
+ export declare const defaultTheme: MedosTheme;
3
+ export declare const modernTheme: MedosTheme;
4
+ export declare const themes: {
5
+ readonly default: MedosTheme;
6
+ readonly modern: MedosTheme;
7
+ };
8
+ export type ThemeName = keyof typeof themes;
@@ -0,0 +1,178 @@
1
+ export const defaultTheme = {
2
+ name: "default",
3
+ colors: {
4
+ primary: "#27903F",
5
+ primaryHover: "#218838",
6
+ primaryActive: "#1e7835",
7
+ secondary: "#009b4d",
8
+ secondaryHover: "#008840",
9
+ accent: "#10b981",
10
+ accentHover: "#059669",
11
+ background: "#f6f8fa",
12
+ backgroundSecondary: "#f9fafb",
13
+ backgroundTertiary: "#fff",
14
+ surface: "#fff",
15
+ surfaceHover: "#f9fafb",
16
+ border: "#e5e7eb",
17
+ borderHover: "#d1d5db",
18
+ borderFocus: "#27903F",
19
+ text: "#111827",
20
+ textSecondary: "#374151",
21
+ textTertiary: "#6b7280",
22
+ textDisabled: "#9ca3af",
23
+ textOnPrimary: "#fff",
24
+ textOnSecondary: "#fff",
25
+ success: "#10b981",
26
+ successBackground: "#ecfdf5",
27
+ successBorder: "#6ee7b7",
28
+ error: "#ef4444",
29
+ errorBackground: "#fee2e2",
30
+ errorBorder: "#fca5a5",
31
+ warning: "#f59e0b",
32
+ warningBackground: "#fef3c7",
33
+ warningBorder: "#fcd34d",
34
+ info: "#3b82f6",
35
+ infoBackground: "#dbeafe",
36
+ infoBorder: "#93c5fd",
37
+ },
38
+ typography: {
39
+ fontFamily: "'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif",
40
+ fontFamilyHeading: "'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif",
41
+ fontSizeXs: "12px",
42
+ fontSizeSm: "14px",
43
+ fontSizeMd: "16px",
44
+ fontSizeLg: "18px",
45
+ fontSizeXl: "20px",
46
+ fontSize2xl: "24px",
47
+ fontSize3xl: "30px",
48
+ fontWeightNormal: "400",
49
+ fontWeightMedium: "500",
50
+ fontWeightSemibold: "600",
51
+ fontWeightBold: "700",
52
+ lineHeightTight: "1.25",
53
+ lineHeightNormal: "1.5",
54
+ lineHeightRelaxed: "1.75",
55
+ },
56
+ spacing: {
57
+ xs: "4px",
58
+ sm: "8px",
59
+ md: "12px",
60
+ lg: "16px",
61
+ xl: "20px",
62
+ "2xl": "24px",
63
+ "3xl": "32px",
64
+ "4xl": "40px",
65
+ },
66
+ shadows: {
67
+ none: "none",
68
+ sm: "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
69
+ md: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",
70
+ lg: "0 8px 24px rgba(16, 24, 40, 0.08)",
71
+ xl: "0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)",
72
+ "2xl": "0 25px 50px -12px rgba(0, 0, 0, 0.25)",
73
+ },
74
+ radii: {
75
+ none: "0",
76
+ sm: "4px",
77
+ md: "8px",
78
+ lg: "12px",
79
+ xl: "16px",
80
+ full: "9999px",
81
+ },
82
+ transitions: {
83
+ fast: "150ms cubic-bezier(0.4, 0, 0.2, 1)",
84
+ normal: "200ms cubic-bezier(0.4, 0, 0.2, 1)",
85
+ slow: "300ms cubic-bezier(0.4, 0, 0.2, 1)",
86
+ },
87
+ };
88
+ export const modernTheme = {
89
+ name: "modern",
90
+ colors: {
91
+ primary: "#1e3a5f",
92
+ primaryHover: "#2c4a6f",
93
+ primaryActive: "#152942",
94
+ secondary: "#ff6b35",
95
+ secondaryHover: "#ff5722",
96
+ accent: "#3b82f6",
97
+ accentHover: "#2563eb",
98
+ background: "#ffffff",
99
+ backgroundSecondary: "#f8fafc",
100
+ backgroundTertiary: "#f1f5f9",
101
+ surface: "#ffffff",
102
+ surfaceHover: "#f8fafc",
103
+ border: "#e2e8f0",
104
+ borderHover: "#cbd5e1",
105
+ borderFocus: "#3b82f6",
106
+ text: "#1e293b",
107
+ textSecondary: "#64748b",
108
+ textTertiary: "#94a3b8",
109
+ textDisabled: "#cbd5e1",
110
+ textOnPrimary: "#ffffff",
111
+ textOnSecondary: "#ffffff",
112
+ success: "#10b981",
113
+ successBackground: "#ecfdf5",
114
+ successBorder: "#6ee7b7",
115
+ error: "#ef4444",
116
+ errorBackground: "#fef2f2",
117
+ errorBorder: "#fca5a5",
118
+ warning: "#f59e0b",
119
+ warningBackground: "#fffbeb",
120
+ warningBorder: "#fcd34d",
121
+ info: "#0ea5e9",
122
+ infoBackground: "#e0f2fe",
123
+ infoBorder: "#7dd3fc",
124
+ },
125
+ typography: {
126
+ fontFamily: "'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif",
127
+ fontFamilyHeading: "'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif",
128
+ fontSizeXs: "12px",
129
+ fontSizeSm: "14px",
130
+ fontSizeMd: "16px",
131
+ fontSizeLg: "18px",
132
+ fontSizeXl: "20px",
133
+ fontSize2xl: "24px",
134
+ fontSize3xl: "30px",
135
+ fontWeightNormal: "400",
136
+ fontWeightMedium: "500",
137
+ fontWeightSemibold: "600",
138
+ fontWeightBold: "700",
139
+ lineHeightTight: "1.25",
140
+ lineHeightNormal: "1.5",
141
+ lineHeightRelaxed: "1.75",
142
+ },
143
+ spacing: {
144
+ xs: "4px",
145
+ sm: "8px",
146
+ md: "12px",
147
+ lg: "16px",
148
+ xl: "20px",
149
+ "2xl": "24px",
150
+ "3xl": "32px",
151
+ "4xl": "40px",
152
+ },
153
+ shadows: {
154
+ none: "none",
155
+ sm: "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
156
+ md: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",
157
+ lg: "0 8px 24px rgba(30, 58, 95, 0.12)",
158
+ xl: "0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)",
159
+ "2xl": "0 25px 50px -12px rgba(0, 0, 0, 0.25)",
160
+ },
161
+ radii: {
162
+ none: "0",
163
+ sm: "4px",
164
+ md: "8px",
165
+ lg: "12px",
166
+ xl: "16px",
167
+ full: "9999px",
168
+ },
169
+ transitions: {
170
+ fast: "150ms cubic-bezier(0.4, 0, 0.2, 1)",
171
+ normal: "200ms cubic-bezier(0.4, 0, 0.2, 1)",
172
+ slow: "300ms cubic-bezier(0.4, 0, 0.2, 1)",
173
+ },
174
+ };
175
+ export const themes = {
176
+ default: defaultTheme,
177
+ modern: modernTheme,
178
+ };
@@ -0,0 +1,106 @@
1
+ export interface ThemeColors {
2
+ primary: string;
3
+ primaryHover: string;
4
+ primaryActive: string;
5
+ secondary: string;
6
+ secondaryHover: string;
7
+ accent: string;
8
+ accentHover: string;
9
+ background: string;
10
+ backgroundSecondary: string;
11
+ backgroundTertiary: string;
12
+ surface: string;
13
+ surfaceHover: string;
14
+ border: string;
15
+ borderHover: string;
16
+ borderFocus: string;
17
+ text: string;
18
+ textSecondary: string;
19
+ textTertiary: string;
20
+ textDisabled: string;
21
+ textOnPrimary: string;
22
+ textOnSecondary: string;
23
+ success: string;
24
+ successBackground: string;
25
+ successBorder: string;
26
+ error: string;
27
+ errorBackground: string;
28
+ errorBorder: string;
29
+ warning: string;
30
+ warningBackground: string;
31
+ warningBorder: string;
32
+ info: string;
33
+ infoBackground: string;
34
+ infoBorder: string;
35
+ }
36
+ export interface ThemeTypography {
37
+ fontFamily: string;
38
+ fontFamilyHeading: string;
39
+ fontSizeXs: string;
40
+ fontSizeSm: string;
41
+ fontSizeMd: string;
42
+ fontSizeLg: string;
43
+ fontSizeXl: string;
44
+ fontSize2xl: string;
45
+ fontSize3xl: string;
46
+ fontWeightNormal: string;
47
+ fontWeightMedium: string;
48
+ fontWeightSemibold: string;
49
+ fontWeightBold: string;
50
+ lineHeightTight: string;
51
+ lineHeightNormal: string;
52
+ lineHeightRelaxed: string;
53
+ }
54
+ export interface ThemeSpacing {
55
+ xs: string;
56
+ sm: string;
57
+ md: string;
58
+ lg: string;
59
+ xl: string;
60
+ "2xl": string;
61
+ "3xl": string;
62
+ "4xl": string;
63
+ }
64
+ export interface ThemeShadows {
65
+ sm: string;
66
+ md: string;
67
+ lg: string;
68
+ xl: string;
69
+ "2xl": string;
70
+ none: string;
71
+ }
72
+ export interface ThemeRadii {
73
+ none: string;
74
+ sm: string;
75
+ md: string;
76
+ lg: string;
77
+ xl: string;
78
+ full: string;
79
+ }
80
+ export interface ThemeTransitions {
81
+ fast: string;
82
+ normal: string;
83
+ slow: string;
84
+ }
85
+ export interface MedosTheme {
86
+ name: string;
87
+ colors: ThemeColors;
88
+ typography: ThemeTypography;
89
+ spacing: ThemeSpacing;
90
+ shadows: ThemeShadows;
91
+ radii: ThemeRadii;
92
+ transitions: ThemeTransitions;
93
+ }
94
+ export type PartialTheme = {
95
+ name?: string;
96
+ colors?: Partial<ThemeColors>;
97
+ typography?: Partial<ThemeTypography>;
98
+ spacing?: Partial<ThemeSpacing>;
99
+ shadows?: Partial<ThemeShadows>;
100
+ radii?: Partial<ThemeRadii>;
101
+ transitions?: Partial<ThemeTransitions>;
102
+ };
103
+ export interface ThemeConfig {
104
+ theme?: MedosTheme | PartialTheme;
105
+ cssVariablePrefix?: string;
106
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import { MedosTheme, PartialTheme } from "./types";
2
+ export declare function mergeTheme(partialTheme?: PartialTheme): MedosTheme;
3
+ export declare function generateCssVariables(theme: MedosTheme, prefix?: string): string;
4
+ export declare function generateCssVariablesObject(theme: MedosTheme, prefix?: string): Record<string, string>;
5
+ export declare function getCssVar(prefix: string, category: string, key: string, fallback?: string): string;
6
+ export declare function injectCssVariables(theme: MedosTheme, containerId: string, prefix?: string): void;
7
+ export declare function createThemeStyleTag(theme: MedosTheme, prefix?: string, selector?: string): HTMLStyleElement | null;
8
+ export declare function validateTheme(theme: any): string[];