@getmicdrop/svelte-components 2.4.0 → 2.6.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.
- package/dist/__LIB_STORES__.js +2 -30
- package/dist/components/Badges/Badge.svelte +3 -129
- package/dist/components/Badges/Badge.svelte.d.ts +2 -8
- package/dist/components/Badges/Badge.svelte.d.ts.map +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.svelte +36 -65
- package/dist/components/Breadcrumb/Breadcrumb.svelte.d.ts +2 -16
- package/dist/components/Breadcrumb/Breadcrumb.svelte.d.ts.map +1 -1
- package/dist/components/Button/Button.svelte +0 -1
- package/dist/components/Calendar/Calendar.spec.d.ts +2 -0
- package/dist/components/Calendar/Calendar.spec.d.ts.map +1 -0
- package/dist/components/Calendar/Calendar.spec.js +131 -0
- package/dist/components/Calendar/Calendar.svelte +1115 -0
- package/dist/components/Calendar/{MiniMonthCalendar.svelte.d.ts → Calendar.svelte.d.ts} +21 -20
- package/dist/components/{Checkbox/Checkbox.svelte.d.ts.map → Calendar/Calendar.svelte.d.ts.map} +1 -1
- package/dist/components/Calendar/QuarterView.spec.d.ts +2 -0
- package/dist/components/Calendar/QuarterView.spec.d.ts.map +1 -0
- package/dist/components/Calendar/QuarterView.spec.js +394 -0
- package/dist/components/Calendar/QuarterView.stories.svelte +134 -0
- package/dist/components/{PublicCard/PublicCard.svelte.d.ts → Calendar/QuarterView.stories.svelte.d.ts} +21 -15
- package/dist/components/Calendar/QuarterView.stories.svelte.d.ts.map +1 -0
- package/dist/components/Calendar/QuarterView.svelte +736 -0
- package/dist/components/{FAQs/FAQs.svelte.d.ts → Calendar/QuarterView.svelte.d.ts} +10 -10
- package/dist/components/{Skeleton/Skeleton.svelte.d.ts.map → Calendar/QuarterView.svelte.d.ts.map} +1 -1
- package/dist/components/DarkModeToggle.svelte +0 -2
- package/dist/components/DarkModeToggle.svelte.d.ts.map +1 -1
- package/dist/components/Input/Input.svelte +12 -100
- package/dist/components/Input/Input.svelte.d.ts +6 -18
- package/dist/components/Input/Input.svelte.d.ts.map +1 -1
- package/dist/components/Input/MultiSelect.svelte +5 -4
- package/dist/components/Input/MultiSelect.svelte.d.ts +6 -6
- package/dist/components/Input/MultiSelect.svelte.d.ts.map +1 -1
- package/dist/components/Input/OTPInput.svelte +1 -1
- package/dist/components/Input/Select.svelte +5 -4
- package/dist/components/Input/Select.svelte.d.ts +6 -6
- package/dist/components/Input/Select.svelte.d.ts.map +1 -1
- package/dist/components/Layout/Header.svelte +4 -14
- package/dist/components/Modal/ConfirmationModal.svelte +17 -69
- package/dist/components/Modal/ConfirmationModal.svelte.d.ts +0 -22
- package/dist/components/Modal/ConfirmationModal.svelte.d.ts.map +1 -1
- package/dist/components/Modal/Modal.svelte +8 -34
- package/dist/components/Modal/Modal.svelte.d.ts +0 -2
- package/dist/components/Modal/Modal.svelte.d.ts.map +1 -1
- package/dist/components/PasswordStrengthIndicator/PasswordStrengthIndicator.svelte.d.ts +2 -2
- package/dist/components/Spinner/Spinner.svelte +17 -73
- package/dist/components/Spinner/Spinner.svelte.d.ts +3 -5
- package/dist/components/Spinner/Spinner.svelte.d.ts.map +1 -1
- package/dist/components/pages/performers/AvailabilityCalendarModal.svelte +632 -0
- package/dist/components/{ShowTimeCard/ShowTimeCard.svelte.d.ts → pages/performers/AvailabilityCalendarModal.svelte.d.ts} +14 -14
- package/dist/components/pages/performers/AvailabilityCalendarModal.svelte.d.ts.map +1 -0
- package/dist/components/pages/performers/ShowDetails.svelte.d.ts +2 -2
- package/dist/components/pages/performers/ShowItemCard.svelte.d.ts +8 -8
- package/dist/components/pages/performers/SwitchOption.svelte.d.ts +2 -2
- package/dist/components/pages/performers/VenueInfo.svelte.d.ts +2 -2
- package/dist/components/pages/performers/VenueItemCard.svelte +2 -2
- package/dist/components/pages/performers/VenueItemCard.svelte.d.ts +4 -4
- package/dist/components/pages/profile/profile-form.svelte +1 -1
- package/dist/components/pages/shows/TabNavigation.svelte +8 -7
- package/dist/constants/formOptions.d.ts +2 -5
- package/dist/constants/formOptions.d.ts.map +1 -1
- package/dist/constants/formOptions.js +1 -2
- package/dist/index.d.ts +4 -24
- package/dist/index.js +4 -30
- package/dist/services/EventService.js +75 -75
- package/dist/services/EventService.spec.js +217 -217
- package/dist/services/ShowService.spec.js +342 -342
- package/package.json +160 -160
- package/dist/components/AboutShow/AboutShow.svelte +0 -278
- package/dist/components/AboutShow/AboutShow.svelte.d.ts +0 -43
- package/dist/components/AboutShow/AboutShow.svelte.d.ts.map +0 -1
- package/dist/components/Accordion/Accordion.svelte +0 -44
- package/dist/components/Accordion/Accordion.svelte.d.ts +0 -42
- package/dist/components/Accordion/Accordion.svelte.d.ts.map +0 -1
- package/dist/components/Accordion/AccordionItem.svelte +0 -141
- package/dist/components/Accordion/AccordionItem.svelte.d.ts +0 -50
- package/dist/components/Accordion/AccordionItem.svelte.d.ts.map +0 -1
- package/dist/components/Calendar/MiniMonthCalendar.svelte +0 -1446
- package/dist/components/Calendar/MiniMonthCalendar.svelte.d.ts.map +0 -1
- package/dist/components/Checkbox/Checkbox.svelte +0 -116
- package/dist/components/Checkbox/Checkbox.svelte.d.ts +0 -52
- package/dist/components/Drawer/Drawer.svelte +0 -207
- package/dist/components/Drawer/Drawer.svelte.d.ts +0 -74
- package/dist/components/Drawer/Drawer.svelte.d.ts.map +0 -1
- package/dist/components/Dropdown/Dropdown.svelte +0 -129
- package/dist/components/Dropdown/Dropdown.svelte.d.ts +0 -48
- package/dist/components/Dropdown/Dropdown.svelte.d.ts.map +0 -1
- package/dist/components/Dropdown/DropdownItem.svelte +0 -111
- package/dist/components/Dropdown/DropdownItem.svelte.d.ts +0 -48
- package/dist/components/Dropdown/DropdownItem.svelte.d.ts.map +0 -1
- package/dist/components/FAQs/FAQs.svelte +0 -49
- package/dist/components/FAQs/FAQs.svelte.d.ts.map +0 -1
- package/dist/components/Input/Search.svelte +0 -173
- package/dist/components/Input/Search.svelte.d.ts +0 -68
- package/dist/components/Input/Search.svelte.d.ts.map +0 -1
- package/dist/components/Input/Textarea.svelte +0 -160
- package/dist/components/Input/Textarea.svelte.d.ts +0 -69
- package/dist/components/Input/Textarea.svelte.d.ts.map +0 -1
- package/dist/components/Label/Label.svelte +0 -60
- package/dist/components/Label/Label.svelte.d.ts +0 -48
- package/dist/components/Label/Label.svelte.d.ts.map +0 -1
- package/dist/components/Modal/InputModal.svelte +0 -180
- package/dist/components/Modal/InputModal.svelte.d.ts +0 -77
- package/dist/components/Modal/InputModal.svelte.d.ts.map +0 -1
- package/dist/components/Modal/StatusModal.svelte +0 -221
- package/dist/components/Modal/StatusModal.svelte.d.ts +0 -59
- package/dist/components/Modal/StatusModal.svelte.d.ts.map +0 -1
- package/dist/components/MonthSwitcher/MonthSwitcher.svelte +0 -206
- package/dist/components/MonthSwitcher/MonthSwitcher.svelte.d.ts +0 -37
- package/dist/components/MonthSwitcher/MonthSwitcher.svelte.d.ts.map +0 -1
- package/dist/components/OrderSummary/OrderSummary.svelte +0 -553
- package/dist/components/OrderSummary/OrderSummary.svelte.d.ts +0 -65
- package/dist/components/OrderSummary/OrderSummary.svelte.d.ts.map +0 -1
- package/dist/components/Pagination/Pagination.svelte +0 -197
- package/dist/components/Pagination/Pagination.svelte.d.ts +0 -53
- package/dist/components/Pagination/Pagination.svelte.d.ts.map +0 -1
- package/dist/components/PublicCard/PublicCard.svelte +0 -267
- package/dist/components/PublicCard/PublicCard.svelte.d.ts.map +0 -1
- package/dist/components/Radio/Radio.svelte +0 -119
- package/dist/components/Radio/Radio.svelte.d.ts +0 -54
- package/dist/components/Radio/Radio.svelte.d.ts.map +0 -1
- package/dist/components/ShowCard/ShowCard.svelte +0 -240
- package/dist/components/ShowCard/ShowCard.svelte.d.ts +0 -39
- package/dist/components/ShowCard/ShowCard.svelte.d.ts.map +0 -1
- package/dist/components/ShowTimeCard/ShowTimeCard.svelte +0 -92
- package/dist/components/ShowTimeCard/ShowTimeCard.svelte.d.ts.map +0 -1
- package/dist/components/Skeleton/Skeleton.svelte +0 -68
- package/dist/components/Skeleton/Skeleton.svelte.d.ts +0 -37
- package/dist/components/Tabs/TabItem.svelte +0 -39
- package/dist/components/Tabs/TabItem.svelte.d.ts +0 -52
- package/dist/components/Tabs/TabItem.svelte.d.ts.map +0 -1
- package/dist/components/Tabs/Tabs.svelte +0 -181
- package/dist/components/Tabs/Tabs.svelte.d.ts +0 -46
- package/dist/components/Tabs/Tabs.svelte.d.ts.map +0 -1
package/dist/__LIB_STORES__.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { writable } from 'svelte/store';
|
|
2
2
|
|
|
3
|
-
// Create a
|
|
3
|
+
// Create a minimal page store for library builds
|
|
4
4
|
const createPageStore = () => {
|
|
5
|
-
const
|
|
5
|
+
const { subscribe, set } = writable({
|
|
6
6
|
url: typeof window !== 'undefined' ? new URL(window.location.href) : new URL('http://localhost'),
|
|
7
7
|
params: {},
|
|
8
8
|
route: { id: null },
|
|
@@ -13,34 +13,6 @@ const createPageStore = () => {
|
|
|
13
13
|
state: {}
|
|
14
14
|
});
|
|
15
15
|
|
|
16
|
-
const { subscribe, set } = writable(getPageState());
|
|
17
|
-
|
|
18
|
-
// Listen for navigation events in the browser
|
|
19
|
-
if (typeof window !== 'undefined') {
|
|
20
|
-
// Update on popstate (back/forward navigation)
|
|
21
|
-
window.addEventListener('popstate', () => set(getPageState()));
|
|
22
|
-
|
|
23
|
-
// Intercept pushState and replaceState to detect programmatic navigation
|
|
24
|
-
const originalPushState = history.pushState;
|
|
25
|
-
const originalReplaceState = history.replaceState;
|
|
26
|
-
|
|
27
|
-
history.pushState = function(...args) {
|
|
28
|
-
originalPushState.apply(this, args);
|
|
29
|
-
set(getPageState());
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
history.replaceState = function(...args) {
|
|
33
|
-
originalReplaceState.apply(this, args);
|
|
34
|
-
set(getPageState());
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
// Also listen for click events on links to catch SvelteKit navigation
|
|
38
|
-
window.addEventListener('click', (e) => {
|
|
39
|
-
// Small delay to let the navigation complete
|
|
40
|
-
setTimeout(() => set(getPageState()), 0);
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
|
|
44
16
|
return { subscribe };
|
|
45
17
|
};
|
|
46
18
|
|
|
@@ -6,14 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
export let size = "medium";
|
|
8
8
|
export let className = "";
|
|
9
|
-
/** @type {string
|
|
9
|
+
/** @type {string} Semantic variant (required) */
|
|
10
10
|
export let variant = "neutral";
|
|
11
|
-
/** @type {string|null} Event display type: "square" or "circle" */
|
|
12
|
-
export let event = null;
|
|
13
|
-
/** @type {string|null} Custom text color (hex) */
|
|
14
|
-
export let textColor = null;
|
|
15
|
-
/** @type {string|null} Custom background color (hex or rgba) */
|
|
16
|
-
export let bgColor = null;
|
|
17
11
|
|
|
18
12
|
$: sizeClass = (() => {
|
|
19
13
|
switch (size) {
|
|
@@ -28,24 +22,8 @@
|
|
|
28
22
|
}
|
|
29
23
|
})();
|
|
30
24
|
|
|
31
|
-
// Handle tier numbers (1-5) as variants
|
|
32
|
-
$: normalizedVariant = (() => {
|
|
33
|
-
if (typeof variant === "number" || !isNaN(Number(variant))) {
|
|
34
|
-
const tierNum = Number(variant);
|
|
35
|
-
switch (tierNum) {
|
|
36
|
-
case 1: return "tier-1";
|
|
37
|
-
case 2: return "tier-2";
|
|
38
|
-
case 3: return "tier-3";
|
|
39
|
-
case 4: return "tier-4";
|
|
40
|
-
case 5: return "tier-5";
|
|
41
|
-
default: return "neutral";
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return String(variant).toLowerCase();
|
|
45
|
-
})();
|
|
46
|
-
|
|
47
25
|
$: variantClass = (() => {
|
|
48
|
-
switch (
|
|
26
|
+
switch (variant.toLowerCase()) {
|
|
49
27
|
// Role variants
|
|
50
28
|
case "host":
|
|
51
29
|
return "badge-host";
|
|
@@ -69,46 +47,14 @@
|
|
|
69
47
|
case "warning":
|
|
70
48
|
return "badge-warning";
|
|
71
49
|
case "error":
|
|
72
|
-
case "danger":
|
|
73
50
|
return "badge-error";
|
|
74
51
|
case "info":
|
|
75
52
|
return "badge-info";
|
|
76
|
-
// Tier variants (for lineup position badges)
|
|
77
|
-
case "tier-1":
|
|
78
|
-
return "badge-tier-1";
|
|
79
|
-
case "tier-2":
|
|
80
|
-
return "badge-tier-2";
|
|
81
|
-
case "tier-3":
|
|
82
|
-
return "badge-tier-3";
|
|
83
|
-
case "tier-4":
|
|
84
|
-
return "badge-tier-4";
|
|
85
|
-
case "tier-5":
|
|
86
|
-
return "badge-tier-5";
|
|
87
53
|
case "neutral":
|
|
88
54
|
default:
|
|
89
55
|
return "badge-neutral";
|
|
90
56
|
}
|
|
91
57
|
})();
|
|
92
|
-
|
|
93
|
-
$: eventClass = (() => {
|
|
94
|
-
if (!event) return "";
|
|
95
|
-
switch (event) {
|
|
96
|
-
case "square":
|
|
97
|
-
return "badge-event-square";
|
|
98
|
-
case "circle":
|
|
99
|
-
return "badge-event-circle";
|
|
100
|
-
default:
|
|
101
|
-
return "";
|
|
102
|
-
}
|
|
103
|
-
})();
|
|
104
|
-
|
|
105
|
-
// Custom style for text/bg color overrides
|
|
106
|
-
$: customStyle = (() => {
|
|
107
|
-
const styles = [];
|
|
108
|
-
if (textColor) styles.push(`color: ${textColor}`);
|
|
109
|
-
if (bgColor) styles.push(`background-color: ${bgColor}`);
|
|
110
|
-
return styles.length > 0 ? styles.join("; ") : null;
|
|
111
|
-
})();
|
|
112
58
|
</script>
|
|
113
59
|
|
|
114
60
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
@@ -118,11 +64,9 @@
|
|
|
118
64
|
"badge",
|
|
119
65
|
sizeClass,
|
|
120
66
|
variantClass,
|
|
121
|
-
eventClass,
|
|
122
67
|
className
|
|
123
68
|
)}
|
|
124
|
-
|
|
125
|
-
on:click={(e) => dispatch("click", e)}
|
|
69
|
+
on:click={(event) => dispatch("click", event)}
|
|
126
70
|
>
|
|
127
71
|
<slot />
|
|
128
72
|
</div>
|
|
@@ -132,9 +76,6 @@
|
|
|
132
76
|
|
|
133
77
|
Role variants: host, headliner, feature, special-guest, opener, guest, teacher, assistant
|
|
134
78
|
Status variants: success, warning, error, info, neutral
|
|
135
|
-
Tier variants: 1, 2, 3, 4, 5 (pass as number or string)
|
|
136
|
-
Event types: event="square" or event="circle"
|
|
137
|
-
Custom colors: textColor="#hex" bgColor="rgba(...)"
|
|
138
79
|
-->
|
|
139
80
|
|
|
140
81
|
<style>
|
|
@@ -238,71 +179,4 @@
|
|
|
238
179
|
color: #4b5563;
|
|
239
180
|
background-color: #f9fafb;
|
|
240
181
|
}
|
|
241
|
-
|
|
242
|
-
/* Tier variants (lineup position badges) - colors match local frontend implementation */
|
|
243
|
-
.badge-tier-1 {
|
|
244
|
-
color: rgba(108, 43, 217, 1);
|
|
245
|
-
background-color: rgba(108, 43, 217, 0.15);
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
.badge-tier-2 {
|
|
249
|
-
color: rgba(255, 146, 46, 1);
|
|
250
|
-
background-color: rgba(255, 146, 46, 0.15);
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
.badge-tier-3 {
|
|
254
|
-
color: rgba(2, 132, 254, 1);
|
|
255
|
-
background-color: rgba(2, 132, 254, 0.15);
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
.badge-tier-4 {
|
|
259
|
-
color: rgba(21, 160, 51, 1);
|
|
260
|
-
background-color: rgba(21, 160, 51, 0.15);
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
.badge-tier-5 {
|
|
264
|
-
color: rgba(255, 102, 102, 1);
|
|
265
|
-
background-color: rgba(255, 102, 102, 0.15);
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
/* Event display types */
|
|
269
|
-
.badge-event-square {
|
|
270
|
-
padding: 4px;
|
|
271
|
-
border-radius: 4px;
|
|
272
|
-
border: 0.8px solid rgba(2, 132, 254, 0.5);
|
|
273
|
-
box-shadow:
|
|
274
|
-
0px 20px 6px 0px rgba(0, 0, 0, 0),
|
|
275
|
-
0px 13px 5px 0px rgba(0, 0, 0, 0.02),
|
|
276
|
-
0px 7px 4px 0px rgba(0, 0, 0, 0.08),
|
|
277
|
-
0px 3px 3px 0px rgba(0, 0, 0, 0.14),
|
|
278
|
-
0px 1px 2px 0px rgba(0, 0, 0, 0.16);
|
|
279
|
-
font-size: 14px;
|
|
280
|
-
font-weight: 400;
|
|
281
|
-
line-height: 14px;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
.badge-event-circle {
|
|
285
|
-
padding: 4px;
|
|
286
|
-
border-radius: 9999px;
|
|
287
|
-
font-size: 14px;
|
|
288
|
-
font-weight: 600;
|
|
289
|
-
line-height: 14px;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
@media only screen and (max-width: 640px) {
|
|
293
|
-
.badge-event-square {
|
|
294
|
-
padding: 2px;
|
|
295
|
-
font-size: 8px;
|
|
296
|
-
line-height: 10px;
|
|
297
|
-
font-weight: 200;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
.badge-event-circle {
|
|
301
|
-
padding: 2px;
|
|
302
|
-
font-size: 8px;
|
|
303
|
-
gap: 0px;
|
|
304
|
-
font-weight: 500;
|
|
305
|
-
line-height: 8px;
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
182
|
</style>
|
|
@@ -2,10 +2,7 @@ export default Badge;
|
|
|
2
2
|
type Badge = SvelteComponent<$$__sveltets_2_PropsWithChildren<{
|
|
3
3
|
size?: string | undefined;
|
|
4
4
|
className?: string | undefined;
|
|
5
|
-
variant?: string |
|
|
6
|
-
event?: string | null | undefined;
|
|
7
|
-
textColor?: string | null | undefined;
|
|
8
|
-
bgColor?: string | null | undefined;
|
|
5
|
+
variant?: string | undefined;
|
|
9
6
|
}, {
|
|
10
7
|
default: {};
|
|
11
8
|
}>, {
|
|
@@ -20,10 +17,7 @@ type Badge = SvelteComponent<$$__sveltets_2_PropsWithChildren<{
|
|
|
20
17
|
declare const Badge: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
21
18
|
size?: string | undefined;
|
|
22
19
|
className?: string | undefined;
|
|
23
|
-
variant?: string |
|
|
24
|
-
event?: string | null | undefined;
|
|
25
|
-
textColor?: string | null | undefined;
|
|
26
|
-
bgColor?: string | null | undefined;
|
|
20
|
+
variant?: string | undefined;
|
|
27
21
|
}, {
|
|
28
22
|
default: {};
|
|
29
23
|
}>, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Badges/Badge.svelte.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Badge.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Badges/Badge.svelte.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAiGA;;;;;;;;;;;;eAAuJ;sCATjH,KAAK,EAAE,KAAK;;;;;6CALL,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,18 +1,8 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { createEventDispatcher } from "svelte";
|
|
3
|
-
import
|
|
4
|
-
import Home from "../Icons/Home.svelte";
|
|
3
|
+
import BreadcrumbArrow from "../../assets/svg/arrow-up.svg";
|
|
5
4
|
|
|
6
|
-
/** @type {Array<{name: string, href: string}>} */
|
|
7
5
|
export let data = [];
|
|
8
|
-
/** @type {string} Additional CSS classes */
|
|
9
|
-
export let className = "";
|
|
10
|
-
/** @type {boolean} Show built-in home icon for first item */
|
|
11
|
-
export let showHomeIcon = true;
|
|
12
|
-
/** @type {string} Page title displayed below breadcrumb */
|
|
13
|
-
export let title = "";
|
|
14
|
-
/** @type {string} Subtitle displayed below title */
|
|
15
|
-
export let subtitle = "";
|
|
16
6
|
|
|
17
7
|
const dispatch = createEventDispatcher();
|
|
18
8
|
|
|
@@ -21,59 +11,40 @@
|
|
|
21
11
|
}
|
|
22
12
|
</script>
|
|
23
13
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
14
|
+
{#if data.length > 0}
|
|
15
|
+
<nav class="inline-flex text-sm leading-[14px] font-medium">
|
|
16
|
+
{#each data as crumb, index}
|
|
17
|
+
<div class="flex items-center">
|
|
18
|
+
{#if index > 0}
|
|
19
|
+
<img
|
|
20
|
+
src={BreadcrumbArrow}
|
|
21
|
+
alt=""
|
|
22
|
+
class="w-2.5 sm:w-3 h-2.5 sm:h-3 mx-2 sm:mx-2.5"
|
|
23
|
+
/>
|
|
24
|
+
{/if}
|
|
25
|
+
{#if index === 0}
|
|
26
|
+
<img
|
|
27
|
+
src={crumb.icon}
|
|
28
|
+
alt=""
|
|
29
|
+
class="w-3 sm:w-4 h-3 sm:h-4 mx-2 sm:mx-2.5"
|
|
30
|
+
/>
|
|
31
|
+
{/if}
|
|
32
|
+
{#if index === data.length - 1}
|
|
33
|
+
<span class="text-Text-Tartiary cursor-default">{crumb.name}</span>
|
|
34
|
+
{:else}
|
|
35
|
+
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
36
|
+
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
37
|
+
<span class="text-Text-Secondary no-underline cursor-pointer">
|
|
38
|
+
<a
|
|
39
|
+
href={crumb.href}
|
|
40
|
+
on:click={() => handleClick(crumb)}
|
|
41
|
+
class="hover:no-underline"
|
|
43
42
|
>
|
|
44
43
|
{crumb.name}
|
|
45
|
-
</
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
>
|
|
53
|
-
<a
|
|
54
|
-
href={crumb.href}
|
|
55
|
-
on:click={() => handleClick(crumb)}
|
|
56
|
-
class="hover:no-underline"
|
|
57
|
-
>
|
|
58
|
-
{crumb.name}
|
|
59
|
-
</a>
|
|
60
|
-
</span>
|
|
61
|
-
{/if}
|
|
62
|
-
</div>
|
|
63
|
-
{/each}
|
|
64
|
-
</nav>
|
|
65
|
-
{/if}
|
|
66
|
-
|
|
67
|
-
{#if title || subtitle}
|
|
68
|
-
<div class="pl-1 mb-2 md:pl-6 flex flex-col gap-1">
|
|
69
|
-
{#if title}
|
|
70
|
-
<h1 class="text-[32px] font-semibold text-text-primary text-start">
|
|
71
|
-
{title}
|
|
72
|
-
</h1>
|
|
73
|
-
{/if}
|
|
74
|
-
{#if subtitle}
|
|
75
|
-
<p class="text-sm text-text-secondary">{subtitle}</p>
|
|
76
|
-
{/if}
|
|
77
|
-
</div>
|
|
78
|
-
{/if}
|
|
79
|
-
</div>
|
|
44
|
+
</a>
|
|
45
|
+
</span>
|
|
46
|
+
{/if}
|
|
47
|
+
</div>
|
|
48
|
+
{/each}
|
|
49
|
+
</nav>
|
|
50
|
+
{/if}
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
export default Breadcrumb;
|
|
2
2
|
type Breadcrumb = SvelteComponent<{
|
|
3
|
-
|
|
4
|
-
className?: string | undefined;
|
|
5
|
-
data?: {
|
|
6
|
-
name: string;
|
|
7
|
-
href: string;
|
|
8
|
-
}[] | undefined;
|
|
9
|
-
showHomeIcon?: boolean | undefined;
|
|
10
|
-
subtitle?: string | undefined;
|
|
3
|
+
data?: any[] | undefined;
|
|
11
4
|
}, {
|
|
12
5
|
click: CustomEvent<any>;
|
|
13
6
|
} & {
|
|
@@ -16,14 +9,7 @@ type Breadcrumb = SvelteComponent<{
|
|
|
16
9
|
$$bindings?: string | undefined;
|
|
17
10
|
};
|
|
18
11
|
declare const Breadcrumb: $$__sveltets_2_IsomorphicComponent<{
|
|
19
|
-
|
|
20
|
-
className?: string | undefined;
|
|
21
|
-
data?: {
|
|
22
|
-
name: string;
|
|
23
|
-
href: string;
|
|
24
|
-
}[] | undefined;
|
|
25
|
-
showHomeIcon?: boolean | undefined;
|
|
26
|
-
subtitle?: string | undefined;
|
|
12
|
+
data?: any[] | undefined;
|
|
27
13
|
}, {
|
|
28
14
|
click: CustomEvent<any>;
|
|
29
15
|
} & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumb.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Breadcrumb/Breadcrumb.svelte.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Breadcrumb.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Breadcrumb/Breadcrumb.svelte.js"],"names":[],"mappings":";;;;;;;;;;AAwDA;;;;;;mBAAgI;6CATnF,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 @@
|
|
|
1
|
+
{"version":3,"file":"Calendar.spec.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Calendar/Calendar.spec.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
|
2
|
+
import { render, screen } from '@testing-library/svelte';
|
|
3
|
+
|
|
4
|
+
// Mock FullCalendar since it's complex and requires DOM
|
|
5
|
+
vi.mock('@fullcalendar/core', () => ({
|
|
6
|
+
Calendar: vi.fn().mockImplementation(() => ({
|
|
7
|
+
render: vi.fn(),
|
|
8
|
+
destroy: vi.fn(),
|
|
9
|
+
next: vi.fn(),
|
|
10
|
+
prev: vi.fn(),
|
|
11
|
+
today: vi.fn(),
|
|
12
|
+
getDate: vi.fn(() => new Date()),
|
|
13
|
+
changeView: vi.fn(),
|
|
14
|
+
})),
|
|
15
|
+
}));
|
|
16
|
+
|
|
17
|
+
vi.mock('@fullcalendar/daygrid', () => ({
|
|
18
|
+
default: {},
|
|
19
|
+
}));
|
|
20
|
+
|
|
21
|
+
vi.mock('@fullcalendar/interaction', () => ({
|
|
22
|
+
default: {},
|
|
23
|
+
}));
|
|
24
|
+
|
|
25
|
+
vi.mock('$app/environment', () => ({
|
|
26
|
+
browser: true,
|
|
27
|
+
}));
|
|
28
|
+
|
|
29
|
+
// Import after mocks
|
|
30
|
+
import Calendar from './Calendar.svelte';
|
|
31
|
+
|
|
32
|
+
describe('Calendar', () => {
|
|
33
|
+
describe('basic rendering', () => {
|
|
34
|
+
it('renders calendar container', () => {
|
|
35
|
+
const { container } = render(Calendar);
|
|
36
|
+
expect(container.querySelector('.calendar-wrapper')).toBeTruthy();
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('renders with default variant availability', () => {
|
|
40
|
+
const { container } = render(Calendar);
|
|
41
|
+
expect(container.querySelector('.calendar-wrapper')).toBeTruthy();
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
describe('props', () => {
|
|
46
|
+
it('accepts variant prop', () => {
|
|
47
|
+
const { container } = render(Calendar, { variant: 'scheduler' });
|
|
48
|
+
expect(container.querySelector('.calendar-wrapper')).toBeTruthy();
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('accepts view prop', () => {
|
|
52
|
+
const { container } = render(Calendar, { view: 'dayGridMonth' });
|
|
53
|
+
expect(container.querySelector('.calendar-wrapper')).toBeTruthy();
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it('accepts events prop', () => {
|
|
57
|
+
const events = [
|
|
58
|
+
{ title: 'Event 1', start: '2025-01-01' },
|
|
59
|
+
{ title: 'Event 2', start: '2025-01-02' },
|
|
60
|
+
];
|
|
61
|
+
const { container } = render(Calendar, { events });
|
|
62
|
+
expect(container.querySelector('.calendar-wrapper')).toBeTruthy();
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it('accepts selectedDates prop', () => {
|
|
66
|
+
const selectedDates = ['2025-01-01', '2025-01-02'];
|
|
67
|
+
const { container } = render(Calendar, { selectedDates });
|
|
68
|
+
expect(container.querySelector('.calendar-wrapper')).toBeTruthy();
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it('accepts compact prop', () => {
|
|
72
|
+
const { container } = render(Calendar, { compact: true });
|
|
73
|
+
// Component renders with compact mode - verify container exists
|
|
74
|
+
expect(container.querySelector('.calendar-wrapper')).toBeTruthy();
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it('accepts readOnly prop', () => {
|
|
78
|
+
const { container } = render(Calendar, { readOnly: true });
|
|
79
|
+
expect(container.querySelector('.calendar-wrapper')).toBeTruthy();
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
it('accepts showNavigation prop', () => {
|
|
83
|
+
const { container } = render(Calendar, { showNavigation: false });
|
|
84
|
+
expect(container.querySelector('.calendar-wrapper')).toBeTruthy();
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it('accepts showLegend prop', () => {
|
|
88
|
+
const { container } = render(Calendar, { showLegend: false });
|
|
89
|
+
expect(container.querySelector('.calendar-wrapper')).toBeTruthy();
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
describe('variant styles', () => {
|
|
94
|
+
it('renders availability variant', () => {
|
|
95
|
+
const { container } = render(Calendar, { variant: 'availability' });
|
|
96
|
+
expect(container.querySelector('.calendar-wrapper')).toBeTruthy();
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
it('renders scheduler variant', () => {
|
|
100
|
+
const { container } = render(Calendar, { variant: 'scheduler' });
|
|
101
|
+
expect(container.querySelector('.calendar-wrapper')).toBeTruthy();
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it('renders display variant', () => {
|
|
105
|
+
const { container } = render(Calendar, { variant: 'display' });
|
|
106
|
+
expect(container.querySelector('.calendar-wrapper')).toBeTruthy();
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
it('renders public variant', () => {
|
|
110
|
+
const { container } = render(Calendar, { variant: 'public' });
|
|
111
|
+
expect(container.querySelector('.calendar-wrapper')).toBeTruthy();
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
describe('saveStatus states', () => {
|
|
116
|
+
it('handles saving status', () => {
|
|
117
|
+
const { container } = render(Calendar, { saveStatus: 'saving' });
|
|
118
|
+
expect(container.querySelector('.calendar-wrapper')).toBeTruthy();
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
it('handles saved status', () => {
|
|
122
|
+
const { container } = render(Calendar, { saveStatus: 'saved' });
|
|
123
|
+
expect(container.querySelector('.calendar-wrapper')).toBeTruthy();
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
it('handles empty status', () => {
|
|
127
|
+
const { container } = render(Calendar, { saveStatus: '' });
|
|
128
|
+
expect(container.querySelector('.calendar-wrapper')).toBeTruthy();
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
});
|