@open-mercato/core 0.5.1-develop.2953.6647bb2c43 → 0.5.1-develop.2964.d5ac4a6ebb

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
@@ -6,6 +6,13 @@ import { ScheduleView, type ScheduleItem, type ScheduleRange, type ScheduleSlot,
6
6
  import { Button } from '@open-mercato/ui/primitives/button'
7
7
  import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@open-mercato/ui/primitives/dialog'
8
8
  import { Input } from '@open-mercato/ui/primitives/input'
9
+ import {
10
+ Select,
11
+ SelectContent,
12
+ SelectItem,
13
+ SelectTrigger,
14
+ SelectValue,
15
+ } from '@open-mercato/ui/primitives/select'
9
16
  import { LoadingMessage, ErrorMessage } from '@open-mercato/ui/backend/detail'
10
17
  import { apiCall, apiCallOrThrow } from '@open-mercato/ui/backend/utils/apiCall'
11
18
  import { createCrud, deleteCrud, updateCrud } from '@open-mercato/ui/backend/utils/crud'
@@ -1308,22 +1315,24 @@ export function AvailabilityRulesEditor({
1308
1315
  {ruleSetsLoading ? (
1309
1316
  <span className="text-xs text-muted-foreground">{listLabels.ruleSetLoading}</span>
1310
1317
  ) : (
1311
- <select
1312
- className="h-9 rounded border bg-background px-2 text-sm"
1313
- value={rulesetId ?? ''}
1314
- onChange={(event) => {
1315
- const value = event.target.value
1318
+ <Select
1319
+ value={rulesetId || undefined}
1320
+ onValueChange={(value) => {
1316
1321
  void handleRuleSetChange(value ? value : null)
1317
1322
  }}
1318
1323
  disabled={isReadOnly}
1319
1324
  >
1320
- <option value="">{listLabels.ruleSetPlaceholder}</option>
1321
- {ruleSets.map((ruleSet) => (
1322
- <option key={ruleSet.id} value={ruleSet.id}>
1323
- {ruleSet.name}
1324
- </option>
1325
- ))}
1326
- </select>
1325
+ <SelectTrigger size="sm" className="w-auto min-w-[10rem]">
1326
+ <SelectValue placeholder={listLabels.ruleSetPlaceholder} />
1327
+ </SelectTrigger>
1328
+ <SelectContent>
1329
+ {ruleSets.map((ruleSet) => (
1330
+ <SelectItem key={ruleSet.id} value={ruleSet.id}>
1331
+ {ruleSet.name}
1332
+ </SelectItem>
1333
+ ))}
1334
+ </SelectContent>
1335
+ </Select>
1327
1336
  )}
1328
1337
  <Button type="button" variant="outline" size="sm" onClick={() => setCreateRuleSetOpen(true)} disabled={isReadOnly}>
1329
1338
  <Plus className="size-4 mr-2" aria-hidden />
@@ -1717,17 +1726,21 @@ export function AvailabilityRulesEditor({
1717
1726
  ) : (
1718
1727
  <div className="space-y-2">
1719
1728
  <label className="text-xs text-muted-foreground">{listLabels.applyScopeWeekday}</label>
1720
- <select
1721
- className="h-9 rounded border bg-background pl-2 pr-8 text-sm"
1729
+ <Select
1722
1730
  value={String(editorWeekday)}
1723
- onChange={(event) => setEditorWeekday(Number(event.target.value))}
1731
+ onValueChange={(value) => setEditorWeekday(Number(value))}
1724
1732
  >
1725
- {DAY_LABELS.map((day, index) => (
1726
- <option key={day.code} value={index}>
1727
- {t(day.nameKey, day.fallback)}
1728
- </option>
1729
- ))}
1730
- </select>
1733
+ <SelectTrigger size="sm" className="w-auto min-w-[8rem]">
1734
+ <SelectValue />
1735
+ </SelectTrigger>
1736
+ <SelectContent>
1737
+ {DAY_LABELS.map((day, index) => (
1738
+ <SelectItem key={day.code} value={String(index)}>
1739
+ {t(day.nameKey, day.fallback)}
1740
+ </SelectItem>
1741
+ ))}
1742
+ </SelectContent>
1743
+ </Select>
1731
1744
  </div>
1732
1745
  )}
1733
1746
 
@@ -7,6 +7,13 @@ import { DictionarySelectControl } from '@open-mercato/core/modules/dictionaries
7
7
  import { AppearanceSelector } from '@open-mercato/core/modules/dictionaries/components/AppearanceSelector'
8
8
  import { AttachmentsSection, TagsSection, type TagOption, type TagsSectionLabels } from '@open-mercato/ui/backend/detail'
9
9
  import { Button } from '@open-mercato/ui/primitives/button'
10
+ import {
11
+ Select,
12
+ SelectContent,
13
+ SelectItem,
14
+ SelectTrigger,
15
+ SelectValue,
16
+ } from '@open-mercato/ui/primitives/select'
10
17
  import { E } from '#generated/entities.ids.generated'
11
18
  import { useT } from '@open-mercato/shared/lib/i18n/context'
12
19
  import { useOrganizationScopeVersion } from '@open-mercato/shared/lib/frontend/useOrganizationScope'
@@ -132,26 +139,28 @@ export function useResourcesResourceFormConfig(options: {
132
139
  type: 'custom',
133
140
  component: ({ value, setValue, setFormValue, disabled }) => (
134
141
  <div className="flex items-center gap-2">
135
- <select
136
- className="h-9 w-full rounded border px-2 text-sm"
137
- value={typeof value === 'string' ? value : ''}
138
- onChange={(event) => {
139
- const next = event.target.value || ''
140
- setValue(next)
142
+ <Select
143
+ value={typeof value === 'string' && value ? value : undefined}
144
+ onValueChange={(next) => {
145
+ const value = next || ''
146
+ setValue(value)
141
147
  if (setFormValue) {
142
- setFormValue('customFieldsetCode', resolveFieldsetCode(next || null))
148
+ setFormValue('customFieldsetCode', resolveFieldsetCode(value || null))
143
149
  }
144
150
  }}
145
- data-crud-focus-target=""
146
151
  disabled={disabled}
147
152
  >
148
- <option value="">{t('ui.forms.select.emptyOption', '—')}</option>
149
- {resourceTypes.map((type) => (
150
- <option key={type.id} value={type.id}>
151
- {type.name}
152
- </option>
153
- ))}
154
- </select>
153
+ <SelectTrigger data-crud-focus-target="">
154
+ <SelectValue placeholder={t('ui.forms.select.emptyOption', '—')} />
155
+ </SelectTrigger>
156
+ <SelectContent>
157
+ {resourceTypes.map((type) => (
158
+ <SelectItem key={type.id} value={type.id}>
159
+ {type.name}
160
+ </SelectItem>
161
+ ))}
162
+ </SelectContent>
163
+ </Select>
155
164
  <Button
156
165
  asChild
157
166
  type="button"
@@ -1139,21 +1139,18 @@ function ContactEmailInlineEditor({
1139
1139
  }
1140
1140
  }}
1141
1141
  >
1142
- <div className="relative">
1143
- <Mail className="pointer-events-none absolute left-2 top-2.5 h-4 w-4 text-muted-foreground" />
1144
- <input
1145
- className="w-full rounded-md border pl-8 pr-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
1146
- value={draft}
1147
- onChange={(event) => {
1148
- if (error) setError(null)
1149
- setDraft(event.target.value)
1150
- }}
1151
- placeholder={placeholder}
1152
- type="email"
1153
- autoFocus
1154
- spellCheck={false}
1155
- />
1156
- </div>
1142
+ <Input
1143
+ leftIcon={<Mail />}
1144
+ value={draft}
1145
+ onChange={(event) => {
1146
+ if (error) setError(null)
1147
+ setDraft(event.target.value)
1148
+ }}
1149
+ placeholder={placeholder}
1150
+ type="email"
1151
+ autoFocus
1152
+ spellCheck={false}
1153
+ />
1157
1154
  {error ? <p className="text-xs text-destructive">{error}</p> : null}
1158
1155
  {!error && duplicate ? (
1159
1156
  <p className="text-xs text-muted-foreground">
@@ -1,6 +1,12 @@
1
1
  import { Input } from '@open-mercato/ui/primitives/input'
2
- import { Label } from '@open-mercato/ui/primitives/label'
3
- import { Switch } from '@open-mercato/ui/primitives/switch'
2
+ import {
3
+ Select,
4
+ SelectContent,
5
+ SelectItem,
6
+ SelectTrigger,
7
+ SelectValue,
8
+ } from '@open-mercato/ui/primitives/select'
9
+ import { SwitchField } from '@open-mercato/ui/primitives/switch-field'
4
10
  import { Textarea } from '@open-mercato/ui/primitives/textarea'
5
11
  import { isRecord } from '@open-mercato/shared/lib/utils'
6
12
  import type { ProviderSettingField } from '../lib/providers'
@@ -34,30 +40,33 @@ export function renderProviderFieldInput(opts: {
34
40
  )
35
41
  case 'boolean':
36
42
  return (
37
- <div className="flex items-center gap-2 py-1">
38
- <Switch
43
+ <div className="py-1">
44
+ <SwitchField
39
45
  id={field.key}
46
+ label={field.placeholder ?? ''}
47
+ flip
40
48
  checked={Boolean(value)}
41
49
  onCheckedChange={(checked) => onChange(checked)}
42
50
  />
43
- <Label htmlFor={field.key}>{field.placeholder ?? ''}</Label>
44
51
  </div>
45
52
  )
46
53
  case 'select':
47
54
  return (
48
- <select
49
- {...common}
50
- className="w-full rounded-md border border-input bg-background px-3 py-2 text-sm"
51
- value={typeof value === 'string' ? value : ''}
52
- onChange={(evt) => onChange(evt.target.value)}
55
+ <Select
56
+ value={typeof value === 'string' && value ? value : undefined}
57
+ onValueChange={(next) => onChange(next ?? '')}
53
58
  >
54
- <option value="">—</option>
55
- {(field.options ?? []).map((opt) => (
56
- <option key={opt.value} value={opt.value}>
57
- {opt.label}
58
- </option>
59
- ))}
60
- </select>
59
+ <SelectTrigger {...common}>
60
+ <SelectValue placeholder="—" />
61
+ </SelectTrigger>
62
+ <SelectContent>
63
+ {(field.options ?? []).map((opt) => (
64
+ <SelectItem key={opt.value} value={opt.value}>
65
+ {opt.label}
66
+ </SelectItem>
67
+ ))}
68
+ </SelectContent>
69
+ </Select>
61
70
  )
62
71
  case 'secret':
63
72
  return (
@@ -13,8 +13,15 @@ import {
13
13
  DialogTitle,
14
14
  } from '@open-mercato/ui/primitives/dialog'
15
15
  import { Input } from '@open-mercato/ui/primitives/input'
16
+ import {
17
+ Select,
18
+ SelectContent,
19
+ SelectItem,
20
+ SelectTrigger,
21
+ SelectValue,
22
+ } from '@open-mercato/ui/primitives/select'
16
23
  import { Label } from '@open-mercato/ui/primitives/label'
17
- import { Switch } from '@open-mercato/ui/primitives/switch'
24
+ import { SwitchField } from '@open-mercato/ui/primitives/switch-field'
18
25
  import { CrudForm, type CrudCustomFieldRenderProps, type CrudField } from '@open-mercato/ui/backend/CrudForm'
19
26
  import { flash } from '@open-mercato/ui/backend/FlashMessages'
20
27
  import { apiCall, readApiResultOrThrow } from '@open-mercato/ui/backend/utils/apiCall'
@@ -171,17 +178,21 @@ function FlatRateSettingsEditor(props: {
171
178
  <div className="grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3">
172
179
  <div className="space-y-1">
173
180
  <Label className="text-xs uppercase text-muted-foreground">{translations.metric}</Label>
174
- <select
175
- className="w-full rounded-md border border-input bg-background px-3 py-2 text-sm"
181
+ <Select
176
182
  value={rate.metric ?? 'item_count'}
177
- onChange={(evt) => updateRate(index, 'metric', evt.target.value)}
183
+ onValueChange={(value) => updateRate(index, 'metric', value)}
178
184
  >
179
- {metrics.map((opt) => (
180
- <option key={opt.value} value={opt.value}>
181
- {opt.label}
182
- </option>
183
- ))}
184
- </select>
185
+ <SelectTrigger>
186
+ <SelectValue />
187
+ </SelectTrigger>
188
+ <SelectContent>
189
+ {metrics.map((opt) => (
190
+ <SelectItem key={opt.value} value={opt.value}>
191
+ {opt.label}
192
+ </SelectItem>
193
+ ))}
194
+ </SelectContent>
195
+ </Select>
185
196
  </div>
186
197
  <div className="space-y-1">
187
198
  <Label className="text-xs uppercase text-muted-foreground">{translations.min}</Label>
@@ -239,16 +250,13 @@ function FlatRateSettingsEditor(props: {
239
250
  ))
240
251
  )}
241
252
  </div>
242
- <div className="flex items-center gap-2">
243
- <Switch
244
- id="apply-base-rate"
245
- checked={applyBaseRate}
246
- onCheckedChange={(checked) => onChange({ ...value, applyBaseRate: checked })}
247
- />
248
- <Label htmlFor="apply-base-rate" className="text-sm">
249
- {translations.applyBaseRate}
250
- </Label>
251
- </div>
253
+ <SwitchField
254
+ id="apply-base-rate"
255
+ label={translations.applyBaseRate}
256
+ flip
257
+ checked={applyBaseRate}
258
+ onCheckedChange={(checked) => onChange({ ...value, applyBaseRate: checked })}
259
+ />
252
260
  </div>
253
261
  )
254
262
  }
@@ -10,6 +10,14 @@ import { createCrudFormError, type CrudServerFieldErrors } from '@open-mercato/u
10
10
  import { readApiResultOrThrow, apiCall } from '@open-mercato/ui/backend/utils/apiCall'
11
11
  import { flash } from '@open-mercato/ui/backend/FlashMessages'
12
12
  import { Button } from '@open-mercato/ui/primitives/button'
13
+ import { Input } from '@open-mercato/ui/primitives/input'
14
+ import {
15
+ Select,
16
+ SelectContent,
17
+ SelectItem,
18
+ SelectTrigger,
19
+ SelectValue,
20
+ } from '@open-mercato/ui/primitives/select'
13
21
  import { Loader2, Search, Image as ImageIcon, Trash2 } from 'lucide-react'
14
22
  import { useT } from '@open-mercato/shared/lib/i18n/context'
15
23
  import { E } from '#generated/entities.ids.generated'
@@ -933,18 +941,18 @@ function ChannelSelectInput({
933
941
  )
934
942
  }
935
943
  return (
936
- <select
937
- className="w-full rounded border px-2 py-2 text-sm"
938
- value={value ?? ''}
939
- onChange={(event) => onChange(event.target.value || null)}
940
- >
941
- <option value="">{t('sales.channels.offers.form.channelPlaceholder', 'Select channel')}</option>
942
- {options.map((opt) => (
943
- <option key={opt.id} value={opt.id}>
944
- {opt.code ? `${opt.name} (${opt.code})` : opt.name}
945
- </option>
946
- ))}
947
- </select>
944
+ <Select value={value || undefined} onValueChange={(next) => onChange(next || null)}>
945
+ <SelectTrigger>
946
+ <SelectValue placeholder={t('sales.channels.offers.form.channelPlaceholder', 'Select channel')} />
947
+ </SelectTrigger>
948
+ <SelectContent>
949
+ {options.map((opt) => (
950
+ <SelectItem key={opt.id} value={opt.id}>
951
+ {opt.code ? `${opt.name} (${opt.code})` : opt.name}
952
+ </SelectItem>
953
+ ))}
954
+ </SelectContent>
955
+ </Select>
948
956
  )
949
957
  }
950
958
 
@@ -1027,19 +1035,16 @@ function ProductSelectInput({
1027
1035
 
1028
1036
  return (
1029
1037
  <div className="space-y-3">
1030
- <div className="relative">
1031
- <Search className="pointer-events-none absolute left-2 top-2.5 h-4 w-4 text-muted-foreground" />
1032
- <input
1033
- className="w-full rounded border pl-8 pr-2 py-2 text-sm"
1034
- value={query}
1035
- onChange={(event) => {
1036
- setQuery(event.target.value)
1037
- setHasTyped(true)
1038
- }}
1039
- onKeyDown={handleKeyDown}
1040
- placeholder={t('sales.channels.offers.form.productSearchPlaceholder', 'Search by title, SKU, or ID…')}
1041
- />
1042
- </div>
1038
+ <Input
1039
+ leftIcon={<Search />}
1040
+ value={query}
1041
+ onChange={(event) => {
1042
+ setQuery(event.target.value)
1043
+ setHasTyped(true)
1044
+ }}
1045
+ onKeyDown={handleKeyDown}
1046
+ placeholder={t('sales.channels.offers.form.productSearchPlaceholder', 'Search by title, SKU, or ID…')}
1047
+ />
1043
1048
  {selectedHint ? (
1044
1049
  <div className="rounded border bg-muted px-3 py-2 text-xs text-muted-foreground">
1045
1050
  {selectedHint}
@@ -1819,11 +1824,10 @@ function PriceOverridesEditor({
1819
1824
  <div className="space-y-2">
1820
1825
  {values.map((row) => (
1821
1826
  <div key={row.tempId} className="grid gap-2 rounded border p-3 md:grid-cols-3">
1822
- <select
1823
- className="rounded border px-2 py-2 text-sm"
1824
- value={row.priceKindId ?? ''}
1825
- onChange={(event) => {
1826
- const next = priceKinds.find((kind) => kind.id === event.target.value)
1827
+ <Select
1828
+ value={row.priceKindId || undefined}
1829
+ onValueChange={(value) => {
1830
+ const next = priceKinds.find((kind) => kind.id === value)
1827
1831
  updateRow(row.tempId, {
1828
1832
  priceKindId: next?.id ?? null,
1829
1833
  priceKindCode: next?.code ?? next?.title ?? null,
@@ -1832,28 +1836,29 @@ function PriceOverridesEditor({
1832
1836
  })
1833
1837
  }}
1834
1838
  >
1835
- <option value="">{t('sales.channels.offers.pricing.selectKind', 'Select price kind')}</option>
1836
- {priceKinds.map((kind) => (
1837
- <option
1838
- key={kind.id}
1839
- value={kind.id}
1840
- disabled={usedKindIdSet.has(kind.id) && row.priceKindId !== kind.id}
1841
- >
1842
- {kind.title ?? kind.code ?? kind.id}
1843
- </option>
1844
- ))}
1845
- </select>
1839
+ <SelectTrigger>
1840
+ <SelectValue placeholder={t('sales.channels.offers.pricing.selectKind', 'Select price kind')} />
1841
+ </SelectTrigger>
1842
+ <SelectContent>
1843
+ {priceKinds.map((kind) => (
1844
+ <SelectItem
1845
+ key={kind.id}
1846
+ value={kind.id}
1847
+ disabled={usedKindIdSet.has(kind.id) && row.priceKindId !== kind.id}
1848
+ >
1849
+ {kind.title ?? kind.code ?? kind.id}
1850
+ </SelectItem>
1851
+ ))}
1852
+ </SelectContent>
1853
+ </Select>
1846
1854
  <div className="relative">
1847
1855
  {(row.currencyCode ?? basePrice?.currencyCode) ? (
1848
1856
  <span className="pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-xs font-semibold text-muted-foreground">
1849
1857
  {row.currencyCode ?? basePrice?.currencyCode}
1850
1858
  </span>
1851
1859
  ) : null}
1852
- <input
1853
- className={cn(
1854
- 'w-full rounded border py-2 text-sm',
1855
- row.currencyCode || basePrice?.currencyCode ? 'pl-16 pr-2' : 'px-2',
1856
- )}
1860
+ <Input
1861
+ inputClassName={cn(row.currencyCode || basePrice?.currencyCode ? 'pl-13' : '')}
1857
1862
  type="number"
1858
1863
  placeholder={t('sales.channels.offers.pricing.amount', 'Amount')}
1859
1864
  value={row.amount ?? ''}