@getmicdrop/svelte-components 5.15.0 → 5.16.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.
@@ -40,9 +40,9 @@
40
40
  let nextPressed = $state(false);
41
41
  let todayPressed = $state(false);
42
42
 
43
- let momentumAnimationId = null;
44
- const MOMENTUM_FRICTION = 0.92;
45
- const MOMENTUM_MIN_VELOCITY = 0.05;
43
+ let _momentumAnimationId = null;
44
+ const _MOMENTUM_FRICTION = 0.92;
45
+ const _MOMENTUM_MIN_VELOCITY = 0.05;
46
46
 
47
47
  const SWIPE_THRESHOLD = 0.15;
48
48
  const VELOCITY_THRESHOLD = 0.3;
@@ -99,7 +99,7 @@
99
99
  return checkDate < todayLocal;
100
100
  }
101
101
 
102
- function isSelectedDate(dateStr) {
102
+ function _isSelectedDate(dateStr) {
103
103
  return selectedDates.includes(dateStr);
104
104
  }
105
105
 
@@ -8,7 +8,7 @@
8
8
  onEventClick,
9
9
  } = $props();
10
10
 
11
- let isSmallScreen = $state(false);
11
+ let _isSmallScreen = $state(false);
12
12
 
13
13
  const DEFAULT_PLACEHOLDER = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Crect fill='%23e5e7eb' width='100' height='100'/%3E%3Cpath d='M50 25c-8.3 0-15 6.7-15 15v5c0 8.3 6.7 15 15 15s15-6.7 15-15v-5c0-8.3-6.7-15-15-15zm0 45c-13.8 0-25 5.6-25 12.5V90h50v-7.5c0-6.9-11.2-12.5-25-12.5z' fill='%239ca3af'/%3E%3C/svg%3E";
14
14
 
@@ -21,11 +21,11 @@
21
21
  };
22
22
 
23
23
  function handleResize() {
24
- isSmallScreen = window.innerWidth < 768;
24
+ _isSmallScreen = window.innerWidth < 768;
25
25
  }
26
26
 
27
27
  $effect(() => {
28
- isSmallScreen = window.innerWidth < 768;
28
+ _isSmallScreen = window.innerWidth < 768;
29
29
  window.addEventListener("resize", handleResize);
30
30
  return () => {
31
31
  if (typeof window !== 'undefined') {
@@ -39,7 +39,7 @@
39
39
  </div>
40
40
 
41
41
  {#if footer}
42
- <div class="px-4 py-3 border-t border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800 shrink-0">
42
+ <div class="px-4 py-3 border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-900 shrink-0">
43
43
  {@render footer()}
44
44
  </div>
45
45
  {/if}
@@ -42,7 +42,7 @@
42
42
  }
43
43
  const events = await res.json();
44
44
  invitationCount = events.filter((event: { acceptedState: number }) => event.acceptedState === 0).length;
45
- } catch (err) {
45
+ } catch (_err) {
46
46
  // Silently fail - this is non-critical UI enhancement
47
47
  }
48
48
  }
@@ -5,7 +5,7 @@
5
5
  import Logo from "../../assets/images/Logo.png";
6
6
  import Avatar from "../../primitives/Avatar/Avatar.svelte";
7
7
  import DarkModeToggle from "../../primitives/DarkModeToggle.svelte";
8
- import Icon from "../../primitives/Icons/Icon.svelte";
8
+ import IconComponent from "../../primitives/Icons/Icon.svelte";
9
9
  import ChevronLeft from "../../primitives/Icons/ChevronLeft.svelte";
10
10
  import Button from "../../primitives/Button/Button.svelte";
11
11
  import MenuItem from "../../primitives/MenuItem/MenuItem.svelte";
@@ -10,6 +10,8 @@
10
10
  open?: boolean;
11
11
  /** Title displayed in the header */
12
12
  title?: string;
13
+ /** Keep as bottom sheet at all screen sizes (never convert to centered modal) */
14
+ alwaysSheet?: boolean;
13
15
  /** Callback when the sheet should close */
14
16
  onclose?: () => void;
15
17
  /** Main content */
@@ -21,6 +23,7 @@
21
23
  let {
22
24
  open = $bindable(false),
23
25
  title = '',
26
+ alwaysSheet = false,
24
27
  onclose,
25
28
  children,
26
29
  actions
@@ -57,6 +60,18 @@
57
60
  document.body.style.overflow = "";
58
61
  }
59
62
  });
63
+
64
+ let backdropClass = $derived(
65
+ alwaysSheet
66
+ ? "fixed inset-0 z-50 flex items-end bg-gray-900/50 dark:bg-gray-900/80"
67
+ : "fixed inset-0 z-50 flex items-end md:items-center md:justify-center bg-gray-900/50 dark:bg-gray-900/80"
68
+ );
69
+
70
+ let sheetClass = $derived(
71
+ alwaysSheet
72
+ ? "w-full max-h-[90dvh] bg-white dark:bg-gray-800 rounded-t-xl shadow-xl flex flex-col overflow-hidden"
73
+ : "w-full max-h-[90dvh] md:max-w-lg md:max-h-[80vh] md:m-4 bg-white dark:bg-gray-800 rounded-t-xl md:rounded-lg shadow-xl flex flex-col overflow-hidden"
74
+ );
60
75
  </script>
61
76
 
62
77
  <svelte:window onkeydown={handleKeydown} />
@@ -65,18 +80,18 @@
65
80
  <!-- svelte-ignore a11y_click_events_have_key_events -->
66
81
  <!-- svelte-ignore a11y_no_static_element_interactions -->
67
82
  <div
68
- class="fixed inset-0 z-50 flex items-end md:items-center md:justify-center bg-gray-900/50 dark:bg-gray-900/80"
83
+ class={backdropClass}
69
84
  onclick={handleBackdropClick}
70
85
  transition:fade={{ duration: 200 }}
71
86
  >
72
87
  <!-- svelte-ignore a11y_click_events_have_key_events -->
73
88
  <!-- svelte-ignore a11y_no_static_element_interactions -->
74
89
  <div
75
- class="w-full max-h-[90dvh] md:max-w-lg md:max-h-[80vh] md:m-4 bg-white dark:bg-gray-800 rounded-t-xl md:rounded-lg shadow-xl flex flex-col overflow-hidden"
90
+ class={sheetClass}
76
91
  onclick={(e) => e.stopPropagation()}
77
92
  transition:fly={{ y: 300, duration: 300, easing: cubicOut }}
78
93
  >
79
- <div class="flex justify-center pt-3 pb-2 shrink-0 md:hidden">
94
+ <div class="flex justify-center pt-3 pb-2 shrink-0 {alwaysSheet ? '' : 'md:hidden'}" >
80
95
  <div class="w-10 h-1 bg-gray-300 dark:bg-gray-600 rounded-full"></div>
81
96
  </div>
82
97
 
@@ -4,6 +4,8 @@ interface Props {
4
4
  open?: boolean;
5
5
  /** Title displayed in the header */
6
6
  title?: string;
7
+ /** Keep as bottom sheet at all screen sizes (never convert to centered modal) */
8
+ alwaysSheet?: boolean;
7
9
  /** Callback when the sheet should close */
8
10
  onclose?: () => void;
9
11
  /** Main content */
@@ -1 +1 @@
1
- {"version":3,"file":"BottomSheet.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/primitives/BottomSheet/BottomSheet.svelte.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAIpC,UAAU,KAAK;IACb,0CAA0C;IAC1C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2CAA2C;IAC3C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,mBAAmB;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oCAAoC;IACpC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAoFH,QAAA,MAAM,WAAW,+CAAwC,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"BottomSheet.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/primitives/BottomSheet/BottomSheet.svelte.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAIpC,UAAU,KAAK;IACb,0CAA0C;IAC1C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iFAAiF;IACjF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,2CAA2C;IAC3C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,mBAAmB;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oCAAoC;IACpC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAiGH,QAAA,MAAM,WAAW,+CAAwC,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
@@ -118,7 +118,7 @@
118
118
  link: "text-blue-700 bg-transparent border-transparent hover:underline dark:text-blue-500",
119
119
  icon: "text-gray-500 bg-transparent border-transparent hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-700",
120
120
  toggle: "text-gray-900 bg-gray-100 border border-gray-200 hover:bg-gray-200 dark:bg-gray-700 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600",
121
- success: "text-white bg-green-600 border border-green-600",
121
+ success: "text-white bg-green-600 border border-green-600 hover:bg-green-700 dark:bg-green-600 dark:hover:bg-green-700",
122
122
  };
123
123
 
124
124
  // Active state classes for ghost and toggle
@@ -130,17 +130,15 @@
130
130
  }
131
131
  }
132
132
 
133
- // Lock body scroll when drawer is open
133
+ // Focus management when drawer is open (no body scroll lock — allow background scrolling)
134
134
  $effect(() => {
135
135
  if (typeof document !== "undefined") {
136
136
  if (isVisible) {
137
- document.body.style.overflow = "hidden";
138
137
  // Store previously focused element and focus drawer
139
138
  previouslyFocusedElement = document.activeElement;
140
139
  // Use setTimeout to ensure drawer is rendered before focusing
141
140
  setTimeout(() => drawerElement?.focus(), 0);
142
141
  } else {
143
- document.body.style.overflow = "";
144
142
  // Restore focus when closing
145
143
  if (previouslyFocusedElement && previouslyFocusedElement instanceof HTMLElement) {
146
144
  previouslyFocusedElement.focus();
@@ -148,12 +146,6 @@
148
146
  }
149
147
  }
150
148
  });
151
-
152
- onDestroy(() => {
153
- if (typeof document !== "undefined") {
154
- document.body.style.overflow = "";
155
- }
156
- });
157
149
  </script>
158
150
 
159
151
  <svelte:window onkeydown={handleKeydown} />
@@ -1 +1 @@
1
- {"version":3,"file":"Drawer.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/primitives/Drawer/Drawer.svelte.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAGpC,UAAU,KAAK;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC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,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AA2LH,QAAA,MAAM,MAAM,+CAAwC,CAAC;AACrD,KAAK,MAAM,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC;AACxC,eAAe,MAAM,CAAC"}
@@ -27,8 +27,8 @@
27
27
  }} */
28
28
  let {
29
29
  open = $bindable(false),
30
- isProcessing = false,
31
- isSuccess = false,
30
+ isProcessing: _isProcessing = false,
31
+ isSuccess: _isSuccess = false,
32
32
  size = "md",
33
33
  persistent = false,
34
34
  haptic = true,
@@ -112,7 +112,7 @@
112
112
  }
113
113
  });
114
114
 
115
- let authError = $state("");
115
+ let _authError = $state("");
116
116
  let email = $state((() => userEmail)());
117
117
  let password = $state("");
118
118
  let errors = $state({});
@@ -181,7 +181,7 @@
181
181
  email = rememberedUser.email;
182
182
  }
183
183
  }
184
- } catch (e) {
184
+ } catch (_e) {
185
185
  // Ignore parse errors
186
186
  }
187
187
 
@@ -205,7 +205,7 @@
205
205
 
206
206
  // Handle browser back/forward buttons
207
207
  const handlePopState = () => {
208
- const path = window.location.pathname;
208
+ const _path = window.location.pathname;
209
209
  };
210
210
 
211
211
  window.addEventListener("popstate", handlePopState);
@@ -275,7 +275,7 @@
275
275
  async function handleSubmit(event) {
276
276
  event.preventDefault();
277
277
  isLoading = true;
278
- authError = "";
278
+ _authError = "";
279
279
  // Try to get values from DOM first (for testing frameworks), fall back to Svelte state
280
280
  const emailInput = /** @type {HTMLInputElement|null} */ (document.querySelector('#email'));
281
281
  const passwordInput = /** @type {HTMLInputElement|null} */ (document.querySelector('#password'));
@@ -436,7 +436,7 @@
436
436
  });
437
437
 
438
438
  try {
439
- const [_, response] = await Promise.all([minDelay, apiCall]);
439
+ const [_delay, _response] = await Promise.all([minDelay, apiCall]);
440
440
  isLoading = false;
441
441
 
442
442
  // Always show success to prevent email enumeration
@@ -483,7 +483,7 @@
483
483
  });
484
484
 
485
485
  try {
486
- const [_, response] = await Promise.all([minDelay, apiCall]);
486
+ const [_delay2, _response2] = await Promise.all([minDelay, apiCall]);
487
487
 
488
488
  isLoading = false;
489
489
 
@@ -549,7 +549,7 @@
549
549
  'rememberedUser',
550
550
  JSON.stringify({ email: emailVal, firstName: firstNameVal })
551
551
  );
552
- } catch (e) {
552
+ } catch (_e) {
553
553
  // Ignore storage errors
554
554
  }
555
555
  }
@@ -120,7 +120,7 @@ export async function sendVenueMessage(inviteId, message) {
120
120
  if (text) {
121
121
  try {
122
122
  result = JSON.parse(text);
123
- } catch (e) {
123
+ } catch (_e) {
124
124
  // Empty response is fine
125
125
  }
126
126
  }
@@ -142,7 +142,7 @@ export function getGreeting(name) {
142
142
  return greeting;
143
143
  }
144
144
  }
145
- } catch (e) {
145
+ } catch (_e) {
146
146
  // localStorage unavailable or parse error - continue to generate
147
147
  }
148
148
 
@@ -157,7 +157,7 @@ export function getGreeting(name) {
157
157
  day: currentDay,
158
158
  cachedName: name
159
159
  }));
160
- } catch (e) {
160
+ } catch (_e2) {
161
161
  // localStorage unavailable - greeting still works, just won't persist
162
162
  }
163
163
 
@@ -181,7 +181,7 @@ export function clearGreetingCache() {
181
181
  if (typeof window === 'undefined') return;
182
182
  try {
183
183
  localStorage.removeItem(STORAGE_KEY);
184
- } catch (e) {
184
+ } catch (_e) {
185
185
  // localStorage unavailable
186
186
  }
187
187
  }
@@ -61,7 +61,7 @@ export async function validateImage(file) {
61
61
  error: null,
62
62
  dimensions
63
63
  };
64
- } catch (error) {
64
+ } catch (_error) {
65
65
  return {
66
66
  valid: false,
67
67
  error: 'Failed to read image dimensions. Please try another file.',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getmicdrop/svelte-components",
3
- "version": "5.15.0",
3
+ "version": "5.16.0",
4
4
  "description": "Shared component library for Micdrop applications",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",