@stacksjs/defaults 0.75.528 → 0.75.535

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.
Files changed (248) hide show
  1. package/ai/skills/stacks-actions/SKILL.md +1 -1
  2. package/ai/skills/stacks-build/SKILL.md +1 -1
  3. package/ai/skills/stacks-dashboard/SKILL.md +2 -2
  4. package/ai/skills/stacks-database/SKILL.md +1 -1
  5. package/ai/skills/stacks-migrations/SKILL.md +2 -2
  6. package/ai/skills/stacks-native/CATALOG.md +4 -4
  7. package/app/Actions/Dashboard/Commerce/CommerceCouponsAction.ts +27 -15
  8. package/app/Actions/Dashboard/Commerce/CommerceCouponsExportAction.ts +45 -0
  9. package/app/Actions/Dashboard/Commerce/CommerceCustomersAction.ts +22 -12
  10. package/app/Actions/Dashboard/Commerce/CommerceCustomersExportAction.ts +44 -0
  11. package/app/Actions/Dashboard/Commerce/CommercePosCheckoutAction.ts +9 -29
  12. package/app/Actions/Dashboard/Commerce/CommercePrintDevicesAction.ts +7 -9
  13. package/app/Actions/Dashboard/Commerce/CommerceProductDetailAction.ts +9 -8
  14. package/app/Actions/Dashboard/Commerce/CommerceTaxesAction.ts +7 -9
  15. package/app/Actions/Dashboard/Commerce/ManufacturerIndexAction.ts +8 -20
  16. package/app/Actions/Dashboard/Commerce/commerce-coupon-list.test.ts +203 -0
  17. package/app/Actions/Dashboard/Commerce/commerce-coupon-list.ts +248 -0
  18. package/app/Actions/Dashboard/Commerce/commerce-customer-list.test.ts +183 -0
  19. package/app/Actions/Dashboard/Commerce/commerce-customer-list.ts +186 -0
  20. package/app/Actions/Dashboard/Commerce/commerce-customer-records.test.ts +1 -34
  21. package/app/Actions/Dashboard/Commerce/commerce-customer-records.ts +0 -11
  22. package/app/Actions/Dashboard/Commerce/commerce-manufacturer-list.test.ts +118 -0
  23. package/app/Actions/Dashboard/Commerce/commerce-manufacturer-list.ts +41 -0
  24. package/app/Actions/Dashboard/Commerce/commerce-pos-catalog.test.ts +17 -5
  25. package/app/Actions/Dashboard/Commerce/commerce-pos-catalog.ts +17 -3
  26. package/app/Actions/Dashboard/Commerce/commerce-print-device-list.test.ts +99 -0
  27. package/app/Actions/Dashboard/Commerce/commerce-print-device-list.ts +18 -0
  28. package/app/Actions/Dashboard/Commerce/commerce-product-list.ts +5 -5
  29. package/app/Actions/Dashboard/Commerce/commerce-product-options.test.ts +81 -0
  30. package/app/Actions/Dashboard/Commerce/commerce-tax-rate-list.test.ts +99 -0
  31. package/app/Actions/Dashboard/Commerce/commerce-tax-rate-list.ts +18 -0
  32. package/app/Actions/Dashboard/Commerce/coupon-records.test.ts +1 -16
  33. package/app/Actions/Dashboard/Commerce/coupon-records.ts +6 -10
  34. package/app/Actions/Dashboard/Commerce/manufacturer-records.test.ts +5 -17
  35. package/app/Actions/Dashboard/Commerce/manufacturer-records.ts +0 -29
  36. package/app/Actions/Dashboard/Email/captured-mail.test.ts +16 -0
  37. package/app/Actions/Dashboard/Email/captured-mail.ts +9 -1
  38. package/app/Actions/Dashboard/Models/model-write.ts +36 -3
  39. package/app/Actions/Dashboard/Notifications/NotificationDeliveryHistoryAction.ts +13 -58
  40. package/app/Actions/Dashboard/Notifications/notification-delivery-history.ts +74 -0
  41. package/app/Actions/SitemapAction.ts +3 -1
  42. package/app/Models/Notification.ts +3 -1
  43. package/app/Models/NotificationDelivery.ts +4 -0
  44. package/app/Models/User.ts +10 -1
  45. package/bootstrap.ts +10 -2
  46. package/functions/commerce/tax-types.ts +21 -0
  47. package/functions/dashboard-list.test.ts +16 -0
  48. package/functions/dashboard-list.ts +14 -6
  49. package/functions/dashboard-model-record.test.ts +139 -0
  50. package/functions/dashboard-model-record.ts +353 -0
  51. package/functions/monitoring/errors.ts +22 -103
  52. package/functions/notifications/deliveries.ts +7 -38
  53. package/functions/queries.ts +7 -10
  54. package/ide/vscode/package.json +1 -1
  55. package/package.json +5 -5
  56. package/resources/components/Dashboard/Analytics/AnalyticsHub.stx +2 -2
  57. package/resources/components/Dashboard/Analytics/CampaignAnalytics.stx +22 -28
  58. package/resources/components/Dashboard/Analytics/EventAnalytics.stx +26 -34
  59. package/resources/components/Dashboard/Analytics/SalesAnalytics.stx +29 -37
  60. package/resources/components/Dashboard/Analytics/WebAnalyticsBreakdown.stx +12 -16
  61. package/resources/components/Dashboard/Analytics/WebAnalyticsDashboard.stx +43 -53
  62. package/resources/components/Dashboard/App/RequestsOverview.stx +2 -1
  63. package/resources/components/Dashboard/App/SourceInventory.stx +2 -1
  64. package/resources/components/Dashboard/Auth/AccessTokens.stx +3 -5
  65. package/resources/components/Dashboard/Billing/BillingPaymentMethodsPanel.stx +9 -11
  66. package/resources/components/Dashboard/Billing/BillingSettings.stx +1 -1
  67. package/resources/components/Dashboard/Buddy/BuddyAssistant.stx +4 -6
  68. package/resources/components/Dashboard/Commerce/CommerceCategoriesDashboard.stx +2 -2
  69. package/resources/components/Dashboard/Commerce/CommerceCategoriesTable.stx +3 -3
  70. package/resources/components/Dashboard/Commerce/CommerceCategoryDialog.stx +2 -2
  71. package/resources/components/Dashboard/Commerce/CommerceCategoryHierarchy.stx +3 -5
  72. package/resources/components/Dashboard/Commerce/CommerceCouponBreakdown.stx +17 -13
  73. package/resources/components/Dashboard/Commerce/CommerceCouponDialog.stx +1 -1
  74. package/resources/components/Dashboard/Commerce/CommerceCouponsDashboard.stx +57 -85
  75. package/resources/components/Dashboard/Commerce/CommerceCouponsTable.stx +32 -9
  76. package/resources/components/Dashboard/Commerce/CommerceCustomerDialog.stx +1 -1
  77. package/resources/components/Dashboard/Commerce/CommerceCustomersDashboard.stx +49 -83
  78. package/resources/components/Dashboard/Commerce/CommerceCustomersTable.stx +32 -9
  79. package/resources/components/Dashboard/Commerce/CommerceGiftCardBreakdown.stx +9 -15
  80. package/resources/components/Dashboard/Commerce/CommerceGiftCardDialog.stx +1 -1
  81. package/resources/components/Dashboard/Commerce/CommerceGiftCardsDashboard.stx +35 -119
  82. package/resources/components/Dashboard/Commerce/CommerceGiftCardsTable.stx +3 -3
  83. package/resources/components/Dashboard/Commerce/CommerceManufacturerDialog.stx +1 -1
  84. package/resources/components/Dashboard/Commerce/CommerceManufacturersDashboard.stx +3 -5
  85. package/resources/components/Dashboard/Commerce/CommerceManufacturersTable.stx +2 -2
  86. package/resources/components/Dashboard/Commerce/CommerceOrderDialog.stx +4 -4
  87. package/resources/components/Dashboard/Commerce/CommerceOrdersDashboard.stx +42 -129
  88. package/resources/components/Dashboard/Commerce/CommerceOrdersTable.stx +3 -3
  89. package/resources/components/Dashboard/Commerce/CommerceOverviewDashboard.stx +1 -1
  90. package/resources/components/Dashboard/Commerce/CommerceOverviewOrdersTable.stx +9 -11
  91. package/resources/components/Dashboard/Commerce/CommerceOverviewProductsTable.stx +5 -7
  92. package/resources/components/Dashboard/Commerce/CommerceOverviewStats.stx +14 -16
  93. package/resources/components/Dashboard/Commerce/CommercePaymentsBreakdown.stx +12 -18
  94. package/resources/components/Dashboard/Commerce/CommercePaymentsDashboard.stx +41 -120
  95. package/resources/components/Dashboard/Commerce/CommercePaymentsTable.stx +1 -1
  96. package/resources/components/Dashboard/Commerce/CommercePosCart.stx +13 -15
  97. package/resources/components/Dashboard/Commerce/CommercePosCatalog.stx +17 -19
  98. package/resources/components/Dashboard/Commerce/CommercePosCheckoutDialog.stx +2 -2
  99. package/resources/components/Dashboard/Commerce/CommercePosDashboard.stx +1 -1
  100. package/resources/components/Dashboard/Commerce/CommercePosReceiptDialog.stx +1 -1
  101. package/resources/components/Dashboard/Commerce/CommerceProductDetailDashboard.stx +5 -5
  102. package/resources/components/Dashboard/Commerce/CommerceProductDialog.stx +3 -3
  103. package/resources/components/Dashboard/Commerce/CommerceProductsDashboard.stx +41 -122
  104. package/resources/components/Dashboard/Commerce/CommerceProductsTable.stx +3 -3
  105. package/resources/components/Dashboard/Commerce/CommerceReviewEditDialog.stx +1 -1
  106. package/resources/components/Dashboard/Commerce/CommerceReviewsDashboard.stx +38 -122
  107. package/resources/components/Dashboard/Commerce/CommerceReviewsTable.stx +2 -2
  108. package/resources/components/Dashboard/Commerce/CommerceTaxDialog.stx +3 -3
  109. package/resources/components/Dashboard/Commerce/CommerceTaxesDashboard.stx +5 -4
  110. package/resources/components/Dashboard/Commerce/CommerceTaxesTable.stx +4 -3
  111. package/resources/components/Dashboard/Commerce/CommerceUnitDialog.stx +3 -7
  112. package/resources/components/Dashboard/Commerce/CommerceUnitsDashboard.stx +3 -5
  113. package/resources/components/Dashboard/Commerce/CommerceUnitsTable.stx +2 -2
  114. package/resources/components/Dashboard/Commerce/CommerceVariantDialog.stx +3 -3
  115. package/resources/components/Dashboard/Commerce/CommerceVariantsDashboard.stx +4 -4
  116. package/resources/components/Dashboard/Commerce/CommerceVariantsTable.stx +3 -5
  117. package/resources/components/Dashboard/Commerce/Delivery/CourierDialog.stx +1 -1
  118. package/resources/components/Dashboard/Commerce/Delivery/CouriersDashboard.stx +1 -1
  119. package/resources/components/Dashboard/Commerce/Delivery/CouriersTable.stx +2 -2
  120. package/resources/components/Dashboard/Commerce/Delivery/DeliveryOverviewDashboard.stx +44 -52
  121. package/resources/components/Dashboard/Commerce/Delivery/DeliveryPagination.stx +2 -2
  122. package/resources/components/Dashboard/Commerce/Delivery/DeliveryRouteDialog.stx +1 -1
  123. package/resources/components/Dashboard/Commerce/Delivery/DeliveryRoutesDashboard.stx +1 -1
  124. package/resources/components/Dashboard/Commerce/Delivery/DeliveryRoutesTable.stx +2 -2
  125. package/resources/components/Dashboard/Commerce/Delivery/DigitalDeliveriesDashboard.stx +1 -1
  126. package/resources/components/Dashboard/Commerce/Delivery/DigitalDeliveryTable.stx +2 -2
  127. package/resources/components/Dashboard/Commerce/Delivery/LicenseKeyDialog.stx +3 -3
  128. package/resources/components/Dashboard/Commerce/Delivery/LicenseKeysDashboard.stx +1 -1
  129. package/resources/components/Dashboard/Commerce/Delivery/LicenseKeysTable.stx +2 -2
  130. package/resources/components/Dashboard/Commerce/Delivery/ShippingMethodsDashboard.stx +1 -1
  131. package/resources/components/Dashboard/Commerce/Delivery/ShippingMethodsTable.stx +2 -2
  132. package/resources/components/Dashboard/Commerce/Delivery/ShippingRateDialog.stx +2 -2
  133. package/resources/components/Dashboard/Commerce/Delivery/ShippingRatesDashboard.stx +1 -1
  134. package/resources/components/Dashboard/Commerce/Delivery/ShippingRatesTable.stx +2 -2
  135. package/resources/components/Dashboard/Commerce/Delivery/ShippingZoneDialog.stx +1 -1
  136. package/resources/components/Dashboard/Commerce/Delivery/ShippingZonesDashboard.stx +1 -1
  137. package/resources/components/Dashboard/Commerce/Delivery/ShippingZonesTable.stx +4 -8
  138. package/resources/components/Dashboard/Commerce/PaymentDetailsDialog.stx +1 -3
  139. package/resources/components/Dashboard/Commerce/PrintDeviceBreakdown.stx +9 -15
  140. package/resources/components/Dashboard/Commerce/PrintDeviceDialog.stx +1 -1
  141. package/resources/components/Dashboard/Commerce/PrintDevicesDashboard.stx +3 -3
  142. package/resources/components/Dashboard/Commerce/PrintDevicesTable.stx +3 -3
  143. package/resources/components/Dashboard/Commerce/PrintLogBreakdown.stx +3 -9
  144. package/resources/components/Dashboard/Commerce/PrintLogDetailsDialog.stx +1 -1
  145. package/resources/components/Dashboard/Commerce/PrintLogsDashboard.stx +4 -4
  146. package/resources/components/Dashboard/Commerce/PrintLogsTable.stx +8 -10
  147. package/resources/components/Dashboard/Commerce/ProductWaitlistDashboard.stx +37 -109
  148. package/resources/components/Dashboard/Commerce/ProductWaitlistEntryDialog.stx +3 -3
  149. package/resources/components/Dashboard/Commerce/ProductWaitlistTable.stx +2 -2
  150. package/resources/components/Dashboard/Commerce/RestaurantWaitlistDashboard.stx +38 -112
  151. package/resources/components/Dashboard/Commerce/RestaurantWaitlistEntryDialog.stx +2 -2
  152. package/resources/components/Dashboard/Commerce/RestaurantWaitlistTable.stx +2 -2
  153. package/resources/components/Dashboard/Content/AuthorsDashboard.stx +4 -4
  154. package/resources/components/Dashboard/Content/BlogDashboard.stx +4 -4
  155. package/resources/components/Dashboard/Content/CommentsDashboard.stx +36 -83
  156. package/resources/components/Dashboard/Content/ContentDashboard.stx +12 -14
  157. package/resources/components/Dashboard/Content/ContentTaxonomyDashboard.stx +2 -2
  158. package/resources/components/Dashboard/Content/FileManagerDashboard.stx +8 -12
  159. package/resources/components/Dashboard/Content/FileStoragePanel.stx +6 -10
  160. package/resources/components/Dashboard/Content/FileUploadDialog.stx +1 -3
  161. package/resources/components/Dashboard/Content/PagesDashboard.stx +39 -78
  162. package/resources/components/Dashboard/Content/PostEditorDialog.stx +4 -8
  163. package/resources/components/Dashboard/Content/PostsDashboard.stx +44 -85
  164. package/resources/components/Dashboard/Content/SeoDashboard.stx +5 -4
  165. package/resources/components/Dashboard/Data/DataRecords.stx +140 -12
  166. package/resources/components/Dashboard/Deployments/DeploymentList.stx +4 -4
  167. package/resources/components/Dashboard/Deployments/DeploymentTable.stx +3 -1
  168. package/resources/components/Dashboard/Elements/DropdownNavigation.stx +5 -7
  169. package/resources/components/Dashboard/Email/CapturedMailDashboard.stx +1 -3
  170. package/resources/components/Dashboard/Email/CapturedMailList.stx +18 -20
  171. package/resources/components/Dashboard/Email/EmailActivityDashboard.stx +24 -28
  172. package/resources/components/Dashboard/Email/EmailSettingsList.stx +6 -8
  173. package/resources/components/Dashboard/Email/EmailSettingsNavigation.stx +10 -12
  174. package/resources/components/Dashboard/Email/EmailSidebar.stx +33 -37
  175. package/resources/components/Dashboard/Email/InboxMessageDetail.stx +1 -1
  176. package/resources/components/Dashboard/Email/InboxMessageList.stx +16 -18
  177. package/resources/components/Dashboard/Email/InboxSettingsDashboard.stx +1 -1
  178. package/resources/components/Dashboard/Environment/EnvironmentDashboard.stx +2 -2
  179. package/resources/components/Dashboard/GlobalSearch.stx +19 -21
  180. package/resources/components/Dashboard/Home/DashboardHome.stx +8 -1
  181. package/resources/components/Dashboard/Infrastructure/CloudDashboard.stx +1 -1
  182. package/resources/components/Dashboard/Infrastructure/DnsDashboard.stx +27 -13
  183. package/resources/components/Dashboard/Infrastructure/LogsDashboard.stx +1 -1
  184. package/resources/components/Dashboard/Infrastructure/MailboxesDashboard.stx +46 -8
  185. package/resources/components/Dashboard/Infrastructure/ServerlessDashboard.stx +1 -1
  186. package/resources/components/Dashboard/Infrastructure/ServersDashboard.stx +1 -1
  187. package/resources/components/Dashboard/Jobs/JobDetail.stx +1 -1
  188. package/resources/components/Dashboard/Jobs/JobHistory.stx +44 -57
  189. package/resources/components/Dashboard/Jobs/JobTable.stx +23 -25
  190. package/resources/components/Dashboard/Kanban/KanbanCardDialog.stx +1 -1
  191. package/resources/components/Dashboard/Library/ComponentsDashboard.stx +1 -1
  192. package/resources/components/Dashboard/Management/AssignmentDrawer.stx +5 -7
  193. package/resources/components/Dashboard/Management/PermissionsDashboard.stx +35 -43
  194. package/resources/components/Dashboard/Marketing/AbandonedCartsDashboard.stx +11 -13
  195. package/resources/components/Dashboard/Marketing/CampaignDialog.stx +1 -3
  196. package/resources/components/Dashboard/Marketing/CampaignsDashboard.stx +2 -2
  197. package/resources/components/Dashboard/Marketing/CampaignsTable.stx +2 -2
  198. package/resources/components/Dashboard/Marketing/MarketingListsDashboard.stx +1 -1
  199. package/resources/components/Dashboard/Marketing/MarketingListsTable.stx +2 -2
  200. package/resources/components/Dashboard/Marketing/SocialPostDialog.stx +1 -3
  201. package/resources/components/Dashboard/Marketing/SocialPostsDashboard.stx +2 -2
  202. package/resources/components/Dashboard/Marketing/SocialPostsTable.stx +2 -2
  203. package/resources/components/Dashboard/Models/ModelRecordActions.stx +11 -2
  204. package/resources/components/Dashboard/Models/ModelRecordCreate.stx +193 -0
  205. package/resources/components/Dashboard/Models/ModelRecordDetail.stx +144 -0
  206. package/resources/components/Dashboard/Models/ModelRecordEdit.stx +176 -0
  207. package/resources/components/Dashboard/Models/ModelRecordsDashboard.stx +52 -186
  208. package/resources/components/Dashboard/Models/ModelsOverview.stx +2 -4
  209. package/resources/components/Dashboard/Monitoring/ErrorDashboard.stx +47 -81
  210. package/resources/components/Dashboard/Monitoring/ErrorTable.stx +4 -2
  211. package/resources/components/Dashboard/NotFoundDashboard.stx +4 -4
  212. package/resources/components/Dashboard/Notifications/NotificationDeliveryHistory.stx +43 -77
  213. package/resources/components/Dashboard/Notifications/NotificationDeliveryOverview.stx +15 -17
  214. package/resources/components/Dashboard/Notifications/NotificationDeliveryTable.stx +1 -1
  215. package/resources/components/Dashboard/Operations/AuditDashboard.stx +1 -1
  216. package/resources/components/Dashboard/Operations/ChangeDashboard.stx +1 -1
  217. package/resources/components/Dashboard/Operations/IncidentDashboard.stx +1 -1
  218. package/resources/components/Dashboard/Operations/MigrationDashboard.stx +2 -2
  219. package/resources/components/Dashboard/Operations/RecoveryDashboard.stx +1 -1
  220. package/resources/components/Dashboard/Operations/SchedulerDashboard.stx +1 -1
  221. package/resources/components/Dashboard/Queries/QueryDashboard.stx +60 -86
  222. package/resources/components/Dashboard/Queries/QueryDetail.stx +5 -9
  223. package/resources/components/Dashboard/Realtime/RealtimeDashboard.stx +6 -8
  224. package/resources/components/Dashboard/Remote/RemoteConsole.stx +14 -20
  225. package/resources/components/Dashboard/Settings/AppearanceSettingsDashboard.stx +48 -54
  226. package/resources/components/Dashboard/Settings/MailSettingsDashboard.stx +8 -8
  227. package/resources/components/Dashboard/Settings/SettingsDashboard.stx +43 -47
  228. package/resources/components/Dashboard/Teams/TeamInvitationDashboard.stx +2 -2
  229. package/resources/components/Dashboard/UI/ActivityTable.stx +2 -1
  230. package/resources/components/Dashboard/UI/Button.stx +15 -0
  231. package/resources/components/Dashboard/UI/MetricCards.stx +5 -7
  232. package/resources/components/Dashboard/UI/Pagination.stx +3 -5
  233. package/resources/components/Dashboard/UI/QuickLinks.stx +2 -2
  234. package/resources/components/Dashboard/UI/Select.stx +1 -0
  235. package/resources/components/Dashboard/UI/Table.stx +139 -96
  236. package/resources/components/Dashboard/UI/Tabs.stx +18 -20
  237. package/routes/dashboard-api.ts +2 -0
  238. package/routes/dashboard.ts +246 -253
  239. package/routes/storefront.ts +31 -0
  240. package/stx-components-plugin.ts +12 -1
  241. package/views/dashboard/content/categories/index.stx +1 -1
  242. package/views/dashboard/content/tags/index.stx +1 -1
  243. package/views/dashboard/layouts/default.stx +27 -12
  244. package/views/dashboard/models/[model]/[id]/edit.stx +8 -0
  245. package/views/dashboard/models/[model]/[id].stx +8 -0
  246. package/views/dashboard/models/[model]/create.stx +8 -0
  247. package/resources/components/Dashboard/CreateRecordModal.stx +0 -138
  248. package/resources/components/Dashboard/Models/EditRecordModal.stx +0 -81
@@ -155,13 +155,11 @@ onMount(() => {
155
155
  </tr>
156
156
  </thead>
157
157
  <tbody class="divide-gray-200 divide-y dark:divide-neutral-700">
158
- <template :for="point in trafficRows()">
159
- <tr>
160
- <td class="px-4 py-3 text-gray-900 text-sm dark:text-white">{{ point.date }}</td>
161
- <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ formatNumber(point.visitors) }}</td>
162
- <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ formatNumber(point.pageViews) }}</td>
163
- </tr>
164
- </template>
158
+ <tr :for="point in trafficRows()">
159
+ <td class="px-4 py-3 text-gray-900 text-sm dark:text-white">{{ point.date }}</td>
160
+ <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ formatNumber(point.visitors) }}</td>
161
+ <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ formatNumber(point.pageViews) }}</td>
162
+ </tr>
165
163
  </tbody>
166
164
  </table>
167
165
  </div>
@@ -194,15 +192,13 @@ onMount(() => {
194
192
  </tr>
195
193
  </thead>
196
194
  <tbody class="divide-gray-200 divide-y dark:divide-neutral-700">
197
- <template :for="row in currentRows()">
198
- <tr class="hover:bg-gray-50 dark:hover:bg-neutral-700/50">
199
- <td class="px-4 py-3 font-medium text-gray-900 text-sm dark:text-white">{{ rowName(row) }}</td>
200
- <td :show="kind() === 'pages'" class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ formatNumber(row.entries || 0) }}</td>
201
- <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ formatNumber(rowVisitors(row)) }}</td>
202
- <td :show="kind() === 'pages' || kind() === 'referrers'" class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ formatNumber(row.views || 0) }}</td>
203
- <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ rowPercentage(row) }}%</td>
204
- </tr>
205
- </template>
195
+ <tr :for="row in currentRows()" class="hover:bg-gray-50 dark:hover:bg-neutral-700/50">
196
+ <td class="px-4 py-3 font-medium text-gray-900 text-sm dark:text-white">{{ rowName(row) }}</td>
197
+ <td :show="kind() === 'pages'" class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ formatNumber(row.entries || 0) }}</td>
198
+ <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ formatNumber(rowVisitors(row)) }}</td>
199
+ <td :show="kind() === 'pages' || kind() === 'referrers'" class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ formatNumber(row.views || 0) }}</td>
200
+ <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ rowPercentage(row) }}%</td>
201
+ </tr>
206
202
  </tbody>
207
203
  </table>
208
204
  </div>
@@ -60,18 +60,16 @@
60
60
  </tr>
61
61
  </thead>
62
62
  <tbody class="bg-white dark:bg-neutral-800 divide-gray-200 divide-y dark:divide-neutral-700">
63
- <template :for="page in pagesData">
64
- <tr class="relative hover:bg-gray-50 dark:hover:bg-neutral-700/50">
65
- <td class="px-4 py-3 text-gray-900 text-sm whitespace-nowrap dark:text-white">
66
- <div class="absolute inset-0 bg-blue-100/50 dark:bg-blue-900/50" :style="'width: ' + page.percentage + '%'"></div>
67
- <span class="relative z-10">{{ page.path }}</span>
68
- </td>
69
- <td class="relative px-4 py-3 text-gray-500 text-right text-sm whitespace-nowrap dark:text-neutral-300"><span class="relative z-10">{{ page.entries }}</span></td>
70
- <td class="relative px-4 py-3 text-gray-500 text-right text-sm whitespace-nowrap dark:text-neutral-300"><span class="relative z-10">{{ page.visitors }}</span></td>
71
- <td class="relative px-4 py-3 text-gray-500 text-right text-sm whitespace-nowrap dark:text-neutral-300"><span class="relative z-10">{{ page.views }}</span></td>
72
- <td class="relative px-4 py-3 text-gray-500 text-right text-sm whitespace-nowrap dark:text-neutral-300"><span class="relative z-10">{{ page.percentage }}%</span></td>
73
- </tr>
74
- </template>
63
+ <tr :for="page in pagesData" class="relative hover:bg-gray-50 dark:hover:bg-neutral-700/50">
64
+ <td class="px-4 py-3 text-gray-900 text-sm whitespace-nowrap dark:text-white">
65
+ <div class="absolute inset-0 bg-blue-100/50 dark:bg-blue-900/50" :style="'width: ' + page.percentage + '%'"></div>
66
+ <span class="relative z-10">{{ page.path }}</span>
67
+ </td>
68
+ <td class="relative px-4 py-3 text-gray-500 text-right text-sm whitespace-nowrap dark:text-neutral-300"><span class="relative z-10">{{ page.entries }}</span></td>
69
+ <td class="relative px-4 py-3 text-gray-500 text-right text-sm whitespace-nowrap dark:text-neutral-300"><span class="relative z-10">{{ page.visitors }}</span></td>
70
+ <td class="relative px-4 py-3 text-gray-500 text-right text-sm whitespace-nowrap dark:text-neutral-300"><span class="relative z-10">{{ page.views }}</span></td>
71
+ <td class="relative px-4 py-3 text-gray-500 text-right text-sm whitespace-nowrap dark:text-neutral-300"><span class="relative z-10">{{ page.percentage }}%</span></td>
72
+ </tr>
75
73
  </tbody>
76
74
  </table>
77
75
  </div>
@@ -91,17 +89,15 @@
91
89
  </tr>
92
90
  </thead>
93
91
  <tbody class="bg-white dark:bg-neutral-800 divide-gray-200 divide-y dark:divide-neutral-700">
94
- <template :for="referrer in referrersData">
95
- <tr class="relative hover:bg-gray-50 dark:hover:bg-neutral-700/50">
96
- <td class="px-4 py-3 text-gray-900 text-sm whitespace-nowrap dark:text-white">
97
- <div class="absolute inset-0 bg-green-100/50 dark:bg-green-900/50" :style="'width: ' + referrer.percentage + '%'"></div>
98
- <span class="relative z-10">{{ referrer.name }}</span>
99
- </td>
100
- <td class="relative px-4 py-3 text-gray-500 text-right text-sm whitespace-nowrap dark:text-neutral-300"><span class="relative z-10">{{ referrer.visitors }}</span></td>
101
- <td class="relative px-4 py-3 text-gray-500 text-right text-sm whitespace-nowrap dark:text-neutral-300"><span class="relative z-10">{{ referrer.views }}</span></td>
102
- <td class="relative px-4 py-3 text-gray-500 text-right text-sm whitespace-nowrap dark:text-neutral-300"><span class="relative z-10">{{ referrer.percentage }}%</span></td>
103
- </tr>
104
- </template>
92
+ <tr :for="referrer in referrersData" class="relative hover:bg-gray-50 dark:hover:bg-neutral-700/50">
93
+ <td class="px-4 py-3 text-gray-900 text-sm whitespace-nowrap dark:text-white">
94
+ <div class="absolute inset-0 bg-green-100/50 dark:bg-green-900/50" :style="'width: ' + referrer.percentage + '%'"></div>
95
+ <span class="relative z-10">{{ referrer.name }}</span>
96
+ </td>
97
+ <td class="relative px-4 py-3 text-gray-500 text-right text-sm whitespace-nowrap dark:text-neutral-300"><span class="relative z-10">{{ referrer.visitors }}</span></td>
98
+ <td class="relative px-4 py-3 text-gray-500 text-right text-sm whitespace-nowrap dark:text-neutral-300"><span class="relative z-10">{{ referrer.views }}</span></td>
99
+ <td class="relative px-4 py-3 text-gray-500 text-right text-sm whitespace-nowrap dark:text-neutral-300"><span class="relative z-10">{{ referrer.percentage }}%</span></td>
100
+ </tr>
105
101
  </tbody>
106
102
  </table>
107
103
  </div>
@@ -123,16 +119,14 @@
123
119
  </tr>
124
120
  </thead>
125
121
  <tbody class="bg-white dark:bg-neutral-800 divide-gray-200 divide-y dark:divide-neutral-700">
126
- <template :for="device in deviceData">
127
- <tr class="relative hover:bg-gray-50 dark:hover:bg-neutral-700/50">
128
- <td class="px-4 py-3 text-gray-900 text-sm whitespace-nowrap dark:text-white">
129
- <div class="absolute inset-0 bg-purple-100/50 dark:bg-purple-900/50" :style="'width: ' + device.percentage + '%'"></div>
130
- <span class="relative z-10">{{ device.name }}</span>
131
- </td>
132
- <td class="relative px-4 py-3 text-gray-500 text-right text-sm whitespace-nowrap dark:text-neutral-300"><span class="relative z-10">{{ device.visitors }}</span></td>
133
- <td class="relative px-4 py-3 text-gray-500 text-right text-sm whitespace-nowrap dark:text-neutral-300"><span class="relative z-10">{{ device.percentage }}%</span></td>
134
- </tr>
135
- </template>
122
+ <tr :for="device in deviceData" class="relative hover:bg-gray-50 dark:hover:bg-neutral-700/50">
123
+ <td class="px-4 py-3 text-gray-900 text-sm whitespace-nowrap dark:text-white">
124
+ <div class="absolute inset-0 bg-purple-100/50 dark:bg-purple-900/50" :style="'width: ' + device.percentage + '%'"></div>
125
+ <span class="relative z-10">{{ device.name }}</span>
126
+ </td>
127
+ <td class="relative px-4 py-3 text-gray-500 text-right text-sm whitespace-nowrap dark:text-neutral-300"><span class="relative z-10">{{ device.visitors }}</span></td>
128
+ <td class="relative px-4 py-3 text-gray-500 text-right text-sm whitespace-nowrap dark:text-neutral-300"><span class="relative z-10">{{ device.percentage }}%</span></td>
129
+ </tr>
136
130
  </tbody>
137
131
  </table>
138
132
  </div>
@@ -151,16 +145,14 @@
151
145
  </tr>
152
146
  </thead>
153
147
  <tbody class="bg-white dark:bg-neutral-800 divide-gray-200 divide-y dark:divide-neutral-700">
154
- <template :for="browser in browserData">
155
- <tr class="relative hover:bg-gray-50 dark:hover:bg-neutral-700/50">
156
- <td class="px-4 py-3 text-gray-900 text-sm whitespace-nowrap dark:text-white">
157
- <div class="absolute inset-0 bg-amber-100/50 dark:bg-amber-900/50" :style="'width: ' + browser.percentage + '%'"></div>
158
- <span class="relative z-10">{{ browser.name }}</span>
159
- </td>
160
- <td class="relative px-4 py-3 text-gray-500 text-right text-sm whitespace-nowrap dark:text-neutral-300"><span class="relative z-10">{{ browser.visitors }}</span></td>
161
- <td class="relative px-4 py-3 text-gray-500 text-right text-sm whitespace-nowrap dark:text-neutral-300"><span class="relative z-10">{{ browser.percentage }}%</span></td>
162
- </tr>
163
- </template>
148
+ <tr :for="browser in browserData" class="relative hover:bg-gray-50 dark:hover:bg-neutral-700/50">
149
+ <td class="px-4 py-3 text-gray-900 text-sm whitespace-nowrap dark:text-white">
150
+ <div class="absolute inset-0 bg-amber-100/50 dark:bg-amber-900/50" :style="'width: ' + browser.percentage + '%'"></div>
151
+ <span class="relative z-10">{{ browser.name }}</span>
152
+ </td>
153
+ <td class="relative px-4 py-3 text-gray-500 text-right text-sm whitespace-nowrap dark:text-neutral-300"><span class="relative z-10">{{ browser.visitors }}</span></td>
154
+ <td class="relative px-4 py-3 text-gray-500 text-right text-sm whitespace-nowrap dark:text-neutral-300"><span class="relative z-10">{{ browser.percentage }}%</span></td>
155
+ </tr>
164
156
  </tbody>
165
157
  </table>
166
158
  </div>
@@ -179,16 +171,14 @@
179
171
  </tr>
180
172
  </thead>
181
173
  <tbody class="bg-white dark:bg-neutral-800 divide-gray-200 divide-y dark:divide-neutral-700">
182
- <template :for="country in countriesData">
183
- <tr class="relative hover:bg-gray-50 dark:hover:bg-neutral-700/50">
184
- <td class="px-4 py-3 text-gray-900 text-sm whitespace-nowrap dark:text-white">
185
- <div class="absolute inset-0 bg-rose-100/50 dark:bg-rose-900/50" :style="'width: ' + country.percentage + '%'"></div>
186
- <span class="relative z-10"><span class="mr-2">{{ country.flag }}</span>{{ country.name }}</span>
187
- </td>
188
- <td class="relative px-4 py-3 text-gray-500 text-right text-sm whitespace-nowrap dark:text-neutral-300"><span class="relative z-10">{{ country.visitors }}</span></td>
189
- <td class="relative px-4 py-3 text-gray-500 text-right text-sm whitespace-nowrap dark:text-neutral-300"><span class="relative z-10">{{ country.percentage }}%</span></td>
190
- </tr>
191
- </template>
174
+ <tr :for="country in countriesData" class="relative hover:bg-gray-50 dark:hover:bg-neutral-700/50">
175
+ <td class="px-4 py-3 text-gray-900 text-sm whitespace-nowrap dark:text-white">
176
+ <div class="absolute inset-0 bg-rose-100/50 dark:bg-rose-900/50" :style="'width: ' + country.percentage + '%'"></div>
177
+ <span class="relative z-10"><span class="mr-2">{{ country.flag }}</span>{{ country.name }}</span>
178
+ </td>
179
+ <td class="relative px-4 py-3 text-gray-500 text-right text-sm whitespace-nowrap dark:text-neutral-300"><span class="relative z-10">{{ country.visitors }}</span></td>
180
+ <td class="relative px-4 py-3 text-gray-500 text-right text-sm whitespace-nowrap dark:text-neutral-300"><span class="relative z-10">{{ country.percentage }}%</span></td>
181
+ </tr>
192
182
  </tbody>
193
183
  </table>
194
184
  </div>
@@ -170,7 +170,7 @@ onMount(() => {
170
170
  })
171
171
  </script>
172
172
 
173
- <div class="space-y-6">
173
+ <div class="flex flex-col gap-6">
174
174
  <header class="flex flex-col gap-4 sm:flex-row sm:items-end sm:justify-between">
175
175
  <div>
176
176
  <h1 class="font-semibold text-2xl text-neutral-900 tracking-tight dark:text-white">Requests</h1>
@@ -233,6 +233,7 @@ onMount(() => {
233
233
  </div>
234
234
 
235
235
  <Table
236
+ :framed="false"
236
237
  :columns="COLUMNS"
237
238
  :data="requestRows()"
238
239
  :loading="loading()"
@@ -194,7 +194,7 @@ onMount(() => {
194
194
  })
195
195
  </script>
196
196
 
197
- <div class="space-y-6">
197
+ <div class="flex flex-col gap-6">
198
198
  <header class="flex flex-col gap-4 sm:flex-row sm:items-end sm:justify-between">
199
199
  <div>
200
200
  <h1 class="font-semibold text-2xl text-neutral-900 tracking-tight dark:text-white">{{ page().title }}</h1>
@@ -250,6 +250,7 @@ onMount(() => {
250
250
  </div>
251
251
 
252
252
  <Table
253
+ :framed="false"
253
254
  :columns="COLUMNS_BY_MODE[mode()]"
254
255
  :data="itemRows()"
255
256
  :loading="loading()"
@@ -211,7 +211,7 @@ onMount(() => {
211
211
  })
212
212
  </script>
213
213
 
214
- <div class="space-y-6">
214
+ <div class="flex flex-col gap-6">
215
215
  <header class="flex flex-col gap-4 sm:flex-row sm:items-end sm:justify-between">
216
216
  <div>
217
217
  <h1 class="font-semibold text-2xl text-neutral-900 tracking-tight dark:text-white">Access Tokens</h1>
@@ -298,13 +298,11 @@ onMount(() => {
298
298
  "Never", so it sorts on the date itself.
299
299
  --}}
300
300
  <div :if="!loading() && !authenticationRequired() && tokens().length > 0">
301
- <Table :columns="TOKEN_COLUMNS" :data="tokenRows()" paginated :page-size="25">
301
+ <Table :columns="TOKEN_COLUMNS" :data="tokenRows()" paginated :page-size="25" :framed="false">
302
302
  <template #cell="{ row, column }">
303
303
  <template :if="column.key === 'scopesLabel'">
304
304
  <div class="flex flex-wrap gap-1">
305
- <template :for="scope in row.scopes" :key="scope">
306
- <span class="inline-flex px-2 py-0.5 font-medium text-blue-700 text-xs dark:text-blue-300 bg-blue-50 dark:bg-blue-950/40 rounded" x-text="scope"></span>
307
- </template>
305
+ <span :for="scope in row.scopes" :key="scope" class="inline-flex px-2 py-0.5 font-medium text-blue-700 text-xs dark:text-blue-300 bg-blue-50 dark:bg-blue-950/40 rounded" x-text="scope"></span>
308
306
  </div>
309
307
  </template>
310
308
  <template :else>
@@ -32,17 +32,15 @@ function expiry(method: BillingPaymentMethod): string {
32
32
  </div>
33
33
 
34
34
  <ul :else role="list" class="divide-gray-200 divide-y dark:divide-neutral-700">
35
- <template :for="method in methods()" :key="method.id">
36
- <li class="flex gap-4 items-center px-5 py-4">
37
- <span class="flex flex-none items-center justify-center h-10 w-10 text-gray-500 dark:text-neutral-300 bg-gray-100 dark:bg-neutral-700 rounded-lg"><span class="h-5 w-5 i-hugeicons-credit-card"></span></span>
38
- <div class="flex-1 min-w-0">
39
- <div class="flex gap-2 items-center">
40
- <p class="font-medium text-gray-900 text-sm dark:text-white">{{ brand(method.brand) }} {{ method.lastFour ? 'ending in ' + method.lastFour : '' }}</p>
41
- <span :if="method.isDefault" class="inline-flex px-2 py-0.5 font-medium text-[11px] text-blue-700 dark:text-blue-300 bg-blue-50 dark:bg-blue-950/40 rounded-full">Default</span>
42
- </div>
43
- <p class="mt-1 text-gray-500 text-xs dark:text-neutral-400">{{ expiry(method) }}</p>
35
+ <li :for="method in methods()" :key="method.id" class="flex gap-4 items-center px-5 py-4">
36
+ <span class="flex flex-none items-center justify-center h-10 w-10 text-gray-500 dark:text-neutral-300 bg-gray-100 dark:bg-neutral-700 rounded-lg"><span class="h-5 w-5 i-hugeicons-credit-card"></span></span>
37
+ <div class="flex-1 min-w-0">
38
+ <div class="flex gap-2 items-center">
39
+ <p class="font-medium text-gray-900 text-sm dark:text-white">{{ brand(method.brand) }} {{ method.lastFour ? 'ending in ' + method.lastFour : '' }}</p>
40
+ <span :if="method.isDefault" class="inline-flex px-2 py-0.5 font-medium text-[11px] text-blue-700 dark:text-blue-300 bg-blue-50 dark:bg-blue-950/40 rounded-full">Default</span>
44
41
  </div>
45
- </li>
46
- </template>
42
+ <p class="mt-1 text-gray-500 text-xs dark:text-neutral-400">{{ expiry(method) }}</p>
43
+ </div>
44
+ </li>
47
45
  </ul>
48
46
  </section>
@@ -74,7 +74,7 @@ onMount(() => { void loadBilling() })
74
74
  <div :if="unavailable().length" role="status" class="p-4 text-amber-800 text-sm dark:text-amber-200 bg-amber-50 dark:bg-amber-950/30 border border-amber-200 rounded-lg dark:border-amber-900">
75
75
  <p class="font-semibold">Some provider-backed details are unavailable.</p>
76
76
  <ul class="mt-2 pl-5 space-y-1 list-disc">
77
- <template :for="message in unavailable()"><li>{{ message }}</li></template>
77
+ <li :for="message in unavailable()">{{ message }}</li>
78
78
  </ul>
79
79
  </div>
80
80
 
@@ -151,13 +151,11 @@ onMount(() => {
151
151
  </div>
152
152
 
153
153
  <div :if="messages().length > 0" class="mx-auto space-y-4 max-w-4xl">
154
- <template :for="message in messages()">
155
- <div :class="'flex ' + (message.role === 'user' ? 'justify-end' : 'justify-start')">
156
- <div :class="'max-w-[85%] px-4 py-3 text-sm whitespace-pre-wrap rounded-lg ' + (message.role === 'user' ? 'text-white bg-blue-600' : 'text-gray-800 dark:text-neutral-100 bg-gray-100 dark:bg-neutral-700')">
157
- {{ message.content }}
158
- </div>
154
+ <div :for="message in messages()" :class="'flex ' + (message.role === 'user' ? 'justify-end' : 'justify-start')">
155
+ <div :class="'max-w-[85%] px-4 py-3 text-sm whitespace-pre-wrap rounded-lg ' + (message.role === 'user' ? 'text-white bg-blue-600' : 'text-gray-800 dark:text-neutral-100 bg-gray-100 dark:bg-neutral-700')">
156
+ {{ message.content }}
159
157
  </div>
160
- </template>
158
+ </div>
161
159
  <div :if="isSending()" class="flex justify-start">
162
160
  <div class="inline-flex items-center px-4 py-3 text-gray-500 text-sm dark:text-neutral-300 bg-gray-100 dark:bg-neutral-700 rounded-lg">
163
161
  <span class="mr-2 h-4 w-4 animate-spin i-hugeicons-loading-03"></span>
@@ -223,7 +223,7 @@ onMount(() => {
223
223
  })
224
224
  </script>
225
225
 
226
- <div class="space-y-6">
226
+ <div class="flex flex-col gap-6">
227
227
  <PageHeader title="Product Categories" description="Manage the native Category hierarchy, display order, and storefront availability.">
228
228
  <div class="flex flex-wrap gap-2">
229
229
  <Button variant="secondary" :loading="loading()" @click="loadCategories()"><span :if="!loading()" class="h-4 w-4 i-hugeicons-refresh"></span>Refresh</Button>
@@ -238,7 +238,7 @@ onMount(() => {
238
238
 
239
239
  <CommerceCategoryHierarchy :records="records()" />
240
240
 
241
- <section class="space-y-3">
241
+ <section class="flex flex-col gap-3">
242
242
  <div class="grid gap-3 grid-cols-1 sm:grid-cols-2 xl:grid-cols-5">
243
243
  <label class="relative sm:col-span-2">
244
244
  <span class="sr-only">Search product categories</span>
@@ -38,9 +38,9 @@ const COLUMNS = [
38
38
  ]
39
39
 
40
40
  const ROW_ACTIONS = [
41
- { action: 'view', label: 'View', icon: 'i-hugeicons-view' },
42
- { action: 'edit', label: 'Edit', icon: 'i-hugeicons-edit-02' },
43
- { action: 'delete', label: 'Delete', icon: 'i-hugeicons-delete-02', class: 'text-red-500' },
41
+ { action: 'view', label: 'View' },
42
+ { action: 'edit', label: 'Edit' },
43
+ { action: 'delete', label: 'Delete' },
44
44
  ]
45
45
 
46
46
  const rows = derived(() => records().map(record => ({
@@ -118,14 +118,14 @@ function errorMessages(): string[] {
118
118
  >
119
119
  <form id="category-form" @submit.prevent="submit">
120
120
  <ul :if="errorMessages().length > 0" class="mb-5 p-3 space-y-1 text-red-700 text-sm dark:text-red-300 bg-red-50 dark:bg-red-950/30 border border-red-200 rounded-lg dark:border-red-900">
121
- <template :for="message in errorMessages()" :key="message"><li>{{ message }}</li></template>
121
+ <li :for="message in errorMessages()" :key="message">{{ message }}</li>
122
122
  </ul>
123
123
  <div class="grid gap-4 grid-cols-1 sm:grid-cols-2">
124
124
  <label class="block"><span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Name</span><input x-model="name" type="text" maxlength="50" required class="mt-1 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-900 border border-gray-300 rounded-md dark:border-neutral-700" /></label>
125
125
  <label class="block"><span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Slug</span><input x-model="slug" type="text" required spellcheck="false" class="mt-1 px-3 py-2 w-full font-mono text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-900 border border-gray-300 rounded-md dark:border-neutral-700" @input="markSlugTouched" @blur="normalizeSlug" /></label>
126
126
  <label class="block sm:col-span-2"><span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Description</span><textarea x-model="description" rows="3" class="mt-1 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-900 border border-gray-300 rounded-md dark:border-neutral-700"></textarea></label>
127
127
  <label class="block sm:col-span-2"><span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Image URL</span><input x-model="imageUrl" type="text" placeholder="Optional persisted asset URL" class="mt-1 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-900 border border-gray-300 rounded-md dark:border-neutral-700" /><span class="block mt-1 text-gray-500 text-xs dark:text-neutral-500">Use a stored asset URL. File uploads belong to the native storage workflow.</span></label>
128
- <label class="block"><span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Parent category</span><select x-model="parentCategoryId" class="mt-1 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-900 border border-gray-300 rounded-md dark:border-neutral-700"><option value="">Root category</option><template :for="option in parentOptions()" :key="option.id"><option :value="option.id">{{ option.name }}</option></template></select></label>
128
+ <label class="block"><span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Parent category</span><select x-model="parentCategoryId" class="mt-1 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-900 border border-gray-300 rounded-md dark:border-neutral-700"><option value="">Root category</option><option :for="option in parentOptions()" :key="option.id" :value="option.id">{{ option.name }}</option></select></label>
129
129
  <label class="block"><span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Display order</span><input x-model="displayOrder" type="number" min="0" step="1" required class="mt-1 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-900 border border-gray-300 rounded-md dark:border-neutral-700" /></label>
130
130
  <label class="flex gap-3 items-center sm:col-span-2 p-3 border border-gray-200 rounded-lg dark:border-neutral-700"><input x-model="isActive" type="checkbox" class="h-4 w-4 text-blue-600 border-gray-300 rounded" /><span><span class="block font-medium text-gray-700 text-sm dark:text-neutral-200">Active in the storefront</span><span class="block mt-0.5 text-gray-500 text-xs dark:text-neutral-500">Availability is independent from the hierarchy.</span></span></label>
131
131
  </div>
@@ -26,10 +26,8 @@ function childLabel(id: string): string {
26
26
  </div>
27
27
  <div :if="roots().length === 0" class="mt-4 text-gray-500 text-sm dark:text-neutral-400">No root categories recorded.</div>
28
28
  <div :if="roots().length > 0" class="grid gap-2 grid-cols-1 sm:grid-cols-2 xl:grid-cols-5 mt-4">
29
- <template :for="record in roots().slice(0, 10)" :key="record.id">
30
- <article class="p-3 border border-gray-100 rounded-lg dark:border-neutral-700">
31
- <div class="flex gap-3 items-center"><span class="flex items-center justify-center shrink-0 h-8 w-8 font-semibold text-blue-700 text-xs dark:text-blue-300 bg-blue-50 dark:bg-blue-950/40 rounded-md">{{ record.name.slice(0, 1).toUpperCase() }}</span><div class="min-w-0"><p class="font-medium text-gray-900 text-sm truncate dark:text-white">{{ record.name }}</p><p class="text-gray-500 text-xs dark:text-neutral-500">{{ childLabel(record.id) }} · order {{ record.displayOrder }}</p></div></div>
32
- </article>
33
- </template>
29
+ <article :for="record in roots().slice(0, 10)" :key="record.id" class="p-3 border border-gray-100 rounded-lg dark:border-neutral-700">
30
+ <div class="flex gap-3 items-center"><span class="flex items-center justify-center shrink-0 h-8 w-8 font-semibold text-blue-700 text-xs dark:text-blue-300 bg-blue-50 dark:bg-blue-950/40 rounded-md">{{ record.name.slice(0, 1).toUpperCase() }}</span><div class="min-w-0"><p class="font-medium text-gray-900 text-sm truncate dark:text-white">{{ record.name }}</p><p class="text-gray-500 text-xs dark:text-neutral-500">{{ childLabel(record.id) }} · order {{ record.displayOrder }}</p></div></div>
31
+ </article>
34
32
  </div>
35
33
  </section>
@@ -1,34 +1,38 @@
1
1
  <script client>
2
- import type { CouponRecord } from '../../../../app/Actions/Dashboard/Commerce/coupon-records'
2
+ import type { CouponSummary } from '../../../../app/Actions/Dashboard/Commerce/coupon-records'
3
3
 
4
- const records = useReactiveProp('records', [] as CouponRecord[])
4
+ /**
5
+ * Counted by the server over every coupon (stacksjs/stacks#3218); this used
6
+ * to count the records the page had, which were the newest 500.
7
+ */
8
+ const summary = useReactiveProp<CouponSummary>('summary', { total: 0, enabled: 0, active: 0, scheduled: 0, expired: 0, percentage: 0, fixedAmount: 0, redemptions: 0, mostUsed: [] })
5
9
 
6
10
  function statuses(): Array<{ label: string, count: number, color: string }> {
7
11
  return [
8
- { label: 'Active', count: records().filter(record => record.status === 'Active').length, color: 'bg-emerald-500' },
9
- { label: 'Scheduled', count: records().filter(record => record.status === 'Scheduled').length, color: 'bg-blue-500' },
10
- { label: 'Expired', count: records().filter(record => record.status === 'Expired').length, color: 'bg-gray-400' },
12
+ { label: 'Active', count: summary().active, color: 'bg-emerald-500' },
13
+ { label: 'Scheduled', count: summary().scheduled, color: 'bg-blue-500' },
14
+ { label: 'Expired', count: summary().expired, color: 'bg-gray-400' },
11
15
  ]
12
16
  }
13
17
 
14
18
  function width(count: number): string {
15
- return `${records().length ? Math.round((count / records().length) * 100) : 0}%`
19
+ return `${summary().total ? Math.round((count / summary().total) * 100) : 0}%`
16
20
  }
17
21
 
18
22
  function discountTypes(): Array<{ label: string, count: number }> {
19
23
  return [
20
- { label: 'Percentage', count: records().filter(record => record.discountType === 'percentage').length },
21
- { label: 'Fixed amount', count: records().filter(record => record.discountType === 'fixed_amount').length },
24
+ { label: 'Percentage', count: summary().percentage },
25
+ { label: 'Fixed amount', count: summary().fixedAmount },
22
26
  ]
23
27
  }
24
28
 
25
- function mostUsed(): CouponRecord[] {
26
- return [...records()].sort((left, right) => right.usageCount - left.usageCount || left.code.localeCompare(right.code)).slice(0, 5)
29
+ function mostUsed(): CouponSummary['mostUsed'] {
30
+ return summary().mostUsed ?? []
27
31
  }
28
32
  </script>
29
33
 
30
34
  <section aria-label="Coupon breakdowns" class="grid gap-3 grid-cols-1 lg:grid-cols-3">
31
- <article class="p-4 bg-white dark:bg-neutral-800 border border-gray-200 rounded-lg dark:border-neutral-700"><h2 class="font-semibold text-gray-900 text-sm dark:text-white">Status distribution</h2><div class="mt-4 space-y-3"><template :for="item in statuses()" :key="item.label"><div><div class="flex justify-between text-xs"><span class="text-gray-500 dark:text-neutral-400">{{ item.label }}</span><span class="font-mono text-gray-700 dark:text-neutral-200">{{ item.count }}</span></div><div class="mt-1 h-1.5 bg-gray-100 dark:bg-neutral-700 rounded-full"><div :class="'h-full rounded-full ' + item.color" :style="'width: ' + width(item.count)"></div></div></div></template></div></article>
32
- <article class="p-4 bg-white dark:bg-neutral-800 border border-gray-200 rounded-lg dark:border-neutral-700"><h2 class="font-semibold text-gray-900 text-sm dark:text-white">Discount types</h2><dl class="mt-3 divide-gray-100 divide-y dark:divide-neutral-700"><template :for="item in discountTypes()" :key="item.label"><div class="flex items-center justify-between py-3"><dt class="text-gray-500 text-sm dark:text-neutral-400">{{ item.label }}</dt><dd class="font-mono text-gray-900 text-sm dark:text-white">{{ item.count }}</dd></div></template></dl></article>
33
- <article class="p-4 bg-white dark:bg-neutral-800 border border-gray-200 rounded-lg dark:border-neutral-700"><h2 class="font-semibold text-gray-900 text-sm dark:text-white">Most redeemed</h2><p :if="mostUsed().length === 0" class="mt-4 text-gray-500 text-sm dark:text-neutral-400">No coupon usage recorded.</p><ol :else class="mt-3 divide-gray-100 divide-y dark:divide-neutral-700"><template :for="record in mostUsed()" :key="record.id"><li class="flex items-center justify-between py-2"><span class="font-mono text-gray-600 text-sm truncate dark:text-neutral-300">{{ record.code }}</span><span class="ml-3 font-mono text-gray-900 text-sm dark:text-white">{{ record.usageCount.toLocaleString() }}</span></li></template></ol></article>
35
+ <article class="p-4 bg-white dark:bg-neutral-800 border border-gray-200 rounded-lg dark:border-neutral-700"><h2 class="font-semibold text-gray-900 text-sm dark:text-white">Status distribution</h2><div class="mt-4 space-y-3"><div :for="item in statuses()" :key="item.label"><div class="flex justify-between text-xs"><span class="text-gray-500 dark:text-neutral-400">{{ item.label }}</span><span class="font-mono text-gray-700 dark:text-neutral-200">{{ item.count }}</span></div><div class="mt-1 h-1.5 bg-gray-100 dark:bg-neutral-700 rounded-full"><div :class="'h-full rounded-full ' + item.color" :style="'width: ' + width(item.count)"></div></div></div></div></article>
36
+ <article class="p-4 bg-white dark:bg-neutral-800 border border-gray-200 rounded-lg dark:border-neutral-700"><h2 class="font-semibold text-gray-900 text-sm dark:text-white">Discount types</h2><dl class="mt-3 divide-gray-100 divide-y dark:divide-neutral-700"><div :for="item in discountTypes()" :key="item.label" class="flex items-center justify-between py-3"><dt class="text-gray-500 text-sm dark:text-neutral-400">{{ item.label }}</dt><dd class="font-mono text-gray-900 text-sm dark:text-white">{{ item.count }}</dd></div></dl></article>
37
+ <article class="p-4 bg-white dark:bg-neutral-800 border border-gray-200 rounded-lg dark:border-neutral-700"><h2 class="font-semibold text-gray-900 text-sm dark:text-white">Most redeemed</h2><p :if="mostUsed().length === 0" class="mt-4 text-gray-500 text-sm dark:text-neutral-400">No coupon usage recorded.</p><ol :else class="mt-3 divide-gray-100 divide-y dark:divide-neutral-700"><li :for="record in mostUsed()" :key="record.id" class="flex items-center justify-between py-2"><span class="font-mono text-gray-600 text-sm truncate dark:text-neutral-300">{{ record.code }}</span><span class="ml-3 font-mono text-gray-900 text-sm dark:text-white">{{ record.usageCount.toLocaleString() }}</span></li></ol></article>
34
38
  </section>
@@ -118,7 +118,7 @@ function errorMessages(): string[] {
118
118
  >
119
119
  <form id="coupon-form" @submit.prevent="submit">
120
120
  <ul :if="errorMessages().length > 0" class="mb-5 p-3 space-y-1 text-red-700 text-sm dark:text-red-300 bg-red-50 dark:bg-red-950/30 border border-red-200 rounded-lg dark:border-red-900">
121
- <template :for="message in errorMessages()" :key="message"><li>{{ message }}</li></template>
121
+ <li :for="message in errorMessages()" :key="message">{{ message }}</li>
122
122
  </ul>
123
123
  <div class="grid gap-4 grid-cols-1 sm:grid-cols-2">
124
124
  <label class="block"><span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Code</span><input x-model="code" type="text" maxlength="50" required spellcheck="false" class="mt-1 px-3 py-2 w-full font-mono text-gray-900 text-sm uppercase dark:text-white bg-white dark:bg-neutral-900 border border-gray-300 rounded-md dark:border-neutral-700" /></label>