From 785570a8efc6886c67910ba29ca984734e195368 Mon Sep 17 00:00:00 2001 From: sirineJ <112706079+sirineJ@users.noreply.github.com> Date: Wed, 15 Jan 2025 17:39:23 +0100 Subject: [PATCH 1/3] Move all close label translations inside the Dialog component --- .../components/DateInput/DateInput.tsx | 1 + .../DateInput/translations/bg-BG.json | 1 - .../DateInput/translations/cs-CZ.json | 1 - .../DateInput/translations/da-DK.json | 1 - .../DateInput/translations/de-AT.json | 1 - .../DateInput/translations/de-CH.json | 1 - .../DateInput/translations/de-DE.json | 1 - .../DateInput/translations/de-LU.json | 1 - .../DateInput/translations/el-CY.json | 1 - .../DateInput/translations/el-GR.json | 1 - .../DateInput/translations/en-AU.json | 1 - .../DateInput/translations/en-GB.json | 1 - .../DateInput/translations/en-IE.json | 1 - .../DateInput/translations/en-MT.json | 1 - .../DateInput/translations/en-US.json | 1 - .../DateInput/translations/es-CL.json | 1 - .../DateInput/translations/es-CO.json | 1 - .../DateInput/translations/es-ES.json | 1 - .../DateInput/translations/es-MX.json | 1 - .../DateInput/translations/es-PE.json | 1 - .../DateInput/translations/es-US.json | 1 - .../DateInput/translations/et-EE.json | 1 - .../DateInput/translations/fi-FI.json | 1 - .../DateInput/translations/fr-BE.json | 1 - .../DateInput/translations/fr-CH.json | 1 - .../DateInput/translations/fr-FR.json | 1 - .../DateInput/translations/fr-LU.json | 1 - .../DateInput/translations/hr-HR.json | 1 - .../DateInput/translations/hu-HU.json | 1 - .../DateInput/translations/it-CH.json | 1 - .../DateInput/translations/it-IT.json | 1 - .../DateInput/translations/lt-LT.json | 1 - .../DateInput/translations/lv-LV.json | 1 - .../DateInput/translations/nb-NO.json | 1 - .../DateInput/translations/nl-BE.json | 1 - .../DateInput/translations/nl-NL.json | 1 - .../DateInput/translations/pl-PL.json | 1 - .../DateInput/translations/pt-BR.json | 1 - .../DateInput/translations/pt-PT.json | 1 - .../DateInput/translations/ro-RO.json | 1 - .../DateInput/translations/sk-SK.json | 1 - .../DateInput/translations/sl-SI.json | 1 - .../DateInput/translations/sv-SE.json | 1 - .../components/Dialog/Dialog.stories.tsx | 1 - .../circuit-ui/components/Dialog/Dialog.tsx | 4 ++- .../{Modal => Dialog}/translations/bg-BG.json | 0 .../{Modal => Dialog}/translations/cs-CZ.json | 0 .../{Modal => Dialog}/translations/da-DK.json | 0 .../{Modal => Dialog}/translations/de-AT.json | 0 .../{Modal => Dialog}/translations/de-CH.json | 0 .../{Modal => Dialog}/translations/de-DE.json | 0 .../{Modal => Dialog}/translations/de-LU.json | 0 .../{Modal => Dialog}/translations/el-CY.json | 0 .../{Modal => Dialog}/translations/el-GR.json | 0 .../{Modal => Dialog}/translations/en-AU.json | 0 .../{Modal => Dialog}/translations/en-GB.json | 0 .../{Modal => Dialog}/translations/en-IE.json | 0 .../{Modal => Dialog}/translations/en-MT.json | 0 .../{Modal => Dialog}/translations/en-US.json | 0 .../{Modal => Dialog}/translations/es-CL.json | 0 .../{Modal => Dialog}/translations/es-CO.json | 0 .../{Modal => Dialog}/translations/es-ES.json | 0 .../{Modal => Dialog}/translations/es-MX.json | 0 .../{Modal => Dialog}/translations/es-PE.json | 0 .../{Modal => Dialog}/translations/es-US.json | 0 .../{Modal => Dialog}/translations/et-EE.json | 0 .../{Modal => Dialog}/translations/fi-FI.json | 0 .../{Modal => Dialog}/translations/fr-BE.json | 0 .../{Modal => Dialog}/translations/fr-CH.json | 0 .../{Modal => Dialog}/translations/fr-FR.json | 0 .../{Modal => Dialog}/translations/fr-LU.json | 0 .../{Modal => Dialog}/translations/hr-HR.json | 0 .../{Modal => Dialog}/translations/hu-HU.json | 0 .../{Modal => Dialog}/translations/index.ts | 0 .../{Modal => Dialog}/translations/it-CH.json | 0 .../{Modal => Dialog}/translations/it-IT.json | 0 .../{Modal => Dialog}/translations/lt-LT.json | 0 .../{Modal => Dialog}/translations/lv-LV.json | 0 .../{Modal => Dialog}/translations/nb-NO.json | 0 .../{Modal => Dialog}/translations/nl-BE.json | 0 .../{Modal => Dialog}/translations/nl-NL.json | 0 .../{Modal => Dialog}/translations/pl-PL.json | 0 .../{Modal => Dialog}/translations/pt-BR.json | 0 .../{Modal => Dialog}/translations/pt-PT.json | 0 .../{Modal => Dialog}/translations/ro-RO.json | 0 .../{Modal => Dialog}/translations/sk-SK.json | 0 .../{Modal => Dialog}/translations/sl-SI.json | 0 .../{Modal => Dialog}/translations/sv-SE.json | 0 .../components/Modal/Modal.stories.tsx | 1 - .../circuit-ui/components/Modal/Modal.tsx | 4 +-- .../components/Toggletip/Toggletip.tsx | 26 ++++++------------- .../Toggletip/translations/bg-BG.json | 3 --- .../Toggletip/translations/cs-CZ.json | 3 --- .../Toggletip/translations/da-DK.json | 3 --- .../Toggletip/translations/de-AT.json | 3 --- .../Toggletip/translations/de-CH.json | 3 --- .../Toggletip/translations/de-DE.json | 3 --- .../Toggletip/translations/de-LU.json | 3 --- .../Toggletip/translations/el-CY.json | 3 --- .../Toggletip/translations/el-GR.json | 3 --- .../Toggletip/translations/en-AU.json | 3 --- .../Toggletip/translations/en-GB.json | 3 --- .../Toggletip/translations/en-IE.json | 3 --- .../Toggletip/translations/en-MT.json | 3 --- .../Toggletip/translations/en-US.json | 3 --- .../Toggletip/translations/es-CL.json | 3 --- .../Toggletip/translations/es-CO.json | 3 --- .../Toggletip/translations/es-ES.json | 3 --- .../Toggletip/translations/es-MX.json | 3 --- .../Toggletip/translations/es-PE.json | 3 --- .../Toggletip/translations/es-US.json | 3 --- .../Toggletip/translations/et-EE.json | 3 --- .../Toggletip/translations/fi-FI.json | 3 --- .../Toggletip/translations/fr-BE.json | 3 --- .../Toggletip/translations/fr-CH.json | 3 --- .../Toggletip/translations/fr-FR.json | 3 --- .../Toggletip/translations/fr-LU.json | 3 --- .../Toggletip/translations/hr-HR.json | 3 --- .../Toggletip/translations/hu-HU.json | 3 --- .../Toggletip/translations/index.ts | 26 ------------------- .../Toggletip/translations/it-CH.json | 3 --- .../Toggletip/translations/it-IT.json | 3 --- .../Toggletip/translations/lt-LT.json | 3 --- .../Toggletip/translations/lv-LV.json | 3 --- .../Toggletip/translations/nb-NO.json | 3 --- .../Toggletip/translations/nl-BE.json | 3 --- .../Toggletip/translations/nl-NL.json | 3 --- .../Toggletip/translations/pl-PL.json | 3 --- .../Toggletip/translations/pt-BR.json | 3 --- .../Toggletip/translations/pt-PT.json | 3 --- .../Toggletip/translations/ro-RO.json | 3 --- .../Toggletip/translations/sk-SK.json | 3 --- .../Toggletip/translations/sl-SI.json | 3 --- .../Toggletip/translations/sv-SE.json | 3 --- 134 files changed, 13 insertions(+), 218 deletions(-) rename packages/circuit-ui/components/{Modal => Dialog}/translations/bg-BG.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/cs-CZ.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/da-DK.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/de-AT.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/de-CH.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/de-DE.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/de-LU.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/el-CY.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/el-GR.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/en-AU.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/en-GB.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/en-IE.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/en-MT.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/en-US.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/es-CL.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/es-CO.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/es-ES.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/es-MX.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/es-PE.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/es-US.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/et-EE.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/fi-FI.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/fr-BE.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/fr-CH.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/fr-FR.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/fr-LU.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/hr-HR.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/hu-HU.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/index.ts (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/it-CH.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/it-IT.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/lt-LT.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/lv-LV.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/nb-NO.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/nl-BE.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/nl-NL.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/pl-PL.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/pt-BR.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/pt-PT.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/ro-RO.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/sk-SK.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/sl-SI.json (100%) rename packages/circuit-ui/components/{Modal => Dialog}/translations/sv-SE.json (100%) delete mode 100644 packages/circuit-ui/components/Toggletip/translations/bg-BG.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/cs-CZ.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/da-DK.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/de-AT.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/de-CH.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/de-DE.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/de-LU.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/el-CY.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/el-GR.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/en-AU.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/en-GB.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/en-IE.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/en-MT.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/en-US.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/es-CL.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/es-CO.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/es-ES.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/es-MX.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/es-PE.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/es-US.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/et-EE.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/fi-FI.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/fr-BE.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/fr-CH.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/fr-FR.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/fr-LU.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/hr-HR.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/hu-HU.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/index.ts delete mode 100644 packages/circuit-ui/components/Toggletip/translations/it-CH.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/it-IT.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/lt-LT.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/lv-LV.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/nb-NO.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/nl-BE.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/nl-NL.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/pl-PL.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/pt-BR.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/pt-PT.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/ro-RO.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/sk-SK.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/sl-SI.json delete mode 100644 packages/circuit-ui/components/Toggletip/translations/sv-SE.json diff --git a/packages/circuit-ui/components/DateInput/DateInput.tsx b/packages/circuit-ui/components/DateInput/DateInput.tsx index 4c0d4cfc04..a2cc0c8b06 100644 --- a/packages/circuit-ui/components/DateInput/DateInput.tsx +++ b/packages/circuit-ui/components/DateInput/DateInput.tsx @@ -488,6 +488,7 @@ export const DateInput = forwardRef( animationDuration={isMobile ? animationDuration : 0} aria-labelledby={headlineId} style={dialogStyles} + locale={locale} closeButtonLabel={closeCalendarButtonLabel} > {() => ( diff --git a/packages/circuit-ui/components/DateInput/translations/bg-BG.json b/packages/circuit-ui/components/DateInput/translations/bg-BG.json index 04401d39a3..52ba34eb32 100644 --- a/packages/circuit-ui/components/DateInput/translations/bg-BG.json +++ b/packages/circuit-ui/components/DateInput/translations/bg-BG.json @@ -3,7 +3,6 @@ "monthInputLabel": "Месец", "dayInputLabel": "Ден", "openCalendarButtonLabel": "Промяна на дата", - "closeCalendarButtonLabel": "Затваряне на календар", "applyDateButtonLabel": "Прилагане на дата", "clearDateButtonLabel": "Изчистване на дата" } diff --git a/packages/circuit-ui/components/DateInput/translations/cs-CZ.json b/packages/circuit-ui/components/DateInput/translations/cs-CZ.json index b44268efe6..abbc1aa504 100644 --- a/packages/circuit-ui/components/DateInput/translations/cs-CZ.json +++ b/packages/circuit-ui/components/DateInput/translations/cs-CZ.json @@ -3,7 +3,6 @@ "monthInputLabel": "Měsíc", "dayInputLabel": "Den", "openCalendarButtonLabel": "Změnit datum", - "closeCalendarButtonLabel": "Zavřít kalendář", "applyDateButtonLabel": "Použít datum", "clearDateButtonLabel": "Vymazat datum" } diff --git a/packages/circuit-ui/components/DateInput/translations/da-DK.json b/packages/circuit-ui/components/DateInput/translations/da-DK.json index 9622a3d899..a477b6c1bc 100644 --- a/packages/circuit-ui/components/DateInput/translations/da-DK.json +++ b/packages/circuit-ui/components/DateInput/translations/da-DK.json @@ -3,7 +3,6 @@ "monthInputLabel": "Måned", "dayInputLabel": "Dag", "openCalendarButtonLabel": "Skift dato", - "closeCalendarButtonLabel": "Luk kalender", "applyDateButtonLabel": "Anvend dato", "clearDateButtonLabel": "Slet dato" } diff --git a/packages/circuit-ui/components/DateInput/translations/de-AT.json b/packages/circuit-ui/components/DateInput/translations/de-AT.json index b699d0c899..349ab42a37 100644 --- a/packages/circuit-ui/components/DateInput/translations/de-AT.json +++ b/packages/circuit-ui/components/DateInput/translations/de-AT.json @@ -3,7 +3,6 @@ "monthInputLabel": "Monat", "dayInputLabel": "Tag", "openCalendarButtonLabel": "Datum ändern", - "closeCalendarButtonLabel": "Kalender schließen", "applyDateButtonLabel": "Datum anwenden", "clearDateButtonLabel": "Datum löschen" } diff --git a/packages/circuit-ui/components/DateInput/translations/de-CH.json b/packages/circuit-ui/components/DateInput/translations/de-CH.json index b699d0c899..349ab42a37 100644 --- a/packages/circuit-ui/components/DateInput/translations/de-CH.json +++ b/packages/circuit-ui/components/DateInput/translations/de-CH.json @@ -3,7 +3,6 @@ "monthInputLabel": "Monat", "dayInputLabel": "Tag", "openCalendarButtonLabel": "Datum ändern", - "closeCalendarButtonLabel": "Kalender schließen", "applyDateButtonLabel": "Datum anwenden", "clearDateButtonLabel": "Datum löschen" } diff --git a/packages/circuit-ui/components/DateInput/translations/de-DE.json b/packages/circuit-ui/components/DateInput/translations/de-DE.json index b699d0c899..349ab42a37 100644 --- a/packages/circuit-ui/components/DateInput/translations/de-DE.json +++ b/packages/circuit-ui/components/DateInput/translations/de-DE.json @@ -3,7 +3,6 @@ "monthInputLabel": "Monat", "dayInputLabel": "Tag", "openCalendarButtonLabel": "Datum ändern", - "closeCalendarButtonLabel": "Kalender schließen", "applyDateButtonLabel": "Datum anwenden", "clearDateButtonLabel": "Datum löschen" } diff --git a/packages/circuit-ui/components/DateInput/translations/de-LU.json b/packages/circuit-ui/components/DateInput/translations/de-LU.json index b699d0c899..349ab42a37 100644 --- a/packages/circuit-ui/components/DateInput/translations/de-LU.json +++ b/packages/circuit-ui/components/DateInput/translations/de-LU.json @@ -3,7 +3,6 @@ "monthInputLabel": "Monat", "dayInputLabel": "Tag", "openCalendarButtonLabel": "Datum ändern", - "closeCalendarButtonLabel": "Kalender schließen", "applyDateButtonLabel": "Datum anwenden", "clearDateButtonLabel": "Datum löschen" } diff --git a/packages/circuit-ui/components/DateInput/translations/el-CY.json b/packages/circuit-ui/components/DateInput/translations/el-CY.json index 4832ba620d..bd61fad708 100644 --- a/packages/circuit-ui/components/DateInput/translations/el-CY.json +++ b/packages/circuit-ui/components/DateInput/translations/el-CY.json @@ -3,7 +3,6 @@ "monthInputLabel": "Μήνας", "dayInputLabel": "Ημέρα", "openCalendarButtonLabel": "Αλλαγή ημερομηνίας", - "closeCalendarButtonLabel": "Κλείσιμο ημερολογίου", "applyDateButtonLabel": "Εφαρμογή ημερομηνίας", "clearDateButtonLabel": "Εκκαθάριση ημερομηνίας" } diff --git a/packages/circuit-ui/components/DateInput/translations/el-GR.json b/packages/circuit-ui/components/DateInput/translations/el-GR.json index 4832ba620d..bd61fad708 100644 --- a/packages/circuit-ui/components/DateInput/translations/el-GR.json +++ b/packages/circuit-ui/components/DateInput/translations/el-GR.json @@ -3,7 +3,6 @@ "monthInputLabel": "Μήνας", "dayInputLabel": "Ημέρα", "openCalendarButtonLabel": "Αλλαγή ημερομηνίας", - "closeCalendarButtonLabel": "Κλείσιμο ημερολογίου", "applyDateButtonLabel": "Εφαρμογή ημερομηνίας", "clearDateButtonLabel": "Εκκαθάριση ημερομηνίας" } diff --git a/packages/circuit-ui/components/DateInput/translations/en-AU.json b/packages/circuit-ui/components/DateInput/translations/en-AU.json index 1881397a9c..e672f8cfb6 100644 --- a/packages/circuit-ui/components/DateInput/translations/en-AU.json +++ b/packages/circuit-ui/components/DateInput/translations/en-AU.json @@ -3,7 +3,6 @@ "monthInputLabel": "Month", "dayInputLabel": "Day", "openCalendarButtonLabel": "Change date", - "closeCalendarButtonLabel": "Close calendar", "applyDateButtonLabel": "Apply date", "clearDateButtonLabel": "Clear date" } diff --git a/packages/circuit-ui/components/DateInput/translations/en-GB.json b/packages/circuit-ui/components/DateInput/translations/en-GB.json index 1881397a9c..e672f8cfb6 100644 --- a/packages/circuit-ui/components/DateInput/translations/en-GB.json +++ b/packages/circuit-ui/components/DateInput/translations/en-GB.json @@ -3,7 +3,6 @@ "monthInputLabel": "Month", "dayInputLabel": "Day", "openCalendarButtonLabel": "Change date", - "closeCalendarButtonLabel": "Close calendar", "applyDateButtonLabel": "Apply date", "clearDateButtonLabel": "Clear date" } diff --git a/packages/circuit-ui/components/DateInput/translations/en-IE.json b/packages/circuit-ui/components/DateInput/translations/en-IE.json index 1881397a9c..e672f8cfb6 100644 --- a/packages/circuit-ui/components/DateInput/translations/en-IE.json +++ b/packages/circuit-ui/components/DateInput/translations/en-IE.json @@ -3,7 +3,6 @@ "monthInputLabel": "Month", "dayInputLabel": "Day", "openCalendarButtonLabel": "Change date", - "closeCalendarButtonLabel": "Close calendar", "applyDateButtonLabel": "Apply date", "clearDateButtonLabel": "Clear date" } diff --git a/packages/circuit-ui/components/DateInput/translations/en-MT.json b/packages/circuit-ui/components/DateInput/translations/en-MT.json index 1881397a9c..e672f8cfb6 100644 --- a/packages/circuit-ui/components/DateInput/translations/en-MT.json +++ b/packages/circuit-ui/components/DateInput/translations/en-MT.json @@ -3,7 +3,6 @@ "monthInputLabel": "Month", "dayInputLabel": "Day", "openCalendarButtonLabel": "Change date", - "closeCalendarButtonLabel": "Close calendar", "applyDateButtonLabel": "Apply date", "clearDateButtonLabel": "Clear date" } diff --git a/packages/circuit-ui/components/DateInput/translations/en-US.json b/packages/circuit-ui/components/DateInput/translations/en-US.json index 1881397a9c..e672f8cfb6 100644 --- a/packages/circuit-ui/components/DateInput/translations/en-US.json +++ b/packages/circuit-ui/components/DateInput/translations/en-US.json @@ -3,7 +3,6 @@ "monthInputLabel": "Month", "dayInputLabel": "Day", "openCalendarButtonLabel": "Change date", - "closeCalendarButtonLabel": "Close calendar", "applyDateButtonLabel": "Apply date", "clearDateButtonLabel": "Clear date" } diff --git a/packages/circuit-ui/components/DateInput/translations/es-CL.json b/packages/circuit-ui/components/DateInput/translations/es-CL.json index 6772c3207d..4f5fe0269f 100644 --- a/packages/circuit-ui/components/DateInput/translations/es-CL.json +++ b/packages/circuit-ui/components/DateInput/translations/es-CL.json @@ -3,7 +3,6 @@ "monthInputLabel": "Mes", "dayInputLabel": "Día", "openCalendarButtonLabel": "Cambiar la fecha", - "closeCalendarButtonLabel": "Cerrar calendario", "applyDateButtonLabel": "Aplicar fecha", "clearDateButtonLabel": "Borrar fecha" } diff --git a/packages/circuit-ui/components/DateInput/translations/es-CO.json b/packages/circuit-ui/components/DateInput/translations/es-CO.json index b1d2e7845b..1549f0ed76 100644 --- a/packages/circuit-ui/components/DateInput/translations/es-CO.json +++ b/packages/circuit-ui/components/DateInput/translations/es-CO.json @@ -3,7 +3,6 @@ "monthInputLabel": "Mes", "dayInputLabel": "Día", "openCalendarButtonLabel": "Cambiar fecha", - "closeCalendarButtonLabel": "Cerrar calendario", "applyDateButtonLabel": "Aplicar fecha", "clearDateButtonLabel": "Borrar fecha" } diff --git a/packages/circuit-ui/components/DateInput/translations/es-ES.json b/packages/circuit-ui/components/DateInput/translations/es-ES.json index b1d2e7845b..1549f0ed76 100644 --- a/packages/circuit-ui/components/DateInput/translations/es-ES.json +++ b/packages/circuit-ui/components/DateInput/translations/es-ES.json @@ -3,7 +3,6 @@ "monthInputLabel": "Mes", "dayInputLabel": "Día", "openCalendarButtonLabel": "Cambiar fecha", - "closeCalendarButtonLabel": "Cerrar calendario", "applyDateButtonLabel": "Aplicar fecha", "clearDateButtonLabel": "Borrar fecha" } diff --git a/packages/circuit-ui/components/DateInput/translations/es-MX.json b/packages/circuit-ui/components/DateInput/translations/es-MX.json index b1d2e7845b..1549f0ed76 100644 --- a/packages/circuit-ui/components/DateInput/translations/es-MX.json +++ b/packages/circuit-ui/components/DateInput/translations/es-MX.json @@ -3,7 +3,6 @@ "monthInputLabel": "Mes", "dayInputLabel": "Día", "openCalendarButtonLabel": "Cambiar fecha", - "closeCalendarButtonLabel": "Cerrar calendario", "applyDateButtonLabel": "Aplicar fecha", "clearDateButtonLabel": "Borrar fecha" } diff --git a/packages/circuit-ui/components/DateInput/translations/es-PE.json b/packages/circuit-ui/components/DateInput/translations/es-PE.json index b1d2e7845b..1549f0ed76 100644 --- a/packages/circuit-ui/components/DateInput/translations/es-PE.json +++ b/packages/circuit-ui/components/DateInput/translations/es-PE.json @@ -3,7 +3,6 @@ "monthInputLabel": "Mes", "dayInputLabel": "Día", "openCalendarButtonLabel": "Cambiar fecha", - "closeCalendarButtonLabel": "Cerrar calendario", "applyDateButtonLabel": "Aplicar fecha", "clearDateButtonLabel": "Borrar fecha" } diff --git a/packages/circuit-ui/components/DateInput/translations/es-US.json b/packages/circuit-ui/components/DateInput/translations/es-US.json index b1d2e7845b..1549f0ed76 100644 --- a/packages/circuit-ui/components/DateInput/translations/es-US.json +++ b/packages/circuit-ui/components/DateInput/translations/es-US.json @@ -3,7 +3,6 @@ "monthInputLabel": "Mes", "dayInputLabel": "Día", "openCalendarButtonLabel": "Cambiar fecha", - "closeCalendarButtonLabel": "Cerrar calendario", "applyDateButtonLabel": "Aplicar fecha", "clearDateButtonLabel": "Borrar fecha" } diff --git a/packages/circuit-ui/components/DateInput/translations/et-EE.json b/packages/circuit-ui/components/DateInput/translations/et-EE.json index 4aaf28bfe2..8787481b4b 100644 --- a/packages/circuit-ui/components/DateInput/translations/et-EE.json +++ b/packages/circuit-ui/components/DateInput/translations/et-EE.json @@ -3,7 +3,6 @@ "monthInputLabel": "Kuu", "dayInputLabel": "Päev", "openCalendarButtonLabel": "Kuupäeva muutmine", - "closeCalendarButtonLabel": "Sulge kalender", "applyDateButtonLabel": "Rakenda kuupäev", "clearDateButtonLabel": "Tühjenda kuupäev" } diff --git a/packages/circuit-ui/components/DateInput/translations/fi-FI.json b/packages/circuit-ui/components/DateInput/translations/fi-FI.json index 8469ab66e6..453b88cfdd 100644 --- a/packages/circuit-ui/components/DateInput/translations/fi-FI.json +++ b/packages/circuit-ui/components/DateInput/translations/fi-FI.json @@ -3,7 +3,6 @@ "monthInputLabel": "Kuukausi", "dayInputLabel": "Päivä", "openCalendarButtonLabel": "Vaihda päivämäärä", - "closeCalendarButtonLabel": "Sulje kalenteri", "applyDateButtonLabel": "Käytä päivämäärää", "clearDateButtonLabel": "Tyhjennä päivämäärä" } diff --git a/packages/circuit-ui/components/DateInput/translations/fr-BE.json b/packages/circuit-ui/components/DateInput/translations/fr-BE.json index 60b957b707..b64b642d95 100644 --- a/packages/circuit-ui/components/DateInput/translations/fr-BE.json +++ b/packages/circuit-ui/components/DateInput/translations/fr-BE.json @@ -3,7 +3,6 @@ "monthInputLabel": "Mois", "dayInputLabel": "Jour", "openCalendarButtonLabel": "Modifier la date", - "closeCalendarButtonLabel": "Fermer le calendrier", "applyDateButtonLabel": "Appliquer la date", "clearDateButtonLabel": "Supprimer la date" } diff --git a/packages/circuit-ui/components/DateInput/translations/fr-CH.json b/packages/circuit-ui/components/DateInput/translations/fr-CH.json index 60b957b707..b64b642d95 100644 --- a/packages/circuit-ui/components/DateInput/translations/fr-CH.json +++ b/packages/circuit-ui/components/DateInput/translations/fr-CH.json @@ -3,7 +3,6 @@ "monthInputLabel": "Mois", "dayInputLabel": "Jour", "openCalendarButtonLabel": "Modifier la date", - "closeCalendarButtonLabel": "Fermer le calendrier", "applyDateButtonLabel": "Appliquer la date", "clearDateButtonLabel": "Supprimer la date" } diff --git a/packages/circuit-ui/components/DateInput/translations/fr-FR.json b/packages/circuit-ui/components/DateInput/translations/fr-FR.json index 60b957b707..b64b642d95 100644 --- a/packages/circuit-ui/components/DateInput/translations/fr-FR.json +++ b/packages/circuit-ui/components/DateInput/translations/fr-FR.json @@ -3,7 +3,6 @@ "monthInputLabel": "Mois", "dayInputLabel": "Jour", "openCalendarButtonLabel": "Modifier la date", - "closeCalendarButtonLabel": "Fermer le calendrier", "applyDateButtonLabel": "Appliquer la date", "clearDateButtonLabel": "Supprimer la date" } diff --git a/packages/circuit-ui/components/DateInput/translations/fr-LU.json b/packages/circuit-ui/components/DateInput/translations/fr-LU.json index 60b957b707..b64b642d95 100644 --- a/packages/circuit-ui/components/DateInput/translations/fr-LU.json +++ b/packages/circuit-ui/components/DateInput/translations/fr-LU.json @@ -3,7 +3,6 @@ "monthInputLabel": "Mois", "dayInputLabel": "Jour", "openCalendarButtonLabel": "Modifier la date", - "closeCalendarButtonLabel": "Fermer le calendrier", "applyDateButtonLabel": "Appliquer la date", "clearDateButtonLabel": "Supprimer la date" } diff --git a/packages/circuit-ui/components/DateInput/translations/hr-HR.json b/packages/circuit-ui/components/DateInput/translations/hr-HR.json index 146e5b3537..614f9bf0bb 100644 --- a/packages/circuit-ui/components/DateInput/translations/hr-HR.json +++ b/packages/circuit-ui/components/DateInput/translations/hr-HR.json @@ -3,7 +3,6 @@ "monthInputLabel": "Mjesec", "dayInputLabel": "Dan", "openCalendarButtonLabel": "Promijeni datum", - "closeCalendarButtonLabel": "Zatvori kalendar", "applyDateButtonLabel": "Primijeni datum", "clearDateButtonLabel": "Izbriši datum" } diff --git a/packages/circuit-ui/components/DateInput/translations/hu-HU.json b/packages/circuit-ui/components/DateInput/translations/hu-HU.json index c069789acf..14d9d22c05 100644 --- a/packages/circuit-ui/components/DateInput/translations/hu-HU.json +++ b/packages/circuit-ui/components/DateInput/translations/hu-HU.json @@ -3,7 +3,6 @@ "monthInputLabel": "Hónap", "dayInputLabel": "Nap", "openCalendarButtonLabel": "Dátum módosítása", - "closeCalendarButtonLabel": "Naptár bezárása", "applyDateButtonLabel": "Dátuma alkalmazása", "clearDateButtonLabel": "Dátum törlése" } diff --git a/packages/circuit-ui/components/DateInput/translations/it-CH.json b/packages/circuit-ui/components/DateInput/translations/it-CH.json index 310ba513ec..0464936058 100644 --- a/packages/circuit-ui/components/DateInput/translations/it-CH.json +++ b/packages/circuit-ui/components/DateInput/translations/it-CH.json @@ -3,7 +3,6 @@ "monthInputLabel": "Mese", "dayInputLabel": "Giorno", "openCalendarButtonLabel": "Modifica data", - "closeCalendarButtonLabel": "Chiudi calendario", "applyDateButtonLabel": "Applica data", "clearDateButtonLabel": "Rimuovi data" } diff --git a/packages/circuit-ui/components/DateInput/translations/it-IT.json b/packages/circuit-ui/components/DateInput/translations/it-IT.json index 310ba513ec..0464936058 100644 --- a/packages/circuit-ui/components/DateInput/translations/it-IT.json +++ b/packages/circuit-ui/components/DateInput/translations/it-IT.json @@ -3,7 +3,6 @@ "monthInputLabel": "Mese", "dayInputLabel": "Giorno", "openCalendarButtonLabel": "Modifica data", - "closeCalendarButtonLabel": "Chiudi calendario", "applyDateButtonLabel": "Applica data", "clearDateButtonLabel": "Rimuovi data" } diff --git a/packages/circuit-ui/components/DateInput/translations/lt-LT.json b/packages/circuit-ui/components/DateInput/translations/lt-LT.json index 3040347e7f..5fa4fed88f 100644 --- a/packages/circuit-ui/components/DateInput/translations/lt-LT.json +++ b/packages/circuit-ui/components/DateInput/translations/lt-LT.json @@ -3,7 +3,6 @@ "monthInputLabel": "Mėnuo", "dayInputLabel": "Diena", "openCalendarButtonLabel": "Keisti datą", - "closeCalendarButtonLabel": "Uždaryti kalendorių", "applyDateButtonLabel": "Taikyti datą", "clearDateButtonLabel": "Išvalyti datą" } diff --git a/packages/circuit-ui/components/DateInput/translations/lv-LV.json b/packages/circuit-ui/components/DateInput/translations/lv-LV.json index 4983f17a04..72844103f9 100644 --- a/packages/circuit-ui/components/DateInput/translations/lv-LV.json +++ b/packages/circuit-ui/components/DateInput/translations/lv-LV.json @@ -3,7 +3,6 @@ "monthInputLabel": "Mēnesis", "dayInputLabel": "Diena", "openCalendarButtonLabel": "Mainīt datumu", - "closeCalendarButtonLabel": "Aizvērt kalendāru", "applyDateButtonLabel": "Piemērot datumu", "clearDateButtonLabel": "Notīrīt datumu" } diff --git a/packages/circuit-ui/components/DateInput/translations/nb-NO.json b/packages/circuit-ui/components/DateInput/translations/nb-NO.json index 520258708a..06eb8bf272 100644 --- a/packages/circuit-ui/components/DateInput/translations/nb-NO.json +++ b/packages/circuit-ui/components/DateInput/translations/nb-NO.json @@ -3,7 +3,6 @@ "monthInputLabel": "Måned", "dayInputLabel": "Dag", "openCalendarButtonLabel": "Endre dato", - "closeCalendarButtonLabel": "Lukk kalender", "applyDateButtonLabel": "Bruk dato", "clearDateButtonLabel": "Slett dato" } diff --git a/packages/circuit-ui/components/DateInput/translations/nl-BE.json b/packages/circuit-ui/components/DateInput/translations/nl-BE.json index fcda3b845b..5fed2e2b6b 100644 --- a/packages/circuit-ui/components/DateInput/translations/nl-BE.json +++ b/packages/circuit-ui/components/DateInput/translations/nl-BE.json @@ -3,7 +3,6 @@ "monthInputLabel": "Maand", "dayInputLabel": "Dag", "openCalendarButtonLabel": "Datum wijzigen", - "closeCalendarButtonLabel": "Agenda sluiten", "applyDateButtonLabel": "Datum toepassen", "clearDateButtonLabel": "Datum wissen" } diff --git a/packages/circuit-ui/components/DateInput/translations/nl-NL.json b/packages/circuit-ui/components/DateInput/translations/nl-NL.json index fcda3b845b..5fed2e2b6b 100644 --- a/packages/circuit-ui/components/DateInput/translations/nl-NL.json +++ b/packages/circuit-ui/components/DateInput/translations/nl-NL.json @@ -3,7 +3,6 @@ "monthInputLabel": "Maand", "dayInputLabel": "Dag", "openCalendarButtonLabel": "Datum wijzigen", - "closeCalendarButtonLabel": "Agenda sluiten", "applyDateButtonLabel": "Datum toepassen", "clearDateButtonLabel": "Datum wissen" } diff --git a/packages/circuit-ui/components/DateInput/translations/pl-PL.json b/packages/circuit-ui/components/DateInput/translations/pl-PL.json index fbfa42c141..3f9b08fdfd 100644 --- a/packages/circuit-ui/components/DateInput/translations/pl-PL.json +++ b/packages/circuit-ui/components/DateInput/translations/pl-PL.json @@ -3,7 +3,6 @@ "monthInputLabel": "Miesiąc", "dayInputLabel": "Dzień", "openCalendarButtonLabel": "Zmień datę", - "closeCalendarButtonLabel": "Zamknij kalendarz", "applyDateButtonLabel": "Zastosuj datę", "clearDateButtonLabel": "Usuń datę" } diff --git a/packages/circuit-ui/components/DateInput/translations/pt-BR.json b/packages/circuit-ui/components/DateInput/translations/pt-BR.json index 22096f95a2..9ae9bc64f5 100644 --- a/packages/circuit-ui/components/DateInput/translations/pt-BR.json +++ b/packages/circuit-ui/components/DateInput/translations/pt-BR.json @@ -3,7 +3,6 @@ "monthInputLabel": "Mês", "dayInputLabel": "Dia", "openCalendarButtonLabel": "Alterar data", - "closeCalendarButtonLabel": "Fechar agenda", "applyDateButtonLabel": "Aplicar data", "clearDateButtonLabel": "Limpar data" } diff --git a/packages/circuit-ui/components/DateInput/translations/pt-PT.json b/packages/circuit-ui/components/DateInput/translations/pt-PT.json index f401597430..9ae9bc64f5 100644 --- a/packages/circuit-ui/components/DateInput/translations/pt-PT.json +++ b/packages/circuit-ui/components/DateInput/translations/pt-PT.json @@ -3,7 +3,6 @@ "monthInputLabel": "Mês", "dayInputLabel": "Dia", "openCalendarButtonLabel": "Alterar data", - "closeCalendarButtonLabel": "Fechar calendário", "applyDateButtonLabel": "Aplicar data", "clearDateButtonLabel": "Limpar data" } diff --git a/packages/circuit-ui/components/DateInput/translations/ro-RO.json b/packages/circuit-ui/components/DateInput/translations/ro-RO.json index 4ba85f22de..8fa0f694ae 100644 --- a/packages/circuit-ui/components/DateInput/translations/ro-RO.json +++ b/packages/circuit-ui/components/DateInput/translations/ro-RO.json @@ -3,7 +3,6 @@ "monthInputLabel": "Lună", "dayInputLabel": "Zi", "openCalendarButtonLabel": "Modifică data", - "closeCalendarButtonLabel": "Închide calendarul", "applyDateButtonLabel": "Aplică data", "clearDateButtonLabel": "Șterge data" } diff --git a/packages/circuit-ui/components/DateInput/translations/sk-SK.json b/packages/circuit-ui/components/DateInput/translations/sk-SK.json index b1f5665ada..3680451f23 100644 --- a/packages/circuit-ui/components/DateInput/translations/sk-SK.json +++ b/packages/circuit-ui/components/DateInput/translations/sk-SK.json @@ -3,7 +3,6 @@ "monthInputLabel": "Mesiac", "dayInputLabel": "Deň", "openCalendarButtonLabel": "Zmeniť dátum?", - "closeCalendarButtonLabel": "Zatvoriť kalendár", "applyDateButtonLabel": "Vybrať dátum", "clearDateButtonLabel": "Vymazať dátum" } diff --git a/packages/circuit-ui/components/DateInput/translations/sl-SI.json b/packages/circuit-ui/components/DateInput/translations/sl-SI.json index da53cc8061..d71690ed4e 100644 --- a/packages/circuit-ui/components/DateInput/translations/sl-SI.json +++ b/packages/circuit-ui/components/DateInput/translations/sl-SI.json @@ -3,7 +3,6 @@ "monthInputLabel": "Mesec", "dayInputLabel": "Dan", "openCalendarButtonLabel": "Spremeni datum", - "closeCalendarButtonLabel": "Zapri koledar", "applyDateButtonLabel": "Uporabi datum", "clearDateButtonLabel": "Počisti datum" } diff --git a/packages/circuit-ui/components/DateInput/translations/sv-SE.json b/packages/circuit-ui/components/DateInput/translations/sv-SE.json index 42dc825800..e31be75fa5 100644 --- a/packages/circuit-ui/components/DateInput/translations/sv-SE.json +++ b/packages/circuit-ui/components/DateInput/translations/sv-SE.json @@ -3,7 +3,6 @@ "monthInputLabel": "Månad", "dayInputLabel": "Dag", "openCalendarButtonLabel": "Ändra datum", - "closeCalendarButtonLabel": "Stäng kalendern", "applyDateButtonLabel": "Välj datum", "clearDateButtonLabel": "Rensa datum" } diff --git a/packages/circuit-ui/components/Dialog/Dialog.stories.tsx b/packages/circuit-ui/components/Dialog/Dialog.stories.tsx index ffea83dc25..e9d8791895 100644 --- a/packages/circuit-ui/components/Dialog/Dialog.stories.tsx +++ b/packages/circuit-ui/components/Dialog/Dialog.stories.tsx @@ -80,7 +80,6 @@ const baseArgs: DialogProps = { onCloseEnd: () => {}, 'aria-labelledby': 'title', 'aria-describedby': 'description', - closeButtonLabel: 'Close', children: defaultChildren, style: dialogStyles, }; diff --git a/packages/circuit-ui/components/Dialog/Dialog.tsx b/packages/circuit-ui/components/Dialog/Dialog.tsx index 6ee75f2cde..ba50b740d4 100644 --- a/packages/circuit-ui/components/Dialog/Dialog.tsx +++ b/packages/circuit-ui/components/Dialog/Dialog.tsx @@ -36,9 +36,11 @@ import { clsx } from '../../styles/clsx.js'; import { useClickOutside } from '../../hooks/useClickOutside/index.js'; import { useEscapeKey } from '../../hooks/useEscapeKey/index.js'; import { useLatest } from '../../hooks/useLatest/index.js'; +import { useI18n } from '../../hooks/useI18n/useI18n.js'; import { getFirstFocusableElement } from './DialogService.js'; import classes from './dialog.module.css'; +import { translations } from './translations/index.js'; type DataAttribute = `data-${string}`; @@ -119,7 +121,7 @@ export const Dialog = forwardRef( animationDuration = 0, onCloseStart, ...rest - } = props; + } = useI18n(props, translations); const dialogRef = useRef(null); const openRef = useLatest(open); const animationDurationRef = useLatest(animationDuration); diff --git a/packages/circuit-ui/components/Modal/translations/bg-BG.json b/packages/circuit-ui/components/Dialog/translations/bg-BG.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/bg-BG.json rename to packages/circuit-ui/components/Dialog/translations/bg-BG.json diff --git a/packages/circuit-ui/components/Modal/translations/cs-CZ.json b/packages/circuit-ui/components/Dialog/translations/cs-CZ.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/cs-CZ.json rename to packages/circuit-ui/components/Dialog/translations/cs-CZ.json diff --git a/packages/circuit-ui/components/Modal/translations/da-DK.json b/packages/circuit-ui/components/Dialog/translations/da-DK.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/da-DK.json rename to packages/circuit-ui/components/Dialog/translations/da-DK.json diff --git a/packages/circuit-ui/components/Modal/translations/de-AT.json b/packages/circuit-ui/components/Dialog/translations/de-AT.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/de-AT.json rename to packages/circuit-ui/components/Dialog/translations/de-AT.json diff --git a/packages/circuit-ui/components/Modal/translations/de-CH.json b/packages/circuit-ui/components/Dialog/translations/de-CH.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/de-CH.json rename to packages/circuit-ui/components/Dialog/translations/de-CH.json diff --git a/packages/circuit-ui/components/Modal/translations/de-DE.json b/packages/circuit-ui/components/Dialog/translations/de-DE.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/de-DE.json rename to packages/circuit-ui/components/Dialog/translations/de-DE.json diff --git a/packages/circuit-ui/components/Modal/translations/de-LU.json b/packages/circuit-ui/components/Dialog/translations/de-LU.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/de-LU.json rename to packages/circuit-ui/components/Dialog/translations/de-LU.json diff --git a/packages/circuit-ui/components/Modal/translations/el-CY.json b/packages/circuit-ui/components/Dialog/translations/el-CY.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/el-CY.json rename to packages/circuit-ui/components/Dialog/translations/el-CY.json diff --git a/packages/circuit-ui/components/Modal/translations/el-GR.json b/packages/circuit-ui/components/Dialog/translations/el-GR.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/el-GR.json rename to packages/circuit-ui/components/Dialog/translations/el-GR.json diff --git a/packages/circuit-ui/components/Modal/translations/en-AU.json b/packages/circuit-ui/components/Dialog/translations/en-AU.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/en-AU.json rename to packages/circuit-ui/components/Dialog/translations/en-AU.json diff --git a/packages/circuit-ui/components/Modal/translations/en-GB.json b/packages/circuit-ui/components/Dialog/translations/en-GB.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/en-GB.json rename to packages/circuit-ui/components/Dialog/translations/en-GB.json diff --git a/packages/circuit-ui/components/Modal/translations/en-IE.json b/packages/circuit-ui/components/Dialog/translations/en-IE.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/en-IE.json rename to packages/circuit-ui/components/Dialog/translations/en-IE.json diff --git a/packages/circuit-ui/components/Modal/translations/en-MT.json b/packages/circuit-ui/components/Dialog/translations/en-MT.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/en-MT.json rename to packages/circuit-ui/components/Dialog/translations/en-MT.json diff --git a/packages/circuit-ui/components/Modal/translations/en-US.json b/packages/circuit-ui/components/Dialog/translations/en-US.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/en-US.json rename to packages/circuit-ui/components/Dialog/translations/en-US.json diff --git a/packages/circuit-ui/components/Modal/translations/es-CL.json b/packages/circuit-ui/components/Dialog/translations/es-CL.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/es-CL.json rename to packages/circuit-ui/components/Dialog/translations/es-CL.json diff --git a/packages/circuit-ui/components/Modal/translations/es-CO.json b/packages/circuit-ui/components/Dialog/translations/es-CO.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/es-CO.json rename to packages/circuit-ui/components/Dialog/translations/es-CO.json diff --git a/packages/circuit-ui/components/Modal/translations/es-ES.json b/packages/circuit-ui/components/Dialog/translations/es-ES.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/es-ES.json rename to packages/circuit-ui/components/Dialog/translations/es-ES.json diff --git a/packages/circuit-ui/components/Modal/translations/es-MX.json b/packages/circuit-ui/components/Dialog/translations/es-MX.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/es-MX.json rename to packages/circuit-ui/components/Dialog/translations/es-MX.json diff --git a/packages/circuit-ui/components/Modal/translations/es-PE.json b/packages/circuit-ui/components/Dialog/translations/es-PE.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/es-PE.json rename to packages/circuit-ui/components/Dialog/translations/es-PE.json diff --git a/packages/circuit-ui/components/Modal/translations/es-US.json b/packages/circuit-ui/components/Dialog/translations/es-US.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/es-US.json rename to packages/circuit-ui/components/Dialog/translations/es-US.json diff --git a/packages/circuit-ui/components/Modal/translations/et-EE.json b/packages/circuit-ui/components/Dialog/translations/et-EE.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/et-EE.json rename to packages/circuit-ui/components/Dialog/translations/et-EE.json diff --git a/packages/circuit-ui/components/Modal/translations/fi-FI.json b/packages/circuit-ui/components/Dialog/translations/fi-FI.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/fi-FI.json rename to packages/circuit-ui/components/Dialog/translations/fi-FI.json diff --git a/packages/circuit-ui/components/Modal/translations/fr-BE.json b/packages/circuit-ui/components/Dialog/translations/fr-BE.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/fr-BE.json rename to packages/circuit-ui/components/Dialog/translations/fr-BE.json diff --git a/packages/circuit-ui/components/Modal/translations/fr-CH.json b/packages/circuit-ui/components/Dialog/translations/fr-CH.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/fr-CH.json rename to packages/circuit-ui/components/Dialog/translations/fr-CH.json diff --git a/packages/circuit-ui/components/Modal/translations/fr-FR.json b/packages/circuit-ui/components/Dialog/translations/fr-FR.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/fr-FR.json rename to packages/circuit-ui/components/Dialog/translations/fr-FR.json diff --git a/packages/circuit-ui/components/Modal/translations/fr-LU.json b/packages/circuit-ui/components/Dialog/translations/fr-LU.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/fr-LU.json rename to packages/circuit-ui/components/Dialog/translations/fr-LU.json diff --git a/packages/circuit-ui/components/Modal/translations/hr-HR.json b/packages/circuit-ui/components/Dialog/translations/hr-HR.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/hr-HR.json rename to packages/circuit-ui/components/Dialog/translations/hr-HR.json diff --git a/packages/circuit-ui/components/Modal/translations/hu-HU.json b/packages/circuit-ui/components/Dialog/translations/hu-HU.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/hu-HU.json rename to packages/circuit-ui/components/Dialog/translations/hu-HU.json diff --git a/packages/circuit-ui/components/Modal/translations/index.ts b/packages/circuit-ui/components/Dialog/translations/index.ts similarity index 100% rename from packages/circuit-ui/components/Modal/translations/index.ts rename to packages/circuit-ui/components/Dialog/translations/index.ts diff --git a/packages/circuit-ui/components/Modal/translations/it-CH.json b/packages/circuit-ui/components/Dialog/translations/it-CH.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/it-CH.json rename to packages/circuit-ui/components/Dialog/translations/it-CH.json diff --git a/packages/circuit-ui/components/Modal/translations/it-IT.json b/packages/circuit-ui/components/Dialog/translations/it-IT.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/it-IT.json rename to packages/circuit-ui/components/Dialog/translations/it-IT.json diff --git a/packages/circuit-ui/components/Modal/translations/lt-LT.json b/packages/circuit-ui/components/Dialog/translations/lt-LT.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/lt-LT.json rename to packages/circuit-ui/components/Dialog/translations/lt-LT.json diff --git a/packages/circuit-ui/components/Modal/translations/lv-LV.json b/packages/circuit-ui/components/Dialog/translations/lv-LV.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/lv-LV.json rename to packages/circuit-ui/components/Dialog/translations/lv-LV.json diff --git a/packages/circuit-ui/components/Modal/translations/nb-NO.json b/packages/circuit-ui/components/Dialog/translations/nb-NO.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/nb-NO.json rename to packages/circuit-ui/components/Dialog/translations/nb-NO.json diff --git a/packages/circuit-ui/components/Modal/translations/nl-BE.json b/packages/circuit-ui/components/Dialog/translations/nl-BE.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/nl-BE.json rename to packages/circuit-ui/components/Dialog/translations/nl-BE.json diff --git a/packages/circuit-ui/components/Modal/translations/nl-NL.json b/packages/circuit-ui/components/Dialog/translations/nl-NL.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/nl-NL.json rename to packages/circuit-ui/components/Dialog/translations/nl-NL.json diff --git a/packages/circuit-ui/components/Modal/translations/pl-PL.json b/packages/circuit-ui/components/Dialog/translations/pl-PL.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/pl-PL.json rename to packages/circuit-ui/components/Dialog/translations/pl-PL.json diff --git a/packages/circuit-ui/components/Modal/translations/pt-BR.json b/packages/circuit-ui/components/Dialog/translations/pt-BR.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/pt-BR.json rename to packages/circuit-ui/components/Dialog/translations/pt-BR.json diff --git a/packages/circuit-ui/components/Modal/translations/pt-PT.json b/packages/circuit-ui/components/Dialog/translations/pt-PT.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/pt-PT.json rename to packages/circuit-ui/components/Dialog/translations/pt-PT.json diff --git a/packages/circuit-ui/components/Modal/translations/ro-RO.json b/packages/circuit-ui/components/Dialog/translations/ro-RO.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/ro-RO.json rename to packages/circuit-ui/components/Dialog/translations/ro-RO.json diff --git a/packages/circuit-ui/components/Modal/translations/sk-SK.json b/packages/circuit-ui/components/Dialog/translations/sk-SK.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/sk-SK.json rename to packages/circuit-ui/components/Dialog/translations/sk-SK.json diff --git a/packages/circuit-ui/components/Modal/translations/sl-SI.json b/packages/circuit-ui/components/Dialog/translations/sl-SI.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/sl-SI.json rename to packages/circuit-ui/components/Dialog/translations/sl-SI.json diff --git a/packages/circuit-ui/components/Modal/translations/sv-SE.json b/packages/circuit-ui/components/Dialog/translations/sv-SE.json similarity index 100% rename from packages/circuit-ui/components/Modal/translations/sv-SE.json rename to packages/circuit-ui/components/Dialog/translations/sv-SE.json diff --git a/packages/circuit-ui/components/Modal/Modal.stories.tsx b/packages/circuit-ui/components/Modal/Modal.stories.tsx index dc1f3463a7..5975d7488a 100644 --- a/packages/circuit-ui/components/Modal/Modal.stories.tsx +++ b/packages/circuit-ui/components/Modal/Modal.stories.tsx @@ -79,7 +79,6 @@ const baseArgs: ModalProps = { 'aria-labelledby': 'title', 'aria-describedby': 'description', variant: 'contextual', - closeButtonLabel: 'Close', children: defaultModalChildren, }; diff --git a/packages/circuit-ui/components/Modal/Modal.tsx b/packages/circuit-ui/components/Modal/Modal.tsx index c05de7d8ac..2112879b3a 100644 --- a/packages/circuit-ui/components/Modal/Modal.tsx +++ b/packages/circuit-ui/components/Modal/Modal.tsx @@ -18,14 +18,12 @@ import { forwardRef, useCallback, useState } from 'react'; import { clsx } from '../../styles/clsx.js'; -import { useI18n } from '../../hooks/useI18n/useI18n.js'; import { deprecate } from '../../util/logger.js'; import { Dialog, type DialogProps } from '../Dialog/Dialog.js'; import { sharedClasses } from '../../styles/shared.js'; import { useMedia } from '../../hooks/useMedia/index.js'; import classes from './Modal.module.css'; -import { translations } from './translations/index.js'; export interface ModalProps extends Omit< @@ -58,7 +56,7 @@ export const Modal = forwardRef((props, ref) => { children, onClose, ...rest - } = useI18n(props, translations); + } = props; if (process.env.NODE_ENV !== 'production') { if (hideCloseButton) { deprecate( diff --git a/packages/circuit-ui/components/Toggletip/Toggletip.tsx b/packages/circuit-ui/components/Toggletip/Toggletip.tsx index 3ea3aeac15..085d59ffec 100644 --- a/packages/circuit-ui/components/Toggletip/Toggletip.tsx +++ b/packages/circuit-ui/components/Toggletip/Toggletip.tsx @@ -24,7 +24,6 @@ import { useRef, useState, type ComponentType, - type HTMLAttributes, } from 'react'; import { arrow, @@ -45,12 +44,9 @@ import { CloseButton } from '../CloseButton/index.js'; import { Headline } from '../Headline/index.js'; import { Body } from '../Body/index.js'; import { Button, type ButtonProps } from '../Button/index.js'; -import { useI18n } from '../../hooks/useI18n/useI18n.js'; -import type { Locale } from '../../util/i18n.js'; -import { Dialog } from '../Dialog/Dialog.js'; +import { Dialog, type DialogProps } from '../Dialog/Dialog.js'; import classes from './Toggletip.module.css'; -import { translations } from './translations/index.js'; export interface ToggletipReferenceProps { 'id': string; @@ -58,7 +54,11 @@ export interface ToggletipReferenceProps { 'aria-haspopup': 'dialog'; } -export interface ToggletipProps extends HTMLAttributes { +export interface ToggletipProps + extends Omit< + DialogProps, + 'onCloseStart' | 'onCloseEnd' | 'isModal' | 'animationDuration' + > { /** * The button element that triggers the toggletip. */ @@ -81,10 +81,6 @@ export interface ToggletipProps extends HTMLAttributes { * follow with a one-word object if needed to clarify. */ action?: Omit; - /** - * Label for the toggletip's close button. - */ - closeButtonLabel?: string; /** * Whether the toggletip is initially open. Default: 'false'. */ @@ -105,13 +101,6 @@ export interface ToggletipProps extends HTMLAttributes { * Default: 12. */ offset?: number | { mainAxis?: number; crossAxis?: number }; - /** - * One or more [IETF BCP 47](https://en.wikipedia.org/wiki/IETF_language_tag) - * locale identifiers such as `'de-DE'` or `['GB', 'en-US']`. - * When passing an array, the first supported locale is used. - * Defaults to `navigator.language` in supported environments. - */ - locale?: Locale; } export const Toggletip = forwardRef( @@ -129,7 +118,7 @@ export const Toggletip = forwardRef( style, locale, ...rest - } = useI18n(props, translations); + } = props; const zIndex = useStackContext(); const isMobile = useMedia('(max-width: 479px)'); const arrowRef = useRef(null); @@ -224,6 +213,7 @@ export const Toggletip = forwardRef( aria-labelledby={headline ? headlineId : bodyId} aria-describedby={headline ? bodyId : undefined} className={clsx(classes.base, className)} + closeButtonLabel={closeButtonLabel} style={{ ...style, ...dialogStyles, diff --git a/packages/circuit-ui/components/Toggletip/translations/bg-BG.json b/packages/circuit-ui/components/Toggletip/translations/bg-BG.json deleted file mode 100644 index ddf333d07f..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/bg-BG.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Затвори" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/cs-CZ.json b/packages/circuit-ui/components/Toggletip/translations/cs-CZ.json deleted file mode 100644 index 78f6b38afd..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/cs-CZ.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Zavřít" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/da-DK.json b/packages/circuit-ui/components/Toggletip/translations/da-DK.json deleted file mode 100644 index 12c5d6f111..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/da-DK.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Luk" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/de-AT.json b/packages/circuit-ui/components/Toggletip/translations/de-AT.json deleted file mode 100644 index b6226360c4..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/de-AT.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Schließen" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/de-CH.json b/packages/circuit-ui/components/Toggletip/translations/de-CH.json deleted file mode 100644 index ddcc840f48..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/de-CH.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Schliessen" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/de-DE.json b/packages/circuit-ui/components/Toggletip/translations/de-DE.json deleted file mode 100644 index b6226360c4..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/de-DE.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Schließen" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/de-LU.json b/packages/circuit-ui/components/Toggletip/translations/de-LU.json deleted file mode 100644 index b6226360c4..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/de-LU.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Schließen" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/el-CY.json b/packages/circuit-ui/components/Toggletip/translations/el-CY.json deleted file mode 100644 index 33d5e74c1d..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/el-CY.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Κλείσιμο" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/el-GR.json b/packages/circuit-ui/components/Toggletip/translations/el-GR.json deleted file mode 100644 index 33d5e74c1d..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/el-GR.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Κλείσιμο" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/en-AU.json b/packages/circuit-ui/components/Toggletip/translations/en-AU.json deleted file mode 100644 index 5fb33ad8f3..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/en-AU.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Close" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/en-GB.json b/packages/circuit-ui/components/Toggletip/translations/en-GB.json deleted file mode 100644 index 5fb33ad8f3..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/en-GB.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Close" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/en-IE.json b/packages/circuit-ui/components/Toggletip/translations/en-IE.json deleted file mode 100644 index 5fb33ad8f3..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/en-IE.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Close" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/en-MT.json b/packages/circuit-ui/components/Toggletip/translations/en-MT.json deleted file mode 100644 index 5fb33ad8f3..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/en-MT.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Close" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/en-US.json b/packages/circuit-ui/components/Toggletip/translations/en-US.json deleted file mode 100644 index 5fb33ad8f3..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/en-US.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Close" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/es-CL.json b/packages/circuit-ui/components/Toggletip/translations/es-CL.json deleted file mode 100644 index b46dc02916..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/es-CL.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Cerrar" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/es-CO.json b/packages/circuit-ui/components/Toggletip/translations/es-CO.json deleted file mode 100644 index b46dc02916..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/es-CO.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Cerrar" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/es-ES.json b/packages/circuit-ui/components/Toggletip/translations/es-ES.json deleted file mode 100644 index b46dc02916..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/es-ES.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Cerrar" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/es-MX.json b/packages/circuit-ui/components/Toggletip/translations/es-MX.json deleted file mode 100644 index b46dc02916..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/es-MX.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Cerrar" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/es-PE.json b/packages/circuit-ui/components/Toggletip/translations/es-PE.json deleted file mode 100644 index b46dc02916..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/es-PE.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Cerrar" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/es-US.json b/packages/circuit-ui/components/Toggletip/translations/es-US.json deleted file mode 100644 index b46dc02916..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/es-US.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Cerrar" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/et-EE.json b/packages/circuit-ui/components/Toggletip/translations/et-EE.json deleted file mode 100644 index a9d5010617..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/et-EE.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Sulge" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/fi-FI.json b/packages/circuit-ui/components/Toggletip/translations/fi-FI.json deleted file mode 100644 index 10d8058a44..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/fi-FI.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Sulje" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/fr-BE.json b/packages/circuit-ui/components/Toggletip/translations/fr-BE.json deleted file mode 100644 index b071a84d05..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/fr-BE.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Fermer" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/fr-CH.json b/packages/circuit-ui/components/Toggletip/translations/fr-CH.json deleted file mode 100644 index b071a84d05..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/fr-CH.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Fermer" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/fr-FR.json b/packages/circuit-ui/components/Toggletip/translations/fr-FR.json deleted file mode 100644 index b071a84d05..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/fr-FR.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Fermer" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/fr-LU.json b/packages/circuit-ui/components/Toggletip/translations/fr-LU.json deleted file mode 100644 index b071a84d05..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/fr-LU.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Fermer" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/hr-HR.json b/packages/circuit-ui/components/Toggletip/translations/hr-HR.json deleted file mode 100644 index 58c4e9bbb8..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/hr-HR.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Zatvori" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/hu-HU.json b/packages/circuit-ui/components/Toggletip/translations/hu-HU.json deleted file mode 100644 index f1f68c32e6..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/hu-HU.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Bezárás" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/index.ts b/packages/circuit-ui/components/Toggletip/translations/index.ts deleted file mode 100644 index d0df2ae94b..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/index.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright 2024, SumUp Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { transformModulesToTranslations } from '../../../util/i18n.js'; - -export const translations = transformModulesToTranslations< - typeof import('./en-US.json') ->( - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore import.meta.glob is supported by Vite - import.meta.glob('./*.json', { - eager: true, - }), -); diff --git a/packages/circuit-ui/components/Toggletip/translations/it-CH.json b/packages/circuit-ui/components/Toggletip/translations/it-CH.json deleted file mode 100644 index 73c3efb158..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/it-CH.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Chiudi" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/it-IT.json b/packages/circuit-ui/components/Toggletip/translations/it-IT.json deleted file mode 100644 index 73c3efb158..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/it-IT.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Chiudi" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/lt-LT.json b/packages/circuit-ui/components/Toggletip/translations/lt-LT.json deleted file mode 100644 index b55cf74468..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/lt-LT.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Uždaryti" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/lv-LV.json b/packages/circuit-ui/components/Toggletip/translations/lv-LV.json deleted file mode 100644 index 486fc0ee7a..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/lv-LV.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Aizvērt" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/nb-NO.json b/packages/circuit-ui/components/Toggletip/translations/nb-NO.json deleted file mode 100644 index 72f78d9c6a..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/nb-NO.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Lukk" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/nl-BE.json b/packages/circuit-ui/components/Toggletip/translations/nl-BE.json deleted file mode 100644 index 538d49ed54..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/nl-BE.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Sluit" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/nl-NL.json b/packages/circuit-ui/components/Toggletip/translations/nl-NL.json deleted file mode 100644 index f2a9127e10..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/nl-NL.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Sluiten" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/pl-PL.json b/packages/circuit-ui/components/Toggletip/translations/pl-PL.json deleted file mode 100644 index a1cb3d0112..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/pl-PL.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Zamknij" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/pt-BR.json b/packages/circuit-ui/components/Toggletip/translations/pt-BR.json deleted file mode 100644 index 12ce2fa58f..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/pt-BR.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Fechar" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/pt-PT.json b/packages/circuit-ui/components/Toggletip/translations/pt-PT.json deleted file mode 100644 index 12ce2fa58f..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/pt-PT.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Fechar" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/ro-RO.json b/packages/circuit-ui/components/Toggletip/translations/ro-RO.json deleted file mode 100644 index 58d8225420..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/ro-RO.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Închide" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/sk-SK.json b/packages/circuit-ui/components/Toggletip/translations/sk-SK.json deleted file mode 100644 index 73e63be91a..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/sk-SK.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Zatvoriť" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/sl-SI.json b/packages/circuit-ui/components/Toggletip/translations/sl-SI.json deleted file mode 100644 index 364b505566..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/sl-SI.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Zapri" -} diff --git a/packages/circuit-ui/components/Toggletip/translations/sv-SE.json b/packages/circuit-ui/components/Toggletip/translations/sv-SE.json deleted file mode 100644 index 2d332d9d2a..0000000000 --- a/packages/circuit-ui/components/Toggletip/translations/sv-SE.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "closeButtonLabel": "Stäng" -} From 751dd7087b160a1322de2dfbe88aae22cec65703 Mon Sep 17 00:00:00 2001 From: sirineJ <112706079+sirineJ@users.noreply.github.com> Date: Wed, 15 Jan 2025 18:02:43 +0100 Subject: [PATCH 2/3] Cleanup components' props interfaces --- packages/circuit-ui/components/Dialog/Dialog.tsx | 2 +- .../circuit-ui/components/Modal/Modal.stories.tsx | 2 -- packages/circuit-ui/components/Modal/Modal.tsx | 8 ++++++-- packages/circuit-ui/components/Popover/Popover.tsx | 11 ++++++++++- .../circuit-ui/components/Toggletip/Toggletip.tsx | 14 +++++++++++--- 5 files changed, 28 insertions(+), 9 deletions(-) diff --git a/packages/circuit-ui/components/Dialog/Dialog.tsx b/packages/circuit-ui/components/Dialog/Dialog.tsx index ba50b740d4..f7537dfe03 100644 --- a/packages/circuit-ui/components/Dialog/Dialog.tsx +++ b/packages/circuit-ui/components/Dialog/Dialog.tsx @@ -88,7 +88,7 @@ export interface DialogProps */ preventClose?: boolean; /** - * Enables focusing a particular element in the dialog content and override default behavior. This will have no effect if the dialog is not modal. + * Enables focusing a particular element in the dialog content and overrides the default behavior. * @default `false`. */ initialFocusRef?: RefObject; diff --git a/packages/circuit-ui/components/Modal/Modal.stories.tsx b/packages/circuit-ui/components/Modal/Modal.stories.tsx index 5975d7488a..d40cc791d9 100644 --- a/packages/circuit-ui/components/Modal/Modal.stories.tsx +++ b/packages/circuit-ui/components/Modal/Modal.stories.tsx @@ -76,8 +76,6 @@ const openModal = async ({ const baseArgs: ModalProps = { open: false, onClose: () => {}, - 'aria-labelledby': 'title', - 'aria-describedby': 'description', variant: 'contextual', children: defaultModalChildren, }; diff --git a/packages/circuit-ui/components/Modal/Modal.tsx b/packages/circuit-ui/components/Modal/Modal.tsx index 2112879b3a..b1ae94f075 100644 --- a/packages/circuit-ui/components/Modal/Modal.tsx +++ b/packages/circuit-ui/components/Modal/Modal.tsx @@ -28,7 +28,11 @@ import classes from './Modal.module.css'; export interface ModalProps extends Omit< DialogProps, - 'onCloseStart' | 'onCloseEnd' | 'isModal' | 'animationDuration' + | 'onCloseStart' + | 'onCloseEnd' + | 'isModal' + | 'animationDuration' + | 'preventOutsideClickRefs' > { /** * Use the `immersive` variant to focus the user's attention on the dialog content. @@ -38,7 +42,7 @@ export interface ModalProps /** * Callback when the modal dialog is closed. */ - onClose: DialogProps['onCloseEnd']; + onClose?: DialogProps['onCloseEnd']; /** * @deprecated This prop was passed to `react-modal` and is no longer relevant. * Use the `preventClose` prop instead. Also see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/dialog_role#required_javascript_features diff --git a/packages/circuit-ui/components/Popover/Popover.tsx b/packages/circuit-ui/components/Popover/Popover.tsx index 8046d4a17e..998d1d9241 100644 --- a/packages/circuit-ui/components/Popover/Popover.tsx +++ b/packages/circuit-ui/components/Popover/Popover.tsx @@ -75,7 +75,16 @@ export interface PopoverReferenceProps { export interface PopoverProps extends Omit< DialogProps, - 'children' | 'role' | 'open' | 'onCloseEnd' | 'onCloseStart' + | 'children' + | 'role' + | 'open' + | 'onCloseEnd' + | 'onCloseStart' + | 'isModal' + | 'animationDuration' + | 'preventClose' + | 'initialFocusRef' + | 'preventOutsideClickRefs' > { /** * Determines whether the Popover is open or closed. diff --git a/packages/circuit-ui/components/Toggletip/Toggletip.tsx b/packages/circuit-ui/components/Toggletip/Toggletip.tsx index 085d59ffec..51121ae0fa 100644 --- a/packages/circuit-ui/components/Toggletip/Toggletip.tsx +++ b/packages/circuit-ui/components/Toggletip/Toggletip.tsx @@ -57,7 +57,15 @@ export interface ToggletipReferenceProps { export interface ToggletipProps extends Omit< DialogProps, - 'onCloseStart' | 'onCloseEnd' | 'isModal' | 'animationDuration' + | 'onCloseStart' + | 'onCloseEnd' + | 'isModal' + | 'animationDuration' + | 'initialFocusRef' + | 'open' + | 'preventClose' + | 'preventOutsideClickRefs' + | 'children' > { /** * The button element that triggers the toggletip. @@ -88,7 +96,7 @@ export interface ToggletipProps /** * Where to display the toggletip relative to the trigger component. The * toggletip will automatically move if there isn't enough space available. - * Default: 'top'. + * @default 'top'. */ placement?: Placement; /** @@ -98,7 +106,7 @@ export interface ToggletipProps * positive) or towards (if negative) the reference element. Pass an object * to displace the floating element on both the main and cross axes. * - * Default: 12. + * @default: 12. */ offset?: number | { mainAxis?: number; crossAxis?: number }; } From 12c73b462ce4a859599895e4863b308405f69256 Mon Sep 17 00:00:00 2001 From: sirineJ <112706079+sirineJ@users.noreply.github.com> Date: Thu, 16 Jan 2025 11:18:02 +0100 Subject: [PATCH 3/3] add changelog entry for components refactoring --- .changeset/spicy-avocados-provide.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/spicy-avocados-provide.md diff --git a/.changeset/spicy-avocados-provide.md b/.changeset/spicy-avocados-provide.md new file mode 100644 index 0000000000..bd19b8be3a --- /dev/null +++ b/.changeset/spicy-avocados-provide.md @@ -0,0 +1,5 @@ +--- +"@sumup-oss/circuit-ui": minor +--- + +Refactored the Modal, Popover, Toggletip, DateInput, SidePanel and SideNavigation components to leverage the internal Dialog component for improved consistency and maintainability.