@stacksjs/defaults 0.75.529 → 0.75.537

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 +6 -6
  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
@@ -47,6 +47,12 @@ import { parseDashboardDate } from '../../../../functions/dashboard-dates'
47
47
  interface DashboardTableColumn {
48
48
  key: string
49
49
  label: string
50
+ /**
51
+ * What the header means, for a label a newcomer may not know (`TTL`, a tax
52
+ * code). The header wears it through `<abbr>`: shown on hover, read out by
53
+ * screen readers, and marked with a dotted underline so it is findable.
54
+ */
55
+ description?: string
50
56
  align?: 'left' | 'center' | 'right'
51
57
  sortable?: boolean
52
58
  /** Show a filter control for this column in the filter row. */
@@ -122,6 +128,11 @@ interface DashboardTableColumn {
122
128
  */
123
129
  currencyKey?: string
124
130
  width?: string
131
+ /**
132
+ * Classes for this column's cells. Not its header: a cell's look - a code
133
+ * font for numbers, a muted colour for timestamps - set the header in the
134
+ * same code font and colour, so `Members` read as code.
135
+ */
125
136
  class?: string
126
137
  /** Hidden until switched on in the column menu. */
127
138
  hidden?: boolean
@@ -156,8 +167,12 @@ interface DashboardTableRowAction {
156
167
  action: string
157
168
  /** Read out as "<label> <row[actionLabelKey]>", e.g. "Edit Kilogram". */
158
169
  label: string
159
- /** Iconify class, e.g. `i-hugeicons-edit-01`. */
160
- icon: string
170
+ /**
171
+ * Iconify class, e.g. `i-hugeicons-user-remove-01`. Not needed, and not
172
+ * used, for `view`, `edit` and `delete`: those take the dashboard's standard
173
+ * eye, pencil and trash, so the same action looks the same in every table.
174
+ */
175
+ icon?: string
161
176
  /** Colour class for the icon. Defaults to the usual blue. */
162
177
  class?: string
163
178
  /**
@@ -187,6 +202,10 @@ const emptyTitle = useReactiveProp('emptyTitle', 'No data')
187
202
  const emptyDescription = useReactiveProp('emptyDescription', 'There are no items to display.')
188
203
  const rowKey = useReactiveProp('rowKey', 'id')
189
204
  const hoverable = useReactiveProp('hoverable', true)
205
+ // Its own border, corners and shadow. Off inside a container that already
206
+ // draws them, such as a `Card padding="none"`, which otherwise framed the
207
+ // table twice.
208
+ const framed = useReactiveProp('framed', true)
190
209
 
191
210
  const searchable = useReactiveProp('searchable', false)
192
211
  const searchPlaceholder = useReactiveProp('searchPlaceholder', 'Search')
@@ -457,6 +476,16 @@ const sorted = derived(() => {
457
476
  /** Rows in the whole result: the server's count when it pages, else what is held. */
458
477
  const totalRows = derived(() => (manualPagination() ? Math.max(0, Number(total()) || 0) : sorted().length))
459
478
 
479
+ /**
480
+ * Whether the pager has anything to do. Rows that all fit on the smallest page
481
+ * size are already on screen, so "Showing 1-5 of 5", a page-size picker and a
482
+ * "1 / 1" between two disabled arrows were three controls for nothing.
483
+ */
484
+ function needsPager(): boolean {
485
+ const smallest = Math.min(...pageSizeOptions(), pageSize())
486
+ return totalRows() > smallest
487
+ }
488
+
460
489
  const pageCount = derived(() => (paginated() ? Math.max(1, Math.ceil(totalRows() / pageSize())) : 1))
461
490
 
462
491
  // A filter that shortens the list must not strand the viewer on a page that
@@ -637,14 +666,26 @@ function alignClass(align: DashboardTableColumn['align']): string {
637
666
  return 'text-left'
638
667
  }
639
668
 
669
+ /**
670
+ * The outer columns' padding. A framed table keeps its own 24px left inset. An
671
+ * unframed one sits in a card whose title and search box are inset 20px, so
672
+ * its first and last columns match that instead of drifting 4px either way.
673
+ */
674
+ function edgePadding(index: number): string {
675
+ const first = index === 0 && !selectable()
676
+ const last = index === visibleColumns().length - 1 && !hasRowActions()
677
+ const left = first ? (framed() ? 'pl-6' : 'pl-5') : 'pl-4'
678
+ const right = last && !framed() ? 'pr-5' : 'pr-4'
679
+ return `${left} ${right}`
680
+ }
681
+
640
682
  function headerClass(column: DashboardTableColumn, index: number): string {
641
683
  return [
642
- index === 0 && !selectable() ? 'pl-6' : 'pl-4',
643
- 'pr-4 font-semibold text-xs uppercase tracking-wider text-stone-500 dark:text-neutral-400',
684
+ edgePadding(index),
685
+ 'font-semibold text-xs uppercase tracking-wider text-stone-500 dark:text-neutral-400',
644
686
  compact() ? 'py-2' : 'py-3.5',
645
687
  alignClass(column.align),
646
688
  index === 0 && stickyFirstColumn() ? 'sticky left-0 z-20 bg-stone-50 dark:bg-neutral-800' : '',
647
- column.class || '',
648
689
  ].filter(Boolean).join(' ')
649
690
  }
650
691
 
@@ -702,14 +743,26 @@ function rowIsBusy(row: DashboardTableRow): boolean {
702
743
  return rawValue(row, busyKey() || rowKey()) === value
703
744
  }
704
745
 
746
+ /**
747
+ * The dashboard's three common row actions and how they look everywhere: an
748
+ * eye to view, a pencil to edit, a red trash can to delete. Tables had picked
749
+ * their own - two different pencils and two different bins across 40 tables.
750
+ */
751
+ const STANDARD_ROW_ACTIONS: Record<string, { icon: string, class: string }> = {
752
+ view: { icon: 'i-hugeicons-view', class: 'text-neutral-500 dark:text-neutral-400' },
753
+ edit: { icon: 'i-hugeicons-pencil-edit-02', class: 'text-blue-500' },
754
+ delete: { icon: 'i-hugeicons-delete-02', class: 'text-red-500' },
755
+ }
756
+
705
757
  function rowActionIconClass(action: DashboardTableRowAction): string {
706
- return `block h-4 w-4 ${action.class || 'text-blue-500'} ${action.icon}`
758
+ const standard = STANDARD_ROW_ACTIONS[action.action]
759
+ return `block h-4 w-4 ${action.class || standard?.class || 'text-blue-500'} ${standard?.icon ?? action.icon ?? ''}`
707
760
  }
708
761
 
709
762
  function cellClass(column: DashboardTableColumn, index: number): string {
710
763
  return [
711
- index === 0 && !selectable() ? 'pl-6' : 'pl-4',
712
- 'pr-4 text-sm text-stone-700 dark:text-neutral-200',
764
+ edgePadding(index),
765
+ 'text-sm text-stone-700 dark:text-neutral-200',
713
766
  compact() ? 'py-2' : 'py-3.5',
714
767
  alignClass(column.align),
715
768
  column.type === 'number' || column.type === 'currency' ? 'tabular-nums' : '',
@@ -719,7 +772,7 @@ function cellClass(column: DashboardTableColumn, index: number): string {
719
772
  }
720
773
  </script>
721
774
 
722
- <div class="overflow-hidden relative bg-white dark:bg-neutral-900 border border-stone-200/80 rounded-xl dark:border-neutral-700 shadow-sm">
775
+ <div class="overflow-hidden relative bg-white dark:bg-neutral-900" :class="framed() ? 'border border-stone-200/80 rounded-xl dark:border-neutral-700 shadow-sm' : ''">
723
776
  <div :if="loading()" class="flex absolute inset-0 z-30 items-center justify-center bg-white/80 dark:bg-neutral-900/80 backdrop-blur-sm" role="status">
724
777
  <span aria-hidden="true" class="mr-2 h-5 w-5 text-blue-500 animate-spin i-hugeicons-loading-03"></span>
725
778
  <span class="text-neutral-500 text-sm dark:text-neutral-400">Loading</span>
@@ -777,17 +830,15 @@ function cellClass(column: DashboardTableColumn, index: number): string {
777
830
  :if="columnMenuOpen()"
778
831
  class="absolute right-0 z-40 mt-1 p-2 w-52 bg-white dark:bg-neutral-800 border border-stone-200 rounded-lg dark:border-neutral-700 shadow-lg"
779
832
  >
780
- <template :for="column in columns()">
781
- <label class="flex gap-2 items-center px-2 py-1.5 text-neutral-700 text-sm dark:text-neutral-200 hover:bg-stone-50 dark:hover:bg-neutral-700 rounded cursor-pointer">
782
- <input
783
- type="checkbox"
784
- :checked="!hiddenColumns().includes(column.key)"
785
- @change="toggleColumn(column.key)"
786
- class="h-3.5 w-3.5 text-blue-600 border-stone-300 rounded dark:border-neutral-600"
787
- />
788
- {{ column.label }}
789
- </label>
790
- </template>
833
+ <label :for="column in columns()" class="flex gap-2 items-center px-2 py-1.5 text-neutral-700 text-sm dark:text-neutral-200 hover:bg-stone-50 dark:hover:bg-neutral-700 rounded cursor-pointer">
834
+ <input
835
+ type="checkbox"
836
+ :checked="!hiddenColumns().includes(column.key)"
837
+ @change="toggleColumn(column.key)"
838
+ class="h-3.5 w-3.5 text-blue-600 border-stone-300 rounded dark:border-neutral-600"
839
+ />
840
+ {{ column.label }}
841
+ </label>
791
842
  </div>
792
843
  </div>
793
844
 
@@ -833,33 +884,35 @@ function cellClass(column: DashboardTableColumn, index: number): string {
833
884
  />
834
885
  </th>
835
886
 
836
- <template :for="(column, index) in visibleColumns()">
837
- <th
838
- scope="col"
839
- :class="headerClass(column, index)"
840
- :style="column.width ? 'width: ' + column.width : undefined"
841
- :aria-sort="ariaSort(column)"
887
+ <th :for="(column, index) in visibleColumns()"
888
+ scope="col"
889
+ :class="headerClass(column, index)"
890
+ :style="column.width ? 'width: ' + column.width : undefined"
891
+ :aria-sort="ariaSort(column)"
892
+ >
893
+ {{-- `bare`: a header button fills its `<th>` and carries no box
894
+ of its own, so none of the sizes fit. It still comes through
895
+ `UI/Button` for the shared focus ring and disabled handling.
896
+ See stacksjs/stacks#2926. --}}
897
+ <Button
898
+ :if="column.sortable"
899
+ variant="bare"
900
+ :ariaLabel="sortLabel(column)"
901
+ class="inline-flex gap-1.5 items-center hover:text-stone-700 dark:hover:text-neutral-200"
902
+ @click="sort(column)"
842
903
  >
843
- {{-- `bare`: a header button fills its `<th>` and carries no box
844
- of its own, so none of the sizes fit. It still comes through
845
- `UI/Button` for the shared focus ring and disabled handling.
846
- See stacksjs/stacks#2926. --}}
847
- <Button
848
- :if="column.sortable"
849
- variant="bare"
850
- :ariaLabel="sortLabel(column)"
851
- class="inline-flex gap-1.5 items-center hover:text-stone-700 dark:hover:text-neutral-200"
852
- @click="sort(column)"
853
- >
854
- <span>{{ column.label }}</span>
855
- <span
856
- aria-hidden="true"
857
- :class="'h-3.5 w-3.5 ' + (sortKey() === column.key ? (sortDirection() === 'asc' ? 'i-hugeicons-arrow-up-02' : 'i-hugeicons-arrow-down-02') : 'opacity-30 i-hugeicons-arrow-up-down')"
858
- ></span>
859
- </Button>
904
+ <abbr :if="column.description" :title="column.description" class="underline underline-offset-2 cursor-help decoration-dotted">{{ column.label }}</abbr>
905
+ <span :else>{{ column.label }}</span>
906
+ <span
907
+ aria-hidden="true"
908
+ :class="'h-3.5 w-3.5 ' + (sortKey() === column.key ? (sortDirection() === 'asc' ? 'i-hugeicons-arrow-up-02' : 'i-hugeicons-arrow-down-02') : 'opacity-30 i-hugeicons-arrow-up-down')"
909
+ ></span>
910
+ </Button>
911
+ <span :else>
912
+ <abbr :if="column.description" :title="column.description" class="underline underline-offset-2 cursor-help decoration-dotted">{{ column.label }}</abbr>
860
913
  <span :else>{{ column.label }}</span>
861
- </th>
862
- </template>
914
+ </span>
915
+ </th>
863
916
 
864
917
  {{-- `$slots` only resolves as a standalone reference: inside a
865
918
  compound expression like `$slots.actions || hasRowActions()` the
@@ -872,39 +925,34 @@ function cellClass(column: DashboardTableColumn, index: number): string {
872
925
  <!-- Per-column filter row. -->
873
926
  <tr :if="filterable()" class="border-stone-200/70 border-t dark:border-neutral-700">
874
927
  <td :if="selectable()" class="pl-6 pr-2 py-2"></td>
875
- <template :for="(column, index) in visibleColumns()">
876
- <td :class="(index === 0 && !selectable() ? 'pl-6' : 'pl-4') + ' pr-4 py-2'">
877
- <select
878
- :if="column.filterable && column.filterOptions"
879
- :aria-label="'Filter by ' + column.label"
880
- :value="columnFilters()[column.key] || ''"
881
- @change="setFilter(column.key, $event)"
882
- class="px-1.5 py-1 w-full text-xs bg-white dark:bg-neutral-800 border border-stone-300 rounded dark:border-neutral-600"
883
- >
884
- <option value="">All</option>
885
- <template :for="option in column.filterOptions">
886
- <option :value="option">{{ option }}</option>
887
- </template>
888
- </select>
889
- <input
890
- :else-if="column.filterable"
891
- type="text"
892
- :aria-label="'Filter by ' + column.label"
893
- :placeholder="column.label"
894
- :value="columnFilters()[column.key] || ''"
895
- @input="setFilter(column.key, $event)"
896
- class="px-1.5 py-1 w-full text-xs bg-white dark:bg-neutral-800 border border-stone-300 rounded dark:border-neutral-600"
897
- />
898
- </td>
899
- </template>
928
+ <td :for="(column, index) in visibleColumns()" :class="edgePadding(index) + ' py-2'">
929
+ <select
930
+ :if="column.filterable && column.filterOptions"
931
+ :aria-label="'Filter by ' + column.label"
932
+ :value="columnFilters()[column.key] || ''"
933
+ @change="setFilter(column.key, $event)"
934
+ class="px-1.5 py-1 w-full text-xs bg-white dark:bg-neutral-800 border border-stone-300 rounded dark:border-neutral-600"
935
+ >
936
+ <option value="">All</option>
937
+ <option :for="option in column.filterOptions" :value="option">{{ option }}</option>
938
+ </select>
939
+ <input
940
+ :else-if="column.filterable"
941
+ type="text"
942
+ :aria-label="'Filter by ' + column.label"
943
+ :placeholder="column.label"
944
+ :value="columnFilters()[column.key] || ''"
945
+ @input="setFilter(column.key, $event)"
946
+ class="px-1.5 py-1 w-full text-xs bg-white dark:bg-neutral-800 border border-stone-300 rounded dark:border-neutral-600"
947
+ />
948
+ </td>
900
949
  <td :if="$slots.actions" class="px-4 py-2"></td>
901
950
  <td :else-if="hasRowActions()" class="px-4 py-2"></td>
902
951
  </tr>
903
952
  </thead>
904
953
 
905
954
  <tbody class="divide-stone-100 divide-y dark:divide-neutral-700">
906
- <template :for="(row, rowIndex) in visibleRows()">
907
- <tr :class="rowClass(rowIndex)" :data-row-id="String(row[rowKey()])">
955
+ <tr :for="(row, rowIndex) in visibleRows()" :class="rowClass(rowIndex)" :data-row-id="String(row[rowKey()])">
908
956
  <td :if="selectable()" class="pl-6 pr-2 w-12" :class="compact() ? 'py-2' : 'py-3.5'">
909
957
  <input
910
958
  type="checkbox"
@@ -915,33 +963,31 @@ function cellClass(column: DashboardTableColumn, index: number): string {
915
963
  />
916
964
  </td>
917
965
 
918
- <template :for="(column, columnIndex) in visibleColumns()">
919
- <td :class="cellClass(column, columnIndex)">
920
- {{-- No `$slots` here: it only resolves standalone, so the
921
- compound condition this used to carry made every slotted
922
- cell render nothing. The slot's own fallback covers the
923
- "caller gave no slot" case instead. See stacksjs/stx#2098. --}}
924
- <template :if="column.slotted || !hasSlottedColumns()">
925
- <slot name="cell" :row="row" :column="column" :value="row[column.key]">
926
- <span :if="column.type === 'badge' && hasBadge(row, column)" :class="badgeClass(row, column)">{{ badgeLabel(row, column) }}</span>
927
- <span :if="column.type !== 'badge'">{{ displayValue(row, column) }}</span>
928
- <p :if="subtitleValue(row, column)" class="mt-1 text-neutral-500 text-xs dark:text-neutral-400">{{ subtitleValue(row, column) }}</p>
929
- </slot>
930
- </template>
931
- <template :else>
966
+ <td :for="(column, columnIndex) in visibleColumns()" :class="cellClass(column, columnIndex)">
967
+ {{-- No `$slots` here: it only resolves standalone, so the
968
+ compound condition this used to carry made every slotted
969
+ cell render nothing. The slot's own fallback covers the
970
+ "caller gave no slot" case instead. See stacksjs/stx#2098. --}}
971
+ <template :if="column.slotted || !hasSlottedColumns()">
972
+ <slot name="cell" :row="row" :column="column" :value="row[column.key]">
932
973
  <span :if="column.type === 'badge' && hasBadge(row, column)" :class="badgeClass(row, column)">{{ badgeLabel(row, column) }}</span>
933
974
  <span :if="column.type !== 'badge'">{{ displayValue(row, column) }}</span>
934
975
  <p :if="subtitleValue(row, column)" class="mt-1 text-neutral-500 text-xs dark:text-neutral-400">{{ subtitleValue(row, column) }}</p>
935
- </template>
936
- </td>
937
- </template>
976
+ </slot>
977
+ </template>
978
+ <template :else>
979
+ <span :if="column.type === 'badge' && hasBadge(row, column)" :class="badgeClass(row, column)">{{ badgeLabel(row, column) }}</span>
980
+ <span :if="column.type !== 'badge'">{{ displayValue(row, column) }}</span>
981
+ <p :if="subtitleValue(row, column)" class="mt-1 text-neutral-500 text-xs dark:text-neutral-400">{{ subtitleValue(row, column) }}</p>
982
+ </template>
983
+ </td>
938
984
 
939
985
  <td :if="$slots.actions" class="px-4 w-12" :class="compact() ? 'py-2' : 'py-3'">
940
986
  <slot name="actions" :row="row" />
941
987
  </td>
942
988
  <td :else-if="hasRowActions()" class="px-4 w-12" :class="compact() ? 'py-2' : 'py-3'">
943
989
  <div class="flex gap-1 justify-end">
944
- <template :for="action in rowActions()">
990
+ <span :for="action in rowActions()" class="contents">
945
991
  <Button
946
992
  :if="showsRowAction(row, action)"
947
993
  variant="ghost"
@@ -953,11 +999,10 @@ function cellClass(column: DashboardTableColumn, index: number): string {
953
999
  >
954
1000
  <span aria-hidden="true" :class="rowActionIconClass(action)"></span>
955
1001
  </Button>
956
- </template>
1002
+ </span>
957
1003
  </div>
958
1004
  </td>
959
1005
  </tr>
960
- </template>
961
1006
  </tbody>
962
1007
  </table>
963
1008
  </div>
@@ -986,7 +1031,7 @@ function cellClass(column: DashboardTableColumn, index: number): string {
986
1031
  </div>
987
1032
 
988
1033
  <div
989
- :if="paginated() && totalRows() > 0"
1034
+ :if="paginated() && needsPager()"
990
1035
  class="flex flex-wrap gap-3 items-center justify-between px-4 py-3 bg-neutral-50/50 dark:bg-neutral-800/25 border-neutral-200 border-t dark:border-neutral-700"
991
1036
  >
992
1037
  <div class="flex gap-3 items-center text-neutral-500 text-sm dark:text-neutral-400">
@@ -998,9 +1043,7 @@ function cellClass(column: DashboardTableColumn, index: number): string {
998
1043
  @change="changePageSize($event)"
999
1044
  class="px-1.5 py-1 text-xs bg-white dark:bg-neutral-800 border border-stone-300 rounded dark:border-neutral-600"
1000
1045
  >
1001
- <template :for="option in pageSizeOptions()">
1002
- <option :value="String(option)">{{ option }} / page</option>
1003
- </template>
1046
+ <option :for="option in pageSizeOptions()" :value="String(option)">{{ option }} / page</option>
1004
1047
  </select>
1005
1048
  </label>
1006
1049
  </div>
@@ -87,25 +87,23 @@ function badgeClass(tab: DashboardTab): string {
87
87
  </script>
88
88
 
89
89
  <div role="tablist" :class="'flex overflow-x-auto ' + (fullWidth() ? 'w-full ' : '') + containerClasses[variant()]">
90
- <template :for="tab in tabs()">
91
- <button
92
- type="button"
93
- role="tab"
94
- :aria-selected="String(activeTab() === tab.id)"
95
- :aria-controls="tab.panelId || undefined"
96
- :tabindex="activeTab() === tab.id ? 0 : -1"
97
- :disabled="Boolean(tab.disabled)"
98
- :class="tabClass(tab)"
99
- @click="selectTab(tab)"
90
+ <button :for="tab in tabs()"
91
+ type="button"
92
+ role="tab"
93
+ :aria-selected="String(activeTab() === tab.id)"
94
+ :aria-controls="tab.panelId || undefined"
95
+ :tabindex="activeTab() === tab.id ? 0 : -1"
96
+ :disabled="Boolean(tab.disabled)"
97
+ :class="tabClass(tab)"
98
+ @click="selectTab(tab)"
99
+ >
100
+ <span :if="tab.icon" :class="tab.icon + ' h-4 w-4'"></span>
101
+ <span>{{ tab.label }}</span>
102
+ <span
103
+ :if="tab.badge !== undefined"
104
+ :class="'inline-flex items-center justify-center px-1.5 h-5 min-w-[1.25rem] font-medium text-xs rounded-full ' + badgeClass(tab)"
100
105
  >
101
- <span :if="tab.icon" :class="tab.icon + ' h-4 w-4'"></span>
102
- <span>{{ tab.label }}</span>
103
- <span
104
- :if="tab.badge !== undefined"
105
- :class="'inline-flex items-center justify-center px-1.5 h-5 min-w-[1.25rem] font-medium text-xs rounded-full ' + badgeClass(tab)"
106
- >
107
- {{ tab.badge }}
108
- </span>
109
- </button>
110
- </template>
106
+ {{ tab.badge }}
107
+ </span>
108
+ </button>
111
109
  </div>
@@ -124,6 +124,7 @@ route.group({ prefix: '/api/dashboard', apiResponse: true }, () => {
124
124
  guard(route.patch('/commerce/reviews/{id}', 'Actions/Commerce/ReviewUpdateAction'))
125
125
  guard(route.delete('/commerce/reviews/{id}', 'Actions/Commerce/ReviewDestroyAction'))
126
126
  guard(route.get('/commerce/coupons', 'Actions/Dashboard/Commerce/CommerceCouponsAction'))
127
+ guard(route.get('/commerce/coupons/export', 'Actions/Dashboard/Commerce/CommerceCouponsExportAction'))
127
128
  guard(route.post('/commerce/coupons', 'Actions/Commerce/CouponStoreAction'))
128
129
  guard(route.patch('/commerce/coupons/{id}', 'Actions/Commerce/CouponUpdateAction'))
129
130
  guard(route.delete('/commerce/coupons/{id}', 'Actions/Commerce/CouponDestroyAction'))
@@ -137,6 +138,7 @@ route.group({ prefix: '/api/dashboard', apiResponse: true }, () => {
137
138
  guard(route.patch('/commerce/categories/{id}', 'Actions/Commerce/Product/ProductCategoryUpdateAction'))
138
139
  guard(route.delete('/commerce/categories/{id}', 'Actions/Commerce/Product/ProductCategoryDestroyAction'))
139
140
  guard(route.get('/commerce/customers', 'Actions/Dashboard/Commerce/CommerceCustomersAction'))
141
+ guard(route.get('/commerce/customers/export', 'Actions/Dashboard/Commerce/CommerceCustomersExportAction'))
140
142
  guard(route.post('/commerce/customers', 'Actions/Commerce/CustomerStoreAction'))
141
143
  guard(route.patch('/commerce/customers/{id}', 'Actions/Commerce/CustomerUpdateAction'))
142
144
  guard(route.delete('/commerce/customers/{id}', 'Actions/Commerce/CustomerDestroyAction'))