medos-sdk 1.1.7 → 1.1.9

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 (27) hide show
  1. package/dist/components/SuccessStep.js +1 -1
  2. package/dist/vanilla/AppointmentCalendarWidget.d.ts +8 -0
  3. package/dist/vanilla/AppointmentCalendarWidget.js +463 -158
  4. package/dist/vanilla/EnquiryFormWidget.d.ts +2 -0
  5. package/dist/vanilla/EnquiryFormWidget.js +155 -100
  6. package/dist/vanilla/components/VanillaCalendar.d.ts +32 -0
  7. package/dist/vanilla/components/VanillaCalendar.js +366 -0
  8. package/dist/vanilla/components/VanillaIcons.d.ts +17 -0
  9. package/dist/vanilla/components/VanillaIcons.js +268 -0
  10. package/dist/vanilla/components/VanillaSelect.d.ts +46 -0
  11. package/dist/vanilla/components/VanillaSelect.js +523 -0
  12. package/dist/vanilla/components/index.d.ts +3 -0
  13. package/dist/vanilla/components/index.js +3 -0
  14. package/dist/vanilla/components/theme-injector.d.ts +1 -0
  15. package/dist/vanilla/components/theme-injector.js +447 -0
  16. package/dist/vanilla/enquiry-widget.js +1366 -100
  17. package/dist/vanilla/vanilla/AppointmentCalendarWidget.d.ts +8 -0
  18. package/dist/vanilla/vanilla/EnquiryFormWidget.d.ts +2 -0
  19. package/dist/vanilla/vanilla/components/VanillaCalendar.d.ts +32 -0
  20. package/dist/vanilla/vanilla/components/VanillaIcons.d.ts +17 -0
  21. package/dist/vanilla/vanilla/components/VanillaSelect.d.ts +46 -0
  22. package/dist/vanilla/vanilla/components/index.d.ts +3 -0
  23. package/dist/vanilla/vanilla/components/theme-injector.d.ts +1 -0
  24. package/dist/vanilla/vanilla/widget.d.ts +2 -0
  25. package/dist/vanilla/widget.d.ts +2 -0
  26. package/dist/vanilla/widget.js +2213 -257
  27. package/package.json +1 -1
@@ -0,0 +1,447 @@
1
+ export function injectThemedStyles() {
2
+ if (typeof document === "undefined")
3
+ return;
4
+ const styleId = "medos-themed-styles";
5
+ if (document.getElementById(styleId))
6
+ return;
7
+ const styleElement = document.createElement("style");
8
+ styleElement.id = styleId;
9
+ styleElement.innerHTML = `
10
+ /* Default Theme Variables */
11
+ :root {
12
+ /* Colors */
13
+ --medos-color-primary: #27903f;
14
+ --medos-color-primary-dark: #1e7032;
15
+ --medos-color-background: #ffffff;
16
+ --medos-color-background-secondary: #f9fafb;
17
+ --medos-color-surface: #ffffff;
18
+ --medos-color-surface-hover: #f9fafb;
19
+ --medos-color-text: #111827;
20
+ --medos-color-text-secondary: #374151;
21
+ --medos-color-text-muted: #9ca3af;
22
+ --medos-color-text-on-primary: #ffffff;
23
+ --medos-color-border: #e5e7eb;
24
+ --medos-color-border-hover: #d1d5db;
25
+ --medos-color-border-focus: #27903f;
26
+ --medos-color-error: #ef4444;
27
+ --medos-color-error-background: #fee2e2;
28
+ --medos-color-error-border: #fca5a5;
29
+ --medos-color-success: #10b981;
30
+ --medos-color-success-background: #ecfdf5;
31
+
32
+ /* Typography */
33
+ --medos-typography-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
34
+ --medos-typography-font-size-xs: 12px;
35
+ --medos-typography-font-size-sm: 14px;
36
+ --medos-typography-font-size-md: 16px;
37
+ --medos-typography-font-size-lg: 18px;
38
+ --medos-typography-font-size-xl: 20px;
39
+ --medos-typography-font-weight-normal: 400;
40
+ --medos-typography-font-weight-medium: 500;
41
+ --medos-typography-font-weight-semibold: 600;
42
+
43
+ /* Spacing */
44
+ --medos-spacing-xs: 4px;
45
+ --medos-spacing-sm: 8px;
46
+ --medos-spacing-md: 12px;
47
+ --medos-spacing-lg: 16px;
48
+ --medos-spacing-xl: 20px;
49
+ --medos-spacing-2xl: 24px;
50
+
51
+ /* Radius */
52
+ --medos-radius-sm: 4px;
53
+ --medos-radius-md: 8px;
54
+ --medos-radius-lg: 12px;
55
+ --medos-radius-full: 999px;
56
+
57
+ /* Shadows */
58
+ --medos-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
59
+ --medos-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
60
+ --medos-shadow-lg: 0 8px 24px rgba(16, 24, 40, 0.08);
61
+
62
+ /* Transitions */
63
+ --medos-transition-normal: 200ms ease-in-out;
64
+ }
65
+
66
+ /* Container & Card */
67
+ .medos-appointment-container {
68
+ display: flex;
69
+ justify-content: center;
70
+ padding: var(--medos-spacing-xl, 20px);
71
+ font-family: var(--medos-typography-font-family);
72
+ background: var(--medos-color-background, #f6f8fa);
73
+ }
74
+
75
+ .medos-appointment-card {
76
+ width: 100%;
77
+ max-width: 720px;
78
+ background: var(--medos-color-surface, #fff);
79
+ border-radius: var(--medos-radius-lg, 12px);
80
+ box-shadow: var(--medos-shadow-lg);
81
+ padding: var(--medos-spacing-2xl, 24px);
82
+ box-sizing: border-box;
83
+ }
84
+
85
+ /* Section Cards */
86
+ .medos-section-card {
87
+ background: var(--medos-color-surface, #fff);
88
+ border: 1px solid var(--medos-color-border, #e5e7eb);
89
+ border-radius: var(--medos-radius-lg, 12px);
90
+ margin-bottom: var(--medos-spacing-lg, 16px);
91
+ overflow: visible;
92
+ }
93
+
94
+ .medos-section-header {
95
+ display: flex;
96
+ align-items: center;
97
+ gap: var(--medos-spacing-sm, 8px);
98
+ padding: var(--medos-spacing-md, 12px) var(--medos-spacing-lg, 16px);
99
+ background: var(--medos-color-background-secondary, #f9fafb);
100
+ border-bottom: 1px solid var(--medos-color-border, #e5e7eb);
101
+ border-radius: var(--medos-radius-lg, 12px) var(--medos-radius-lg, 12px) 0 0;
102
+ }
103
+
104
+ .medos-section-header svg {
105
+ color: var(--medos-color-primary, #27903f);
106
+ flex-shrink: 0;
107
+ }
108
+
109
+ .medos-section-title {
110
+ font-size: var(--medos-typography-font-size-sm, 14px);
111
+ font-weight: var(--medos-typography-font-weight-semibold, 600);
112
+ color: var(--medos-color-text, #111827);
113
+ margin: 0;
114
+ }
115
+
116
+ .medos-section-body {
117
+ padding: var(--medos-spacing-lg, 16px);
118
+ }
119
+
120
+ .medos-section-description {
121
+ margin: 0 0 var(--medos-spacing-md, 12px) 0;
122
+ font-size: var(--medos-typography-font-size-sm, 14px);
123
+ color: var(--medos-color-text-secondary, #6b7280);
124
+ }
125
+
126
+ /* Form Groups */
127
+ .medos-form-group {
128
+ margin-bottom: var(--medos-spacing-md, 12px);
129
+ }
130
+
131
+ .medos-form-row {
132
+ display: flex;
133
+ gap: var(--medos-spacing-md, 12px);
134
+ }
135
+
136
+ .medos-form-row .medos-form-group {
137
+ flex: 1;
138
+ }
139
+
140
+ .medos-label {
141
+ display: block;
142
+ font-size: var(--medos-typography-font-size-xs, 13px);
143
+ font-weight: var(--medos-typography-font-weight-medium, 500);
144
+ color: var(--medos-color-text-secondary, #374151);
145
+ margin-bottom: var(--medos-spacing-xs, 6px);
146
+ }
147
+
148
+ .medos-required {
149
+ color: var(--medos-color-error, #ef4444);
150
+ }
151
+
152
+ /* Inputs */
153
+ .medos-input,
154
+ .medos-textarea {
155
+ width: 100%;
156
+ padding: var(--medos-spacing-sm, 10px) var(--medos-spacing-md, 12px);
157
+ border-radius: var(--medos-radius-md, 8px);
158
+ border: 1px solid var(--medos-color-border, #e5e7eb);
159
+ outline: none;
160
+ font-size: var(--medos-typography-font-size-sm, 14px);
161
+ box-sizing: border-box;
162
+ font-family: inherit;
163
+ color: var(--medos-color-text, #111827);
164
+ background: var(--medos-color-surface, #fff);
165
+ transition: var(--medos-transition-normal);
166
+ }
167
+
168
+ .medos-input:focus,
169
+ .medos-textarea:focus {
170
+ border-color: var(--medos-color-primary, #27903f);
171
+ box-shadow: 0 0 0 2px rgba(39, 144, 63, 0.15);
172
+ }
173
+
174
+ /* Buttons */
175
+ .medos-btn {
176
+ display: inline-flex;
177
+ align-items: center;
178
+ justify-content: center;
179
+ gap: var(--medos-spacing-xs, 6px);
180
+ padding: var(--medos-spacing-sm, 10px) var(--medos-spacing-lg, 16px);
181
+ border-radius: var(--medos-radius-md, 8px);
182
+ font-size: var(--medos-typography-font-size-sm, 14px);
183
+ font-weight: var(--medos-typography-font-weight-semibold, 600);
184
+ cursor: pointer;
185
+ border: none;
186
+ transition: var(--medos-transition-normal);
187
+ font-family: inherit;
188
+ }
189
+
190
+ .medos-btn-primary {
191
+ background: var(--medos-color-primary, #27903f);
192
+ color: var(--medos-color-text-on-primary, #fff);
193
+ }
194
+
195
+ .medos-btn-primary:hover:not(:disabled) {
196
+ background: var(--medos-color-primary-dark, #1e7032);
197
+ }
198
+
199
+ .medos-btn:disabled {
200
+ opacity: 0.5;
201
+ cursor: not-allowed;
202
+ pointer-events: none;
203
+ }
204
+
205
+ .medos-btn-secondary {
206
+ background: var(--medos-color-surface, #fff);
207
+ color: var(--medos-color-text, #111827);
208
+ border: 1px solid var(--medos-color-border, #e5e7eb);
209
+ }
210
+
211
+ .medos-actions {
212
+ display: flex;
213
+ justify-content: flex-end;
214
+ gap: var(--medos-spacing-md, 12px);
215
+ margin-top: var(--medos-spacing-lg, 16px);
216
+ }
217
+
218
+ /* Radio Options */
219
+ .medos-radio-option {
220
+ display: flex;
221
+ align-items: center;
222
+ gap: var(--medos-spacing-sm, 8px);
223
+ padding: var(--medos-spacing-sm, 10px) var(--medos-spacing-md, 12px);
224
+ border: 1px solid var(--medos-color-border, #e5e7eb);
225
+ border-radius: var(--medos-radius-md, 8px);
226
+ cursor: pointer;
227
+ transition: var(--medos-transition-normal);
228
+ margin-bottom: var(--medos-spacing-xs, 4px);
229
+ }
230
+
231
+ .medos-radio-option:hover {
232
+ border-color: var(--medos-color-primary, #27903f);
233
+ background: var(--medos-color-surface-hover, #f9fafb);
234
+ }
235
+
236
+ .medos-radio-option.selected {
237
+ border-color: var(--medos-color-primary, #27903f);
238
+ background: rgba(39, 144, 63, 0.05);
239
+ }
240
+
241
+ /* Time Slots */
242
+ .medos-slots-grid {
243
+ display: grid;
244
+ grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
245
+ gap: var(--medos-spacing-sm, 8px);
246
+ }
247
+
248
+ .medos-slot-card {
249
+ display: flex;
250
+ align-items: center;
251
+ justify-content: center;
252
+ gap: var(--medos-spacing-xs, 4px);
253
+ padding: var(--medos-spacing-sm, 10px) var(--medos-spacing-md, 12px);
254
+ border: 1px solid var(--medos-color-border, #e5e7eb);
255
+ border-radius: var(--medos-radius-md, 8px);
256
+ cursor: pointer;
257
+ transition: var(--medos-transition-normal);
258
+ position: relative;
259
+ }
260
+
261
+ .medos-slot-card:hover {
262
+ border-color: var(--medos-color-primary, #27903f);
263
+ background: var(--medos-color-surface-hover, #f9fafb);
264
+ }
265
+
266
+ .medos-slot-card.selected {
267
+ border-color: var(--medos-color-primary, #27903f);
268
+ background: rgba(39, 144, 63, 0.1);
269
+ }
270
+
271
+ /* Phone Input */
272
+ .medos-phone-input-row {
273
+ display: flex;
274
+ gap: var(--medos-spacing-sm, 8px);
275
+ align-items: flex-start;
276
+ }
277
+
278
+ .medos-country-code-wrapper {
279
+ width: 140px;
280
+ flex-shrink: 0;
281
+ }
282
+
283
+ .medos-phone-wrapper {
284
+ flex: 1;
285
+ }
286
+
287
+ /* VanillaSelect Styles */
288
+ .vanilla-select-container {
289
+ position: relative;
290
+ width: 100%;
291
+ z-index: 1;
292
+ }
293
+
294
+ .vanilla-select-container.open {
295
+ z-index: 10000;
296
+ }
297
+
298
+ .vanilla-select-display {
299
+ width: 100%;
300
+ padding: var(--medos-spacing-sm, 10px) var(--medos-spacing-md, 12px);
301
+ border-radius: var(--medos-radius-md, 8px);
302
+ border: 1px solid var(--medos-color-border, #e5e7eb);
303
+ background: var(--medos-color-surface, #fff);
304
+ cursor: pointer;
305
+ display: flex;
306
+ justify-content: space-between;
307
+ align-items: center;
308
+ font-size: var(--medos-typography-font-size-sm, 14px);
309
+ color: var(--medos-color-text, #111827);
310
+ box-sizing: border-box;
311
+ transition: var(--medos-transition-normal);
312
+ }
313
+
314
+ .vanilla-select-display:hover {
315
+ border-color: var(--medos-color-border-hover, #d1d5db);
316
+ }
317
+
318
+ .vanilla-select-display.open {
319
+ border-color: var(--medos-color-primary, #27903f);
320
+ box-shadow: 0 0 0 2px rgba(39, 144, 63, 0.15);
321
+ }
322
+
323
+ .vanilla-select-dropdown {
324
+ position: absolute;
325
+ top: 100%;
326
+ left: 0;
327
+ right: 0;
328
+ background: var(--medos-color-surface, #fff);
329
+ border: 1px solid var(--medos-color-border, #e5e7eb);
330
+ border-radius: var(--medos-radius-md, 8px);
331
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
332
+ z-index: 9999;
333
+ max-height: 200px;
334
+ overflow-y: auto;
335
+ margin-top: 4px;
336
+ }
337
+
338
+ .vanilla-select-option {
339
+ padding: var(--medos-spacing-sm, 10px) var(--medos-spacing-md, 12px);
340
+ cursor: pointer;
341
+ font-size: var(--medos-typography-font-size-sm, 14px);
342
+ color: var(--medos-color-text, #111827);
343
+ display: flex;
344
+ justify-content: space-between;
345
+ align-items: center;
346
+ transition: var(--medos-transition-normal);
347
+ }
348
+
349
+ .vanilla-select-option:hover {
350
+ background: var(--medos-color-surface-hover, #f9fafb);
351
+ }
352
+
353
+ .vanilla-select-option.selected {
354
+ background: rgba(39, 144, 63, 0.1);
355
+ color: var(--medos-color-primary, #27903f);
356
+ }
357
+
358
+ /* VanillaCalendar Styles */
359
+ .vanilla-calendar-container {
360
+ width: 100%;
361
+ background: var(--medos-color-surface, #fff);
362
+ border: 1px solid var(--medos-color-border, #e5e7eb);
363
+ border-radius: var(--medos-radius-md, 8px);
364
+ padding: var(--medos-spacing-lg, 16px);
365
+ }
366
+
367
+ .vanilla-calendar-header {
368
+ display: flex;
369
+ justify-content: space-between;
370
+ align-items: center;
371
+ margin-bottom: var(--medos-spacing-lg, 16px);
372
+ }
373
+
374
+ .vanilla-calendar-nav-btn {
375
+ background: none;
376
+ border: none;
377
+ padding: var(--medos-spacing-xs, 4px);
378
+ cursor: pointer;
379
+ border-radius: var(--medos-radius-sm, 4px);
380
+ display: flex;
381
+ align-items: center;
382
+ justify-content: center;
383
+ transition: var(--medos-transition-normal);
384
+ }
385
+
386
+ .vanilla-calendar-nav-btn:hover {
387
+ background: var(--medos-color-surface-hover, #f9fafb);
388
+ }
389
+
390
+ .vanilla-calendar-month-year {
391
+ font-size: var(--medos-typography-font-size-md, 16px);
392
+ font-weight: var(--medos-typography-font-weight-semibold, 600);
393
+ color: var(--medos-color-text, #111827);
394
+ }
395
+
396
+ .vanilla-calendar-grid {
397
+ display: grid;
398
+ grid-template-columns: repeat(7, 1fr);
399
+ gap: 2px;
400
+ }
401
+
402
+ .vanilla-calendar-day-header {
403
+ text-align: center;
404
+ font-size: var(--medos-typography-font-size-xs, 12px);
405
+ font-weight: var(--medos-typography-font-weight-medium, 500);
406
+ color: var(--medos-color-text-secondary, #6b7280);
407
+ padding: var(--medos-spacing-sm, 8px);
408
+ }
409
+
410
+ .vanilla-calendar-day {
411
+ text-align: center;
412
+ padding: var(--medos-spacing-sm, 8px);
413
+ cursor: pointer;
414
+ border-radius: var(--medos-radius-sm, 4px);
415
+ font-size: var(--medos-typography-font-size-sm, 14px);
416
+ transition: var(--medos-transition-normal);
417
+ min-height: 32px;
418
+ display: flex;
419
+ align-items: center;
420
+ justify-content: center;
421
+ }
422
+
423
+ .vanilla-calendar-day:hover:not(.disabled):not(.other-month) {
424
+ background: var(--medos-color-surface-hover, #f9fafb);
425
+ }
426
+
427
+ .vanilla-calendar-day.selected {
428
+ background: var(--medos-color-primary, #27903f);
429
+ color: var(--medos-color-text-on-primary, #fff);
430
+ }
431
+
432
+ .vanilla-calendar-day.disabled {
433
+ color: var(--medos-color-text-muted, #9ca3af);
434
+ cursor: not-allowed;
435
+ }
436
+
437
+ .vanilla-calendar-day.other-month {
438
+ color: var(--medos-color-text-muted, #9ca3af);
439
+ }
440
+
441
+ .vanilla-calendar-day.today {
442
+ background: rgba(39, 144, 63, 0.1);
443
+ font-weight: var(--medos-typography-font-weight-semibold, 600);
444
+ }
445
+ `;
446
+ document.head.appendChild(styleElement);
447
+ }