Skip to content

Commit

Permalink
[Badge] Update props and tokens (Shopify#10307)
Browse files Browse the repository at this point in the history
<!--
  ☝️How to write a good PR title:
- Prefix it with [ComponentName] (if applicable), for example: [Button]
  - Start with a verb, for example: Add, Delete, Improve, Fix…
  - Give as much context as necessary and as little as possible
  - Prefix it with [WIP] while it’s a work in progress
-->

### WHY are these changes introduced?

Fixes https://github.com/Shopify/polaris/issues/10277ds

<!--
  Context about the problem that’s being addressed.
-->

### WHAT is this pull request doing?

Replaces status prop with tone
Removes experimental prefix from values
  • Loading branch information
kyledurand committed Sep 5, 2023
1 parent 0f19064 commit 73aec60
Show file tree
Hide file tree
Showing 72 changed files with 290 additions and 298 deletions.
6 changes: 6 additions & 0 deletions documentation/guides/migrating-from-v11-to-v12.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ Polaris v12.0.0 ([full release notes](https://github.com/Shopify/polaris/release

## Quick migration guide

**Badge**

`npx @shopify/polaris-migrator react-rename-component-prop <path> --componentName="Badge" --from="status" --to="tone"`

`npx @shopify/polaris-migrator react-rename-component-prop <path> --componentName="Badge" --from="statusAndProgressLabelOverride" --to="toneAndProgressLabelOverride"`

**Layout.Section**

- One third:
Expand Down
4 changes: 2 additions & 2 deletions polaris-react/locales/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"partiallyComplete": "Částečně dokončeno",
"complete": "Dokončeno"
},
"STATUS_LABELS": {
"TONE_LABELS": {
"info": "Informace",
"success": "Úspěch",
"warning": "Varování",
Expand All @@ -24,7 +24,7 @@
"readOnly": "Pouze pro čtení",
"enabled": "Aktivováno"
},
"progressAndStatus": "{statusLabel} {progressLabel}"
"progressAndTone": "{statusLabel} {progressLabel}"
},
"Banner": {
"dismissButton": "Zavřít notifikaci"
Expand Down
4 changes: 2 additions & 2 deletions polaris-react/locales/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"partiallyComplete": "Delvist fuldført",
"complete": "Fuldført"
},
"STATUS_LABELS": {
"TONE_LABELS": {
"info": "Info",
"success": "Succes",
"warning": "Advarsel",
Expand All @@ -24,7 +24,7 @@
"readOnly": "Skrivebeskyttet",
"enabled": "Aktiveret"
},
"progressAndStatus": "{statusLabel} {progressLabel}"
"progressAndTone": "{statusLabel} {progressLabel}"
},
"Banner": {
"dismissButton": "Afvis meddelelse"
Expand Down
4 changes: 2 additions & 2 deletions polaris-react/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"partiallyComplete": "Teilweise abgeschlossen",
"complete": "Abgeschlossen"
},
"STATUS_LABELS": {
"TONE_LABELS": {
"info": "Info",
"success": "Erfolg",
"warning": "Warnung",
Expand All @@ -24,7 +24,7 @@
"readOnly": "Schreibgeschützt",
"enabled": "Aktiviert"
},
"progressAndStatus": "{statusLabel} {progressLabel}"
"progressAndTone": "{statusLabel} {progressLabel}"
},
"Banner": {
"dismissButton": "Benachrichtigung verwerfen"
Expand Down
4 changes: 2 additions & 2 deletions polaris-react/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"partiallyComplete": "Partially complete",
"complete": "Complete"
},
"STATUS_LABELS": {
"TONE_LABELS": {
"info": "Info",
"success": "Success",
"warning": "Warning",
Expand All @@ -39,7 +39,7 @@
"readOnly": "Read-only",
"enabled": "Enabled"
},
"progressAndStatus": "{statusLabel} {progressLabel}"
"progressAndTone": "{toneLabel} {progressLabel}"
},
"Banner": {
"dismissButton": "Dismiss notification"
Expand Down
4 changes: 2 additions & 2 deletions polaris-react/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"partiallyComplete": "Parcialmente completado",
"complete": "Completado"
},
"STATUS_LABELS": {
"TONE_LABELS": {
"info": "Información",
"success": "Correcto",
"warning": "Advertencia",
Expand All @@ -24,7 +24,7 @@
"readOnly": "Solo lectura",
"enabled": "Activado"
},
"progressAndStatus": "{statusLabel} {progressLabel}"
"progressAndTone": "{statusLabel} {progressLabel}"
},
"Banner": {
"dismissButton": "Descartar notificación"
Expand Down
4 changes: 2 additions & 2 deletions polaris-react/locales/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"partiallyComplete": "Osittain valmis",
"complete": "Valmis"
},
"STATUS_LABELS": {
"TONE_LABELS": {
"info": "Tiedot",
"success": "Onnistui",
"warning": "Varoitus",
Expand All @@ -24,7 +24,7 @@
"readOnly": "Vain luku",
"enabled": "Otettu käyttöön"
},
"progressAndStatus": "{statusLabel} {progressLabel}"
"progressAndTone": "{statusLabel} {progressLabel}"
},
"Banner": {
"dismissButton": "Ohita ilmoitus"
Expand Down
4 changes: 2 additions & 2 deletions polaris-react/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"partiallyComplete": "Partiellement terminé",
"complete": "Terminé"
},
"STATUS_LABELS": {
"TONE_LABELS": {
"info": "Informations",
"success": "Réussite",
"warning": "Avertissement",
Expand All @@ -24,7 +24,7 @@
"readOnly": "Lecture seule",
"enabled": "Activé"
},
"progressAndStatus": "{statusLabel} {progressLabel}"
"progressAndTone": "{statusLabel} {progressLabel}"
},
"Banner": {
"dismissButton": "Rejeter la notification"
Expand Down
4 changes: 2 additions & 2 deletions polaris-react/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"partiallyComplete": "Parzialmente completo",
"complete": "Completo"
},
"STATUS_LABELS": {
"TONE_LABELS": {
"info": "Info",
"success": "Avvenuto",
"warning": "Avvertimento",
Expand All @@ -24,7 +24,7 @@
"readOnly": "Sola lettura",
"enabled": "Abilitato"
},
"progressAndStatus": "{statusLabel} {progressLabel}"
"progressAndTone": "{statusLabel} {progressLabel}"
},
"Banner": {
"dismissButton": "Elimina notifica"
Expand Down
4 changes: 2 additions & 2 deletions polaris-react/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"partiallyComplete": "一部完了済み",
"complete": "完了"
},
"STATUS_LABELS": {
"TONE_LABELS": {
"info": "情報",
"success": "成功しました",
"warning": "警告",
Expand All @@ -24,7 +24,7 @@
"readOnly": "読み取り専用",
"enabled": "有効"
},
"progressAndStatus": "{statusLabel} {progressLabel}"
"progressAndTone": "{statusLabel} {progressLabel}"
},
"Banner": {
"dismissButton": "通知を閉じる"
Expand Down
4 changes: 2 additions & 2 deletions polaris-react/locales/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"partiallyComplete": "일부 완료",
"complete": "완료"
},
"STATUS_LABELS": {
"TONE_LABELS": {
"info": "정보",
"success": "성공",
"warning": "경고",
Expand All @@ -24,7 +24,7 @@
"readOnly": "읽기 전용",
"enabled": "활성화됨"
},
"progressAndStatus": "{statusLabel} {progressLabel}"
"progressAndTone": "{statusLabel} {progressLabel}"
},
"Banner": {
"dismissButton": "알림 무시"
Expand Down
4 changes: 2 additions & 2 deletions polaris-react/locales/nb.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"partiallyComplete": "Delvis fullført",
"complete": "Ferdig"
},
"STATUS_LABELS": {
"TONE_LABELS": {
"info": "Info",
"success": "Vellykket",
"warning": "Advarsel",
Expand All @@ -24,7 +24,7 @@
"readOnly": "Kun lesetilgang",
"enabled": "Aktivert"
},
"progressAndStatus": "{statusLabel} {progressLabel}"
"progressAndTone": "{statusLabel} {progressLabel}"
},
"Banner": {
"dismissButton": "Avvis varsel"
Expand Down
4 changes: 2 additions & 2 deletions polaris-react/locales/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"partiallyComplete": "Gedeeltelijk voltooid",
"complete": "Voltooid"
},
"STATUS_LABELS": {
"TONE_LABELS": {
"info": "Info",
"success": "Geslaagd",
"warning": "Waarschuwing",
Expand All @@ -24,7 +24,7 @@
"readOnly": "Alleen-lezen",
"enabled": "Ingeschakeld"
},
"progressAndStatus": "{statusLabel} {progressLabel}"
"progressAndTone": "{statusLabel} {progressLabel}"
},
"Banner": {
"dismissButton": "Melding sluiten"
Expand Down
4 changes: 2 additions & 2 deletions polaris-react/locales/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"partiallyComplete": "Częściowo kompletne",
"complete": "Zakończ"
},
"STATUS_LABELS": {
"TONE_LABELS": {
"info": "Informacja",
"success": "Udało się",
"warning": "Ostrzeżenie",
Expand All @@ -24,7 +24,7 @@
"readOnly": "Tylko do odczytu",
"enabled": "Włączone"
},
"progressAndStatus": "{statusLabel} {progressLabel}"
"progressAndTone": "{statusLabel} {progressLabel}"
},
"Banner": {
"dismissButton": "Odrzuć powiadomienie"
Expand Down
4 changes: 2 additions & 2 deletions polaris-react/locales/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"partiallyComplete": "Parcialmente completo",
"complete": "Concluir"
},
"STATUS_LABELS": {
"TONE_LABELS": {
"info": "Informações",
"success": "Sucesso",
"warning": "Aviso",
Expand All @@ -24,7 +24,7 @@
"readOnly": "Somente de leitura",
"enabled": "Habilitado"
},
"progressAndStatus": "{statusLabel} {progressLabel}"
"progressAndTone": "{statusLabel} {progressLabel}"
},
"Banner": {
"dismissButton": "Dispensar notificação"
Expand Down
4 changes: 2 additions & 2 deletions polaris-react/locales/pt-PT.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"partiallyComplete": "Parcialmente concluído",
"complete": "Concluído"
},
"STATUS_LABELS": {
"TONE_LABELS": {
"info": "Informações",
"success": "Sucesso",
"warning": "Aviso",
Expand All @@ -24,7 +24,7 @@
"readOnly": "Só de leitura",
"enabled": "Ativado"
},
"progressAndStatus": "{statusLabel} {progressLabel}"
"progressAndTone": "{statusLabel} {progressLabel}"
},
"Banner": {
"dismissButton": "Ignorar notificação"
Expand Down
4 changes: 2 additions & 2 deletions polaris-react/locales/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"partiallyComplete": "Delvis slutförd",
"complete": "Slutförd"
},
"STATUS_LABELS": {
"TONE_LABELS": {
"info": "Info",
"success": "Lyckades",
"warning": "Varning",
Expand All @@ -24,7 +24,7 @@
"readOnly": "Skrivskyddad",
"enabled": "Aktiverat"
},
"progressAndStatus": "{statusLabel} {progressLabel}"
"progressAndTone": "{statusLabel} {progressLabel}"
},
"Banner": {
"dismissButton": "Avvisa avisering"
Expand Down
4 changes: 2 additions & 2 deletions polaris-react/locales/th.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"partiallyComplete": "เสร็จสมบูรณ์แล้วบางส่วน",
"complete": "เสร็จสมบูรณ์"
},
"STATUS_LABELS": {
"TONE_LABELS": {
"info": "ข้อมูล",
"success": "สำเร็จ",
"warning": "คำเตือน",
Expand All @@ -24,7 +24,7 @@
"readOnly": "อ่านอย่างเดียว",
"enabled": "เปิดใช้แล้ว"
},
"progressAndStatus": "{statusLabel} {progressLabel}"
"progressAndTone": "{statusLabel} {progressLabel}"
},
"Banner": {
"dismissButton": "ปิดการแจ้งเตือน"
Expand Down
4 changes: 2 additions & 2 deletions polaris-react/locales/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"partiallyComplete": "Kısmen tamamlandı",
"complete": "Tamamlandı"
},
"STATUS_LABELS": {
"TONE_LABELS": {
"info": "Bilgi",
"success": "Başarılı",
"warning": "Uyarı",
Expand All @@ -24,7 +24,7 @@
"readOnly": "Salt okunur",
"enabled": "Etkinleştirildi"
},
"progressAndStatus": "{statusLabel} - {progressLabel}"
"progressAndTone": "{statusLabel} - {progressLabel}"
},
"Banner": {
"dismissButton": "Bildirimi kapat"
Expand Down
4 changes: 2 additions & 2 deletions polaris-react/locales/vi.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"partiallyComplete": "Hoàn tất một phần",
"complete": "Hoàn tất"
},
"STATUS_LABELS": {
"TONE_LABELS": {
"info": "Thông tin",
"success": "Thành công",
"warning": "Cảnh báo",
Expand All @@ -24,7 +24,7 @@
"readOnly": "Chỉ đọc",
"enabled": "Đã bật"
},
"progressAndStatus": "{statusLabel} {progressLabel}"
"progressAndTone": "{statusLabel} {progressLabel}"
},
"Banner": {
"dismissButton": "Bỏ qua thông báo"
Expand Down
4 changes: 2 additions & 2 deletions polaris-react/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"partiallyComplete": "部分完成",
"complete": "完成"
},
"STATUS_LABELS": {
"TONE_LABELS": {
"info": "信息",
"success": "成功",
"warning": "警告",
Expand All @@ -24,7 +24,7 @@
"readOnly": "只读",
"enabled": "已启用"
},
"progressAndStatus": "{statusLabel} {progressLabel}"
"progressAndTone": "{statusLabel} {progressLabel}"
},
"Banner": {
"dismissButton": "忽略通知"
Expand Down
4 changes: 2 additions & 2 deletions polaris-react/locales/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"partiallyComplete": "部分完成",
"complete": "完成"
},
"STATUS_LABELS": {
"TONE_LABELS": {
"info": "資訊",
"success": "成功",
"warning": "警告",
Expand All @@ -24,7 +24,7 @@
"readOnly": "唯讀",
"enabled": "已啟用"
},
"progressAndStatus": "{statusLabel} {progressLabel}"
"progressAndTone": "{statusLabel} {progressLabel}"
},
"Banner": {
"dismissButton": "關閉通知"
Expand Down
2 changes: 1 addition & 1 deletion polaris-react/playground/DetailsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ export function DetailsPage() {
fullWidth
backAction={{content: 'Products', url: '/products/31'}}
title={title}
titleMetadata={<Badge status="success">Success badge</Badge>}
titleMetadata={<Badge tone="success">Success badge</Badge>}
primaryAction={{
content: 'Save this page',
onAction: () => console.log('save'),
Expand Down
Loading

0 comments on commit 73aec60

Please sign in to comment.