@stacksjs/defaults 0.75.612 → 0.75.613

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 (116) hide show
  1. package/ai/skills/stacks-actions/SKILL.md +208 -0
  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 +79 -0
  5. package/ai/skills/stacks-middleware/SKILL.md +4 -1
  6. package/ai/skills/stacks-native/CATALOG.md +12 -12
  7. package/ai/skills/stacks-validation/SKILL.md +7 -0
  8. package/app/Actions/Storefront/AddToCartAction.ts +12 -15
  9. package/app/Actions/Storefront/CheckoutContactAction.ts +18 -10
  10. package/app/Actions/Storefront/CheckoutShippingAction.ts +20 -10
  11. package/app/Actions/Storefront/PlaceOrderAction.ts +9 -12
  12. package/app/Actions/Storefront/UpdateCartItemAction.ts +11 -9
  13. package/app/Middleware/Abilities.ts +4 -3
  14. package/app/Middleware/Csrf.ts +10 -1
  15. package/app/Middleware/Throttle.ts +4 -4
  16. package/ide/vscode/package.json +1 -1
  17. package/package.json +5 -5
  18. package/resources/components/Dashboard/Analytics/AnalyticsPageHeader.stx +3 -13
  19. package/resources/components/Dashboard/App/RequestsOverview.stx +3 -20
  20. package/resources/components/Dashboard/App/SourceInventory.stx +1 -5
  21. package/resources/components/Dashboard/Auth/AccessTokenCreateDialog.stx +11 -28
  22. package/resources/components/Dashboard/Commerce/CommerceCategoriesDashboard.stx +4 -8
  23. package/resources/components/Dashboard/Commerce/CommerceCategoryDialog.stx +9 -9
  24. package/resources/components/Dashboard/Commerce/CommerceCouponDialog.stx +14 -14
  25. package/resources/components/Dashboard/Commerce/CommerceCouponsDashboard.stx +5 -9
  26. package/resources/components/Dashboard/Commerce/CommerceCustomerDialog.stx +7 -7
  27. package/resources/components/Dashboard/Commerce/CommerceCustomersDashboard.stx +3 -7
  28. package/resources/components/Dashboard/Commerce/CommerceGiftCardDialog.stx +15 -15
  29. package/resources/components/Dashboard/Commerce/CommerceGiftCardsDashboard.stx +5 -9
  30. package/resources/components/Dashboard/Commerce/CommerceManufacturerDialog.stx +12 -15
  31. package/resources/components/Dashboard/Commerce/CommerceManufacturersDashboard.stx +4 -28
  32. package/resources/components/Dashboard/Commerce/CommerceOrderDialog.stx +15 -15
  33. package/resources/components/Dashboard/Commerce/CommerceOrdersDashboard.stx +4 -8
  34. package/resources/components/Dashboard/Commerce/CommerceOverviewDashboard.stx +3 -11
  35. package/resources/components/Dashboard/Commerce/CommercePaymentsDashboard.stx +8 -9
  36. package/resources/components/Dashboard/Commerce/CommercePosCatalog.stx +3 -20
  37. package/resources/components/Dashboard/Commerce/CommercePosCheckoutDialog.stx +4 -4
  38. package/resources/components/Dashboard/Commerce/CommerceProductDialog.stx +14 -14
  39. package/resources/components/Dashboard/Commerce/CommerceProductsDashboard.stx +4 -8
  40. package/resources/components/Dashboard/Commerce/CommerceReviewEditDialog.stx +14 -24
  41. package/resources/components/Dashboard/Commerce/CommerceReviewsDashboard.stx +5 -43
  42. package/resources/components/Dashboard/Commerce/CommerceTaxDialog.stx +22 -38
  43. package/resources/components/Dashboard/Commerce/CommerceTaxesDashboard.stx +5 -33
  44. package/resources/components/Dashboard/Commerce/CommerceUnitDialog.stx +16 -30
  45. package/resources/components/Dashboard/Commerce/CommerceUnitsDashboard.stx +4 -28
  46. package/resources/components/Dashboard/Commerce/CommerceVariantDialog.stx +15 -9
  47. package/resources/components/Dashboard/Commerce/CommerceVariantsDashboard.stx +8 -9
  48. package/resources/components/Dashboard/Commerce/Delivery/CourierDialog.stx +14 -12
  49. package/resources/components/Dashboard/Commerce/Delivery/DeliveryRouteDialog.stx +9 -11
  50. package/resources/components/Dashboard/Commerce/Delivery/DigitalDeliveryDialog.stx +15 -9
  51. package/resources/components/Dashboard/Commerce/Delivery/LicenseKeyDialog.stx +11 -7
  52. package/resources/components/Dashboard/Commerce/Delivery/ShippingMethodDialog.stx +14 -8
  53. package/resources/components/Dashboard/Commerce/Delivery/ShippingRateDialog.stx +11 -17
  54. package/resources/components/Dashboard/Commerce/Delivery/ShippingZoneDialog.stx +18 -12
  55. package/resources/components/Dashboard/Commerce/PaymentRefundDialog.stx +1 -1
  56. package/resources/components/Dashboard/Commerce/PrintDeviceDialog.stx +5 -5
  57. package/resources/components/Dashboard/Commerce/PrintDevicesDashboard.stx +4 -8
  58. package/resources/components/Dashboard/Commerce/PrintLogsDashboard.stx +5 -9
  59. package/resources/components/Dashboard/Commerce/ProductWaitlistDashboard.stx +2 -10
  60. package/resources/components/Dashboard/Commerce/ProductWaitlistEntryDialog.stx +14 -67
  61. package/resources/components/Dashboard/Commerce/RestaurantWaitlistDashboard.stx +3 -18
  62. package/resources/components/Dashboard/Commerce/RestaurantWaitlistEntryDialog.stx +23 -69
  63. package/resources/components/Dashboard/Content/AuthorEditorDialog.stx +4 -16
  64. package/resources/components/Dashboard/Content/BlogDashboard.stx +2 -19
  65. package/resources/components/Dashboard/Content/BlogPostEditorDialog.stx +31 -51
  66. package/resources/components/Dashboard/Content/CommentsDashboard.stx +1 -1
  67. package/resources/components/Dashboard/Content/ContentDashboard.stx +1 -11
  68. package/resources/components/Dashboard/Content/CreateFolderDialog.stx +1 -4
  69. package/resources/components/Dashboard/Content/FileManagerDashboard.stx +2 -2
  70. package/resources/components/Dashboard/Content/PageEditorDialog.stx +8 -17
  71. package/resources/components/Dashboard/Content/PostEditorDialog.stx +35 -45
  72. package/resources/components/Dashboard/Content/PostsDashboard.stx +1 -13
  73. package/resources/components/Dashboard/Content/SeoDashboard.stx +2 -20
  74. package/resources/components/Dashboard/Content/SeoEditorDialog.stx +4 -38
  75. package/resources/components/Dashboard/Content/TaxonomyEditorDialog.stx +8 -15
  76. package/resources/components/Dashboard/Data/ActivityLog.stx +1 -5
  77. package/resources/components/Dashboard/Deployments/DeploymentList.stx +2 -11
  78. package/resources/components/Dashboard/Email/InboxMessageList.stx +1 -5
  79. package/resources/components/Dashboard/Infrastructure/DnsDashboard.stx +2 -16
  80. package/resources/components/Dashboard/Infrastructure/LogsDashboard.stx +6 -10
  81. package/resources/components/Dashboard/Infrastructure/MailboxesDashboard.stx +1 -5
  82. package/resources/components/Dashboard/Infrastructure/ServersDashboard.stx +1 -5
  83. package/resources/components/Dashboard/Jobs/JobHistory.stx +3 -12
  84. package/resources/components/Dashboard/Kanban/KanbanCardDialog.stx +57 -51
  85. package/resources/components/Dashboard/Library/ComponentsDashboard.stx +4 -14
  86. package/resources/components/Dashboard/Library/DependenciesDashboard.stx +2 -15
  87. package/resources/components/Dashboard/Library/PackagesDashboard.stx +1 -8
  88. package/resources/components/Dashboard/Library/SourceScaffoldDialog.stx +1 -12
  89. package/resources/components/Dashboard/Management/PermissionsDashboard.stx +3 -3
  90. package/resources/components/Dashboard/Marketing/AbandonedCartsDashboard.stx +4 -4
  91. package/resources/components/Dashboard/Marketing/CampaignDeliveryDialog.stx +3 -5
  92. package/resources/components/Dashboard/Marketing/CampaignDialog.stx +59 -93
  93. package/resources/components/Dashboard/Marketing/CampaignsDashboard.stx +5 -5
  94. package/resources/components/Dashboard/Marketing/MarketingListDialog.stx +12 -26
  95. package/resources/components/Dashboard/Marketing/MarketingListsDashboard.stx +4 -4
  96. package/resources/components/Dashboard/Marketing/RecoveryCampaignDialog.stx +12 -43
  97. package/resources/components/Dashboard/Marketing/SocialPostDialog.stx +7 -41
  98. package/resources/components/Dashboard/Marketing/SocialPostsDashboard.stx +5 -5
  99. package/resources/components/Dashboard/Models/ModelRecordsDashboard.stx +7 -23
  100. package/resources/components/Dashboard/Models/ModelsOverview.stx +2 -12
  101. package/resources/components/Dashboard/Notifications/NotificationDeliveries.stx +4 -27
  102. package/resources/components/Dashboard/Notifications/NotificationDeliveryHistory.stx +4 -36
  103. package/resources/components/Dashboard/Operations/RecoveryDestinationDialog.stx +18 -47
  104. package/resources/components/Dashboard/Operations/RecoveryPolicyDialog.stx +24 -78
  105. package/resources/components/Dashboard/Operations/RecoveryRestoreDialog.stx +8 -19
  106. package/resources/components/Dashboard/Queries/QueryDashboard.stx +3 -21
  107. package/resources/components/Dashboard/Releases/ReleaseDashboard.stx +2 -9
  108. package/resources/components/Dashboard/Settings/SettingsDashboard.stx +1 -11
  109. package/resources/components/Dashboard/UI/Input.stx +50 -1
  110. package/resources/components/Dashboard/UI/SearchFilter.stx +27 -17
  111. package/resources/components/Dashboard/UI/Select.stx +4 -1
  112. package/resources/components/Dashboard/UI/Textarea.stx +16 -1
  113. package/resources/views/cart.stx +14 -0
  114. package/resources/views/checkout/contact.stx +15 -1
  115. package/resources/views/checkout/payment.stx +7 -0
  116. package/resources/views/checkout/shipping.stx +39 -5
@@ -142,8 +142,8 @@ effect(() => {
142
142
  void loadChoices('customers', '')
143
143
  })
144
144
 
145
- function hydrateCustomer(event: Event): void {
146
- const selectedId = (event.target as HTMLSelectElement).value
145
+ /** The customer just chosen, by the id the select reports. */
146
+ function hydrateCustomer(selectedId: string): void {
147
147
  const customer = customers().find(option => option.id === selectedId)
148
148
  if (!customer)
149
149
  return
@@ -193,86 +193,33 @@ function errorMessages(): string[] {
193
193
  </ul>
194
194
 
195
195
  <div class="grid gap-4 sm:grid-cols-2 mt-6">
196
- <label class="block sm:col-span-2">
197
- <span class="block font-medium text-gray-900 text-sm dark:text-neutral-200">Product</span>
198
- <input x-model="productQuery" @input="searchSoon('products')" type="search" name="product_search" aria-label="Search products by name or id" placeholder="Search products by name or id" class="block mt-2 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-700 border border-gray-300 rounded-md dark:border-neutral-600" />
199
- </label>
196
+ <div class="sm:col-span-2"><Input v-model:value="productQuery" label="Product" type="search" name="product_search" ariaLabel="Search products by name or id" placeholder="Search products by name or id" @input="searchSoon('products')" /></div>
200
197
  <div class="sm:col-span-2 -mt-2">
201
- <select x-model="productId" required aria-label="Product" class="block px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-700 border border-gray-300 rounded-md dark:border-neutral-600">
202
- <option value="">Select a product</option>
203
- <option :for="option in products()" :key="option.id" :value="option.id" :selected="option.id === String(productId())">{{ option.label }}{{ option.detail ? ' · ' + option.detail : '' }}</option>
204
- </select>
198
+ <Select v-model:value="productId" ariaLabel="Product" :required="true" placeholder="Select a product" :options="[...products().map(option => ({ value: option.id, label: option.label + (option.detail ? ' · ' + option.detail : '') }))]" />
205
199
  <p :if="moreLabel(productChoices().length, productMatches(), 'products')" class="mt-1 text-gray-500 text-xs dark:text-neutral-400" :text="moreLabel(productChoices().length, productMatches(), 'products')"></p>
206
200
  </div>
207
201
 
208
- <label class="block sm:col-span-2">
209
- <span class="block font-medium text-gray-900 text-sm dark:text-neutral-200">Existing customer</span>
210
- <input x-model="customerQuery" @input="searchSoon('customers')" type="search" name="customer_search" aria-label="Search customers by name, email or phone" placeholder="Search customers by name, email or phone" class="block mt-2 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-700 border border-gray-300 rounded-md dark:border-neutral-600" />
211
- </label>
202
+ <div class="sm:col-span-2"><Input v-model:value="customerQuery" label="Existing customer" type="search" name="customer_search" ariaLabel="Search customers by name, email or phone" placeholder="Search customers by name, email or phone" @input="searchSoon('customers')" /></div>
212
203
  <div class="sm:col-span-2 -mt-2">
213
- <select x-model="customerId" aria-label="Existing customer" class="block px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-700 border border-gray-300 rounded-md dark:border-neutral-600" @change="hydrateCustomer($event)">
214
- <option value="">No linked customer</option>
215
- <option :for="option in customers()" :key="option.id" :value="option.id" :selected="option.id === String(customerId())">{{ option.label }}{{ option.detail ? ' · ' + option.detail : '' }}</option>
216
- </select>
204
+ <Select v-model:value="customerId" ariaLabel="Existing customer" placeholder="" :options="[{ value: '', label: 'No linked customer' }, ...customers().map(option => ({ value: option.id, label: option.label + (option.detail ? ' · ' + option.detail : '') }))]" @change="hydrateCustomer($event)" />
217
205
  <p :if="moreLabel(customerChoices().length, customerMatches(), 'customers')" class="mt-1 text-gray-500 text-xs dark:text-neutral-400" :text="moreLabel(customerChoices().length, customerMatches(), 'customers')"></p>
218
206
  </div>
219
207
 
220
- <label class="block">
221
- <span class="block font-medium text-gray-900 text-sm dark:text-neutral-200">Name</span>
222
- <input type="text" x-model.trim="name" required maxlength="255" autocomplete="name" class="block mt-2 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-700 border border-gray-300 rounded-md dark:border-neutral-600" />
223
- </label>
208
+ <Input v-model:value="name" label="Name" :required="true" :maxLength="255" autocomplete="name" />
224
209
 
225
- <label class="block">
226
- <span class="block font-medium text-gray-900 text-sm dark:text-neutral-200">Email</span>
227
- <input type="email" x-model.trim="email" required maxlength="255" autocomplete="email" class="block mt-2 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-700 border border-gray-300 rounded-md dark:border-neutral-600" />
228
- </label>
210
+ <Input type="email" label="Email" v-model:value="email" :required="true" :maxLength="255" autocomplete="email" />
229
211
 
230
- <label class="block">
231
- <span class="block font-medium text-gray-900 text-sm dark:text-neutral-200">Phone</span>
232
- <input type="tel" x-model.trim="phone" maxlength="100" autocomplete="tel" class="block mt-2 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-700 border border-gray-300 rounded-md dark:border-neutral-600" />
233
- </label>
212
+ <Input type="tel" label="Phone" v-model:value="phone" :maxLength="100" autocomplete="tel" />
234
213
 
235
- <label class="block">
236
- <span class="block font-medium text-gray-900 text-sm dark:text-neutral-200">Quantity</span>
237
- <input type="number" x-model.number="quantity" required min="1" step="1" class="block mt-2 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-700 border border-gray-300 rounded-md dark:border-neutral-600" />
238
- </label>
214
+ <Input type="number" label="Quantity" v-model:value="quantity" :required="true" min="1" step="1" />
239
215
 
240
- <label class="block">
241
- <span class="block font-medium text-gray-900 text-sm dark:text-neutral-200">Notification preference</span>
242
- <select x-model="notificationPreference" required class="block mt-2 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-700 border border-gray-300 rounded-md dark:border-neutral-600">
243
- <option value="email">Email</option>
244
- <option value="sms">SMS</option>
245
- <option value="both">Email and SMS</option>
246
- </select>
247
- </label>
216
+ <Select v-model:value="notificationPreference" label="Notification preference" :required="true" placeholder="" :options="[{ value: 'email', label: 'Email' }, { value: 'sms', label: 'SMS' }, { value: 'both', label: 'Email and SMS' }]" />
248
217
 
249
- <label class="block">
250
- <span class="block font-medium text-gray-900 text-sm dark:text-neutral-200">Source</span>
251
- <select x-model="source" required class="block mt-2 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-700 border border-gray-300 rounded-md dark:border-neutral-600">
252
- <option value="website">Website</option>
253
- <option value="social_media">Social media</option>
254
- <option value="in-store">In store</option>
255
- <option value="email">Email</option>
256
- <option value="app">App</option>
257
- <option value="referral">Referral</option>
258
- <option value="other">Other</option>
259
- </select>
260
- </label>
218
+ <Select v-model:value="source" label="Source" :required="true" placeholder="" :options="[{ value: 'website', label: 'Website' }, { value: 'social_media', label: 'Social media' }, { value: 'in-store', label: 'In store' }, { value: 'email', label: 'Email' }, { value: 'app', label: 'App' }, { value: 'referral', label: 'Referral' }, { value: 'other', label: 'Other' }]" />
261
219
 
262
- <label class="block">
263
- <span class="block font-medium text-gray-900 text-sm dark:text-neutral-200">Status</span>
264
- <select x-model="status" required class="block mt-2 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-700 border border-gray-300 rounded-md dark:border-neutral-600">
265
- <option value="waiting">Waiting</option>
266
- <option value="notified">Notified</option>
267
- <option value="purchased">Purchased</option>
268
- <option value="cancelled">Cancelled</option>
269
- </select>
270
- </label>
220
+ <Select v-model:value="status" label="Status" :required="true" placeholder="" :options="[{ value: 'waiting', label: 'Waiting' }, { value: 'notified', label: 'Notified' }, { value: 'purchased', label: 'Purchased' }, { value: 'cancelled', label: 'Cancelled' }]" />
271
221
 
272
- <label class="block sm:col-span-2">
273
- <span class="block font-medium text-gray-900 text-sm dark:text-neutral-200">Notes</span>
274
- <textarea x-model.trim="notes" maxlength="500" rows="3" class="block mt-2 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-700 border border-gray-300 rounded-md dark:border-neutral-600"></textarea>
275
- </label>
222
+ <div class="sm:col-span-2"><Textarea v-model:value="notes" label="Notes" :maxLength="500" :rows="3" /></div>
276
223
  </div>
277
224
 
278
225
  </form>
@@ -247,24 +247,9 @@ onMount(() => {
247
247
  <p class="mt-1 text-gray-500 text-sm dark:text-neutral-400">{{ matchingLabel() }}</p>
248
248
  </div>
249
249
  <div class="flex flex-wrap gap-2">
250
- <label class="sr-only" for="restaurant-waitlist-status">Status</label>
251
- <select id="restaurant-waitlist-status" x-model="status" class="px-3 py-2 text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700">
252
- <option value="all">All statuses</option>
253
- <option value="waiting">Waiting</option>
254
- <option value="seated">Seated</option>
255
- <option value="cancelled">Cancelled</option>
256
- <option value="no_show">No show</option>
257
- </select>
258
- <label class="sr-only" for="restaurant-waitlist-preference">Table preference</label>
259
- <select id="restaurant-waitlist-preference" x-model="preference" class="px-3 py-2 text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700">
260
- <option value="all">All tables</option>
261
- <option value="no_preference">No preference</option>
262
- <option value="indoor">Indoor</option>
263
- <option value="bar">Bar</option>
264
- <option value="booth">Booth</option>
265
- </select>
266
- <label class="sr-only" for="restaurant-waitlist-search">Search waitlist</label>
267
- <input id="restaurant-waitlist-search" x-model="search" type="search" placeholder="Search waitlist" class="px-3 py-2 w-56 text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700" />
250
+ <Select v-model:value="status" id="restaurant-waitlist-status" ariaLabel="Status" placeholder="" :options="[{ value: 'all', label: 'All statuses' }, { value: 'waiting', label: 'Waiting' }, { value: 'seated', label: 'Seated' }, { value: 'cancelled', label: 'Cancelled' }, { value: 'no_show', label: 'No show' }]" />
251
+ <Select v-model:value="preference" id="restaurant-waitlist-preference" ariaLabel="Table preference" placeholder="" :options="[{ value: 'all', label: 'All tables' }, { value: 'no_preference', label: 'No preference' }, { value: 'indoor', label: 'Indoor' }, { value: 'bar', label: 'Bar' }, { value: 'booth', label: 'Booth' }]" />
252
+ <SearchFilter v-model:searchValue="search" placeholder="Search waitlist" ariaLabel="Search waitlist" class="w-56" />
268
253
  </div>
269
254
  </div>
270
255
 
@@ -124,8 +124,8 @@ effect(() => {
124
124
  void loadCustomers('')
125
125
  })
126
126
 
127
- function hydrateCustomer(event: Event): void {
128
- const selectedId = (event.target as HTMLSelectElement).value
127
+ /** The customer just chosen, by the id the select reports. */
128
+ function hydrateCustomer(selectedId: string): void {
129
129
  const customer = customers().find(option => option.id === selectedId)
130
130
  if (!customer)
131
131
  return
@@ -178,77 +178,31 @@ function errorMessages(): string[] {
178
178
  </ul>
179
179
 
180
180
  <div class="grid gap-4 sm:grid-cols-2 mt-6">
181
- <label class="block sm:col-span-2">
182
- <span class="block font-medium text-gray-900 text-sm dark:text-neutral-200">Existing customer</span>
183
- <input x-model="customerQuery" @input="searchCustomersSoon()" type="search" name="customer_search" aria-label="Search customers by name, email or phone" placeholder="Search customers by name, email or phone" class="block mt-2 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-700 border border-gray-300 rounded-md dark:border-neutral-600" />
184
- </label>
181
+ <div class="sm:col-span-2"><Input v-model:value="customerQuery" label="Existing customer" type="search" name="customer_search" ariaLabel="Search customers by name, email or phone" placeholder="Search customers by name, email or phone" @input="searchCustomersSoon()" /></div>
185
182
  <div class="sm:col-span-2 -mt-2">
186
- <select x-model="customerId" aria-label="Existing customer" class="block px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-700 border border-gray-300 rounded-md dark:border-neutral-600" @change="hydrateCustomer($event)">
187
- <option value="">No linked customer</option>
188
- <option :for="option in customers()" :key="option.id" :value="option.id" :selected="option.id === String(customerId())">{{ option.label }}{{ option.detail ? ' · ' + option.detail : '' }}</option>
189
- </select>
183
+ <Select v-model:value="customerId" ariaLabel="Existing customer" placeholder="" :options="[{ value: '', label: 'No linked customer' }, ...customers().map(option => ({ value: option.id, label: option.label + (option.detail ? ' · ' + option.detail : '') }))]" @change="hydrateCustomer($event)" />
190
184
  <p :if="moreCustomersLabel()" class="mt-1 text-gray-500 text-xs dark:text-neutral-400" :text="moreCustomersLabel()"></p>
191
185
  </div>
192
186
 
193
- <label class="block">
194
- <span class="block font-medium text-gray-900 text-sm dark:text-neutral-200">Name</span>
195
- <input type="text" x-model.trim="name" required maxlength="255" autocomplete="name" class="block mt-2 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-700 border border-gray-300 rounded-md dark:border-neutral-600" />
196
- </label>
197
-
198
- <label class="block">
199
- <span class="block font-medium text-gray-900 text-sm dark:text-neutral-200">Email</span>
200
- <input type="email" x-model.trim="email" required maxlength="255" autocomplete="email" class="block mt-2 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-700 border border-gray-300 rounded-md dark:border-neutral-600" />
201
- </label>
202
-
203
- <label class="block">
204
- <span class="block font-medium text-gray-900 text-sm dark:text-neutral-200">Phone</span>
205
- <input type="tel" x-model.trim="phone" maxlength="100" autocomplete="tel" class="block mt-2 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-700 border border-gray-300 rounded-md dark:border-neutral-600" />
206
- </label>
207
-
208
- <label class="block">
209
- <span class="block font-medium text-gray-900 text-sm dark:text-neutral-200">Party size</span>
210
- <input type="number" x-model.number="partySize" required min="1" step="1" class="block mt-2 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-700 border border-gray-300 rounded-md dark:border-neutral-600" />
211
- </label>
212
-
213
- <label class="block">
214
- <span class="block font-medium text-gray-900 text-sm dark:text-neutral-200">Check in time</span>
215
- <input type="datetime-local" x-model="checkInTime" required class="block mt-2 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-700 border border-gray-300 rounded-md dark:border-neutral-600" />
216
- </label>
217
-
218
- <label class="block">
219
- <span class="block font-medium text-gray-900 text-sm dark:text-neutral-200">Quoted wait in minutes</span>
220
- <input type="number" x-model.number="quotedWaitTime" required min="0" step="1" class="block mt-2 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-700 border border-gray-300 rounded-md dark:border-neutral-600" />
221
- </label>
222
-
223
- <label class="block">
224
- <span class="block font-medium text-gray-900 text-sm dark:text-neutral-200">Table preference</span>
225
- <select x-model="tablePreference" required class="block mt-2 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-700 border border-gray-300 rounded-md dark:border-neutral-600">
226
- <option value="no_preference">No preference</option>
227
- <option value="indoor">Indoor</option>
228
- <option value="bar">Bar</option>
229
- <option value="booth">Booth</option>
230
- </select>
231
- </label>
232
-
233
- <label class="block">
234
- <span class="block font-medium text-gray-900 text-sm dark:text-neutral-200">Status</span>
235
- <select x-model="status" required class="block mt-2 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-700 border border-gray-300 rounded-md dark:border-neutral-600">
236
- <option value="waiting">Waiting</option>
237
- <option value="seated">Seated</option>
238
- <option value="cancelled">Cancelled</option>
239
- <option value="no_show">No show</option>
240
- </select>
241
- </label>
242
-
243
- <label class="block">
244
- <span class="block font-medium text-gray-900 text-sm dark:text-neutral-200">Actual wait in minutes</span>
245
- <input type="number" x-model.number="actualWaitTime" min="0" step="1" placeholder="Not recorded" class="block mt-2 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-700 border border-gray-300 rounded-md dark:border-neutral-600" />
246
- </label>
247
-
248
- <label class="block">
249
- <span class="block font-medium text-gray-900 text-sm dark:text-neutral-200">Queue position</span>
250
- <input type="number" x-model.number="queuePosition" min="1" step="1" placeholder="Not assigned" class="block mt-2 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-700 border border-gray-300 rounded-md dark:border-neutral-600" />
251
- </label>
187
+ <Input v-model:value="name" label="Name" :required="true" :maxLength="255" autocomplete="name" />
188
+
189
+ <Input type="email" label="Email" v-model:value="email" :required="true" :maxLength="255" autocomplete="email" />
190
+
191
+ <Input type="tel" label="Phone" v-model:value="phone" :maxLength="100" autocomplete="tel" />
192
+
193
+ <Input type="number" label="Party size" v-model:value="partySize" :required="true" min="1" step="1" />
194
+
195
+ <Input type="datetime-local" label="Check in time" v-model:value="checkInTime" :required="true" />
196
+
197
+ <Input type="number" label="Quoted wait in minutes" v-model:value="quotedWaitTime" :required="true" min="0" step="1" />
198
+
199
+ <Select v-model:value="tablePreference" label="Table preference" :required="true" placeholder="" :options="[{ value: 'no_preference', label: 'No preference' }, { value: 'indoor', label: 'Indoor' }, { value: 'bar', label: 'Bar' }, { value: 'booth', label: 'Booth' }]" />
200
+
201
+ <Select v-model:value="status" label="Status" :required="true" placeholder="" :options="[{ value: 'waiting', label: 'Waiting' }, { value: 'seated', label: 'Seated' }, { value: 'cancelled', label: 'Cancelled' }, { value: 'no_show', label: 'No show' }]" />
202
+
203
+ <Input type="number" label="Actual wait in minutes" v-model:value="actualWaitTime" min="0" step="1" placeholder="Not recorded" />
204
+
205
+ <Input type="number" label="Queue position" v-model:value="queuePosition" min="1" step="1" placeholder="Not assigned" />
252
206
  </div>
253
207
 
254
208
  </form>
@@ -61,22 +61,10 @@ function submit(): void {
61
61
  @close="close"
62
62
  >
63
63
  <form id="author-editor-form" class="grid gap-4" @submit.prevent="submit">
64
- <label>
65
- <span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Name</span>
66
- <input x-model="name" name="name" required minlength="5" maxlength="255" autocomplete="name" 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>
69
- <span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Email</span>
70
- <input x-model="email" name="email" type="email" required autocomplete="email" 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" />
71
- </label>
72
- <label>
73
- <span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Bio</span>
74
- <textarea x-model="bio" name="bio" maxlength="500" 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>
75
- </label>
76
- <label>
77
- <span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Avatar URL</span>
78
- <input x-model="avatar" name="avatar" type="url" inputmode="url" placeholder="https://example.com/avatar.jpg" 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" />
79
- </label>
64
+ <Input v-model:value="name" name="name" label="Name" :required="true" :minLength="5" :maxLength="255" autocomplete="name" />
65
+ <Input v-model:value="email" name="email" label="Email" type="email" :required="true" autocomplete="email" />
66
+ <Textarea v-model:value="bio" name="bio" label="Bio" :rows="3" :maxLength="500" />
67
+ <Input v-model:value="avatar" name="avatar" label="Avatar URL" type="url" inputmode="url" placeholder="https://example.com/avatar.jpg" />
80
68
  </form>
81
69
 
82
70
  <div :if="error()" role="alert" class="mt-4 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">
@@ -55,27 +55,10 @@ defineClientPayload({ blogUrl })
55
55
  <section class="overflow-hidden max-w-full min-w-0 bg-white dark:bg-neutral-900 border border-neutral-200 rounded-md dark:border-neutral-800">
56
56
  <div class="flex flex-col gap-3 md:flex-row md:items-center md:justify-between p-4 border-b border-neutral-200 dark:border-neutral-800">
57
57
  <div class="relative flex-1 max-w-md">
58
- <span class="absolute left-3 top-1/2 h-4 w-4 text-neutral-500 pointer-events-none -translate-y-1/2 i-hugeicons-search-01"></span>
59
- <label for="blog-search" class="sr-only">Search posts</label>
60
- <input
61
- id="blog-search"
62
- type="search"
63
- x-model="searchQuery"
64
- placeholder="Search posts"
65
- class="placeholder-neutral-500 pl-9 pr-3 py-2 w-full text-neutral-900 text-sm dark:text-neutral-100 bg-white dark:bg-neutral-950 border border-neutral-300 outline-none rounded-md dark:border-neutral-700 focus:border-blue-500 focus:ring-2 focus:ring-blue-500/30"
66
- />
58
+ <SearchFilter v-model:searchValue="searchQuery" placeholder="Search posts" ariaLabel="Search posts" class="w-full" />
67
59
  </div>
68
60
  <div>
69
- <label for="blog-status" class="sr-only">Filter by status</label>
70
- <select
71
- id="blog-status"
72
- x-model="statusFilter"
73
- class="px-3 py-2 text-neutral-900 text-sm dark:text-neutral-100 bg-white dark:bg-neutral-950 border border-neutral-300 rounded-md dark:border-neutral-700"
74
- >
75
- <option value="all">All statuses</option>
76
- <option value="published">Published</option>
77
- <option value="draft">Draft</option>
78
- </select>
61
+ <Select v-model:value="statusFilter" id="blog-status" ariaLabel="Filter by status" placeholder="" :options="[{ value: 'all', label: 'All statuses' }, { value: 'published', label: 'Published' }, { value: 'draft', label: 'Draft' }]" />
79
62
  </div>
80
63
  </div>
81
64
 
@@ -34,9 +34,11 @@ const bodyLoading = useReactiveProp('bodyLoading', false)
34
34
  const bodyLoadFailed = useReactiveProp('bodyLoadFailed', false)
35
35
  const busy = useReactiveProp('busy', false)
36
36
  const error = useReactiveProp('error', '')
37
- const title = state('')
37
+ // Not `title` and `description`: a field bound inside the Modal is first read
38
+ // as the Modal's own prop of that name (stacksjs/stacks#3310).
39
+ const postTitle = state('')
38
40
  const slug = state('')
39
- const description = state('')
41
+ const descriptionText = state('')
40
42
  const date = state('')
41
43
  const author = state('')
42
44
  const poster = state('')
@@ -55,7 +57,7 @@ function slugify(input: string): string {
55
57
  .slice(0, 80)
56
58
  }
57
59
 
58
- const suggestedSlug = derived(() => slugify(title()))
60
+ const suggestedSlug = derived(() => slugify(postTitle()))
59
61
  const wordCount = derived(() => body().split(/\s+/).filter(Boolean).length)
60
62
  const readingTime = derived(() => Math.max(1, Math.round(wordCount() / 200)))
61
63
  const dialogTitle = derived(() => editing() ? 'Edit post' : 'New post')
@@ -66,9 +68,9 @@ effect(() => {
66
68
  if (isOpen && !wasOpen) {
67
69
  const record = editing()
68
70
  activeSlug = record?.slug || ''
69
- title.set(record?.title || '')
71
+ postTitle.set(record?.title || '')
70
72
  slug.set(record?.slug || '')
71
- description.set(record?.description || '')
73
+ descriptionText.set(record?.description || '')
72
74
  date.set(record?.date || new Date().toISOString().slice(0, 10))
73
75
  author.set(record?.author || '')
74
76
  poster.set(record?.poster || '')
@@ -85,7 +87,7 @@ effect(() => {
85
87
  })
86
88
 
87
89
  function valid(): boolean {
88
- return title().trim().length > 0 && !bodyLoading() && !bodyLoadFailed()
90
+ return postTitle().trim().length > 0 && !bodyLoading() && !bodyLoadFailed()
89
91
  }
90
92
 
91
93
  function close(): void {
@@ -99,8 +101,8 @@ function submit(): void {
99
101
 
100
102
  const postDraft: BlogPostDraft = {
101
103
  slug: slug().trim() || suggestedSlug(),
102
- title: title().trim(),
103
- description: description().trim(),
104
+ title: postTitle().trim(),
105
+ description: descriptionText().trim(),
104
106
  date: date(),
105
107
  author: author().trim(),
106
108
  authorBio: '',
@@ -131,49 +133,27 @@ function submit(): void {
131
133
  </div>
132
134
 
133
135
  <div class="grid gap-4 sm:grid-cols-2">
134
- <label class="flex flex-col gap-2 sm:col-span-2">
135
- <span class="font-medium text-sm">Title</span>
136
- <input x-model="title" name="title" type="text" required autofocus class="px-3 py-2 text-neutral-900 text-sm dark:text-neutral-100 bg-white dark:bg-neutral-950 border border-neutral-300 outline-none rounded-md dark:border-neutral-700 focus:border-blue-500 focus:ring-2 focus:ring-blue-500/30" />
137
- </label>
138
-
139
- <label class="flex flex-col gap-2 sm:col-span-2">
140
- <span class="font-medium text-sm">Slug</span>
141
- <input x-model="slug" name="slug" type="text" :placeholder="suggestedSlug()" class="placeholder-neutral-500 px-3 py-2 font-mono text-neutral-900 text-sm dark:text-neutral-100 bg-white dark:bg-neutral-950 border border-neutral-300 outline-none rounded-md dark:border-neutral-700 focus:border-blue-500 focus:ring-2 focus:ring-blue-500/30" />
142
- <span class="text-neutral-500 text-xs dark:text-neutral-400">The file name and public URL: /blog/{{ slug() || suggestedSlug() || 'your-post' }}</span>
143
- </label>
144
-
145
- <label class="flex flex-col gap-2 sm:col-span-2">
146
- <span class="font-medium text-sm">Description</span>
147
- <input x-model="description" name="description" type="text" class="px-3 py-2 text-neutral-900 text-sm dark:text-neutral-100 bg-white dark:bg-neutral-950 border border-neutral-300 outline-none rounded-md dark:border-neutral-700 focus:border-blue-500 focus:ring-2 focus:ring-blue-500/30" />
148
- <span class="text-neutral-500 text-xs dark:text-neutral-400">Used as the excerpt, meta description, and RSS summary.</span>
149
- </label>
150
-
151
- <label class="flex flex-col gap-2">
152
- <span class="font-medium text-sm">Date</span>
153
- <input x-model="date" name="date" type="date" class="px-3 py-2 text-neutral-900 text-sm dark:text-neutral-100 bg-white dark:bg-neutral-950 border border-neutral-300 outline-none rounded-md dark:border-neutral-700 focus:border-blue-500 focus:ring-2 focus:ring-blue-500/30" />
154
- </label>
155
-
156
- <label class="flex flex-col gap-2">
157
- <span class="font-medium text-sm">Author</span>
158
- <input x-model="author" name="author" type="text" class="px-3 py-2 text-neutral-900 text-sm dark:text-neutral-100 bg-white dark:bg-neutral-950 border border-neutral-300 outline-none rounded-md dark:border-neutral-700 focus:border-blue-500 focus:ring-2 focus:ring-blue-500/30" />
159
- </label>
160
-
161
- <label class="flex flex-col gap-2 sm:col-span-2">
162
- <span class="font-medium text-sm">Poster image</span>
163
- <input x-model="poster" name="poster" type="text" placeholder="/assets/images/example.svg" class="placeholder-neutral-500 px-3 py-2 text-neutral-900 text-sm dark:text-neutral-100 bg-white dark:bg-neutral-950 border border-neutral-300 outline-none rounded-md dark:border-neutral-700 focus:border-blue-500 focus:ring-2 focus:ring-blue-500/30" />
164
- </label>
165
-
166
- <label class="flex flex-col gap-2 sm:col-span-2">
167
- <span class="flex gap-3 items-center justify-between">
168
- <span class="font-medium text-sm">Content</span>
169
- <span :if="bodyLoading()" role="status" class="inline-flex gap-1.5 items-center text-neutral-500 text-xs dark:text-neutral-400">
170
- <span class="h-3.5 w-3.5 animate-spin i-hugeicons-loading-03"></span>
171
- Loading content
172
- </span>
173
- </span>
174
- <textarea x-model="body" name="body" rows="14" :disabled="bodyLoading() || bodyLoadFailed()" class="px-3 py-2 font-mono text-neutral-900 text-sm dark:text-neutral-100 bg-white dark:bg-neutral-950 border border-neutral-300 outline-none rounded-md dark:border-neutral-700 focus:border-blue-500 focus:ring-2 focus:ring-blue-500/30 disabled:opacity-60 resize-y"></textarea>
175
- <span class="text-neutral-500 text-xs dark:text-neutral-400">Markdown. {{ wordCount() }} words, about {{ readingTime() }} min read.</span>
176
- </label>
136
+ <div class="sm:col-span-2">
137
+ <Input v-model:value="postTitle" name="title" label="Title" :required="true" :autofocus="true" />
138
+ </div>
139
+ <div class="sm:col-span-2">
140
+ <Input v-model:value="slug" name="slug" label="Slug" :placeholder="suggestedSlug()" :spellcheck="false" :monospace="true" :hint="'The file name and public URL: /blog/' + (slug() || suggestedSlug() || 'your-post')" />
141
+ </div>
142
+ <div class="sm:col-span-2">
143
+ <Input v-model:value="descriptionText" name="description" label="Description" hint="Used as the excerpt, meta description, and RSS summary." />
144
+ </div>
145
+ <Input v-model:value="date" name="date" label="Date" type="date" />
146
+ <Input v-model:value="author" name="author" label="Author" />
147
+ <div class="sm:col-span-2">
148
+ <Input v-model:value="poster" name="poster" label="Poster image" placeholder="/assets/images/example.svg" />
149
+ </div>
150
+ <div class="sm:col-span-2">
151
+ <Textarea v-model:value="body" name="body" label="Content" :rows="14" :monospace="true" :disabled="bodyLoading() || bodyLoadFailed()" :hint="'Markdown. ' + wordCount() + ' words, about ' + readingTime() + ' min read.'" />
152
+ <p :if="bodyLoading()" role="status" class="inline-flex gap-1.5 items-center mt-1.5 text-neutral-500 text-xs dark:text-neutral-400">
153
+ <span aria-hidden="true" class="h-3.5 w-3.5 animate-spin i-hugeicons-loading-03"></span>
154
+ Loading content
155
+ </p>
156
+ </div>
177
157
  </div>
178
158
 
179
159
  <div class="flex flex-col gap-3 sm:flex-row sm:gap-6 pt-2 border-neutral-200 border-t dark:border-neutral-800">
@@ -207,7 +207,7 @@ onMount(() => {
207
207
  </section>
208
208
 
209
209
  <section class="overflow-hidden bg-white dark:bg-neutral-800 border border-gray-200 rounded-lg dark:border-neutral-700">
210
- <div class="flex flex-col gap-3 sm:flex-row p-4 border-b border-gray-200 dark:border-neutral-700"><label class="flex-1"><span class="sr-only">Search comments</span><input x-model="search" type="search" placeholder="Search comments" class="px-3 py-2 max-w-xl 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><label><span class="sr-only">Filter comment 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-900 border border-gray-300 rounded-md dark:border-neutral-700"><option value="all">All statuses</option><option value="pending">Pending</option><option value="approved">Approved</option><option value="spam">Spam</option><option value="trash">Trash</option></select></label></div>
210
+ <div class="flex flex-col gap-3 sm:flex-row p-4 border-b border-gray-200 dark:border-neutral-700"><div class="flex-1"><SearchFilter v-model:searchValue="search" placeholder="Search comments" ariaLabel="Search comments" /></div><Select v-model:value="statusFilter" ariaLabel="Filter comment status" placeholder="" :options="[{ value: 'all', label: 'All statuses' }, { value: 'pending', label: 'Pending' }, { value: 'approved', label: 'Approved' }, { value: 'spam', label: 'Spam' }, { value: 'trash', label: 'Trash' }]" /></div>
211
211
  <div class="divide-gray-200 divide-y dark:divide-neutral-700">
212
212
  <div :if="loading()" class="px-4 py-14 text-center text-gray-500 text-sm dark:text-neutral-400"><span class="inline-block mr-2 h-4 w-4 animate-spin i-hugeicons-loading-03"></span>Loading comments</div>
213
213
  <div :else-if="visibleComments().length === 0" class="px-4 py-14 text-center"><span class="inline-block h-6 w-6 text-gray-400 i-hugeicons-comment-01"></span><p class="mt-2 font-medium text-gray-900 text-sm dark:text-white">No comments found</p><p class="mt-1 text-gray-500 text-sm dark:text-neutral-400">Adjust the search or status filter.</p></div>
@@ -245,17 +245,7 @@ onDestroy(() => {
245
245
  <p class="mt-1 text-gray-500 text-sm dark:text-neutral-400">What was written, published and read in the selected period.</p>
246
246
  </div>
247
247
  <div class="flex gap-2">
248
- <label>
249
- <span class="sr-only">Content reporting period</span>
250
- <select
251
- x-model="selectedRange"
252
- aria-label="Content reporting period"
253
- class="block pl-3 pr-10 py-2 text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700"
254
- @change="changeRange"
255
- >
256
- <option :for="range in rangeOptions" :value="range.value">{{ range.label }}</option>
257
- </select>
258
- </label>
248
+ <Select v-model:value="selectedRange" ariaLabel="Content reporting period" placeholder="" :options="rangeOptions" @change="changeRange" />
259
249
  <Button variant="secondary" :loading="loading()" @click="loadOverview()">
260
250
  <span :if="!loading()" class="h-4 w-4 i-hugeicons-refresh"></span>
261
251
  Refresh
@@ -28,10 +28,7 @@ function submit(): void {
28
28
 
29
29
  <Modal :isOpen="open()" title="Create folder" :description="'Add a folder inside ' + location() + '.'" size="sm" :closable="!busy()" @close="close">
30
30
  <form id="create-folder-form" @submit.prevent="submit">
31
- <label class="block">
32
- <span class="font-medium text-sm text-stone-700 dark:text-neutral-200">Folder name</span>
33
- <input x-model.trim="folderName" name="name" required maxlength="255" autocomplete="off" class="mt-1 px-3 py-2 w-full text-sm text-stone-900 dark:text-white bg-white dark:bg-neutral-900 border border-stone-300 rounded-lg dark:border-neutral-700" />
34
- </label>
31
+ <Input v-model:value="folderName" name="name" label="Folder name" :required="true" :maxLength="255" autocomplete="off" />
35
32
  </form>
36
33
 
37
34
  <div :if="error()" role="alert" class="mt-4 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>
@@ -458,9 +458,9 @@ onMount(() => { void loadFiles() })
458
458
  <div class="ml-3 min-w-0"><p class="font-semibold text-stone-900 truncate dark:text-white">{{ currentFolderLabel }}</p><p class="mt-0.5 text-stone-500 text-xs dark:text-neutral-400">{{ selectedDisk }} disk</p></div>
459
459
  </div>
460
460
  <div class="flex flex-wrap gap-2 items-center">
461
- <label class="relative"><span class="sr-only">Search current folder</span><span class="absolute left-3 top-2.5 h-4 w-4 text-stone-400 i-hugeicons-search-01"></span><input x-model="searchQuery" type="search" placeholder="Search this folder" class="pl-9 pr-3 py-2 w-56 text-sm text-stone-900 dark:text-white bg-white dark:bg-neutral-800 border border-stone-200 rounded-lg dark:border-neutral-700" /></label>
461
+ <SearchFilter v-model:searchValue="searchQuery" placeholder="Search this folder" ariaLabel="Search current folder" />
462
462
  <div class="flex gap-0.5 p-0.5 bg-black/[0.05] dark:bg-white/[0.06] rounded-lg"><button type="button" aria-label="Grid view" :class="gridViewClass()" @click="viewMode.set('grid')"><span class="h-5 w-5 i-hugeicons-grid-view"></span></button><button type="button" aria-label="List view" :class="listViewClass()" @click="viewMode.set('list')"><span class="h-5 w-5 i-hugeicons-right-to-left-list-number"></span></button></div>
463
- <select x-model="sortBy" aria-label="Sort files" class="px-2.5 py-2 text-sm text-stone-700 dark:text-neutral-200 bg-white dark:bg-neutral-800 border border-stone-200 rounded-lg dark:border-neutral-700"><option value="name">Name</option><option value="lastModified">Date</option><option value="size">Size</option></select>
463
+ <Select v-model:value="sortBy" ariaLabel="Sort files" placeholder="" :options="[{ value: 'name', label: 'Name' }, { value: 'lastModified', label: 'Date' }, { value: 'size', label: 'Size' }]" />
464
464
  <Button variant="ghost" iconOnly ariaLabel="Reverse sort order" @click="toggleSortOrder()"><span :class="sortOrderIconClass()"></span></Button>
465
465
  <Button :loading="loading()" variant="secondary" @click="loadFiles()"><span :if="!loading()" aria-hidden="true" class="h-4 w-4 i-hugeicons-refresh"></span>Refresh</Button>
466
466
  <Button @click="openCreateFolder()"><span aria-hidden="true" class="h-4 w-4 i-hugeicons-folder-add"></span>New folder</Button>
@@ -16,7 +16,9 @@ const open = useReactiveProp('open', false)
16
16
  const page = useReactiveProp('page', null as PageRecord | null)
17
17
  const busy = useReactiveProp('busy', false)
18
18
  const error = useReactiveProp('error', '')
19
- const title = state('')
19
+ // Not `title`: a field bound inside the Modal is first read as the Modal's own
20
+ // `title` prop (stacksjs/stacks#3310).
21
+ const pageTitle = state('')
20
22
  const template = state('default')
21
23
  const published = state(false)
22
24
  const emit = defineEmits(['close', 'submit'])
@@ -26,7 +28,7 @@ effect(() => {
26
28
  const isOpen = open()
27
29
  if (isOpen && !wasOpen) {
28
30
  const record = page()
29
- title.set(record?.title || '')
31
+ pageTitle.set(record?.title || '')
30
32
  template.set(record?.template || 'default')
31
33
  published.set(Boolean(record?.publishedAt))
32
34
  }
@@ -40,7 +42,7 @@ function close(): void {
40
42
 
41
43
  function submit(): void {
42
44
  const draft: PageDraft = {
43
- title: title().trim(),
45
+ title: pageTitle().trim(),
44
46
  template: template(),
45
47
  published: published(),
46
48
  }
@@ -56,19 +58,8 @@ function submit(): void {
56
58
  @close="close"
57
59
  >
58
60
  <form id="page-editor-form" class="grid gap-4" @submit.prevent="submit">
59
- <label>
60
- <span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Title</span>
61
- <input x-model="title" name="title" required minlength="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" />
62
- </label>
63
- <label>
64
- <span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Template</span>
65
- <select x-model="template" name="template" 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">
66
- <option value="default">Default</option>
67
- <option value="landing">Landing</option>
68
- <option value="blog">Blog</option>
69
- <option value="contact">Contact</option>
70
- </select>
71
- </label>
61
+ <Input v-model:value="pageTitle" name="title" label="Title" :required="true" :minLength="3" :maxLength="255" />
62
+ <Select v-model:value="template" name="template" label="Template" placeholder="" :options="[{ value: 'default', label: 'Default' }, { value: 'landing', label: 'Landing' }, { value: 'blog', label: 'Blog' }, { value: 'contact', label: 'Contact' }]" />
72
63
  <div class="p-3 bg-gray-50 dark:bg-neutral-900/50 border border-gray-200 rounded-lg dark:border-neutral-700">
73
64
  <Toggle v-model:checked="published" name="published" label="Published" description="Published pages receive a timestamp. Clearing this returns the page to draft." labelPosition="left" />
74
65
  </div>
@@ -81,7 +72,7 @@ function submit(): void {
81
72
  <template #footer>
82
73
  <div class="flex gap-2 justify-end w-full">
83
74
  <Button :disabled="busy()" variant="secondary" @click="close">Cancel</Button>
84
- <Button type="submit" form="page-editor-form" :disabled="title().trim().length < 3" :loading="busy()">
75
+ <Button type="submit" form="page-editor-form" :disabled="pageTitle().trim().length < 3" :loading="busy()">
85
76
  {{ page() ? 'Save changes' : 'Create page' }}
86
77
  </Button>
87
78
  </div>