@medusajs/dashboard 2.12.3-preview-20251217123836 → 2.12.3-snapshot-20251216185234

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 (126) hide show
  1. package/dist/{api-key-management-detail-FRUN2KFK.mjs → api-key-management-detail-6RCDH73M.mjs} +1 -1
  2. package/dist/app.css +0 -19
  3. package/dist/app.js +679 -795
  4. package/dist/app.mjs +2 -2
  5. package/dist/{campaign-detail-HM3GQJLQ.mjs → campaign-detail-5Q4BYCPX.mjs} +1 -1
  6. package/dist/{categories-metadata-WKL3MGD7.mjs → categories-metadata-J7M3XWI7.mjs} +1 -1
  7. package/dist/{category-detail-UTWWDKFP.mjs → category-detail-S5IPXMHX.mjs} +2 -2
  8. package/dist/{category-products-XXBTCXFF.mjs → category-products-KPW6BA5J.mjs} +2 -2
  9. package/dist/{chunk-UMCJYHAD.mjs → chunk-CVHJAKLQ.mjs} +1 -1
  10. package/dist/{chunk-KSDXSKJ7.mjs → chunk-DBXWB3RF.mjs} +1 -1
  11. package/dist/{chunk-GLBHPDR4.mjs → chunk-GRZSG4EP.mjs} +16 -21
  12. package/dist/{chunk-FKNW5MLZ.mjs → chunk-LZFWCKOF.mjs} +4 -21
  13. package/dist/{chunk-5ISRTMYH.mjs → chunk-MJDHVDOW.mjs} +1 -1
  14. package/dist/{chunk-5F427YCP.mjs → chunk-OL24RDYM.mjs} +2 -2
  15. package/dist/{chunk-VFF5WB7C.mjs → chunk-OL6MEUKW.mjs} +104 -108
  16. package/dist/{chunk-OK6NZN2A.mjs → chunk-PHLCT2HA.mjs} +1 -1
  17. package/dist/{chunk-DQUXK4WW.mjs → chunk-ST4P6BQN.mjs} +1 -1
  18. package/dist/{chunk-HNJ65IND.mjs → chunk-WYATCUOM.mjs} +1 -1
  19. package/dist/{chunk-DTCIBQO2.mjs → chunk-YYOPBKME.mjs} +1 -1
  20. package/dist/{chunk-SG2JZPTG.mjs → chunk-ZMG5B4FG.mjs} +1 -1
  21. package/dist/{collection-add-products-42F7H77E.mjs → collection-add-products-FU2BS3D3.mjs} +2 -2
  22. package/dist/{collection-detail-PXIS3G64.mjs → collection-detail-VJE7XHLV.mjs} +2 -2
  23. package/dist/{collection-list-O74CGY24.mjs → collection-list-IGA6SCNF.mjs} +2 -2
  24. package/dist/{collection-metadata-U6FMA4IC.mjs → collection-metadata-QK7MI3D2.mjs} +1 -1
  25. package/dist/{customer-detail-OMTFJ6CE.mjs → customer-detail-MOV2T3LF.mjs} +1 -1
  26. package/dist/{customer-group-detail-ADK3M5LG.mjs → customer-group-detail-6T7OXGQD.mjs} +1 -1
  27. package/dist/{customer-group-list-7ZRQ2HWU.mjs → customer-group-list-AJEAF5D2.mjs} +1 -1
  28. package/dist/{customers-add-customer-group-5U27WHJB.mjs → customers-add-customer-group-QVTVSQYM.mjs} +1 -1
  29. package/dist/{edit-rules-BM2ERGVJ.mjs → edit-rules-SMVRTCUP.mjs} +1 -1
  30. package/dist/en.json +1 -1
  31. package/dist/{inventory-create-7MA7B5N2.mjs → inventory-create-BK52VALF.mjs} +2 -2
  32. package/dist/{inventory-detail-B4PRHZK3.mjs → inventory-detail-ZPSEMYI2.mjs} +1 -1
  33. package/dist/{inventory-metadata-C7MJ3GY5.mjs → inventory-metadata-FNEJ3RAT.mjs} +1 -1
  34. package/dist/{inventory-stock-WVTYPJTX.mjs → inventory-stock-6WYWLWJ7.mjs} +3 -3
  35. package/dist/{location-detail-KO6EBDK5.mjs → location-detail-N3GUZSY7.mjs} +1 -1
  36. package/dist/{location-fulfillment-providers-IORBE3E3.mjs → location-fulfillment-providers-7ZUJAGNY.mjs} +2 -2
  37. package/dist/{location-service-zone-shipping-option-create-2R3ZFLVK.mjs → location-service-zone-shipping-option-create-CNRWYZQC.mjs} +3 -3
  38. package/dist/{location-service-zone-shipping-option-pricing-5HN2Z5RB.mjs → location-service-zone-shipping-option-pricing-OGWI7VPT.mjs} +2 -2
  39. package/dist/{login-XKB6OR7I.mjs → login-VNOLI5YG.mjs} +1 -1
  40. package/dist/{order-create-claim-NKCOGF4A.mjs → order-create-claim-SCDJGM46.mjs} +1 -1
  41. package/dist/{order-create-edit-UNQYXGLL.mjs → order-create-edit-2WALBPXS.mjs} +1 -1
  42. package/dist/{order-create-exchange-WI7OA2WO.mjs → order-create-exchange-LQU4YN7F.mjs} +1 -1
  43. package/dist/{order-create-fulfillment-2LJTEWDY.mjs → order-create-fulfillment-OWUVTZXW.mjs} +1 -1
  44. package/dist/{order-create-refund-7K6UJXGP.mjs → order-create-refund-Q6HQY42R.mjs} +1 -1
  45. package/dist/{order-create-shipment-ZTDLLUBY.mjs → order-create-shipment-WAGGEPRW.mjs} +1 -1
  46. package/dist/{order-detail-JTRUMRLO.mjs → order-detail-PVPGEWGY.mjs} +1 -1
  47. package/dist/{order-edit-billing-address-YHYNVLOE.mjs → order-edit-billing-address-UM76J4KX.mjs} +1 -1
  48. package/dist/{order-edit-email-TCQPEVZY.mjs → order-edit-email-CL3KNOCM.mjs} +1 -1
  49. package/dist/{order-edit-shipping-address-CFSYQLKD.mjs → order-edit-shipping-address-PIESTGVL.mjs} +1 -1
  50. package/dist/{order-export-G4SBNEJ7.mjs → order-export-LE363ZLB.mjs} +1 -1
  51. package/dist/{order-metadata-KGPB37VL.mjs → order-metadata-FHBB7MTG.mjs} +1 -1
  52. package/dist/{order-receive-return-JER24SEV.mjs → order-receive-return-PRVKP6J2.mjs} +1 -1
  53. package/dist/{order-request-transfer-3FBUYZNT.mjs → order-request-transfer-XSAGRUMT.mjs} +1 -1
  54. package/dist/{price-list-create-CXZCFFTP.mjs → price-list-create-K5JEZT57.mjs} +4 -4
  55. package/dist/{price-list-detail-XOMU6U5J.mjs → price-list-detail-Q5VG5VGW.mjs} +2 -2
  56. package/dist/{price-list-prices-add-SDX5CQME.mjs → price-list-prices-add-2MQ226U4.mjs} +4 -4
  57. package/dist/{price-list-prices-edit-EKB6NI5D.mjs → price-list-prices-edit-OJZLV7OS.mjs} +2 -2
  58. package/dist/{product-attributes-MXDPSOWM.mjs → product-attributes-YF4TZOIO.mjs} +2 -2
  59. package/dist/{product-create-3O34JJLS.mjs → product-create-KJML2332.mjs} +3 -3
  60. package/dist/{product-create-variant-OTJKT6WI.mjs → product-create-variant-5EBCLM54.mjs} +2 -2
  61. package/dist/{product-detail-SYTLG5D3.mjs → product-detail-QG72542C.mjs} +2 -2
  62. package/dist/{product-edit-W72S22NM.mjs → product-edit-DZZR775Q.mjs} +2 -2
  63. package/dist/{product-export-57UUAGXF.mjs → product-export-5AD7NELI.mjs} +2 -2
  64. package/dist/{product-image-variants-edit-2BW5BJON.mjs → product-image-variants-edit-M6QF2RLE.mjs} +1 -1
  65. package/dist/{product-import-6EM4VUXP.mjs → product-import-V3KQN4TV.mjs} +1 -1
  66. package/dist/{product-list-5V5GEH5K.mjs → product-list-EUWZIFTM.mjs} +2 -2
  67. package/dist/{product-metadata-JZLHBLZQ.mjs → product-metadata-GL2MVPDI.mjs} +1 -1
  68. package/dist/{product-organization-SVXTCWIF.mjs → product-organization-O7RHELMQ.mjs} +2 -2
  69. package/dist/{product-prices-5ZL2RP7A.mjs → product-prices-YWV6MSM6.mjs} +1 -1
  70. package/dist/{product-stock-SJJABF6I.mjs → product-stock-AKEFMK5O.mjs} +3 -3
  71. package/dist/{product-tag-create-XXO4AQEC.mjs → product-tag-create-PQMDDKWH.mjs} +1 -1
  72. package/dist/{product-tag-detail-BSK64HXL.mjs → product-tag-detail-I3MBZX7U.mjs} +3 -3
  73. package/dist/{product-tag-edit-ENCGDT7E.mjs → product-tag-edit-K3BBQLJR.mjs} +1 -1
  74. package/dist/{product-tag-list-SLQGCNDZ.mjs → product-tag-list-JUWSOMB7.mjs} +3 -3
  75. package/dist/{product-tag-metadata-EPXHMU2K.mjs → product-tag-metadata-MJH5LH7E.mjs} +1 -1
  76. package/dist/{product-type-detail-4CRRU7YK.mjs → product-type-detail-RKHT5NBL.mjs} +2 -2
  77. package/dist/{product-type-metadata-73OKOGPP.mjs → product-type-metadata-CDJDFFGQ.mjs} +1 -1
  78. package/dist/{product-variant-detail-RPHLG4HU.mjs → product-variant-detail-XAYG5CKE.mjs} +1 -1
  79. package/dist/{product-variant-edit-JF7NN64Y.mjs → product-variant-edit-DEZEY2H2.mjs} +1 -1
  80. package/dist/{product-variant-metadata-HU2CXGPO.mjs → product-variant-metadata-VTZDNWUT.mjs} +1 -1
  81. package/dist/{promotion-create-BHA3FQG2.mjs → promotion-create-HWFNUQXG.mjs} +1 -1
  82. package/dist/{promotion-detail-F3QSR52W.mjs → promotion-detail-QC36KXB3.mjs} +1 -1
  83. package/dist/{refund-reason-create-ZA5TKW2Z.mjs → refund-reason-create-YHCDEHGQ.mjs} +1 -1
  84. package/dist/{refund-reason-edit-N2CRCLKZ.mjs → refund-reason-edit-CZ5QZ2SZ.mjs} +1 -1
  85. package/dist/{refund-reason-list-SE4TMGMT.mjs → refund-reason-list-OJYYEYJE.mjs} +1 -1
  86. package/dist/{region-metadata-O5NZBWXP.mjs → region-metadata-H6XXUQ4S.mjs} +1 -1
  87. package/dist/{reservation-detail-UFK6XIXE.mjs → reservation-detail-LZAQL4XA.mjs} +1 -1
  88. package/dist/{reservation-metadata-AEJEKGLV.mjs → reservation-metadata-5HZSDDOK.mjs} +1 -1
  89. package/dist/{sales-channel-add-products-2LMB7EF5.mjs → sales-channel-add-products-F7YV4MO5.mjs} +2 -2
  90. package/dist/{sales-channel-detail-EUQ4STQI.mjs → sales-channel-detail-MXIPZCGA.mjs} +2 -2
  91. package/dist/{sales-channel-list-JXKGHX4G.mjs → sales-channel-list-RLGL7FM3.mjs} +1 -1
  92. package/dist/{sales-channel-metadata-AJMQ5SQ2.mjs → sales-channel-metadata-M364R4RJ.mjs} +1 -1
  93. package/dist/{shipping-option-type-create-YVVIA2XC.mjs → shipping-option-type-create-C5WUWON7.mjs} +1 -1
  94. package/dist/{shipping-option-type-detail-ZZW36XLK.mjs → shipping-option-type-detail-PENS2K73.mjs} +2 -2
  95. package/dist/{shipping-option-type-edit-O6F74T3A.mjs → shipping-option-type-edit-CIU5EHRP.mjs} +1 -1
  96. package/dist/{shipping-option-type-list-SPTE7MT6.mjs → shipping-option-type-list-DIOX7VG7.mjs} +2 -2
  97. package/dist/{shipping-profile-metadata-7WFE55VG.mjs → shipping-profile-metadata-75G2NNMA.mjs} +1 -1
  98. package/dist/{chunk-IKTGFXWR.mjs → store-add-locales-VJ4RJ7UI.mjs} +67 -2
  99. package/dist/{store-detail-YLJLBBZE.mjs → store-detail-JSNPOB2F.mjs} +1 -1
  100. package/dist/{store-metadata-BZ57I2E6.mjs → store-metadata-CYXTVJUE.mjs} +1 -1
  101. package/dist/{tax-region-create-FGTV7VJL.mjs → tax-region-create-DWGL4EUT.mjs} +1 -1
  102. package/dist/{tax-region-detail-PPIMD7OX.mjs → tax-region-detail-2AE2EFI3.mjs} +5 -5
  103. package/dist/{tax-region-edit-ELZKA7YH.mjs → tax-region-edit-EEVEEU2Q.mjs} +1 -1
  104. package/dist/{tax-region-province-detail-FV2NDT3E.mjs → tax-region-province-detail-4ERSEQFF.mjs} +5 -5
  105. package/dist/{tax-region-tax-override-create-N572MQPZ.mjs → tax-region-tax-override-create-PHCGEF7V.mjs} +3 -3
  106. package/dist/{tax-region-tax-override-edit-5DCSJW6D.mjs → tax-region-tax-override-edit-SMRPSILC.mjs} +4 -4
  107. package/dist/{translation-list-FK7XYLHX.mjs → translation-list-UF7FLXOW.mjs} +141 -227
  108. package/dist/{translations-edit-VRXZI5KW.mjs → translations-edit-USQJNMAY.mjs} +253 -224
  109. package/dist/{user-metadata-GRJZZ524.mjs → user-metadata-2WPJOEJA.mjs} +1 -1
  110. package/dist/{workflow-execution-detail-HXTFWGKG.mjs → workflow-execution-detail-H2AKEZJX.mjs} +1 -1
  111. package/package.json +9 -9
  112. package/src/components/data-grid/hooks/use-data-grid-cell.tsx +0 -1
  113. package/src/components/data-grid/hooks/use-data-grid-form-handlers.tsx +0 -1
  114. package/src/components/data-grid/hooks/use-data-grid-keydown-event.tsx +4 -22
  115. package/src/dashboard-app/routes/get-route.map.tsx +0 -4
  116. package/src/hooks/api/translations.tsx +17 -26
  117. package/src/i18n/translations/en.json +1 -1
  118. package/src/i18n/translations/es.json +1 -1
  119. package/src/routes/translations/translation-list/components/active-locales-section/active-locales-section.tsx +17 -42
  120. package/src/routes/translations/translation-list/components/translation-list-section/translation-list-section.tsx +1 -5
  121. package/src/routes/translations/translation-list/components/translations-completion-section/translations-completion-section.tsx +121 -182
  122. package/src/routes/translations/translations-edit/components/translations-edit-form/translations-edit-form.tsx +330 -285
  123. package/dist/add-locales-GGNZCABB.mjs +0 -81
  124. package/dist/store-add-locales-GWCGIXHU.mjs +0 -81
  125. package/src/routes/translations/add-locales/add-locales.tsx +0 -29
  126. package/src/routes/translations/add-locales/index.tsx +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medusajs/dashboard",
3
- "version": "2.12.3-preview-20251217123836",
3
+ "version": "2.12.3-snapshot-20251216185234",
4
4
  "scripts": {
5
5
  "generate:static": "node ./scripts/generate-currencies.js && prettier --write ./src/lib/currencies.ts",
6
6
  "dev": "../../../node_modules/.bin/vite",
@@ -46,10 +46,10 @@
46
46
  "@dnd-kit/utilities": "^3.2.2",
47
47
  "@hookform/error-message": "^2.0.1",
48
48
  "@hookform/resolvers": "3.4.2",
49
- "@medusajs/admin-shared": "2.12.3-preview-20251217123836",
50
- "@medusajs/icons": "2.12.3-preview-20251217123836",
51
- "@medusajs/js-sdk": "2.12.3-preview-20251217123836",
52
- "@medusajs/ui": "4.0.31-preview-20251217123836",
49
+ "@medusajs/admin-shared": "2.12.3-snapshot-20251216185234",
50
+ "@medusajs/icons": "2.12.3-snapshot-20251216185234",
51
+ "@medusajs/js-sdk": "2.12.3-snapshot-20251216185234",
52
+ "@medusajs/ui": "4.0.31-snapshot-20251216185234",
53
53
  "@radix-ui/react-dialog": "1.1.4",
54
54
  "@radix-ui/react-dismissable-layer": "1.1.4",
55
55
  "@tanstack/react-query": "5.64.2",
@@ -80,10 +80,10 @@
80
80
  "zod": "3.25.76"
81
81
  },
82
82
  "devDependencies": {
83
- "@medusajs/admin-shared": "2.12.3-preview-20251217123836",
84
- "@medusajs/admin-vite-plugin": "2.12.3-preview-20251217123836",
85
- "@medusajs/types": "2.12.3-preview-20251217123836",
86
- "@medusajs/ui-preset": "2.12.3-preview-20251217123836"
83
+ "@medusajs/admin-shared": "2.12.3-snapshot-20251216185234",
84
+ "@medusajs/admin-vite-plugin": "2.12.3-snapshot-20251216185234",
85
+ "@medusajs/types": "2.12.3-snapshot-20251216185234",
86
+ "@medusajs/ui-preset": "2.12.3-snapshot-20251216185234"
87
87
  },
88
88
  "packageManager": "yarn@3.2.1"
89
89
  }
@@ -128,7 +128,6 @@ export const useDataGridCell = <TData, TValue>({
128
128
  case "number":
129
129
  return numberCharacterRegex.test(key)
130
130
  case "text":
131
- case "multiline-text":
132
131
  return textCharacterRegex.test(key)
133
132
  default:
134
133
  // KeyboardEvents should not be forwareded to other types of cells
@@ -228,7 +228,6 @@ export function convertArrayToPrimitive(
228
228
  case "boolean":
229
229
  return values.map(convertToBoolean)
230
230
  case "text":
231
- case "multiline-text":
232
231
  return values.map(covertToString)
233
232
  default:
234
233
  throw new Error(`Unsupported target type "${type}".`)
@@ -211,22 +211,7 @@ export const useDataGridKeydownEvent = <
211
211
  [rangeEnd, matrix, getSelectionValues, setSelectionValues, execute]
212
212
  )
213
213
 
214
- const handleSpaceKeyText = useCallback(
215
- (anchor: DataGridCoordinates) => {
216
- const field = matrix.getCellField(anchor)
217
- const input = queryTool?.getInput(anchor)
218
-
219
- if (!field || !input) {
220
- return
221
- }
222
-
223
- createSnapshot(anchor)
224
- input.focus()
225
- },
226
- [matrix, queryTool, createSnapshot]
227
- )
228
-
229
- const handleSpaceKeyNumber = useCallback(
214
+ const handleSpaceKeyTextOrNumber = useCallback(
230
215
  (anchor: DataGridCoordinates) => {
231
216
  const field = matrix.getCellField(anchor)
232
217
  const input = queryTool?.getInput(anchor)
@@ -318,12 +303,10 @@ export const useDataGridKeydownEvent = <
318
303
  case "togglable-number":
319
304
  handleSpaceKeyTogglableNumber(anchor)
320
305
  break
306
+ case "number":
321
307
  case "text":
322
308
  case "multiline-text":
323
- handleSpaceKeyText(anchor)
324
- break
325
- case "number":
326
- handleSpaceKeyNumber(anchor)
309
+ handleSpaceKeyTextOrNumber(anchor)
327
310
  break
328
311
  }
329
312
  },
@@ -332,8 +315,7 @@ export const useDataGridKeydownEvent = <
332
315
  isEditing,
333
316
  matrix,
334
317
  handleSpaceKeyBoolean,
335
- handleSpaceKeyText,
336
- handleSpaceKeyNumber,
318
+ handleSpaceKeyTextOrNumber,
337
319
  handleSpaceKeyTogglableNumber,
338
320
  ]
339
321
  )
@@ -1857,10 +1857,6 @@ export function getRouteMap({
1857
1857
  lazy: () =>
1858
1858
  import("../../routes/translations/translations-edit"),
1859
1859
  },
1860
- {
1861
- path: "add-locales",
1862
- lazy: () => import("../../routes/translations/add-locales"),
1863
- },
1864
1860
  ],
1865
1861
  },
1866
1862
  ...(settingsRoutes?.[0]?.children || []),
@@ -229,15 +229,6 @@ export const useTranslations = (
229
229
  return { ...data, ...rest }
230
230
  }
231
231
 
232
- const referenceInvalidationKeysMap = new Map<string, QueryKey>([
233
- ["product", productsQueryKeys.lists()],
234
- ["product_variant", productVariantQueryKeys.lists()],
235
- ["product_category", categoriesQueryKeys.lists()],
236
- ["product_collection", collectionsQueryKeys.lists()],
237
- ["product_type", productTypesQueryKeys.lists()],
238
- ["product_tag", productTagsQueryKeys.lists()],
239
- ])
240
-
241
232
  export const useBatchTranslations = (
242
233
  reference: string,
243
234
  options?: UseMutationOptions<
@@ -246,30 +237,30 @@ export const useBatchTranslations = (
246
237
  HttpTypes.AdminBatchTranslations
247
238
  >
248
239
  ) => {
249
- const mutation = useMutation({
240
+ const referenceInvalidationKeysMap = new Map<string, QueryKey>([
241
+ ["product", productsQueryKeys.lists()],
242
+ ["product_variant", productVariantQueryKeys.lists()],
243
+ ["product_category", categoriesQueryKeys.lists()],
244
+ ["product_collection", collectionsQueryKeys.lists()],
245
+ ["product_type", productTypesQueryKeys.lists()],
246
+ ["product_tag", productTagsQueryKeys.lists()],
247
+ ])
248
+
249
+ return useMutation({
250
250
  mutationFn: (payload: HttpTypes.AdminBatchTranslations) =>
251
251
  sdk.admin.translation.batch(payload),
252
- ...options,
253
- })
254
-
255
- /**
256
- * Useful to call the invalidation separately from the batch request and await the refetch finishes.
257
- */
258
- const invalidateQueries = async () => {
259
- await Promise.all([
252
+ onSuccess: (data, variables, context) => {
260
253
  queryClient.invalidateQueries({
261
254
  queryKey: referenceInvalidationKeysMap.get(reference),
262
- }),
255
+ })
263
256
  queryClient.invalidateQueries({
264
257
  queryKey: translationStatisticsQueryKeys.lists(),
265
- }),
266
- ])
267
- }
258
+ })
268
259
 
269
- return {
270
- ...mutation,
271
- invalidateQueries,
272
- }
260
+ options?.onSuccess?.(data, variables, context)
261
+ },
262
+ ...options,
263
+ })
273
264
  }
274
265
 
275
266
  export const useTranslationSettings = (
@@ -2538,7 +2538,7 @@
2538
2538
  "completion": {
2539
2539
  "heading": "Translated fields",
2540
2540
  "translated": "Translated",
2541
- "toTranslate": "Missing",
2541
+ "toTranslate": "To be translated",
2542
2542
  "footer": "Languages"
2543
2543
  }
2544
2544
  },
@@ -2477,7 +2477,7 @@
2477
2477
  "completion": {
2478
2478
  "heading": "Textos traducidos",
2479
2479
  "translated": "Traducidos",
2480
- "toTranslate": "Faltantes",
2480
+ "toTranslate": "Por traducir",
2481
2481
  "footer": "Idiomas"
2482
2482
  }
2483
2483
  },
@@ -1,16 +1,9 @@
1
1
  import { PencilSquare, Language } from "@medusajs/icons"
2
- import {
3
- Container,
4
- Heading,
5
- IconButton,
6
- InlineTip,
7
- Text,
8
- Tooltip,
9
- } from "@medusajs/ui"
2
+ import { Container, Heading, IconButton, InlineTip, Text } from "@medusajs/ui"
10
3
  import { useTranslation } from "react-i18next"
11
4
  import { IconAvatar } from "../../../../../components/common/icon-avatar"
12
5
  import { HttpTypes } from "@medusajs/types"
13
- import { useCallback, useState } from "react"
6
+ import { useCallback } from "react"
14
7
  import { useNavigate } from "react-router-dom"
15
8
 
16
9
  type ActiveLocalesSectionProps = {
@@ -22,10 +15,9 @@ export const ActiveLocalesSection = ({
22
15
  }: ActiveLocalesSectionProps) => {
23
16
  const { t } = useTranslation()
24
17
  const navigate = useNavigate()
25
- const [isHovered, setIsHovered] = useState(false)
26
18
 
27
19
  const handleManageLocales = useCallback(() => {
28
- navigate("/settings/translations/add-locales")
20
+ navigate("/settings/store/locales")
29
21
  }, [navigate])
30
22
 
31
23
  const renderLocales = useCallback(() => {
@@ -45,43 +37,26 @@ export const ActiveLocalesSection = ({
45
37
  return (
46
38
  <Container className="flex flex-col p-0">
47
39
  <div className="flex items-center justify-between px-6 py-4">
48
- <Heading level="h2">{t("translations.activeLocales.heading")}</Heading>
40
+ <Heading>{t("translations.activeLocales.heading")}</Heading>
49
41
  <IconButton variant="transparent" onClick={handleManageLocales}>
50
42
  <PencilSquare></PencilSquare>
51
43
  </IconButton>
52
44
  </div>
53
45
  <div className="px-1 pb-1">
54
46
  {hasLocales ? (
55
- <Tooltip
56
- open={isHovered}
57
- content={
58
- <div className="flex flex-col gap-y-1 p-1">
59
- {locales.map((locale) => (
60
- <Text key={locale.code} size="small" weight="plus">
61
- {locale.name}
62
- </Text>
63
- ))}
64
- </div>
65
- }
66
- >
67
- <Container
68
- className="bg-ui-bg-component border-r-1 flex items-center gap-x-4 px-[19px] py-2"
69
- onMouseEnter={() => setIsHovered(true)}
70
- onMouseLeave={() => setIsHovered(false)}
71
- >
72
- <IconAvatar className="border-ui-border-base border">
73
- <Language />
74
- </IconAvatar>
75
- <div className="flex flex-col">
76
- <Text size="small" weight="plus">
77
- {t("translations.activeLocales.subtitle")}
78
- </Text>
79
- <Text className="text-ui-fg-subtle" size="small">
80
- {renderLocales()}
81
- </Text>
82
- </div>
83
- </Container>
84
- </Tooltip>
47
+ <Container className="bg-ui-bg-component flex items-center gap-x-4 px-6 py-2">
48
+ <IconAvatar>
49
+ <Language />
50
+ </IconAvatar>
51
+ <div className="flex flex-col">
52
+ <Text size="small" weight="plus">
53
+ {t("translations.activeLocales.subtitle")}
54
+ </Text>
55
+ <Text className="text-ui-fg-subtle" size="small">
56
+ {renderLocales()}
57
+ </Text>
58
+ </div>
59
+ </Container>
85
60
  ) : (
86
61
  <InlineTip label="Tip">
87
62
  {t("translations.activeLocales.noLocalesTip")}
@@ -33,11 +33,7 @@ export const TranslationListSection = ({
33
33
  <Link
34
34
  to={`/settings/translations/edit?reference=${entity.reference}`}
35
35
  >
36
- <Button
37
- variant="secondary"
38
- size="small"
39
- disabled={!hasLocales || !entity.totalCount}
40
- >
36
+ <Button variant="secondary" size="small" disabled={!hasLocales}>
41
37
  Edit
42
38
  </Button>
43
39
  </Link>
@@ -1,5 +1,5 @@
1
1
  import { AdminTranslationEntityStatistics, HttpTypes } from "@medusajs/types"
2
- import { Container, Divider, Heading, Text, Tooltip } from "@medusajs/ui"
2
+ import { Container, Heading, Text, Tooltip } from "@medusajs/ui"
3
3
  import { useMemo, useState } from "react"
4
4
  import { useTranslation } from "react-i18next"
5
5
 
@@ -75,210 +75,149 @@ export const TranslationsCompletionSection = ({
75
75
  [localeStats]
76
76
  )
77
77
 
78
- const localeStatsCount = useMemo(() => localeStats.length, [localeStats])
79
-
80
78
  return (
81
- <Container className="p-0">
82
- <div className="flex flex-col gap-y-4 px-6 py-4">
83
- <div className="flex items-center justify-between">
84
- <Heading level="h2">{t("translations.completion.heading")}</Heading>
85
- <Text size="small" weight="plus" className="text-ui-fg-subtle">
86
- {translatedCount.toLocaleString()} {t("general.of")}{" "}
87
- {totalCount.toLocaleString()}
88
- </Text>
89
- </div>
79
+ <Container className="flex flex-col gap-y-3 px-6 py-4">
80
+ <div className="flex items-center justify-between">
81
+ <Heading>{t("translations.completion.heading")}</Heading>
82
+ <Text size="small" weight="plus" className="text-ui-fg-subtle">
83
+ {translatedCount.toLocaleString()} {t("general.of")}{" "}
84
+ {totalCount.toLocaleString()}
85
+ </Text>
86
+ </div>
90
87
 
91
- <div className="flex h-3 w-full overflow-hidden">
92
- {percentage > 0 ? (
93
- <>
94
- <div
95
- className="mr-0.5 h-full rounded-sm transition-all"
96
- style={{
97
- width: `${percentage}%`,
98
- backgroundColor: "var(--tag-blue-icon)",
99
- boxShadow: "inset 0 0 0 0.5px var(--alpha-250)",
100
- }}
101
- />
102
- <div
103
- className="h-full flex-1 rounded-sm"
104
- style={{
105
- backgroundColor: "var(--tag-blue-border)",
106
- boxShadow: "inset 0 0 0 0.5px var(--alpha-250)",
107
- }}
108
- />
109
- </>
110
- ) : (
88
+ <div className="flex h-3 w-full overflow-hidden">
89
+ {percentage > 0 ? (
90
+ <>
111
91
  <div
112
- className="h-full w-full rounded-sm"
92
+ className="mr-0.5 h-full rounded-sm transition-all"
113
93
  style={{
114
- backgroundColor: "var(--tag-blue-border)",
115
- boxShadow: "inset 0 0 0 0.5px var(--alpha-250)",
94
+ width: `${percentage}%`,
95
+ backgroundColor: "var(--bg-interactive)",
116
96
  }}
117
97
  />
118
- )}
119
- </div>
98
+ <div
99
+ className="h-full flex-1 rounded-sm"
100
+ style={{
101
+ backgroundColor: "var(--bg-interactive)",
102
+ opacity: 0.3,
103
+ }}
104
+ />
105
+ </>
106
+ ) : (
107
+ <div
108
+ className="h-full w-full rounded-full"
109
+ style={{
110
+ backgroundColor: "var(--bg-interactive)",
111
+ opacity: 0.3,
112
+ }}
113
+ />
114
+ )}
115
+ </div>
120
116
 
121
- <div className="flex items-center justify-between">
122
- <Text size="small" weight="plus" className="text-ui-fg-subtle">
123
- {percentage.toFixed(1)}%
124
- </Text>
125
- <Text size="small" weight="plus" className="text-ui-fg-subtle">
126
- {remaining.toLocaleString()} {t("general.remaining").toLowerCase()}
127
- </Text>
128
- </div>
117
+ <div className="flex items-center justify-between">
118
+ <Text size="small" weight="plus" className="text-ui-fg-subtle">
119
+ {percentage.toFixed(1)}%
120
+ </Text>
121
+ <Text size="small" weight="plus" className="text-ui-fg-subtle">
122
+ {remaining.toLocaleString()} {t("general.remaining").toLowerCase()}
123
+ </Text>
129
124
  </div>
130
125
 
131
126
  {localeStats.length > 0 && (
132
- <>
133
- <Divider variant="dashed" />
134
- <div className="flex flex-col gap-y-3 px-6 pb-6 pt-4">
135
- <div className="flex h-32 w-full items-end gap-1">
136
- {localeStats.map((locale) => {
137
- const heightPercent = (locale.total / maxTotal) * 100
138
- const translatedPercent =
139
- locale.total > 0
140
- ? (locale.translated / locale.total) * 100
141
- : 0
142
-
143
- return (
144
- <Tooltip
145
- key={locale.code}
146
- open={hoveredLocale === locale.code}
147
- content={
148
- <div className="flex min-w-[150px] flex-col gap-y-1 p-1">
149
- <Text size="small" weight="plus">
150
- {locale.name}
151
- </Text>
152
- <div className="flex items-center justify-between">
153
- <div className="flex items-center gap-x-2">
154
- <div
155
- className="h-2 w-2 rounded-full"
156
- style={{
157
- backgroundColor: "var(--tag-blue-icon)",
158
- boxShadow: "inset 0 0 0 0.5px var(--alpha-250)",
159
- }}
160
- />
161
- <Text
162
- size="small"
163
- weight="plus"
164
- className="text-ui-fg-base"
165
- >
166
- {t("translations.completion.translated")}
167
- </Text>
168
- </div>
169
- <Text
170
- size="small"
171
- weight="plus"
172
- className="text-ui-fg-base"
173
- >
174
- {locale.translated}
175
- </Text>
176
- </div>
177
- <div className="flex items-center justify-between">
178
- <div className="flex items-center gap-x-2">
179
- <div
180
- className="h-2 w-2 rounded-full"
181
- style={{
182
- backgroundColor: "var(--tag-blue-border)",
183
- boxShadow: "inset 0 0 0 0.5px var(--alpha-250)",
184
- }}
185
- />
186
- <Text
187
- size="small"
188
- weight="plus"
189
- className="text-ui-fg-base"
190
- >
191
- {t("translations.completion.toTranslate")}
192
- </Text>
193
- </div>
127
+ <div className="mt-4 flex flex-col gap-y-2">
128
+ <div className="flex h-32 w-full items-end gap-1">
129
+ {localeStats.map((locale) => {
130
+ const heightPercent = (locale.total / maxTotal) * 100
131
+ const translatedPercent =
132
+ locale.total > 0 ? (locale.translated / locale.total) * 100 : 0
133
+
134
+ return (
135
+ <Tooltip
136
+ key={locale.code}
137
+ open={hoveredLocale === locale.code}
138
+ content={
139
+ <div className="flex flex-col gap-y-1 p-1">
140
+ <Text size="small" weight="plus">
141
+ {locale.name}
142
+ </Text>
143
+ <div className="flex items-center justify-between">
144
+ <div className="flex items-center gap-x-2">
145
+ <div
146
+ className="h-2 w-2 rounded-full"
147
+ style={{ backgroundColor: "var(--bg-interactive)" }}
148
+ />
194
149
  <Text
195
150
  size="small"
196
151
  weight="plus"
197
- className="text-ui-fg-base"
152
+ className="text-ui-fg-subtle"
198
153
  >
199
- {locale.toTranslate}
154
+ {t("translations.completion.translated")}
200
155
  </Text>
201
156
  </div>
157
+ <Text size="small" weight="plus">
158
+ {locale.translated}
159
+ </Text>
202
160
  </div>
203
- }
204
- >
205
- <div className="flex h-full flex-1 items-end justify-center">
206
- <div
207
- className="flex w-full min-w-2 max-w-[96px] flex-col justify-end overflow-hidden rounded-t-sm transition-opacity"
208
- style={{ height: `${heightPercent}%` }}
209
- onMouseEnter={() => setHoveredLocale(locale.code)}
210
- onMouseLeave={() => setHoveredLocale(null)}
211
- >
212
- {translatedPercent === 0 ? (
213
- <div
214
- className="w-full rounded-sm"
215
- style={{
216
- height: "100%",
217
- backgroundColor: "var(--tag-neutral-bg)",
218
- boxShadow: "inset 0 0 0 0.5px var(--alpha-250)",
219
- }}
220
- />
221
- ) : (
222
- <>
223
- <div
224
- className="w-full rounded-sm"
225
- style={{
226
- height: `${100 - translatedPercent}%`,
227
- backgroundColor: "var(--tag-blue-border)",
228
- boxShadow: "inset 0 0 0 0.5px var(--alpha-250)",
229
- minHeight: locale.toTranslate > 0 ? "2px" : "0",
230
- }}
231
- />
232
- {translatedPercent > 0 && (
233
- <div
234
- className="mt-0.5 w-full rounded-sm"
235
- style={{
236
- height: `${translatedPercent}%`,
237
- backgroundColor: "var(--tag-blue-icon)",
238
- boxShadow:
239
- "inset 0 0 0 0.5px var(--alpha-250)",
240
- minHeight:
241
- locale.translated > 0 ? "2px" : "0",
242
- }}
243
- />
244
- )}
245
- </>
246
- )}
161
+ <div className="flex items-center gap-x-2">
162
+ <div
163
+ className="h-2 w-2 rounded-full"
164
+ style={{
165
+ backgroundColor: "var(--bg-interactive)",
166
+ opacity: 0.3,
167
+ }}
168
+ />
169
+ <Text
170
+ size="small"
171
+ weight="plus"
172
+ className="text-ui-fg-subtle"
173
+ >
174
+ {t("translations.completion.toTranslate")}
175
+ </Text>
176
+ <Text size="small" weight="plus">
177
+ {locale.toTranslate}
178
+ </Text>
247
179
  </div>
248
180
  </div>
249
- </Tooltip>
250
- )
251
- })}
252
- </div>
253
- {localeStatsCount < 9 && (
254
- <div className="flex w-full gap-1">
255
- {localeStats.map((locale) => (
181
+ }
182
+ >
256
183
  <div
257
- key={locale.code}
258
- className="flex flex-1 items-center justify-center"
184
+ className="flex min-w-2 flex-1 cursor-pointer flex-col justify-end overflow-hidden rounded-t-sm transition-opacity"
185
+ style={{ height: `${heightPercent}%` }}
186
+ onMouseEnter={() => setHoveredLocale(locale.code)}
187
+ onMouseLeave={() => setHoveredLocale(null)}
259
188
  >
260
- <Text
261
- size="xsmall"
262
- weight="plus"
263
- className="text-ui-fg-subtle min-w-2 whitespace-normal break-words text-center leading-tight"
264
- >
265
- {localeStatsCount < 6 ? locale.name : locale.code}
266
- </Text>
189
+ <div
190
+ className="w-full rounded-t-sm"
191
+ style={{
192
+ height: `${100 - translatedPercent}%`,
193
+ backgroundColor: "var(--bg-interactive)",
194
+ opacity: 0.3,
195
+ minHeight: locale.toTranslate > 0 ? "2px" : "0",
196
+ }}
197
+ />
198
+ {translatedPercent > 0 && (
199
+ <div
200
+ className="mt-0.5 w-full rounded-sm"
201
+ style={{
202
+ height: `${translatedPercent}%`,
203
+ backgroundColor: "var(--bg-interactive)",
204
+ minHeight: locale.translated > 0 ? "2px" : "0",
205
+ }}
206
+ />
207
+ )}
267
208
  </div>
268
- ))}
269
- </div>
270
- )}
271
- {localeStatsCount > 9 && (
272
- <Text
273
- weight="plus"
274
- size="xsmall"
275
- className="text-ui-fg-subtle text-center"
276
- >
277
- {t("translations.completion.footer")}
278
- </Text>
279
- )}
209
+ </Tooltip>
210
+ )
211
+ })}
280
212
  </div>
281
- </>
213
+ <Text
214
+ size="small"
215
+ weight="plus"
216
+ className="text-ui-fg-muted text-center"
217
+ >
218
+ {t("translations.completion.footer")}
219
+ </Text>
220
+ </div>
282
221
  )}
283
222
  </Container>
284
223
  )