@getmicdrop/svelte-components 5.3.12 → 5.3.13
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 +145 -145
- package/dist/calendar/ShowCard/ShowCard.svelte +157 -157
- package/dist/calendar/ShowTimeCard/ShowTimeCard.svelte +61 -61
- package/dist/components/Layout/Grid.svelte +109 -109
- package/dist/components/Layout/Section.svelte +80 -80
- package/dist/components/Layout/Sidebar.svelte +108 -108
- package/dist/components/Layout/Stack.svelte +90 -90
- package/dist/constants/formOptions.js +26 -26
- package/dist/constants/validation.js +91 -91
- package/dist/constants/validation.spec.js +64 -64
- package/dist/datetime/__tests__/format.test.d.ts +2 -0
- package/dist/datetime/__tests__/format.test.d.ts.map +1 -0
- package/dist/datetime/__tests__/format.test.js +268 -0
- package/dist/datetime/__tests__/integration.test.d.ts +2 -0
- package/dist/datetime/__tests__/integration.test.d.ts.map +1 -0
- package/dist/datetime/__tests__/integration.test.js +243 -0
- package/dist/datetime/__tests__/parse.test.d.ts +2 -0
- package/dist/datetime/__tests__/parse.test.d.ts.map +1 -0
- package/dist/datetime/__tests__/parse.test.js +261 -0
- package/dist/datetime/__tests__/timezone.test.d.ts +2 -0
- package/dist/datetime/__tests__/timezone.test.d.ts.map +1 -0
- package/dist/datetime/__tests__/timezone.test.js +214 -0
- package/dist/datetime/constants.d.ts +133 -0
- package/dist/datetime/constants.d.ts.map +1 -0
- package/dist/datetime/constants.js +112 -0
- package/dist/datetime/format.d.ts +158 -0
- package/dist/datetime/format.d.ts.map +1 -0
- package/dist/datetime/format.js +315 -0
- package/dist/datetime/index.d.ts +42 -0
- package/dist/datetime/index.d.ts.map +1 -0
- package/dist/datetime/index.js +44 -0
- package/dist/datetime/parse.d.ts +149 -0
- package/dist/datetime/parse.d.ts.map +1 -0
- package/dist/datetime/parse.js +276 -0
- package/dist/datetime/timezone.d.ts +95 -0
- package/dist/datetime/timezone.d.ts.map +1 -0
- package/dist/datetime/timezone.js +241 -0
- package/dist/datetime/types.d.ts +105 -0
- package/dist/datetime/types.d.ts.map +1 -0
- package/dist/datetime/types.js +31 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +232 -218
- package/dist/patterns/data/DataGrid.svelte +45 -45
- package/dist/patterns/data/DataList.svelte +24 -24
- package/dist/patterns/data/DataTable.svelte +40 -40
- package/dist/patterns/forms/FormActions.spec.js +88 -88
- 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.spec.js +203 -203
- package/dist/patterns/forms/FormValidationSummary.stories.svelte +97 -97
- package/dist/patterns/forms/FormValidationSummary.svelte +67 -67
- package/dist/patterns/layout/Grid.svelte +35 -35
- package/dist/patterns/layout/Sidebar.svelte +39 -39
- package/dist/patterns/layout/Stack.svelte +45 -45
- package/dist/patterns/navigation/BottomNav.spec.js +130 -130
- package/dist/patterns/navigation/BottomNav.stories.svelte +117 -117
- package/dist/patterns/navigation/BottomNav.svelte +54 -54
- package/dist/patterns/navigation/Header.spec.js +203 -203
- package/dist/patterns/navigation/Header.stories.svelte +77 -77
- package/dist/patterns/navigation/Header.svelte +240 -240
- package/dist/patterns/page/PageHeader.svelte +36 -36
- package/dist/patterns/page/PageLayout.svelte +40 -40
- package/dist/patterns/page/PageLoader.spec.js +54 -54
- package/dist/patterns/page/PageLoader.stories.svelte +137 -137
- package/dist/patterns/page/PageLoader.svelte +41 -41
- package/dist/patterns/page/SectionHeader.svelte +41 -41
- 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 +61 -61
- package/dist/primitives/Accordion/AccordionItem.svelte +95 -95
- package/dist/primitives/Alert/Alert.spec.js +170 -170
- package/dist/primitives/Alert/Alert.stories.svelte +88 -88
- package/dist/primitives/Alert/Alert.svelte +65 -65
- package/dist/primitives/Avatar/Avatar.stories.svelte +94 -94
- package/dist/primitives/Avatar/Avatar.svelte +66 -66
- package/dist/primitives/Badges/Badge.spec.js +103 -103
- package/dist/primitives/Badges/Badge.stories.svelte +86 -86
- package/dist/primitives/Badges/Badge.svelte +142 -142
- package/dist/primitives/BottomSheet/BottomSheet.spec.js +127 -127
- package/dist/primitives/BottomSheet/BottomSheet.stories.svelte +83 -83
- package/dist/primitives/BottomSheet/BottomSheet.svelte +100 -100
- package/dist/primitives/Breadcrumb/Breadcrumb.spec.js +120 -120
- package/dist/primitives/Breadcrumb/Breadcrumb.stories.svelte +23 -23
- package/dist/primitives/Breadcrumb/Breadcrumb.svelte +89 -89
- package/dist/primitives/Button/Button.spec.js +211 -211
- package/dist/primitives/Button/Button.stories.svelte +76 -76
- package/dist/primitives/Button/Button.svelte +301 -301
- package/dist/primitives/Button/ButtonSaveDemo.spec.js +48 -48
- 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 +357 -357
- package/dist/primitives/DarkModeToggle.stories.svelte +57 -57
- package/dist/primitives/DarkModeToggle.svelte +136 -136
- package/dist/primitives/Drawer/Drawer.stories.svelte +100 -100
- package/dist/primitives/Drawer/Drawer.svelte +214 -214
- package/dist/primitives/Dropdown/Dropdown.stories.svelte +137 -137
- package/dist/primitives/Dropdown/Dropdown.svelte +148 -148
- package/dist/primitives/Dropdown/DropdownItem.svelte +80 -80
- package/dist/primitives/Icons/ArrowLeft.svelte +20 -20
- package/dist/primitives/Icons/ArrowRight.svelte +20 -20
- package/dist/primitives/Icons/Availability.svelte +26 -26
- package/dist/primitives/Icons/Back.svelte +26 -26
- package/dist/primitives/Icons/CheckCircle.svelte +18 -18
- package/dist/primitives/Icons/CheckCircleOutline.svelte +27 -27
- package/dist/primitives/Icons/ChevronLeft.svelte +16 -16
- package/dist/primitives/Icons/ChevronRight.svelte +16 -16
- package/dist/primitives/Icons/Copy.svelte +27 -27
- package/dist/primitives/Icons/Cross.svelte +17 -17
- package/dist/primitives/Icons/DownArrow.svelte +20 -20
- package/dist/primitives/Icons/ErrorCircle.svelte +18 -18
- package/dist/primitives/Icons/FacebookIcon.svelte +13 -13
- package/dist/primitives/Icons/Home.svelte +27 -27
- package/dist/primitives/Icons/Icon.spec.js +175 -175
- package/dist/primitives/Icons/Icon.stories.svelte +100 -100
- package/dist/primitives/Icons/Icon.svelte +63 -63
- package/dist/primitives/Icons/IconGallery.stories.svelte +235 -235
- package/dist/primitives/Icons/ImageOutline.svelte +19 -19
- package/dist/primitives/Icons/Info.svelte +19 -19
- package/dist/primitives/Icons/InstagramIcon.svelte +19 -19
- package/dist/primitives/Icons/LogoInstagram.svelte +15 -15
- package/dist/primitives/Icons/Message.svelte +27 -27
- package/dist/primitives/Icons/MoonIcon.svelte +16 -16
- package/dist/primitives/Icons/More.svelte +33 -33
- package/dist/primitives/Icons/MoreHori.spec.js +67 -67
- package/dist/primitives/Icons/MoreHori.svelte +34 -34
- package/dist/primitives/Icons/Notification.svelte +26 -26
- package/dist/primitives/Icons/Payment.svelte +26 -26
- package/dist/primitives/Icons/Profile.svelte +33 -33
- package/dist/primitives/Icons/Reload.svelte +41 -41
- package/dist/primitives/Icons/Shows.svelte +33 -33
- package/dist/primitives/Icons/Signout.svelte +33 -33
- package/dist/primitives/Icons/SunIcon.svelte +19 -19
- package/dist/primitives/Icons/TiktokIcon.svelte +13 -13
- package/dist/primitives/Icons/TrashBinOutline.svelte +19 -19
- package/dist/primitives/Icons/TwitterIcon.svelte +13 -13
- package/dist/primitives/Icons/WarningIcon.spec.js +30 -30
- package/dist/primitives/Icons/WarningIcon.svelte +24 -24
- package/dist/primitives/Input/Input.spec.js +573 -573
- package/dist/primitives/Input/Input.stories.svelte +139 -139
- package/dist/primitives/Input/Input.svelte +444 -444
- package/dist/primitives/Input/Select.spec.js +218 -218
- package/dist/primitives/Input/Select.stories.svelte +112 -112
- package/dist/primitives/Input/Select.svelte +232 -232
- package/dist/primitives/Input/Textarea.stories.svelte +137 -137
- package/dist/primitives/Input/Textarea.svelte +79 -79
- package/dist/primitives/Label/Label.svelte +37 -37
- package/dist/primitives/Modal/Modal.spec.js +95 -95
- package/dist/primitives/Modal/Modal.stories.svelte +86 -86
- package/dist/primitives/Modal/Modal.svelte +158 -158
- 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 +52 -52
- package/dist/primitives/Spinner/Spinner.spec.js +75 -75
- package/dist/primitives/Spinner/Spinner.stories.svelte +29 -29
- package/dist/primitives/Spinner/Spinner.svelte +57 -57
- package/dist/primitives/Tabs/TabItem.svelte +51 -51
- package/dist/primitives/Tabs/Tabs.stories.svelte +112 -112
- package/dist/primitives/Tabs/Tabs.svelte +128 -128
- package/dist/primitives/Toggle.spec.js +127 -127
- package/dist/primitives/Toggle.stories.svelte +92 -92
- package/dist/primitives/Toggle.svelte +71 -71
- package/dist/primitives/Typography/Typography.svelte +53 -53
- package/dist/primitives/ValidationError.spec.js +103 -103
- package/dist/primitives/ValidationError.stories.svelte +111 -111
- package/dist/primitives/ValidationError.svelte +29 -29
- package/dist/recipes/CropImage/CropImage.spec.js +216 -216
- package/dist/recipes/CropImage/CropImage.stories.svelte +104 -104
- package/dist/recipes/CropImage/CropImage.svelte +238 -238
- package/dist/recipes/ImageUploader/ImageUploader.stories.svelte +125 -125
- package/dist/recipes/ImageUploader/ImageUploader.svelte +980 -980
- package/dist/recipes/Toaster/Toaster.stories.svelte +62 -62
- package/dist/recipes/feedback/EmptyState/EmptyState.svelte +47 -47
- package/dist/recipes/feedback/ErrorDisplay.spec.js +69 -69
- package/dist/recipes/feedback/ErrorDisplay.stories.svelte +112 -112
- package/dist/recipes/feedback/ErrorDisplay.svelte +38 -38
- package/dist/recipes/feedback/StatusIndicator/StatusIndicator.spec.js +129 -129
- package/dist/recipes/feedback/StatusIndicator/StatusIndicator.svelte +167 -167
- 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 +82 -82
- package/dist/recipes/fields/TextareaField.svelte +101 -101
- package/dist/recipes/fields/ToggleField.svelte +60 -60
- package/dist/recipes/fields/index.js +7 -7
- package/dist/recipes/inputs/MultiSelect.spec.js +257 -257
- package/dist/recipes/inputs/MultiSelect.stories.svelte +133 -133
- package/dist/recipes/inputs/MultiSelect.svelte +244 -244
- package/dist/recipes/inputs/OTPInput.spec.js +238 -238
- package/dist/recipes/inputs/OTPInput.stories.svelte +162 -162
- package/dist/recipes/inputs/OTPInput.svelte +102 -102
- package/dist/recipes/inputs/PasswordInput.svelte +100 -100
- package/dist/recipes/inputs/PasswordStrengthIndicator/PasswordStrengthIndicator.spec.js +173 -173
- package/dist/recipes/inputs/PasswordStrengthIndicator/PasswordStrengthIndicator.svelte +108 -108
- package/dist/recipes/inputs/PlaceAutocomplete/PlaceAutocomplete.spec.js +300 -300
- package/dist/recipes/inputs/PlaceAutocomplete/PlaceAutocomplete.stories.svelte +165 -165
- package/dist/recipes/inputs/PlaceAutocomplete/PlaceAutocomplete.svelte +337 -337
- package/dist/recipes/inputs/Search.svelte +85 -85
- package/dist/recipes/inputs/SelectDropdown.svelte +161 -161
- package/dist/recipes/modals/AlertModal.svelte +130 -130
- package/dist/recipes/modals/ConfirmationModal.spec.js +191 -191
- 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 +342 -342
- package/dist/stores/auth.js +93 -6
- package/dist/stores/auth.spec.js +310 -2
- 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 +388 -388
- 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 +441 -441
- package/dist/stories/button-audit-manifest.json +11186 -11186
- package/dist/tailwind/preset.cjs +82 -82
- package/dist/telemetry.js +357 -357
- package/dist/tokens/tokens.css +87 -87
- package/dist/utils/apiConfig.js +49 -49
- package/dist/utils/utils.js +9 -1
- package/package.json +233 -191
|
@@ -1,388 +1,388 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
// ============================================================================
|
|
3
|
-
// PATTERNS VISUAL GALLERY
|
|
4
|
-
// Displays ALL pattern components (Layer 3) - Layout & flow components
|
|
5
|
-
// ============================================================================
|
|
6
|
-
|
|
7
|
-
// Forms
|
|
8
|
-
import FormActions from '../patterns/forms/FormActions.svelte';
|
|
9
|
-
import FormGrid from '../patterns/forms/FormGrid.svelte';
|
|
10
|
-
import FormSection from '../patterns/forms/FormSection.svelte';
|
|
11
|
-
import FormValidationSummary from '../patterns/forms/FormValidationSummary.svelte';
|
|
12
|
-
|
|
13
|
-
// Navigation
|
|
14
|
-
import BottomNav from '../patterns/navigation/BottomNav.svelte';
|
|
15
|
-
import Header from '../patterns/navigation/Header.svelte';
|
|
16
|
-
|
|
17
|
-
// Page
|
|
18
|
-
import PageHeader from '../patterns/page/PageHeader.svelte';
|
|
19
|
-
import PageLayout from '../patterns/page/PageLayout.svelte';
|
|
20
|
-
import PageLoader from '../patterns/page/PageLoader.svelte';
|
|
21
|
-
import SectionHeader from '../patterns/page/SectionHeader.svelte';
|
|
22
|
-
|
|
23
|
-
// Data
|
|
24
|
-
import DataGrid from '../patterns/data/DataGrid.svelte';
|
|
25
|
-
import DataList from '../patterns/data/DataList.svelte';
|
|
26
|
-
import DataTable from '../patterns/data/DataTable.svelte';
|
|
27
|
-
|
|
28
|
-
// Layout
|
|
29
|
-
import Grid from '../patterns/layout/Grid.svelte';
|
|
30
|
-
import Stack from '../patterns/layout/Stack.svelte';
|
|
31
|
-
import Sidebar from '../patterns/layout/Sidebar.svelte';
|
|
32
|
-
|
|
33
|
-
// Primitives for demos
|
|
34
|
-
import Button from '../primitives/Button/Button.svelte';
|
|
35
|
-
import Input from '../primitives/Input/Input.svelte';
|
|
36
|
-
import Card from '../primitives/Card.svelte';
|
|
37
|
-
import Badge from '../primitives/Badges/Badge.svelte';
|
|
38
|
-
|
|
39
|
-
// State
|
|
40
|
-
let isDark = $state(false);
|
|
41
|
-
let showPageLoader = $state(false);
|
|
42
|
-
|
|
43
|
-
function toggleDark() {
|
|
44
|
-
isDark = !isDark;
|
|
45
|
-
document.documentElement.classList.toggle('dark', isDark);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// Section styling
|
|
49
|
-
const sectionClass = (dark: boolean) =>
|
|
50
|
-
`rounded-xl p-6 ${dark ? 'bg-gray-800 border-gray-700' : 'bg-white border-gray-200'} border`;
|
|
51
|
-
|
|
52
|
-
const headingClass = (dark: boolean) =>
|
|
53
|
-
`text-xl font-semibold mb-1 ${dark ? 'text-white' : 'text-gray-900'}`;
|
|
54
|
-
|
|
55
|
-
const subheadingClass = (dark: boolean) =>
|
|
56
|
-
`text-sm mb-4 ${dark ? 'text-gray-400' : 'text-gray-500'}`;
|
|
57
|
-
|
|
58
|
-
// Demo data
|
|
59
|
-
const sampleErrors = [
|
|
60
|
-
{ field: 'email', message: 'Email is required' },
|
|
61
|
-
{ field: 'password', message: 'Password must be at least 8 characters' },
|
|
62
|
-
];
|
|
63
|
-
|
|
64
|
-
const tableData = [
|
|
65
|
-
{ id: 1, name: 'John Doe', email: 'john@example.com', status: 'Active' },
|
|
66
|
-
{ id: 2, name: 'Jane Smith', email: 'jane@example.com', status: 'Pending' },
|
|
67
|
-
{ id: 3, name: 'Bob Wilson', email: 'bob@example.com', status: 'Inactive' },
|
|
68
|
-
];
|
|
69
|
-
|
|
70
|
-
const tableColumns = [
|
|
71
|
-
{ key: 'name', label: 'Name' },
|
|
72
|
-
{ key: 'email', label: 'Email' },
|
|
73
|
-
{ key: 'status', label: 'Status' },
|
|
74
|
-
];
|
|
75
|
-
|
|
76
|
-
const gridItems = [
|
|
77
|
-
{ id: 1, title: 'Item 1', description: 'Description for item 1' },
|
|
78
|
-
{ id: 2, title: 'Item 2', description: 'Description for item 2' },
|
|
79
|
-
{ id: 3, title: 'Item 3', description: 'Description for item 3' },
|
|
80
|
-
{ id: 4, title: 'Item 4', description: 'Description for item 4' },
|
|
81
|
-
{ id: 5, title: 'Item 5', description: 'Description for item 5' },
|
|
82
|
-
{ id: 6, title: 'Item 6', description: 'Description for item 6' },
|
|
83
|
-
];
|
|
84
|
-
|
|
85
|
-
const listItems = [
|
|
86
|
-
{ id: 1, primary: 'Primary text 1', secondary: 'Secondary text' },
|
|
87
|
-
{ id: 2, primary: 'Primary text 2', secondary: 'More details here' },
|
|
88
|
-
{ id: 3, primary: 'Primary text 3', secondary: 'Additional info' },
|
|
89
|
-
];
|
|
90
|
-
|
|
91
|
-
const navItems = [
|
|
92
|
-
{ label: 'Home', href: '/', icon: 'home', active: true },
|
|
93
|
-
{ label: 'Shows', href: '/shows', icon: 'shows' },
|
|
94
|
-
{ label: 'Profile', href: '/profile', icon: 'profile' },
|
|
95
|
-
{ label: 'Settings', href: '/settings', icon: 'settings' },
|
|
96
|
-
];
|
|
97
|
-
</script>
|
|
98
|
-
|
|
99
|
-
<div class="min-h-screen p-6 space-y-8 {isDark ? 'bg-gray-900' : 'bg-gray-50'}">
|
|
100
|
-
<!-- Header -->
|
|
101
|
-
<div class="flex items-center justify-between mb-8">
|
|
102
|
-
<div>
|
|
103
|
-
<h1 class="text-3xl font-bold {isDark ? 'text-white' : 'text-gray-900'}">Patterns Gallery</h1>
|
|
104
|
-
<p class="{isDark ? 'text-gray-400' : 'text-gray-600'}">Layout & flow components (Layer 3)</p>
|
|
105
|
-
</div>
|
|
106
|
-
<button
|
|
107
|
-
onclick={toggleDark}
|
|
108
|
-
class="px-4 py-2 rounded-lg font-medium {isDark ? 'bg-yellow-500 text-black' : 'bg-gray-800 text-white'}"
|
|
109
|
-
>
|
|
110
|
-
{isDark ? '☀️ Light' : '🌙 Dark'}
|
|
111
|
-
</button>
|
|
112
|
-
</div>
|
|
113
|
-
|
|
114
|
-
<!-- ========== PAGE PATTERNS ========== -->
|
|
115
|
-
<section class={sectionClass(isDark)}>
|
|
116
|
-
<h2 class={headingClass(isDark)}>PageHeader</h2>
|
|
117
|
-
<p class={subheadingClass(isDark)}>Page title with optional actions and breadcrumb</p>
|
|
118
|
-
|
|
119
|
-
<div class="space-y-6 border rounded-lg p-4 {isDark ? 'border-gray-700' : 'border-gray-200'}">
|
|
120
|
-
<PageHeader title="Page Title" />
|
|
121
|
-
<hr class="{isDark ? 'border-gray-700' : 'border-gray-200'}" />
|
|
122
|
-
<PageHeader title="With Subtitle" subtitle="This is a subtitle explaining the page" />
|
|
123
|
-
<hr class="{isDark ? 'border-gray-700' : 'border-gray-200'}" />
|
|
124
|
-
<PageHeader title="With Actions">
|
|
125
|
-
{#snippet actions()}
|
|
126
|
-
<Button size="sm">Add New</Button>
|
|
127
|
-
{/snippet}
|
|
128
|
-
</PageHeader>
|
|
129
|
-
</div>
|
|
130
|
-
</section>
|
|
131
|
-
|
|
132
|
-
<!-- ========== SECTION HEADER ========== -->
|
|
133
|
-
<section class={sectionClass(isDark)}>
|
|
134
|
-
<h2 class={headingClass(isDark)}>SectionHeader</h2>
|
|
135
|
-
<p class={subheadingClass(isDark)}>Section dividers with optional description</p>
|
|
136
|
-
|
|
137
|
-
<div class="space-y-6">
|
|
138
|
-
<SectionHeader title="Basic Section" />
|
|
139
|
-
<SectionHeader title="With Description" description="Additional context about this section" />
|
|
140
|
-
<SectionHeader title="With Action">
|
|
141
|
-
{#snippet action()}
|
|
142
|
-
<Button variant="link" size="sm">View All</Button>
|
|
143
|
-
{/snippet}
|
|
144
|
-
</SectionHeader>
|
|
145
|
-
</div>
|
|
146
|
-
</section>
|
|
147
|
-
|
|
148
|
-
<!-- ========== PAGE LOADER ========== -->
|
|
149
|
-
<section class={sectionClass(isDark)}>
|
|
150
|
-
<h2 class={headingClass(isDark)}>PageLoader</h2>
|
|
151
|
-
<p class={subheadingClass(isDark)}>Full-page loading indicator</p>
|
|
152
|
-
|
|
153
|
-
<Button onclick={() => {
|
|
154
|
-
showPageLoader = true;
|
|
155
|
-
setTimeout(() => showPageLoader = false, 2000);
|
|
156
|
-
}}>
|
|
157
|
-
Show PageLoader (2s)
|
|
158
|
-
</Button>
|
|
159
|
-
</section>
|
|
160
|
-
|
|
161
|
-
{#if showPageLoader}
|
|
162
|
-
<PageLoader />
|
|
163
|
-
{/if}
|
|
164
|
-
|
|
165
|
-
<!-- ========== FORM PATTERNS ========== -->
|
|
166
|
-
<section class={sectionClass(isDark)}>
|
|
167
|
-
<h2 class={headingClass(isDark)}>FormSection</h2>
|
|
168
|
-
<p class={subheadingClass(isDark)}>Grouped form fields with title and description</p>
|
|
169
|
-
|
|
170
|
-
<FormSection title="Personal Information" description="Enter your personal details">
|
|
171
|
-
<div class="space-y-4">
|
|
172
|
-
<Input label="Full Name" placeholder="John Doe" />
|
|
173
|
-
<Input label="Email" type="email" placeholder="john@example.com" />
|
|
174
|
-
</div>
|
|
175
|
-
</FormSection>
|
|
176
|
-
</section>
|
|
177
|
-
|
|
178
|
-
<!-- ========== FORM GRID ========== -->
|
|
179
|
-
<section class={sectionClass(isDark)}>
|
|
180
|
-
<h2 class={headingClass(isDark)}>FormGrid</h2>
|
|
181
|
-
<p class={subheadingClass(isDark)}>Responsive grid layout for form fields</p>
|
|
182
|
-
|
|
183
|
-
<FormGrid cols={2}>
|
|
184
|
-
<Input label="First Name" placeholder="John" />
|
|
185
|
-
<Input label="Last Name" placeholder="Doe" />
|
|
186
|
-
<Input label="Email" type="email" placeholder="john@example.com" />
|
|
187
|
-
<Input label="Phone" type="tel" placeholder="(555) 123-4567" />
|
|
188
|
-
</FormGrid>
|
|
189
|
-
|
|
190
|
-
<div class="mt-6">
|
|
191
|
-
<p class="text-xs {isDark ? 'text-gray-500' : 'text-gray-400'} mb-2">3 Columns</p>
|
|
192
|
-
<FormGrid cols={3}>
|
|
193
|
-
<Input label="City" placeholder="New York" />
|
|
194
|
-
<Input label="State" placeholder="NY" />
|
|
195
|
-
<Input label="Zip" placeholder="10001" />
|
|
196
|
-
</FormGrid>
|
|
197
|
-
</div>
|
|
198
|
-
</section>
|
|
199
|
-
|
|
200
|
-
<!-- ========== FORM ACTIONS ========== -->
|
|
201
|
-
<section class={sectionClass(isDark)}>
|
|
202
|
-
<h2 class={headingClass(isDark)}>FormActions</h2>
|
|
203
|
-
<p class={subheadingClass(isDark)}>Form submit/cancel button group</p>
|
|
204
|
-
|
|
205
|
-
<div class="space-y-6">
|
|
206
|
-
<div>
|
|
207
|
-
<p class="text-xs {isDark ? 'text-gray-500' : 'text-gray-400'} mb-2">Default (right-aligned)</p>
|
|
208
|
-
<FormActions>
|
|
209
|
-
<Button variant="ghost">Cancel</Button>
|
|
210
|
-
<Button>Save Changes</Button>
|
|
211
|
-
</FormActions>
|
|
212
|
-
</div>
|
|
213
|
-
|
|
214
|
-
<div>
|
|
215
|
-
<p class="text-xs {isDark ? 'text-gray-500' : 'text-gray-400'} mb-2">With loading state</p>
|
|
216
|
-
<FormActions>
|
|
217
|
-
<Button variant="ghost" disabled>Cancel</Button>
|
|
218
|
-
<Button loading>Saving...</Button>
|
|
219
|
-
</FormActions>
|
|
220
|
-
</div>
|
|
221
|
-
|
|
222
|
-
<div>
|
|
223
|
-
<p class="text-xs {isDark ? 'text-gray-500' : 'text-gray-400'} mb-2">Delete confirmation</p>
|
|
224
|
-
<FormActions>
|
|
225
|
-
<Button variant="alternative">Cancel</Button>
|
|
226
|
-
<Button variant="red">Delete</Button>
|
|
227
|
-
</FormActions>
|
|
228
|
-
</div>
|
|
229
|
-
</div>
|
|
230
|
-
</section>
|
|
231
|
-
|
|
232
|
-
<!-- ========== FORM VALIDATION SUMMARY ========== -->
|
|
233
|
-
<section class={sectionClass(isDark)}>
|
|
234
|
-
<h2 class={headingClass(isDark)}>FormValidationSummary</h2>
|
|
235
|
-
<p class={subheadingClass(isDark)}>Summary of form validation errors</p>
|
|
236
|
-
|
|
237
|
-
<FormValidationSummary errors={sampleErrors} />
|
|
238
|
-
</section>
|
|
239
|
-
|
|
240
|
-
<!-- ========== DATA TABLE ========== -->
|
|
241
|
-
<section class={sectionClass(isDark)}>
|
|
242
|
-
<h2 class={headingClass(isDark)}>DataTable</h2>
|
|
243
|
-
<p class={subheadingClass(isDark)}>Tabular data display with sorting and actions</p>
|
|
244
|
-
|
|
245
|
-
<DataTable
|
|
246
|
-
columns={tableColumns}
|
|
247
|
-
data={tableData}
|
|
248
|
-
/>
|
|
249
|
-
</section>
|
|
250
|
-
|
|
251
|
-
<!-- ========== DATA LIST ========== -->
|
|
252
|
-
<section class={sectionClass(isDark)}>
|
|
253
|
-
<h2 class={headingClass(isDark)}>DataList</h2>
|
|
254
|
-
<p class={subheadingClass(isDark)}>Vertical list of items with primary/secondary text</p>
|
|
255
|
-
|
|
256
|
-
<div class="max-w-md">
|
|
257
|
-
<DataList items={listItems}>
|
|
258
|
-
{#snippet item(data)}
|
|
259
|
-
<div class="flex justify-between items-center">
|
|
260
|
-
<div>
|
|
261
|
-
<p class="font-medium {isDark ? 'text-white' : 'text-gray-900'}">{data.primary}</p>
|
|
262
|
-
<p class="text-sm {isDark ? 'text-gray-400' : 'text-gray-500'}">{data.secondary}</p>
|
|
263
|
-
</div>
|
|
264
|
-
<Badge color="blue">Active</Badge>
|
|
265
|
-
</div>
|
|
266
|
-
{/snippet}
|
|
267
|
-
</DataList>
|
|
268
|
-
</div>
|
|
269
|
-
</section>
|
|
270
|
-
|
|
271
|
-
<!-- ========== DATA GRID ========== -->
|
|
272
|
-
<section class={sectionClass(isDark)}>
|
|
273
|
-
<h2 class={headingClass(isDark)}>DataGrid</h2>
|
|
274
|
-
<p class={subheadingClass(isDark)}>Responsive grid of cards</p>
|
|
275
|
-
|
|
276
|
-
<DataGrid items={gridItems} cols={3}>
|
|
277
|
-
{#snippet item(data)}
|
|
278
|
-
<Card>
|
|
279
|
-
<h4 class="font-medium mb-1">{data.title}</h4>
|
|
280
|
-
<p class="text-sm text-gray-500">{data.description}</p>
|
|
281
|
-
</Card>
|
|
282
|
-
{/snippet}
|
|
283
|
-
</DataGrid>
|
|
284
|
-
</section>
|
|
285
|
-
|
|
286
|
-
<!-- ========== LAYOUT: STACK ========== -->
|
|
287
|
-
<section class={sectionClass(isDark)}>
|
|
288
|
-
<h2 class={headingClass(isDark)}>Stack</h2>
|
|
289
|
-
<p class={subheadingClass(isDark)}>Vertical spacing utility</p>
|
|
290
|
-
|
|
291
|
-
<div class="max-w-sm">
|
|
292
|
-
<Stack gap="md">
|
|
293
|
-
<Card>Stack Item 1</Card>
|
|
294
|
-
<Card>Stack Item 2</Card>
|
|
295
|
-
<Card>Stack Item 3</Card>
|
|
296
|
-
</Stack>
|
|
297
|
-
</div>
|
|
298
|
-
</section>
|
|
299
|
-
|
|
300
|
-
<!-- ========== LAYOUT: GRID ========== -->
|
|
301
|
-
<section class={sectionClass(isDark)}>
|
|
302
|
-
<h2 class={headingClass(isDark)}>Grid</h2>
|
|
303
|
-
<p class={subheadingClass(isDark)}>Responsive grid layout utility</p>
|
|
304
|
-
|
|
305
|
-
<Grid cols={4} gap="md">
|
|
306
|
-
{#each [1, 2, 3, 4, 5, 6, 7, 8] as i}
|
|
307
|
-
<Card class="text-center py-4">
|
|
308
|
-
<span class="text-2xl font-bold">{i}</span>
|
|
309
|
-
</Card>
|
|
310
|
-
{/each}
|
|
311
|
-
</Grid>
|
|
312
|
-
</section>
|
|
313
|
-
|
|
314
|
-
<!-- ========== LAYOUT: SIDEBAR ========== -->
|
|
315
|
-
<section class={sectionClass(isDark)}>
|
|
316
|
-
<h2 class={headingClass(isDark)}>Sidebar</h2>
|
|
317
|
-
<p class={subheadingClass(isDark)}>Sidebar + main content layout</p>
|
|
318
|
-
|
|
319
|
-
<div class="border rounded-lg overflow-hidden {isDark ? 'border-gray-700' : 'border-gray-200'}">
|
|
320
|
-
<Sidebar>
|
|
321
|
-
{#snippet sidebar()}
|
|
322
|
-
<div class="p-4 {isDark ? 'bg-gray-900' : 'bg-gray-100'} h-48">
|
|
323
|
-
<p class="font-medium mb-4">Navigation</p>
|
|
324
|
-
<ul class="space-y-2 text-sm">
|
|
325
|
-
<li>Dashboard</li>
|
|
326
|
-
<li>Settings</li>
|
|
327
|
-
<li>Profile</li>
|
|
328
|
-
</ul>
|
|
329
|
-
</div>
|
|
330
|
-
{/snippet}
|
|
331
|
-
{#snippet main()}
|
|
332
|
-
<div class="p-4 h-48">
|
|
333
|
-
<p>Main content area</p>
|
|
334
|
-
</div>
|
|
335
|
-
{/snippet}
|
|
336
|
-
</Sidebar>
|
|
337
|
-
</div>
|
|
338
|
-
</section>
|
|
339
|
-
|
|
340
|
-
<!-- ========== NAVIGATION: HEADER ========== -->
|
|
341
|
-
<section class={sectionClass(isDark)}>
|
|
342
|
-
<h2 class={headingClass(isDark)}>Header</h2>
|
|
343
|
-
<p class={subheadingClass(isDark)}>Top navigation bar</p>
|
|
344
|
-
|
|
345
|
-
<div class="border rounded-lg overflow-hidden {isDark ? 'border-gray-700' : 'border-gray-200'}">
|
|
346
|
-
<Header title="App Name">
|
|
347
|
-
{#snippet actions()}
|
|
348
|
-
<Button variant="ghost" size="sm">Settings</Button>
|
|
349
|
-
<Button size="sm">Sign Out</Button>
|
|
350
|
-
{/snippet}
|
|
351
|
-
</Header>
|
|
352
|
-
</div>
|
|
353
|
-
</section>
|
|
354
|
-
|
|
355
|
-
<!-- ========== NAVIGATION: BOTTOM NAV ========== -->
|
|
356
|
-
<section class={sectionClass(isDark)}>
|
|
357
|
-
<h2 class={headingClass(isDark)}>BottomNav</h2>
|
|
358
|
-
<p class={subheadingClass(isDark)}>Mobile bottom navigation</p>
|
|
359
|
-
|
|
360
|
-
<div class="border rounded-lg overflow-hidden max-w-sm mx-auto {isDark ? 'border-gray-700' : 'border-gray-200'}">
|
|
361
|
-
<BottomNav items={navItems} />
|
|
362
|
-
</div>
|
|
363
|
-
</section>
|
|
364
|
-
|
|
365
|
-
<!-- ========== PAGE LAYOUT ========== -->
|
|
366
|
-
<section class={sectionClass(isDark)}>
|
|
367
|
-
<h2 class={headingClass(isDark)}>PageLayout</h2>
|
|
368
|
-
<p class={subheadingClass(isDark)}>Complete page structure with header, content, and optional footer</p>
|
|
369
|
-
|
|
370
|
-
<div class="border rounded-lg overflow-hidden h-64 {isDark ? 'border-gray-700' : 'border-gray-200'}">
|
|
371
|
-
<PageLayout>
|
|
372
|
-
{#snippet header()}
|
|
373
|
-
<Header title="PageLayout Demo" />
|
|
374
|
-
{/snippet}
|
|
375
|
-
{#snippet content()}
|
|
376
|
-
<div class="p-6">
|
|
377
|
-
<p>Main page content goes here. The layout handles spacing and responsive behavior.</p>
|
|
378
|
-
</div>
|
|
379
|
-
{/snippet}
|
|
380
|
-
{#snippet footer()}
|
|
381
|
-
<div class="p-4 text-center text-sm text-gray-500 border-t {isDark ? 'border-gray-700' : 'border-gray-200'}">
|
|
382
|
-
Footer content
|
|
383
|
-
</div>
|
|
384
|
-
{/snippet}
|
|
385
|
-
</PageLayout>
|
|
386
|
-
</div>
|
|
387
|
-
</section>
|
|
388
|
-
</div>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// ============================================================================
|
|
3
|
+
// PATTERNS VISUAL GALLERY
|
|
4
|
+
// Displays ALL pattern components (Layer 3) - Layout & flow components
|
|
5
|
+
// ============================================================================
|
|
6
|
+
|
|
7
|
+
// Forms
|
|
8
|
+
import FormActions from '../patterns/forms/FormActions.svelte';
|
|
9
|
+
import FormGrid from '../patterns/forms/FormGrid.svelte';
|
|
10
|
+
import FormSection from '../patterns/forms/FormSection.svelte';
|
|
11
|
+
import FormValidationSummary from '../patterns/forms/FormValidationSummary.svelte';
|
|
12
|
+
|
|
13
|
+
// Navigation
|
|
14
|
+
import BottomNav from '../patterns/navigation/BottomNav.svelte';
|
|
15
|
+
import Header from '../patterns/navigation/Header.svelte';
|
|
16
|
+
|
|
17
|
+
// Page
|
|
18
|
+
import PageHeader from '../patterns/page/PageHeader.svelte';
|
|
19
|
+
import PageLayout from '../patterns/page/PageLayout.svelte';
|
|
20
|
+
import PageLoader from '../patterns/page/PageLoader.svelte';
|
|
21
|
+
import SectionHeader from '../patterns/page/SectionHeader.svelte';
|
|
22
|
+
|
|
23
|
+
// Data
|
|
24
|
+
import DataGrid from '../patterns/data/DataGrid.svelte';
|
|
25
|
+
import DataList from '../patterns/data/DataList.svelte';
|
|
26
|
+
import DataTable from '../patterns/data/DataTable.svelte';
|
|
27
|
+
|
|
28
|
+
// Layout
|
|
29
|
+
import Grid from '../patterns/layout/Grid.svelte';
|
|
30
|
+
import Stack from '../patterns/layout/Stack.svelte';
|
|
31
|
+
import Sidebar from '../patterns/layout/Sidebar.svelte';
|
|
32
|
+
|
|
33
|
+
// Primitives for demos
|
|
34
|
+
import Button from '../primitives/Button/Button.svelte';
|
|
35
|
+
import Input from '../primitives/Input/Input.svelte';
|
|
36
|
+
import Card from '../primitives/Card.svelte';
|
|
37
|
+
import Badge from '../primitives/Badges/Badge.svelte';
|
|
38
|
+
|
|
39
|
+
// State
|
|
40
|
+
let isDark = $state(false);
|
|
41
|
+
let showPageLoader = $state(false);
|
|
42
|
+
|
|
43
|
+
function toggleDark() {
|
|
44
|
+
isDark = !isDark;
|
|
45
|
+
document.documentElement.classList.toggle('dark', isDark);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Section styling
|
|
49
|
+
const sectionClass = (dark: boolean) =>
|
|
50
|
+
`rounded-xl p-6 ${dark ? 'bg-gray-800 border-gray-700' : 'bg-white border-gray-200'} border`;
|
|
51
|
+
|
|
52
|
+
const headingClass = (dark: boolean) =>
|
|
53
|
+
`text-xl font-semibold mb-1 ${dark ? 'text-white' : 'text-gray-900'}`;
|
|
54
|
+
|
|
55
|
+
const subheadingClass = (dark: boolean) =>
|
|
56
|
+
`text-sm mb-4 ${dark ? 'text-gray-400' : 'text-gray-500'}`;
|
|
57
|
+
|
|
58
|
+
// Demo data
|
|
59
|
+
const sampleErrors = [
|
|
60
|
+
{ field: 'email', message: 'Email is required' },
|
|
61
|
+
{ field: 'password', message: 'Password must be at least 8 characters' },
|
|
62
|
+
];
|
|
63
|
+
|
|
64
|
+
const tableData = [
|
|
65
|
+
{ id: 1, name: 'John Doe', email: 'john@example.com', status: 'Active' },
|
|
66
|
+
{ id: 2, name: 'Jane Smith', email: 'jane@example.com', status: 'Pending' },
|
|
67
|
+
{ id: 3, name: 'Bob Wilson', email: 'bob@example.com', status: 'Inactive' },
|
|
68
|
+
];
|
|
69
|
+
|
|
70
|
+
const tableColumns = [
|
|
71
|
+
{ key: 'name', label: 'Name' },
|
|
72
|
+
{ key: 'email', label: 'Email' },
|
|
73
|
+
{ key: 'status', label: 'Status' },
|
|
74
|
+
];
|
|
75
|
+
|
|
76
|
+
const gridItems = [
|
|
77
|
+
{ id: 1, title: 'Item 1', description: 'Description for item 1' },
|
|
78
|
+
{ id: 2, title: 'Item 2', description: 'Description for item 2' },
|
|
79
|
+
{ id: 3, title: 'Item 3', description: 'Description for item 3' },
|
|
80
|
+
{ id: 4, title: 'Item 4', description: 'Description for item 4' },
|
|
81
|
+
{ id: 5, title: 'Item 5', description: 'Description for item 5' },
|
|
82
|
+
{ id: 6, title: 'Item 6', description: 'Description for item 6' },
|
|
83
|
+
];
|
|
84
|
+
|
|
85
|
+
const listItems = [
|
|
86
|
+
{ id: 1, primary: 'Primary text 1', secondary: 'Secondary text' },
|
|
87
|
+
{ id: 2, primary: 'Primary text 2', secondary: 'More details here' },
|
|
88
|
+
{ id: 3, primary: 'Primary text 3', secondary: 'Additional info' },
|
|
89
|
+
];
|
|
90
|
+
|
|
91
|
+
const navItems = [
|
|
92
|
+
{ label: 'Home', href: '/', icon: 'home', active: true },
|
|
93
|
+
{ label: 'Shows', href: '/shows', icon: 'shows' },
|
|
94
|
+
{ label: 'Profile', href: '/profile', icon: 'profile' },
|
|
95
|
+
{ label: 'Settings', href: '/settings', icon: 'settings' },
|
|
96
|
+
];
|
|
97
|
+
</script>
|
|
98
|
+
|
|
99
|
+
<div class="min-h-screen p-6 space-y-8 {isDark ? 'bg-gray-900' : 'bg-gray-50'}">
|
|
100
|
+
<!-- Header -->
|
|
101
|
+
<div class="flex items-center justify-between mb-8">
|
|
102
|
+
<div>
|
|
103
|
+
<h1 class="text-3xl font-bold {isDark ? 'text-white' : 'text-gray-900'}">Patterns Gallery</h1>
|
|
104
|
+
<p class="{isDark ? 'text-gray-400' : 'text-gray-600'}">Layout & flow components (Layer 3)</p>
|
|
105
|
+
</div>
|
|
106
|
+
<button
|
|
107
|
+
onclick={toggleDark}
|
|
108
|
+
class="px-4 py-2 rounded-lg font-medium {isDark ? 'bg-yellow-500 text-black' : 'bg-gray-800 text-white'}"
|
|
109
|
+
>
|
|
110
|
+
{isDark ? '☀️ Light' : '🌙 Dark'}
|
|
111
|
+
</button>
|
|
112
|
+
</div>
|
|
113
|
+
|
|
114
|
+
<!-- ========== PAGE PATTERNS ========== -->
|
|
115
|
+
<section class={sectionClass(isDark)}>
|
|
116
|
+
<h2 class={headingClass(isDark)}>PageHeader</h2>
|
|
117
|
+
<p class={subheadingClass(isDark)}>Page title with optional actions and breadcrumb</p>
|
|
118
|
+
|
|
119
|
+
<div class="space-y-6 border rounded-lg p-4 {isDark ? 'border-gray-700' : 'border-gray-200'}">
|
|
120
|
+
<PageHeader title="Page Title" />
|
|
121
|
+
<hr class="{isDark ? 'border-gray-700' : 'border-gray-200'}" />
|
|
122
|
+
<PageHeader title="With Subtitle" subtitle="This is a subtitle explaining the page" />
|
|
123
|
+
<hr class="{isDark ? 'border-gray-700' : 'border-gray-200'}" />
|
|
124
|
+
<PageHeader title="With Actions">
|
|
125
|
+
{#snippet actions()}
|
|
126
|
+
<Button size="sm">Add New</Button>
|
|
127
|
+
{/snippet}
|
|
128
|
+
</PageHeader>
|
|
129
|
+
</div>
|
|
130
|
+
</section>
|
|
131
|
+
|
|
132
|
+
<!-- ========== SECTION HEADER ========== -->
|
|
133
|
+
<section class={sectionClass(isDark)}>
|
|
134
|
+
<h2 class={headingClass(isDark)}>SectionHeader</h2>
|
|
135
|
+
<p class={subheadingClass(isDark)}>Section dividers with optional description</p>
|
|
136
|
+
|
|
137
|
+
<div class="space-y-6">
|
|
138
|
+
<SectionHeader title="Basic Section" />
|
|
139
|
+
<SectionHeader title="With Description" description="Additional context about this section" />
|
|
140
|
+
<SectionHeader title="With Action">
|
|
141
|
+
{#snippet action()}
|
|
142
|
+
<Button variant="link" size="sm">View All</Button>
|
|
143
|
+
{/snippet}
|
|
144
|
+
</SectionHeader>
|
|
145
|
+
</div>
|
|
146
|
+
</section>
|
|
147
|
+
|
|
148
|
+
<!-- ========== PAGE LOADER ========== -->
|
|
149
|
+
<section class={sectionClass(isDark)}>
|
|
150
|
+
<h2 class={headingClass(isDark)}>PageLoader</h2>
|
|
151
|
+
<p class={subheadingClass(isDark)}>Full-page loading indicator</p>
|
|
152
|
+
|
|
153
|
+
<Button onclick={() => {
|
|
154
|
+
showPageLoader = true;
|
|
155
|
+
setTimeout(() => showPageLoader = false, 2000);
|
|
156
|
+
}}>
|
|
157
|
+
Show PageLoader (2s)
|
|
158
|
+
</Button>
|
|
159
|
+
</section>
|
|
160
|
+
|
|
161
|
+
{#if showPageLoader}
|
|
162
|
+
<PageLoader />
|
|
163
|
+
{/if}
|
|
164
|
+
|
|
165
|
+
<!-- ========== FORM PATTERNS ========== -->
|
|
166
|
+
<section class={sectionClass(isDark)}>
|
|
167
|
+
<h2 class={headingClass(isDark)}>FormSection</h2>
|
|
168
|
+
<p class={subheadingClass(isDark)}>Grouped form fields with title and description</p>
|
|
169
|
+
|
|
170
|
+
<FormSection title="Personal Information" description="Enter your personal details">
|
|
171
|
+
<div class="space-y-4">
|
|
172
|
+
<Input label="Full Name" placeholder="John Doe" />
|
|
173
|
+
<Input label="Email" type="email" placeholder="john@example.com" />
|
|
174
|
+
</div>
|
|
175
|
+
</FormSection>
|
|
176
|
+
</section>
|
|
177
|
+
|
|
178
|
+
<!-- ========== FORM GRID ========== -->
|
|
179
|
+
<section class={sectionClass(isDark)}>
|
|
180
|
+
<h2 class={headingClass(isDark)}>FormGrid</h2>
|
|
181
|
+
<p class={subheadingClass(isDark)}>Responsive grid layout for form fields</p>
|
|
182
|
+
|
|
183
|
+
<FormGrid cols={2}>
|
|
184
|
+
<Input label="First Name" placeholder="John" />
|
|
185
|
+
<Input label="Last Name" placeholder="Doe" />
|
|
186
|
+
<Input label="Email" type="email" placeholder="john@example.com" />
|
|
187
|
+
<Input label="Phone" type="tel" placeholder="(555) 123-4567" />
|
|
188
|
+
</FormGrid>
|
|
189
|
+
|
|
190
|
+
<div class="mt-6">
|
|
191
|
+
<p class="text-xs {isDark ? 'text-gray-500' : 'text-gray-400'} mb-2">3 Columns</p>
|
|
192
|
+
<FormGrid cols={3}>
|
|
193
|
+
<Input label="City" placeholder="New York" />
|
|
194
|
+
<Input label="State" placeholder="NY" />
|
|
195
|
+
<Input label="Zip" placeholder="10001" />
|
|
196
|
+
</FormGrid>
|
|
197
|
+
</div>
|
|
198
|
+
</section>
|
|
199
|
+
|
|
200
|
+
<!-- ========== FORM ACTIONS ========== -->
|
|
201
|
+
<section class={sectionClass(isDark)}>
|
|
202
|
+
<h2 class={headingClass(isDark)}>FormActions</h2>
|
|
203
|
+
<p class={subheadingClass(isDark)}>Form submit/cancel button group</p>
|
|
204
|
+
|
|
205
|
+
<div class="space-y-6">
|
|
206
|
+
<div>
|
|
207
|
+
<p class="text-xs {isDark ? 'text-gray-500' : 'text-gray-400'} mb-2">Default (right-aligned)</p>
|
|
208
|
+
<FormActions>
|
|
209
|
+
<Button variant="ghost">Cancel</Button>
|
|
210
|
+
<Button>Save Changes</Button>
|
|
211
|
+
</FormActions>
|
|
212
|
+
</div>
|
|
213
|
+
|
|
214
|
+
<div>
|
|
215
|
+
<p class="text-xs {isDark ? 'text-gray-500' : 'text-gray-400'} mb-2">With loading state</p>
|
|
216
|
+
<FormActions>
|
|
217
|
+
<Button variant="ghost" disabled>Cancel</Button>
|
|
218
|
+
<Button loading>Saving...</Button>
|
|
219
|
+
</FormActions>
|
|
220
|
+
</div>
|
|
221
|
+
|
|
222
|
+
<div>
|
|
223
|
+
<p class="text-xs {isDark ? 'text-gray-500' : 'text-gray-400'} mb-2">Delete confirmation</p>
|
|
224
|
+
<FormActions>
|
|
225
|
+
<Button variant="alternative">Cancel</Button>
|
|
226
|
+
<Button variant="red">Delete</Button>
|
|
227
|
+
</FormActions>
|
|
228
|
+
</div>
|
|
229
|
+
</div>
|
|
230
|
+
</section>
|
|
231
|
+
|
|
232
|
+
<!-- ========== FORM VALIDATION SUMMARY ========== -->
|
|
233
|
+
<section class={sectionClass(isDark)}>
|
|
234
|
+
<h2 class={headingClass(isDark)}>FormValidationSummary</h2>
|
|
235
|
+
<p class={subheadingClass(isDark)}>Summary of form validation errors</p>
|
|
236
|
+
|
|
237
|
+
<FormValidationSummary errors={sampleErrors} />
|
|
238
|
+
</section>
|
|
239
|
+
|
|
240
|
+
<!-- ========== DATA TABLE ========== -->
|
|
241
|
+
<section class={sectionClass(isDark)}>
|
|
242
|
+
<h2 class={headingClass(isDark)}>DataTable</h2>
|
|
243
|
+
<p class={subheadingClass(isDark)}>Tabular data display with sorting and actions</p>
|
|
244
|
+
|
|
245
|
+
<DataTable
|
|
246
|
+
columns={tableColumns}
|
|
247
|
+
data={tableData}
|
|
248
|
+
/>
|
|
249
|
+
</section>
|
|
250
|
+
|
|
251
|
+
<!-- ========== DATA LIST ========== -->
|
|
252
|
+
<section class={sectionClass(isDark)}>
|
|
253
|
+
<h2 class={headingClass(isDark)}>DataList</h2>
|
|
254
|
+
<p class={subheadingClass(isDark)}>Vertical list of items with primary/secondary text</p>
|
|
255
|
+
|
|
256
|
+
<div class="max-w-md">
|
|
257
|
+
<DataList items={listItems}>
|
|
258
|
+
{#snippet item(data)}
|
|
259
|
+
<div class="flex justify-between items-center">
|
|
260
|
+
<div>
|
|
261
|
+
<p class="font-medium {isDark ? 'text-white' : 'text-gray-900'}">{data.primary}</p>
|
|
262
|
+
<p class="text-sm {isDark ? 'text-gray-400' : 'text-gray-500'}">{data.secondary}</p>
|
|
263
|
+
</div>
|
|
264
|
+
<Badge color="blue">Active</Badge>
|
|
265
|
+
</div>
|
|
266
|
+
{/snippet}
|
|
267
|
+
</DataList>
|
|
268
|
+
</div>
|
|
269
|
+
</section>
|
|
270
|
+
|
|
271
|
+
<!-- ========== DATA GRID ========== -->
|
|
272
|
+
<section class={sectionClass(isDark)}>
|
|
273
|
+
<h2 class={headingClass(isDark)}>DataGrid</h2>
|
|
274
|
+
<p class={subheadingClass(isDark)}>Responsive grid of cards</p>
|
|
275
|
+
|
|
276
|
+
<DataGrid items={gridItems} cols={3}>
|
|
277
|
+
{#snippet item(data)}
|
|
278
|
+
<Card>
|
|
279
|
+
<h4 class="font-medium mb-1">{data.title}</h4>
|
|
280
|
+
<p class="text-sm text-gray-500">{data.description}</p>
|
|
281
|
+
</Card>
|
|
282
|
+
{/snippet}
|
|
283
|
+
</DataGrid>
|
|
284
|
+
</section>
|
|
285
|
+
|
|
286
|
+
<!-- ========== LAYOUT: STACK ========== -->
|
|
287
|
+
<section class={sectionClass(isDark)}>
|
|
288
|
+
<h2 class={headingClass(isDark)}>Stack</h2>
|
|
289
|
+
<p class={subheadingClass(isDark)}>Vertical spacing utility</p>
|
|
290
|
+
|
|
291
|
+
<div class="max-w-sm">
|
|
292
|
+
<Stack gap="md">
|
|
293
|
+
<Card>Stack Item 1</Card>
|
|
294
|
+
<Card>Stack Item 2</Card>
|
|
295
|
+
<Card>Stack Item 3</Card>
|
|
296
|
+
</Stack>
|
|
297
|
+
</div>
|
|
298
|
+
</section>
|
|
299
|
+
|
|
300
|
+
<!-- ========== LAYOUT: GRID ========== -->
|
|
301
|
+
<section class={sectionClass(isDark)}>
|
|
302
|
+
<h2 class={headingClass(isDark)}>Grid</h2>
|
|
303
|
+
<p class={subheadingClass(isDark)}>Responsive grid layout utility</p>
|
|
304
|
+
|
|
305
|
+
<Grid cols={4} gap="md">
|
|
306
|
+
{#each [1, 2, 3, 4, 5, 6, 7, 8] as i}
|
|
307
|
+
<Card class="text-center py-4">
|
|
308
|
+
<span class="text-2xl font-bold">{i}</span>
|
|
309
|
+
</Card>
|
|
310
|
+
{/each}
|
|
311
|
+
</Grid>
|
|
312
|
+
</section>
|
|
313
|
+
|
|
314
|
+
<!-- ========== LAYOUT: SIDEBAR ========== -->
|
|
315
|
+
<section class={sectionClass(isDark)}>
|
|
316
|
+
<h2 class={headingClass(isDark)}>Sidebar</h2>
|
|
317
|
+
<p class={subheadingClass(isDark)}>Sidebar + main content layout</p>
|
|
318
|
+
|
|
319
|
+
<div class="border rounded-lg overflow-hidden {isDark ? 'border-gray-700' : 'border-gray-200'}">
|
|
320
|
+
<Sidebar>
|
|
321
|
+
{#snippet sidebar()}
|
|
322
|
+
<div class="p-4 {isDark ? 'bg-gray-900' : 'bg-gray-100'} h-48">
|
|
323
|
+
<p class="font-medium mb-4">Navigation</p>
|
|
324
|
+
<ul class="space-y-2 text-sm">
|
|
325
|
+
<li>Dashboard</li>
|
|
326
|
+
<li>Settings</li>
|
|
327
|
+
<li>Profile</li>
|
|
328
|
+
</ul>
|
|
329
|
+
</div>
|
|
330
|
+
{/snippet}
|
|
331
|
+
{#snippet main()}
|
|
332
|
+
<div class="p-4 h-48">
|
|
333
|
+
<p>Main content area</p>
|
|
334
|
+
</div>
|
|
335
|
+
{/snippet}
|
|
336
|
+
</Sidebar>
|
|
337
|
+
</div>
|
|
338
|
+
</section>
|
|
339
|
+
|
|
340
|
+
<!-- ========== NAVIGATION: HEADER ========== -->
|
|
341
|
+
<section class={sectionClass(isDark)}>
|
|
342
|
+
<h2 class={headingClass(isDark)}>Header</h2>
|
|
343
|
+
<p class={subheadingClass(isDark)}>Top navigation bar</p>
|
|
344
|
+
|
|
345
|
+
<div class="border rounded-lg overflow-hidden {isDark ? 'border-gray-700' : 'border-gray-200'}">
|
|
346
|
+
<Header title="App Name">
|
|
347
|
+
{#snippet actions()}
|
|
348
|
+
<Button variant="ghost" size="sm">Settings</Button>
|
|
349
|
+
<Button size="sm">Sign Out</Button>
|
|
350
|
+
{/snippet}
|
|
351
|
+
</Header>
|
|
352
|
+
</div>
|
|
353
|
+
</section>
|
|
354
|
+
|
|
355
|
+
<!-- ========== NAVIGATION: BOTTOM NAV ========== -->
|
|
356
|
+
<section class={sectionClass(isDark)}>
|
|
357
|
+
<h2 class={headingClass(isDark)}>BottomNav</h2>
|
|
358
|
+
<p class={subheadingClass(isDark)}>Mobile bottom navigation</p>
|
|
359
|
+
|
|
360
|
+
<div class="border rounded-lg overflow-hidden max-w-sm mx-auto {isDark ? 'border-gray-700' : 'border-gray-200'}">
|
|
361
|
+
<BottomNav items={navItems} />
|
|
362
|
+
</div>
|
|
363
|
+
</section>
|
|
364
|
+
|
|
365
|
+
<!-- ========== PAGE LAYOUT ========== -->
|
|
366
|
+
<section class={sectionClass(isDark)}>
|
|
367
|
+
<h2 class={headingClass(isDark)}>PageLayout</h2>
|
|
368
|
+
<p class={subheadingClass(isDark)}>Complete page structure with header, content, and optional footer</p>
|
|
369
|
+
|
|
370
|
+
<div class="border rounded-lg overflow-hidden h-64 {isDark ? 'border-gray-700' : 'border-gray-200'}">
|
|
371
|
+
<PageLayout>
|
|
372
|
+
{#snippet header()}
|
|
373
|
+
<Header title="PageLayout Demo" />
|
|
374
|
+
{/snippet}
|
|
375
|
+
{#snippet content()}
|
|
376
|
+
<div class="p-6">
|
|
377
|
+
<p>Main page content goes here. The layout handles spacing and responsive behavior.</p>
|
|
378
|
+
</div>
|
|
379
|
+
{/snippet}
|
|
380
|
+
{#snippet footer()}
|
|
381
|
+
<div class="p-4 text-center text-sm text-gray-500 border-t {isDark ? 'border-gray-700' : 'border-gray-200'}">
|
|
382
|
+
Footer content
|
|
383
|
+
</div>
|
|
384
|
+
{/snippet}
|
|
385
|
+
</PageLayout>
|
|
386
|
+
</div>
|
|
387
|
+
</section>
|
|
388
|
+
</div>
|