@getmicdrop/svelte-components 5.10.0 → 5.10.3
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/calendar/AboutShow/AboutShow.svelte +172 -172
- package/dist/calendar/Calendar/MiniMonthCalendar.svelte +782 -782
- package/dist/calendar/FAQs/FAQs.svelte +75 -75
- package/dist/calendar/MonthSwitcher/MonthSwitcher.svelte +126 -126
- package/dist/calendar/OrderSummary/OrderSummary.svelte +367 -367
- package/dist/calendar/PublicCard/PublicCard.svelte +146 -146
- package/dist/calendar/ShowCard/ShowCard.svelte +157 -157
- package/dist/calendar/ShowTimeCard/ShowTimeCard.svelte +61 -61
- package/dist/components/Heading.svelte +60 -60
- package/dist/components/Layout/AppShell.svelte +104 -104
- package/dist/components/Layout/ContentSection.svelte +80 -80
- package/dist/components/Layout/Grid.svelte +4 -4
- package/dist/components/Layout/Heading.svelte +81 -81
- package/dist/components/Layout/PageContainer.svelte +69 -69
- package/dist/components/Layout/Responsive.svelte +75 -75
- package/dist/components/Layout/Section.svelte +80 -80
- package/dist/components/Layout/ShowOnDesktop.svelte +37 -37
- package/dist/components/Layout/ShowOnMobile.svelte +37 -37
- package/dist/components/Layout/Sidebar.svelte +108 -108
- package/dist/components/Layout/Stack.spec.js +1 -1
- package/dist/components/Layout/Stack.svelte +6 -6
- package/dist/components/Layout/Text.svelte +87 -87
- package/dist/components/Layout/TwoColumn.svelte +108 -108
- package/dist/components/Text.svelte +53 -53
- package/dist/constants/validation.js +91 -91
- package/dist/constants/validation.spec.js +64 -64
- package/dist/datetime/__tests__/format.test.js +1 -1
- package/dist/datetime/__tests__/parse.test.js +1 -1
- package/dist/datetime/__tests__/timezone.test.js +1 -1
- package/dist/datetime/parse.js +1 -1
- package/dist/forms/createFormStore.svelte.js +1 -0
- package/dist/index.js +51 -51
- package/dist/patterns/data/DataGrid.svelte +45 -45
- package/dist/patterns/data/DataList.svelte +24 -24
- package/dist/patterns/data/DataTable.svelte +36 -36
- package/dist/patterns/forms/FormActions.spec.js +95 -95
- package/dist/patterns/forms/FormActions.stories.svelte +97 -97
- package/dist/patterns/forms/FormActions.svelte +46 -46
- package/dist/patterns/forms/FormGrid.svelte +33 -33
- package/dist/patterns/forms/FormSection.svelte +32 -32
- package/dist/patterns/forms/FormValidationSummary.stories.svelte +83 -83
- package/dist/patterns/forms/FormValidationSummary.svelte +74 -74
- package/dist/patterns/layout/Sidebar.svelte +39 -39
- package/dist/patterns/layout/index.js +29 -29
- package/dist/patterns/navigation/BottomNav.stories.svelte +117 -117
- package/dist/patterns/navigation/BottomNav.svelte +74 -74
- package/dist/patterns/navigation/Header.stories.svelte +77 -77
- package/dist/patterns/navigation/Header.svelte +255 -255
- package/dist/patterns/page/PageHeader.svelte +18 -18
- package/dist/patterns/page/PageLayout.svelte +40 -40
- package/dist/patterns/page/PageLoader.spec.js +57 -57
- package/dist/patterns/page/PageLoader.stories.svelte +137 -137
- package/dist/patterns/page/PageLoader.svelte +24 -24
- package/dist/patterns/page/SectionHeader.svelte +29 -29
- package/dist/presets/badges.js +112 -112
- package/dist/presets/buttons.js +76 -76
- package/dist/presets/index.js +9 -9
- package/dist/primitives/Accordion/Accordion.stories.svelte +75 -75
- package/dist/primitives/Accordion/Accordion.svelte +42 -42
- package/dist/primitives/Accordion/AccordionItem.svelte +95 -95
- package/dist/primitives/Alert/Alert.spec.js +173 -173
- package/dist/primitives/Alert/Alert.stories.svelte +88 -88
- package/dist/primitives/Alert/Alert.svelte +27 -27
- package/dist/primitives/Avatar/Avatar.stories.svelte +94 -94
- package/dist/primitives/Avatar/Avatar.svelte +66 -66
- package/dist/primitives/Badges/Badge.spec.js +144 -144
- package/dist/primitives/Badges/Badge.stories.svelte +86 -86
- package/dist/primitives/Badges/Badge.svelte +99 -99
- package/dist/primitives/BottomSheet/BottomSheet.spec.js +136 -136
- package/dist/primitives/BottomSheet/BottomSheet.stories.svelte +83 -83
- package/dist/primitives/BottomSheet/BottomSheet.svelte +100 -100
- package/dist/primitives/Breadcrumb/Breadcrumb.spec.js +122 -122
- package/dist/primitives/Breadcrumb/Breadcrumb.stories.svelte +23 -23
- package/dist/primitives/Breadcrumb/Breadcrumb.svelte +98 -98
- package/dist/primitives/Button/Button.spec.js +223 -223
- package/dist/primitives/Button/Button.stories.svelte +76 -76
- package/dist/primitives/Button/Button.svelte +283 -283
- package/dist/primitives/Button/ButtonGroup.svelte +50 -50
- package/dist/primitives/Button/ButtonSaveDemo.spec.js +146 -146
- package/dist/primitives/Button/ButtonSaveDemo.svelte +25 -25
- package/dist/primitives/Button/ButtonVariantShowcase.svelte +129 -129
- package/dist/primitives/Card.spec.js +49 -49
- package/dist/primitives/Card.stories.svelte +22 -22
- package/dist/primitives/Card.svelte +28 -28
- package/dist/primitives/Checkbox/Checkbox.stories.svelte +84 -84
- package/dist/primitives/Checkbox/Checkbox.svelte +88 -88
- package/dist/primitives/DarkModeToggle.spec.js +390 -390
- package/dist/primitives/DarkModeToggle.stories.svelte +57 -57
- package/dist/primitives/DarkModeToggle.svelte +136 -136
- package/dist/primitives/Drawer/Drawer.stories.svelte +80 -80
- package/dist/primitives/Drawer/Drawer.svelte +120 -120
- package/dist/primitives/Dropdown/Dropdown.stories.svelte +137 -137
- package/dist/primitives/Dropdown/Dropdown.svelte +170 -170
- package/dist/primitives/Dropdown/DropdownDivider.svelte +9 -9
- package/dist/primitives/Dropdown/DropdownItem.svelte +80 -80
- package/dist/primitives/Helper/Helper.svelte +33 -33
- package/dist/primitives/Icons/ArrowLeft.svelte +8 -8
- package/dist/primitives/Icons/ArrowRight.svelte +8 -8
- package/dist/primitives/Icons/Availability.svelte +14 -14
- package/dist/primitives/Icons/Back.svelte +14 -14
- package/dist/primitives/Icons/CheckCircle.svelte +6 -6
- package/dist/primitives/Icons/CheckCircleOutline.svelte +15 -15
- package/dist/primitives/Icons/ChevronLeft.svelte +4 -4
- package/dist/primitives/Icons/ChevronRight.svelte +4 -4
- package/dist/primitives/Icons/Copy.svelte +15 -15
- package/dist/primitives/Icons/Cross.svelte +5 -5
- package/dist/primitives/Icons/DownArrow.svelte +8 -8
- package/dist/primitives/Icons/ErrorCircle.svelte +6 -6
- package/dist/primitives/Icons/FacebookIcon.svelte +2 -2
- package/dist/primitives/Icons/Home.svelte +15 -15
- package/dist/primitives/Icons/Icon.spec.js +169 -169
- package/dist/primitives/Icons/Icon.stories.svelte +100 -100
- package/dist/primitives/Icons/Icon.svelte +52 -52
- package/dist/primitives/Icons/IconGallery.stories.svelte +235 -235
- package/dist/primitives/Icons/Info.svelte +7 -7
- package/dist/primitives/Icons/InstagramIcon.svelte +4 -4
- package/dist/primitives/Icons/LogoInstagram.svelte +2 -2
- package/dist/primitives/Icons/Message.svelte +15 -15
- package/dist/primitives/Icons/MoonIcon.svelte +5 -5
- package/dist/primitives/Icons/More.svelte +21 -21
- package/dist/primitives/Icons/MoreHori.spec.js +61 -61
- package/dist/primitives/Icons/MoreHori.svelte +22 -22
- package/dist/primitives/Icons/Notification.svelte +14 -14
- package/dist/primitives/Icons/Payment.svelte +14 -14
- package/dist/primitives/Icons/Profile.svelte +21 -21
- package/dist/primitives/Icons/Reload.svelte +29 -29
- package/dist/primitives/Icons/Shows.svelte +21 -21
- package/dist/primitives/Icons/Signout.svelte +21 -21
- package/dist/primitives/Icons/SunIcon.svelte +8 -8
- package/dist/primitives/Icons/TiktokIcon.svelte +2 -2
- package/dist/primitives/Icons/TwitterIcon.svelte +2 -2
- package/dist/primitives/Icons/WarningIcon.spec.js +18 -18
- package/dist/primitives/Icons/WarningIcon.svelte +5 -5
- package/dist/primitives/Input/Input.spec.js +573 -573
- package/dist/primitives/Input/Input.stories.svelte +139 -139
- package/dist/primitives/Input/Input.svelte +423 -423
- package/dist/primitives/Input/Select.spec.js +218 -218
- package/dist/primitives/Input/Select.stories.svelte +112 -112
- package/dist/primitives/Input/Select.svelte +252 -252
- package/dist/primitives/Input/Textarea.stories.svelte +137 -137
- package/dist/primitives/Input/Textarea.svelte +105 -105
- package/dist/primitives/Label/Label.svelte +37 -37
- package/dist/primitives/Modal/Modal.spec.js +99 -99
- package/dist/primitives/Modal/Modal.stories.svelte +86 -86
- package/dist/primitives/Modal/Modal.svelte +157 -157
- package/dist/primitives/Pagination/Pagination.stories.svelte +76 -76
- package/dist/primitives/Pagination/Pagination.svelte +261 -261
- package/dist/primitives/Radio/Radio.stories.svelte +80 -80
- package/dist/primitives/Radio/Radio.svelte +67 -67
- package/dist/primitives/Skeleton/CardPlaceholder.svelte +87 -87
- package/dist/primitives/Skeleton/ImagePlaceholder.svelte +59 -59
- package/dist/primitives/Skeleton/ListPlaceholder.svelte +76 -76
- package/dist/primitives/Skeleton/Skeleton.stories.svelte +151 -151
- package/dist/primitives/Skeleton/Skeleton.svelte +26 -26
- package/dist/primitives/Spinner/Spinner.spec.js +71 -71
- package/dist/primitives/Spinner/Spinner.stories.svelte +29 -29
- package/dist/primitives/Spinner/Spinner.svelte +20 -20
- package/dist/primitives/Tabs/TabItem.svelte +49 -49
- package/dist/primitives/Tabs/Tabs.stories.svelte +112 -112
- package/dist/primitives/Tabs/Tabs.svelte +137 -137
- package/dist/primitives/Toggle.spec.js +146 -146
- package/dist/primitives/Toggle.stories.svelte +92 -92
- package/dist/primitives/Toggle.svelte +131 -132
- package/dist/primitives/Tooltip/Tooltip.svelte +83 -83
- package/dist/primitives/Typography/Typography.svelte +53 -53
- package/dist/primitives/ValidationError.spec.js +103 -103
- package/dist/primitives/ValidationError.stories.svelte +69 -69
- package/dist/primitives/ValidationError.svelte +29 -29
- package/dist/primitives/index.js +92 -92
- package/dist/recipes/CropImage/CropImage.spec.js +208 -208
- package/dist/recipes/CropImage/CropImage.stories.svelte +104 -104
- package/dist/recipes/CropImage/CropImage.svelte +219 -219
- package/dist/recipes/ImageUploader/ImageUploader.stories.svelte +125 -125
- package/dist/recipes/ImageUploader/ImageUploader.svelte +970 -970
- package/dist/recipes/Toaster/Toaster.stories.svelte +62 -62
- package/dist/recipes/feedback/EmptyState/EmptyState.svelte +1 -1
- package/dist/recipes/feedback/ErrorDisplay.spec.js +69 -69
- package/dist/recipes/feedback/ErrorDisplay.stories.svelte +101 -101
- package/dist/recipes/feedback/ErrorDisplay.svelte +1 -1
- package/dist/recipes/feedback/StatusIndicator/StatusIndicator.spec.js +133 -133
- package/dist/recipes/feedback/StatusIndicator/StatusIndicator.svelte +157 -157
- package/dist/recipes/fields/CheckboxField.svelte +85 -85
- package/dist/recipes/fields/FormField.svelte +58 -58
- package/dist/recipes/fields/RadioGroup.svelte +95 -95
- package/dist/recipes/fields/SelectField.svelte +80 -80
- package/dist/recipes/fields/TextareaField.svelte +97 -97
- package/dist/recipes/fields/ToggleField.svelte +60 -60
- package/dist/recipes/fields/index.js +7 -7
- package/dist/recipes/inputs/MultiSelect.spec.js +260 -260
- package/dist/recipes/inputs/MultiSelect.stories.svelte +133 -133
- package/dist/recipes/inputs/MultiSelect.svelte +283 -283
- package/dist/recipes/inputs/OTPInput.spec.js +251 -251
- package/dist/recipes/inputs/OTPInput.stories.svelte +162 -162
- package/dist/recipes/inputs/OTPInput.svelte +117 -117
- package/dist/recipes/inputs/PasswordInput.svelte +22 -22
- package/dist/recipes/inputs/PasswordStrengthIndicator/PasswordStrengthIndicator.svelte +131 -117
- package/dist/recipes/inputs/PasswordStrengthIndicator/PasswordStrengthIndicator.svelte.d.ts.map +1 -1
- package/dist/recipes/inputs/PlaceAutocomplete/PlaceAutocomplete.stories.svelte +123 -123
- package/dist/recipes/inputs/PlaceAutocomplete/PlaceAutocomplete.svelte +344 -344
- package/dist/recipes/inputs/Search.svelte +102 -102
- package/dist/recipes/inputs/SelectDropdown.svelte +171 -171
- package/dist/recipes/modals/AlertModal.svelte +130 -130
- package/dist/recipes/modals/ConfirmationModal.spec.js +206 -206
- package/dist/recipes/modals/ConfirmationModal.stories.svelte +119 -119
- package/dist/recipes/modals/ConfirmationModal.svelte +152 -152
- package/dist/recipes/modals/InputModal.svelte +182 -182
- package/dist/recipes/modals/ModalStateManager.spec.js +100 -100
- package/dist/recipes/modals/ModalStateManager.svelte +77 -77
- package/dist/recipes/modals/ModalTestWrapper.svelte +65 -65
- package/dist/recipes/modals/StatusModal.svelte +206 -206
- package/dist/services/EventService.js +75 -75
- package/dist/services/EventService.spec.js +217 -217
- package/dist/services/ShowService.spec.js +345 -345
- package/dist/stores/toaster.js +13 -13
- package/dist/stories/ButtonAuditReview.stories.svelte +14 -14
- package/dist/stories/ButtonAuditReview.svelte +427 -427
- package/dist/stories/PatternsGallery.stories.svelte +19 -19
- package/dist/stories/PatternsGallery.svelte +206 -206
- package/dist/stories/PrimitivesGallery.stories.svelte +19 -19
- package/dist/stories/PrimitivesGallery.svelte +752 -752
- package/dist/stories/RecipesGallery.stories.svelte +19 -19
- package/dist/stories/RecipesGallery.svelte +471 -471
- package/dist/stories/button-audit-manifest.json +11186 -11186
- package/dist/tailwind/preset.cjs +82 -82
- package/dist/telemetry.js +405 -405
- package/dist/telemetry.spec.js +1169 -1169
- package/dist/tokens/tokens.css +87 -87
- package/dist/tokens/typography-base.css +163 -163
- package/dist/tokens/utilities.css +353 -353
- package/dist/utils/apiConfig.spec.js +219 -219
- package/dist/utils/transitions.js +4 -4
- package/dist/utils/utils.js +693 -693
- package/package.json +297 -297
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { page } from '../../__LIB_STORES__.js';
|
|
3
|
-
import { base } from '../../__LIB_PATHS__.js';
|
|
4
|
-
import { browser } from '../../__LIB_ENVIRONMENT__.js';
|
|
5
|
-
import { onMount } from "svelte";
|
|
6
|
-
import Icon from "../../primitives/Icons/Icon.svelte";
|
|
7
|
-
import { typography } from '../../tokens/typography';
|
|
8
|
-
|
|
9
|
-
interface NavLink {
|
|
10
|
-
label: string;
|
|
11
|
-
href: string;
|
|
12
|
-
icon: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
interface Props {
|
|
16
|
-
links?: NavLink[];
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
let {
|
|
20
|
-
links = [],
|
|
21
|
-
}: Props = $props();
|
|
22
|
-
|
|
23
|
-
let invitationCount = $state(0);
|
|
24
|
-
|
|
25
|
-
let currentPath = $derived($page.url.pathname);
|
|
26
|
-
|
|
27
|
-
function isActive(href: string, path: string): boolean {
|
|
28
|
-
if (href === `${base}/` || href === '/') {
|
|
29
|
-
return path === href || path === `${base}/`;
|
|
30
|
-
}
|
|
31
|
-
return path.startsWith(href);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
onMount(() => {
|
|
35
|
-
async function fetchShows() {
|
|
36
|
-
try {
|
|
37
|
-
const res = await fetch(`/api/getEventsForVenue`);
|
|
38
|
-
if (!res.ok) {
|
|
39
|
-
// Silently ignore auth errors - user may not be logged in yet
|
|
40
|
-
if (res.status === 401) return;
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
const events = await res.json();
|
|
44
|
-
invitationCount = events.filter((event: { acceptedState: number }) => event.acceptedState === 0).length;
|
|
45
|
-
} catch (err) {
|
|
46
|
-
// Silently fail - this is non-critical UI enhancement
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
if (browser) {
|
|
51
|
-
fetchShows();
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
</script>
|
|
55
|
-
|
|
56
|
-
{#each links as { label, href, icon }}
|
|
57
|
-
<a
|
|
58
|
-
{href}
|
|
59
|
-
class={`bottom-nav-item flex-1 flex items-center justify-center py-3 px-2 no-underline bg-transparent border-none cursor-pointer min-w-0
|
|
60
|
-
${typography.textMuted} transition-colors duration-150
|
|
61
|
-
hover:text-gray-900 hover:no-underline dark:hover:text-white
|
|
62
|
-
select-none touch-manipulation
|
|
63
|
-
${isActive(href, currentPath) ? 'active text-blue-700 dark:text-blue-500' : ''}`}
|
|
64
|
-
aria-label={label}
|
|
65
|
-
style="-webkit-tap-highlight-color: transparent; -webkit-touch-callout: none;"
|
|
66
|
-
>
|
|
67
|
-
<span class="bottom-nav-icon relative flex items-center justify-center transition-transform duration-150 active:scale-[0.8]">
|
|
68
|
-
<Icon name={icon} size="24" />
|
|
69
|
-
{#if label === "Shows" && invitationCount > 0}
|
|
70
|
-
<span class="notification-dot absolute -top-1 -right-1 w-2 h-2 bg-red-500 rounded-full"></span>
|
|
71
|
-
{/if}
|
|
72
|
-
</span>
|
|
73
|
-
</a>
|
|
74
|
-
{/each}
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { page } from '../../__LIB_STORES__.js';
|
|
3
|
+
import { base } from '../../__LIB_PATHS__.js';
|
|
4
|
+
import { browser } from '../../__LIB_ENVIRONMENT__.js';
|
|
5
|
+
import { onMount } from "svelte";
|
|
6
|
+
import Icon from "../../primitives/Icons/Icon.svelte";
|
|
7
|
+
import { typography } from '../../tokens/typography';
|
|
8
|
+
|
|
9
|
+
interface NavLink {
|
|
10
|
+
label: string;
|
|
11
|
+
href: string;
|
|
12
|
+
icon: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
interface Props {
|
|
16
|
+
links?: NavLink[];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
let {
|
|
20
|
+
links = [],
|
|
21
|
+
}: Props = $props();
|
|
22
|
+
|
|
23
|
+
let invitationCount = $state(0);
|
|
24
|
+
|
|
25
|
+
let currentPath = $derived($page.url.pathname);
|
|
26
|
+
|
|
27
|
+
function isActive(href: string, path: string): boolean {
|
|
28
|
+
if (href === `${base}/` || href === '/') {
|
|
29
|
+
return path === href || path === `${base}/`;
|
|
30
|
+
}
|
|
31
|
+
return path.startsWith(href);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
onMount(() => {
|
|
35
|
+
async function fetchShows() {
|
|
36
|
+
try {
|
|
37
|
+
const res = await fetch(`/api/getEventsForVenue`);
|
|
38
|
+
if (!res.ok) {
|
|
39
|
+
// Silently ignore auth errors - user may not be logged in yet
|
|
40
|
+
if (res.status === 401) return;
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const events = await res.json();
|
|
44
|
+
invitationCount = events.filter((event: { acceptedState: number }) => event.acceptedState === 0).length;
|
|
45
|
+
} catch (err) {
|
|
46
|
+
// Silently fail - this is non-critical UI enhancement
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (browser) {
|
|
51
|
+
fetchShows();
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
{#each links as { label, href, icon }}
|
|
57
|
+
<a
|
|
58
|
+
{href}
|
|
59
|
+
class={`bottom-nav-item flex-1 flex items-center justify-center py-3 px-2 no-underline bg-transparent border-none cursor-pointer min-w-0
|
|
60
|
+
${typography.textMuted} transition-colors duration-150
|
|
61
|
+
hover:text-gray-900 hover:no-underline dark:hover:text-white
|
|
62
|
+
select-none touch-manipulation
|
|
63
|
+
${isActive(href, currentPath) ? 'active text-blue-700 dark:text-blue-500' : ''}`}
|
|
64
|
+
aria-label={label}
|
|
65
|
+
style="-webkit-tap-highlight-color: transparent; -webkit-touch-callout: none;"
|
|
66
|
+
>
|
|
67
|
+
<span class="bottom-nav-icon relative flex items-center justify-center transition-transform duration-150 active:scale-[0.8]">
|
|
68
|
+
<Icon name={icon} size="24" />
|
|
69
|
+
{#if label === "Shows" && invitationCount > 0}
|
|
70
|
+
<span class="notification-dot absolute -top-1 -right-1 w-2 h-2 bg-red-500 rounded-full"></span>
|
|
71
|
+
{/if}
|
|
72
|
+
</span>
|
|
73
|
+
</a>
|
|
74
|
+
{/each}
|
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
<script module>
|
|
2
|
-
import { defineMeta } from "@storybook/addon-svelte-csf";
|
|
3
|
-
|
|
4
|
-
import Header from "./Header.svelte";
|
|
5
|
-
|
|
6
|
-
const { Story } = defineMeta({
|
|
7
|
-
title: "Components/Layout/Header",
|
|
8
|
-
component: Header,
|
|
9
|
-
argTypes: {
|
|
10
|
-
name: { control: "text" },
|
|
11
|
-
email: { control: "text" },
|
|
12
|
-
avatar: { control: "text" },
|
|
13
|
-
signoutHandler: { action: "signout" },
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
function handleSignout() {
|
|
18
|
-
alert("User signed out");
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
</script>
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<Story
|
|
25
|
-
name="Default Header"
|
|
26
|
-
args={{
|
|
27
|
-
name: "John Performer",
|
|
28
|
-
email: "john@example.com",
|
|
29
|
-
avatar: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 150 150'%3E%3Crect width='150' height='150' fill='%236366f1'/%3E%3Ccircle cx='75' cy='55' r='30' fill='%23fff'/%3E%3Cellipse cx='75' cy='130' rx='45' ry='35' fill='%23fff'/%3E%3C/svg%3E?demo=12",
|
|
30
|
-
signoutHandler: handleSignout
|
|
31
|
-
}}
|
|
32
|
-
/>
|
|
33
|
-
|
|
34
|
-
<Story name="With Long Name">
|
|
35
|
-
<Header
|
|
36
|
-
name="Alexander Christopher Wellington"
|
|
37
|
-
email="alexander.wellington@performersportal.com"
|
|
38
|
-
avatar="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 150 150'%3E%3Crect width='150' height='150' fill='%236366f1'/%3E%3Ccircle cx='75' cy='55' r='30' fill='%23fff'/%3E%3Cellipse cx='75' cy='130' rx='45' ry='35' fill='%23fff'/%3E%3C/svg%3E?demo=33"
|
|
39
|
-
signoutHandler={handleSignout}
|
|
40
|
-
/>
|
|
41
|
-
</Story>
|
|
42
|
-
|
|
43
|
-
<Story name="With Short Name">
|
|
44
|
-
<Header
|
|
45
|
-
name="Jo"
|
|
46
|
-
email="jo@test.com"
|
|
47
|
-
avatar="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 150 150'%3E%3Crect width='150' height='150' fill='%236366f1'/%3E%3Ccircle cx='75' cy='55' r='30' fill='%23fff'/%3E%3Cellipse cx='75' cy='130' rx='45' ry='35' fill='%23fff'/%3E%3C/svg%3E?demo=5"
|
|
48
|
-
signoutHandler={handleSignout}
|
|
49
|
-
/>
|
|
50
|
-
</Story>
|
|
51
|
-
|
|
52
|
-
<Story name="Female Performer">
|
|
53
|
-
<Header
|
|
54
|
-
name="Sarah Johnson"
|
|
55
|
-
email="sarah.johnson@comedy.com"
|
|
56
|
-
avatar="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 150 150'%3E%3Crect width='150' height='150' fill='%236366f1'/%3E%3Ccircle cx='75' cy='55' r='30' fill='%23fff'/%3E%3Cellipse cx='75' cy='130' rx='45' ry='35' fill='%23fff'/%3E%3C/svg%3E?demo=47"
|
|
57
|
-
signoutHandler={handleSignout}
|
|
58
|
-
/>
|
|
59
|
-
</Story>
|
|
60
|
-
|
|
61
|
-
<Story name="Without Email">
|
|
62
|
-
<Header
|
|
63
|
-
name="Anonymous Performer"
|
|
64
|
-
email=""
|
|
65
|
-
avatar="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 150 150'%3E%3Crect width='150' height='150' fill='%236366f1'/%3E%3Ccircle cx='75' cy='55' r='30' fill='%23fff'/%3E%3Cellipse cx='75' cy='130' rx='45' ry='35' fill='%23fff'/%3E%3C/svg%3E?demo=68"
|
|
66
|
-
signoutHandler={handleSignout}
|
|
67
|
-
/>
|
|
68
|
-
</Story>
|
|
69
|
-
|
|
70
|
-
<Story name="With Default Avatar">
|
|
71
|
-
<Header
|
|
72
|
-
name="Default User"
|
|
73
|
-
email="default@performers.com"
|
|
74
|
-
avatar=""
|
|
75
|
-
signoutHandler={handleSignout}
|
|
76
|
-
/>
|
|
77
|
-
</Story>
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from "@storybook/addon-svelte-csf";
|
|
3
|
+
|
|
4
|
+
import Header from "./Header.svelte";
|
|
5
|
+
|
|
6
|
+
const { Story } = defineMeta({
|
|
7
|
+
title: "Components/Layout/Header",
|
|
8
|
+
component: Header,
|
|
9
|
+
argTypes: {
|
|
10
|
+
name: { control: "text" },
|
|
11
|
+
email: { control: "text" },
|
|
12
|
+
avatar: { control: "text" },
|
|
13
|
+
signoutHandler: { action: "signout" },
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
function handleSignout() {
|
|
18
|
+
alert("User signed out");
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
<Story
|
|
25
|
+
name="Default Header"
|
|
26
|
+
args={{
|
|
27
|
+
name: "John Performer",
|
|
28
|
+
email: "john@example.com",
|
|
29
|
+
avatar: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 150 150'%3E%3Crect width='150' height='150' fill='%236366f1'/%3E%3Ccircle cx='75' cy='55' r='30' fill='%23fff'/%3E%3Cellipse cx='75' cy='130' rx='45' ry='35' fill='%23fff'/%3E%3C/svg%3E?demo=12",
|
|
30
|
+
signoutHandler: handleSignout
|
|
31
|
+
}}
|
|
32
|
+
/>
|
|
33
|
+
|
|
34
|
+
<Story name="With Long Name">
|
|
35
|
+
<Header
|
|
36
|
+
name="Alexander Christopher Wellington"
|
|
37
|
+
email="alexander.wellington@performersportal.com"
|
|
38
|
+
avatar="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 150 150'%3E%3Crect width='150' height='150' fill='%236366f1'/%3E%3Ccircle cx='75' cy='55' r='30' fill='%23fff'/%3E%3Cellipse cx='75' cy='130' rx='45' ry='35' fill='%23fff'/%3E%3C/svg%3E?demo=33"
|
|
39
|
+
signoutHandler={handleSignout}
|
|
40
|
+
/>
|
|
41
|
+
</Story>
|
|
42
|
+
|
|
43
|
+
<Story name="With Short Name">
|
|
44
|
+
<Header
|
|
45
|
+
name="Jo"
|
|
46
|
+
email="jo@test.com"
|
|
47
|
+
avatar="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 150 150'%3E%3Crect width='150' height='150' fill='%236366f1'/%3E%3Ccircle cx='75' cy='55' r='30' fill='%23fff'/%3E%3Cellipse cx='75' cy='130' rx='45' ry='35' fill='%23fff'/%3E%3C/svg%3E?demo=5"
|
|
48
|
+
signoutHandler={handleSignout}
|
|
49
|
+
/>
|
|
50
|
+
</Story>
|
|
51
|
+
|
|
52
|
+
<Story name="Female Performer">
|
|
53
|
+
<Header
|
|
54
|
+
name="Sarah Johnson"
|
|
55
|
+
email="sarah.johnson@comedy.com"
|
|
56
|
+
avatar="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 150 150'%3E%3Crect width='150' height='150' fill='%236366f1'/%3E%3Ccircle cx='75' cy='55' r='30' fill='%23fff'/%3E%3Cellipse cx='75' cy='130' rx='45' ry='35' fill='%23fff'/%3E%3C/svg%3E?demo=47"
|
|
57
|
+
signoutHandler={handleSignout}
|
|
58
|
+
/>
|
|
59
|
+
</Story>
|
|
60
|
+
|
|
61
|
+
<Story name="Without Email">
|
|
62
|
+
<Header
|
|
63
|
+
name="Anonymous Performer"
|
|
64
|
+
email=""
|
|
65
|
+
avatar="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 150 150'%3E%3Crect width='150' height='150' fill='%236366f1'/%3E%3Ccircle cx='75' cy='55' r='30' fill='%23fff'/%3E%3Cellipse cx='75' cy='130' rx='45' ry='35' fill='%23fff'/%3E%3C/svg%3E?demo=68"
|
|
66
|
+
signoutHandler={handleSignout}
|
|
67
|
+
/>
|
|
68
|
+
</Story>
|
|
69
|
+
|
|
70
|
+
<Story name="With Default Avatar">
|
|
71
|
+
<Header
|
|
72
|
+
name="Default User"
|
|
73
|
+
email="default@performers.com"
|
|
74
|
+
avatar=""
|
|
75
|
+
signoutHandler={handleSignout}
|
|
76
|
+
/>
|
|
77
|
+
</Story>
|