@getmicdrop/svelte-components 2.0.13 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/__LIB_STORES__.js +30 -2
  2. package/dist/components/AboutShow/AboutShow.svelte +278 -0
  3. package/dist/components/AboutShow/AboutShow.svelte.d.ts +43 -0
  4. package/dist/components/AboutShow/AboutShow.svelte.d.ts.map +1 -0
  5. package/dist/components/Calendar/MiniMonthCalendar.svelte +1446 -0
  6. package/dist/components/Calendar/{Calendar.svelte.d.ts → MiniMonthCalendar.svelte.d.ts} +20 -21
  7. package/dist/components/Calendar/MiniMonthCalendar.svelte.d.ts.map +1 -0
  8. package/dist/components/DarkModeToggle.svelte +3 -1
  9. package/dist/components/DarkModeToggle.svelte.d.ts.map +1 -1
  10. package/dist/components/FAQs/FAQs.svelte +49 -0
  11. package/dist/components/{Calendar/QuarterView.svelte.d.ts → FAQs/FAQs.svelte.d.ts} +10 -10
  12. package/dist/components/FAQs/FAQs.svelte.d.ts.map +1 -0
  13. package/dist/components/Input/Input.svelte +100 -12
  14. package/dist/components/Input/Input.svelte.d.ts +12 -0
  15. package/dist/components/Input/Input.svelte.d.ts.map +1 -1
  16. package/dist/components/Input/OTPInput.svelte +1 -1
  17. package/dist/components/MonthSwitcher/MonthSwitcher.svelte +206 -0
  18. package/dist/components/MonthSwitcher/MonthSwitcher.svelte.d.ts +37 -0
  19. package/dist/components/MonthSwitcher/MonthSwitcher.svelte.d.ts.map +1 -0
  20. package/dist/components/OrderSummary/OrderSummary.svelte +553 -0
  21. package/dist/components/OrderSummary/OrderSummary.svelte.d.ts +65 -0
  22. package/dist/components/OrderSummary/OrderSummary.svelte.d.ts.map +1 -0
  23. package/dist/components/PublicCard/PublicCard.svelte +267 -0
  24. package/dist/components/{pages/performers/AvailabilityCalendarModal.svelte.d.ts → PublicCard/PublicCard.svelte.d.ts} +12 -14
  25. package/dist/components/PublicCard/PublicCard.svelte.d.ts.map +1 -0
  26. package/dist/components/ShowCard/ShowCard.svelte +240 -0
  27. package/dist/components/ShowCard/ShowCard.svelte.d.ts +39 -0
  28. package/dist/components/ShowCard/ShowCard.svelte.d.ts.map +1 -0
  29. package/dist/components/ShowTimeCard/ShowTimeCard.svelte +92 -0
  30. package/dist/components/{Calendar/QuarterView.stories.svelte.d.ts → ShowTimeCard/ShowTimeCard.svelte.d.ts} +17 -21
  31. package/dist/components/ShowTimeCard/ShowTimeCard.svelte.d.ts.map +1 -0
  32. package/dist/components/Spinner/Spinner.svelte +73 -17
  33. package/dist/components/Spinner/Spinner.svelte.d.ts +5 -3
  34. package/dist/components/Spinner/Spinner.svelte.d.ts.map +1 -1
  35. package/dist/components/pages/performers/ShowDetails.svelte.d.ts +2 -2
  36. package/dist/components/pages/performers/ShowItemCard.svelte.d.ts +6 -6
  37. package/dist/components/pages/performers/VenueItemCard.svelte.d.ts +2 -2
  38. package/dist/components/pages/shows/TabNavigation.svelte +7 -8
  39. package/dist/index.d.ts +8 -3
  40. package/dist/index.js +12 -3
  41. package/dist/services/EventService.js +75 -75
  42. package/dist/services/EventService.spec.js +217 -217
  43. package/dist/services/ShowService.spec.js +342 -342
  44. package/package.json +160 -160
  45. package/dist/components/Calendar/Calendar.spec.d.ts +0 -2
  46. package/dist/components/Calendar/Calendar.spec.d.ts.map +0 -1
  47. package/dist/components/Calendar/Calendar.spec.js +0 -131
  48. package/dist/components/Calendar/Calendar.svelte +0 -1115
  49. package/dist/components/Calendar/Calendar.svelte.d.ts.map +0 -1
  50. package/dist/components/Calendar/QuarterView.spec.d.ts +0 -2
  51. package/dist/components/Calendar/QuarterView.spec.d.ts.map +0 -1
  52. package/dist/components/Calendar/QuarterView.spec.js +0 -394
  53. package/dist/components/Calendar/QuarterView.stories.svelte +0 -134
  54. package/dist/components/Calendar/QuarterView.stories.svelte.d.ts.map +0 -1
  55. package/dist/components/Calendar/QuarterView.svelte +0 -736
  56. package/dist/components/Calendar/QuarterView.svelte.d.ts.map +0 -1
  57. package/dist/components/pages/performers/AvailabilityCalendarModal.svelte +0 -632
  58. package/dist/components/pages/performers/AvailabilityCalendarModal.svelte.d.ts.map +0 -1
@@ -1,43 +1,42 @@
1
- export default Calendar;
2
- type Calendar = SvelteComponent<{
1
+ export default MiniMonthCalendar;
2
+ type MiniMonthCalendar = SvelteComponent<{
3
3
  variant?: string | undefined;
4
- view?: string | undefined;
5
- events?: any[] | undefined;
6
4
  selectedDates?: any[] | undefined;
7
- showMonths?: number | undefined;
8
- compact?: boolean | undefined;
9
- showNavigation?: boolean | undefined;
10
- showViewSwitcher?: boolean | undefined;
11
- readOnly?: boolean | undefined;
5
+ events?: any[] | undefined;
12
6
  saveStatus?: string | undefined;
13
7
  showLegend?: boolean | undefined;
8
+ showNavigation?: boolean | undefined;
9
+ showTodayButton?: boolean | undefined;
10
+ readOnly?: boolean | undefined;
11
+ showPartialPreview?: boolean | undefined;
12
+ disablePastNavigation?: boolean | undefined;
14
13
  }, {
15
14
  dateSelect: CustomEvent<any>;
16
- eventClick: CustomEvent<any>;
15
+ dayClick: CustomEvent<any>;
16
+ monthChange: CustomEvent<any>;
17
17
  } & {
18
18
  [evt: string]: CustomEvent<any>;
19
19
  }, {}> & {
20
20
  $$bindings?: string | undefined;
21
21
  };
22
- declare const Calendar: $$__sveltets_2_IsomorphicComponent<{
22
+ declare const MiniMonthCalendar: $$__sveltets_2_IsomorphicComponent<{
23
23
  variant?: string | undefined;
24
- view?: string | undefined;
25
- events?: any[] | undefined;
26
24
  selectedDates?: any[] | undefined;
27
- showMonths?: number | undefined;
28
- compact?: boolean | undefined;
29
- showNavigation?: boolean | undefined;
30
- showViewSwitcher?: boolean | undefined;
31
- readOnly?: boolean | undefined;
25
+ events?: any[] | undefined;
32
26
  saveStatus?: string | undefined;
33
27
  showLegend?: boolean | undefined;
28
+ showNavigation?: boolean | undefined;
29
+ showTodayButton?: boolean | undefined;
30
+ readOnly?: boolean | undefined;
31
+ showPartialPreview?: boolean | undefined;
32
+ disablePastNavigation?: boolean | undefined;
34
33
  }, {
35
34
  dateSelect: CustomEvent<any>;
36
- eventClick: CustomEvent<any>;
35
+ dayClick: CustomEvent<any>;
36
+ monthChange: CustomEvent<any>;
37
37
  } & {
38
38
  [evt: string]: CustomEvent<any>;
39
39
  }, {}, {}, string>;
40
- import { Calendar } from '@fullcalendar/core';
41
40
  interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
42
41
  new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
43
42
  $$bindings?: Bindings;
@@ -51,4 +50,4 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
51
50
  };
52
51
  z_$$bindings?: Bindings;
53
52
  }
54
- //# sourceMappingURL=Calendar.svelte.d.ts.map
53
+ //# sourceMappingURL=MiniMonthCalendar.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MiniMonthCalendar.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Calendar/MiniMonthCalendar.svelte.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAwxBA;;;;;;;;;;;;;;;;;mBAAwR;6CAT3O,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,OAAO,OAAO,QAAQ;IAC3L,cAAc,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,WAAW,OAAO,SAAS,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,eAAe,QAAQ,CAAC"}
@@ -11,6 +11,7 @@
11
11
  let themeMode = 'auto';
12
12
  let isDark = false; // Current display state (for applying classes)
13
13
 
14
+ /** @param {boolean} enable */
14
15
  function setMicdropDarkClass(enable) {
15
16
  // Support both performers portal and micdrop frontend
16
17
  const container = document.querySelector(containerSelector);
@@ -63,7 +64,8 @@
63
64
  };
64
65
  });
65
66
 
66
- function toggleTheme(event: MouseEvent & { currentTarget: HTMLButtonElement }) {
67
+ /** @param {MouseEvent} event */
68
+ function toggleTheme(event) {
67
69
  // Cycle: auto -> light -> dark -> auto
68
70
  if (themeMode === 'auto') {
69
71
  themeMode = 'light';
@@ -1 +1 @@
1
- {"version":3,"file":"DarkModeToggle.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/components/DarkModeToggle.svelte.js"],"names":[],"mappings":";;;;;;;;;AAqJA;;;;;mBAA8J;6CATjH,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,OAAO,OAAO,QAAQ;IAC3L,cAAc,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,WAAW,OAAO,SAAS,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"DarkModeToggle.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/components/DarkModeToggle.svelte.js"],"names":[],"mappings":";;;;;;;;;AAuJA;;;;;mBAA8J;6CATjH,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,OAAO,OAAO,QAAQ;IAC3L,cAAc,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,WAAW,OAAO,SAAS,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,49 @@
1
+ <script>
2
+ export let faqs = [];
3
+ export let title = "FAQs";
4
+ export let showTitle = true;
5
+
6
+ $: items = faqs.map(f =>
7
+ typeof f === 'string' ? { question: '', answer: f } : f
8
+ );
9
+ </script>
10
+
11
+ <div class="flex flex-col gap-3">
12
+ {#if showTitle}
13
+ <h2 class="section-title font-medium text-xl">{title}</h2>
14
+ {/if}
15
+
16
+ {#if items.length}
17
+ <div class="space-y-4">
18
+ {#each items as { question, answer }}
19
+ <div>
20
+ {#if question}
21
+ <p class="question-text text-[15px] font-medium mb-1">{question}</p>
22
+ {/if}
23
+ <p class="answer-text text-[15px] leading-relaxed">{answer}</p>
24
+ </div>
25
+ {/each}
26
+ </div>
27
+ {:else}
28
+ <p class="empty-text text-sm">No FAQs available.</p>
29
+ {/if}
30
+ </div>
31
+
32
+ <style>
33
+ /* Theme-responsive colors using CSS variables */
34
+ .section-title {
35
+ color: hsl(var(--Text-Primary));
36
+ }
37
+
38
+ .question-text {
39
+ color: hsl(var(--Text-Primary));
40
+ }
41
+
42
+ .answer-text {
43
+ color: hsl(var(--Text-Secondary));
44
+ }
45
+
46
+ .empty-text {
47
+ color: hsl(var(--Text-Tartiary));
48
+ }
49
+ </style>
@@ -1,17 +1,17 @@
1
- export default QuarterView;
2
- type QuarterView = SvelteComponent<{
3
- selectedDates: any;
4
- saveStatus?: string | undefined;
5
- currentevents?: any[] | undefined;
1
+ export default FAQs;
2
+ type FAQs = SvelteComponent<{
3
+ title?: string | undefined;
4
+ showTitle?: boolean | undefined;
5
+ faqs?: any[] | undefined;
6
6
  }, {
7
7
  [evt: string]: CustomEvent<any>;
8
8
  }, {}> & {
9
9
  $$bindings?: string | undefined;
10
10
  };
11
- declare const QuarterView: $$__sveltets_2_IsomorphicComponent<{
12
- selectedDates: any;
13
- saveStatus?: string | undefined;
14
- currentevents?: any[] | undefined;
11
+ declare const FAQs: $$__sveltets_2_IsomorphicComponent<{
12
+ title?: string | undefined;
13
+ showTitle?: boolean | undefined;
14
+ faqs?: any[] | undefined;
15
15
  }, {
16
16
  [evt: string]: CustomEvent<any>;
17
17
  }, {}, {}, string>;
@@ -28,4 +28,4 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
28
28
  };
29
29
  z_$$bindings?: Bindings;
30
30
  }
31
- //# sourceMappingURL=QuarterView.svelte.d.ts.map
31
+ //# sourceMappingURL=FAQs.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FAQs.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/FAQs/FAQs.svelte.js"],"names":[],"mappings":";;;;;;;;;;AA+CA;;;;;;mBAA8I;6CATjG,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,OAAO,OAAO,QAAQ;IAC3L,cAAc,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,WAAW,OAAO,SAAS,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,eAAe,QAAQ,CAAC"}
@@ -1,6 +1,7 @@
1
1
  <script>
2
2
  import { slide } from "svelte/transition";
3
3
  import { cubicOut } from "svelte/easing";
4
+ import { createEventDispatcher, onDestroy } from "svelte";
4
5
  import WarningIcon from "../Icons/WarningIcon.svelte";
5
6
 
6
7
  export let required = false;
@@ -41,8 +42,16 @@
41
42
  export let showErrors = false; // Show errors immediately (bypass touched requirement)
42
43
  export let disableBuiltInValidation = false; // When true, disables the built-in blur validation (use for custom validation)
43
44
 
45
+ // Instant search props
46
+ export let instantSearch = false; // Enable search-as-you-type with debouncing
47
+ export let debounceMs = 250; // Debounce delay for instant search
48
+ export let minSearchChars = 2; // Minimum characters before search triggers
49
+ export let showClearButton = false; // Show clear (X) button when input has value
50
+
44
51
  let inputValue = value;
45
52
  let inputElement;
53
+ let debounceTimer;
54
+ const dispatch = createEventDispatcher();
46
55
 
47
56
  // Derive inputmode from type if not explicitly set
48
57
  $: computedInputmode = inputmode || getInputmodeFromType(type);
@@ -163,8 +172,56 @@
163
172
 
164
173
  // Update exported value for parent bind:value
165
174
  value = inputValue;
175
+
176
+ // Instant search functionality
177
+ if (instantSearch) {
178
+ clearTimeout(debounceTimer);
179
+
180
+ // Dispatch immediately if cleared
181
+ if (inputValue.length === 0) {
182
+ dispatch('search', { query: '' });
183
+ return;
184
+ }
185
+
186
+ // Only search if we have enough characters
187
+ if (inputValue.length >= minSearchChars) {
188
+ debounceTimer = setTimeout(() => {
189
+ dispatch('search', { query: inputValue });
190
+ }, debounceMs);
191
+ }
192
+ }
166
193
  };
167
194
 
195
+ // Clear input (for instant search clear button)
196
+ function clearInput() {
197
+ inputValue = '';
198
+ value = '';
199
+ clearTimeout(debounceTimer);
200
+ if (instantSearch) {
201
+ dispatch('search', { query: '' });
202
+ }
203
+ if (inputElement) {
204
+ inputElement.focus();
205
+ }
206
+ }
207
+
208
+ // Handle keyboard shortcuts for instant search
209
+ function handleSearchKeyDown(event) {
210
+ if (instantSearch) {
211
+ if (event.key === 'Enter') {
212
+ clearTimeout(debounceTimer);
213
+ dispatch('search', { query: inputValue });
214
+ }
215
+ if (event.key === 'Escape') {
216
+ clearInput();
217
+ }
218
+ }
219
+ }
220
+
221
+ onDestroy(() => {
222
+ clearTimeout(debounceTimer);
223
+ });
224
+
168
225
  const isStrongPassword = (password) => {
169
226
  const minLength = 8;
170
227
  const hasUpperCase = /[A-Z]/.test(password);
@@ -399,7 +456,7 @@
399
456
  </div>
400
457
  {:else}
401
458
  <!-- Standard Input Layout -->
402
- <div class="flex items-center">
459
+ <div class="relative flex items-center w-full">
403
460
  <input
404
461
  bind:this={inputElement}
405
462
  {id}
@@ -411,9 +468,10 @@
411
468
  on:change={checkForAutofill}
412
469
  on:animationstart={handleAnimationStart}
413
470
  on:blur={handleBlur}
471
+ on:keydown={handleSearchKeyDown}
414
472
  {maxlength}
415
473
  {minlength}
416
- class="input-field {icon
474
+ class="input-field flex-1 {icon || (showClearButton && inputValue)
417
475
  ? 'pr-10'
418
476
  : ''} {getContentFloatClass()} {displayErrorText
419
477
  ? 'input-error'
@@ -426,7 +484,26 @@
426
484
  {autofocus}
427
485
  inputmode={computedInputmode}
428
486
  />
429
- {#if controlled && (buttonIcon || buttonText)}
487
+ {#if showClearButton && inputValue}
488
+ <button
489
+ type="button"
490
+ on:click={clearInput}
491
+ class="absolute right-2 top-1/2 -translate-y-1/2 flex items-center justify-center p-1 input-clear-button"
492
+ aria-label="Clear input"
493
+ tabindex="-1"
494
+ >
495
+ <svg
496
+ xmlns="http://www.w3.org/2000/svg"
497
+ viewBox="0 0 20 20"
498
+ fill="currentColor"
499
+ class="w-4 h-4"
500
+ >
501
+ <path
502
+ d="M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"
503
+ />
504
+ </svg>
505
+ </button>
506
+ {:else if controlled && (buttonIcon || buttonText)}
430
507
  <button
431
508
  type="button"
432
509
  on:click={handleButtonClick}
@@ -447,6 +524,13 @@
447
524
  {/if}
448
525
  </button>
449
526
  {/if}
527
+ {#if icon && type !== "textarea" && !(showClearButton && inputValue)}
528
+ <img
529
+ src={icon}
530
+ alt="Input icon"
531
+ class="absolute inset-y-0 right-0 w-5 h-5 mr-3 top-1/2 transform -translate-y-1/2 text-Text-Primary"
532
+ />
533
+ {/if}
450
534
  </div>
451
535
  {/if}
452
536
 
@@ -467,17 +551,9 @@
467
551
  {#if helperIcon || hintIcon}
468
552
  <img src={helperIcon || hintIcon} alt="Helper icon" class="w-4 h-4 mr-2" />
469
553
  {/if}
470
- <span>{helperText || hintText}</span>
554
+ <span>{@html helperText || hintText}</span>
471
555
  </div>
472
556
  {/if}
473
-
474
- {#if icon && type !== "textarea"}
475
- <img
476
- src={icon}
477
- alt="Input icon"
478
- class="absolute inset-y-0 right-0 w-5 h-5 mr-3 top-1/2 transform -translate-y-1/2 text-Text-Primary"
479
- />
480
- {/if}
481
557
  </div>
482
558
  </div>
483
559
 
@@ -549,6 +625,18 @@
549
625
  cursor: not-allowed;
550
626
  }
551
627
 
628
+ .input-clear-button {
629
+ color: var(--input-text-placeholder);
630
+ background: transparent;
631
+ border: none;
632
+ cursor: pointer;
633
+ transition: color 0.15s ease;
634
+ }
635
+
636
+ .input-clear-button:hover {
637
+ color: var(--input-text);
638
+ }
639
+
552
640
  .input-field {
553
641
  padding: 0.25rem 0.625rem;
554
642
  height: 40px;
@@ -36,7 +36,13 @@ type Input = SvelteComponent<{
36
36
  inputmode?: null | undefined;
37
37
  showErrors?: boolean | undefined;
38
38
  disableBuiltInValidation?: boolean | undefined;
39
+ instantSearch?: boolean | undefined;
40
+ debounceMs?: number | undefined;
41
+ minSearchChars?: number | undefined;
42
+ showClearButton?: boolean | undefined;
39
43
  }, {
44
+ search: CustomEvent<any>;
45
+ } & {
40
46
  [evt: string]: CustomEvent<any>;
41
47
  }, {}> & {
42
48
  $$bindings?: string | undefined;
@@ -78,7 +84,13 @@ declare const Input: $$__sveltets_2_IsomorphicComponent<{
78
84
  inputmode?: null | undefined;
79
85
  showErrors?: boolean | undefined;
80
86
  disableBuiltInValidation?: boolean | undefined;
87
+ instantSearch?: boolean | undefined;
88
+ debounceMs?: number | undefined;
89
+ minSearchChars?: number | undefined;
90
+ showClearButton?: boolean | undefined;
81
91
  }, {
92
+ search: CustomEvent<any>;
93
+ } & {
82
94
  [evt: string]: CustomEvent<any>;
83
95
  }, {}, {}, string>;
84
96
  interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
@@ -1 +1 @@
1
- {"version":3,"file":"Input.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Input/Input.svelte.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAAkjB;6CATrgB,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,OAAO,OAAO,QAAQ;IAC3L,cAAc,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,WAAW,OAAO,SAAS,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"Input.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Input/Input.svelte.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwcA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAAknB;6CATrkB,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,OAAO,OAAO,QAAQ;IAC3L,cAAc,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,WAAW,OAAO,SAAS,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,eAAe,QAAQ,CAAC"}
@@ -89,7 +89,7 @@
89
89
  {disabled}
90
90
  aria-label="Digit {index + 1} of {length}"
91
91
  aria-describedby="otp-instructions"
92
- class="otp-input w-12 h-12 md:w-14 md:h-14 text-center text-xl md:text-2xl text-Text-Primary font-semibold border-2 border-stroke-Primary rounded-xl focus:border-primary-700 focus:outline-none transition-colors bg-BG-Primary disabled:bg-BG-Secondary disabled:cursor-not-allowed"
92
+ class="otp-input w-12 h-12 md:w-14 md:h-14 text-center text-xl md:text-2xl text-text-primary font-semibold border-2 border-stroke-secondary rounded-xl focus:border-brand-primary focus:outline-none transition-colors bg-bg-tertiary disabled:bg-bg-quaternary disabled:cursor-not-allowed"
93
93
  on:input={(e) => handleInput(index, e)}
94
94
  on:keydown={(e) => handleKeyDown(index, e)}
95
95
  on:paste={handlePaste}
@@ -0,0 +1,206 @@
1
+ <script>
2
+ import ChevronLeft from 'carbon-icons-svelte/lib/ChevronLeft.svelte';
3
+ import ChevronRight from 'carbon-icons-svelte/lib/ChevronRight.svelte';
4
+
5
+ // Use LOCAL time, not UTC - consistent with how calendar displays dates
6
+ const today = new Date();
7
+ const todayLocalMonth = today.getMonth();
8
+ const todayLocalYear = today.getFullYear();
9
+
10
+ export let currentYear = todayLocalYear;
11
+ export let currentMonth = todayLocalMonth;
12
+ export let handleNext = () => {};
13
+ export let handlePrev = () => {};
14
+ export let handleToday = () => {}; // Navigate back to current month
15
+ export let disablePastNavigation = true; // Prevent navigating to past months by default
16
+
17
+ $: isAtCurrentMonth =
18
+ currentYear === todayLocalYear && currentMonth === todayLocalMonth;
19
+
20
+ $: canGoPrev = !disablePastNavigation || !isAtCurrentMonth;
21
+
22
+ // Track pressed state for touch animations
23
+ let prevPressed = false;
24
+ let nextPressed = false;
25
+ let todayPressed = false;
26
+
27
+ // Haptic feedback for mobile
28
+ function triggerHaptic(style = 'light') {
29
+ if (typeof window === 'undefined') return;
30
+
31
+ // iOS WebKit
32
+ if (window.webkit?.messageHandlers?.haptic) {
33
+ window.webkit.messageHandlers.haptic.postMessage(style);
34
+ return;
35
+ }
36
+
37
+ // Taptic Engine
38
+ if (window.TapticEngine) {
39
+ window.TapticEngine.impact({ style });
40
+ return;
41
+ }
42
+
43
+ // Android fallback
44
+ if (navigator.vibrate) {
45
+ navigator.vibrate(style === 'light' ? 10 : 20);
46
+ }
47
+ }
48
+
49
+ function handlePrevClick() {
50
+ if (canGoPrev) {
51
+ triggerHaptic('light');
52
+ handlePrev();
53
+ }
54
+ }
55
+
56
+ function handleNextClick() {
57
+ triggerHaptic('light');
58
+ handleNext();
59
+ }
60
+
61
+ function handleTodayClick() {
62
+ triggerHaptic('light');
63
+ handleToday();
64
+ }
65
+ </script>
66
+
67
+ <header class="month-switcher w-full flex items-center justify-between select-none">
68
+ <h2 class="month-title text-3xl font-semibold">
69
+ {new Intl.DateTimeFormat("en", {
70
+ month: "long",
71
+ }).format(new Date(currentYear, currentMonth, 1))}
72
+ </h2>
73
+ <div class="flex items-center gap-2">
74
+ <button
75
+ class="nav-btn outline-none p-3 -m-1.5 rounded-full cursor-pointer disabled:cursor-not-allowed disabled:opacity-50"
76
+ class:pressed={prevPressed}
77
+ on:click={handlePrevClick}
78
+ on:touchstart={() => prevPressed = true}
79
+ on:touchend={() => prevPressed = false}
80
+ on:touchcancel={() => prevPressed = false}
81
+ on:mousedown={() => prevPressed = true}
82
+ on:mouseup={() => prevPressed = false}
83
+ on:mouseleave={() => prevPressed = false}
84
+ disabled={!canGoPrev}
85
+ aria-label="Previous month"
86
+ >
87
+ <ChevronLeft size={20} />
88
+ </button>
89
+ <button
90
+ class="today-btn text-sm font-medium px-3 py-1 rounded-lg cursor-pointer disabled:cursor-not-allowed disabled:opacity-50"
91
+ class:pressed={todayPressed}
92
+ on:click={handleTodayClick}
93
+ on:touchstart={() => todayPressed = true}
94
+ on:touchend={() => todayPressed = false}
95
+ on:touchcancel={() => todayPressed = false}
96
+ on:mousedown={() => todayPressed = true}
97
+ on:mouseup={() => todayPressed = false}
98
+ on:mouseleave={() => todayPressed = false}
99
+ disabled={isAtCurrentMonth}
100
+ aria-label="Go to current month"
101
+ >
102
+ Today
103
+ </button>
104
+ <button
105
+ class="nav-btn cursor-pointer outline-none p-3 -m-1.5 rounded-full"
106
+ class:pressed={nextPressed}
107
+ on:click={handleNextClick}
108
+ on:touchstart={() => nextPressed = true}
109
+ on:touchend={() => nextPressed = false}
110
+ on:touchcancel={() => nextPressed = false}
111
+ on:mousedown={() => nextPressed = true}
112
+ on:mouseup={() => nextPressed = false}
113
+ on:mouseleave={() => nextPressed = false}
114
+ aria-label="Next month"
115
+ >
116
+ <ChevronRight size={20} />
117
+ </button>
118
+ </div>
119
+ </header>
120
+
121
+ <style>
122
+ /* Theme-responsive colors using CSS variables */
123
+ .nav-btn {
124
+ background: transparent;
125
+ border: none;
126
+ color: hsl(var(--Stroke-Primary));
127
+ -webkit-tap-highlight-color: transparent;
128
+ touch-action: manipulation;
129
+ -webkit-user-select: none;
130
+ -moz-user-select: none;
131
+ user-select: none;
132
+ transition: transform 0.1s ease, color 0.15s ease, background-color 0.15s ease;
133
+ }
134
+
135
+ @media (hover: hover) and (pointer: fine) {
136
+ .nav-btn:hover:not(:disabled) {
137
+ background-color: hsl(var(--BG-Secondary));
138
+ color: hsl(var(--Text-Primary));
139
+ }
140
+ }
141
+
142
+ .nav-btn.pressed:not(:disabled) {
143
+ transform: scale(0.9);
144
+ background-color: hsl(var(--BG-Secondary));
145
+ color: hsl(var(--Text-Primary));
146
+ }
147
+
148
+ .nav-btn:focus {
149
+ outline: none;
150
+ }
151
+
152
+ .nav-btn:focus-visible {
153
+ outline: 2px solid hsl(var(--Brand-Primary));
154
+ outline-offset: 2px;
155
+ }
156
+
157
+ .month-title {
158
+ color: hsl(var(--Text-Primary));
159
+ }
160
+
161
+ .month-switcher {
162
+ -webkit-tap-highlight-color: transparent;
163
+ touch-action: manipulation;
164
+ -webkit-touch-callout: none;
165
+ }
166
+
167
+ .today-btn {
168
+ background: transparent;
169
+ border: 1px solid hsl(var(--Stroke-Primary));
170
+ color: hsl(var(--Text-Primary));
171
+ -webkit-tap-highlight-color: transparent;
172
+ touch-action: manipulation;
173
+ -webkit-user-select: none;
174
+ -moz-user-select: none;
175
+ user-select: none;
176
+ transition: transform 0.1s ease, background-color 0.15s ease, color 0.15s ease;
177
+ }
178
+
179
+ @media (hover: hover) and (pointer: fine) {
180
+ .today-btn:hover:not(:disabled) {
181
+ background-color: hsl(var(--Brand-Primary));
182
+ color: white;
183
+ }
184
+ }
185
+
186
+ .today-btn.pressed:not(:disabled) {
187
+ transform: scale(0.95);
188
+ background-color: hsl(var(--Brand-Primary));
189
+ color: white;
190
+ }
191
+
192
+ .today-btn:disabled {
193
+ opacity: 0.4;
194
+ border-color: hsl(var(--Stroke-Primary));
195
+ color: hsl(var(--Text-Tertiary));
196
+ }
197
+
198
+ .today-btn:focus {
199
+ outline: none;
200
+ }
201
+
202
+ .today-btn:focus-visible {
203
+ outline: 2px solid hsl(var(--Brand-Primary));
204
+ outline-offset: 2px;
205
+ }
206
+ </style>
@@ -0,0 +1,37 @@
1
+ export default MonthSwitcher;
2
+ type MonthSwitcher = SvelteComponent<{
3
+ disablePastNavigation?: boolean | undefined;
4
+ currentYear?: number | undefined;
5
+ currentMonth?: number | undefined;
6
+ handleNext?: (() => void) | undefined;
7
+ handlePrev?: (() => void) | undefined;
8
+ handleToday?: (() => void) | undefined;
9
+ }, {
10
+ [evt: string]: CustomEvent<any>;
11
+ }, {}> & {
12
+ $$bindings?: string | undefined;
13
+ };
14
+ declare const MonthSwitcher: $$__sveltets_2_IsomorphicComponent<{
15
+ disablePastNavigation?: boolean | undefined;
16
+ currentYear?: number | undefined;
17
+ currentMonth?: number | undefined;
18
+ handleNext?: (() => void) | undefined;
19
+ handlePrev?: (() => void) | undefined;
20
+ handleToday?: (() => void) | undefined;
21
+ }, {
22
+ [evt: string]: CustomEvent<any>;
23
+ }, {}, {}, string>;
24
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
25
+ new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
26
+ $$bindings?: Bindings;
27
+ } & Exports;
28
+ (internal: unknown, props: Props & {
29
+ $$events?: Events;
30
+ $$slots?: Slots;
31
+ }): Exports & {
32
+ $set?: any;
33
+ $on?: any;
34
+ };
35
+ z_$$bindings?: Bindings;
36
+ }
37
+ //# sourceMappingURL=MonthSwitcher.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MonthSwitcher.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/MonthSwitcher/MonthSwitcher.svelte.js"],"names":[],"mappings":";;;;;;;;;;;;;AAwGA;;;;;;;;;mBAAyN;6CAT5K,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,OAAO,OAAO,QAAQ;IAC3L,cAAc,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,WAAW,OAAO,SAAS,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,eAAe,QAAQ,CAAC"}