@stacksjs/defaults 0.70.54
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/LICENSE.md +21 -0
- package/README.md +2 -0
- package/package.json +20 -0
- package/resources/assets/fonts/013717e9.woff +0 -0
- package/resources/assets/fonts/03355817.woff2 +0 -0
- package/resources/assets/fonts/0380de7e.woff2 +0 -0
- package/resources/assets/fonts/0ba5d32a.woff +0 -0
- package/resources/assets/fonts/0bd57ddf.woff2 +0 -0
- package/resources/assets/fonts/19de0a60.woff2 +0 -0
- package/resources/assets/fonts/20b87e84.woff +0 -0
- package/resources/assets/fonts/4bbc67e1.woff +0 -0
- package/resources/assets/fonts/576fb0d7.woff +0 -0
- package/resources/assets/fonts/5ea10ee5.woff2 +0 -0
- package/resources/assets/fonts/6413fc0a.woff +0 -0
- package/resources/assets/fonts/72c114cf.woff +0 -0
- package/resources/assets/fonts/73c57e73.woff2 +0 -0
- package/resources/assets/fonts/813dca6c.woff +0 -0
- package/resources/assets/fonts/8a9b0995.woff2 +0 -0
- package/resources/assets/fonts/90b4832f.woff +0 -0
- package/resources/assets/fonts/9394ab85.woff2 +0 -0
- package/resources/assets/fonts/9b3c7d7f.woff2 +0 -0
- package/resources/assets/fonts/Monaco.ttf +0 -0
- package/resources/assets/fonts/b1b36d74.woff +0 -0
- package/resources/assets/fonts/b5d74798.woff2 +0 -0
- package/resources/assets/fonts/b9f81a4d.woff +0 -0
- package/resources/assets/fonts/c9784008.woff2 +0 -0
- package/resources/assets/fonts/cf692227.woff +0 -0
- package/resources/assets/fonts/d1c6ab51.woff2 +0 -0
- package/resources/assets/fonts/e2eb62fc.woff +0 -0
- package/resources/assets/fonts/fe21f8d8.woff2 +0 -0
- package/resources/assets/fonts/nps/CampmateScript-Regular.woff2 +0 -0
- package/resources/assets/fonts/nps/NPS_2026-variable.woff2 +0 -0
- package/resources/assets/fonts/nps/RedwoodSerif-Regular.woff2 +0 -0
- package/resources/assets/fonts/nps/SequoiaSans-Regular.woff2 +0 -0
- package/resources/assets/fonts/nps/Switchback-Regular.woff2 +0 -0
- package/resources/assets/images/app-icon.png +0 -0
- package/resources/assets/images/bg-img.png +0 -0
- package/resources/assets/images/park-ridge.svg +15 -0
- package/resources/assets/images/topography.svg +1 -0
- package/resources/assets/scripts/main.ts +2153 -0
- package/resources/assets/styles/README.md +19 -0
- package/resources/assets/styles/docs/main.css +1 -0
- package/resources/assets/styles/docs/overrides.css +1 -0
- package/resources/assets/styles/docs/vars.css +8 -0
- package/resources/assets/styles/main.css +1419 -0
- package/resources/components/Button.stx +70 -0
- package/resources/components/Buttons/BaseButton.stx +39 -0
- package/resources/components/Buttons/Counter.stx +28 -0
- package/resources/components/Buttons/ToggleDark.stx +11 -0
- package/resources/components/Container.stx +10 -0
- package/resources/components/Dashboard/.gitkeep +0 -0
- package/resources/components/Dashboard/Auth/ForgotPassword.stx +127 -0
- package/resources/components/Dashboard/Auth/Login.stx +212 -0
- package/resources/components/Dashboard/Auth/Register.stx +306 -0
- package/resources/components/Dashboard/Avatar.stx +123 -0
- package/resources/components/Dashboard/Billing/ActivePlan.stx +57 -0
- package/resources/components/Dashboard/Billing/CardBrands.stx +32 -0
- package/resources/components/Dashboard/Billing/CardForm.stx +34 -0
- package/resources/components/Dashboard/Billing/OneTimePayment.stx +28 -0
- package/resources/components/Dashboard/Billing/PaymentForm.stx +33 -0
- package/resources/components/Dashboard/Billing/PaymentMethod.stx +66 -0
- package/resources/components/Dashboard/Billing/PaymentMethodList.stx +52 -0
- package/resources/components/Dashboard/Billing/Plans.stx +136 -0
- package/resources/components/Dashboard/Buttons/AppButton.stx +48 -0
- package/resources/components/Dashboard/Buttons/IconButton.stx +20 -0
- package/resources/components/Dashboard/Card.stx +78 -0
- package/resources/components/Dashboard/Chart.stx +75 -0
- package/resources/components/Dashboard/CodeEditor.stx +41 -0
- package/resources/components/Dashboard/Commerce/BulkActionBar.stx +70 -0
- package/resources/components/Dashboard/Commerce/CategoriesTable.stx +133 -0
- package/resources/components/Dashboard/Commerce/CouponsTable.stx +161 -0
- package/resources/components/Dashboard/Commerce/CustomersTable.stx +142 -0
- package/resources/components/Dashboard/Commerce/Delivery/DeliveryRoutesTable.stx +80 -0
- package/resources/components/Dashboard/Commerce/Delivery/DigitalDeliveryTable.stx +85 -0
- package/resources/components/Dashboard/Commerce/Delivery/DriversTable.stx +99 -0
- package/resources/components/Dashboard/Commerce/Delivery/LicenseKeysTable.stx +92 -0
- package/resources/components/Dashboard/Commerce/Delivery/LicenseTemplatesTable.stx +88 -0
- package/resources/components/Dashboard/Commerce/Delivery/Pagination.stx +122 -0
- package/resources/components/Dashboard/Commerce/Delivery/SearchFilter.stx +23 -0
- package/resources/components/Dashboard/Commerce/Delivery/ShippingMethodsTable.stx +80 -0
- package/resources/components/Dashboard/Commerce/Delivery/ShippingRatesTable.stx +59 -0
- package/resources/components/Dashboard/Commerce/Delivery/ShippingZonesTable.stx +71 -0
- package/resources/components/Dashboard/Commerce/Delivery/TabNavigation.stx +36 -0
- package/resources/components/Dashboard/Commerce/Forms/CouponsForm.stx +191 -0
- package/resources/components/Dashboard/Commerce/OrdersTable.stx +131 -0
- package/resources/components/Dashboard/Commerce/ProductsTable.stx +170 -0
- package/resources/components/Dashboard/CreateRecordModal.stx +363 -0
- package/resources/components/Dashboard/DashboardLayout.stx +155 -0
- package/resources/components/Dashboard/Deployments/ActivityFeed.stx +54 -0
- package/resources/components/Dashboard/Deployments/DeployScript.stx +23 -0
- package/resources/components/Dashboard/Deployments/DeploymentHistory.stx +97 -0
- package/resources/components/Dashboard/Deployments/DeploymentList.stx +94 -0
- package/resources/components/Dashboard/Deployments/LiveTerminalOutput.stx +18 -0
- package/resources/components/Dashboard/Elements/Dropdown.stx +57 -0
- package/resources/components/Dashboard/Email/EmailActivityChart.stx +111 -0
- package/resources/components/Dashboard/Email/EmailCompose.stx +72 -0
- package/resources/components/Dashboard/Email/EmailDetail.stx +105 -0
- package/resources/components/Dashboard/Email/EmailList.stx +117 -0
- package/resources/components/Dashboard/Email/EmailSearch.stx +40 -0
- package/resources/components/Dashboard/Email/EmailSidebar.stx +133 -0
- package/resources/components/Dashboard/GlobalSearch.stx +124 -0
- package/resources/components/Dashboard/MobileSidebar.stx +47 -0
- package/resources/components/Dashboard/Modals/BaseModal.stx +50 -0
- package/resources/components/Dashboard/Modals/Popups/Alert.stx +112 -0
- package/resources/components/Dashboard/Modals/Popups/Toast.stx +70 -0
- package/resources/components/Dashboard/Modals/ToastWrapper.stx +35 -0
- package/resources/components/Dashboard/Monitoring/ErrorDetailModal.stx +228 -0
- package/resources/components/Dashboard/Monitoring/ErrorsTable.stx +184 -0
- package/resources/components/Dashboard/Navbar.stx +194 -0
- package/resources/components/Dashboard/NavbarModern.stx +188 -0
- package/resources/components/Dashboard/NotificationErrorModal.stx +105 -0
- package/resources/components/Dashboard/NotificationStatusBadge.stx +20 -0
- package/resources/components/Dashboard/Pagination.stx +90 -0
- package/resources/components/Dashboard/Queue/QueueTable.stx +127 -0
- package/resources/components/Dashboard/Settings/Forms/AIForm.stx +126 -0
- package/resources/components/Dashboard/Settings/Forms/AnalyticsForm.stx +52 -0
- package/resources/components/Dashboard/Settings/Forms/AppForm.stx +157 -0
- package/resources/components/Dashboard/Settings/Forms/CLIForm.stx +66 -0
- package/resources/components/Dashboard/Settings/Forms/CacheForm.stx +253 -0
- package/resources/components/Dashboard/Settings/Forms/CloudForm.stx +441 -0
- package/resources/components/Dashboard/Settings/Forms/DNSForm.stx +307 -0
- package/resources/components/Dashboard/Settings/Forms/DatabaseForm.stx +168 -0
- package/resources/components/Dashboard/Settings/Forms/EmailForm.stx +100 -0
- package/resources/components/Dashboard/Settings/Forms/FileSystemForm.stx +259 -0
- package/resources/components/Dashboard/Settings/Forms/HashingForm.stx +119 -0
- package/resources/components/Dashboard/Settings/Forms/LibraryForm.stx +389 -0
- package/resources/components/Dashboard/Settings/Forms/QueueForm.stx +219 -0
- package/resources/components/Dashboard/Settings/Forms/SearchEngineForm.stx +48 -0
- package/resources/components/Dashboard/Settings/Forms/SecurityForm.stx +143 -0
- package/resources/components/Dashboard/Settings/Forms/ServicesForm.stx +194 -0
- package/resources/components/Dashboard/Settings/Forms/StorageForm.stx +191 -0
- package/resources/components/Dashboard/Settings/Forms/TeamsForm.stx +33 -0
- package/resources/components/Dashboard/Settings/SettingsFormManager.stx +181 -0
- package/resources/components/Dashboard/SettingsHeader.stx +88 -0
- package/resources/components/Dashboard/SettingsSidebar.stx +234 -0
- package/resources/components/Dashboard/Sidebar.stx +23 -0
- package/resources/components/Dashboard/SidebarModern.stx +249 -0
- package/resources/components/Dashboard/Skeleton/LoadingCard.stx +15 -0
- package/resources/components/Dashboard/Skeleton/LoadingDetails.stx +26 -0
- package/resources/components/Dashboard/Table.stx +82 -0
- package/resources/components/Dashboard/TerminalContainer.stx +97 -0
- package/resources/components/Dashboard/Tooltip.stx +166 -0
- package/resources/components/Dashboard/Transaction/index.stx +88 -0
- package/resources/components/Dashboard/UI/ActivityTable.stx +54 -0
- package/resources/components/Dashboard/UI/Avatar.stx +102 -0
- package/resources/components/Dashboard/UI/Badge.stx +66 -0
- package/resources/components/Dashboard/UI/Button.stx +73 -0
- package/resources/components/Dashboard/UI/Card.stx +51 -0
- package/resources/components/Dashboard/UI/ChartCard.stx +36 -0
- package/resources/components/Dashboard/UI/Checkbox.stx +74 -0
- package/resources/components/Dashboard/UI/ConfirmDialog.stx +74 -0
- package/resources/components/Dashboard/UI/DataTable.stx +45 -0
- package/resources/components/Dashboard/UI/Dropdown.stx +72 -0
- package/resources/components/Dashboard/UI/DropdownItem.stx +80 -0
- package/resources/components/Dashboard/UI/EmptyState.stx +50 -0
- package/resources/components/Dashboard/UI/FilterBar.stx +48 -0
- package/resources/components/Dashboard/UI/Input.stx +77 -0
- package/resources/components/Dashboard/UI/Modal.stx +75 -0
- package/resources/components/Dashboard/UI/PageHeader.stx +69 -0
- package/resources/components/Dashboard/UI/PageLayout.stx +84 -0
- package/resources/components/Dashboard/UI/Pagination.stx +126 -0
- package/resources/components/Dashboard/UI/QuickLinks.stx +31 -0
- package/resources/components/Dashboard/UI/RouterLink.stx +31 -0
- package/resources/components/Dashboard/UI/Select.stx +84 -0
- package/resources/components/Dashboard/UI/ServiceHealth.stx +38 -0
- package/resources/components/Dashboard/UI/StatsCard.stx +79 -0
- package/resources/components/Dashboard/UI/Table.stx +143 -0
- package/resources/components/Dashboard/UI/Tabs.stx +45 -0
- package/resources/components/Dashboard/UI/Textarea.stx +93 -0
- package/resources/components/Dashboard/UI/Toggle.stx +84 -0
- package/resources/components/Dashboard/UI/WindowControls.stx +135 -0
- package/resources/components/Dashboard/Widget.stx +89 -0
- package/resources/components/Dashboard/WindowControls.stx +119 -0
- package/resources/components/Dashboard/index.ts +106 -0
- package/resources/components/Docs/Demo/ComboboxCode.md +114 -0
- package/resources/components/Docs/Demo/ComboboxDemo.stx +91 -0
- package/resources/components/Docs/Demo/DialogCode.md +42 -0
- package/resources/components/Docs/Demo/DialogDemo.stx +76 -0
- package/resources/components/Docs/Demo/DocsPlayground.stx +39 -0
- package/resources/components/Docs/Demo/DropdownCode.md +109 -0
- package/resources/components/Docs/Demo/DropdownDemo.stx +82 -0
- package/resources/components/Docs/Demo/Hero.stx +100 -0
- package/resources/components/Docs/Demo/ListboxCode.md +87 -0
- package/resources/components/Docs/Demo/ListboxDemo.stx +59 -0
- package/resources/components/Docs/Demo/NotificationCode.md +173 -0
- package/resources/components/Docs/Demo/NotificationDemo.stx +99 -0
- package/resources/components/Docs/Demo/PopoverCode.md +161 -0
- package/resources/components/Docs/Demo/PopoverDemo.stx +96 -0
- package/resources/components/Docs/Demo/RadioGroupCode.md +98 -0
- package/resources/components/Docs/Demo/RadioGroupDemo.stx +53 -0
- package/resources/components/Docs/Demo/StepperCode.md +216 -0
- package/resources/components/Docs/Demo/StepperDemo.stx +137 -0
- package/resources/components/Docs/Demo/SwitchCode.md +24 -0
- package/resources/components/Docs/Demo/SwitchDemo.stx +28 -0
- package/resources/components/Docs/Home.stx +7 -0
- package/resources/components/Docs/HomeContributors.stx +23 -0
- package/resources/components/Docs/HomeSponsors.stx +17 -0
- package/resources/components/Docs/HomeTeam.stx +18 -0
- package/resources/components/Docs/TeamMember.stx +79 -0
- package/resources/components/Email/EmailButton.stx +32 -0
- package/resources/components/Email/EmailDivider.stx +20 -0
- package/resources/components/Email/EmailImage.stx +24 -0
- package/resources/components/Email/EmailLayout.stx +55 -0
- package/resources/components/Email/EmailLink.stx +22 -0
- package/resources/components/Email/EmailSection.stx +20 -0
- package/resources/components/Email/EmailText.stx +30 -0
- package/resources/components/Forum/ForumBreadcrumb.stx +38 -0
- package/resources/components/Forum/ForumCategory.stx +16 -0
- package/resources/components/Forum/ForumCategoryItem.stx +46 -0
- package/resources/components/Forum/ForumLayout.stx +36 -0
- package/resources/components/Forum/ForumPagination.stx +39 -0
- package/resources/components/Forum/ForumPost.stx +71 -0
- package/resources/components/Forum/ForumReplyForm.stx +76 -0
- package/resources/components/Forum/ForumSidebar.stx +86 -0
- package/resources/components/Forum/ForumTopicItem.stx +77 -0
- package/resources/components/Forum/ForumTopicList.stx +23 -0
- package/resources/components/HelloWorld.stx +253 -0
- package/resources/components/Logo.stx +10 -0
- package/resources/components/Marketing/CallToAction.stx +30 -0
- package/resources/components/Marketing/ComingSoon.stx +155 -0
- package/resources/components/Marketing/Faqs.stx +99 -0
- package/resources/components/Marketing/Feature.stx +32 -0
- package/resources/components/Marketing/Fields.stx +28 -0
- package/resources/components/Marketing/Footer.stx +33 -0
- package/resources/components/Marketing/Header.stx +51 -0
- package/resources/components/Marketing/Hero.stx +46 -0
- package/resources/components/Marketing/Layout.stx +26 -0
- package/resources/components/Marketing/NavLink.stx +13 -0
- package/resources/components/Marketing/Plan.stx +43 -0
- package/resources/components/Marketing/Pricing.stx +120 -0
- package/resources/components/Marketing/PrimaryFeatures.stx +80 -0
- package/resources/components/Marketing/PrimaryFeatures2.stx +98 -0
- package/resources/components/Marketing/SecondaryFeatures.stx +80 -0
- package/resources/components/Marketing/Testimonials.stx +120 -0
- package/resources/components/Pagination.stx +149 -0
- package/resources/components/Playground.stx +9 -0
- package/resources/components/README.md +87 -0
- package/resources/components/Storefront/AnnouncementBar.stx +17 -0
- package/resources/components/Storefront/CartDrawer.stx +227 -0
- package/resources/components/Storefront/CheckoutSteps.stx +50 -0
- package/resources/components/Storefront/Footer.stx +81 -0
- package/resources/components/Storefront/Header.stx +66 -0
- package/resources/components/Storefront/OrderSummary.stx +79 -0
- package/resources/components/Storefront/ProductCard.stx +63 -0
- package/resources/components/Storefront/ProductGallery.stx +88 -0
- package/resources/components/Storefront/QuantitySelector.stx +97 -0
- package/resources/components/index.ts +13 -0
- package/resources/emails/email-verification.stx +46 -0
- package/resources/emails/layouts/base.html +113 -0
- package/resources/emails/password-changed.stx +55 -0
- package/resources/emails/password-reset.stx +43 -0
- package/resources/emails/subscription-confirmation.stx +99 -0
- package/resources/emails/welcome.stx +48 -0
- package/resources/functions/README.md +28 -0
- package/resources/functions/counter.ts +13 -0
- package/resources/functions/dark.ts +4 -0
- package/resources/functions/dashboard/analytics.ts +238 -0
- package/resources/functions/dashboard/config-io.ts +316 -0
- package/resources/functions/dashboard/data.ts +375 -0
- package/resources/functions/dashboard/library.ts +250 -0
- package/resources/functions/dashboard/sidebar.ts +537 -0
- package/resources/functions/dashboard/system.ts +150 -0
- package/resources/layouts/403.stx +188 -0
- package/resources/layouts/404.stx +34 -0
- package/resources/layouts/README.md +14 -0
- package/resources/layouts/dashboard/default.stx +20 -0
- package/resources/layouts/dashboard/guest.stx +10 -0
- package/resources/layouts/default.stx +3 -0
- package/resources/layouts/maintenance.stx +11 -0
- package/resources/layouts/storefront.stx +73 -0
- package/resources/layouts/system-tray/default.stx +3 -0
- package/resources/modules/.gitkeep +0 -0
- package/resources/plugins/.gitkeep +0 -0
- package/resources/plugins/preloader.ts +308 -0
- package/resources/types/README.md +3 -0
- package/resources/views/cart.stx +149 -0
- package/resources/views/checkout/contact.stx +101 -0
- package/resources/views/checkout/payment.stx +114 -0
- package/resources/views/checkout/shipping.stx +120 -0
- package/resources/views/coming-soon.stx +9 -0
- package/resources/views/dashboard/custom-page.stx +45 -0
- package/resources/views/dashboard/index.stx +24 -0
- package/resources/views/emails/welcome.stx +0 -0
- package/resources/views/errors/tester.stx +26 -0
- package/resources/views/index.stx +2865 -0
- package/resources/views/orders/[id].stx +130 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
interface EmailListProps {
|
|
3
|
+
emails?: any[]
|
|
4
|
+
activeFolder?: string
|
|
5
|
+
searchQuery?: string
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const { emails = [], activeFolder = 'inbox', searchQuery = '' } = defineProps<EmailListProps>()
|
|
9
|
+
|
|
10
|
+
// Helper function to format date
|
|
11
|
+
function formatDate(dateString) {
|
|
12
|
+
const date = new Date(dateString)
|
|
13
|
+
const now = new Date()
|
|
14
|
+
const today = new Date(now.getFullYear(), now.getMonth(), now.getDate())
|
|
15
|
+
const yesterday = new Date(today)
|
|
16
|
+
yesterday.setDate(yesterday.getDate() - 1)
|
|
17
|
+
|
|
18
|
+
if (date >= today) {
|
|
19
|
+
return date.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })
|
|
20
|
+
} else if (date >= yesterday) {
|
|
21
|
+
return 'Yesterday'
|
|
22
|
+
} else {
|
|
23
|
+
return date.toLocaleDateString([], { month: 'short', day: 'numeric' })
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Filter and sort emails
|
|
28
|
+
function getFilteredEmails() {
|
|
29
|
+
let filtered = emails.filter(email => {
|
|
30
|
+
if (activeFolder === 'starred') {
|
|
31
|
+
return email.starred
|
|
32
|
+
} else {
|
|
33
|
+
return email.folder === activeFolder
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (searchQuery) {
|
|
38
|
+
const query = searchQuery.toLowerCase()
|
|
39
|
+
filtered = filtered.filter(email =>
|
|
40
|
+
email.subject.toLowerCase().includes(query) ||
|
|
41
|
+
email.from.toLowerCase().includes(query) ||
|
|
42
|
+
email.preview.toLowerCase().includes(query)
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return filtered.sort((a, b) => new Date(b.date).getTime() - new Date(a.date).getTime())
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const filteredEmails = getFilteredEmails()
|
|
50
|
+
const folderTitle = activeFolder.charAt(0).toUpperCase() + activeFolder.slice(1)
|
|
51
|
+
</script>
|
|
52
|
+
<div class="flex flex-col w-full md:w-1/3 lg:w-2/5 border-gray-200 border-r dark:border-neutral-600">
|
|
53
|
+
<div class="flex items-center justify-between px-4 py-2 bg-white dark:bg-neutral-700 border-b border-gray-200 dark:border-neutral-600">
|
|
54
|
+
<div class="flex items-center justify-between">
|
|
55
|
+
<h2 class="font-medium text-gray-900 text-lg dark:text-neutral-100">
|
|
56
|
+
{{ folderTitle }}
|
|
57
|
+
</h2>
|
|
58
|
+
<div class="flex ml-4 space-x-2">
|
|
59
|
+
<button class="p-1 hover:bg-gray-100 dark:hover:bg-neutral-600 rounded">
|
|
60
|
+
<i class="text-gray-500 text-lg dark:text-neutral-400 i-hugeicons-refresh"></i>
|
|
61
|
+
</button>
|
|
62
|
+
<button class="p-1 hover:bg-gray-100 dark:hover:bg-neutral-600 rounded">
|
|
63
|
+
<i class="text-gray-500 text-lg dark:text-neutral-400 i-hugeicons-more-vertical-circle-01"></i>
|
|
64
|
+
</button>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
<div class="overflow-y-auto flex-1">
|
|
70
|
+
<ul class="divide-gray-200 divide-y dark:divide-neutral-600">
|
|
71
|
+
@foreach(filteredEmails as email)
|
|
72
|
+
<li
|
|
73
|
+
class="hover:bg-gray-100 dark:hover:bg-neutral-600 cursor-pointer {{ !email.read ? 'bg-blue-50 dark:bg-neutral-800' : 'bg-white dark:bg-neutral-700' }}"
|
|
74
|
+
data-action="open-email"
|
|
75
|
+
data-email-id="{{ email.id }}"
|
|
76
|
+
>
|
|
77
|
+
<div class="px-4 py-3">
|
|
78
|
+
<div class="flex items-center justify-between">
|
|
79
|
+
<p class="text-sm font-medium {{ !email.read ? 'text-gray-900 dark:text-white' : 'text-gray-600 dark:text-neutral-300' }}">
|
|
80
|
+
{{ email.from }}
|
|
81
|
+
</p>
|
|
82
|
+
<p class="text-gray-500 text-xs dark:text-neutral-400">
|
|
83
|
+
{{ formatDate(email.date) }}
|
|
84
|
+
</p>
|
|
85
|
+
</div>
|
|
86
|
+
<div class="flex items-center justify-between mt-1">
|
|
87
|
+
<p class="text-sm {{ !email.read ? 'text-gray-900 dark:text-white font-medium' : 'text-gray-600 dark:text-neutral-300' }}">
|
|
88
|
+
{{ email.subject }}
|
|
89
|
+
</p>
|
|
90
|
+
<div class="flex items-center space-x-1">
|
|
91
|
+
<button class="text-gray-400 hover:text-yellow-400" data-action="toggle-star" data-email-id="{{ email.id }}">
|
|
92
|
+
@if(email.starred)
|
|
93
|
+
<span class="text-lg text-yellow-400">
|
|
94
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="currentColor">
|
|
95
|
+
<path d="M13.7276 3.44418L15.4874 6.99288C15.7274 7.48687 16.3673 7.9607 16.9073 8.05143L20.0969 8.58575C22.1367 8.92853 22.6167 10.4206 21.1468 11.8925L18.6671 14.3927C18.2471 14.8161 18.0172 15.6327 18.1471 16.2175L18.8571 19.3125C19.417 21.7623 18.1271 22.71 15.9774 21.4296L12.9877 19.6452C12.4478 19.3226 11.5579 19.3226 11.0079 19.6452L8.01827 21.4296C5.8785 22.71 4.57865 21.7522 5.13859 19.3125L5.84851 16.2175C5.97849 15.6327 5.74852 14.8161 5.32856 14.3927L2.84884 11.8925C1.389 10.4206 1.85895 8.92853 3.89872 8.58575L7.08837 8.05143C7.61831 7.9607 8.25824 7.48687 8.49821 6.99288L10.258 3.44418C11.2179 1.51861 12.7777 1.51861 13.7276 3.44418Z"/>
|
|
96
|
+
</svg>
|
|
97
|
+
</span>
|
|
98
|
+
@else
|
|
99
|
+
<i class="text-lg i-hugeicons-star"></i>
|
|
100
|
+
@endif
|
|
101
|
+
</button>
|
|
102
|
+
@if(email.attachment)
|
|
103
|
+
<span class="text-gray-400">
|
|
104
|
+
<i class="text-lg i-hugeicons-attachment-01"></i>
|
|
105
|
+
</span>
|
|
106
|
+
@endif
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
<p class="mt-1 text-gray-500 text-xs truncate dark:text-neutral-400">
|
|
110
|
+
{{ email.preview }}
|
|
111
|
+
</p>
|
|
112
|
+
</div>
|
|
113
|
+
</li>
|
|
114
|
+
@endforeach
|
|
115
|
+
</ul>
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
interface EmailSearchProps {
|
|
3
|
+
modelValue?: string
|
|
4
|
+
timeRange?: 'day' | 'week' | 'month' | 'year'
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const { modelValue = '', timeRange = 'day' } = defineProps<EmailSearchProps>()
|
|
8
|
+
</script>
|
|
9
|
+
<div class="px-4 py-2 bg-white dark:bg-neutral-700 border-b border-gray-200 dark:border-neutral-600">
|
|
10
|
+
<div class="flex items-center">
|
|
11
|
+
<!-- Search bar -->
|
|
12
|
+
<div class="flex-1 max-w-2xl">
|
|
13
|
+
<div class="relative">
|
|
14
|
+
<div class="flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none">
|
|
15
|
+
<i class="text-gray-400 text-lg i-hugeicons-search"></i>
|
|
16
|
+
</div>
|
|
17
|
+
<input
|
|
18
|
+
type="text"
|
|
19
|
+
name="search"
|
|
20
|
+
value="{{ modelValue }}"
|
|
21
|
+
placeholder="Search emails..."
|
|
22
|
+
class="block placeholder-gray-500 dark:placeholder-gray-400 pl-10 pr-3 py-2 w-full text-gray-900 sm:text-sm dark:text-neutral-100 bg-gray-50 dark:bg-neutral-600 border border-gray-300 rounded-md dark:border-neutral-600 focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500"
|
|
23
|
+
>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<!-- Activity chart toggle -->
|
|
28
|
+
<div class="ml-4">
|
|
29
|
+
<select
|
|
30
|
+
name="timeRange"
|
|
31
|
+
class="pl-3 pr-8 py-1.5 h-9 text-gray-900 text-sm dark:text-neutral-100 bg-gray-50 dark:bg-neutral-600 border-0 ring-1 ring-gray-300 ring-inset rounded-md dark:ring-neutral-600 focus:ring-2 focus:ring-blue-600"
|
|
32
|
+
>
|
|
33
|
+
<option value="day" {{ timeRange == 'day' ? 'selected' : '' }}>Last 24 Hours</option>
|
|
34
|
+
<option value="week" {{ timeRange == 'week' ? 'selected' : '' }}>Last 7 Days</option>
|
|
35
|
+
<option value="month" {{ timeRange == 'month' ? 'selected' : '' }}>Last 30 Days</option>
|
|
36
|
+
<option value="year" {{ timeRange == 'year' ? 'selected' : '' }}>Last Year</option>
|
|
37
|
+
</select>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
interface EmailSidebarProps {
|
|
3
|
+
activeFolder?: string
|
|
4
|
+
folders?: any[]
|
|
5
|
+
unreadCounts?: Record<string, any>
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const { activeFolder = 'inbox', folders = [], unreadCounts = {} } = defineProps<EmailSidebarProps>()
|
|
9
|
+
|
|
10
|
+
// User info
|
|
11
|
+
const userInfo = {
|
|
12
|
+
name: 'Alicia Koch',
|
|
13
|
+
email: 'alicia@example.com',
|
|
14
|
+
initial: 'A'
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function getUnreadCount(folderId) {
|
|
18
|
+
return unreadCounts[folderId] || 0
|
|
19
|
+
}
|
|
20
|
+
</script>
|
|
21
|
+
<div class="flex flex-col w-64 bg-white dark:bg-neutral-800 border-gray-200 border-r dark:border-neutral-600">
|
|
22
|
+
<!-- User dropdown -->
|
|
23
|
+
<div class="p-3 border-b border-gray-200 dark:border-neutral-600">
|
|
24
|
+
<div class="flex items-center justify-between">
|
|
25
|
+
<div class="flex items-center space-x-2">
|
|
26
|
+
<div class="flex items-center justify-center h-8 w-8 text-gray-700 dark:text-white bg-gray-200 dark:bg-neutral-700 rounded">
|
|
27
|
+
<i class="text-sm i-hugeicons-alert-02"></i>
|
|
28
|
+
</div>
|
|
29
|
+
<span class="font-medium text-gray-900 text-sm dark:text-white">{{ userInfo.name }}</span>
|
|
30
|
+
</div>
|
|
31
|
+
<button class="text-gray-500 dark:text-neutral-400">
|
|
32
|
+
<i class="text-sm i-hugeicons-arrow-down-02"></i>
|
|
33
|
+
</button>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<!-- Folders -->
|
|
38
|
+
<div class="overflow-y-auto flex-1">
|
|
39
|
+
<nav class="mt-1">
|
|
40
|
+
<ul>
|
|
41
|
+
@foreach(folders as folder)
|
|
42
|
+
<li class="mb-1">
|
|
43
|
+
<button
|
|
44
|
+
class="w-full flex items-center justify-between px-4 py-2 text-sm {{ activeFolder == folder.id ? 'bg-gray-100 dark:bg-neutral-700 text-gray-900 dark:text-white font-medium' : 'text-gray-700 dark:text-neutral-300 hover:bg-gray-50 dark:hover:bg-neutral-700' }}"
|
|
45
|
+
data-action="set-folder"
|
|
46
|
+
data-folder-id="{{ folder.id }}"
|
|
47
|
+
>
|
|
48
|
+
<div class="flex items-center">
|
|
49
|
+
@if(folder.id == 'inbox')
|
|
50
|
+
<i class="mr-3 text-lg i-hugeicons-inbox"></i>
|
|
51
|
+
@elseif(folder.id == 'drafts')
|
|
52
|
+
<i class="mr-3 text-lg i-hugeicons-edit-01"></i>
|
|
53
|
+
@elseif(folder.id == 'sent')
|
|
54
|
+
<i class="mr-3 text-lg i-hugeicons-sent"></i>
|
|
55
|
+
@elseif(folder.id == 'trash')
|
|
56
|
+
<i class="mr-3 text-lg i-hugeicons-waste"></i>
|
|
57
|
+
@elseif(folder.id == 'archive')
|
|
58
|
+
<i class="mr-3 text-lg i-hugeicons-archive"></i>
|
|
59
|
+
@elseif(folder.id == 'spam')
|
|
60
|
+
<i class="mr-3 text-lg i-hugeicons-spam"></i>
|
|
61
|
+
@elseif(folder.id == 'starred')
|
|
62
|
+
<i class="mr-3 text-lg i-hugeicons-star"></i>
|
|
63
|
+
@endif
|
|
64
|
+
<span>{{ folder.name }}</span>
|
|
65
|
+
</div>
|
|
66
|
+
@if(getUnreadCount(folder.id) > 0)
|
|
67
|
+
<span class="px-2 font-medium text-gray-800 text-xs dark:text-neutral-200 bg-gray-200 dark:bg-neutral-600 rounded-full">
|
|
68
|
+
{{ getUnreadCount(folder.id) }}
|
|
69
|
+
</span>
|
|
70
|
+
@endif
|
|
71
|
+
</button>
|
|
72
|
+
</li>
|
|
73
|
+
@endforeach
|
|
74
|
+
</ul>
|
|
75
|
+
</nav>
|
|
76
|
+
|
|
77
|
+
<!-- Categories -->
|
|
78
|
+
<div class="mt-6 px-4">
|
|
79
|
+
<h3 class="font-semibold text-gray-500 text-xs tracking-wider uppercase dark:text-neutral-400">
|
|
80
|
+
Categories
|
|
81
|
+
</h3>
|
|
82
|
+
<nav class="mt-2">
|
|
83
|
+
<ul>
|
|
84
|
+
<li class="mb-1">
|
|
85
|
+
<button class="flex items-center px-2 py-2 w-full text-gray-700 text-sm dark:text-neutral-300 hover:bg-gray-50 dark:hover:bg-neutral-700 rounded">
|
|
86
|
+
<i class="mr-3 text-lg i-hugeicons-user"></i>
|
|
87
|
+
<span>Social</span>
|
|
88
|
+
<span class="ml-auto px-2 font-medium text-gray-800 text-xs dark:text-neutral-200 bg-gray-200 dark:bg-neutral-600 rounded-full">
|
|
89
|
+
972
|
|
90
|
+
</span>
|
|
91
|
+
</button>
|
|
92
|
+
</li>
|
|
93
|
+
<li class="mb-1">
|
|
94
|
+
<button class="flex items-center px-2 py-2 w-full text-gray-700 text-sm dark:text-neutral-300 hover:bg-gray-50 dark:hover:bg-neutral-700 rounded">
|
|
95
|
+
<i class="mr-3 text-lg i-hugeicons-notification-03"></i>
|
|
96
|
+
<span>Updates</span>
|
|
97
|
+
<span class="ml-auto px-2 font-medium text-gray-800 text-xs dark:text-neutral-200 bg-gray-200 dark:bg-neutral-600 rounded-full">
|
|
98
|
+
342
|
|
99
|
+
</span>
|
|
100
|
+
</button>
|
|
101
|
+
</li>
|
|
102
|
+
<li class="mb-1">
|
|
103
|
+
<button class="flex items-center px-2 py-2 w-full text-gray-700 text-sm dark:text-neutral-300 hover:bg-gray-50 dark:hover:bg-neutral-700 rounded">
|
|
104
|
+
<i class="mr-3 text-lg i-hugeicons-chatting-01"></i>
|
|
105
|
+
<span>Forums</span>
|
|
106
|
+
<span class="ml-auto px-2 font-medium text-gray-800 text-xs dark:text-neutral-200 bg-gray-200 dark:bg-neutral-600 rounded-full">
|
|
107
|
+
128
|
|
108
|
+
</span>
|
|
109
|
+
</button>
|
|
110
|
+
</li>
|
|
111
|
+
<li class="mb-1">
|
|
112
|
+
<button class="flex items-center px-2 py-2 w-full text-gray-700 text-sm dark:text-neutral-300 hover:bg-gray-50 dark:hover:bg-neutral-700 rounded">
|
|
113
|
+
<i class="mr-3 text-lg i-hugeicons-shopping-cart-02"></i>
|
|
114
|
+
<span>Shopping</span>
|
|
115
|
+
<span class="ml-auto px-2 font-medium text-gray-800 text-xs dark:text-neutral-200 bg-gray-200 dark:bg-neutral-600 rounded-full">
|
|
116
|
+
8
|
|
117
|
+
</span>
|
|
118
|
+
</button>
|
|
119
|
+
</li>
|
|
120
|
+
<li class="mb-1">
|
|
121
|
+
<button class="flex items-center px-2 py-2 w-full text-gray-700 text-sm dark:text-neutral-300 hover:bg-gray-50 dark:hover:bg-neutral-700 rounded">
|
|
122
|
+
<i class="mr-3 text-lg i-hugeicons-tag-01"></i>
|
|
123
|
+
<span>Promotions</span>
|
|
124
|
+
<span class="ml-auto px-2 font-medium text-gray-800 text-xs dark:text-neutral-200 bg-gray-200 dark:bg-neutral-600 rounded-full">
|
|
125
|
+
21
|
|
126
|
+
</span>
|
|
127
|
+
</button>
|
|
128
|
+
</li>
|
|
129
|
+
</ul>
|
|
130
|
+
</nav>
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
<script server>
|
|
2
|
+
import { useGlobalSearch } from '../../../functions/search'
|
|
3
|
+
|
|
4
|
+
const { query, results, isSearching, isOpen, selectedIndex, modelIcons, search, open, close, moveUp, moveDown, selectCurrent, flatResults } = useGlobalSearch()
|
|
5
|
+
|
|
6
|
+
function handleKeydown(event) {
|
|
7
|
+
if (event.key === 'ArrowUp') {
|
|
8
|
+
event.preventDefault()
|
|
9
|
+
moveUp()
|
|
10
|
+
} else if (event.key === 'ArrowDown') {
|
|
11
|
+
event.preventDefault()
|
|
12
|
+
moveDown()
|
|
13
|
+
} else if (event.key === 'Enter') {
|
|
14
|
+
event.preventDefault()
|
|
15
|
+
const href = selectCurrent()
|
|
16
|
+
if (href) window.location.href = href
|
|
17
|
+
} else if (event.key === 'Escape') {
|
|
18
|
+
close()
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function handleInput(event) {
|
|
23
|
+
search(event.target.value)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function navigateTo(href) {
|
|
27
|
+
close()
|
|
28
|
+
window.location.href = href
|
|
29
|
+
}
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<!-- Search Modal Overlay -->
|
|
33
|
+
@if(isOpen)
|
|
34
|
+
<div class="fixed inset-0 overflow-y-auto z-50" @keydown="handleKeydown">
|
|
35
|
+
<!-- Backdrop -->
|
|
36
|
+
<div class="fixed inset-0 bg-black/50 backdrop-blur-sm" @click="close"></div>
|
|
37
|
+
|
|
38
|
+
<!-- Modal -->
|
|
39
|
+
<div class="relative mt-[15vh] mx-auto max-w-lg">
|
|
40
|
+
<div class="overflow-hidden bg-white dark:bg-neutral-900 border border-neutral-200 rounded-xl dark:border-neutral-700 shadow-2xl">
|
|
41
|
+
<!-- Search Input -->
|
|
42
|
+
<div class="flex items-center px-4 border-b border-neutral-200 dark:border-neutral-700">
|
|
43
|
+
<svg class="shrink-0 h-5 w-5 text-neutral-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
44
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path>
|
|
45
|
+
</svg>
|
|
46
|
+
<input
|
|
47
|
+
type="text"
|
|
48
|
+
placeholder="Search across all models..."
|
|
49
|
+
class="px-3 py-4 w-full text-neutral-900 text-sm dark:text-white placeholder:text-neutral-400 bg-transparent border-none focus:outline-none focus:ring-0"
|
|
50
|
+
:value="query"
|
|
51
|
+
@input="handleInput"
|
|
52
|
+
autofocus
|
|
53
|
+
/>
|
|
54
|
+
@if(isSearching)
|
|
55
|
+
<div class="shrink-0 h-5 w-5 border-2 border-blue-500 border-t-transparent rounded-full animate-spin"></div>
|
|
56
|
+
@else
|
|
57
|
+
<kbd class="shrink-0 px-1.5 py-0.5 font-medium text-[10px] text-neutral-400 bg-neutral-100 dark:bg-neutral-700 border border-neutral-200 rounded dark:border-neutral-600">
|
|
58
|
+
ESC
|
|
59
|
+
</kbd>
|
|
60
|
+
@endif
|
|
61
|
+
</div>
|
|
62
|
+
|
|
63
|
+
<!-- Results -->
|
|
64
|
+
<div class="overflow-y-auto max-h-80">
|
|
65
|
+
@if(Object.keys(results).length > 0)
|
|
66
|
+
@for(modelType in results)
|
|
67
|
+
<div class="pb-1 pt-3 px-3">
|
|
68
|
+
<h3 class="px-1 font-semibold text-neutral-400 text-xs tracking-wider uppercase">
|
|
69
|
+
{{ modelType }}
|
|
70
|
+
</h3>
|
|
71
|
+
</div>
|
|
72
|
+
@for(item, itemIndex in results[modelType])
|
|
73
|
+
<button
|
|
74
|
+
class="flex gap-3 items-center px-4 py-2.5 w-full text-left hover:bg-neutral-50 dark:hover:bg-neutral-800 transition-colors"
|
|
75
|
+
@click="navigateTo(item.href)"
|
|
76
|
+
>
|
|
77
|
+
<div :class="'i-hugeicons-file-02' || modelIcons[modelType]" class="shrink-0 h-5 w-5 text-neutral-400"></div>
|
|
78
|
+
<div class="flex-1 min-w-0">
|
|
79
|
+
<p class="font-medium text-neutral-900 text-sm truncate dark:text-white">
|
|
80
|
+
{{ item.title }}
|
|
81
|
+
</p>
|
|
82
|
+
@if(item.subtitle)
|
|
83
|
+
<p class="text-neutral-500 text-xs truncate dark:text-neutral-400">
|
|
84
|
+
{{ item.subtitle }}
|
|
85
|
+
</p>
|
|
86
|
+
@endif
|
|
87
|
+
</div>
|
|
88
|
+
<svg class="shrink-0 h-4 w-4 text-neutral-300 dark:text-neutral-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
89
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path>
|
|
90
|
+
</svg>
|
|
91
|
+
</button>
|
|
92
|
+
@endfor
|
|
93
|
+
@endfor
|
|
94
|
+
@elseif(query && !isSearching)
|
|
95
|
+
<div class="px-4 py-8 text-center">
|
|
96
|
+
<div class="mb-2 mx-auto h-8 w-8 text-neutral-300 dark:text-neutral-600 i-hugeicons-search-02"></div>
|
|
97
|
+
<p class="text-neutral-500 text-sm dark:text-neutral-400">No results found for "{{ query }}"</p>
|
|
98
|
+
</div>
|
|
99
|
+
@else
|
|
100
|
+
<div class="px-4 py-8 text-center">
|
|
101
|
+
<p class="text-neutral-400 text-sm">Start typing to search...</p>
|
|
102
|
+
</div>
|
|
103
|
+
@endif
|
|
104
|
+
</div>
|
|
105
|
+
|
|
106
|
+
<!-- Footer -->
|
|
107
|
+
<div class="flex gap-4 items-center px-4 py-2.5 text-neutral-400 text-xs border-neutral-200 border-t dark:border-neutral-700">
|
|
108
|
+
<span class="flex gap-1 items-center">
|
|
109
|
+
<kbd class="px-1 py-0.5 text-[10px] bg-neutral-100 dark:bg-neutral-700 border border-neutral-200 rounded dark:border-neutral-600">↑↓</kbd>
|
|
110
|
+
Navigate
|
|
111
|
+
</span>
|
|
112
|
+
<span class="flex gap-1 items-center">
|
|
113
|
+
<kbd class="px-1 py-0.5 text-[10px] bg-neutral-100 dark:bg-neutral-700 border border-neutral-200 rounded dark:border-neutral-600">↵</kbd>
|
|
114
|
+
Open
|
|
115
|
+
</span>
|
|
116
|
+
<span class="flex gap-1 items-center">
|
|
117
|
+
<kbd class="px-1 py-0.5 text-[10px] bg-neutral-100 dark:bg-neutral-700 border border-neutral-200 rounded dark:border-neutral-600">esc</kbd>
|
|
118
|
+
Close
|
|
119
|
+
</span>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
@endif
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
interface MobileSidebarProps {
|
|
3
|
+
isOpen?: boolean
|
|
4
|
+
companyLogo?: string
|
|
5
|
+
companyName?: string
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const { isOpen = false, companyLogo = 'https:, companyName = 'Your Company' } = defineProps<MobileSidebarProps>()
|
|
9
|
+
</script>
|
|
10
|
+
@if(isOpen)
|
|
11
|
+
<div
|
|
12
|
+
class="lg:hidden relative z-50"
|
|
13
|
+
role="dialog"
|
|
14
|
+
aria-modal="true"
|
|
15
|
+
>
|
|
16
|
+
<!-- Off-canvas menu backdrop -->
|
|
17
|
+
<div class="fixed inset-0 bg-gray-900/80"></div>
|
|
18
|
+
|
|
19
|
+
<div class="flex fixed inset-0">
|
|
20
|
+
<!-- Off-canvas menu panel -->
|
|
21
|
+
<div class="flex relative flex-1 mr-16 max-w-xs w-full">
|
|
22
|
+
<!-- Close button -->
|
|
23
|
+
<div class="flex absolute left-full top-0 justify-center pt-5 w-16">
|
|
24
|
+
<button
|
|
25
|
+
type="button"
|
|
26
|
+
class="-m-2.5 p-2.5"
|
|
27
|
+
data-close-sidebar
|
|
28
|
+
>
|
|
29
|
+
<span class="sr-only">Close sidebar</span>
|
|
30
|
+
<div class="h-6 w-6 text-white i-hugeicons-cancel-01"></div>
|
|
31
|
+
</button>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<!-- Sidebar component -->
|
|
35
|
+
<div class="flex overflow-y-auto flex-col gap-y-5 grow pb-4 px-6 bg-white dark:bg-neutral-900">
|
|
36
|
+
<div class="flex items-center shrink-0 h-16">
|
|
37
|
+
<img
|
|
38
|
+
class="h-8 w-auto"
|
|
39
|
+
src="{{ companyLogo }}"
|
|
40
|
+
alt="{{ companyName }}"
|
|
41
|
+
>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
@endif
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
interface BaseModalProps {
|
|
3
|
+
id?: string
|
|
4
|
+
show?: boolean
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const { id = 'modal-' + Math.random().toString(36).slice(2, 11), show = true } = defineProps<BaseModalProps>()
|
|
8
|
+
</script>
|
|
9
|
+
<div
|
|
10
|
+
class="fixed inset-x-0 bottom-0 px-4 pb-6 sm:inset-0 sm:flex sm:items-center sm:justify-center sm:p-0 {{ show ? 'z-20' : 'z-[-1]' }}"
|
|
11
|
+
data-modal="{{ id }}"
|
|
12
|
+
>
|
|
13
|
+
<!-- Backdrop -->
|
|
14
|
+
<div
|
|
15
|
+
class="fixed inset-0 transition-opacity {{ show ? 'opacity-100' : 'opacity-0' }}"
|
|
16
|
+
data-backdrop
|
|
17
|
+
>
|
|
18
|
+
<div class="absolute inset-0 bg-gray-500 opacity-75"></div>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<span class="hidden sm:inline-block sm:h-screen sm:align-middle"></span>​
|
|
22
|
+
|
|
23
|
+
<!-- Modal content -->
|
|
24
|
+
<div
|
|
25
|
+
class="max-h-[32rem] max-w-md transform overflow-hidden overflow-y-auto rounded-lg bg-white px-4 pb-4 pt-5 shadow-xl transition-all md:max-w-xl sm:w-full dark:bg-neutral-700 sm:p-6 {{ show ? 'opacity-100 translate-y-0 sm:scale-100' : 'opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95' }}"
|
|
26
|
+
role="dialog"
|
|
27
|
+
aria-modal="true"
|
|
28
|
+
aria-labelledby="modal-headline"
|
|
29
|
+
>
|
|
30
|
+
<div class="absolute right-0 top-0 pr-4 pt-4">
|
|
31
|
+
<button
|
|
32
|
+
type="button"
|
|
33
|
+
class="text-gray-400 focus:text-gray-500 hover:text-neutral-500 focus:outline-none duration-150 ease-in-out transition"
|
|
34
|
+
aria-label="Close"
|
|
35
|
+
data-action="close"
|
|
36
|
+
>
|
|
37
|
+
<svg class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
38
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
|
|
39
|
+
</svg>
|
|
40
|
+
</button>
|
|
41
|
+
</div>
|
|
42
|
+
<div class="flex flex-col">
|
|
43
|
+
<slot name="body" />
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<div class="sm:flex sm:flex-row-reverse mt-5 space-y-4 sm:mt-4 md:space-y-0">
|
|
47
|
+
<slot name="actions" />
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
interface AlertProps {
|
|
3
|
+
title?: string
|
|
4
|
+
description?: string
|
|
5
|
+
type?: 'info' | 'warning' | 'danger' | 'success' | 'error'
|
|
6
|
+
confirmationText?: string
|
|
7
|
+
abortText?: string
|
|
8
|
+
show?: boolean
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const { title = '', description = '', type = 'info', confirmationText = 'Confirm', abortText = 'Cancel', show = true } = defineProps<AlertProps>()
|
|
12
|
+
|
|
13
|
+
function getButtonBackground() {
|
|
14
|
+
if (type === 'info') return 'bg-blue-600 hover:bg-blue-700 focus:ring-blue-500'
|
|
15
|
+
if (type === 'warning') return 'bg-yellow-600 hover:bg-yellow-700 focus:ring-yellow-500'
|
|
16
|
+
if (type === 'danger') return 'bg-red-600 hover:bg-red-700 focus:ring-red-500'
|
|
17
|
+
if (type === 'success') return 'bg-green-600 hover:bg-green-700 focus:ring-green-500'
|
|
18
|
+
return 'bg-white-600 hover:bg-gray-50'
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const buttonBackground = getButtonBackground()
|
|
22
|
+
</script>
|
|
23
|
+
@if(show)
|
|
24
|
+
<div class="sm:flex bottom-0 fixed inset-x-0 z-20 sm:inset-0 sm:items-center sm:justify-center pb-6 px-4 sm:p-0" data-alert-modal>
|
|
25
|
+
<!-- Backdrop -->
|
|
26
|
+
<div class="fixed inset-0 transition-opacity">
|
|
27
|
+
<div class="absolute inset-0 bg-gray-500 opacity-75"></div>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<span class="hidden sm:inline-block sm:h-screen sm:align-middle"></span>​
|
|
31
|
+
|
|
32
|
+
<!-- Modal content -->
|
|
33
|
+
<div
|
|
34
|
+
class="overflow-hidden overflow-y-auto pb-4 pt-5 px-4 sm:p-6 max-h-[32rem] max-w-md sm:w-full md:max-w-xl bg-white dark:bg-neutral-700 rounded-lg shadow-xl transition-all transform"
|
|
35
|
+
role="dialog"
|
|
36
|
+
aria-modal="true"
|
|
37
|
+
aria-labelledby="modal-title"
|
|
38
|
+
>
|
|
39
|
+
<div class="hidden sm:block absolute right-0 top-0 pr-4 pt-4">
|
|
40
|
+
<button
|
|
41
|
+
type="button"
|
|
42
|
+
class="text-gray-400 dark:text-neutral-200 hover:text-gray-500 dark:hover:text-gray-100 rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2"
|
|
43
|
+
data-action="close"
|
|
44
|
+
>
|
|
45
|
+
<span class="sr-only">Close</span>
|
|
46
|
+
<svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
|
|
47
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"></path>
|
|
48
|
+
</svg>
|
|
49
|
+
</button>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
<div class="sm:flex sm:items-start">
|
|
53
|
+
@if(type == 'warning')
|
|
54
|
+
<div class="flex flex-shrink-0 items-center justify-center mx-auto sm:mx-0 h-12 w-12 sm:h-10 sm:w-10 bg-yellow-100 rounded-full">
|
|
55
|
+
<svg class="h-6 w-6 text-yellow-600" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
|
|
56
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"></path>
|
|
57
|
+
</svg>
|
|
58
|
+
</div>
|
|
59
|
+
@elseif(type == 'success')
|
|
60
|
+
<div class="flex flex-shrink-0 items-center justify-center mx-auto sm:mx-0 h-12 w-12 sm:h-10 sm:w-10 bg-green-100 rounded-full">
|
|
61
|
+
<svg class="h-6 w-6 text-green-600" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
|
62
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
|
|
63
|
+
</svg>
|
|
64
|
+
</div>
|
|
65
|
+
@elseif(type == 'error')
|
|
66
|
+
<div class="flex flex-shrink-0 items-center justify-center mx-auto sm:mx-0 h-12 w-12 sm:h-10 sm:w-10 bg-red-100 rounded-full">
|
|
67
|
+
<svg class="h-6 w-6 text-red-600" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
|
68
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M9.75 9.75l4.5 4.5m0-4.5l-4.5 4.5M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
|
|
69
|
+
</svg>
|
|
70
|
+
</div>
|
|
71
|
+
@elseif(type == 'info')
|
|
72
|
+
<div class="flex flex-shrink-0 items-center justify-center mx-auto sm:mx-0 h-12 w-12 sm:h-10 sm:w-10 bg-blue-100 rounded-full">
|
|
73
|
+
<svg class="h-6 w-6 text-blue-600" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
|
74
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"></path>
|
|
75
|
+
</svg>
|
|
76
|
+
</div>
|
|
77
|
+
@endif
|
|
78
|
+
|
|
79
|
+
<div class="mt-3 sm:ml-4 sm:mt-0 text-center sm:text-left">
|
|
80
|
+
<h3 id="modal-title" class="font-medium leading-6 text-gray-900 text-lg dark:text-neutral-100">
|
|
81
|
+
{{ title }}
|
|
82
|
+
</h3>
|
|
83
|
+
<div class="mt-2">
|
|
84
|
+
<p class="text-gray-500 text-sm dark:text-neutral-400">
|
|
85
|
+
{{ description }}
|
|
86
|
+
</p>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
<div class="sm:flex sm:flex-row-reverse mt-5 space-y-4 sm:mt-4 md:space-y-0">
|
|
92
|
+
<button
|
|
93
|
+
type="button"
|
|
94
|
+
class="flex items-center primary-button {{ buttonBackground }} disabled:opacity-50 disabled:cursor-not-allowed"
|
|
95
|
+
data-action="confirm"
|
|
96
|
+
>
|
|
97
|
+
<span>{{ confirmationText }}</span>
|
|
98
|
+
</button>
|
|
99
|
+
|
|
100
|
+
@if(abortText)
|
|
101
|
+
<button
|
|
102
|
+
type="button"
|
|
103
|
+
class="mr-4 secondary-button"
|
|
104
|
+
data-action="cancel"
|
|
105
|
+
>
|
|
106
|
+
{{ abortText }}
|
|
107
|
+
</button>
|
|
108
|
+
@endif
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
@endif
|