@open-mercato/core 0.5.1-develop.2949.009dcdd2d5 → 0.5.1-develop.2954.610bab2d08

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 (229) hide show
  1. package/dist/helpers/integration/salesUi.js +25 -23
  2. package/dist/helpers/integration/salesUi.js.map +2 -2
  3. package/dist/modules/api_docs/frontend/docs/api/Explorer.js +24 -24
  4. package/dist/modules/api_docs/frontend/docs/api/Explorer.js.map +2 -2
  5. package/dist/modules/attachments/components/AttachmentPartitionSettings.js +15 -7
  6. package/dist/modules/attachments/components/AttachmentPartitionSettings.js.map +2 -2
  7. package/dist/modules/attachments/fields/attachment.js +4 -6
  8. package/dist/modules/attachments/fields/attachment.js.map +2 -2
  9. package/dist/modules/auth/api/users/route.js +63 -23
  10. package/dist/modules/auth/api/users/route.js.map +2 -2
  11. package/dist/modules/auth/backend/users/create/page.js +26 -26
  12. package/dist/modules/auth/backend/users/create/page.js.map +2 -2
  13. package/dist/modules/business_rules/components/ActionRow.js +36 -25
  14. package/dist/modules/business_rules/components/ActionRow.js.map +2 -2
  15. package/dist/modules/business_rules/components/ConditionGroup.js +14 -5
  16. package/dist/modules/business_rules/components/ConditionGroup.js.map +2 -2
  17. package/dist/modules/business_rules/components/ConditionRow.js +19 -10
  18. package/dist/modules/business_rules/components/ConditionRow.js.map +2 -2
  19. package/dist/modules/business_rules/components/RuleSetMembers.js +16 -10
  20. package/dist/modules/business_rules/components/RuleSetMembers.js.map +2 -2
  21. package/dist/modules/catalog/backend/catalog/products/[id]/page.js +30 -34
  22. package/dist/modules/catalog/backend/catalog/products/[id]/page.js.map +2 -2
  23. package/dist/modules/catalog/backend/catalog/products/create/page.js +220 -223
  24. package/dist/modules/catalog/backend/catalog/products/create/page.js.map +2 -2
  25. package/dist/modules/catalog/components/PriceKindSettings.js +20 -19
  26. package/dist/modules/catalog/components/PriceKindSettings.js.map +2 -2
  27. package/dist/modules/catalog/components/products/ProductUomSection.js +42 -37
  28. package/dist/modules/catalog/components/products/ProductUomSection.js.map +2 -2
  29. package/dist/modules/catalog/components/products/VariantBuilder.js +22 -18
  30. package/dist/modules/catalog/components/products/VariantBuilder.js.map +2 -2
  31. package/dist/modules/customer_accounts/backend/customer_accounts/users/[id]/page.js +18 -26
  32. package/dist/modules/customer_accounts/backend/customer_accounts/users/[id]/page.js.map +2 -2
  33. package/dist/modules/customer_accounts/backend/customer_accounts/users/page.js +4 -6
  34. package/dist/modules/customer_accounts/backend/customer_accounts/users/page.js.map +2 -2
  35. package/dist/modules/customer_accounts/widgets/injection/account-status/widget.client.js +5 -4
  36. package/dist/modules/customer_accounts/widgets/injection/account-status/widget.client.js.map +2 -2
  37. package/dist/modules/customers/backend/config/customers/pipeline-stages/page.js +19 -7
  38. package/dist/modules/customers/backend/config/customers/pipeline-stages/page.js.map +2 -2
  39. package/dist/modules/customers/backend/customers/deals/pipeline/page.js +24 -21
  40. package/dist/modules/customers/backend/customers/deals/pipeline/page.js.map +2 -2
  41. package/dist/modules/customers/components/AddressEditor.js +24 -7
  42. package/dist/modules/customers/components/AddressEditor.js.map +2 -2
  43. package/dist/modules/customers/components/AddressFormatSettings.js +35 -25
  44. package/dist/modules/customers/components/AddressFormatSettings.js.map +2 -2
  45. package/dist/modules/customers/components/detail/ActivityForm.js +20 -12
  46. package/dist/modules/customers/components/detail/ActivityForm.js.map +2 -2
  47. package/dist/modules/customers/components/detail/AnnualRevenueField.js +2 -2
  48. package/dist/modules/customers/components/detail/AnnualRevenueField.js.map +2 -2
  49. package/dist/modules/customers/components/detail/DealForm.js +19 -14
  50. package/dist/modules/customers/components/detail/DealForm.js.map +2 -2
  51. package/dist/modules/customers/components/formConfig.js +16 -12
  52. package/dist/modules/customers/components/formConfig.js.map +2 -2
  53. package/dist/modules/customers/widgets/dashboard/customer-todos/widget.client.js +3 -2
  54. package/dist/modules/customers/widgets/dashboard/customer-todos/widget.client.js.map +2 -2
  55. package/dist/modules/customers/widgets/dashboard/new-customers/widget.client.js +18 -10
  56. package/dist/modules/customers/widgets/dashboard/new-customers/widget.client.js.map +2 -2
  57. package/dist/modules/customers/widgets/dashboard/new-deals/widget.client.js +3 -2
  58. package/dist/modules/customers/widgets/dashboard/new-deals/widget.client.js.map +2 -2
  59. package/dist/modules/customers/widgets/dashboard/next-interactions/widget.client.js +3 -2
  60. package/dist/modules/customers/widgets/dashboard/next-interactions/widget.client.js.map +2 -2
  61. package/dist/modules/dashboards/components/WidgetVisibilityEditor.js +27 -28
  62. package/dist/modules/dashboards/components/WidgetVisibilityEditor.js.map +2 -2
  63. package/dist/modules/dashboards/widgets/dashboard/orders-by-status/widget.client.js +14 -6
  64. package/dist/modules/dashboards/widgets/dashboard/orders-by-status/widget.client.js.map +2 -2
  65. package/dist/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.js +14 -6
  66. package/dist/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.js.map +2 -2
  67. package/dist/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.js +3 -2
  68. package/dist/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.js.map +2 -2
  69. package/dist/modules/dashboards/widgets/dashboard/top-customers/widget.client.js +3 -2
  70. package/dist/modules/dashboards/widgets/dashboard/top-customers/widget.client.js.map +2 -2
  71. package/dist/modules/dashboards/widgets/dashboard/top-products/widget.client.js +17 -8
  72. package/dist/modules/dashboards/widgets/dashboard/top-products/widget.client.js.map +2 -2
  73. package/dist/modules/data_sync/backend/data-sync/page.js +40 -23
  74. package/dist/modules/data_sync/backend/data-sync/page.js.map +2 -2
  75. package/dist/modules/data_sync/components/IntegrationScheduleTab.js +15 -6
  76. package/dist/modules/data_sync/components/IntegrationScheduleTab.js.map +2 -2
  77. package/dist/modules/dictionaries/components/AppearanceSelector.js +4 -4
  78. package/dist/modules/dictionaries/components/AppearanceSelector.js.map +2 -2
  79. package/dist/modules/dictionaries/components/DictionaryEntriesEditor.js +4 -5
  80. package/dist/modules/dictionaries/components/DictionaryEntriesEditor.js.map +2 -2
  81. package/dist/modules/dictionaries/components/DictionaryEntrySelect.js +22 -14
  82. package/dist/modules/dictionaries/components/DictionaryEntrySelect.js.map +2 -2
  83. package/dist/modules/dictionaries/fields/dictionary.js +18 -13
  84. package/dist/modules/dictionaries/fields/dictionary.js.map +2 -2
  85. package/dist/modules/entities/components/EncryptionManager.js +23 -19
  86. package/dist/modules/entities/components/EncryptionManager.js.map +2 -2
  87. package/dist/modules/feature_toggles/components/formConfig.js +17 -9
  88. package/dist/modules/feature_toggles/components/formConfig.js.map +2 -2
  89. package/dist/modules/feature_toggles/components/overrideFormConfig.js +17 -9
  90. package/dist/modules/feature_toggles/components/overrideFormConfig.js.map +2 -2
  91. package/dist/modules/inbox_ops/backend/inbox-ops/settings/page.js +15 -8
  92. package/dist/modules/inbox_ops/backend/inbox-ops/settings/page.js.map +2 -2
  93. package/dist/modules/inbox_ops/components/proposals/EditActionDialog.js +37 -22
  94. package/dist/modules/inbox_ops/components/proposals/EditActionDialog.js.map +2 -2
  95. package/dist/modules/integrations/backend/integrations/[id]/page.js +22 -17
  96. package/dist/modules/integrations/backend/integrations/[id]/page.js.map +2 -2
  97. package/dist/modules/integrations/backend/integrations/bundle/[id]/page.js +12 -6
  98. package/dist/modules/integrations/backend/integrations/bundle/[id]/page.js.map +2 -2
  99. package/dist/modules/planner/components/AvailabilityRulesEditor.js +19 -12
  100. package/dist/modules/planner/components/AvailabilityRulesEditor.js.map +2 -2
  101. package/dist/modules/resources/components/ResourceCrudForm.js +15 -10
  102. package/dist/modules/resources/components/ResourceCrudForm.js.map +3 -3
  103. package/dist/modules/sales/backend/sales/documents/[id]/page.js +15 -18
  104. package/dist/modules/sales/backend/sales/documents/[id]/page.js.map +2 -2
  105. package/dist/modules/sales/components/ProviderFieldInput.js +23 -20
  106. package/dist/modules/sales/components/ProviderFieldInput.js.map +2 -2
  107. package/dist/modules/sales/components/ShippingMethodsSettings.js +25 -17
  108. package/dist/modules/sales/components/ShippingMethodsSettings.js.map +3 -3
  109. package/dist/modules/sales/components/channels/ChannelOfferForm.js +35 -42
  110. package/dist/modules/sales/components/channels/ChannelOfferForm.js.map +2 -2
  111. package/dist/modules/sales/components/documents/AddressesSection.js +87 -90
  112. package/dist/modules/sales/components/documents/AddressesSection.js.map +2 -2
  113. package/dist/modules/sales/components/documents/AdjustmentDialog.js +17 -6
  114. package/dist/modules/sales/components/documents/AdjustmentDialog.js.map +3 -3
  115. package/dist/modules/sales/components/documents/LineItemDialog.js +42 -25
  116. package/dist/modules/sales/components/documents/LineItemDialog.js.map +2 -2
  117. package/dist/modules/sales/components/documents/SalesDocumentForm.js +96 -87
  118. package/dist/modules/sales/components/documents/SalesDocumentForm.js.map +2 -2
  119. package/dist/modules/sales/widgets/dashboard/new-orders/widget.client.js +20 -11
  120. package/dist/modules/sales/widgets/dashboard/new-orders/widget.client.js.map +2 -2
  121. package/dist/modules/sales/widgets/dashboard/new-quotes/widget.client.js +20 -11
  122. package/dist/modules/sales/widgets/dashboard/new-quotes/widget.client.js.map +2 -2
  123. package/dist/modules/shipping_carriers/lib/shipment-wizard/components/ConfigureStep.js +36 -22
  124. package/dist/modules/shipping_carriers/lib/shipment-wizard/components/ConfigureStep.js.map +2 -2
  125. package/dist/modules/staff/components/TeamMemberForm.js +14 -9
  126. package/dist/modules/staff/components/TeamMemberForm.js.map +3 -3
  127. package/dist/modules/workflows/backend/tasks/[id]/page.js +42 -21
  128. package/dist/modules/workflows/backend/tasks/[id]/page.js.map +2 -2
  129. package/dist/modules/workflows/components/ActivitiesEditor.js +14 -6
  130. package/dist/modules/workflows/components/ActivitiesEditor.js.map +3 -3
  131. package/dist/modules/workflows/components/DefinitionTriggersEditor.js +25 -17
  132. package/dist/modules/workflows/components/DefinitionTriggersEditor.js.map +3 -3
  133. package/dist/modules/workflows/components/EdgeEditDialog.js +48 -45
  134. package/dist/modules/workflows/components/EdgeEditDialog.js.map +2 -2
  135. package/dist/modules/workflows/components/NodeEditDialog.js +90 -90
  136. package/dist/modules/workflows/components/NodeEditDialog.js.map +2 -2
  137. package/dist/modules/workflows/components/StepsEditor.js +14 -6
  138. package/dist/modules/workflows/components/StepsEditor.js.map +3 -3
  139. package/dist/modules/workflows/components/TransitionsEditor.js +31 -26
  140. package/dist/modules/workflows/components/TransitionsEditor.js.map +3 -3
  141. package/dist/modules/workflows/components/fields/ActivityArrayEditor.js +19 -11
  142. package/dist/modules/workflows/components/fields/ActivityArrayEditor.js.map +3 -3
  143. package/dist/modules/workflows/components/fields/BusinessRuleConditionsEditor.js +12 -14
  144. package/dist/modules/workflows/components/fields/BusinessRuleConditionsEditor.js.map +2 -2
  145. package/dist/modules/workflows/components/fields/FormFieldArrayEditor.js +24 -16
  146. package/dist/modules/workflows/components/fields/FormFieldArrayEditor.js.map +3 -3
  147. package/dist/modules/workflows/components/fields/StartPreConditionsEditor.js +12 -13
  148. package/dist/modules/workflows/components/fields/StartPreConditionsEditor.js.map +2 -2
  149. package/dist/modules/workflows/components/mobile/MobileTaskForm.js +12 -8
  150. package/dist/modules/workflows/components/mobile/MobileTaskForm.js.map +2 -2
  151. package/dist/modules/workflows/frontend/checkout-demo/page.js +43 -46
  152. package/dist/modules/workflows/frontend/checkout-demo/page.js.map +2 -2
  153. package/package.json +3 -3
  154. package/src/helpers/integration/salesUi.ts +40 -30
  155. package/src/modules/api_docs/frontend/docs/api/Explorer.tsx +25 -19
  156. package/src/modules/attachments/components/AttachmentPartitionSettings.tsx +21 -11
  157. package/src/modules/attachments/fields/attachment.tsx +4 -6
  158. package/src/modules/auth/api/users/route.ts +75 -25
  159. package/src/modules/auth/backend/users/create/page.tsx +16 -20
  160. package/src/modules/business_rules/components/ActionRow.tsx +51 -32
  161. package/src/modules/business_rules/components/ConditionGroup.tsx +20 -9
  162. package/src/modules/business_rules/components/ConditionRow.tsx +24 -15
  163. package/src/modules/business_rules/components/RuleSetMembers.tsx +23 -13
  164. package/src/modules/catalog/backend/catalog/products/[id]/page.tsx +47 -53
  165. package/src/modules/catalog/backend/catalog/products/create/page.tsx +84 -87
  166. package/src/modules/catalog/components/PriceKindSettings.tsx +9 -9
  167. package/src/modules/catalog/components/products/ProductUomSection.tsx +85 -83
  168. package/src/modules/catalog/components/products/VariantBuilder.tsx +49 -33
  169. package/src/modules/customer_accounts/backend/customer_accounts/users/[id]/page.tsx +12 -27
  170. package/src/modules/customer_accounts/backend/customer_accounts/users/page.tsx +4 -6
  171. package/src/modules/customer_accounts/widgets/injection/account-status/widget.client.tsx +5 -4
  172. package/src/modules/customers/backend/config/customers/pipeline-stages/page.tsx +28 -15
  173. package/src/modules/customers/backend/customers/deals/pipeline/page.tsx +37 -26
  174. package/src/modules/customers/components/AddressEditor.tsx +30 -16
  175. package/src/modules/customers/components/AddressFormatSettings.tsx +25 -19
  176. package/src/modules/customers/components/detail/ActivityForm.tsx +35 -23
  177. package/src/modules/customers/components/detail/AnnualRevenueField.tsx +2 -2
  178. package/src/modules/customers/components/detail/DealForm.tsx +33 -20
  179. package/src/modules/customers/components/formConfig.tsx +25 -17
  180. package/src/modules/customers/widgets/dashboard/customer-todos/widget.client.tsx +3 -2
  181. package/src/modules/customers/widgets/dashboard/new-customers/widget.client.tsx +21 -11
  182. package/src/modules/customers/widgets/dashboard/new-deals/widget.client.tsx +3 -2
  183. package/src/modules/customers/widgets/dashboard/next-interactions/widget.client.tsx +3 -2
  184. package/src/modules/dashboards/components/WidgetVisibilityEditor.tsx +17 -22
  185. package/src/modules/dashboards/widgets/dashboard/orders-by-status/widget.client.tsx +17 -7
  186. package/src/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.tsx +20 -10
  187. package/src/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.tsx +3 -2
  188. package/src/modules/dashboards/widgets/dashboard/top-customers/widget.client.tsx +3 -2
  189. package/src/modules/dashboards/widgets/dashboard/top-products/widget.client.tsx +20 -9
  190. package/src/modules/data_sync/backend/data-sync/page.tsx +64 -38
  191. package/src/modules/data_sync/components/IntegrationScheduleTab.tsx +18 -7
  192. package/src/modules/dictionaries/components/AppearanceSelector.tsx +4 -4
  193. package/src/modules/dictionaries/components/DictionaryEntriesEditor.tsx +3 -4
  194. package/src/modules/dictionaries/components/DictionaryEntrySelect.tsx +27 -21
  195. package/src/modules/dictionaries/fields/dictionary.tsx +36 -23
  196. package/src/modules/entities/components/EncryptionManager.tsx +49 -33
  197. package/src/modules/feature_toggles/components/formConfig.tsx +20 -10
  198. package/src/modules/feature_toggles/components/overrideFormConfig.tsx +20 -10
  199. package/src/modules/inbox_ops/backend/inbox-ops/settings/page.tsx +19 -10
  200. package/src/modules/inbox_ops/components/proposals/EditActionDialog.tsx +49 -26
  201. package/src/modules/integrations/backend/integrations/[id]/page.tsx +20 -11
  202. package/src/modules/integrations/backend/integrations/bundle/[id]/page.tsx +19 -9
  203. package/src/modules/planner/components/AvailabilityRulesEditor.tsx +34 -21
  204. package/src/modules/resources/components/ResourceCrudForm.tsx +24 -15
  205. package/src/modules/sales/backend/sales/documents/[id]/page.tsx +12 -15
  206. package/src/modules/sales/components/ProviderFieldInput.tsx +26 -17
  207. package/src/modules/sales/components/ShippingMethodsSettings.tsx +28 -20
  208. package/src/modules/sales/components/channels/ChannelOfferForm.tsx +51 -46
  209. package/src/modules/sales/components/documents/AddressesSection.tsx +78 -76
  210. package/src/modules/sales/components/documents/AdjustmentDialog.tsx +27 -15
  211. package/src/modules/sales/components/documents/LineItemDialog.tsx +69 -51
  212. package/src/modules/sales/components/documents/SalesDocumentForm.tsx +98 -87
  213. package/src/modules/sales/widgets/dashboard/new-orders/widget.client.tsx +23 -12
  214. package/src/modules/sales/widgets/dashboard/new-quotes/widget.client.tsx +23 -12
  215. package/src/modules/shipping_carriers/lib/shipment-wizard/components/ConfigureStep.tsx +35 -19
  216. package/src/modules/staff/components/TeamMemberForm.tsx +23 -14
  217. package/src/modules/workflows/backend/tasks/[id]/page.tsx +51 -23
  218. package/src/modules/workflows/components/ActivitiesEditor.tsx +20 -10
  219. package/src/modules/workflows/components/DefinitionTriggersEditor.tsx +28 -18
  220. package/src/modules/workflows/components/EdgeEditDialog.tsx +51 -40
  221. package/src/modules/workflows/components/NodeEditDialog.tsx +81 -77
  222. package/src/modules/workflows/components/StepsEditor.tsx +20 -10
  223. package/src/modules/workflows/components/TransitionsEditor.tsx +61 -44
  224. package/src/modules/workflows/components/fields/ActivityArrayEditor.tsx +22 -12
  225. package/src/modules/workflows/components/fields/BusinessRuleConditionsEditor.tsx +9 -13
  226. package/src/modules/workflows/components/fields/FormFieldArrayEditor.tsx +27 -17
  227. package/src/modules/workflows/components/fields/StartPreConditionsEditor.tsx +9 -12
  228. package/src/modules/workflows/components/mobile/MobileTaskForm.tsx +19 -11
  229. package/src/modules/workflows/frontend/checkout-demo/page.tsx +71 -60
@@ -5,7 +5,15 @@ import Link from 'next/link'
5
5
  import { useRouter } from 'next/navigation'
6
6
  import { Page, PageBody } from '@open-mercato/ui/backend/Page'
7
7
  import { Button } from '@open-mercato/ui/primitives/button'
8
+ import { Input } from '@open-mercato/ui/primitives/input'
8
9
  import { FormHeader } from '@open-mercato/ui/backend/forms'
10
+ import {
11
+ Select,
12
+ SelectContent,
13
+ SelectItem,
14
+ SelectTrigger,
15
+ SelectValue,
16
+ } from '@open-mercato/ui/primitives/select'
9
17
  import { Spinner } from '@open-mercato/ui/primitives/spinner'
10
18
  import { Separator } from '@open-mercato/ui/primitives/separator'
11
19
  import { JsonDisplay } from '@open-mercato/ui/backend/JsonDisplay'
@@ -24,6 +32,10 @@ export default function UserTaskDetailPage({ params }: { params: { id: string }
24
32
  const [formData, setFormData] = React.useState<Record<string, string | number | boolean>>({})
25
33
  const [comments, setComments] = React.useState('')
26
34
  const [submitting, setSubmitting] = React.useState(false)
35
+ // Tracks the first required field that failed validation so we can mark the
36
+ // field with aria-invalid + a red ring (Radix Select can't carry HTML
37
+ // `required`, so we enforce constraint validation in JS instead).
38
+ const [invalidField, setInvalidField] = React.useState<string | null>(null)
27
39
 
28
40
  const { data: task, isLoading, error } = useQuery({
29
41
  queryKey: ['workflow-task', params.id],
@@ -45,6 +57,8 @@ export default function UserTaskDetailPage({ params }: { params: { id: string }
45
57
  ...prev,
46
58
  [fieldName]: value,
47
59
  }))
60
+ // Clear invalid state once the user touches the offending field.
61
+ if (invalidField === fieldName) setInvalidField(null)
48
62
  }
49
63
 
50
64
  const handleSubmit = async (e: React.FormEvent) => {
@@ -52,15 +66,27 @@ export default function UserTaskDetailPage({ params }: { params: { id: string }
52
66
 
53
67
  if (!task) return
54
68
 
55
- // Validate required fields
69
+ // Validate required fields. Radix Select doesn't expose HTML `required`,
70
+ // so we enforce constraint validation here and surface it visually via
71
+ // `invalidField` + aria-invalid on the offending field.
56
72
  if (task.formSchema?.required) {
57
73
  for (const requiredField of task.formSchema.required) {
58
74
  if (!formData[requiredField] || formData[requiredField] === '') {
59
- flash(t('workflows.tasks.detail.validation.requiredField', { field: requiredField }), 'error')
75
+ const fieldSchema = task.formSchema.properties?.[requiredField]
76
+ const fieldLabel = fieldSchema?.title ?? requiredField
77
+ flash(t('workflows.tasks.detail.validation.requiredField', { field: fieldLabel }), 'error')
78
+ setInvalidField(requiredField)
79
+ // Scroll + focus the trigger so the user sees what's missing.
80
+ if (typeof document !== 'undefined') {
81
+ const trigger = document.getElementById(requiredField)
82
+ trigger?.scrollIntoView({ behavior: 'smooth', block: 'center' })
83
+ trigger?.focus()
84
+ }
60
85
  return
61
86
  }
62
87
  }
63
88
  }
89
+ setInvalidField(null)
64
90
 
65
91
  setSubmitting(true)
66
92
 
@@ -119,20 +145,26 @@ export default function UserTaskDetailPage({ params }: { params: { id: string }
119
145
  {fieldDescription && (
120
146
  <p className="text-xs text-muted-foreground">{fieldDescription}</p>
121
147
  )}
122
- <select
123
- id={fieldName}
124
- value={fieldValue(fieldName)}
125
- onChange={(e) => handleFieldChange(fieldName, e.target.value)}
126
- required={required}
127
- className={inputClasses}
148
+ <Select
149
+ value={fieldValue(fieldName) ? String(fieldValue(fieldName)) : undefined}
150
+ onValueChange={(value) => handleFieldChange(fieldName, value ?? '')}
128
151
  >
129
- <option value="">{t('workflows.tasks.detail.form.selectOption')}</option>
130
- {enumValues.map((value: any) => (
131
- <option key={value} value={value}>
132
- {value}
133
- </option>
134
- ))}
135
- </select>
152
+ <SelectTrigger
153
+ id={fieldName}
154
+ className={`${inputClasses} ${invalidField === fieldName ? 'ring-2 ring-status-error-border border-status-error-border' : ''}`}
155
+ aria-required={required}
156
+ aria-invalid={invalidField === fieldName ? true : undefined}
157
+ >
158
+ <SelectValue placeholder={t('workflows.tasks.detail.form.selectOption')} />
159
+ </SelectTrigger>
160
+ <SelectContent>
161
+ {enumValues.map((value: any) => (
162
+ <SelectItem key={value} value={value}>
163
+ {value}
164
+ </SelectItem>
165
+ ))}
166
+ </SelectContent>
167
+ </Select>
136
168
  </div>
137
169
  )
138
170
  }
@@ -150,13 +182,12 @@ export default function UserTaskDetailPage({ params }: { params: { id: string }
150
182
  {fieldDescription && (
151
183
  <p className="text-xs text-muted-foreground">{fieldDescription}</p>
152
184
  )}
153
- <input
185
+ <Input
154
186
  type="email"
155
187
  id={fieldName}
156
188
  value={fieldValue(fieldName)}
157
189
  onChange={(e) => handleFieldChange(fieldName, e.target.value)}
158
190
  required={required}
159
- className={inputClasses}
160
191
  />
161
192
  </div>
162
193
  )
@@ -212,13 +243,12 @@ export default function UserTaskDetailPage({ params }: { params: { id: string }
212
243
  {fieldDescription && (
213
244
  <p className="text-xs text-muted-foreground">{fieldDescription}</p>
214
245
  )}
215
- <input
246
+ <Input
216
247
  type="text"
217
248
  id={fieldName}
218
249
  value={fieldValue(fieldName)}
219
250
  onChange={(e) => handleFieldChange(fieldName, e.target.value)}
220
251
  required={required}
221
- className={inputClasses}
222
252
  />
223
253
  </div>
224
254
  )
@@ -234,14 +264,13 @@ export default function UserTaskDetailPage({ params }: { params: { id: string }
234
264
  {fieldDescription && (
235
265
  <p className="text-xs text-muted-foreground">{fieldDescription}</p>
236
266
  )}
237
- <input
267
+ <Input
238
268
  type="number"
239
269
  id={fieldName}
240
270
  value={fieldValue(fieldName)}
241
271
  onChange={(e) => handleFieldChange(fieldName, e.target.value ? Number(e.target.value) : '')}
242
272
  required={required}
243
273
  step={fieldType === 'integer' ? 1 : 'any'}
244
- className={inputClasses}
245
274
  />
246
275
  </div>
247
276
  )
@@ -278,13 +307,12 @@ export default function UserTaskDetailPage({ params }: { params: { id: string }
278
307
  {fieldDescription && (
279
308
  <p className="text-xs text-muted-foreground">{fieldDescription}</p>
280
309
  )}
281
- <input
310
+ <Input
282
311
  type="text"
283
312
  id={fieldName}
284
313
  value={fieldValue(fieldName)}
285
314
  onChange={(e) => handleFieldChange(fieldName, e.target.value)}
286
315
  required={required}
287
- className={inputClasses}
288
316
  />
289
317
  </div>
290
318
  )
@@ -4,6 +4,13 @@ import * as React from 'react'
4
4
  import { Button } from '@open-mercato/ui/primitives/button'
5
5
  import { Input } from '@open-mercato/ui/primitives/input'
6
6
  import { Label } from '@open-mercato/ui/primitives/label'
7
+ import {
8
+ Select,
9
+ SelectContent,
10
+ SelectItem,
11
+ SelectTrigger,
12
+ SelectValue,
13
+ } from '@open-mercato/ui/primitives/select'
7
14
  import { Textarea } from '@open-mercato/ui/primitives/textarea'
8
15
  import { Trash2, Plus, ChevronUp, ChevronDown } from 'lucide-react'
9
16
  import { useT } from '@open-mercato/shared/lib/i18n/context'
@@ -181,18 +188,21 @@ export function ActivitiesEditor({ value = [], onChange, error }: ActivitiesEdit
181
188
  <Label htmlFor={`activity-${index}-type`} className="text-xs">
182
189
  {t('workflows.activities.activityType')} *
183
190
  </Label>
184
- <select
185
- id={`activity-${index}-type`}
191
+ <Select
186
192
  value={activity.activityType}
187
- onChange={(e) => updateActivity(index, 'activityType', e.target.value)}
188
- className="mt-1 w-full px-3 py-2 border border-gray-300 rounded-md text-sm"
193
+ onValueChange={(value) => updateActivity(index, 'activityType', value)}
189
194
  >
190
- {ACTIVITY_TYPES.map((type) => (
191
- <option key={type.value} value={type.value}>
192
- {t(`workflows.activities.types.${type.value}`)}
193
- </option>
194
- ))}
195
- </select>
195
+ <SelectTrigger id={`activity-${index}-type`} className="mt-1">
196
+ <SelectValue />
197
+ </SelectTrigger>
198
+ <SelectContent>
199
+ {ACTIVITY_TYPES.map((type) => (
200
+ <SelectItem key={type.value} value={type.value}>
201
+ {t(`workflows.activities.types.${type.value}`)}
202
+ </SelectItem>
203
+ ))}
204
+ </SelectContent>
205
+ </Select>
196
206
  </div>
197
207
  <div>
198
208
  <Label htmlFor={`activity-${index}-timeout`} className="text-xs">
@@ -6,7 +6,14 @@ import { Button } from '@open-mercato/ui/primitives/button'
6
6
  import { Input } from '@open-mercato/ui/primitives/input'
7
7
  import { Textarea } from '@open-mercato/ui/primitives/textarea'
8
8
  import { Label } from '@open-mercato/ui/primitives/label'
9
- import { Switch } from '@open-mercato/ui/primitives/switch'
9
+ import {
10
+ Select,
11
+ SelectContent,
12
+ SelectItem,
13
+ SelectTrigger,
14
+ SelectValue,
15
+ } from '@open-mercato/ui/primitives/select'
16
+ import { SwitchField } from '@open-mercato/ui/primitives/switch-field'
10
17
  import { Badge } from '@open-mercato/ui/primitives/badge'
11
18
  import {
12
19
  Dialog,
@@ -403,14 +410,13 @@ export function DefinitionTriggersEditor({
403
410
  </div>
404
411
 
405
412
  {/* Enabled Switch */}
406
- <div className="flex items-center gap-2">
407
- <Switch
408
- id="trigger-enabled"
409
- checked={formValues.enabled}
410
- onCheckedChange={checked => setFormValues(prev => ({ ...prev, enabled: checked }))}
411
- />
412
- <Label htmlFor="trigger-enabled">{t('workflows.triggers.fields.enabled', 'Enabled')}</Label>
413
- </div>
413
+ <SwitchField
414
+ id="trigger-enabled"
415
+ label={t('workflows.triggers.fields.enabled', 'Enabled')}
416
+ flip
417
+ checked={formValues.enabled}
418
+ onCheckedChange={checked => setFormValues(prev => ({ ...prev, enabled: checked }))}
419
+ />
414
420
 
415
421
  {/* Filter Conditions */}
416
422
  <div className="space-y-2">
@@ -432,17 +438,21 @@ export function DefinitionTriggersEditor({
432
438
  placeholder="status"
433
439
  className="w-full sm:w-1/3"
434
440
  />
435
- <select
441
+ <Select
436
442
  value={fc.operator}
437
- onChange={(e: React.ChangeEvent<HTMLSelectElement>) => updateFilterCondition(index, 'operator', e.target.value)}
438
- className="h-10 w-full sm:w-[140px] rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
443
+ onValueChange={(value) => updateFilterCondition(index, 'operator', value)}
439
444
  >
440
- {FILTER_OPERATORS.map(op => (
441
- <option key={op.value} value={op.value}>
442
- {op.label}
443
- </option>
444
- ))}
445
- </select>
445
+ <SelectTrigger size="lg" className="w-full sm:w-[140px]">
446
+ <SelectValue />
447
+ </SelectTrigger>
448
+ <SelectContent>
449
+ {FILTER_OPERATORS.map(op => (
450
+ <SelectItem key={op.value} value={op.value}>
451
+ {op.label}
452
+ </SelectItem>
453
+ ))}
454
+ </SelectContent>
455
+ </Select>
446
456
  <Input
447
457
  value={fc.value}
448
458
  onChange={e => updateFilterCondition(index, 'value', e.target.value)}
@@ -13,6 +13,13 @@ import {
13
13
  import {Button} from '@open-mercato/ui/primitives/button'
14
14
  import {Input} from '@open-mercato/ui/primitives/input'
15
15
  import {Label} from '@open-mercato/ui/primitives/label'
16
+ import {
17
+ Select,
18
+ SelectContent,
19
+ SelectItem,
20
+ SelectTrigger,
21
+ SelectValue,
22
+ } from '@open-mercato/ui/primitives/select'
16
23
  import {Badge} from '@open-mercato/ui/primitives/badge'
17
24
  import {Separator} from '@open-mercato/ui/primitives/separator'
18
25
  import {Plus, Trash2} from 'lucide-react'
@@ -355,17 +362,17 @@ export function EdgeEditDialog({ edge, isOpen, onClose, onSave, onDelete }: Edge
355
362
  {/* Trigger Type */}
356
363
  <div className="space-y-2">
357
364
  <Label htmlFor="trigger">{t('workflows.edgeEditor.triggerType')}</Label>
358
- <select
359
- id="trigger"
360
- value={trigger}
361
- onChange={(e) => setTrigger(e.target.value)}
362
- className="flex h-9 w-full rounded-md border border-input bg-background px-3 py-2 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
363
- >
364
- <option value="auto">{t('workflows.transitions.triggers.auto')}</option>
365
- <option value="manual">{t('workflows.transitions.triggers.manual')}</option>
366
- <option value="signal">{t('workflows.transitions.triggers.signal')}</option>
367
- <option value="timer">{t('workflows.transitions.triggers.timer')}</option>
368
- </select>
365
+ <Select value={trigger} onValueChange={(value) => setTrigger(value)}>
366
+ <SelectTrigger id="trigger">
367
+ <SelectValue />
368
+ </SelectTrigger>
369
+ <SelectContent>
370
+ <SelectItem value="auto">{t('workflows.transitions.triggers.auto')}</SelectItem>
371
+ <SelectItem value="manual">{t('workflows.transitions.triggers.manual')}</SelectItem>
372
+ <SelectItem value="signal">{t('workflows.transitions.triggers.signal')}</SelectItem>
373
+ <SelectItem value="timer">{t('workflows.transitions.triggers.timer')}</SelectItem>
374
+ </SelectContent>
375
+ </Select>
369
376
  <p className="text-xs text-muted-foreground">
370
377
  {t(`workflows.edgeEditor.triggerDescriptions.${trigger}`)}
371
378
  </p>
@@ -483,11 +490,11 @@ export function EdgeEditDialog({ edge, isOpen, onClose, onSave, onDelete }: Edge
483
490
  <div className="px-4 pb-4 space-y-3 border-t border-gray-200 bg-white">
484
491
  <div className="pt-3">
485
492
  <label className="block text-xs font-medium text-gray-700 mb-1">{t('workflows.edgeEditor.ruleId')}</label>
486
- <input
493
+ <Input
487
494
  type="text"
495
+ size="sm"
488
496
  value={condition.ruleId}
489
497
  onChange={(e) => updatePreCondition(index, 'ruleId', e.target.value)}
490
- className="w-full px-2 py-1.5 border border-gray-300 rounded text-xs focus-visible:ring-1 focus-visible:ring-ring focus-visible:border-ring"
491
498
  />
492
499
  </div>
493
500
 
@@ -635,11 +642,11 @@ export function EdgeEditDialog({ edge, isOpen, onClose, onSave, onDelete }: Edge
635
642
  <div className="px-4 pb-4 space-y-3 border-t border-gray-200 bg-white">
636
643
  <div className="pt-3">
637
644
  <label className="block text-xs font-medium text-gray-700 mb-1">{t('workflows.edgeEditor.ruleId')}</label>
638
- <input
645
+ <Input
639
646
  type="text"
647
+ size="sm"
640
648
  value={condition.ruleId}
641
649
  onChange={(e) => updatePostCondition(index, 'ruleId', e.target.value)}
642
- className="w-full px-2 py-1.5 border border-gray-300 rounded text-xs focus-visible:ring-1 focus-visible:ring-ring focus-visible:border-ring"
643
650
  />
644
651
  </div>
645
652
 
@@ -772,11 +779,11 @@ export function EdgeEditDialog({ edge, isOpen, onClose, onSave, onDelete }: Edge
772
779
  {/* Activity ID */}
773
780
  <div className="pt-3">
774
781
  <label className="block text-xs font-medium text-gray-700 mb-1">{t('workflows.edgeEditor.activityId')} *</label>
775
- <input
782
+ <Input
776
783
  type="text"
784
+ size="sm"
777
785
  value={activity.activityId}
778
786
  onChange={(e) => updateActivity(index, 'activityId', e.target.value)}
779
- className="w-full px-2 py-1.5 border border-gray-300 rounded text-xs focus-visible:ring-1 focus-visible:ring-ring focus-visible:border-ring"
780
787
  placeholder={t('workflows.edgeEditor.activityIdPlaceholder')}
781
788
  />
782
789
  </div>
@@ -784,11 +791,11 @@ export function EdgeEditDialog({ edge, isOpen, onClose, onSave, onDelete }: Edge
784
791
  {/* Activity Name */}
785
792
  <div>
786
793
  <label className="block text-xs font-medium text-gray-700 mb-1">{t('workflows.edgeEditor.activityName')} *</label>
787
- <input
794
+ <Input
788
795
  type="text"
796
+ size="sm"
789
797
  value={activity.activityName || ''}
790
798
  onChange={(e) => updateActivity(index, 'activityName', e.target.value)}
791
- className="w-full px-2 py-1.5 border border-gray-300 rounded text-xs focus-visible:ring-1 focus-visible:ring-ring focus-visible:border-ring"
792
799
  placeholder={t('workflows.edgeEditor.activityNamePlaceholder')}
793
800
  />
794
801
  </div>
@@ -796,29 +803,33 @@ export function EdgeEditDialog({ edge, isOpen, onClose, onSave, onDelete }: Edge
796
803
  {/* Activity Type */}
797
804
  <div>
798
805
  <label className="block text-xs font-medium text-gray-700 mb-1">{t('workflows.edgeEditor.activityType')} *</label>
799
- <select
806
+ <Select
800
807
  value={activity.activityType}
801
- onChange={(e) => updateActivity(index, 'activityType', e.target.value)}
802
- className="w-full px-2 py-1.5 border border-gray-300 rounded text-xs focus-visible:ring-1 focus-visible:ring-ring focus-visible:border-ring"
808
+ onValueChange={(value) => updateActivity(index, 'activityType', value)}
803
809
  >
804
- <option value="SEND_EMAIL">{t('workflows.activities.types.SEND_EMAIL')}</option>
805
- <option value="CALL_API">{t('workflows.activities.types.CALL_API')}</option>
806
- <option value="UPDATE_ENTITY">{t('workflows.activities.types.UPDATE_ENTITY')}</option>
807
- <option value="EMIT_EVENT">{t('workflows.activities.types.EMIT_EVENT')}</option>
808
- <option value="CALL_WEBHOOK">{t('workflows.activities.types.CALL_WEBHOOK')}</option>
809
- <option value="EXECUTE_FUNCTION">{t('workflows.activities.types.EXECUTE_FUNCTION')}</option>
810
- <option value="WAIT">{t('workflows.activities.types.WAIT')}</option>
811
- </select>
810
+ <SelectTrigger size="sm">
811
+ <SelectValue />
812
+ </SelectTrigger>
813
+ <SelectContent>
814
+ <SelectItem value="SEND_EMAIL">{t('workflows.activities.types.SEND_EMAIL')}</SelectItem>
815
+ <SelectItem value="CALL_API">{t('workflows.activities.types.CALL_API')}</SelectItem>
816
+ <SelectItem value="UPDATE_ENTITY">{t('workflows.activities.types.UPDATE_ENTITY')}</SelectItem>
817
+ <SelectItem value="EMIT_EVENT">{t('workflows.activities.types.EMIT_EVENT')}</SelectItem>
818
+ <SelectItem value="CALL_WEBHOOK">{t('workflows.activities.types.CALL_WEBHOOK')}</SelectItem>
819
+ <SelectItem value="EXECUTE_FUNCTION">{t('workflows.activities.types.EXECUTE_FUNCTION')}</SelectItem>
820
+ <SelectItem value="WAIT">{t('workflows.activities.types.WAIT')}</SelectItem>
821
+ </SelectContent>
822
+ </Select>
812
823
  </div>
813
824
 
814
825
  {/* Timeout */}
815
826
  <div>
816
827
  <label className="block text-xs font-medium text-gray-700 mb-1">{t('workflows.edgeEditor.timeout')}</label>
817
- <input
828
+ <Input
818
829
  type="text"
830
+ size="sm"
819
831
  value={activity.timeout || ''}
820
832
  onChange={(e) => updateActivity(index, 'timeout', e.target.value)}
821
- className="w-full px-2 py-1.5 border border-gray-300 rounded text-xs focus-visible:ring-1 focus-visible:ring-ring focus-visible:border-ring"
822
833
  placeholder={t('workflows.edgeEditor.timeoutPlaceholder')}
823
834
  />
824
835
  <p className="text-xs text-gray-500 mt-0.5">{t('workflows.edgeEditor.timeoutHint')}</p>
@@ -830,11 +841,11 @@ export function EdgeEditDialog({ edge, isOpen, onClose, onSave, onDelete }: Edge
830
841
  <div className="grid grid-cols-1 sm:grid-cols-2 gap-2">
831
842
  <div>
832
843
  <label className="block text-xs font-medium text-gray-700 mb-1">{t('workflows.edgeEditor.maxAttempts')}</label>
833
- <input
844
+ <Input
834
845
  type="number"
846
+ size="sm"
835
847
  value={activity.retryPolicy?.maxAttempts || ''}
836
848
  onChange={(e) => updateActivityRetryPolicy(index, 'maxAttempts', parseInt(e.target.value) || 0)}
837
- className="w-full px-2 py-1.5 border border-gray-300 rounded text-xs focus-visible:ring-1 focus-visible:ring-ring focus-visible:border-ring"
838
849
  placeholder="3"
839
850
  min="1"
840
851
  max="10"
@@ -842,23 +853,23 @@ export function EdgeEditDialog({ edge, isOpen, onClose, onSave, onDelete }: Edge
842
853
  </div>
843
854
  <div>
844
855
  <label className="block text-xs font-medium text-gray-700 mb-1">{t('workflows.edgeEditor.initialInterval')}</label>
845
- <input
856
+ <Input
846
857
  type="number"
858
+ size="sm"
847
859
  value={activity.retryPolicy?.initialIntervalMs || ''}
848
860
  onChange={(e) => updateActivityRetryPolicy(index, 'initialIntervalMs', parseInt(e.target.value) || 0)}
849
- className="w-full px-2 py-1.5 border border-gray-300 rounded text-xs focus-visible:ring-1 focus-visible:ring-ring focus-visible:border-ring"
850
861
  placeholder="1000"
851
862
  min="0"
852
863
  />
853
864
  </div>
854
865
  <div>
855
866
  <label className="block text-xs font-medium text-gray-700 mb-1">{t('workflows.edgeEditor.backoffCoefficient')}</label>
856
- <input
867
+ <Input
857
868
  type="number"
869
+ size="sm"
858
870
  step="0.1"
859
871
  value={activity.retryPolicy?.backoffCoefficient || ''}
860
872
  onChange={(e) => updateActivityRetryPolicy(index, 'backoffCoefficient', parseFloat(e.target.value) || 1)}
861
- className="w-full px-2 py-1.5 border border-gray-300 rounded text-xs focus-visible:ring-1 focus-visible:ring-ring focus-visible:border-ring"
862
873
  placeholder="2"
863
874
  min="1"
864
875
  max="10"
@@ -866,11 +877,11 @@ export function EdgeEditDialog({ edge, isOpen, onClose, onSave, onDelete }: Edge
866
877
  </div>
867
878
  <div>
868
879
  <label className="block text-xs font-medium text-gray-700 mb-1">{t('workflows.edgeEditor.maxInterval')}</label>
869
- <input
880
+ <Input
870
881
  type="number"
882
+ size="sm"
871
883
  value={activity.retryPolicy?.maxIntervalMs || ''}
872
884
  onChange={(e) => updateActivityRetryPolicy(index, 'maxIntervalMs', parseInt(e.target.value) || 0)}
873
- className="w-full px-2 py-1.5 border border-gray-300 rounded text-xs focus-visible:ring-1 focus-visible:ring-ring focus-visible:border-ring"
874
885
  placeholder="10000"
875
886
  min="0"
876
887
  />