@stacksjs/defaults 0.75.612 → 0.75.614

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 (132) hide show
  1. package/ai/skills/stacks-actions/SKILL.md +209 -1
  2. package/ai/skills/stacks-api/SKILL.md +1 -1
  3. package/ai/skills/stacks-buddy/SKILL.md +1 -1
  4. package/ai/skills/stacks-dashboard/SKILL.md +120 -9
  5. package/ai/skills/stacks-database/SKILL.md +4 -2
  6. package/ai/skills/stacks-email/SKILL.md +15 -0
  7. package/ai/skills/stacks-middleware/SKILL.md +4 -1
  8. package/ai/skills/stacks-native/CAPABILITIES.md +1 -1
  9. package/ai/skills/stacks-native/CATALOG.md +12 -12
  10. package/ai/skills/stacks-validation/SKILL.md +7 -0
  11. package/app/Actions/Dashboard/Models/ModelDestroyAction.ts +4 -47
  12. package/app/Actions/Dashboard/Models/ModelSaveAction.ts +257 -0
  13. package/app/Actions/Dashboard/Models/ModelStoreAction.ts +4 -31
  14. package/app/Actions/Dashboard/Models/ModelUpdateAction.ts +5 -61
  15. package/app/Actions/Dashboard/Models/model-related.ts +2 -3
  16. package/app/Actions/Dashboard/Models/model-row-writes.ts +188 -0
  17. package/app/Actions/Storefront/AddToCartAction.ts +12 -15
  18. package/app/Actions/Storefront/CheckoutContactAction.ts +18 -10
  19. package/app/Actions/Storefront/CheckoutShippingAction.ts +20 -10
  20. package/app/Actions/Storefront/PlaceOrderAction.ts +9 -12
  21. package/app/Actions/Storefront/UpdateCartItemAction.ts +11 -9
  22. package/app/Middleware/Abilities.ts +4 -3
  23. package/app/Middleware/Csrf.ts +10 -1
  24. package/app/Middleware/Throttle.ts +4 -4
  25. package/functions/dashboard-api.ts +9 -3
  26. package/functions/dashboard-model-bulk.ts +3 -3
  27. package/functions/dashboard-model-drafts.test.ts +122 -0
  28. package/functions/dashboard-model-drafts.ts +228 -0
  29. package/functions/dashboard-model-record.ts +1 -1
  30. package/ide/vscode/package.json +1 -1
  31. package/package.json +5 -5
  32. package/resources/components/Dashboard/Analytics/AnalyticsPageHeader.stx +3 -13
  33. package/resources/components/Dashboard/App/RequestsOverview.stx +3 -20
  34. package/resources/components/Dashboard/App/SourceInventory.stx +1 -5
  35. package/resources/components/Dashboard/Auth/AccessTokenCreateDialog.stx +11 -28
  36. package/resources/components/Dashboard/Commerce/CommerceCategoriesDashboard.stx +4 -8
  37. package/resources/components/Dashboard/Commerce/CommerceCategoryDialog.stx +9 -9
  38. package/resources/components/Dashboard/Commerce/CommerceCouponDialog.stx +14 -14
  39. package/resources/components/Dashboard/Commerce/CommerceCouponsDashboard.stx +5 -9
  40. package/resources/components/Dashboard/Commerce/CommerceCustomerDialog.stx +7 -7
  41. package/resources/components/Dashboard/Commerce/CommerceCustomersDashboard.stx +3 -7
  42. package/resources/components/Dashboard/Commerce/CommerceGiftCardDialog.stx +15 -15
  43. package/resources/components/Dashboard/Commerce/CommerceGiftCardsDashboard.stx +5 -9
  44. package/resources/components/Dashboard/Commerce/CommerceManufacturerDialog.stx +12 -15
  45. package/resources/components/Dashboard/Commerce/CommerceManufacturersDashboard.stx +4 -28
  46. package/resources/components/Dashboard/Commerce/CommerceOrderDialog.stx +15 -15
  47. package/resources/components/Dashboard/Commerce/CommerceOrdersDashboard.stx +4 -8
  48. package/resources/components/Dashboard/Commerce/CommerceOverviewDashboard.stx +3 -11
  49. package/resources/components/Dashboard/Commerce/CommercePaymentsDashboard.stx +8 -9
  50. package/resources/components/Dashboard/Commerce/CommercePosCatalog.stx +3 -20
  51. package/resources/components/Dashboard/Commerce/CommercePosCheckoutDialog.stx +4 -4
  52. package/resources/components/Dashboard/Commerce/CommerceProductDialog.stx +14 -14
  53. package/resources/components/Dashboard/Commerce/CommerceProductsDashboard.stx +4 -8
  54. package/resources/components/Dashboard/Commerce/CommerceReviewEditDialog.stx +14 -24
  55. package/resources/components/Dashboard/Commerce/CommerceReviewsDashboard.stx +5 -43
  56. package/resources/components/Dashboard/Commerce/CommerceTaxDialog.stx +22 -38
  57. package/resources/components/Dashboard/Commerce/CommerceTaxesDashboard.stx +5 -33
  58. package/resources/components/Dashboard/Commerce/CommerceUnitDialog.stx +16 -30
  59. package/resources/components/Dashboard/Commerce/CommerceUnitsDashboard.stx +4 -28
  60. package/resources/components/Dashboard/Commerce/CommerceVariantDialog.stx +15 -9
  61. package/resources/components/Dashboard/Commerce/CommerceVariantsDashboard.stx +8 -9
  62. package/resources/components/Dashboard/Commerce/Delivery/CourierDialog.stx +14 -12
  63. package/resources/components/Dashboard/Commerce/Delivery/DeliveryRouteDialog.stx +9 -11
  64. package/resources/components/Dashboard/Commerce/Delivery/DigitalDeliveryDialog.stx +15 -9
  65. package/resources/components/Dashboard/Commerce/Delivery/LicenseKeyDialog.stx +11 -7
  66. package/resources/components/Dashboard/Commerce/Delivery/ShippingMethodDialog.stx +14 -8
  67. package/resources/components/Dashboard/Commerce/Delivery/ShippingRateDialog.stx +11 -17
  68. package/resources/components/Dashboard/Commerce/Delivery/ShippingZoneDialog.stx +18 -12
  69. package/resources/components/Dashboard/Commerce/PaymentRefundDialog.stx +1 -1
  70. package/resources/components/Dashboard/Commerce/PrintDeviceDialog.stx +5 -5
  71. package/resources/components/Dashboard/Commerce/PrintDevicesDashboard.stx +4 -8
  72. package/resources/components/Dashboard/Commerce/PrintLogsDashboard.stx +5 -9
  73. package/resources/components/Dashboard/Commerce/ProductWaitlistDashboard.stx +2 -10
  74. package/resources/components/Dashboard/Commerce/ProductWaitlistEntryDialog.stx +14 -67
  75. package/resources/components/Dashboard/Commerce/RestaurantWaitlistDashboard.stx +3 -18
  76. package/resources/components/Dashboard/Commerce/RestaurantWaitlistEntryDialog.stx +23 -69
  77. package/resources/components/Dashboard/Content/AuthorEditorDialog.stx +4 -16
  78. package/resources/components/Dashboard/Content/BlogDashboard.stx +2 -19
  79. package/resources/components/Dashboard/Content/BlogPostEditorDialog.stx +31 -51
  80. package/resources/components/Dashboard/Content/CommentsDashboard.stx +1 -1
  81. package/resources/components/Dashboard/Content/ContentDashboard.stx +1 -11
  82. package/resources/components/Dashboard/Content/CreateFolderDialog.stx +1 -4
  83. package/resources/components/Dashboard/Content/FileManagerDashboard.stx +2 -2
  84. package/resources/components/Dashboard/Content/PageEditorDialog.stx +8 -17
  85. package/resources/components/Dashboard/Content/PostEditorDialog.stx +35 -45
  86. package/resources/components/Dashboard/Content/PostsDashboard.stx +1 -13
  87. package/resources/components/Dashboard/Content/SeoDashboard.stx +2 -20
  88. package/resources/components/Dashboard/Content/SeoEditorDialog.stx +4 -38
  89. package/resources/components/Dashboard/Content/TaxonomyEditorDialog.stx +8 -15
  90. package/resources/components/Dashboard/Data/ActivityLog.stx +1 -5
  91. package/resources/components/Dashboard/Deployments/DeploymentList.stx +2 -11
  92. package/resources/components/Dashboard/Email/InboxMessageList.stx +1 -5
  93. package/resources/components/Dashboard/Infrastructure/DnsDashboard.stx +2 -16
  94. package/resources/components/Dashboard/Infrastructure/LogsDashboard.stx +6 -10
  95. package/resources/components/Dashboard/Infrastructure/MailboxesDashboard.stx +1 -5
  96. package/resources/components/Dashboard/Infrastructure/ServersDashboard.stx +1 -5
  97. package/resources/components/Dashboard/Jobs/JobHistory.stx +3 -12
  98. package/resources/components/Dashboard/Kanban/KanbanCardDialog.stx +57 -51
  99. package/resources/components/Dashboard/Library/ComponentsDashboard.stx +4 -14
  100. package/resources/components/Dashboard/Library/DependenciesDashboard.stx +2 -15
  101. package/resources/components/Dashboard/Library/PackagesDashboard.stx +1 -8
  102. package/resources/components/Dashboard/Library/SourceScaffoldDialog.stx +1 -12
  103. package/resources/components/Dashboard/Management/PermissionsDashboard.stx +3 -3
  104. package/resources/components/Dashboard/Marketing/AbandonedCartsDashboard.stx +4 -4
  105. package/resources/components/Dashboard/Marketing/CampaignDeliveryDialog.stx +3 -5
  106. package/resources/components/Dashboard/Marketing/CampaignDialog.stx +59 -93
  107. package/resources/components/Dashboard/Marketing/CampaignsDashboard.stx +5 -5
  108. package/resources/components/Dashboard/Marketing/MarketingListDialog.stx +12 -26
  109. package/resources/components/Dashboard/Marketing/MarketingListsDashboard.stx +4 -4
  110. package/resources/components/Dashboard/Marketing/RecoveryCampaignDialog.stx +12 -43
  111. package/resources/components/Dashboard/Marketing/SocialPostDialog.stx +7 -41
  112. package/resources/components/Dashboard/Marketing/SocialPostsDashboard.stx +5 -5
  113. package/resources/components/Dashboard/Models/ModelRecordEdit.stx +240 -28
  114. package/resources/components/Dashboard/Models/ModelRecordsDashboard.stx +7 -23
  115. package/resources/components/Dashboard/Models/ModelsOverview.stx +2 -12
  116. package/resources/components/Dashboard/Notifications/NotificationDeliveries.stx +4 -27
  117. package/resources/components/Dashboard/Notifications/NotificationDeliveryHistory.stx +4 -36
  118. package/resources/components/Dashboard/Operations/RecoveryDestinationDialog.stx +18 -47
  119. package/resources/components/Dashboard/Operations/RecoveryPolicyDialog.stx +24 -78
  120. package/resources/components/Dashboard/Operations/RecoveryRestoreDialog.stx +8 -19
  121. package/resources/components/Dashboard/Queries/QueryDashboard.stx +3 -21
  122. package/resources/components/Dashboard/Releases/ReleaseDashboard.stx +2 -9
  123. package/resources/components/Dashboard/Settings/SettingsDashboard.stx +1 -11
  124. package/resources/components/Dashboard/UI/Input.stx +50 -1
  125. package/resources/components/Dashboard/UI/SearchFilter.stx +27 -17
  126. package/resources/components/Dashboard/UI/Select.stx +4 -1
  127. package/resources/components/Dashboard/UI/Textarea.stx +16 -1
  128. package/resources/views/cart.stx +14 -0
  129. package/resources/views/checkout/contact.stx +15 -1
  130. package/resources/views/checkout/payment.stx +7 -0
  131. package/resources/views/checkout/shipping.stx +39 -5
  132. package/routes/dashboard-api.ts +2 -0
@@ -7,7 +7,7 @@ const review = useReactiveProp('review', null as ReviewRecord | null)
7
7
  const busy = useReactiveProp('busy', false)
8
8
  const errors = useReactiveProp('errors', {} as Record<string, string>)
9
9
  const emit = defineEmits(['submit', 'close'])
10
- const title = state('')
10
+ const reviewTitle = state('')
11
11
  const content = state('')
12
12
  // A string, so the select can hold "no rating" as well as 1 to 5.
13
13
  const rating = state('5')
@@ -24,7 +24,7 @@ effect(() => {
24
24
  if (hydratedId === current.id)
25
25
  return
26
26
  hydratedId = current.id
27
- title.set(current.title)
27
+ reviewTitle.set(current.title)
28
28
  content.set(current.content)
29
29
  rating.set(current.rating === null ? '' : String(current.rating))
30
30
  approved.set(current.approved)
@@ -32,10 +32,10 @@ effect(() => {
32
32
  })
33
33
 
34
34
  function submit(): void {
35
- if (!title().trim() || !content().trim())
35
+ if (!reviewTitle().trim() || !content().trim())
36
36
  return
37
37
  emit('submit', {
38
- title: title().trim(),
38
+ title: reviewTitle().trim(),
39
39
  content: content().trim(),
40
40
  rating: rating() === '' ? null : Number(rating()),
41
41
  isApproved: approved(),
@@ -61,25 +61,15 @@ function errorMessages(): string[] {
61
61
  </ul>
62
62
 
63
63
  <div class="space-y-4">
64
- <label class="block">
65
- <span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Title</span>
66
- <input x-model="title" type="text" maxlength="100" 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" />
67
- </label>
68
- <label class="block">
69
- <span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Review</span>
70
- <textarea x-model="content" rows="6" maxlength="2000" 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"></textarea>
71
- </label>
72
- <label class="block">
73
- <span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Rating</span>
74
- <select x-model="rating" 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">
75
- <option value="5">5 stars</option>
76
- <option value="4">4 stars</option>
77
- <option value="3">3 stars</option>
78
- <option value="2">2 stars</option>
79
- <option value="1">1 star</option>
80
- <option value="">No rating</option>
81
- </select>
82
- </label>
64
+ <div>
65
+ <Input v-model:value="reviewTitle" label="Title" :maxLength="100" :required="true" />
66
+ </div>
67
+ <div>
68
+ <Textarea v-model:value="content" label="Review" :rows="6" :maxLength="2000" :required="true" />
69
+ </div>
70
+ <div>
71
+ <Select v-model:value="rating" label="Rating" placeholder="" :options="[{ value: '5', label: '5 stars' }, { value: '4', label: '4 stars' }, { value: '3', label: '3 stars' }, { value: '2', label: '2 stars' }, { value: '1', label: '1 star' }, { value: '', label: 'No rating' }]" />
72
+ </div>
83
73
  <div class="grid gap-3 grid-cols-1 sm:grid-cols-2">
84
74
  <div class="p-3 border border-gray-200 rounded-lg dark:border-neutral-700">
85
75
  <Toggle v-model:checked="approved" label="Approved" labelPosition="left" />
@@ -93,7 +83,7 @@ function errorMessages(): string[] {
93
83
  <template #footer>
94
84
  <div class="flex gap-2 justify-end w-full">
95
85
  <Button variant="secondary" :disabled="busy()" @click="emit('close')">Cancel</Button>
96
- <Button type="submit" form="review-form" :loading="busy()" :disabled="!title().trim() || !content().trim()">Save review</Button>
86
+ <Button type="submit" form="review-form" :loading="busy()" :disabled="!reviewTitle().trim() || !content().trim()">Save review</Button>
97
87
  </div>
98
88
  </template>
99
89
  </Modal>
@@ -242,42 +242,10 @@ onMount(() => {
242
242
 
243
243
  <section class="flex flex-col gap-3">
244
244
  <div class="grid gap-3 grid-cols-1 md:grid-cols-2 xl:grid-cols-5">
245
- <div class="relative xl:col-span-2">
246
- <label class="sr-only" for="review-search">Search reviews</label>
247
- <span class="flex absolute inset-y-0 left-0 items-center pl-3 text-gray-400 pointer-events-none">
248
- <span class="h-4 w-4 i-hugeicons-search-01"></span>
249
- </span>
250
- <input id="review-search" x-model="search" type="search" placeholder="Search reviews" class="pl-9 pr-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700" />
251
- </div>
252
- <label>
253
- <span class="sr-only">Product</span>
254
- <select x-model="productFilter" class="px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700">
255
- <option value="all">All products</option>
256
- <option :for="product in products()" :key="product.id" :value="product.id">{{ product.label }}</option>
257
- </select>
258
- </label>
259
- <label>
260
- <span class="sr-only">Rating</span>
261
- <select x-model="ratingFilter" class="px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700">
262
- <option value="all">All ratings</option>
263
- <option value="5">5 stars</option>
264
- <option value="4">4 stars</option>
265
- <option value="3">3 stars</option>
266
- <option value="2">2 stars</option>
267
- <option value="1">1 star</option>
268
- <option value="none">No rating</option>
269
- </select>
270
- </label>
271
- <label>
272
- <span class="sr-only">Moderation state</span>
273
- <select x-model="moderationFilter" class="px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700">
274
- <option value="all">All states</option>
275
- <option value="approved">Approved</option>
276
- <option value="pending">Pending</option>
277
- <option value="featured">Featured</option>
278
- <option value="verified">Verified purchase</option>
279
- </select>
280
- </label>
245
+ <div class="xl:col-span-2"><SearchFilter v-model:searchValue="search" placeholder="Search reviews" ariaLabel="Search reviews" /></div>
246
+ <Select v-model:value="productFilter" ariaLabel="Product" placeholder="" :options="[{ value: 'all', label: 'All products' }, ...products().map(product => ({ value: product.id, label: product.label }))]" />
247
+ <Select v-model:value="ratingFilter" ariaLabel="Rating" placeholder="" :options="[{ value: 'all', label: 'All ratings' }, { value: '5', label: '5 stars' }, { value: '4', label: '4 stars' }, { value: '3', label: '3 stars' }, { value: '2', label: '2 stars' }, { value: '1', label: '1 star' }, { value: 'none', label: 'No rating' }]" />
248
+ <Select v-model:value="moderationFilter" ariaLabel="Moderation state" placeholder="" :options="[{ value: 'all', label: 'All states' }, { value: 'approved', label: 'Approved' }, { value: 'pending', label: 'Pending' }, { value: 'featured', label: 'Featured' }, { value: 'verified', label: 'Verified purchase' }]" />
281
249
  </div>
282
250
 
283
251
  <div class="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
@@ -286,13 +254,7 @@ onMount(() => {
286
254
  </p>
287
255
  <label class="flex gap-2 items-center text-gray-500 text-sm dark:text-neutral-400">
288
256
  Sort
289
- <select x-model="sort" class="px-3 py-1.5 text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700">
290
- <option value="newest">Newest first</option>
291
- <option value="oldest">Oldest first</option>
292
- <option value="rating-high">Highest rating</option>
293
- <option value="rating-low">Lowest rating</option>
294
- <option value="helpful">Most helpful</option>
295
- </select>
257
+ <Select v-model:value="sort" ariaLabel="Sort" size="sm" placeholder="" :options="[{ value: 'newest', label: 'Newest first' }, { value: 'oldest', label: 'Oldest first' }, { value: 'rating-high', label: 'Highest rating' }, { value: 'rating-low', label: 'Lowest rating' }, { value: 'helpful', label: 'Most helpful' }]" />
296
258
  </label>
297
259
  </div>
298
260
 
@@ -10,7 +10,10 @@ const busy = useReactiveProp('busy', false)
10
10
  const errors = useReactiveProp('errors', {} as Record<string, string>)
11
11
  const emit = defineEmits(['submit', 'close'])
12
12
  const name = state('')
13
- const rate = state(0)
13
+ const rate = state<number | string>(0)
14
+ /** The rate as a number: the input reports what was typed, as text. Not a number while it is empty. */
15
+ const rateValue = derived(() => rate() === '' ? Number.NaN : Number(rate()))
16
+ const rateValid = derived(() => rateValue() >= 0 && rateValue() <= 100)
14
17
  const type = state('')
15
18
  const country = state('')
16
19
  const region = state('North America')
@@ -44,11 +47,11 @@ effect(() => {
44
47
  })
45
48
 
46
49
  function submit(): void {
47
- if (!name().trim() || !type().trim() || !country().trim() || rate() < 0 || rate() > 100)
50
+ if (!name().trim() || !type().trim() || !country().trim() || !rateValid())
48
51
  return
49
52
  emit('submit', {
50
53
  name: name().trim(),
51
- rate: rate(),
54
+ rate: rateValue(),
52
55
  type: type().trim(),
53
56
  country: country().trim(),
54
57
  region: region(),
@@ -76,45 +79,26 @@ function errorMessages(): string[] {
76
79
  <li :for="message in errorMessages()" :key="message">{{ message }}</li>
77
80
  </ul>
78
81
  <div class="space-y-4">
79
- <label class="block">
80
- <span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Name</span>
81
- <input x-model="name" type="text" maxlength="255" 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" />
82
- </label>
82
+ <div>
83
+ <Input v-model:value="name" label="Name" :maxLength="255" :required="true" />
84
+ </div>
83
85
  <div class="grid gap-4 sm:grid-cols-2">
84
- <label class="block">
85
- <span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Rate (%)</span>
86
- <input x-model.number="rate" type="number" min="0" max="100" step="0.01" 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" />
87
- </label>
88
- <label class="block">
89
- <span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Type</span>
90
- <input x-model="type" type="text" list="tax-rate-types" maxlength="100" 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" />
86
+ <Input v-model:value="rate" label="Rate (%)" type="number" min="0" max="100" step="0.01" :required="true" />
87
+ <div>
88
+ <Input v-model:value="type" label="Type" list="tax-rate-types" :maxLength="100" :required="true" />
91
89
  <datalist id="tax-rate-types"><option :for="taxType in types()" :key="taxType" :value="taxType"></option></datalist>
92
- </label>
90
+ </div>
91
+ </div>
92
+ <div>
93
+ <Input v-model:value="country" label="Country" :maxLength="100" :required="true" />
93
94
  </div>
94
- <label class="block">
95
- <span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Country</span>
96
- <input x-model="country" type="text" maxlength="100" 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" />
97
- </label>
98
95
  <div class="grid gap-4 sm:grid-cols-2">
99
- <label class="block">
100
- <span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Region</span>
101
- <select x-model="region" 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">
102
- <option :for="regionOption in regions" :key="regionOption" :value="regionOption">{{ regionOption }}</option>
103
- </select>
104
- </label>
105
- <label class="block">
106
- <span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Status</span>
107
- <select x-model="status" 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">
108
- <option value="active">Active</option>
109
- <option value="inactive">Inactive</option>
110
- </select>
111
- </label>
96
+ <Select v-model:value="region" label="Region" placeholder="" :options="[...regions.map(regionOption => ({ value: regionOption, label: regionOption }))]" />
97
+ <Select v-model:value="status" label="Status" placeholder="" :options="[{ value: 'active', label: 'Active' }, { value: 'inactive', label: 'Inactive' }]" />
98
+ </div>
99
+ <div>
100
+ <Input v-model:value="code" label="Code" placeholder="sales" :monospace="true" hint="What the application matches on. Renaming the rate above does not change what is charged; changing this can." />
112
101
  </div>
113
- <label class="block">
114
- <span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Code</span>
115
- <input x-model="code" type="text" placeholder="sales" 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" />
116
- <span class="block mt-1 text-gray-500 text-xs dark:text-neutral-400">What the application matches on. Renaming the rate above does not change what is charged; changing this can.</span>
117
- </label>
118
102
  <div class="p-3 border border-gray-200 rounded-lg dark:border-neutral-700">
119
103
  <Toggle v-model:checked="isDefault" label="Default tax rate" description="Selecting this clears the default flag from every other rate." labelPosition="left" />
120
104
  </div>
@@ -131,7 +115,7 @@ function errorMessages(): string[] {
131
115
  <template #footer>
132
116
  <div class="flex gap-2 justify-end w-full">
133
117
  <Button variant="secondary" :disabled="busy()" @click="emit('close')">Cancel</Button>
134
- <Button type="submit" form="tax-rate-form" :loading="busy()" :disabled="!name().trim() || !type().trim() || !country().trim() || rate() < 0 || rate() > 100">
118
+ <Button type="submit" form="tax-rate-form" :loading="busy()" :disabled="!name().trim() || !type().trim() || !country().trim() || !rateValid()">
135
119
  {{ mode() === 'edit' ? 'Save tax rate' : 'Add tax rate' }}
136
120
  </Button>
137
121
  </div>
@@ -227,45 +227,17 @@ onMount(() => {
227
227
 
228
228
  <section class="flex flex-col gap-3">
229
229
  <div class="grid gap-3 grid-cols-1 sm:grid-cols-2 xl:grid-cols-5">
230
- <label class="relative sm:col-span-2">
231
- <span class="sr-only">Search tax rates</span>
232
- <span class="flex absolute inset-y-0 left-0 items-center pl-3 text-gray-400 pointer-events-none"><span class="h-4 w-4 i-hugeicons-search-01"></span></span>
233
- <input x-model="search" type="search" placeholder="Search tax rates" class="pl-9 pr-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700" />
234
- </label>
235
- <label>
236
- <span class="sr-only">Tax status</span>
237
- <select x-model="statusFilter" class="px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700">
238
- <option value="all">All statuses</option>
239
- <option value="active">Active</option>
240
- <option value="inactive">Inactive</option>
241
- </select>
242
- </label>
243
- <label>
244
- <span class="sr-only">Tax country</span>
245
- <select x-model="countryFilter" class="px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700">
246
- <option value="all">All countries</option>
247
- <option :for="country in countries()" :key="country" :value="country">{{ country }}</option>
248
- </select>
249
- </label>
250
- <label>
251
- <span class="sr-only">Tax type</span>
252
- <select x-model="typeFilter" class="px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700">
253
- <option value="all">All tax types</option>
254
- <option :for="type in taxTypes()" :key="type" :value="type">{{ taxTypeLabel(type) }}</option>
255
- </select>
256
- </label>
230
+ <div class="sm:col-span-2"><SearchFilter v-model:searchValue="search" placeholder="Search tax rates" ariaLabel="Search tax rates" /></div>
231
+ <Select v-model:value="statusFilter" ariaLabel="Tax status" placeholder="" :options="[{ value: 'all', label: 'All statuses' }, { value: 'active', label: 'Active' }, { value: 'inactive', label: 'Inactive' }]" />
232
+ <Select v-model:value="countryFilter" ariaLabel="Tax country" placeholder="" :options="[{ value: 'all', label: 'All countries' }, ...countries().map(country => ({ value: country, label: country }))]" />
233
+ <Select v-model:value="typeFilter" ariaLabel="Tax type" placeholder="" :options="[{ value: 'all', label: 'All tax types' }, ...taxTypes().map(type => ({ value: type, label: taxTypeLabel(type) }))]" />
257
234
  </div>
258
235
 
259
236
  <div class="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
260
237
  <p class="text-gray-500 text-sm dark:text-neutral-400">{{ visibleRecords().length }} matching tax rates</p>
261
238
  <label class="flex gap-2 items-center text-gray-500 text-sm dark:text-neutral-400">
262
239
  Sort
263
- <select x-model="sort" class="px-3 py-1.5 text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700">
264
- <option value="name">Name</option>
265
- <option value="rate">Highest rate</option>
266
- <option value="country">Country</option>
267
- <option value="newest">Newest</option>
268
- </select>
240
+ <Select v-model:value="sort" ariaLabel="Sort" size="sm" placeholder="" :options="[{ value: 'name', label: 'Name' }, { value: 'rate', label: 'Highest rate' }, { value: 'country', label: 'Country' }, { value: 'newest', label: 'Newest' }]" />
269
241
  </label>
270
242
  </div>
271
243
 
@@ -14,7 +14,7 @@ const emit = defineEmits(['submit', 'close'])
14
14
  const name = state('')
15
15
  const abbreviation = state('')
16
16
  const type = state('')
17
- const description = state('')
17
+ const descriptionText = state('')
18
18
  const productId = state('')
19
19
  const isDefault = state(false)
20
20
  let hydrationKey = ''
@@ -83,7 +83,7 @@ effect(() => {
83
83
  name.set(current?.name || '')
84
84
  abbreviation.set(current?.abbreviation || '')
85
85
  type.set(current?.type || '')
86
- description.set(current?.description || '')
86
+ descriptionText.set(current?.description || '')
87
87
  productId.set(current?.productId || '')
88
88
  isDefault.set(current?.isDefault || false)
89
89
  productQuery.set('')
@@ -97,7 +97,7 @@ function submit(): void {
97
97
  name: name().trim(),
98
98
  abbreviation: abbreviation().trim(),
99
99
  type: type().trim(),
100
- description: description().trim(),
100
+ description: descriptionText().trim(),
101
101
  productId: productId() ? Number(productId()) : null,
102
102
  isDefault: isDefault(),
103
103
  })
@@ -121,37 +121,23 @@ function errorMessages(): string[] {
121
121
  </ul>
122
122
  <div class="space-y-4">
123
123
  <div class="grid gap-4 sm:grid-cols-2">
124
- <label class="block">
125
- <span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Name</span>
126
- <input x-model="name" type="text" maxlength="100" 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" />
127
- </label>
128
- <label class="block">
129
- <span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Abbreviation</span>
130
- <input x-model="abbreviation" type="text" maxlength="10" 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" />
131
- </label>
124
+ <Input v-model:value="name" label="Name" :maxLength="100" :required="true" />
125
+ <Input v-model:value="abbreviation" label="Abbreviation" :maxLength="10" :required="true" />
132
126
  </div>
133
- <label class="block">
134
- <span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Type</span>
135
- <input x-model="type" type="text" list="product-unit-types" 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" />
136
- <datalist id="product-unit-types">
137
- <option :for="unitType in types()" :key="unitType" :value="unitType"></option>
138
- </datalist>
139
- </label>
140
- <label class="block">
141
- <span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Product</span>
142
- <input x-model="productQuery" @input="searchProductsSoon()" type="search" name="product_search" aria-label="Search products by name or id" placeholder="Search by name or id" 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" />
143
- </label>
144
127
  <div>
145
- <select x-model="productId" aria-label="Product" class="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">
146
- <option value="">Unassigned</option>
147
- <option :for="product in products()" :key="product.id" :value="product.id" :selected="product.id === productId()">{{ product.label }}</option>
148
- </select>
128
+ <Input v-model:value="type" label="Type" list="product-unit-types" :required="true" />
129
+ <datalist id="product-unit-types"><option :for="unitType in types()" :key="unitType" :value="unitType"></option></datalist>
130
+ </div>
131
+ <div>
132
+ <Input v-model:value="productQuery" label="Product" type="search" name="product_search" ariaLabel="Search products by name or id" placeholder="Search by name or id" @input="searchProductsSoon()" />
133
+ </div>
134
+ <div>
135
+ <Select v-model:value="productId" ariaLabel="Product" placeholder="" :options="[{ value: '', label: 'Unassigned' }, ...products().map(product => ({ value: product.id, label: product.label }))]" />
149
136
  <p :if="moreProductsLabel()" class="mt-1 text-gray-500 text-xs dark:text-neutral-400" :text="moreProductsLabel()"></p>
150
137
  </div>
151
- <label class="block">
152
- <span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Description</span>
153
- <textarea x-model="description" rows="3" maxlength="255" 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>
154
- </label>
138
+ <div>
139
+ <Textarea v-model:value="descriptionText" label="Description" :rows="3" :maxLength="255" />
140
+ </div>
155
141
  <div class="p-3 border border-gray-200 rounded-lg dark:border-neutral-700">
156
142
  <Toggle v-model:checked="isDefault" label="Default for this type" description="Selecting this clears any other default in the same unit type." labelPosition="left" />
157
143
  </div>
@@ -215,40 +215,16 @@ onMount(() => {
215
215
 
216
216
  <section class="flex flex-col gap-3">
217
217
  <div class="grid gap-3 grid-cols-1 sm:grid-cols-2 xl:grid-cols-4">
218
- <label class="relative sm:col-span-2">
219
- <span class="sr-only">Search product units</span>
220
- <span class="flex absolute inset-y-0 left-0 items-center pl-3 text-gray-400 pointer-events-none">
221
- <span class="h-4 w-4 i-hugeicons-search-01"></span>
222
- </span>
223
- <input x-model="search" type="search" placeholder="Search product units" class="pl-9 pr-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700" />
224
- </label>
225
- <label>
226
- <span class="sr-only">Unit type</span>
227
- <select x-model="typeFilter" class="px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700">
228
- <option value="all">All unit types</option>
229
- <option :for="type in unitTypes()" :key="type" :value="type">{{ type }}</option>
230
- </select>
231
- </label>
232
- <label>
233
- <span class="sr-only">Default state</span>
234
- <select x-model="defaultFilter" class="px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700">
235
- <option value="all">All units</option>
236
- <option value="default">Defaults only</option>
237
- <option value="not-default">Not default</option>
238
- </select>
239
- </label>
218
+ <div class="sm:col-span-2"><SearchFilter v-model:searchValue="search" placeholder="Search product units" ariaLabel="Search product units" /></div>
219
+ <Select v-model:value="typeFilter" ariaLabel="Unit type" placeholder="" :options="[{ value: 'all', label: 'All unit types' }, ...unitTypes().map(type => ({ value: type, label: type }))]" />
220
+ <Select v-model:value="defaultFilter" ariaLabel="Default state" placeholder="" :options="[{ value: 'all', label: 'All units' }, { value: 'default', label: 'Defaults only' }, { value: 'not-default', label: 'Not default' }]" />
240
221
  </div>
241
222
 
242
223
  <div class="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
243
224
  <p class="text-gray-500 text-sm dark:text-neutral-400">{{ matchingLabel() }}</p>
244
225
  <label class="flex gap-2 items-center text-gray-500 text-sm dark:text-neutral-400">
245
226
  Sort
246
- <select x-model="sort" class="px-3 py-1.5 text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700">
247
- <option value="name">Name</option>
248
- <option value="type">Type</option>
249
- <option value="product">Product</option>
250
- <option value="newest">Newest</option>
251
- </select>
227
+ <Select v-model:value="sort" ariaLabel="Sort" size="sm" placeholder="" :options="[{ value: 'name', label: 'Name' }, { value: 'type', label: 'Type' }, { value: 'product', label: 'Product' }, { value: 'newest', label: 'Newest' }]" />
252
228
  </label>
253
229
  </div>
254
230
 
@@ -13,7 +13,7 @@ const errors = useReactiveProp('errors', {} as Record<string, string>)
13
13
  const emit = defineEmits(['submit', 'close'])
14
14
  const variant = state('')
15
15
  const type = state('')
16
- const description = state('')
16
+ const descriptionText = state('')
17
17
  const options = state('')
18
18
  const status = state<'active' | 'inactive' | 'draft'>('active')
19
19
  const productId = state('')
@@ -82,7 +82,7 @@ effect(() => {
82
82
  hydrationKey = key
83
83
  variant.set(current?.variant || '')
84
84
  type.set(current?.type || '')
85
- description.set(current?.description || '')
85
+ descriptionText.set(current?.description || '')
86
86
  options.set(current?.options.join(', ') || '')
87
87
  status.set(current?.status || 'active')
88
88
  productId.set(current?.productId || '')
@@ -96,7 +96,7 @@ function submit(): void {
96
96
  emit('submit', {
97
97
  variant: variant().trim(),
98
98
  type: type().trim(),
99
- description: description().trim(),
99
+ description: descriptionText().trim(),
100
100
  options: options().split(/[,\n]/).map(option => option.trim()).filter(Boolean),
101
101
  status: status(),
102
102
  productId: productId() ? Number(productId()) : null,
@@ -121,13 +121,19 @@ function errorMessages(): string[] {
121
121
  </ul>
122
122
  <div class="space-y-4">
123
123
  <div class="grid gap-4 sm:grid-cols-2">
124
- <label class="block"><span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Variant</span><input x-model="variant" type="text" maxlength="100" 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
- <label class="block"><span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Type</span><input x-model="type" type="text" list="product-variant-types" 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" /><datalist id="product-variant-types"><option :for="variantType in types()" :key="variantType" :value="variantType"></option></datalist></label>
124
+ <Input v-model:value="variant" label="Variant" :maxLength="100" :required="true" />
125
+ <div><Input v-model:value="type" label="Type" list="product-variant-types" :maxLength="50" :required="true" /><datalist id="product-variant-types"><option :for="variantType in types()" :key="variantType" :value="variantType"></option></datalist></div>
126
+ </div>
127
+ <div><Input v-model:value="productQuery" label="Product" type="search" name="product_search" ariaLabel="Search products by name or id" placeholder="Search by name or id" @input="searchProductsSoon()" /><div class="mt-2"><Select v-model:value="productId" ariaLabel="Product" placeholder="" :options="[{ value: '', label: 'Unassigned' }, ...products().map(product => ({ value: product.id, label: product.label }))]" /></div><p :if="moreProductsLabel()" class="mt-1 text-gray-500 text-xs dark:text-neutral-400" :text="moreProductsLabel()"></p></div>
128
+ <div>
129
+ <Textarea v-model:value="descriptionText" label="Description" :rows="3" />
130
+ </div>
131
+ <div>
132
+ <Textarea v-model:value="options" label="Options" :rows="3" placeholder="Small, Medium, Large" hint="Separate options with commas or new lines." />
133
+ </div>
134
+ <div>
135
+ <Select v-model:value="status" label="Status" placeholder="" :options="[{ value: 'active', label: 'Active' }, { value: 'inactive', label: 'Inactive' }, { value: 'draft', label: 'Draft' }]" />
126
136
  </div>
127
- <div><label class="block"><span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Product</span><input x-model="productQuery" @input="searchProductsSoon()" type="search" name="product_search" aria-label="Search products by name or id" placeholder="Search by name or id" 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><select x-model="productId" aria-label="Product" class="mt-2 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="">Unassigned</option><option :for="product in products()" :key="product.id" :value="product.id" :selected="product.id === productId()">{{ product.label }}</option></select><p :if="moreProductsLabel()" class="mt-1 text-gray-500 text-xs dark:text-neutral-400" :text="moreProductsLabel()"></p></div>
128
- <label class="block"><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>
129
- <label class="block"><span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Options</span><textarea x-model="options" rows="3" placeholder="Small, Medium, Large" 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><span class="block mt-1 text-gray-500 text-xs dark:text-neutral-400">Separate options with commas or new lines.</span></label>
130
- <label class="block"><span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Status</span><select x-model="status" 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="active">Active</option><option value="inactive">Inactive</option><option value="draft">Draft</option></select></label>
131
137
  </div>
132
138
  </form>
133
139
  <template #footer>
@@ -209,19 +209,18 @@ onMount(() => {
209
209
 
210
210
  <section class="flex flex-col gap-3">
211
211
  <div class="grid gap-3 grid-cols-1 sm:grid-cols-2 xl:grid-cols-5">
212
- <label class="relative sm:col-span-2">
213
- <span class="sr-only">Search product variants</span>
214
- <span class="flex absolute inset-y-0 left-0 items-center pl-3 text-gray-400 pointer-events-none"><span class="h-4 w-4 i-hugeicons-search-01"></span></span>
215
- <input x-model="search" type="search" placeholder="Search product variants" class="pl-9 pr-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700" />
216
- </label>
217
- <label><span class="sr-only">Variant status</span><select x-model="statusFilter" class="px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700"><option value="all">All statuses</option><option value="active">Active</option><option value="inactive">Inactive</option><option value="draft">Draft</option></select></label>
218
- <label><span class="sr-only">Variant type</span><select x-model="typeFilter" class="px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700"><option value="all">All types</option><option :for="type in variantTypes()" :key="type" :value="type">{{ type }}</option></select></label>
219
- <label><span class="sr-only">Variant product</span><select x-model="productFilter" class="px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700"><option value="all">All products</option><option :for="product in products()" :key="product.id" :value="product.id">{{ product.name }}</option></select></label>
212
+ <div class="sm:col-span-2"><SearchFilter v-model:searchValue="search" placeholder="Search product variants" ariaLabel="Search product variants" /></div>
213
+ <Select v-model:value="statusFilter" ariaLabel="Variant status" placeholder="" :options="[{ value: 'all', label: 'All statuses' }, { value: 'active', label: 'Active' }, { value: 'inactive', label: 'Inactive' }, { value: 'draft', label: 'Draft' }]" />
214
+ <Select v-model:value="typeFilter" ariaLabel="Variant type" placeholder="" :options="[{ value: 'all', label: 'All types' }, ...variantTypes().map(type => ({ value: type, label: type }))]" />
215
+ <Select v-model:value="productFilter" ariaLabel="Variant product" placeholder="" :options="[{ value: 'all', label: 'All products' }, ...products().map(product => ({ value: product.id, label: product.name }))]" />
220
216
  </div>
221
217
 
222
218
  <div class="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
223
219
  <p class="text-gray-500 text-sm dark:text-neutral-400">{{ matchingLabel() }}</p>
224
- <label class="flex gap-2 items-center text-gray-500 text-sm dark:text-neutral-400">Sort<select x-model="sort" class="px-3 py-1.5 text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700"><option value="variant">Name</option><option value="options">Most options</option><option value="product">Product</option><option value="newest">Newest</option></select></label>
220
+ <label class="flex gap-2 items-center text-gray-500 text-sm dark:text-neutral-400">
221
+ Sort
222
+ <Select v-model:value="sort" ariaLabel="Sort" size="sm" placeholder="" :options="[{ value: 'variant', label: 'Name' }, { value: 'options', label: 'Most options' }, { value: 'product', label: 'Product' }, { value: 'newest', label: 'Newest' }]" />
223
+ </label>
225
224
  </div>
226
225
 
227
226
  <CommerceVariantsTable :sort-reset-key="sort()" :records="records()" :total="total()" :current-page="page()" :per-page="perPage()" :loading="loading()" @edit="openEdit" @delete="openDelete" @page-change="changePage" @page-size-change="changePageSize" @sort="changeSort" />
@@ -95,20 +95,22 @@ function submit(): void {
95
95
  <div :if="error()" class="mb-5 p-3 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">{{ error() }}</div>
96
96
 
97
97
  <div class="space-y-4">
98
- <label class="block"><span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Courier name</span><input x-model="name" type="text" required maxlength="255" autocomplete="name" placeholder="Alex Morgan" 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>
99
- <label class="block"><span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Phone</span><input x-model="phone" type="tel" required maxlength="255" autocomplete="tel" placeholder="+1 555 0100" 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>
98
+ <div>
99
+ <Input v-model:value="name" label="Courier name" :required="true" :maxLength="255" autocomplete="name" placeholder="Alex Morgan" />
100
+ </div>
101
+ <div>
102
+ <Input v-model:value="phone" label="Phone" type="tel" :required="true" :maxLength="255" autocomplete="tel" placeholder="+1 555 0100" />
103
+ </div>
100
104
  <div class="grid gap-4 grid-cols-1 sm:grid-cols-2">
101
- <label class="block"><span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Vehicle number</span><input x-model="vehicleNumber" type="text" required maxlength="255" autocomplete="off" placeholder="VAN-204" 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>
102
- <label class="block"><span class="font-medium text-gray-700 text-sm dark:text-neutral-200">License number</span><input x-model="license" type="text" required maxlength="255" autocomplete="off" placeholder="D1234567" 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>
105
+ <Input v-model:value="vehicleNumber" label="Vehicle number" :required="true" :maxLength="255" autocomplete="off" placeholder="VAN-204" :monospace="true" class="uppercase" />
106
+ <Input v-model:value="license" label="License number" :required="true" :maxLength="255" autocomplete="off" placeholder="D1234567" :monospace="true" class="uppercase" />
107
+ </div>
108
+ <div>
109
+ <Select v-model:value="status" label="Status" placeholder="" :options="[{ value: 'active', label: 'Available' }, { value: 'on_delivery', label: 'On delivery' }, { value: 'on_break', label: 'On break' }]" />
110
+ </div>
111
+ <div>
112
+ <Select v-model:value="userId" label="Linked user" placeholder="" :options="[{ value: '', label: 'No linked user' }, ...users().map(user => ({ value: user.id, label: `${user.name}${user.email ? ' - ' + user.email : ''}` }))]" />
103
113
  </div>
104
- <label class="block"><span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Status</span><select x-model="status" 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="active">Available</option><option value="on_delivery">On delivery</option><option value="on_break">On break</option></select></label>
105
- <label class="block">
106
- <span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Linked user</span>
107
- <select x-model="userId" 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">
108
- <option value="">No linked user</option>
109
- <option :for="user in users()" :key="user.id" :value="user.id">{{ user.name }}{{ user.email ? ' - ' + user.email : '' }}</option>
110
- </select>
111
- </label>
112
114
  </div>
113
115
  </form>
114
116
  <template #footer>