@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,52 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
interface PaymentMethodListProps {
|
|
3
|
+
userId?: number
|
|
4
|
+
paymentMethods?: any[]
|
|
5
|
+
loading?: boolean
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const { userId = 1, paymentMethods = [], loading = false } = defineProps<PaymentMethodListProps>()
|
|
9
|
+
</script>
|
|
10
|
+
<div class="mt-4">
|
|
11
|
+
@if(loading)
|
|
12
|
+
<slot name="loading" />
|
|
13
|
+
@else
|
|
14
|
+
<ul role="list" class="grid gap-6 grid-cols-1 sm:grid-cols-1 lg:grid-cols-1">
|
|
15
|
+
@foreach(paymentMethods as method)
|
|
16
|
+
<li class="col-span-1 bg-white border divide-gray-200 divide-y rounded-lg shadow">
|
|
17
|
+
<div class="p-3 w-full">
|
|
18
|
+
<div class="flex items-center justify-between">
|
|
19
|
+
<div class="flex items-center space-x-4">
|
|
20
|
+
<slot name="cardBrand" />
|
|
21
|
+
<h2 class="text-gray-600 text-sm">
|
|
22
|
+
{{ method.brand }} •••• {{ method.last_four }} <br>
|
|
23
|
+
<span class="italic text-gray-500 text-xs">Expires {{ method.exp_month }} / {{ method.exp_year }}</span>
|
|
24
|
+
</h2>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<div class="flex justify-end space-x-4">
|
|
28
|
+
<button
|
|
29
|
+
type="button"
|
|
30
|
+
class="px-2 py-1 font-semibold text-sm text-white bg-white hover:bg-neutral-50 border rounded-md focus-visible:outline focus-visible:outline-2 focus-visible:outline-blue-600 focus-visible:outline-offset-2 shadow-sm"
|
|
31
|
+
data-action="make-default"
|
|
32
|
+
data-method-id="{{ method.id }}"
|
|
33
|
+
>
|
|
34
|
+
<span class="text-gray-700 i-hugeicons-star"></span>
|
|
35
|
+
</button>
|
|
36
|
+
|
|
37
|
+
<button
|
|
38
|
+
type="button"
|
|
39
|
+
class="px-2 py-1 font-semibold text-sm text-white bg-white hover:bg-neutral-50 border rounded-md focus-visible:outline focus-visible:outline-2 focus-visible:outline-blue-600 focus-visible:outline-offset-2 shadow-sm"
|
|
40
|
+
data-action="delete"
|
|
41
|
+
data-method-id="{{ method.id }}"
|
|
42
|
+
>
|
|
43
|
+
<span class="text-gray-700 i-hugeicons-trash"></span>
|
|
44
|
+
</button>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
</li>
|
|
49
|
+
@endforeach
|
|
50
|
+
</ul>
|
|
51
|
+
@endif
|
|
52
|
+
</div>
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
interface PlansProps {
|
|
3
|
+
currentPlan?: any
|
|
4
|
+
hasPaymentMethods?: boolean
|
|
5
|
+
updatingPlanState?: boolean
|
|
6
|
+
hobbyMonthlyPrice?: number
|
|
7
|
+
hobbyYearlyPrice?: number
|
|
8
|
+
hobbyLifetimePrice?: number
|
|
9
|
+
proMonthlyPrice?: number
|
|
10
|
+
proYearlyPrice?: number
|
|
11
|
+
proLifetimePrice?: number
|
|
12
|
+
showPlans?: boolean
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const { currentPlan = null, hasPaymentMethods = false, updatingPlanState = false, hobbyMonthlyPrice = 39, hobbyYearlyPrice = 379, hobbyLifetimePrice = 479, proMonthlyPrice = 59, proYearlyPrice = 579, proLifetimePrice = 749, showPlans = true } = defineProps<PlansProps>()
|
|
16
|
+
|
|
17
|
+
// Pricing data
|
|
18
|
+
</script>
|
|
19
|
+
<div class="w-full">
|
|
20
|
+
<div class="flex items-center justify-between">
|
|
21
|
+
<div class="flex items-center space-x-2">
|
|
22
|
+
<h2 class="font-medium text-gray-900 text-lg">
|
|
23
|
+
Dashboard Plans
|
|
24
|
+
</h2>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<div>
|
|
28
|
+
<div class="flex justify-center">
|
|
29
|
+
<fieldset aria-label="Payment frequency">
|
|
30
|
+
<div class="grid gap-x-1 grid-cols-3 p-1 font-semibold text-center text-xs/5 ring-1 ring-gray-200 ring-inset rounded-full" data-plan-type-selector>
|
|
31
|
+
<label class="px-2.5 py-1 text-white bg-blue-600 rounded-full cursor-pointer" data-plan-type="monthly">
|
|
32
|
+
<input type="radio" name="frequency" value="monthly" class="sr-only" checked>
|
|
33
|
+
<span>Monthly</span>
|
|
34
|
+
</label>
|
|
35
|
+
|
|
36
|
+
<label class="px-2.5 py-1 rounded-full cursor-pointer" data-plan-type="annually">
|
|
37
|
+
<input type="radio" name="frequency" value="annually" class="sr-only">
|
|
38
|
+
<span>Annually</span>
|
|
39
|
+
</label>
|
|
40
|
+
|
|
41
|
+
<label class="px-2.5 py-1 rounded-full cursor-pointer" data-plan-type="lifetime">
|
|
42
|
+
<input type="radio" name="frequency" value="lifetime" class="sr-only">
|
|
43
|
+
<span>Lifetime</span>
|
|
44
|
+
</label>
|
|
45
|
+
</div>
|
|
46
|
+
</fieldset>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<div class="pt-8">
|
|
52
|
+
<p class="font-semibold text-gray-800">
|
|
53
|
+
Choose one of the recurring plans.
|
|
54
|
+
</p>
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
<div class="pt-8">
|
|
58
|
+
<fieldset>
|
|
59
|
+
<div class="space-y-4">
|
|
60
|
+
<!-- Hobby Plan -->
|
|
61
|
+
<label class="block sm:flex relative sm:justify-between px-6 py-4 bg-white border rounded-lg focus:outline-none shadow-sm cursor-pointer" data-plan="hobby">
|
|
62
|
+
<input type="radio" name="selected-plan" value="hobby" class="sr-only">
|
|
63
|
+
<span class="flex items-center">
|
|
64
|
+
<span class="flex flex-col text-sm">
|
|
65
|
+
<div class="flex">
|
|
66
|
+
<span class="font-medium text-gray-900">Hobby</span>
|
|
67
|
+
</div>
|
|
68
|
+
<p class="pt-2 text-gray-600 text-xs">
|
|
69
|
+
All Stacks features are included.
|
|
70
|
+
</p>
|
|
71
|
+
</span>
|
|
72
|
+
</span>
|
|
73
|
+
<span class="flex sm:flex-col mt-2 sm:ml-4 sm:mt-0 text-sm sm:text-right">
|
|
74
|
+
<span class="font-medium text-gray-900" data-hobby-price>$ {{ hobbyMonthlyPrice }}</span>
|
|
75
|
+
<span class="ml-1 sm:ml-0 text-gray-500" data-per-text>/month</span>
|
|
76
|
+
</span>
|
|
77
|
+
<span class="absolute border rounded-lg pointer-events-none -inset-px" aria-hidden="true"></span>
|
|
78
|
+
</label>
|
|
79
|
+
|
|
80
|
+
<!-- Pro Plan -->
|
|
81
|
+
<label class="block sm:flex relative sm:justify-between px-6 py-4 bg-white border rounded-lg focus:outline-none shadow-sm cursor-pointer" data-plan="pro">
|
|
82
|
+
<input type="radio" name="selected-plan" value="pro" class="sr-only">
|
|
83
|
+
<span class="flex items-center">
|
|
84
|
+
<span class="flex flex-col text-sm">
|
|
85
|
+
<div class="flex">
|
|
86
|
+
<span class="font-medium text-gray-900">Pro</span>
|
|
87
|
+
</div>
|
|
88
|
+
<p class="pt-2 text-gray-600 text-xs">
|
|
89
|
+
All Stacks features are included & being able to invite team members.
|
|
90
|
+
</p>
|
|
91
|
+
</span>
|
|
92
|
+
</span>
|
|
93
|
+
<span class="flex sm:flex-col mt-2 sm:ml-4 sm:mt-0 text-sm sm:text-right">
|
|
94
|
+
<span class="font-medium text-gray-900" data-pro-price>${{ proMonthlyPrice }}</span>
|
|
95
|
+
<span class="ml-1 sm:ml-0 text-gray-500" data-per-text>/month</span>
|
|
96
|
+
</span>
|
|
97
|
+
<span class="absolute border rounded-lg pointer-events-none -inset-px" aria-hidden="true"></span>
|
|
98
|
+
</label>
|
|
99
|
+
</div>
|
|
100
|
+
</fieldset>
|
|
101
|
+
</div>
|
|
102
|
+
|
|
103
|
+
@if(showPlans)
|
|
104
|
+
<div class="flex justify-end pt-8">
|
|
105
|
+
<button
|
|
106
|
+
type="button"
|
|
107
|
+
class="px-2.5 py-1.5 font-semibold text-sm text-white bg-blue-600 disabled:bg-gray-600 hover:bg-neutral-500 rounded-md focus-visible:outline focus-visible:outline-2 focus-visible:outline-blue-600 focus-visible:outline-offset-2 shadow-sm"
|
|
108
|
+
@if(!hasPaymentMethods) disabled @endif
|
|
109
|
+
data-action="subscribe"
|
|
110
|
+
>
|
|
111
|
+
Subscribe
|
|
112
|
+
</button>
|
|
113
|
+
</div>
|
|
114
|
+
@endif
|
|
115
|
+
|
|
116
|
+
@if(updatingPlanState)
|
|
117
|
+
<div class="flex justify-end pt-8">
|
|
118
|
+
<button
|
|
119
|
+
type="button"
|
|
120
|
+
class="px-2.5 py-1.5 font-semibold text-gray-900 text-sm bg-white hover:bg-gray-50 ring-1 ring-gray-300 ring-inset rounded-md shadow-sm"
|
|
121
|
+
data-action="cancel-edit"
|
|
122
|
+
>
|
|
123
|
+
Cancel Plan
|
|
124
|
+
</button>
|
|
125
|
+
|
|
126
|
+
<button
|
|
127
|
+
type="button"
|
|
128
|
+
class="ml-4 px-2.5 py-1.5 font-semibold text-sm text-white bg-blue-600 disabled:bg-gray-600 hover:bg-neutral-500 rounded-md focus-visible:outline focus-visible:outline-2 focus-visible:outline-blue-600 focus-visible:outline-offset-2 shadow-sm"
|
|
129
|
+
@if(!hasPaymentMethods) disabled @endif
|
|
130
|
+
data-action="update-plan"
|
|
131
|
+
>
|
|
132
|
+
Update Plan
|
|
133
|
+
</button>
|
|
134
|
+
</div>
|
|
135
|
+
@endif
|
|
136
|
+
</div>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<script server>
|
|
2
|
+
interface AppButtonProps {
|
|
3
|
+
buttonText?: string
|
|
4
|
+
loadingText?: string
|
|
5
|
+
passedClass?: string
|
|
6
|
+
loading?: boolean
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const { buttonText = '', loadingText = '', passedClass = '', loading = false } = defineProps<AppButtonProps>()
|
|
10
|
+
|
|
11
|
+
const buttonString = loading ? loadingText : buttonText
|
|
12
|
+
const disabledClass = ' disabled:opacity-50 disabled:cursor-not-allowed'
|
|
13
|
+
const finalClass = passedClass + disabledClass
|
|
14
|
+
</script>
|
|
15
|
+
<button
|
|
16
|
+
type="button"
|
|
17
|
+
class="flex items-center {{ finalClass }}"
|
|
18
|
+
@if(loading) disabled @endif
|
|
19
|
+
>
|
|
20
|
+
@if(loading)
|
|
21
|
+
<svg
|
|
22
|
+
class="-ml-1 mr-3 h-5 w-5 text-white animate-spin"
|
|
23
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
24
|
+
fill="none"
|
|
25
|
+
viewBox="0 0 24 24"
|
|
26
|
+
>
|
|
27
|
+
<circle
|
|
28
|
+
class="opacity-25"
|
|
29
|
+
cx="12"
|
|
30
|
+
cy="12"
|
|
31
|
+
r="10"
|
|
32
|
+
stroke="currentColor"
|
|
33
|
+
stroke-width="4"
|
|
34
|
+
></circle>
|
|
35
|
+
<path
|
|
36
|
+
class="opacity-75"
|
|
37
|
+
fill="currentColor"
|
|
38
|
+
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
39
|
+
></path>
|
|
40
|
+
</svg>
|
|
41
|
+
@else
|
|
42
|
+
<slot name="icon" />
|
|
43
|
+
@endif
|
|
44
|
+
|
|
45
|
+
<span>
|
|
46
|
+
{{ buttonString }}
|
|
47
|
+
</span>
|
|
48
|
+
</button>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script server>
|
|
2
|
+
interface IconButtonProps {
|
|
3
|
+
to?: string
|
|
4
|
+
active?: boolean
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const { to = '', active = false } = defineProps<IconButtonProps>()
|
|
8
|
+
</script>
|
|
9
|
+
<a
|
|
10
|
+
href="{{ to }}"
|
|
11
|
+
class="bg-primary flex flex-row items-center gap-2 rounded-md p-1 {{ active ? 'dark:bg-neutral-700 bg-neutral-50 dark:text-blue-300 text-gray-600' : '' }}"
|
|
12
|
+
>
|
|
13
|
+
<div class="flex relative items-center justify-center p-1 bg-gray-8 rounded-md">
|
|
14
|
+
<span class="h-6 w-6 text-white"></span>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<span class="!text-sm text-gray-8">
|
|
18
|
+
<slot />
|
|
19
|
+
</span>
|
|
20
|
+
</a>
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Custom Dashboard Card Component
|
|
3
|
+
|
|
4
|
+
A flexible card component for dashboard content.
|
|
5
|
+
|
|
6
|
+
Usage:
|
|
7
|
+
<Card title="My Card" :actions="[{ label: 'Action', onClick: handleClick }]">
|
|
8
|
+
<p>Card content here</p>
|
|
9
|
+
</Card>
|
|
10
|
+
-->
|
|
11
|
+
|
|
12
|
+
<script>
|
|
13
|
+
interface CardProps {
|
|
14
|
+
title?: string
|
|
15
|
+
subtitle?: string
|
|
16
|
+
actions?: any[]
|
|
17
|
+
padding?: boolean
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const { title, subtitle, actions, padding } = defineProps<CardProps>()
|
|
21
|
+
</script>
|
|
22
|
+
<div class="dashboard-card">
|
|
23
|
+
@if (title || actions.length > 0)
|
|
24
|
+
<div class="dashboard-card-header">
|
|
25
|
+
<div>
|
|
26
|
+
@if (title)
|
|
27
|
+
<h3 class="dashboard-card-title">{{ title }}</h3>
|
|
28
|
+
@endif
|
|
29
|
+
@if (subtitle)
|
|
30
|
+
<p class="dashboard-card-subtitle">{{ subtitle }}</p>
|
|
31
|
+
@endif
|
|
32
|
+
</div>
|
|
33
|
+
@if (actions.length > 0)
|
|
34
|
+
<div class="dashboard-card-actions">
|
|
35
|
+
@foreach (actions as action)
|
|
36
|
+
<button class="btn btn-ghost btn-sm" @click="action.onClick">
|
|
37
|
+
{{ action.label }}
|
|
38
|
+
</button>
|
|
39
|
+
@endforeach
|
|
40
|
+
</div>
|
|
41
|
+
@endif
|
|
42
|
+
</div>
|
|
43
|
+
@endif
|
|
44
|
+
<div class="{{ padding ? 'dashboard-card-content' : '' }}">
|
|
45
|
+
<slot></slot>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
<style>
|
|
49
|
+
.dashboard-card {
|
|
50
|
+
background: var(--color-bg-card);
|
|
51
|
+
border: 1px solid var(--color-border);
|
|
52
|
+
border-radius: 0.75rem;
|
|
53
|
+
overflow: hidden;
|
|
54
|
+
}
|
|
55
|
+
.dashboard-card-header {
|
|
56
|
+
display: flex;
|
|
57
|
+
justify-content: space-between;
|
|
58
|
+
align-items: center;
|
|
59
|
+
padding: 1rem 1.25rem;
|
|
60
|
+
border-bottom: 1px solid var(--color-border);
|
|
61
|
+
}
|
|
62
|
+
.dashboard-card-title {
|
|
63
|
+
font-size: 0.9375rem;
|
|
64
|
+
font-weight: 600;
|
|
65
|
+
}
|
|
66
|
+
.dashboard-card-subtitle {
|
|
67
|
+
font-size: 0.8125rem;
|
|
68
|
+
color: var(--color-text-muted);
|
|
69
|
+
margin-top: 0.125rem;
|
|
70
|
+
}
|
|
71
|
+
.dashboard-card-actions {
|
|
72
|
+
display: flex;
|
|
73
|
+
gap: 0.5rem;
|
|
74
|
+
}
|
|
75
|
+
.dashboard-card-content {
|
|
76
|
+
padding: 1.25rem;
|
|
77
|
+
}
|
|
78
|
+
</style>
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Custom Dashboard Chart Component
|
|
3
|
+
|
|
4
|
+
A placeholder chart component for dashboard visualizations.
|
|
5
|
+
Integrate with your preferred charting library (Chart.js, D3, etc.)
|
|
6
|
+
|
|
7
|
+
Usage:
|
|
8
|
+
<Chart type="line" :data="chartData" :options="chartOptions" />
|
|
9
|
+
-->
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
interface ChartProps {
|
|
13
|
+
type?: string
|
|
14
|
+
data: Record<string, any>
|
|
15
|
+
options?: Record<string, any>
|
|
16
|
+
height?: string
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const { type = 'line', data, options = {}, height = '300px' } = defineProps<ChartProps>()
|
|
20
|
+
</script>
|
|
21
|
+
<div class="dashboard-chart" style="height: {{ height }};">
|
|
22
|
+
<div class="chart-placeholder">
|
|
23
|
+
<div class="chart-icon">📊</div>
|
|
24
|
+
<div class="chart-text">{{ type.charAt(0).toUpperCase() + type.slice(1) }} Chart</div>
|
|
25
|
+
<div class="chart-hint">
|
|
26
|
+
Integrate with Chart.js, D3, or your preferred library
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
<!--
|
|
30
|
+
To use with Chart.js:
|
|
31
|
+
<canvas ref="chartCanvas"></canvas>
|
|
32
|
+
|
|
33
|
+
<script client>
|
|
34
|
+
import Chart from '@stacksjs/charts'
|
|
35
|
+
|
|
36
|
+
</script>
|
|
37
|
+
-->
|
|
38
|
+
</div>
|
|
39
|
+
<script client>
|
|
40
|
+
import { onMount } from 'stx'
|
|
41
|
+
|
|
42
|
+
onMount(() => {
|
|
43
|
+
new Chart(chartCanvas, {
|
|
44
|
+
type: type,
|
|
45
|
+
data: data,
|
|
46
|
+
options: options
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<style>
|
|
52
|
+
.dashboard-chart {
|
|
53
|
+
background: var(--color-bg-subtle);
|
|
54
|
+
border-radius: 0.5rem;
|
|
55
|
+
display: flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
justify-content: center;
|
|
58
|
+
}
|
|
59
|
+
.chart-placeholder {
|
|
60
|
+
text-align: center;
|
|
61
|
+
color: var(--color-text-muted);
|
|
62
|
+
}
|
|
63
|
+
.chart-icon {
|
|
64
|
+
font-size: 2.5rem;
|
|
65
|
+
margin-bottom: 0.5rem;
|
|
66
|
+
}
|
|
67
|
+
.chart-text {
|
|
68
|
+
font-weight: 500;
|
|
69
|
+
margin-bottom: 0.25rem;
|
|
70
|
+
}
|
|
71
|
+
.chart-hint {
|
|
72
|
+
font-size: 0.75rem;
|
|
73
|
+
opacity: 0.7;
|
|
74
|
+
}
|
|
75
|
+
</style>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
interface CodeEditorProps {
|
|
3
|
+
live?: boolean
|
|
4
|
+
lang?: string
|
|
5
|
+
theme?: string
|
|
6
|
+
content?: string
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const { live = false, lang = 'typescript', theme = 'github_dark', content = `echo 'Hello World!' } = defineProps<CodeEditorProps>()
|
|
10
|
+
|
|
11
|
+
mv ./test/test.ts ./jello
|
|
12
|
+
cp`
|
|
13
|
+
</script>
|
|
14
|
+
<header class="flex items-center justify-between p-4 bg-[#1f2428] border-[#30363d] border-b rounded-t-lg">
|
|
15
|
+
<div class="flex gap-2 items-center">
|
|
16
|
+
<div class="h-3 w-3 bg-[#f85149] rounded-full"></div>
|
|
17
|
+
<div class="h-3 w-3 bg-[#db9d16] rounded-full"></div>
|
|
18
|
+
<div class="h-3 w-3 bg-[#2ea043] rounded-full"></div>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
@if(!live)
|
|
22
|
+
<span class="font-mono text-[#c9d1d9] text-sm">Deploy Script</span>
|
|
23
|
+
@else
|
|
24
|
+
<span class="font-mono text-[#c9d1d9] text-sm">Live Terminal Output</span>
|
|
25
|
+
@endif
|
|
26
|
+
</header>
|
|
27
|
+
|
|
28
|
+
<div class="bg-[#0d1117] rounded-b-lg vue-ace-editor" style="height: 300px; font-size: 14px;">
|
|
29
|
+
<pre class="p-4 font-mono text-[#c9d1d9] text-sm">{{ content }}</pre>
|
|
30
|
+
</div>
|
|
31
|
+
<style>
|
|
32
|
+
select {
|
|
33
|
+
margin-right: 15px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.vue-ace-editor {
|
|
37
|
+
font-size: 14px;
|
|
38
|
+
flex: 1;
|
|
39
|
+
font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
|
|
40
|
+
}
|
|
41
|
+
</style>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
interface BulkActionBarProps {
|
|
3
|
+
selectedCount?: number
|
|
4
|
+
defaultActions?: string
|
|
5
|
+
actions?: string
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const { selectedCount = 0, defaultActions = [, actions } = defineProps<BulkActionBarProps>()
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* BulkActionBar Component
|
|
12
|
+
*
|
|
13
|
+
* Displays a sticky action bar when items are selected in a table.
|
|
14
|
+
* Provides bulk operations like delete, status change, and export.
|
|
15
|
+
*
|
|
16
|
+
* Props:
|
|
17
|
+
* selectedCount - Number of selected items
|
|
18
|
+
* actions - Array of { label, icon, variant, action } objects
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
{ label: 'Delete', icon: 'i-hugeicons-delete-02', variant: 'danger' },
|
|
22
|
+
{ label: 'Export', icon: 'i-hugeicons-download-04', variant: 'secondary' },
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
function handleAction(action) {
|
|
26
|
+
$emit('action', action)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function handleDeselectAll() {
|
|
30
|
+
$emit('deselect-all')
|
|
31
|
+
}
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
@if(selectedCount > 0)
|
|
35
|
+
<div class="flex sticky top-0 z-10 gap-4 items-center justify-between mb-4 px-4 py-3 bg-blue-50 dark:bg-blue-900/30 border border-blue-200 rounded-lg dark:border-blue-800">
|
|
36
|
+
<div class="flex gap-3 items-center">
|
|
37
|
+
<span class="inline-flex items-center justify-center h-6 w-6 font-bold text-white text-xs bg-blue-600 rounded-full">
|
|
38
|
+
{{ selectedCount }}
|
|
39
|
+
</span>
|
|
40
|
+
<span class="font-medium text-blue-800 text-sm dark:text-blue-200">
|
|
41
|
+
{{ selectedCount === 1 ? '1 item selected' : `${selectedCount} items selected` }}
|
|
42
|
+
</span>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
<div class="flex gap-2 items-center">
|
|
46
|
+
@for(action in defaultActions)
|
|
47
|
+
<button
|
|
48
|
+
type="button"
|
|
49
|
+
class="inline-flex gap-1.5 items-center px-3 py-1.5 font-medium text-sm rounded-md transition-colors"
|
|
50
|
+
:class="dark:text-blue-300 dark:text-red-300 bg-blue-100 bg-red-100 dark:bg-blue-900/50 dark:bg-red-900/50 hover:bg-blue-200 hover:bg-red-200 dark:hover:bg-blue-900/70' dark:hover:bg-red-900/70' : ? 'danger' 'text-blue-700 'text-red-700 === action.variant"
|
|
51
|
+
@click="handleAction(action)"
|
|
52
|
+
>
|
|
53
|
+
<div :class="action.icon" class="h-4 w-4"></div>
|
|
54
|
+
{{ action.label }}
|
|
55
|
+
</button>
|
|
56
|
+
@endfor
|
|
57
|
+
|
|
58
|
+
<button
|
|
59
|
+
type="button"
|
|
60
|
+
class="ml-2 p-1.5 text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-200 transition-colors"
|
|
61
|
+
@click="handleDeselectAll"
|
|
62
|
+
title="Deselect all"
|
|
63
|
+
>
|
|
64
|
+
<svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
65
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
|
|
66
|
+
</svg>
|
|
67
|
+
</button>
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
@endif
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
interface CategoriesTableProps {
|
|
3
|
+
categories?: any[]
|
|
4
|
+
searchQuery?: string
|
|
5
|
+
featuredFilter?: string
|
|
6
|
+
sortBy?: string
|
|
7
|
+
sortOrder?: string
|
|
8
|
+
currentPage?: number
|
|
9
|
+
itemsPerPage?: number
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const { categories = [], searchQuery = '', featuredFilter = '', sortBy = 'name', sortOrder = 'asc', currentPage = 1, itemsPerPage = 10 } = defineProps<CategoriesTableProps>()
|
|
13
|
+
|
|
14
|
+
// Color mapping for initial letters
|
|
15
|
+
const initialColors = {
|
|
16
|
+
'Burgers': 'bg-red-500',
|
|
17
|
+
'Mexican': 'bg-green-500',
|
|
18
|
+
'Desserts': 'bg-purple-500',
|
|
19
|
+
'Asian Fusion': 'bg-blue-500'
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function getInitialColor(name) {
|
|
23
|
+
return initialColors[name] || 'bg-blue-500'
|
|
24
|
+
}
|
|
25
|
+
</script>
|
|
26
|
+
<!-- Categories table -->
|
|
27
|
+
<div class="overflow-hidden border border-stone-200/80 rounded-xl dark:border-neutral-700 shadow-sm">
|
|
28
|
+
<table class="min-w-full divide-stone-100 divide-y dark:divide-neutral-700">
|
|
29
|
+
<thead class="bg-stone-50/80 dark:bg-neutral-800">
|
|
30
|
+
<tr>
|
|
31
|
+
<th scope="col" class="pl-6 pr-3 py-3.5 font-semibold text-left text-stone-500 text-xs tracking-wider uppercase dark:text-neutral-400">
|
|
32
|
+
<button class="inline-flex items-center group" data-action="sort" data-column="name">
|
|
33
|
+
Category
|
|
34
|
+
<span class="group-hover:visible flex-none ml-2 text-stone-400 rounded group-focus-visible">
|
|
35
|
+
@if(sortBy == 'name')
|
|
36
|
+
<div class="{{ sortOrder == 'asc' ? 'i-hugeicons-arrow-up-02' : 'i-hugeicons-arrow-down-02' }} h-3.5 w-3.5"></div>
|
|
37
|
+
@else
|
|
38
|
+
<div class="h-3.5 w-3.5 i-hugeicons-arrows-up-down"></div>
|
|
39
|
+
@endif
|
|
40
|
+
</span>
|
|
41
|
+
</button>
|
|
42
|
+
</th>
|
|
43
|
+
<th scope="col" class="px-3 py-3.5 font-semibold text-left text-stone-500 text-xs tracking-wider uppercase dark:text-neutral-400">Description</th>
|
|
44
|
+
<th scope="col" class="px-3 py-3.5 font-semibold text-left text-stone-500 text-xs tracking-wider uppercase dark:text-neutral-400">
|
|
45
|
+
<button class="inline-flex items-center group" data-action="sort" data-column="display_order">
|
|
46
|
+
Display Order
|
|
47
|
+
<span class="group-hover:visible flex-none ml-2 text-stone-400 rounded group-focus-visible">
|
|
48
|
+
@if(sortBy == 'display_order')
|
|
49
|
+
<div class="{{ sortOrder == 'asc' ? 'i-hugeicons-arrow-up-02' : 'i-hugeicons-arrow-down-02' }} h-3.5 w-3.5"></div>
|
|
50
|
+
@else
|
|
51
|
+
<div class="h-3.5 w-3.5 i-hugeicons-arrows-up-down"></div>
|
|
52
|
+
@endif
|
|
53
|
+
</span>
|
|
54
|
+
</button>
|
|
55
|
+
</th>
|
|
56
|
+
<th scope="col" class="px-3 py-3.5 font-semibold text-left text-stone-500 text-xs tracking-wider uppercase dark:text-neutral-400">Active</th>
|
|
57
|
+
<th scope="col" class="relative pl-3 pr-6 py-3.5">
|
|
58
|
+
<span class="sr-only">Actions</span>
|
|
59
|
+
</th>
|
|
60
|
+
</tr>
|
|
61
|
+
</thead>
|
|
62
|
+
<tbody class="bg-white dark:bg-neutral-800 divide-stone-100 divide-y dark:divide-neutral-700">
|
|
63
|
+
@foreach(categories as category)
|
|
64
|
+
<tr class="hover:bg-stone-50/50 dark:hover:bg-neutral-700/50 transition-colors">
|
|
65
|
+
<td class="pl-6 pr-3 py-3.5 font-medium text-sm text-stone-800 whitespace-nowrap dark:text-white">
|
|
66
|
+
<div class="flex items-center space-x-3">
|
|
67
|
+
@if(category.image_url)
|
|
68
|
+
<img
|
|
69
|
+
src="{{ category.image_url }}"
|
|
70
|
+
alt="{{ category.name }}"
|
|
71
|
+
class="object-cover h-10 w-10 border border-stone-200 rounded-full dark:border-neutral-700 shadow-sm"
|
|
72
|
+
>
|
|
73
|
+
@else
|
|
74
|
+
<div class="h-10 w-10 rounded-full flex items-center justify-center text-white font-medium shadow-sm {{ getInitialColor(category.name) }}">
|
|
75
|
+
{{ category.name ? category.name.charAt(0).toUpperCase() : '?' }}
|
|
76
|
+
</div>
|
|
77
|
+
@endif
|
|
78
|
+
<span>{{ category.name }}</span>
|
|
79
|
+
</div>
|
|
80
|
+
</td>
|
|
81
|
+
<td class="px-3 py-3.5 text-sm text-stone-500 dark:text-neutral-300">
|
|
82
|
+
{{ category.description || 'No description' }}
|
|
83
|
+
</td>
|
|
84
|
+
<td class="px-3 py-3.5 text-sm text-stone-500 whitespace-nowrap dark:text-neutral-300">
|
|
85
|
+
{{ category.display_order }}
|
|
86
|
+
</td>
|
|
87
|
+
<td class="px-3 py-3.5 text-sm text-stone-500 whitespace-nowrap dark:text-neutral-300">
|
|
88
|
+
@if(category.is_active)
|
|
89
|
+
<div class="h-5 w-5 text-green-500 i-hugeicons-checkmark-circle-02"></div>
|
|
90
|
+
@else
|
|
91
|
+
<div class="h-5 w-5 text-stone-400 i-hugeicons-cancel-circle"></div>
|
|
92
|
+
@endif
|
|
93
|
+
</td>
|
|
94
|
+
<td class="relative pl-3 pr-6 py-3.5 font-medium text-right text-sm whitespace-nowrap">
|
|
95
|
+
<div class="flex items-center justify-end space-x-2">
|
|
96
|
+
<button
|
|
97
|
+
type="button"
|
|
98
|
+
class="text-stone-400 dark:text-blue-400 hover:text-blue-900 dark:hover:text-blue-300 duration-150 transition-colors"
|
|
99
|
+
data-action="view"
|
|
100
|
+
data-category-id="{{ category.id }}"
|
|
101
|
+
>
|
|
102
|
+
<div class="h-5 w-5 i-hugeicons-view"></div>
|
|
103
|
+
</button>
|
|
104
|
+
<button
|
|
105
|
+
type="button"
|
|
106
|
+
class="text-stone-400 dark:text-blue-400 hover:text-blue-900 dark:hover:text-blue-300 duration-150 transition-colors"
|
|
107
|
+
data-action="edit"
|
|
108
|
+
data-category-id="{{ category.id }}"
|
|
109
|
+
>
|
|
110
|
+
<div class="h-5 w-5 i-hugeicons-edit-01"></div>
|
|
111
|
+
</button>
|
|
112
|
+
<button
|
|
113
|
+
type="button"
|
|
114
|
+
class="text-stone-400 dark:text-red-400 hover:text-red-900 dark:hover:text-red-300 duration-150 transition-colors"
|
|
115
|
+
data-action="delete"
|
|
116
|
+
data-category-id="{{ category.id }}"
|
|
117
|
+
>
|
|
118
|
+
<div class="h-5 w-5 i-hugeicons-waste"></div>
|
|
119
|
+
</button>
|
|
120
|
+
</div>
|
|
121
|
+
</td>
|
|
122
|
+
</tr>
|
|
123
|
+
@endforeach
|
|
124
|
+
@if(categories.length == 0)
|
|
125
|
+
<tr>
|
|
126
|
+
<td colspan="5" class="px-6 py-3.5 text-center text-sm text-stone-500 dark:text-neutral-400">
|
|
127
|
+
No categories found matching your criteria
|
|
128
|
+
</td>
|
|
129
|
+
</tr>
|
|
130
|
+
@endif
|
|
131
|
+
</tbody>
|
|
132
|
+
</table>
|
|
133
|
+
</div>
|