@open-mercato/core 0.5.1-develop.2953.6647bb2c43 → 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 (226) 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/backend/users/create/page.js +26 -26
  10. package/dist/modules/auth/backend/users/create/page.js.map +2 -2
  11. package/dist/modules/business_rules/components/ActionRow.js +36 -25
  12. package/dist/modules/business_rules/components/ActionRow.js.map +2 -2
  13. package/dist/modules/business_rules/components/ConditionGroup.js +14 -5
  14. package/dist/modules/business_rules/components/ConditionGroup.js.map +2 -2
  15. package/dist/modules/business_rules/components/ConditionRow.js +19 -10
  16. package/dist/modules/business_rules/components/ConditionRow.js.map +2 -2
  17. package/dist/modules/business_rules/components/RuleSetMembers.js +16 -10
  18. package/dist/modules/business_rules/components/RuleSetMembers.js.map +2 -2
  19. package/dist/modules/catalog/backend/catalog/products/[id]/page.js +30 -34
  20. package/dist/modules/catalog/backend/catalog/products/[id]/page.js.map +2 -2
  21. package/dist/modules/catalog/backend/catalog/products/create/page.js +220 -223
  22. package/dist/modules/catalog/backend/catalog/products/create/page.js.map +2 -2
  23. package/dist/modules/catalog/components/PriceKindSettings.js +20 -19
  24. package/dist/modules/catalog/components/PriceKindSettings.js.map +2 -2
  25. package/dist/modules/catalog/components/products/ProductUomSection.js +42 -37
  26. package/dist/modules/catalog/components/products/ProductUomSection.js.map +2 -2
  27. package/dist/modules/catalog/components/products/VariantBuilder.js +22 -18
  28. package/dist/modules/catalog/components/products/VariantBuilder.js.map +2 -2
  29. package/dist/modules/customer_accounts/backend/customer_accounts/users/[id]/page.js +18 -26
  30. package/dist/modules/customer_accounts/backend/customer_accounts/users/[id]/page.js.map +2 -2
  31. package/dist/modules/customer_accounts/backend/customer_accounts/users/page.js +4 -6
  32. package/dist/modules/customer_accounts/backend/customer_accounts/users/page.js.map +2 -2
  33. package/dist/modules/customer_accounts/widgets/injection/account-status/widget.client.js +5 -4
  34. package/dist/modules/customer_accounts/widgets/injection/account-status/widget.client.js.map +2 -2
  35. package/dist/modules/customers/backend/config/customers/pipeline-stages/page.js +19 -7
  36. package/dist/modules/customers/backend/config/customers/pipeline-stages/page.js.map +2 -2
  37. package/dist/modules/customers/backend/customers/deals/pipeline/page.js +24 -21
  38. package/dist/modules/customers/backend/customers/deals/pipeline/page.js.map +2 -2
  39. package/dist/modules/customers/components/AddressEditor.js +24 -7
  40. package/dist/modules/customers/components/AddressEditor.js.map +2 -2
  41. package/dist/modules/customers/components/AddressFormatSettings.js +35 -25
  42. package/dist/modules/customers/components/AddressFormatSettings.js.map +2 -2
  43. package/dist/modules/customers/components/detail/ActivityForm.js +20 -12
  44. package/dist/modules/customers/components/detail/ActivityForm.js.map +2 -2
  45. package/dist/modules/customers/components/detail/AnnualRevenueField.js +2 -2
  46. package/dist/modules/customers/components/detail/AnnualRevenueField.js.map +2 -2
  47. package/dist/modules/customers/components/detail/DealForm.js +19 -14
  48. package/dist/modules/customers/components/detail/DealForm.js.map +2 -2
  49. package/dist/modules/customers/components/formConfig.js +16 -12
  50. package/dist/modules/customers/components/formConfig.js.map +2 -2
  51. package/dist/modules/customers/widgets/dashboard/customer-todos/widget.client.js +3 -2
  52. package/dist/modules/customers/widgets/dashboard/customer-todos/widget.client.js.map +2 -2
  53. package/dist/modules/customers/widgets/dashboard/new-customers/widget.client.js +18 -10
  54. package/dist/modules/customers/widgets/dashboard/new-customers/widget.client.js.map +2 -2
  55. package/dist/modules/customers/widgets/dashboard/new-deals/widget.client.js +3 -2
  56. package/dist/modules/customers/widgets/dashboard/new-deals/widget.client.js.map +2 -2
  57. package/dist/modules/customers/widgets/dashboard/next-interactions/widget.client.js +3 -2
  58. package/dist/modules/customers/widgets/dashboard/next-interactions/widget.client.js.map +2 -2
  59. package/dist/modules/dashboards/components/WidgetVisibilityEditor.js +27 -28
  60. package/dist/modules/dashboards/components/WidgetVisibilityEditor.js.map +2 -2
  61. package/dist/modules/dashboards/widgets/dashboard/orders-by-status/widget.client.js +14 -6
  62. package/dist/modules/dashboards/widgets/dashboard/orders-by-status/widget.client.js.map +2 -2
  63. package/dist/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.js +14 -6
  64. package/dist/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.js.map +2 -2
  65. package/dist/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.js +3 -2
  66. package/dist/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.js.map +2 -2
  67. package/dist/modules/dashboards/widgets/dashboard/top-customers/widget.client.js +3 -2
  68. package/dist/modules/dashboards/widgets/dashboard/top-customers/widget.client.js.map +2 -2
  69. package/dist/modules/dashboards/widgets/dashboard/top-products/widget.client.js +17 -8
  70. package/dist/modules/dashboards/widgets/dashboard/top-products/widget.client.js.map +2 -2
  71. package/dist/modules/data_sync/backend/data-sync/page.js +40 -23
  72. package/dist/modules/data_sync/backend/data-sync/page.js.map +2 -2
  73. package/dist/modules/data_sync/components/IntegrationScheduleTab.js +15 -6
  74. package/dist/modules/data_sync/components/IntegrationScheduleTab.js.map +2 -2
  75. package/dist/modules/dictionaries/components/AppearanceSelector.js +4 -4
  76. package/dist/modules/dictionaries/components/AppearanceSelector.js.map +2 -2
  77. package/dist/modules/dictionaries/components/DictionaryEntriesEditor.js +4 -5
  78. package/dist/modules/dictionaries/components/DictionaryEntriesEditor.js.map +2 -2
  79. package/dist/modules/dictionaries/components/DictionaryEntrySelect.js +22 -14
  80. package/dist/modules/dictionaries/components/DictionaryEntrySelect.js.map +2 -2
  81. package/dist/modules/dictionaries/fields/dictionary.js +18 -13
  82. package/dist/modules/dictionaries/fields/dictionary.js.map +2 -2
  83. package/dist/modules/entities/components/EncryptionManager.js +23 -19
  84. package/dist/modules/entities/components/EncryptionManager.js.map +2 -2
  85. package/dist/modules/feature_toggles/components/formConfig.js +17 -9
  86. package/dist/modules/feature_toggles/components/formConfig.js.map +2 -2
  87. package/dist/modules/feature_toggles/components/overrideFormConfig.js +17 -9
  88. package/dist/modules/feature_toggles/components/overrideFormConfig.js.map +2 -2
  89. package/dist/modules/inbox_ops/backend/inbox-ops/settings/page.js +15 -8
  90. package/dist/modules/inbox_ops/backend/inbox-ops/settings/page.js.map +2 -2
  91. package/dist/modules/inbox_ops/components/proposals/EditActionDialog.js +37 -22
  92. package/dist/modules/inbox_ops/components/proposals/EditActionDialog.js.map +2 -2
  93. package/dist/modules/integrations/backend/integrations/[id]/page.js +22 -17
  94. package/dist/modules/integrations/backend/integrations/[id]/page.js.map +2 -2
  95. package/dist/modules/integrations/backend/integrations/bundle/[id]/page.js +12 -6
  96. package/dist/modules/integrations/backend/integrations/bundle/[id]/page.js.map +2 -2
  97. package/dist/modules/planner/components/AvailabilityRulesEditor.js +19 -12
  98. package/dist/modules/planner/components/AvailabilityRulesEditor.js.map +2 -2
  99. package/dist/modules/resources/components/ResourceCrudForm.js +15 -10
  100. package/dist/modules/resources/components/ResourceCrudForm.js.map +3 -3
  101. package/dist/modules/sales/backend/sales/documents/[id]/page.js +15 -18
  102. package/dist/modules/sales/backend/sales/documents/[id]/page.js.map +2 -2
  103. package/dist/modules/sales/components/ProviderFieldInput.js +23 -20
  104. package/dist/modules/sales/components/ProviderFieldInput.js.map +2 -2
  105. package/dist/modules/sales/components/ShippingMethodsSettings.js +25 -17
  106. package/dist/modules/sales/components/ShippingMethodsSettings.js.map +3 -3
  107. package/dist/modules/sales/components/channels/ChannelOfferForm.js +35 -42
  108. package/dist/modules/sales/components/channels/ChannelOfferForm.js.map +2 -2
  109. package/dist/modules/sales/components/documents/AddressesSection.js +87 -90
  110. package/dist/modules/sales/components/documents/AddressesSection.js.map +2 -2
  111. package/dist/modules/sales/components/documents/AdjustmentDialog.js +17 -6
  112. package/dist/modules/sales/components/documents/AdjustmentDialog.js.map +3 -3
  113. package/dist/modules/sales/components/documents/LineItemDialog.js +42 -25
  114. package/dist/modules/sales/components/documents/LineItemDialog.js.map +2 -2
  115. package/dist/modules/sales/components/documents/SalesDocumentForm.js +96 -87
  116. package/dist/modules/sales/components/documents/SalesDocumentForm.js.map +2 -2
  117. package/dist/modules/sales/widgets/dashboard/new-orders/widget.client.js +20 -11
  118. package/dist/modules/sales/widgets/dashboard/new-orders/widget.client.js.map +2 -2
  119. package/dist/modules/sales/widgets/dashboard/new-quotes/widget.client.js +20 -11
  120. package/dist/modules/sales/widgets/dashboard/new-quotes/widget.client.js.map +2 -2
  121. package/dist/modules/shipping_carriers/lib/shipment-wizard/components/ConfigureStep.js +36 -22
  122. package/dist/modules/shipping_carriers/lib/shipment-wizard/components/ConfigureStep.js.map +2 -2
  123. package/dist/modules/staff/components/TeamMemberForm.js +14 -9
  124. package/dist/modules/staff/components/TeamMemberForm.js.map +3 -3
  125. package/dist/modules/workflows/backend/tasks/[id]/page.js +42 -21
  126. package/dist/modules/workflows/backend/tasks/[id]/page.js.map +2 -2
  127. package/dist/modules/workflows/components/ActivitiesEditor.js +14 -6
  128. package/dist/modules/workflows/components/ActivitiesEditor.js.map +3 -3
  129. package/dist/modules/workflows/components/DefinitionTriggersEditor.js +25 -17
  130. package/dist/modules/workflows/components/DefinitionTriggersEditor.js.map +3 -3
  131. package/dist/modules/workflows/components/EdgeEditDialog.js +48 -45
  132. package/dist/modules/workflows/components/EdgeEditDialog.js.map +2 -2
  133. package/dist/modules/workflows/components/NodeEditDialog.js +90 -90
  134. package/dist/modules/workflows/components/NodeEditDialog.js.map +2 -2
  135. package/dist/modules/workflows/components/StepsEditor.js +14 -6
  136. package/dist/modules/workflows/components/StepsEditor.js.map +3 -3
  137. package/dist/modules/workflows/components/TransitionsEditor.js +31 -26
  138. package/dist/modules/workflows/components/TransitionsEditor.js.map +3 -3
  139. package/dist/modules/workflows/components/fields/ActivityArrayEditor.js +19 -11
  140. package/dist/modules/workflows/components/fields/ActivityArrayEditor.js.map +3 -3
  141. package/dist/modules/workflows/components/fields/BusinessRuleConditionsEditor.js +12 -14
  142. package/dist/modules/workflows/components/fields/BusinessRuleConditionsEditor.js.map +2 -2
  143. package/dist/modules/workflows/components/fields/FormFieldArrayEditor.js +24 -16
  144. package/dist/modules/workflows/components/fields/FormFieldArrayEditor.js.map +3 -3
  145. package/dist/modules/workflows/components/fields/StartPreConditionsEditor.js +12 -13
  146. package/dist/modules/workflows/components/fields/StartPreConditionsEditor.js.map +2 -2
  147. package/dist/modules/workflows/components/mobile/MobileTaskForm.js +12 -8
  148. package/dist/modules/workflows/components/mobile/MobileTaskForm.js.map +2 -2
  149. package/dist/modules/workflows/frontend/checkout-demo/page.js +43 -46
  150. package/dist/modules/workflows/frontend/checkout-demo/page.js.map +2 -2
  151. package/package.json +3 -3
  152. package/src/helpers/integration/salesUi.ts +40 -30
  153. package/src/modules/api_docs/frontend/docs/api/Explorer.tsx +25 -19
  154. package/src/modules/attachments/components/AttachmentPartitionSettings.tsx +21 -11
  155. package/src/modules/attachments/fields/attachment.tsx +4 -6
  156. package/src/modules/auth/backend/users/create/page.tsx +16 -20
  157. package/src/modules/business_rules/components/ActionRow.tsx +51 -32
  158. package/src/modules/business_rules/components/ConditionGroup.tsx +20 -9
  159. package/src/modules/business_rules/components/ConditionRow.tsx +24 -15
  160. package/src/modules/business_rules/components/RuleSetMembers.tsx +23 -13
  161. package/src/modules/catalog/backend/catalog/products/[id]/page.tsx +47 -53
  162. package/src/modules/catalog/backend/catalog/products/create/page.tsx +84 -87
  163. package/src/modules/catalog/components/PriceKindSettings.tsx +9 -9
  164. package/src/modules/catalog/components/products/ProductUomSection.tsx +85 -83
  165. package/src/modules/catalog/components/products/VariantBuilder.tsx +49 -33
  166. package/src/modules/customer_accounts/backend/customer_accounts/users/[id]/page.tsx +12 -27
  167. package/src/modules/customer_accounts/backend/customer_accounts/users/page.tsx +4 -6
  168. package/src/modules/customer_accounts/widgets/injection/account-status/widget.client.tsx +5 -4
  169. package/src/modules/customers/backend/config/customers/pipeline-stages/page.tsx +28 -15
  170. package/src/modules/customers/backend/customers/deals/pipeline/page.tsx +37 -26
  171. package/src/modules/customers/components/AddressEditor.tsx +30 -16
  172. package/src/modules/customers/components/AddressFormatSettings.tsx +25 -19
  173. package/src/modules/customers/components/detail/ActivityForm.tsx +35 -23
  174. package/src/modules/customers/components/detail/AnnualRevenueField.tsx +2 -2
  175. package/src/modules/customers/components/detail/DealForm.tsx +33 -20
  176. package/src/modules/customers/components/formConfig.tsx +25 -17
  177. package/src/modules/customers/widgets/dashboard/customer-todos/widget.client.tsx +3 -2
  178. package/src/modules/customers/widgets/dashboard/new-customers/widget.client.tsx +21 -11
  179. package/src/modules/customers/widgets/dashboard/new-deals/widget.client.tsx +3 -2
  180. package/src/modules/customers/widgets/dashboard/next-interactions/widget.client.tsx +3 -2
  181. package/src/modules/dashboards/components/WidgetVisibilityEditor.tsx +17 -22
  182. package/src/modules/dashboards/widgets/dashboard/orders-by-status/widget.client.tsx +17 -7
  183. package/src/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.tsx +20 -10
  184. package/src/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.tsx +3 -2
  185. package/src/modules/dashboards/widgets/dashboard/top-customers/widget.client.tsx +3 -2
  186. package/src/modules/dashboards/widgets/dashboard/top-products/widget.client.tsx +20 -9
  187. package/src/modules/data_sync/backend/data-sync/page.tsx +64 -38
  188. package/src/modules/data_sync/components/IntegrationScheduleTab.tsx +18 -7
  189. package/src/modules/dictionaries/components/AppearanceSelector.tsx +4 -4
  190. package/src/modules/dictionaries/components/DictionaryEntriesEditor.tsx +3 -4
  191. package/src/modules/dictionaries/components/DictionaryEntrySelect.tsx +27 -21
  192. package/src/modules/dictionaries/fields/dictionary.tsx +36 -23
  193. package/src/modules/entities/components/EncryptionManager.tsx +49 -33
  194. package/src/modules/feature_toggles/components/formConfig.tsx +20 -10
  195. package/src/modules/feature_toggles/components/overrideFormConfig.tsx +20 -10
  196. package/src/modules/inbox_ops/backend/inbox-ops/settings/page.tsx +19 -10
  197. package/src/modules/inbox_ops/components/proposals/EditActionDialog.tsx +49 -26
  198. package/src/modules/integrations/backend/integrations/[id]/page.tsx +20 -11
  199. package/src/modules/integrations/backend/integrations/bundle/[id]/page.tsx +19 -9
  200. package/src/modules/planner/components/AvailabilityRulesEditor.tsx +34 -21
  201. package/src/modules/resources/components/ResourceCrudForm.tsx +24 -15
  202. package/src/modules/sales/backend/sales/documents/[id]/page.tsx +12 -15
  203. package/src/modules/sales/components/ProviderFieldInput.tsx +26 -17
  204. package/src/modules/sales/components/ShippingMethodsSettings.tsx +28 -20
  205. package/src/modules/sales/components/channels/ChannelOfferForm.tsx +51 -46
  206. package/src/modules/sales/components/documents/AddressesSection.tsx +78 -76
  207. package/src/modules/sales/components/documents/AdjustmentDialog.tsx +27 -15
  208. package/src/modules/sales/components/documents/LineItemDialog.tsx +69 -51
  209. package/src/modules/sales/components/documents/SalesDocumentForm.tsx +98 -87
  210. package/src/modules/sales/widgets/dashboard/new-orders/widget.client.tsx +23 -12
  211. package/src/modules/sales/widgets/dashboard/new-quotes/widget.client.tsx +23 -12
  212. package/src/modules/shipping_carriers/lib/shipment-wizard/components/ConfigureStep.tsx +35 -19
  213. package/src/modules/staff/components/TeamMemberForm.tsx +23 -14
  214. package/src/modules/workflows/backend/tasks/[id]/page.tsx +51 -23
  215. package/src/modules/workflows/components/ActivitiesEditor.tsx +20 -10
  216. package/src/modules/workflows/components/DefinitionTriggersEditor.tsx +28 -18
  217. package/src/modules/workflows/components/EdgeEditDialog.tsx +51 -40
  218. package/src/modules/workflows/components/NodeEditDialog.tsx +81 -77
  219. package/src/modules/workflows/components/StepsEditor.tsx +20 -10
  220. package/src/modules/workflows/components/TransitionsEditor.tsx +61 -44
  221. package/src/modules/workflows/components/fields/ActivityArrayEditor.tsx +22 -12
  222. package/src/modules/workflows/components/fields/BusinessRuleConditionsEditor.tsx +9 -13
  223. package/src/modules/workflows/components/fields/FormFieldArrayEditor.tsx +27 -17
  224. package/src/modules/workflows/components/fields/StartPreConditionsEditor.tsx +9 -12
  225. package/src/modules/workflows/components/mobile/MobileTaskForm.tsx +19 -11
  226. package/src/modules/workflows/frontend/checkout-demo/page.tsx +71 -60
@@ -5,7 +5,14 @@ import { CrudForm, type CrudCustomFieldRenderProps, type CrudField, type CrudFor
5
5
  import { LookupSelect, type LookupSelectItem } from '@open-mercato/ui/backend/inputs'
6
6
  import { Input } from '@open-mercato/ui/primitives/input'
7
7
  import { Button } from '@open-mercato/ui/primitives/button'
8
- import { Switch } from '@open-mercato/ui/primitives/switch'
8
+ import {
9
+ Select,
10
+ SelectContent,
11
+ SelectItem,
12
+ SelectTrigger,
13
+ SelectValue,
14
+ } from '@open-mercato/ui/primitives/select'
15
+ import { SwitchField } from '@open-mercato/ui/primitives/switch-field'
9
16
  import {
10
17
  Dialog,
11
18
  DialogContent,
@@ -885,33 +892,37 @@ export function SalesDocumentForm({ onCreated, isSubmitting = false, initialKind
885
892
  : t('sales.documents.form.shipping.hint', 'Select an address or define a new one.')}
886
893
  </p>
887
894
  </div>
888
- <label className="flex items-center gap-2 text-sm">
889
- <Switch
890
- checked={useCustom}
891
- onCheckedChange={(checked) => updateValue('useCustomShipping', checked)}
892
- />
893
- <span>{t('sales.documents.form.shipping.custom', 'Define new address')}</span>
894
- </label>
895
+ <SwitchField
896
+ label={t('sales.documents.form.shipping.custom', 'Define new address')}
897
+ flip
898
+ checked={useCustom}
899
+ onCheckedChange={(checked) => updateValue('useCustomShipping', checked)}
900
+ />
895
901
  </div>
896
902
  {!useCustom ? (
897
- <select
898
- className="w-full rounded border px-2 py-2 text-sm"
899
- value={selectedId}
900
- onChange={(evt) => updateValue('shippingAddressId', evt.target.value || null)}
903
+ <Select
904
+ value={selectedId || undefined}
905
+ onValueChange={(value) => updateValue('shippingAddressId', value || null)}
901
906
  disabled={addressesLoading || customerRequired}
902
907
  >
903
- <option value="">
904
- {addressesLoading
905
- ? t('sales.documents.form.address.loading', 'Loading addresses…')
906
- : t('sales.documents.form.address.placeholder', 'Select address')}
907
- </option>
908
- {addressOptions.map((addr) => {
909
- const optionLabel = addr.summary ? `${addr.label} — ${addr.summary}` : addr.label
910
- return (
911
- <option key={addr.id} value={addr.id}>{optionLabel}</option>
912
- )
913
- })}
914
- </select>
908
+ <SelectTrigger>
909
+ <SelectValue
910
+ placeholder={
911
+ addressesLoading
912
+ ? t('sales.documents.form.address.loading', 'Loading addresses…')
913
+ : t('sales.documents.form.address.placeholder', 'Select address')
914
+ }
915
+ />
916
+ </SelectTrigger>
917
+ <SelectContent>
918
+ {addressOptions.map((addr) => {
919
+ const optionLabel = addr.summary ? `${addr.label} — ${addr.summary}` : addr.label
920
+ return (
921
+ <SelectItem key={addr.id} value={addr.id}>{optionLabel}</SelectItem>
922
+ )
923
+ })}
924
+ </SelectContent>
925
+ </Select>
915
926
  ) : null}
916
927
  {useCustom ? (
917
928
  <div className="space-y-3">
@@ -922,13 +933,13 @@ export function SalesDocumentForm({ onCreated, isSubmitting = false, initialKind
922
933
  onChange={(next) => updateValue('shippingAddressDraft', next)}
923
934
  hidePrimaryToggle
924
935
  />
925
- <label className="col-span-2 flex items-center gap-2 text-sm">
926
- <Switch
927
- checked={formValues.saveShippingAddress === true}
928
- onCheckedChange={(checked) => updateValue('saveShippingAddress', checked)}
929
- />
930
- {t('sales.documents.form.address.saveToCustomer', 'Save this address to the customer')}
931
- </label>
936
+ <SwitchField
937
+ containerClassName="col-span-2"
938
+ label={t('sales.documents.form.address.saveToCustomer', 'Save this address to the customer')}
939
+ flip
940
+ checked={formValues.saveShippingAddress === true}
941
+ onCheckedChange={(checked) => updateValue('saveShippingAddress', checked)}
942
+ />
932
943
  </div>
933
944
  ) : null}
934
945
  {addressesError && customerId ? (
@@ -1004,53 +1015,56 @@ export function SalesDocumentForm({ onCreated, isSubmitting = false, initialKind
1004
1015
  : t('sales.documents.form.billing.hint', 'Select an address or define a new one.')}
1005
1016
  </p>
1006
1017
  </div>
1007
- <label className="flex items-center gap-2 text-sm">
1008
- <Switch
1009
- checked={sameAsShipping}
1010
- onCheckedChange={(checked) => {
1011
- updateValue('sameAsShipping', checked)
1012
- if (checked) {
1013
- updateValue('useCustomBilling', useCustomShipping)
1014
- updateValue('billingAddressId', shippingId)
1015
- updateValue('billingAddressDraft', shippingDraft)
1016
- }
1017
- }}
1018
- />
1019
- <span>{t('sales.documents.form.address.sameAsShipping', 'Same as shipping')}</span>
1020
- </label>
1018
+ <SwitchField
1019
+ label={t('sales.documents.form.address.sameAsShipping', 'Same as shipping')}
1020
+ flip
1021
+ checked={sameAsShipping}
1022
+ onCheckedChange={(checked) => {
1023
+ updateValue('sameAsShipping', checked)
1024
+ if (checked) {
1025
+ updateValue('useCustomBilling', useCustomShipping)
1026
+ updateValue('billingAddressId', shippingId)
1027
+ updateValue('billingAddressDraft', shippingDraft)
1028
+ }
1029
+ }}
1030
+ />
1021
1031
  </div>
1022
1032
 
1023
1033
  {!sameAsShipping ? (
1024
1034
  <>
1025
1035
  {!useCustom ? (
1026
- <select
1027
- className="w-full rounded border px-2 py-2 text-sm"
1028
- value={selectedId}
1029
- onChange={(evt) => updateValue('billingAddressId', evt.target.value || null)}
1036
+ <Select
1037
+ value={selectedId || undefined}
1038
+ onValueChange={(value) => updateValue('billingAddressId', value || null)}
1030
1039
  disabled={addressesLoading || customerRequired}
1031
1040
  >
1032
- <option value="">
1033
- {addressesLoading
1034
- ? t('sales.documents.form.address.loading', 'Loading addresses…')
1035
- : t('sales.documents.form.address.placeholder', 'Select address')}
1036
- </option>
1037
- {addressOptions.map((addr) => {
1038
- const optionLabel = addr.summary ? `${addr.label} — ${addr.summary}` : addr.label
1039
- return (
1040
- <option key={addr.id} value={addr.id}>{optionLabel}</option>
1041
- )
1042
- })}
1043
- </select>
1041
+ <SelectTrigger>
1042
+ <SelectValue
1043
+ placeholder={
1044
+ addressesLoading
1045
+ ? t('sales.documents.form.address.loading', 'Loading addresses…')
1046
+ : t('sales.documents.form.address.placeholder', 'Select address')
1047
+ }
1048
+ />
1049
+ </SelectTrigger>
1050
+ <SelectContent>
1051
+ {addressOptions.map((addr) => {
1052
+ const optionLabel = addr.summary ? `${addr.label} — ${addr.summary}` : addr.label
1053
+ return (
1054
+ <SelectItem key={addr.id} value={addr.id}>{optionLabel}</SelectItem>
1055
+ )
1056
+ })}
1057
+ </SelectContent>
1058
+ </Select>
1044
1059
  ) : null}
1045
1060
 
1046
- <label className="flex items-center gap-2 text-sm">
1047
- <Switch
1048
- checked={useCustom}
1049
- onCheckedChange={(checked) => updateValue('useCustomBilling', checked)}
1050
- disabled={false}
1051
- />
1052
- <span>{t('sales.documents.form.shipping.custom', 'Define new address')}</span>
1053
- </label>
1061
+ <SwitchField
1062
+ label={t('sales.documents.form.shipping.custom', 'Define new address')}
1063
+ flip
1064
+ checked={useCustom}
1065
+ onCheckedChange={(checked) => updateValue('useCustomBilling', checked)}
1066
+ disabled={false}
1067
+ />
1054
1068
 
1055
1069
  {useCustom ? (
1056
1070
  <div className="space-y-3">
@@ -1061,13 +1075,13 @@ export function SalesDocumentForm({ onCreated, isSubmitting = false, initialKind
1061
1075
  onChange={(next) => updateValue('billingAddressDraft', next)}
1062
1076
  hidePrimaryToggle
1063
1077
  />
1064
- <label className="col-span-2 flex items-center gap-2 text-sm">
1065
- <Switch
1066
- checked={formValues.saveBillingAddress === true}
1067
- onCheckedChange={(checked) => updateValue('saveBillingAddress', checked)}
1068
- />
1069
- {t('sales.documents.form.address.saveToCustomer', 'Save this address to the customer')}
1070
- </label>
1078
+ <SwitchField
1079
+ containerClassName="col-span-2"
1080
+ label={t('sales.documents.form.address.saveToCustomer', 'Save this address to the customer')}
1081
+ flip
1082
+ checked={formValues.saveBillingAddress === true}
1083
+ onCheckedChange={(checked) => updateValue('saveBillingAddress', checked)}
1084
+ />
1071
1085
  </div>
1072
1086
  ) : null}
1073
1087
  </>
@@ -1208,17 +1222,14 @@ export function SalesDocumentForm({ onCreated, isSubmitting = false, initialKind
1208
1222
  />
1209
1223
  </div>
1210
1224
  <div className="space-y-2">
1211
- <div className="relative">
1212
- <Mail className="pointer-events-none absolute left-2 top-2.5 h-4 w-4 text-muted-foreground" />
1213
- <input
1214
- type="email"
1215
- className="w-full rounded border pl-8 pr-2 py-2 text-sm"
1216
- value={emailValue}
1217
- onChange={(event) => setValue('customerEmail', event.target.value)}
1218
- placeholder={t('sales.documents.form.email.placeholder', 'Email used for the document')}
1219
- spellCheck={false}
1220
- />
1221
- </div>
1225
+ <Input
1226
+ type="email"
1227
+ leftIcon={<Mail />}
1228
+ value={emailValue}
1229
+ onChange={(event) => setValue('customerEmail', event.target.value)}
1230
+ placeholder={t('sales.documents.form.email.placeholder', 'Email used for the document')}
1231
+ spellCheck={false}
1232
+ />
1222
1233
  {duplicate ? (
1223
1234
  <div className="flex items-center justify-between rounded border bg-muted px-3 py-2 text-xs text-muted-foreground">
1224
1235
  <span>
@@ -4,6 +4,14 @@ import * as React from 'react'
4
4
  import Link from 'next/link'
5
5
  import type { DashboardWidgetComponentProps } from '@open-mercato/shared/modules/dashboard/widgets'
6
6
  import { apiCall } from '@open-mercato/ui/backend/utils/apiCall'
7
+ import { Input } from '@open-mercato/ui/primitives/input'
8
+ import {
9
+ Select,
10
+ SelectContent,
11
+ SelectItem,
12
+ SelectTrigger,
13
+ SelectValue,
14
+ } from '@open-mercato/ui/primitives/select'
7
15
  import { Spinner } from '@open-mercato/ui/primitives/spinner'
8
16
  import { Badge } from '@open-mercato/ui/primitives/badge'
9
17
  import { formatRelativeTime } from '@open-mercato/shared/lib/time'
@@ -126,12 +134,12 @@ const SalesNewOrdersWidget: React.FC<DashboardWidgetComponentProps<SalesNewOrder
126
134
  <label htmlFor="sales-new-orders-page-size" className="text-xs font-semibold uppercase text-muted-foreground">
127
135
  {translate('sales.widgets.newOrders.settings.pageSize', 'Number of Orders')}
128
136
  </label>
129
- <input
137
+ <Input
130
138
  id="sales-new-orders-page-size"
131
139
  type="number"
132
140
  min={1}
133
141
  max={20}
134
- className="w-24 rounded-md border border-input bg-background px-2 py-1 text-sm text-foreground focus-visible:border-ring focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
142
+ className="w-24"
135
143
  value={hydrated.pageSize}
136
144
  onChange={(event) => {
137
145
  const next = Number(event.target.value)
@@ -146,19 +154,22 @@ const SalesNewOrdersWidget: React.FC<DashboardWidgetComponentProps<SalesNewOrder
146
154
  <label htmlFor="sales-new-orders-date-period" className="text-xs font-semibold uppercase text-muted-foreground">
147
155
  {translate('sales.widgets.newOrders.settings.datePeriod', 'Date Period')}
148
156
  </label>
149
- <select
150
- id="sales-new-orders-date-period"
157
+ <Select
151
158
  value={hydrated.datePeriod}
152
- onChange={(event) => {
153
- onSettingsChange?.({ ...hydrated, datePeriod: event.target.value as DatePeriodOption })
159
+ onValueChange={(value) => {
160
+ onSettingsChange?.({ ...hydrated, datePeriod: value as DatePeriodOption })
154
161
  }}
155
- className="w-full rounded-md border border-input bg-background px-2 py-1 text-sm text-foreground focus-visible:border-ring focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
156
162
  >
157
- <option value="last24h">{translate('sales.widgets.newOrders.settings.last24h', 'Last 24 hours')}</option>
158
- <option value="last7d">{translate('sales.widgets.newOrders.settings.last7d', 'Last 7 days')}</option>
159
- <option value="last30d">{translate('sales.widgets.newOrders.settings.last30d', 'Last 30 days')}</option>
160
- <option value="custom">{translate('sales.widgets.newOrders.settings.custom', 'Custom range')}</option>
161
- </select>
163
+ <SelectTrigger id="sales-new-orders-date-period" size="sm">
164
+ <SelectValue />
165
+ </SelectTrigger>
166
+ <SelectContent>
167
+ <SelectItem value="last24h">{translate('sales.widgets.newOrders.settings.last24h', 'Last 24 hours')}</SelectItem>
168
+ <SelectItem value="last7d">{translate('sales.widgets.newOrders.settings.last7d', 'Last 7 days')}</SelectItem>
169
+ <SelectItem value="last30d">{translate('sales.widgets.newOrders.settings.last30d', 'Last 30 days')}</SelectItem>
170
+ <SelectItem value="custom">{translate('sales.widgets.newOrders.settings.custom', 'Custom range')}</SelectItem>
171
+ </SelectContent>
172
+ </Select>
162
173
  </div>
163
174
 
164
175
  {hydrated.datePeriod === 'custom' ? (
@@ -4,6 +4,14 @@ import * as React from 'react'
4
4
  import Link from 'next/link'
5
5
  import type { DashboardWidgetComponentProps } from '@open-mercato/shared/modules/dashboard/widgets'
6
6
  import { apiCall } from '@open-mercato/ui/backend/utils/apiCall'
7
+ import { Input } from '@open-mercato/ui/primitives/input'
8
+ import {
9
+ Select,
10
+ SelectContent,
11
+ SelectItem,
12
+ SelectTrigger,
13
+ SelectValue,
14
+ } from '@open-mercato/ui/primitives/select'
7
15
  import { Spinner } from '@open-mercato/ui/primitives/spinner'
8
16
  import { Badge } from '@open-mercato/ui/primitives/badge'
9
17
  import { formatRelativeTime } from '@open-mercato/shared/lib/time'
@@ -132,12 +140,12 @@ const SalesNewQuotesWidget: React.FC<DashboardWidgetComponentProps<SalesNewQuote
132
140
  <label htmlFor="sales-new-quotes-page-size" className="text-xs font-semibold uppercase text-muted-foreground">
133
141
  {translate('sales.widgets.newQuotes.settings.pageSize', 'Number of Quotes')}
134
142
  </label>
135
- <input
143
+ <Input
136
144
  id="sales-new-quotes-page-size"
137
145
  type="number"
138
146
  min={1}
139
147
  max={20}
140
- className="w-24 rounded-md border border-input bg-background px-2 py-1 text-sm text-foreground focus-visible:border-ring focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
148
+ className="w-24"
141
149
  value={hydrated.pageSize}
142
150
  onChange={(event) => {
143
151
  const next = Number(event.target.value)
@@ -152,19 +160,22 @@ const SalesNewQuotesWidget: React.FC<DashboardWidgetComponentProps<SalesNewQuote
152
160
  <label htmlFor="sales-new-quotes-date-period" className="text-xs font-semibold uppercase text-muted-foreground">
153
161
  {translate('sales.widgets.newQuotes.settings.datePeriod', 'Date Period')}
154
162
  </label>
155
- <select
156
- id="sales-new-quotes-date-period"
163
+ <Select
157
164
  value={hydrated.datePeriod}
158
- onChange={(event) => {
159
- onSettingsChange?.({ ...hydrated, datePeriod: event.target.value as DatePeriodOption })
165
+ onValueChange={(value) => {
166
+ onSettingsChange?.({ ...hydrated, datePeriod: value as DatePeriodOption })
160
167
  }}
161
- className="w-full rounded-md border border-input bg-background px-2 py-1 text-sm text-foreground focus-visible:border-ring focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
162
168
  >
163
- <option value="last24h">{translate('sales.widgets.newQuotes.settings.last24h', 'Last 24 hours')}</option>
164
- <option value="last7d">{translate('sales.widgets.newQuotes.settings.last7d', 'Last 7 days')}</option>
165
- <option value="last30d">{translate('sales.widgets.newQuotes.settings.last30d', 'Last 30 days')}</option>
166
- <option value="custom">{translate('sales.widgets.newQuotes.settings.custom', 'Custom range')}</option>
167
- </select>
169
+ <SelectTrigger id="sales-new-quotes-date-period" size="sm">
170
+ <SelectValue />
171
+ </SelectTrigger>
172
+ <SelectContent>
173
+ <SelectItem value="last24h">{translate('sales.widgets.newQuotes.settings.last24h', 'Last 24 hours')}</SelectItem>
174
+ <SelectItem value="last7d">{translate('sales.widgets.newQuotes.settings.last7d', 'Last 7 days')}</SelectItem>
175
+ <SelectItem value="last30d">{translate('sales.widgets.newQuotes.settings.last30d', 'Last 30 days')}</SelectItem>
176
+ <SelectItem value="custom">{translate('sales.widgets.newQuotes.settings.custom', 'Custom range')}</SelectItem>
177
+ </SelectContent>
178
+ </Select>
168
179
  </div>
169
180
 
170
181
  {hydrated.datePeriod === 'custom' ? (
@@ -2,6 +2,14 @@
2
2
 
3
3
  import * as React from 'react'
4
4
  import { Button } from '@open-mercato/ui/primitives/button'
5
+ import { Input } from '@open-mercato/ui/primitives/input'
6
+ import {
7
+ Select,
8
+ SelectContent,
9
+ SelectItem,
10
+ SelectTrigger,
11
+ SelectValue,
12
+ } from '@open-mercato/ui/primitives/select'
5
13
  import { Spinner } from '@open-mercato/ui/primitives/spinner'
6
14
  import { Card, CardContent, CardHeader, CardTitle } from '@open-mercato/ui/primitives/card'
7
15
  import { useT } from '@open-mercato/shared/lib/i18n/context'
@@ -106,13 +114,14 @@ export const ConfigureStep = (props: ConfigureStepProps) => {
106
114
  <label className="text-xs font-medium text-muted-foreground">
107
115
  {t('shipping_carriers.create.field.phone', 'Phone')}
108
116
  </label>
109
- <input
110
- className={`w-full rounded border bg-background px-2 py-1.5 text-sm ${senderContactErrors.phone ? 'border-destructive' : ''}`}
117
+ <Input
111
118
  type="tel"
119
+ size="sm"
112
120
  value={senderContact.phone}
113
121
  onChange={(e) => onSenderContactChange({ ...senderContact, phone: e.target.value })}
114
122
  disabled={isFetchingRates}
115
123
  placeholder="e.g. 500000000"
124
+ aria-invalid={senderContactErrors.phone ? true : undefined}
116
125
  />
117
126
  {senderContactErrors.phone ? (
118
127
  <p className="text-xs text-destructive">{senderContactErrors.phone}</p>
@@ -122,13 +131,14 @@ export const ConfigureStep = (props: ConfigureStepProps) => {
122
131
  <label className="text-xs font-medium text-muted-foreground">
123
132
  {t('shipping_carriers.create.field.email', 'Email')}
124
133
  </label>
125
- <input
126
- className={`w-full rounded border bg-background px-2 py-1.5 text-sm ${senderContactErrors.email ? 'border-destructive' : ''}`}
134
+ <Input
127
135
  type="email"
136
+ size="sm"
128
137
  value={senderContact.email}
129
138
  onChange={(e) => onSenderContactChange({ ...senderContact, email: e.target.value })}
130
139
  disabled={isFetchingRates}
131
140
  placeholder="e.g. sender@example.com"
141
+ aria-invalid={senderContactErrors.email ? true : undefined}
132
142
  />
133
143
  {senderContactErrors.email ? (
134
144
  <p className="text-xs text-destructive">{senderContactErrors.email}</p>
@@ -150,13 +160,14 @@ export const ConfigureStep = (props: ConfigureStepProps) => {
150
160
  <label className="text-xs font-medium text-muted-foreground">
151
161
  {t('shipping_carriers.create.field.phone', 'Phone')}
152
162
  </label>
153
- <input
154
- className={`w-full rounded border bg-background px-2 py-1.5 text-sm ${receiverContactErrors.phone ? 'border-destructive' : ''}`}
163
+ <Input
155
164
  type="tel"
165
+ size="sm"
156
166
  value={receiverContact.phone}
157
167
  onChange={(e) => onReceiverContactChange({ ...receiverContact, phone: e.target.value })}
158
168
  disabled={isFetchingRates}
159
169
  placeholder="e.g. 500000000"
170
+ aria-invalid={receiverContactErrors.phone ? true : undefined}
160
171
  />
161
172
  {receiverContactErrors.phone ? (
162
173
  <p className="text-xs text-destructive">{receiverContactErrors.phone}</p>
@@ -166,13 +177,14 @@ export const ConfigureStep = (props: ConfigureStepProps) => {
166
177
  <label className="text-xs font-medium text-muted-foreground">
167
178
  {t('shipping_carriers.create.field.email', 'Email')}
168
179
  </label>
169
- <input
170
- className={`w-full rounded border bg-background px-2 py-1.5 text-sm ${receiverContactErrors.email ? 'border-destructive' : ''}`}
180
+ <Input
171
181
  type="email"
182
+ size="sm"
172
183
  value={receiverContact.email}
173
184
  onChange={(e) => onReceiverContactChange({ ...receiverContact, email: e.target.value })}
174
185
  disabled={isFetchingRates}
175
186
  placeholder="e.g. receiver@example.com"
187
+ aria-invalid={receiverContactErrors.email ? true : undefined}
176
188
  />
177
189
  {receiverContactErrors.email ? (
178
190
  <p className="text-xs text-destructive">{receiverContactErrors.email}</p>
@@ -194,17 +206,20 @@ export const ConfigureStep = (props: ConfigureStepProps) => {
194
206
  <label className="text-xs font-medium text-muted-foreground">
195
207
  {t('shipping_carriers.create.field.c2cSendingMethod', 'Sending method (applies to courier_c2c service only)')}
196
208
  </label>
197
- <select
198
- className="w-full rounded border bg-background px-2 py-1.5 text-sm"
199
- value={c2cSendingMethod}
200
- onChange={(e) => onC2cSendingMethodChange(e.target.value)}
209
+ <Select
210
+ value={c2cSendingMethod || undefined}
211
+ onValueChange={(value) => onC2cSendingMethodChange(value ?? '')}
201
212
  disabled={isFetchingRates}
202
213
  >
203
- <option value="">{t('shipping_carriers.create.c2cSendingMethod.default', 'Dispatch order (default)')}</option>
204
- <option value="parcel_locker">{t('shipping_carriers.create.c2cSendingMethod.parcel_locker', 'Parcel locker')}</option>
205
- <option value="pop">{t('shipping_carriers.create.c2cSendingMethod.pop', 'POP (parcel pickup point)')}</option>
206
- <option value="any_point">{t('shipping_carriers.create.c2cSendingMethod.any_point', 'Any point')}</option>
207
- </select>
214
+ <SelectTrigger size="sm">
215
+ <SelectValue placeholder={t('shipping_carriers.create.c2cSendingMethod.default', 'Dispatch order (default)')} />
216
+ </SelectTrigger>
217
+ <SelectContent>
218
+ <SelectItem value="parcel_locker">{t('shipping_carriers.create.c2cSendingMethod.parcel_locker', 'Parcel locker')}</SelectItem>
219
+ <SelectItem value="pop">{t('shipping_carriers.create.c2cSendingMethod.pop', 'POP (parcel pickup point)')}</SelectItem>
220
+ <SelectItem value="any_point">{t('shipping_carriers.create.c2cSendingMethod.any_point', 'Any point')}</SelectItem>
221
+ </SelectContent>
222
+ </Select>
208
223
  </div>
209
224
  </CardContent>
210
225
  </Card>
@@ -237,8 +252,9 @@ export const ConfigureStep = (props: ConfigureStepProps) => {
237
252
  )}
238
253
 
239
254
  <div className="flex gap-2">
240
- <input
241
- className="flex-1 rounded border bg-background px-2 py-1.5 text-sm"
255
+ <Input
256
+ size="sm"
257
+ className="flex-1"
242
258
  value={searchInput}
243
259
  onChange={(e) => setSearchInput(e.target.value)}
244
260
  onKeyDown={(e) => {
@@ -8,6 +8,13 @@ import { normalizeCustomFieldValues } from '@open-mercato/shared/lib/custom-fiel
8
8
  import { apiCall } from '@open-mercato/ui/backend/utils/apiCall'
9
9
  import { LookupSelect, type LookupSelectItem } from '@open-mercato/ui/backend/inputs'
10
10
  import { Button } from '@open-mercato/ui/primitives/button'
11
+ import {
12
+ Select,
13
+ SelectContent,
14
+ SelectItem,
15
+ SelectTrigger,
16
+ SelectValue,
17
+ } from '@open-mercato/ui/primitives/select'
11
18
  import { AttachmentsSection, TagsSection, type TagOption, type TagsSectionLabels } from '@open-mercato/ui/backend/detail'
12
19
  import { E } from '#generated/entities.ids.generated'
13
20
  import { useT } from '@open-mercato/shared/lib/i18n/context'
@@ -292,12 +299,11 @@ export function TeamMemberForm(props: TeamMemberFormProps) {
292
299
  {translate('staff.teamMembers.form.actions.createTeam', 'Create new team')}
293
300
  </Button>
294
301
  </div>
295
- <select
296
- className="w-full h-9 rounded border px-2 text-sm"
297
- value={currentValue}
298
- onChange={(event) => {
299
- const nextValue = event.target.value || undefined
300
- const nextTeamId = event.target.value || null
302
+ <Select
303
+ value={currentValue || undefined}
304
+ onValueChange={(value) => {
305
+ const nextValue = value || undefined
306
+ const nextTeamId = value || null
301
307
  setValue(nextValue)
302
308
  setSelectedTeamId(nextTeamId)
303
309
  if (!setFormValue) return
@@ -310,16 +316,19 @@ export function TeamMemberForm(props: TeamMemberFormProps) {
310
316
  setFormValue('roleIds', nextRoleIds)
311
317
  }
312
318
  }}
313
- data-crud-focus-target=""
314
319
  disabled={disabled}
315
320
  >
316
- <option value="">{translate('ui.forms.select.emptyOption', '—')}</option>
317
- {teamOptions.map((option) => (
318
- <option key={option.value} value={option.value}>
319
- {option.label}
320
- </option>
321
- ))}
322
- </select>
321
+ <SelectTrigger data-crud-focus-target="">
322
+ <SelectValue placeholder={translate('ui.forms.select.emptyOption', '—')} />
323
+ </SelectTrigger>
324
+ <SelectContent>
325
+ {teamOptions.map((option) => (
326
+ <SelectItem key={option.value} value={option.value}>
327
+ {option.label}
328
+ </SelectItem>
329
+ ))}
330
+ </SelectContent>
331
+ </Select>
323
332
  </div>
324
333
  )
325
334
  },