Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

fix(Table): sort buttons and the scroll region are named by what they belong to (#9047)

Cindy Zhang8ff38ab97552
diff --git a/.changeset/table-names-own-text.md b/.changeset/table-names-own-text.md
new file mode 100644
index 0000000000..6c8c9c3262
--- /dev/null
+++ b/.changeset/table-names-own-text.md
@@ -0,0 +1,10 @@
+---
+'@astryxdesign/core': patch
+---
+
+[fix] `Table` names say what they belong to (WCAG 2.2 SC 4.1.2 and 2.4.6; the APG sortable table pattern under `spec:AST-020` FR15; `spec:AST-025` FR12).
+
+- A sort button was named "Sort by Name", or "Sort by Name, sorted ascending" with "priority 2 of 3" in multi-sort, and that phrase replaced the column header's name. It is now named by its column's text, so the header keeps that name; the direction comes from the header's `aria-sort`, and while several columns sort, each button is described by its priority ("Priority 2 of 3").
+- The scroll region was a group named "Table" on every table. It now takes the table's own name (its `aria-labelledby`, else its `aria-label`), and "Table" only for an unnamed table.
+
+@cixzhang @duytbp
diff --git a/internal/scripts/upload-crowdin-screenshots.mjs b/internal/scripts/upload-crowdin-screenshots.mjs
index 8492c4c605..a347e0a681 100644
--- a/internal/scripts/upload-crowdin-screenshots.mjs
+++ b/internal/scripts/upload-crowdin-screenshots.mjs
@@ -703,15 +703,15 @@ const TARGETS = [
{
name: 'table-sort-headers',
// The sort-direction strings (`Sort ascending`, `Sort descending`,
- // `Clear sort`) are NOT the column header aria-labels — those use the
- // compound `sortBy` / `sortedBy` templates. The three strings we care
- // about live in the header context menu, which opens on right-click.
+ // `Clear sort`) are not the column header buttons' names, which are the
+ // column text. The three strings we care about live in the header
+ // context menu, which opens on right-click.
// Right-clicking the currently-sorted column (Name) reveals all three
// options in one popover.
storyId: 'core-tablesortable--single-sort',
viewport: {width: 1100, height: 500},
interact: async page => {
- const header = page.getByRole('button', {name: /^Sort by Name/}).first();
+ const header = page.getByRole('button', {name: 'Name', exact: true}).first();
await header.waitFor({state: 'visible', timeout: 5000});
await header.click({button: 'right'});
// Wait for context menu.
diff --git a/packages/core/locales/af-ZA.json b/packages/core/locales/af-ZA.json
index a23a0bfcb1..38c7be3dd0 100644
--- a/packages/core/locales/af-ZA.json
+++ b/packages/core/locales/af-ZA.json
@@ -635,26 +635,6 @@
"defaultMessage": "Vee sortering uit",
"description": "Screen-reader-only label on a column header button that will remove the current sort. \"Clear\" here means remove, not transparent. Part of the sort set."
},
- "@astryx.table.sort.direction.ascending": {
- "defaultMessage": "opgaande",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.direction.descending": {
- "defaultMessage": "afgaande",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.sortBy": {
- "defaultMessage": "Sorteer volgens {label}",
- "description": "Aria label for a sortable Table header button when the column is unsorted. `label` is the column header text."
- },
- "@astryx.table.sort.sortedBy": {
- "defaultMessage": "Sorteer volgens {label}, gesorteer {direction}",
- "description": "Aria label for a sorted Table header button. `direction` is the localized direction word from @astryx.table.sort.direction.*."
- },
- "@astryx.table.sort.sortedByWithPriority": {
- "defaultMessage": "Sorteer volgens {label}, gesorteer {direction}, prioriteit {rank, number} van {total, number}",
- "description": "Aria label for a sorted Table header button in multi-sort. `rank` is the 1-based position of this column in the sort order; `total` is the number of sorted columns."
- },
"@astryx.toast.dismiss": {
"defaultMessage": "Maak kennisgewing toe",
"description": "Screen-reader-only label on the X button of a Toast (transient notification popup). Distinct from `banner.dismiss` (persistent banner)."
@@ -1480,4 +1460,3 @@
"description": "Default summary on the closed trigger of a lab TransferListSelector, stating how many options are currently chosen. Consumers usually override this with a domain phrase (e.g. \"7 columns\")."
}
}
-
diff --git a/packages/core/locales/ar-SA.json b/packages/core/locales/ar-SA.json
index 30905e2800..05faec1f87 100644
--- a/packages/core/locales/ar-SA.json
+++ b/packages/core/locales/ar-SA.json
@@ -635,26 +635,6 @@
"defaultMessage": "مسح الترتيب",
"description": "Screen-reader-only label on a column header button that will remove the current sort. \"Clear\" here means remove, not transparent. Part of the sort set."
},
- "@astryx.table.sort.direction.ascending": {
- "defaultMessage": "تصاعدي",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.direction.descending": {
- "defaultMessage": "تنازلي",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.sortBy": {
- "defaultMessage": "الترتيب حسب {label}",
- "description": "Aria label for a sortable Table header button when the column is unsorted. `label` is the column header text."
- },
- "@astryx.table.sort.sortedBy": {
- "defaultMessage": "الترتيب حسب {label}، مُرتَّب {direction}",
- "description": "Aria label for a sorted Table header button. `direction` is the localized direction word from @astryx.table.sort.direction.*."
- },
- "@astryx.table.sort.sortedByWithPriority": {
- "defaultMessage": "الترتيب حسب {label}، مُرتَّب {direction}، الأولوية {rank, number} من {total, number}",
- "description": "Aria label for a sorted Table header button in multi-sort. `rank` is the 1-based position of this column in the sort order; `total` is the number of sorted columns."
- },
"@astryx.toast.dismiss": {
"defaultMessage": "تجاهل الإشعار",
"description": "Screen-reader-only label on the X button of a Toast (transient notification popup). Distinct from `banner.dismiss` (persistent banner)."
@@ -1480,4 +1460,3 @@
"description": "Default summary on the closed trigger of a lab TransferListSelector, stating how many options are currently chosen. Consumers usually override this with a domain phrase (e.g. \"7 columns\")."
}
}
-
diff --git a/packages/core/locales/ca-ES.json b/packages/core/locales/ca-ES.json
index eb31180651..1e7d69b79a 100644
--- a/packages/core/locales/ca-ES.json
+++ b/packages/core/locales/ca-ES.json
@@ -635,26 +635,6 @@
"defaultMessage": "Esborra l’ordenació",
"description": "Screen-reader-only label on a column header button that will remove the current sort. \"Clear\" here means remove, not transparent. Part of the sort set."
},
- "@astryx.table.sort.direction.ascending": {
- "defaultMessage": "ascendent",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.direction.descending": {
- "defaultMessage": "descendent",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.sortBy": {
- "defaultMessage": "Ordena per {label}",
- "description": "Aria label for a sortable Table header button when the column is unsorted. `label` is the column header text."
- },
- "@astryx.table.sort.sortedBy": {
- "defaultMessage": "Ordena per {label}, ordenat de manera {direction}",
- "description": "Aria label for a sorted Table header button. `direction` is the localized direction word from @astryx.table.sort.direction.*."
- },
- "@astryx.table.sort.sortedByWithPriority": {
- "defaultMessage": "Ordena per {label}, ordenat de manera {direction}, prioritat {rank, number} de {total, number}",
- "description": "Aria label for a sorted Table header button in multi-sort. `rank` is the 1-based position of this column in the sort order; `total` is the number of sorted columns."
- },
"@astryx.toast.dismiss": {
"defaultMessage": "Descarta la notificació",
"description": "Screen-reader-only label on the X button of a Toast (transient notification popup). Distinct from `banner.dismiss` (persistent banner)."
@@ -1480,4 +1460,3 @@
"description": "Default summary on the closed trigger of a lab TransferListSelector, stating how many options are currently chosen. Consumers usually override this with a domain phrase (e.g. \"7 columns\")."
}
}
-
diff --git a/packages/core/locales/cs-CZ.json b/packages/core/locales/cs-CZ.json
index 0f03d41e1e..bb455aac8f 100644
--- a/packages/core/locales/cs-CZ.json
+++ b/packages/core/locales/cs-CZ.json
@@ -635,26 +635,6 @@
"defaultMessage": "Vymazat řazení",
"description": "Screen-reader-only label on a column header button that will remove the current sort. \"Clear\" here means remove, not transparent. Part of the sort set."
},
- "@astryx.table.sort.direction.ascending": {
- "defaultMessage": "vzestupně",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.direction.descending": {
- "defaultMessage": "sestupně",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.sortBy": {
- "defaultMessage": "Seřadit podle {label}",
- "description": "Aria label for a sortable Table header button when the column is unsorted. `label` is the column header text."
- },
- "@astryx.table.sort.sortedBy": {
- "defaultMessage": "Seřadit podle {label}, seřazeno {direction}",
- "description": "Aria label for a sorted Table header button. `direction` is the localized direction word from @astryx.table.sort.direction.*."
- },
- "@astryx.table.sort.sortedByWithPriority": {
- "defaultMessage": "Seřadit podle {label}, seřazeno {direction}, priorita {rank, number} z {total, number}",
- "description": "Aria label for a sorted Table header button in multi-sort. `rank` is the 1-based position of this column in the sort order; `total` is the number of sorted columns."
- },
"@astryx.toast.dismiss": {
"defaultMessage": "Zavřít oznámení",
"description": "Screen-reader-only label on the X button of a Toast (transient notification popup). Distinct from `banner.dismiss` (persistent banner)."
@@ -1480,4 +1460,3 @@
"description": "Default summary on the closed trigger of a lab TransferListSelector, stating how many options are currently chosen. Consumers usually override this with a domain phrase (e.g. \"7 columns\")."
}
}
-
diff --git a/packages/core/locales/da-DK.json b/packages/core/locales/da-DK.json
index 76aed914ee..0de38a1f05 100644
--- a/packages/core/locales/da-DK.json
+++ b/packages/core/locales/da-DK.json
@@ -635,26 +635,6 @@
"defaultMessage": "Ryd sortering",
"description": "Screen-reader-only label on a column header button that will remove the current sort. \"Clear\" here means remove, not transparent. Part of the sort set."
},
- "@astryx.table.sort.direction.ascending": {
- "defaultMessage": "stigende",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.direction.descending": {
- "defaultMessage": "faldende",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.sortBy": {
- "defaultMessage": "Sortér efter {label}",
- "description": "Aria label for a sortable Table header button when the column is unsorted. `label` is the column header text."
- },
- "@astryx.table.sort.sortedBy": {
- "defaultMessage": "Sortér efter {label}, sorteret {direction}",
- "description": "Aria label for a sorted Table header button. `direction` is the localized direction word from @astryx.table.sort.direction.*."
- },
- "@astryx.table.sort.sortedByWithPriority": {
- "defaultMessage": "Sortér efter {label}, sorteret {direction}, prioritet {rank, number} af {total, number}",
- "description": "Aria label for a sorted Table header button in multi-sort. `rank` is the 1-based position of this column in the sort order; `total` is the number of sorted columns."
- },
"@astryx.toast.dismiss": {
"defaultMessage": "Luk notifikation",
"description": "Screen-reader-only label on the X button of a Toast (transient notification popup). Distinct from `banner.dismiss` (persistent banner)."
@@ -1480,4 +1460,3 @@
"description": "Default summary on the closed trigger of a lab TransferListSelector, stating how many options are currently chosen. Consumers usually override this with a domain phrase (e.g. \"7 columns\")."
}
}
-
diff --git a/packages/core/locales/de-DE.json b/packages/core/locales/de-DE.json
index 897d4cd6ef..c4538777f8 100644
--- a/packages/core/locales/de-DE.json
+++ b/packages/core/locales/de-DE.json
@@ -635,26 +635,6 @@
"defaultMessage": "Sortierung aufheben",
"description": "Screen-reader-only label on a column header button that will remove the current sort. \"Clear\" here means remove, not transparent. Part of the sort set."
},
- "@astryx.table.sort.direction.ascending": {
- "defaultMessage": "aufsteigend",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.direction.descending": {
- "defaultMessage": "absteigend",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.sortBy": {
- "defaultMessage": "Nach {label} sortieren",
- "description": "Aria label for a sortable Table header button when the column is unsorted. `label` is the column header text."
- },
- "@astryx.table.sort.sortedBy": {
- "defaultMessage": "Nach {label} sortieren, sortiert {direction}",
- "description": "Aria label for a sorted Table header button. `direction` is the localized direction word from @astryx.table.sort.direction.*."
- },
- "@astryx.table.sort.sortedByWithPriority": {
- "defaultMessage": "Nach {label} sortieren, sortiert {direction}, Priorität {rank, number} von {total, number}",
- "description": "Aria label for a sorted Table header button in multi-sort. `rank` is the 1-based position of this column in the sort order; `total` is the number of sorted columns."
- },
"@astryx.toast.dismiss": {
"defaultMessage": "Benachrichtigung schließen",
"description": "Screen-reader-only label on the X button of a Toast (transient notification popup). Distinct from `banner.dismiss` (persistent banner)."
@@ -1480,4 +1460,3 @@
"description": "Default summary on the closed trigger of a lab TransferListSelector, stating how many options are currently chosen. Consumers usually override this with a domain phrase (e.g. \"7 columns\")."
}
}
-
diff --git a/packages/core/locales/el-GR.json b/packages/core/locales/el-GR.json
index 2e36c4a57b..210e5e0bff 100644
--- a/packages/core/locales/el-GR.json
+++ b/packages/core/locales/el-GR.json
@@ -635,26 +635,6 @@
"defaultMessage": "Απαλοιφή ταξινόμησης",
"description": "Screen-reader-only label on a column header button that will remove the current sort. \"Clear\" here means remove, not transparent. Part of the sort set."
},
- "@astryx.table.sort.direction.ascending": {
- "defaultMessage": "αύξουσα",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.direction.descending": {
- "defaultMessage": "φθίνουσα",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.sortBy": {
- "defaultMessage": "Ταξινόμηση κατά {label}",
- "description": "Aria label for a sortable Table header button when the column is unsorted. `label` is the column header text."
- },
- "@astryx.table.sort.sortedBy": {
- "defaultMessage": "Ταξινόμηση κατά {label}, ταξινομημένο σε {direction}",
- "description": "Aria label for a sorted Table header button. `direction` is the localized direction word from @astryx.table.sort.direction.*."
- },
- "@astryx.table.sort.sortedByWithPriority": {
- "defaultMessage": "Ταξινόμηση κατά {label}, ταξινομημένο σε {direction}, προτεραιότητα {rank, number} από {total, number}",
- "description": "Aria label for a sorted Table header button in multi-sort. `rank` is the 1-based position of this column in the sort order; `total` is the number of sorted columns."
- },
"@astryx.toast.dismiss": {
"defaultMessage": "Παράβλεψη ειδοποίησης",
"description": "Screen-reader-only label on the X button of a Toast (transient notification popup). Distinct from `banner.dismiss` (persistent banner)."
@@ -1480,4 +1460,3 @@
"description": "Default summary on the closed trigger of a lab TransferListSelector, stating how many options are currently chosen. Consumers usually override this with a domain phrase (e.g. \"7 columns\")."
}
}
-
diff --git a/packages/core/locales/en.json b/packages/core/locales/en.json
index d53184f023..c84d240b92 100644
--- a/packages/core/locales/en.json
+++ b/packages/core/locales/en.json
@@ -867,25 +867,9 @@
"defaultMessage": "Clear sort",
"description": "Screen-reader-only label on a column header button that will remove the current sort. \"Clear\" here means remove, not transparent. Part of the sort set."
},
- "@astryx.table.sort.direction.ascending": {
- "defaultMessage": "ascending",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.direction.descending": {
- "defaultMessage": "descending",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.sortBy": {
- "defaultMessage": "Sort by {label}",
- "description": "Aria label for a sortable Table header button when the column is unsorted. `label` is the column header text."
- },
- "@astryx.table.sort.sortedBy": {
- "defaultMessage": "Sort by {label}, sorted {direction}",
- "description": "Aria label for a sorted Table header button. `direction` is the localized direction word from @astryx.table.sort.direction.*."
- },
- "@astryx.table.sort.sortedByWithPriority": {
- "defaultMessage": "Sort by {label}, sorted {direction}, priority {rank, number} of {total, number}",
- "description": "Aria label for a sorted Table header button in multi-sort. `rank` is the 1-based position of this column in the sort order; `total` is the number of sorted columns."
+ "@astryx.table.sort.priority": {
+ "defaultMessage": "Priority {rank, number} of {total, number}",
+ "description": "Screen-reader description of a sortable Table column header button while several columns are sorted: this column's place in the sort order. The button's name is the column header text and its direction is announced from aria-sort."
},
"@astryx.toast.dismiss": {
"defaultMessage": "Dismiss notification",
diff --git a/packages/core/locales/es-ES.json b/packages/core/locales/es-ES.json
index 023b9bd668..2b7b702621 100644
--- a/packages/core/locales/es-ES.json
+++ b/packages/core/locales/es-ES.json
@@ -635,26 +635,6 @@
"defaultMessage": "Quitar el orden",
"description": "Screen-reader-only label on a column header button that will remove the current sort. \"Clear\" here means remove, not transparent. Part of the sort set."
},
- "@astryx.table.sort.direction.ascending": {
- "defaultMessage": "ascendente",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.direction.descending": {
- "defaultMessage": "descendente",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.sortBy": {
- "defaultMessage": "Ordenar por {label}",
- "description": "Aria label for a sortable Table header button when the column is unsorted. `label` is the column header text."
- },
- "@astryx.table.sort.sortedBy": {
- "defaultMessage": "Ordenar por {label}, ordenado en orden {direction}",
- "description": "Aria label for a sorted Table header button. `direction` is the localized direction word from @astryx.table.sort.direction.*."
- },
- "@astryx.table.sort.sortedByWithPriority": {
- "defaultMessage": "Ordenar por {label}, ordenado en orden {direction}, prioridad {rank, number} de {total, number}",
- "description": "Aria label for a sorted Table header button in multi-sort. `rank` is the 1-based position of this column in the sort order; `total` is the number of sorted columns."
- },
"@astryx.toast.dismiss": {
"defaultMessage": "Descartar la notificación",
"description": "Screen-reader-only label on the X button of a Toast (transient notification popup). Distinct from `banner.dismiss` (persistent banner)."
@@ -1480,4 +1460,3 @@
"description": "Default summary on the closed trigger of a lab TransferListSelector, stating how many options are currently chosen. Consumers usually override this with a domain phrase (e.g. \"7 columns\")."
}
}
-
diff --git a/packages/core/locales/fi-FI.json b/packages/core/locales/fi-FI.json
index d7a1aed464..9a01748727 100644
--- a/packages/core/locales/fi-FI.json
+++ b/packages/core/locales/fi-FI.json
@@ -635,26 +635,6 @@
"defaultMessage": "Tyhjennä järjestys",
"description": "Screen-reader-only label on a column header button that will remove the current sort. \"Clear\" here means remove, not transparent. Part of the sort set."
},
- "@astryx.table.sort.direction.ascending": {
- "defaultMessage": "nouseva",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.direction.descending": {
- "defaultMessage": "laskeva",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.sortBy": {
- "defaultMessage": "Järjestä: {label}",
- "description": "Aria label for a sortable Table header button when the column is unsorted. `label` is the column header text."
- },
- "@astryx.table.sort.sortedBy": {
- "defaultMessage": "Järjestä: {label}, järjestys {direction}",
- "description": "Aria label for a sorted Table header button. `direction` is the localized direction word from @astryx.table.sort.direction.*."
- },
- "@astryx.table.sort.sortedByWithPriority": {
- "defaultMessage": "Järjestä: {label}, järjestys {direction}, prioriteetti {rank, number} / {total, number}",
- "description": "Aria label for a sorted Table header button in multi-sort. `rank` is the 1-based position of this column in the sort order; `total` is the number of sorted columns."
- },
"@astryx.toast.dismiss": {
"defaultMessage": "Hylkää ilmoitus",
"description": "Screen-reader-only label on the X button of a Toast (transient notification popup). Distinct from `banner.dismiss` (persistent banner)."
@@ -1480,4 +1460,3 @@
"description": "Default summary on the closed trigger of a lab TransferListSelector, stating how many options are currently chosen. Consumers usually override this with a domain phrase (e.g. \"7 columns\")."
}
}
-
diff --git a/packages/core/locales/fr-FR.json b/packages/core/locales/fr-FR.json
index 8a4297f585..187d9ef375 100644
--- a/packages/core/locales/fr-FR.json
+++ b/packages/core/locales/fr-FR.json
@@ -635,26 +635,6 @@
"defaultMessage": "Effacer le tri",
"description": "Screen-reader-only label on a column header button that will remove the current sort. \"Clear\" here means remove, not transparent. Part of the sort set."
},
- "@astryx.table.sort.direction.ascending": {
- "defaultMessage": "croissant",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.direction.descending": {
- "defaultMessage": "décroissant",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.sortBy": {
- "defaultMessage": "Trier par {label}",
- "description": "Aria label for a sortable Table header button when the column is unsorted. `label` is the column header text."
- },
- "@astryx.table.sort.sortedBy": {
- "defaultMessage": "Trier par {label}, trié par ordre {direction}",
- "description": "Aria label for a sorted Table header button. `direction` is the localized direction word from @astryx.table.sort.direction.*."
- },
- "@astryx.table.sort.sortedByWithPriority": {
- "defaultMessage": "Trier par {label}, trié par ordre {direction}, priorité {rank, number} sur {total, number}",
- "description": "Aria label for a sorted Table header button in multi-sort. `rank` is the 1-based position of this column in the sort order; `total` is the number of sorted columns."
- },
"@astryx.toast.dismiss": {
"defaultMessage": "Ignorer la notification",
"description": "Screen-reader-only label on the X button of a Toast (transient notification popup). Distinct from `banner.dismiss` (persistent banner)."
@@ -1480,4 +1460,3 @@
"description": "Default summary on the closed trigger of a lab TransferListSelector, stating how many options are currently chosen. Consumers usually override this with a domain phrase (e.g. \"7 columns\")."
}
}
-
diff --git a/packages/core/locales/he-IL.json b/packages/core/locales/he-IL.json
index 8aca7bd476..bf485501c5 100644
--- a/packages/core/locales/he-IL.json
+++ b/packages/core/locales/he-IL.json
@@ -635,26 +635,6 @@
"defaultMessage": "נקה את המיון",
"description": "Screen-reader-only label on a column header button that will remove the current sort. \"Clear\" here means remove, not transparent. Part of the sort set."
},
- "@astryx.table.sort.direction.ascending": {
- "defaultMessage": "עולה",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.direction.descending": {
- "defaultMessage": "יורד",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.sortBy": {
- "defaultMessage": "מיון לפי {label}",
- "description": "Aria label for a sortable Table header button when the column is unsorted. `label` is the column header text."
- },
- "@astryx.table.sort.sortedBy": {
- "defaultMessage": "מיון לפי {label}, ממוין {direction}",
- "description": "Aria label for a sorted Table header button. `direction` is the localized direction word from @astryx.table.sort.direction.*."
- },
- "@astryx.table.sort.sortedByWithPriority": {
- "defaultMessage": "מיון לפי {label}, ממוין {direction}, עדיפות {rank, number} מתוך {total, number}",
- "description": "Aria label for a sorted Table header button in multi-sort. `rank` is the 1-based position of this column in the sort order; `total` is the number of sorted columns."
- },
"@astryx.toast.dismiss": {
"defaultMessage": "סגור את ההתראה",
"description": "Screen-reader-only label on the X button of a Toast (transient notification popup). Distinct from `banner.dismiss` (persistent banner)."
@@ -1480,4 +1460,3 @@
"description": "Default summary on the closed trigger of a lab TransferListSelector, stating how many options are currently chosen. Consumers usually override this with a domain phrase (e.g. \"7 columns\")."
}
}
-
diff --git a/packages/core/locales/hu-HU.json b/packages/core/locales/hu-HU.json
index bda16c707a..2aea11e745 100644
--- a/packages/core/locales/hu-HU.json
+++ b/packages/core/locales/hu-HU.json
@@ -635,26 +635,6 @@
"defaultMessage": "Rendezés törlése",
"description": "Screen-reader-only label on a column header button that will remove the current sort. \"Clear\" here means remove, not transparent. Part of the sort set."
},
- "@astryx.table.sort.direction.ascending": {
- "defaultMessage": "növekvő",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.direction.descending": {
- "defaultMessage": "csökkenő",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.sortBy": {
- "defaultMessage": "Rendezés: {label}",
- "description": "Aria label for a sortable Table header button when the column is unsorted. `label` is the column header text."
- },
- "@astryx.table.sort.sortedBy": {
- "defaultMessage": "Rendezés: {label}, rendezve: {direction}",
- "description": "Aria label for a sorted Table header button. `direction` is the localized direction word from @astryx.table.sort.direction.*."
- },
- "@astryx.table.sort.sortedByWithPriority": {
- "defaultMessage": "Rendezés: {label}, rendezve: {direction}, prioritás: {rank, number} / {total, number}",
- "description": "Aria label for a sorted Table header button in multi-sort. `rank` is the 1-based position of this column in the sort order; `total` is the number of sorted columns."
- },
"@astryx.toast.dismiss": {
"defaultMessage": "Értesítés elvetése",
"description": "Screen-reader-only label on the X button of a Toast (transient notification popup). Distinct from `banner.dismiss` (persistent banner)."
@@ -1480,4 +1460,3 @@
"description": "Default summary on the closed trigger of a lab TransferListSelector, stating how many options are currently chosen. Consumers usually override this with a domain phrase (e.g. \"7 columns\")."
}
}
-
diff --git a/packages/core/locales/it-IT.json b/packages/core/locales/it-IT.json
index 0a1e57db27..65b66e055d 100644
--- a/packages/core/locales/it-IT.json
+++ b/packages/core/locales/it-IT.json
@@ -635,26 +635,6 @@
"defaultMessage": "Rimuovi l’ordinamento",
"description": "Screen-reader-only label on a column header button that will remove the current sort. \"Clear\" here means remove, not transparent. Part of the sort set."
},
- "@astryx.table.sort.direction.ascending": {
- "defaultMessage": "crescente",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.direction.descending": {
- "defaultMessage": "decrescente",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.sortBy": {
- "defaultMessage": "Ordina per {label}",
- "description": "Aria label for a sortable Table header button when the column is unsorted. `label` is the column header text."
- },
- "@astryx.table.sort.sortedBy": {
- "defaultMessage": "Ordina per {label}, ordinato in modo {direction}",
- "description": "Aria label for a sorted Table header button. `direction` is the localized direction word from @astryx.table.sort.direction.*."
- },
- "@astryx.table.sort.sortedByWithPriority": {
- "defaultMessage": "Ordina per {label}, ordinato in modo {direction}, priorità {rank, number} di {total, number}",
- "description": "Aria label for a sorted Table header button in multi-sort. `rank` is the 1-based position of this column in the sort order; `total` is the number of sorted columns."
- },
"@astryx.toast.dismiss": {
"defaultMessage": "Ignora la notifica",
"description": "Screen-reader-only label on the X button of a Toast (transient notification popup). Distinct from `banner.dismiss` (persistent banner)."
@@ -1480,4 +1460,3 @@
"description": "Default summary on the closed trigger of a lab TransferListSelector, stating how many options are currently chosen. Consumers usually override this with a domain phrase (e.g. \"7 columns\")."
}
}
-
diff --git a/packages/core/locales/ja-JP.json b/packages/core/locales/ja-JP.json
index ca3eb70422..77c2cc1cff 100644
--- a/packages/core/locales/ja-JP.json
+++ b/packages/core/locales/ja-JP.json
@@ -635,26 +635,6 @@
"defaultMessage": "並べ替えをクリア",
"description": "Screen-reader-only label on a column header button that will remove the current sort. \"Clear\" here means remove, not transparent. Part of the sort set."
},
- "@astryx.table.sort.direction.ascending": {
- "defaultMessage": "昇順",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.direction.descending": {
- "defaultMessage": "降順",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.sortBy": {
- "defaultMessage": "{label} で並べ替え",
- "description": "Aria label for a sortable Table header button when the column is unsorted. `label` is the column header text."
- },
- "@astryx.table.sort.sortedBy": {
- "defaultMessage": "{label} で並べ替え、{direction}",
- "description": "Aria label for a sorted Table header button. `direction` is the localized direction word from @astryx.table.sort.direction.*."
- },
- "@astryx.table.sort.sortedByWithPriority": {
- "defaultMessage": "{label} で並べ替え、{direction}、優先度 {total, number} 中 {rank, number}",
- "description": "Aria label for a sorted Table header button in multi-sort. `rank` is the 1-based position of this column in the sort order; `total` is the number of sorted columns."
- },
"@astryx.toast.dismiss": {
"defaultMessage": "通知を閉じる",
"description": "Screen-reader-only label on the X button of a Toast (transient notification popup). Distinct from `banner.dismiss` (persistent banner)."
@@ -1480,4 +1460,3 @@
"description": "Default summary on the closed trigger of a lab TransferListSelector, stating how many options are currently chosen. Consumers usually override this with a domain phrase (e.g. \"7 columns\")."
}
}
-
diff --git a/packages/core/locales/ko-KR.json b/packages/core/locales/ko-KR.json
index 45572178b8..8790499286 100644
--- a/packages/core/locales/ko-KR.json
+++ b/packages/core/locales/ko-KR.json
@@ -635,26 +635,6 @@
"defaultMessage": "정렬 지우기",
"description": "Screen-reader-only label on a column header button that will remove the current sort. \"Clear\" here means remove, not transparent. Part of the sort set."
},
- "@astryx.table.sort.direction.ascending": {
- "defaultMessage": "오름차순",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.direction.descending": {
- "defaultMessage": "내림차순",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.sortBy": {
- "defaultMessage": "{label} 기준 정렬",
- "description": "Aria label for a sortable Table header button when the column is unsorted. `label` is the column header text."
- },
- "@astryx.table.sort.sortedBy": {
- "defaultMessage": "{label} 기준 정렬, {direction}",
- "description": "Aria label for a sorted Table header button. `direction` is the localized direction word from @astryx.table.sort.direction.*."
- },
- "@astryx.table.sort.sortedByWithPriority": {
- "defaultMessage": "{label} 기준 정렬, {direction}, 우선순위 {total, number} 중 {rank, number}",
- "description": "Aria label for a sorted Table header button in multi-sort. `rank` is the 1-based position of this column in the sort order; `total` is the number of sorted columns."
- },
"@astryx.toast.dismiss": {
"defaultMessage": "알림 닫기",
"description": "Screen-reader-only label on the X button of a Toast (transient notification popup). Distinct from `banner.dismiss` (persistent banner)."
@@ -1480,4 +1460,3 @@
"description": "Default summary on the closed trigger of a lab TransferListSelector, stating how many options are currently chosen. Consumers usually override this with a domain phrase (e.g. \"7 columns\")."
}
}
-
diff --git a/packages/core/locales/nl-NL.json b/packages/core/locales/nl-NL.json
index f70e870c65..cdd0ce6937 100644
--- a/packages/core/locales/nl-NL.json
+++ b/packages/core/locales/nl-NL.json
@@ -635,26 +635,6 @@
"defaultMessage": "Sortering wissen",
"description": "Screen-reader-only label on a column header button that will remove the current sort. \"Clear\" here means remove, not transparent. Part of the sort set."
},
- "@astryx.table.sort.direction.ascending": {
- "defaultMessage": "oplopend",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.direction.descending": {
- "defaultMessage": "aflopend",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.sortBy": {
- "defaultMessage": "Sorteren op {label}",
- "description": "Aria label for a sortable Table header button when the column is unsorted. `label` is the column header text."
- },
- "@astryx.table.sort.sortedBy": {
- "defaultMessage": "Sorteren op {label}, gesorteerd {direction}",
- "description": "Aria label for a sorted Table header button. `direction` is the localized direction word from @astryx.table.sort.direction.*."
- },
- "@astryx.table.sort.sortedByWithPriority": {
- "defaultMessage": "Sorteren op {label}, gesorteerd {direction}, prioriteit {rank, number} van {total, number}",
- "description": "Aria label for a sorted Table header button in multi-sort. `rank` is the 1-based position of this column in the sort order; `total` is the number of sorted columns."
- },
"@astryx.toast.dismiss": {
"defaultMessage": "Melding sluiten",
"description": "Screen-reader-only label on the X button of a Toast (transient notification popup). Distinct from `banner.dismiss` (persistent banner)."
@@ -1480,4 +1460,3 @@
"description": "Default summary on the closed trigger of a lab TransferListSelector, stating how many options are currently chosen. Consumers usually override this with a domain phrase (e.g. \"7 columns\")."
}
}
-
diff --git a/packages/core/locales/no-NO.json b/packages/core/locales/no-NO.json
index 8da3dcabdc..8dda7a96b5 100644
--- a/packages/core/locales/no-NO.json
+++ b/packages/core/locales/no-NO.json
@@ -635,26 +635,6 @@
"defaultMessage": "Fjern sortering",
"description": "Screen-reader-only label on a column header button that will remove the current sort. \"Clear\" here means remove, not transparent. Part of the sort set."
},
- "@astryx.table.sort.direction.ascending": {
- "defaultMessage": "stigende",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.direction.descending": {
- "defaultMessage": "synkende",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.sortBy": {
- "defaultMessage": "Sorter etter {label}",
- "description": "Aria label for a sortable Table header button when the column is unsorted. `label` is the column header text."
- },
- "@astryx.table.sort.sortedBy": {
- "defaultMessage": "Sorter etter {label}, sortert {direction}",
- "description": "Aria label for a sorted Table header button. `direction` is the localized direction word from @astryx.table.sort.direction.*."
- },
- "@astryx.table.sort.sortedByWithPriority": {
- "defaultMessage": "Sorter etter {label}, sortert {direction}, prioritet {rank, number} av {total, number}",
- "description": "Aria label for a sorted Table header button in multi-sort. `rank` is the 1-based position of this column in the sort order; `total` is the number of sorted columns."
- },
"@astryx.toast.dismiss": {
"defaultMessage": "Lukk varsel",
"description": "Screen-reader-only label on the X button of a Toast (transient notification popup). Distinct from `banner.dismiss` (persistent banner)."
@@ -1480,4 +1460,3 @@
"description": "Default summary on the closed trigger of a lab TransferListSelector, stating how many options are currently chosen. Consumers usually override this with a domain phrase (e.g. \"7 columns\")."
}
}
-
diff --git a/packages/core/locales/pl-PL.json b/packages/core/locales/pl-PL.json
index 2536c736c4..cc7e50a8d9 100644
--- a/packages/core/locales/pl-PL.json
+++ b/packages/core/locales/pl-PL.json
@@ -635,26 +635,6 @@
"defaultMessage": "Wyczyść sortowanie",
"description": "Screen-reader-only label on a column header button that will remove the current sort. \"Clear\" here means remove, not transparent. Part of the sort set."
},
- "@astryx.table.sort.direction.ascending": {
- "defaultMessage": "rosnąco",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.direction.descending": {
- "defaultMessage": "malejąco",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.sortBy": {
- "defaultMessage": "Sortuj według {label}",
- "description": "Aria label for a sortable Table header button when the column is unsorted. `label` is the column header text."
- },
- "@astryx.table.sort.sortedBy": {
- "defaultMessage": "Sortuj według {label}, posortowano {direction}",
- "description": "Aria label for a sorted Table header button. `direction` is the localized direction word from @astryx.table.sort.direction.*."
- },
- "@astryx.table.sort.sortedByWithPriority": {
- "defaultMessage": "Sortuj według {label}, posortowano {direction}, priorytet {rank, number} z {total, number}",
- "description": "Aria label for a sorted Table header button in multi-sort. `rank` is the 1-based position of this column in the sort order; `total` is the number of sorted columns."
- },
"@astryx.toast.dismiss": {
"defaultMessage": "Zamknij powiadomienie",
"description": "Screen-reader-only label on the X button of a Toast (transient notification popup). Distinct from `banner.dismiss` (persistent banner)."
@@ -1480,4 +1460,3 @@
"description": "Default summary on the closed trigger of a lab TransferListSelector, stating how many options are currently chosen. Consumers usually override this with a domain phrase (e.g. \"7 columns\")."
}
}
-
diff --git a/packages/core/locales/pt-BR.json b/packages/core/locales/pt-BR.json
index 2d8a56aa9f..029eb1cbd9 100644
--- a/packages/core/locales/pt-BR.json
+++ b/packages/core/locales/pt-BR.json
@@ -635,26 +635,6 @@
"defaultMessage": "Limpar ordenação",
"description": "Screen-reader-only label on a column header button that will remove the current sort. \"Clear\" here means remove, not transparent. Part of the sort set."
},
- "@astryx.table.sort.direction.ascending": {
- "defaultMessage": "crescente",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.direction.descending": {
- "defaultMessage": "decrescente",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.sortBy": {
- "defaultMessage": "Ordenar por {label}",
- "description": "Aria label for a sortable Table header button when the column is unsorted. `label` is the column header text."
- },
- "@astryx.table.sort.sortedBy": {
- "defaultMessage": "Ordenar por {label}, ordenado de forma {direction}",
- "description": "Aria label for a sorted Table header button. `direction` is the localized direction word from @astryx.table.sort.direction.*."
- },
- "@astryx.table.sort.sortedByWithPriority": {
- "defaultMessage": "Ordenar por {label}, ordenado de forma {direction}, prioridade {rank, number} de {total, number}",
- "description": "Aria label for a sorted Table header button in multi-sort. `rank` is the 1-based position of this column in the sort order; `total` is the number of sorted columns."
- },
"@astryx.toast.dismiss": {
"defaultMessage": "Dispensar notificação",
"description": "Screen-reader-only label on the X button of a Toast (transient notification popup). Distinct from `banner.dismiss` (persistent banner)."
@@ -1480,4 +1460,3 @@
"description": "Default summary on the closed trigger of a lab TransferListSelector, stating how many options are currently chosen. Consumers usually override this with a domain phrase (e.g. \"7 columns\")."
}
}
-
diff --git a/packages/core/locales/pt-PT.json b/packages/core/locales/pt-PT.json
index 339945bea4..bd273b24ed 100644
--- a/packages/core/locales/pt-PT.json
+++ b/packages/core/locales/pt-PT.json
@@ -635,26 +635,6 @@
"defaultMessage": "Limpar ordenação",
"description": "Screen-reader-only label on a column header button that will remove the current sort. \"Clear\" here means remove, not transparent. Part of the sort set."
},
- "@astryx.table.sort.direction.ascending": {
- "defaultMessage": "ascendente",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.direction.descending": {
- "defaultMessage": "descendente",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.sortBy": {
- "defaultMessage": "Ordenar por {label}",
- "description": "Aria label for a sortable Table header button when the column is unsorted. `label` is the column header text."
- },
- "@astryx.table.sort.sortedBy": {
- "defaultMessage": "Ordenar por {label}, ordenado de forma {direction}",
- "description": "Aria label for a sorted Table header button. `direction` is the localized direction word from @astryx.table.sort.direction.*."
- },
- "@astryx.table.sort.sortedByWithPriority": {
- "defaultMessage": "Ordenar por {label}, ordenado de forma {direction}, prioridade {rank, number} de {total, number}",
- "description": "Aria label for a sorted Table header button in multi-sort. `rank` is the 1-based position of this column in the sort order; `total` is the number of sorted columns."
- },
"@astryx.toast.dismiss": {
"defaultMessage": "Dispensar notificação",
"description": "Screen-reader-only label on the X button of a Toast (transient notification popup). Distinct from `banner.dismiss` (persistent banner)."
@@ -1480,4 +1460,3 @@
"description": "Default summary on the closed trigger of a lab TransferListSelector, stating how many options are currently chosen. Consumers usually override this with a domain phrase (e.g. \"7 columns\")."
}
}
-
diff --git a/packages/core/locales/ro-RO.json b/packages/core/locales/ro-RO.json
index c8db4bf346..f8cf8dd29e 100644
--- a/packages/core/locales/ro-RO.json
+++ b/packages/core/locales/ro-RO.json
@@ -635,26 +635,6 @@
"defaultMessage": "Șterge sortarea",
"description": "Screen-reader-only label on a column header button that will remove the current sort. \"Clear\" here means remove, not transparent. Part of the sort set."
},
- "@astryx.table.sort.direction.ascending": {
- "defaultMessage": "crescător",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.direction.descending": {
- "defaultMessage": "descrescător",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.sortBy": {
- "defaultMessage": "Sortează după {label}",
- "description": "Aria label for a sortable Table header button when the column is unsorted. `label` is the column header text."
- },
- "@astryx.table.sort.sortedBy": {
- "defaultMessage": "Sortează după {label}, sortat {direction}",
- "description": "Aria label for a sorted Table header button. `direction` is the localized direction word from @astryx.table.sort.direction.*."
- },
- "@astryx.table.sort.sortedByWithPriority": {
- "defaultMessage": "Sortează după {label}, sortat {direction}, prioritatea {rank, number} din {total, number}",
- "description": "Aria label for a sorted Table header button in multi-sort. `rank` is the 1-based position of this column in the sort order; `total` is the number of sorted columns."
- },
"@astryx.toast.dismiss": {
"defaultMessage": "Închide notificarea",
"description": "Screen-reader-only label on the X button of a Toast (transient notification popup). Distinct from `banner.dismiss` (persistent banner)."
@@ -1480,4 +1460,3 @@
"description": "Default summary on the closed trigger of a lab TransferListSelector, stating how many options are currently chosen. Consumers usually override this with a domain phrase (e.g. \"7 columns\")."
}
}
-
diff --git a/packages/core/locales/ru-RU.json b/packages/core/locales/ru-RU.json
index 78e9387d0f..d075db4b4d 100644
--- a/packages/core/locales/ru-RU.json
+++ b/packages/core/locales/ru-RU.json
@@ -635,26 +635,6 @@
"defaultMessage": "Сбросить сортировку",
"description": "Screen-reader-only label on a column header button that will remove the current sort. \"Clear\" here means remove, not transparent. Part of the sort set."
},
- "@astryx.table.sort.direction.ascending": {
- "defaultMessage": "по возрастанию",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.direction.descending": {
- "defaultMessage": "по убыванию",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.sortBy": {
- "defaultMessage": "Сортировать по {label}",
- "description": "Aria label for a sortable Table header button when the column is unsorted. `label` is the column header text."
- },
- "@astryx.table.sort.sortedBy": {
- "defaultMessage": "Сортировать по {label}, отсортировано {direction}",
- "description": "Aria label for a sorted Table header button. `direction` is the localized direction word from @astryx.table.sort.direction.*."
- },
- "@astryx.table.sort.sortedByWithPriority": {
- "defaultMessage": "Сортировать по {label}, отсортировано {direction}, приоритет {rank, number} из {total, number}",
- "description": "Aria label for a sorted Table header button in multi-sort. `rank` is the 1-based position of this column in the sort order; `total` is the number of sorted columns."
- },
"@astryx.toast.dismiss": {
"defaultMessage": "Закрыть уведомление",
"description": "Screen-reader-only label on the X button of a Toast (transient notification popup). Distinct from `banner.dismiss` (persistent banner)."
@@ -1480,4 +1460,3 @@
"description": "Default summary on the closed trigger of a lab TransferListSelector, stating how many options are currently chosen. Consumers usually override this with a domain phrase (e.g. \"7 columns\")."
}
}
-
diff --git a/packages/core/locales/sr-SP.json b/packages/core/locales/sr-SP.json
index d232a39983..c21b69f52f 100644
--- a/packages/core/locales/sr-SP.json
+++ b/packages/core/locales/sr-SP.json
@@ -635,26 +635,6 @@
"defaultMessage": "Обриши сортирање",
"description": "Screen-reader-only label on a column header button that will remove the current sort. \"Clear\" here means remove, not transparent. Part of the sort set."
},
- "@astryx.table.sort.direction.ascending": {
- "defaultMessage": "растуће",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.direction.descending": {
- "defaultMessage": "опадајуће",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.sortBy": {
- "defaultMessage": "Сортирај по {label}",
- "description": "Aria label for a sortable Table header button when the column is unsorted. `label` is the column header text."
- },
- "@astryx.table.sort.sortedBy": {
- "defaultMessage": "Сортирај по {label}, сортирано {direction}",
- "description": "Aria label for a sorted Table header button. `direction` is the localized direction word from @astryx.table.sort.direction.*."
- },
- "@astryx.table.sort.sortedByWithPriority": {
- "defaultMessage": "Сортирај по {label}, сортирано {direction}, приоритет {rank, number} од {total, number}",
- "description": "Aria label for a sorted Table header button in multi-sort. `rank` is the 1-based position of this column in the sort order; `total` is the number of sorted columns."
- },
"@astryx.toast.dismiss": {
"defaultMessage": "Одбаци обавештење",
"description": "Screen-reader-only label on the X button of a Toast (transient notification popup). Distinct from `banner.dismiss` (persistent banner)."
@@ -1480,4 +1460,3 @@
"description": "Default summary on the closed trigger of a lab TransferListSelector, stating how many options are currently chosen. Consumers usually override this with a domain phrase (e.g. \"7 columns\")."
}
}
-
diff --git a/packages/core/locales/sv-SE.json b/packages/core/locales/sv-SE.json
index 8a7a9d8918..bf2115116d 100644
--- a/packages/core/locales/sv-SE.json
+++ b/packages/core/locales/sv-SE.json
@@ -635,26 +635,6 @@
"defaultMessage": "Rensa sortering",
"description": "Screen-reader-only label on a column header button that will remove the current sort. \"Clear\" here means remove, not transparent. Part of the sort set."
},
- "@astryx.table.sort.direction.ascending": {
- "defaultMessage": "stigande",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.direction.descending": {
- "defaultMessage": "fallande",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.sortBy": {
- "defaultMessage": "Sortera efter {label}",
- "description": "Aria label for a sortable Table header button when the column is unsorted. `label` is the column header text."
- },
- "@astryx.table.sort.sortedBy": {
- "defaultMessage": "Sortera efter {label}, sorterat {direction}",
- "description": "Aria label for a sorted Table header button. `direction` is the localized direction word from @astryx.table.sort.direction.*."
- },
- "@astryx.table.sort.sortedByWithPriority": {
- "defaultMessage": "Sortera efter {label}, sorterat {direction}, prioritet {rank, number} av {total, number}",
- "description": "Aria label for a sorted Table header button in multi-sort. `rank` is the 1-based position of this column in the sort order; `total` is the number of sorted columns."
- },
"@astryx.toast.dismiss": {
"defaultMessage": "Stäng avisering",
"description": "Screen-reader-only label on the X button of a Toast (transient notification popup). Distinct from `banner.dismiss` (persistent banner)."
@@ -1480,4 +1460,3 @@
"description": "Default summary on the closed trigger of a lab TransferListSelector, stating how many options are currently chosen. Consumers usually override this with a domain phrase (e.g. \"7 columns\")."
}
}
-
diff --git a/packages/core/locales/tr-TR.json b/packages/core/locales/tr-TR.json
index 99231f3854..4d42d1d827 100644
--- a/packages/core/locales/tr-TR.json
+++ b/packages/core/locales/tr-TR.json
@@ -635,26 +635,6 @@
"defaultMessage": "Sıralamayı temizle",
"description": "Screen-reader-only label on a column header button that will remove the current sort. \"Clear\" here means remove, not transparent. Part of the sort set."
},
- "@astryx.table.sort.direction.ascending": {
- "defaultMessage": "artan",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.direction.descending": {
- "defaultMessage": "azalan",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.sortBy": {
- "defaultMessage": "Şuna göre sırala: {label}",
- "description": "Aria label for a sortable Table header button when the column is unsorted. `label` is the column header text."
- },
- "@astryx.table.sort.sortedBy": {
- "defaultMessage": "Şuna göre sırala: {label}, sıralama: {direction}",
- "description": "Aria label for a sorted Table header button. `direction` is the localized direction word from @astryx.table.sort.direction.*."
- },
- "@astryx.table.sort.sortedByWithPriority": {
- "defaultMessage": "Şuna göre sırala: {label}, sıralama: {direction}, öncelik: {total, number} içinden {rank, number}",
- "description": "Aria label for a sorted Table header button in multi-sort. `rank` is the 1-based position of this column in the sort order; `total` is the number of sorted columns."
- },
"@astryx.toast.dismiss": {
"defaultMessage": "Bildirimi kapat",
"description": "Screen-reader-only label on the X button of a Toast (transient notification popup). Distinct from `banner.dismiss` (persistent banner)."
@@ -1480,4 +1460,3 @@
"description": "Default summary on the closed trigger of a lab TransferListSelector, stating how many options are currently chosen. Consumers usually override this with a domain phrase (e.g. \"7 columns\")."
}
}
-
diff --git a/packages/core/locales/uk-UA.json b/packages/core/locales/uk-UA.json
index 7120afb61f..9d99ff8913 100644
--- a/packages/core/locales/uk-UA.json
+++ b/packages/core/locales/uk-UA.json
@@ -635,26 +635,6 @@
"defaultMessage": "Очистити сортування",
"description": "Screen-reader-only label on a column header button that will remove the current sort. \"Clear\" here means remove, not transparent. Part of the sort set."
},
- "@astryx.table.sort.direction.ascending": {
- "defaultMessage": "за зростанням",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.direction.descending": {
- "defaultMessage": "за спаданням",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.sortBy": {
- "defaultMessage": "Сортувати за {label}",
- "description": "Aria label for a sortable Table header button when the column is unsorted. `label` is the column header text."
- },
- "@astryx.table.sort.sortedBy": {
- "defaultMessage": "Сортувати за {label}, відсортовано {direction}",
- "description": "Aria label for a sorted Table header button. `direction` is the localized direction word from @astryx.table.sort.direction.*."
- },
- "@astryx.table.sort.sortedByWithPriority": {
- "defaultMessage": "Сортувати за {label}, відсортовано {direction}, пріоритет {rank, number} з {total, number}",
- "description": "Aria label for a sorted Table header button in multi-sort. `rank` is the 1-based position of this column in the sort order; `total` is the number of sorted columns."
- },
"@astryx.toast.dismiss": {
"defaultMessage": "Закрити сповіщення",
"description": "Screen-reader-only label on the X button of a Toast (transient notification popup). Distinct from `banner.dismiss` (persistent banner)."
@@ -1480,4 +1460,3 @@
"description": "Default summary on the closed trigger of a lab TransferListSelector, stating how many options are currently chosen. Consumers usually override this with a domain phrase (e.g. \"7 columns\")."
}
}
-
diff --git a/packages/core/locales/vi-VN.json b/packages/core/locales/vi-VN.json
index f7350184a9..e6f6513808 100644
--- a/packages/core/locales/vi-VN.json
+++ b/packages/core/locales/vi-VN.json
@@ -635,26 +635,6 @@
"defaultMessage": "Xóa sắp xếp",
"description": "Screen-reader-only label on a column header button that will remove the current sort. \"Clear\" here means remove, not transparent. Part of the sort set."
},
- "@astryx.table.sort.direction.ascending": {
- "defaultMessage": "tăng dần",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.direction.descending": {
- "defaultMessage": "giảm dần",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.sortBy": {
- "defaultMessage": "Sắp xếp theo {label}",
- "description": "Aria label for a sortable Table header button when the column is unsorted. `label` is the column header text."
- },
- "@astryx.table.sort.sortedBy": {
- "defaultMessage": "Sắp xếp theo {label}, {direction}",
- "description": "Aria label for a sorted Table header button. `direction` is the localized direction word from @astryx.table.sort.direction.*."
- },
- "@astryx.table.sort.sortedByWithPriority": {
- "defaultMessage": "Sắp xếp theo {label}, {direction}, ưu tiên {rank, number} trên {total, number}",
- "description": "Aria label for a sorted Table header button in multi-sort. `rank` is the 1-based position of this column in the sort order; `total` is the number of sorted columns."
- },
"@astryx.toast.dismiss": {
"defaultMessage": "Bỏ qua thông báo",
"description": "Screen-reader-only label on the X button of a Toast (transient notification popup). Distinct from `banner.dismiss` (persistent banner)."
@@ -1480,4 +1460,3 @@
"description": "Default summary on the closed trigger of a lab TransferListSelector, stating how many options are currently chosen. Consumers usually override this with a domain phrase (e.g. \"7 columns\")."
}
}
-
diff --git a/packages/core/locales/zh-CN.json b/packages/core/locales/zh-CN.json
index 4cff3100bc..cc09e7a146 100644
--- a/packages/core/locales/zh-CN.json
+++ b/packages/core/locales/zh-CN.json
@@ -635,26 +635,6 @@
"defaultMessage": "清除排序",
"description": "Screen-reader-only label on a column header button that will remove the current sort. \"Clear\" here means remove, not transparent. Part of the sort set."
},
- "@astryx.table.sort.direction.ascending": {
- "defaultMessage": "升序",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.direction.descending": {
- "defaultMessage": "降序",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.sortBy": {
- "defaultMessage": "按 {label} 排序",
- "description": "Aria label for a sortable Table header button when the column is unsorted. `label` is the column header text."
- },
- "@astryx.table.sort.sortedBy": {
- "defaultMessage": "按 {label} 排序,{direction}",
- "description": "Aria label for a sorted Table header button. `direction` is the localized direction word from @astryx.table.sort.direction.*."
- },
- "@astryx.table.sort.sortedByWithPriority": {
- "defaultMessage": "按 {label} 排序,{direction},优先级 {rank, number}/{total, number}",
- "description": "Aria label for a sorted Table header button in multi-sort. `rank` is the 1-based position of this column in the sort order; `total` is the number of sorted columns."
- },
"@astryx.toast.dismiss": {
"defaultMessage": "关闭通知",
"description": "Screen-reader-only label on the X button of a Toast (transient notification popup). Distinct from `banner.dismiss` (persistent banner)."
@@ -1480,4 +1460,3 @@
"description": "Default summary on the closed trigger of a lab TransferListSelector, stating how many options are currently chosen. Consumers usually override this with a domain phrase (e.g. \"7 columns\")."
}
}
-
diff --git a/packages/core/locales/zh-TW.json b/packages/core/locales/zh-TW.json
index 6e01ff4423..3fee97b811 100644
--- a/packages/core/locales/zh-TW.json
+++ b/packages/core/locales/zh-TW.json
@@ -635,26 +635,6 @@
"defaultMessage": "清除排序",
"description": "Screen-reader-only label on a column header button that will remove the current sort. \"Clear\" here means remove, not transparent. Part of the sort set."
},
- "@astryx.table.sort.direction.ascending": {
- "defaultMessage": "遞增",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.direction.descending": {
- "defaultMessage": "遞減",
- "description": "Localized direction word interpolated as `direction` into @astryx.table.sort.sortedBy and @astryx.table.sort.sortedByWithPriority."
- },
- "@astryx.table.sort.sortBy": {
- "defaultMessage": "依 {label} 排序",
- "description": "Aria label for a sortable Table header button when the column is unsorted. `label` is the column header text."
- },
- "@astryx.table.sort.sortedBy": {
- "defaultMessage": "依 {label} 排序,{direction}",
- "description": "Aria label for a sorted Table header button. `direction` is the localized direction word from @astryx.table.sort.direction.*."
- },
- "@astryx.table.sort.sortedByWithPriority": {
- "defaultMessage": "依 {label} 排序,{direction},優先順序 {rank, number}/{total, number}",
- "description": "Aria label for a sorted Table header button in multi-sort. `rank` is the 1-based position of this column in the sort order; `total` is the number of sorted columns."
- },
"@astryx.toast.dismiss": {
"defaultMessage": "關閉通知",
"description": "Screen-reader-only label on the X button of a Toast (transient notification popup). Distinct from `banner.dismiss` (persistent banner)."
@@ -1480,4 +1460,3 @@
"description": "Default summary on the closed trigger of a lab TransferListSelector, stating how many options are currently chosen. Consumers usually override this with a domain phrase (e.g. \"7 columns\")."
}
}
-
diff --git a/packages/core/src/Table/Table.spec.md b/packages/core/src/Table/Table.spec.md
index e0c83548f9..03f788ec06 100644
--- a/packages/core/src/Table/Table.spec.md
+++ b/packages/core/src/Table/Table.spec.md
@@ -127,7 +127,7 @@ documented in `Table.doc.mjs` and the member and module docs.
| ID | Invariant | Basis | Evidence state |
| ---- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
-| FR1 | By default, Styled Table renders one named Scroll region around one observed content box and one semantic Table. The Scroll region enters the keyboard order and contains inline overscroll only while inline content effectively overflows; fitting content passes scroll gestures to its ancestor. Explicit scroll-wrapper plugin HTML attributes remain authoritative. | `spec:AST-025` FR12, FR14, FR19, FR21; current source, docs, and tests | Verified fitting and inline-overflow transitions through the shared `useScrollableArea` behavior core |
+| FR1 | By default, Styled Table renders one named Scroll region around one observed content box and one semantic Table. The Scroll region takes the Table's own name (its `aria-labelledby`, else its `aria-label`), and a generic table name only when the Table has none. The Scroll region enters the keyboard order and contains inline overscroll only while inline content effectively overflows; fitting content passes scroll gestures to its ancestor. Explicit scroll-wrapper plugin HTML attributes remain authoritative. | `spec:AST-025` FR12, FR14, FR19, FR21; current source, docs, and tests | Verified fitting and inline-overflow transitions through the shared `useScrollableArea` behavior core |
| FR2 | Data-driven mode renders a Body section and a Header section with Column header cells when columns are present. Each data item renders a standard Row and Cells; an empty data array instead renders the configured empty-state row when enabled. It never creates a Footer section. | Current source, docs, and tests | Verified current behavior; no new behavior decided |
| FR3 | Children mode passes caller composition through to the Table. TableHeader, TableBody, and TableFooter provide the respective sections, and TableRow, TableHeaderCell, and TableCell provide standard rows and cells. | Current source, docs, and tests | Verified current composition; no new API or DOM rule |
| FR4 | `Table.doc.mjs` is the canonical aggregate consumer owner for the eight current targets: `table`, `table-scroll-wrapper`, `table-header`, `table-body`, `table-footer`, `table-row`, `table-cell`, and `table-header-cell`. Member docs retain direct lookup metadata through `subComponentOf: 'Table'`. | Current docs and CLI target tests | Verified parent ownership; focused placement coverage is partial |
diff --git a/packages/core/src/Table/Table.test.tsx b/packages/core/src/Table/Table.test.tsx
index 398e5de277..89d225871c 100644
--- a/packages/core/src/Table/Table.test.tsx
+++ b/packages/core/src/Table/Table.test.tsx
@@ -961,6 +961,38 @@ describe('Table', () => {
expect(wrapper.style.overscrollBehaviorX).toBe('auto');
});
+ it('names the scroll region after its table, not a generic "Table" (AST-025)', () => {
+ render(
+ <>
+ <Table aria-label="Orders" data={users} columns={columns} />
+ <h2 id="refunds-title">Refunds</h2>
+ <Table aria-labelledby="refunds-title" data={users} columns={columns} />
+ <h2 id="returns-title">Returns</h2>
+ <Table
+ aria-label="Ignored label"
+ aria-labelledby="returns-title"
+ data={users}
+ columns={columns}
+ />
+ <Table data={users} columns={columns} />
+ </>,
+ );
+ expect(screen.getByRole('group', {name: 'Orders'})).toBeInTheDocument();
+ expect(screen.getByRole('group', {name: 'Refunds'})).toHaveAttribute(
+ 'aria-labelledby',
+ 'refunds-title',
+ );
+ // With both, the region is named as the table is: by aria-labelledby.
+ expect(screen.getByRole('table', {name: 'Returns'})).toBeInTheDocument();
+ const returns = screen.getByRole('group', {name: 'Returns'});
+ expect(returns).not.toHaveAttribute('aria-label');
+ expect(
+ screen.queryByRole('group', {name: 'Ignored label'}),
+ ).not.toBeInTheDocument();
+ // An unnamed table keeps the generic fallback.
+ expect(screen.getAllByRole('group', {name: 'Table'})).toHaveLength(1);
+ });
+
it('preserves scroll-wrapper HTML attributes from plugins', () => {
const plugin: TablePlugin<User> = {
transformScrollWrapper: props => ({
diff --git a/packages/core/src/Table/Table.tsx b/packages/core/src/Table/Table.tsx
index 14cb8ef8bb..d77d045ac8 100644
--- a/packages/core/src/Table/Table.tsx
+++ b/packages/core/src/Table/Table.tsx
@@ -17,7 +17,7 @@
* - /packages/cli/assets/templates/blocks/components/Table/ (showcase blocks)
*/
-import {useMemo, type ReactElement, type Ref} from 'react';
+import {createContext, use, useMemo, type ReactElement, type Ref} from 'react';
import * as stylex from '@stylexjs/stylex';
import {colorVars} from '../theme/tokens.stylex';
import {BaseTable} from './BaseTable';
@@ -135,6 +135,17 @@ const scrollWrapperStyles = stylex.create({
},
});
+/**
+ * The Table's own name, for the scroll region that names itself after it.
+ * Internal to Table: the scroll wrapper is not given it as a prop, so it adds
+ * nothing to the public table types.
+ */
+const TableNameContext = createContext<{
+ label?: string;
+ labelledBy?: string;
+} | null>(null);
+TableNameContext.displayName = 'TableNameContext';
+
function TableScrollWrapper({
children,
htmlProps,
@@ -151,7 +162,17 @@ function TableScrollWrapper({
afterTable?: React.ReactNode;
}) {
const t = useTranslator();
- const label = t('@astryx.table.label');
+ const tableName = use(TableNameContext);
+ // The focusable scroll region takes the table's own name (spec:AST-025
+ // FR12), so two tables are not two groups both named "Table". It is named
+ // the way the table is: `aria-labelledby` wins over `aria-label`, as it does
+ // in accessible-name computation; the generic name is the fallback for an
+ // unnamed table.
+ const labelledBy = tableName?.labelledBy;
+ const label =
+ labelledBy != null
+ ? undefined
+ : (tableName?.label ?? t('@astryx.table.label'));
const {getViewportProps, getContentProps, state} = useScrollableArea({
axis: 'inline',
keyboardAccess: {owner: 'content'},
@@ -161,6 +182,9 @@ function TableScrollWrapper({
const viewportProps = getViewportProps<HTMLDivElement>({
role: 'group',
'aria-label': label,
+ // A plugin's explicit name stays authoritative (Table FR1).
+ 'aria-labelledby':
+ restHtmlProps['aria-label'] == null ? labelledBy : undefined,
...(state.inline.isScrollable ? {tabIndex: 0} : {}),
...restHtmlProps,
ref,
@@ -240,18 +264,26 @@ function TableInner<T extends Record<string, unknown>>({
}),
[density, dividers, isStriped, hasHover, verticalAlign, textOverflow],
);
+ const tableLabel = rest['aria-label'];
+ const tableLabelledBy = rest['aria-labelledby'];
+ const tableName = useMemo(
+ () => ({label: tableLabel, labelledBy: tableLabelledBy}),
+ [tableLabel, tableLabelledBy],
+ );
return (
<TableContext value={contextValue}>
- <BaseTable<T>
- ref={ref}
- data={data}
- columns={columns}
- plugins={mergedPlugins}
- textOverflow={textOverflow}
- scrollWrapper={TableScrollWrapper}
- {...rest}
- />
+ <TableNameContext value={tableName}>
+ <BaseTable<T>
+ ref={ref}
+ data={data}
+ columns={columns}
+ plugins={mergedPlugins}
+ textOverflow={textOverflow}
+ scrollWrapper={TableScrollWrapper}
+ {...rest}
+ />
+ </TableNameContext>
</TableContext>
);
}
diff --git a/packages/core/src/Table/__tests__/Table.a11y.states.ts b/packages/core/src/Table/__tests__/Table.a11y.states.ts
index 90436e61f6..d34925b649 100644
--- a/packages/core/src/Table/__tests__/Table.a11y.states.ts
+++ b/packages/core/src/Table/__tests__/Table.a11y.states.ts
@@ -51,11 +51,7 @@ export const TABLE_A11Y_STATES = [
modules: ['sort'],
facts: {
label: 'Team members',
- columnHeaders: [
- 'Sort by Name, sorted descending',
- 'Sort by Role',
- 'Sort by Location',
- ],
+ columnHeaders: ['Name', 'Role', 'Location'],
rows: 3,
rowHeaders: [],
cells: 3,
diff --git a/packages/core/src/Table/plugins/sortable/useTableSortable.test.tsx b/packages/core/src/Table/plugins/sortable/useTableSortable.test.tsx
index 5f212653bc..1a8d3db226 100644
--- a/packages/core/src/Table/plugins/sortable/useTableSortable.test.tsx
+++ b/packages/core/src/Table/plugins/sortable/useTableSortable.test.tsx
@@ -84,16 +84,12 @@ describe('useTableSortable', () => {
render(<SortableTable />);
// Sortable columns should have sort buttons
- expect(
- screen.getByRole('button', {name: /sort by name/i}),
- ).toBeInTheDocument();
- expect(
- screen.getByRole('button', {name: /sort by age/i}),
- ).toBeInTheDocument();
+ expect(screen.getByRole('button', {name: 'Name'})).toBeInTheDocument();
+ expect(screen.getByRole('button', {name: 'Age'})).toBeInTheDocument();
// Non-sortable column should not have a sort button
expect(
- screen.queryByRole('button', {name: /sort by email/i}),
+ screen.queryByRole('button', {name: 'Email'}),
).not.toBeInTheDocument();
});
@@ -104,9 +100,9 @@ describe('useTableSortable', () => {
/>,
);
- const button = screen.getByRole('button', {name: /sort by name/i});
+ const button = screen.getByRole('button', {name: 'Name'});
expect(button).toBeInTheDocument();
- expect(button.getAttribute('aria-label')).toContain('sorted ascending');
+ expect(button.closest('th')).toHaveAttribute('aria-sort', 'ascending');
});
it('renders descending icon when sort state is descending', () => {
@@ -116,15 +112,16 @@ describe('useTableSortable', () => {
/>,
);
- const button = screen.getByRole('button', {name: /sort by name/i});
- expect(button.getAttribute('aria-label')).toContain('sorted descending');
+ const button = screen.getByRole('button', {name: 'Name'});
+ expect(button.closest('th')).toHaveAttribute('aria-sort', 'descending');
});
it('renders unsorted icon when column is sortable but not in sort state', () => {
render(<SortableTable />);
- const button = screen.getByRole('button', {name: /sort by name/i});
- expect(button.getAttribute('aria-label')).toBe('Sort by Name');
+ const button = screen.getByRole('button', {name: 'Name'});
+ expect(button.closest('th')).not.toHaveAttribute('aria-sort');
+ expect(button).not.toHaveAttribute('aria-describedby');
});
it('renders no sort UI for columns without sortable config', () => {
@@ -132,14 +129,14 @@ describe('useTableSortable', () => {
// Email column is not sortable
expect(
- screen.queryByRole('button', {name: /sort by email/i}),
+ screen.queryByRole('button', {name: 'Email'}),
).not.toBeInTheDocument();
});
it('renders sort button wrapping header content', () => {
render(<SortableTable />);
- const button = screen.getByRole('button', {name: /sort by name/i});
+ const button = screen.getByRole('button', {name: 'Name'});
expect(button.tagName).toBe('BUTTON');
expect(button).toHaveAttribute('type', 'button');
expect(button.textContent).toContain('Name');
@@ -156,8 +153,8 @@ describe('useTableSortable', () => {
/>,
);
- const nameButton = screen.getByRole('button', {name: /sort by name/i});
- const ageButton = screen.getByRole('button', {name: /sort by age/i});
+ const nameButton = screen.getByRole('button', {name: 'Name'});
+ const ageButton = screen.getByRole('button', {name: 'Age'});
// Rank badges should be present
expect(nameButton.textContent).toContain('1');
@@ -171,19 +168,17 @@ describe('useTableSortable', () => {
/>,
);
- const nameButton = screen.getByRole('button', {name: /sort by name/i});
- // Should not contain a rank badge — just "Name" text + icon
- expect(nameButton.getAttribute('aria-label')).toBe(
- 'Sort by Name, sorted ascending',
- );
+ const nameButton = screen.getByRole('button', {name: 'Name'});
+ // Single sort has no priority: the name is the column text, and no
+ // description is attached.
+ expect(nameButton).toHaveAccessibleName('Name');
+ expect(nameButton).not.toHaveAttribute('aria-describedby');
});
it('renders sort indicators when data is empty', () => {
render(<SortableTable data={[]} />);
- expect(
- screen.getByRole('button', {name: /sort by name/i}),
- ).toBeInTheDocument();
+ expect(screen.getByRole('button', {name: 'Name'})).toBeInTheDocument();
});
it('uses custom sortKey from column config', () => {
@@ -198,10 +193,8 @@ describe('useTableSortable', () => {
/>,
);
- const button = screen.getByRole('button', {
- name: /sort by full name/i,
- });
- expect(button.getAttribute('aria-label')).toContain('sorted ascending');
+ const button = screen.getByRole('button', {name: 'Full Name'});
+ expect(button.closest('th')).toHaveAttribute('aria-sort', 'ascending');
});
it('uses column key as default sortKey', () => {
@@ -211,8 +204,8 @@ describe('useTableSortable', () => {
/>,
);
- const button = screen.getByRole('button', {name: /sort by name/i});
- expect(button.getAttribute('aria-label')).toContain('sorted ascending');
+ const button = screen.getByRole('button', {name: 'Name'});
+ expect(button.closest('th')).toHaveAttribute('aria-sort', 'ascending');
});
});
@@ -225,9 +218,7 @@ describe('useTableSortable', () => {
const onSortChange = vi.fn();
render(<SortableTable onSortChange={onSortChange} />);
- await userEvent.click(
- screen.getByRole('button', {name: /sort by name/i}),
- );
+ await userEvent.click(screen.getByRole('button', {name: 'Name'}));
expect(onSortChange).toHaveBeenCalledWith([
{sortKey: 'name', direction: 'ascending'},
@@ -243,9 +234,7 @@ describe('useTableSortable', () => {
/>,
);
- await userEvent.click(
- screen.getByRole('button', {name: /sort by name/i}),
- );
+ await userEvent.click(screen.getByRole('button', {name: 'Name'}));
expect(onSortChange).toHaveBeenCalledWith([
{sortKey: 'name', direction: 'descending'},
@@ -261,9 +250,7 @@ describe('useTableSortable', () => {
/>,
);
- await userEvent.click(
- screen.getByRole('button', {name: /sort by name/i}),
- );
+ await userEvent.click(screen.getByRole('button', {name: 'Name'}));
expect(onSortChange).toHaveBeenCalledWith([
{sortKey: 'name', direction: 'ascending'},
@@ -280,9 +267,7 @@ describe('useTableSortable', () => {
/>,
);
- await userEvent.click(
- screen.getByRole('button', {name: /sort by name/i}),
- );
+ await userEvent.click(screen.getByRole('button', {name: 'Name'}));
expect(onSortChange).toHaveBeenCalledWith([]);
});
@@ -296,7 +281,7 @@ describe('useTableSortable', () => {
/>,
);
- await userEvent.click(screen.getByRole('button', {name: /sort by age/i}));
+ await userEvent.click(screen.getByRole('button', {name: 'Age'}));
expect(onSortChange).toHaveBeenCalledWith([
{sortKey: 'age', direction: 'ascending'},
@@ -315,7 +300,7 @@ describe('useTableSortable', () => {
);
await user.keyboard('{Shift>}');
- await user.click(screen.getByRole('button', {name: /sort by age/i}));
+ await user.click(screen.getByRole('button', {name: 'Age'}));
await user.keyboard('{/Shift}');
expect(onSortChange).toHaveBeenCalledWith([
@@ -339,7 +324,7 @@ describe('useTableSortable', () => {
);
await user.keyboard('{Shift>}');
- await user.click(screen.getByRole('button', {name: /sort by age/i}));
+ await user.click(screen.getByRole('button', {name: 'Age'}));
await user.keyboard('{/Shift}');
expect(onSortChange).toHaveBeenCalledWith([
@@ -364,7 +349,7 @@ describe('useTableSortable', () => {
);
await user.keyboard('{Shift>}');
- await user.click(screen.getByRole('button', {name: /sort by age/i}));
+ await user.click(screen.getByRole('button', {name: 'Age'}));
await user.keyboard('{/Shift}');
expect(onSortChange).toHaveBeenCalledWith([
@@ -385,7 +370,7 @@ describe('useTableSortable', () => {
/>,
);
- await userEvent.click(screen.getByRole('button', {name: /sort by age/i}));
+ await userEvent.click(screen.getByRole('button', {name: 'Age'}));
expect(onSortChange).toHaveBeenCalledWith([
{sortKey: 'age', direction: 'ascending'},
@@ -398,7 +383,7 @@ describe('useTableSortable', () => {
// Email column header text should exist but not as a button
expect(
- screen.queryByRole('button', {name: /sort by email/i}),
+ screen.queryByRole('button', {name: 'Email'}),
).not.toBeInTheDocument();
expect(onSortChange).not.toHaveBeenCalled();
});
@@ -445,25 +430,24 @@ describe('useTableSortable', () => {
expect(emailHeader).not.toHaveAttribute('aria-sort');
});
- it('sort button has accessible aria-label', () => {
+ it('names the sort button by its column text and keeps direction on the header (AST-020 FR15)', () => {
render(
<SortableTable
initialSort={[{sortKey: 'name', direction: 'ascending'}]}
/>,
);
- expect(
- screen.getByRole('button', {
- name: 'Sort by Name, sorted ascending',
- }),
- ).toBeInTheDocument();
+ const button = screen.getByRole('button', {name: 'Name'});
+ expect(button).not.toHaveAttribute('aria-label');
+ const header = screen.getByRole('columnheader', {name: 'Name'});
+ expect(header).toHaveAttribute('aria-sort', 'ascending');
});
it('sort button is keyboard accessible (Enter)', async () => {
const onSortChange = vi.fn();
render(<SortableTable onSortChange={onSortChange} />);
- const button = screen.getByRole('button', {name: /sort by name/i});
+ const button = screen.getByRole('button', {name: 'Name'});
button.focus();
await userEvent.keyboard('{Enter}');
@@ -476,7 +460,7 @@ describe('useTableSortable', () => {
const onSortChange = vi.fn();
render(<SortableTable onSortChange={onSortChange} />);
- const button = screen.getByRole('button', {name: /sort by name/i});
+ const button = screen.getByRole('button', {name: 'Name'});
button.focus();
await userEvent.keyboard(' ');
@@ -485,7 +469,7 @@ describe('useTableSortable', () => {
]);
});
- it('multi-sort aria-label includes priority', () => {
+ it('describes each sort button with its priority while several columns sort', () => {
render(
<SortableTable
isMultiSortEnabled
@@ -497,15 +481,11 @@ describe('useTableSortable', () => {
);
expect(
- screen.getByRole('button', {
- name: 'Sort by Name, sorted ascending, priority 1 of 2',
- }),
- ).toBeInTheDocument();
+ screen.getByRole('button', {name: 'Name'}),
+ ).toHaveAccessibleDescription('Priority 1 of 2');
expect(
- screen.getByRole('button', {
- name: 'Sort by Age, sorted descending, priority 2 of 2',
- }),
- ).toBeInTheDocument();
+ screen.getByRole('button', {name: 'Age'}),
+ ).toHaveAccessibleDescription('Priority 2 of 2');
});
});
@@ -528,8 +508,8 @@ describe('useTableSortable', () => {
render(<SortableTable initialSort={[]} />);
// All sortable columns should show unsorted state
- const nameButton = screen.getByRole('button', {name: 'Sort by Name'});
- const ageButton = screen.getByRole('button', {name: 'Sort by Age'});
+ const nameButton = screen.getByRole('button', {name: 'Name'});
+ const ageButton = screen.getByRole('button', {name: 'Age'});
expect(nameButton).toBeInTheDocument();
expect(ageButton).toBeInTheDocument();
});
@@ -574,7 +554,8 @@ describe('useTableSortable', () => {
render(<SortableTable columns={columns} />);
- const button = screen.getByRole('button', {name: /sort by name/i});
+ // A node header names the button by its own text, not the column key.
+ const button = screen.getByRole('button', {name: 'Custom Name'});
expect(button).toBeInTheDocument();
expect(screen.getByTestId('custom-header')).toBeInTheDocument();
});
@@ -593,13 +574,15 @@ describe('useTableSortable', () => {
);
// Both columns should show their sort state
- const nameButton = screen.getByRole('button', {name: /sort by name/i});
- const ageButton = screen.getByRole('button', {name: /sort by age/i});
- expect(nameButton.getAttribute('aria-label')).toContain(
- 'sorted ascending',
+ const nameButton = screen.getByRole('button', {name: 'Name'});
+ const ageButton = screen.getByRole('button', {name: 'Age'});
+ expect(nameButton.closest('th')).toHaveAttribute(
+ 'aria-sort',
+ 'ascending',
);
- expect(ageButton.getAttribute('aria-label')).toContain(
- 'sorted descending',
+ expect(ageButton.closest('th')).toHaveAttribute(
+ 'aria-sort',
+ 'descending',
);
});
});
@@ -699,39 +682,18 @@ describe('useTableSortable — context menu actions', () => {
});
// =============================================================================
-// i18n (header-button aria-labels route through the catalog)
+// i18n (the multi-sort priority description routes through the catalog)
// =============================================================================
describe('useTableSortable — i18n', () => {
- it('localizes the unsorted sort-by aria-label via @astryx.table.sort.sortBy', () => {
- render(
- <InternationalizationProvider
- locale="fr"
- overrides={{
- fr: {'@astryx.table.sort.sortBy': 'Trier par {label}'},
- }}>
- <SortableTable />
- </InternationalizationProvider>,
- );
-
- expect(
- screen.getByRole('button', {name: 'Trier par Name'}),
- ).toBeInTheDocument();
- expect(
- screen.getByRole('button', {name: 'Trier par Age'}),
- ).toBeInTheDocument();
- });
-
- it('localizes the multi-sort priority aria-label with ICU number args', () => {
+ it('localizes the multi-sort priority description with ICU number args', () => {
render(
<InternationalizationProvider
locale="fr"
overrides={{
fr: {
- '@astryx.table.sort.sortedByWithPriority':
- 'Trier par {label}, tri {direction}, priorité {rank, number} sur {total, number}',
- '@astryx.table.sort.direction.ascending': 'croissant',
- '@astryx.table.sort.direction.descending': 'décroissant',
+ '@astryx.table.sort.priority':
+ 'Priorité {rank, number} sur {total, number}',
},
}}>
<SortableTable
@@ -744,43 +706,12 @@ describe('useTableSortable — i18n', () => {
</InternationalizationProvider>,
);
- // The overridden direction words deliberately differ from the raw enum
- // values ('ascending'/'descending'), so an implementation interpolating
- // the enum without translating it cannot pass — for either direction.
expect(
- screen.getByRole('button', {
- name: 'Trier par Name, tri croissant, priorité 1 sur 2',
- }),
- ).toBeInTheDocument();
+ screen.getByRole('button', {name: 'Name'}),
+ ).toHaveAccessibleDescription('Priorité 1 sur 2');
expect(
- screen.getByRole('button', {
- name: 'Trier par Age, tri décroissant, priorité 2 sur 2',
- }),
- ).toBeInTheDocument();
- });
-
- it('localizes the sorted aria-label and direction word via their own keys', () => {
- render(
- <InternationalizationProvider
- locale="fr"
- overrides={{
- fr: {
- '@astryx.table.sort.sortedBy': 'Trié par {label}, {direction}',
- '@astryx.table.sort.direction.ascending': 'croissant',
- },
- }}>
- <SortableTable
- initialSort={[{sortKey: 'name', direction: 'ascending'}]}
- />
- </InternationalizationProvider>,
- );
-
- // Both the composed template and the direction word resolve through
- // their own catalog keys; 'croissant' differs from the raw enum value,
- // so neither a hardcoded English frame nor raw-enum interpolation passes.
- expect(
- screen.getByRole('button', {name: 'Trié par Name, croissant'}),
- ).toBeInTheDocument();
+ screen.getByRole('button', {name: 'Age'}),
+ ).toHaveAccessibleDescription('Priorité 2 sur 2');
});
});
@@ -805,8 +736,8 @@ describe('useTableSortable — header alignment', () => {
/>,
);
- expect(buttonFor(/sort by age/i).className).not.toBe(
- buttonFor(/sort by name/i).className,
+ expect(buttonFor(/^age$/i).className).not.toBe(
+ buttonFor(/^name$/i).className,
);
});
@@ -820,8 +751,8 @@ describe('useTableSortable — header alignment', () => {
/>,
);
- expect(buttonFor(/sort by age/i).className).not.toBe(
- buttonFor(/sort by name/i).className,
+ expect(buttonFor(/^age$/i).className).not.toBe(
+ buttonFor(/^name$/i).className,
);
});
@@ -835,8 +766,8 @@ describe('useTableSortable — header alignment', () => {
/>,
);
- expect(buttonFor(/sort by name/i).className).not.toBe(
- buttonFor(/sort by age/i).className,
+ expect(buttonFor(/^name$/i).className).not.toBe(
+ buttonFor(/^age$/i).className,
);
});
@@ -850,8 +781,6 @@ describe('useTableSortable — header alignment', () => {
/>,
);
- expect(buttonFor(/sort by age/i).className).toBe(
- buttonFor(/sort by name/i).className,
- );
+ expect(buttonFor(/^age$/i).className).toBe(buttonFor(/^name$/i).className);
});
});
diff --git a/packages/core/src/Table/plugins/sortable/useTableSortable.tsx b/packages/core/src/Table/plugins/sortable/useTableSortable.tsx
index c7ec1d1d3e..543aa8d6a5 100644
--- a/packages/core/src/Table/plugins/sortable/useTableSortable.tsx
+++ b/packages/core/src/Table/plugins/sortable/useTableSortable.tsx
@@ -13,13 +13,13 @@
* - /packages/core/src/Table/index.ts (exports)
*/
-import {useRef, useMemo, type ReactNode} from 'react';
+import {useId, useRef, useMemo, type ReactNode} from 'react';
import * as stylex from '@stylexjs/stylex';
import {colorVars, spacingVars, radiusVars} from '../../../theme/tokens.stylex';
import {focusOutlineProps} from '../../../utils/focusOutline.stylex';
import {Icon} from '../../../Icon';
import {resolveContextActions} from '../../tableContextMenu';
-import {useTranslator, type TranslatorFn} from '../../../i18n';
+import {useTranslator} from '../../../i18n';
import type {
TablePlugin,
HeaderCellRenderProps,
@@ -183,42 +183,6 @@ function resolveSortKey<T extends Record<string, unknown>>(
return sortable.sortKey ?? column.key;
}
-function getHeaderLabel<T extends Record<string, unknown>>(
- column: TableColumn<T>,
-): string {
- const {header} = column;
- if (typeof header === 'string') {
- return header;
- }
- return column.key;
-}
-
-function buildAriaLabel<T extends Record<string, unknown>>(
- t: TranslatorFn,
- column: TableColumn<T>,
- direction: TableSortDirection | null,
- rank: number | null,
- total: number,
-): string {
- const label = getHeaderLabel(column);
- if (direction == null) {
- return t('@astryx.table.sort.sortBy', {label});
- }
- const directionLabel =
- direction === 'ascending'
- ? t('@astryx.table.sort.direction.ascending')
- : t('@astryx.table.sort.direction.descending');
- if (rank != null && total > 1) {
- return t('@astryx.table.sort.sortedByWithPriority', {
- label,
- direction: directionLabel,
- rank,
- total,
- });
- }
- return t('@astryx.table.sort.sortedBy', {label, direction: directionLabel});
-}
-
function getNextDirection(
current: TableSortDirection | null,
allowUnsortedState: boolean,
@@ -264,13 +228,11 @@ function SortHeaderButton<T extends Record<string, unknown>>({
? 'arrowDown'
: 'arrowsUpDown';
- const ariaLabel = buildAriaLabel(
- t,
- column,
- direction,
- rank,
- config.sort.length,
- );
+ // The button is named by its column's text, so the column header keeps
+ // that name; direction lives in the header's aria-sort. Only the multi-sort
+ // priority, which aria-sort cannot carry, is a description
+ // (spec:AST-020 FR15; WCAG 1.3.1).
+ const priorityId = useId();
const handleClick = (e: React.MouseEvent | React.KeyboardEvent) => {
const cfg = configRef.current;
@@ -315,37 +277,46 @@ function SortHeaderButton<T extends Record<string, unknown>>({
};
return (
- <button
- type="button"
- {...focusOutlineProps.focusVisible(
- sortStyles.button,
- column.align === 'end'
- ? sortStyles.buttonAlignEnd
- : column.align === 'center'
- ? sortStyles.buttonAlignCenter
- : null,
- )}
- aria-label={ariaLabel}
- onClick={handleClick}>
- <span>{children}</span>
- <span
- {...stylex.props(
- direction != null
- ? sortStyles.iconWrapperActive
- : sortStyles.iconWrapperUnsorted,
- )}>
- <Icon
- icon={iconName}
- size="xsm"
- color={direction != null ? 'accent' : 'secondary'}
- />
- </span>
+ <>
+ <button
+ type="button"
+ {...focusOutlineProps.focusVisible(
+ sortStyles.button,
+ column.align === 'end'
+ ? sortStyles.buttonAlignEnd
+ : column.align === 'center'
+ ? sortStyles.buttonAlignCenter
+ : null,
+ )}
+ aria-describedby={rank != null ? priorityId : undefined}
+ onClick={handleClick}>
+ <span>{children}</span>
+ <span
+ {...stylex.props(
+ direction != null
+ ? sortStyles.iconWrapperActive
+ : sortStyles.iconWrapperUnsorted,
+ )}>
+ <Icon
+ icon={iconName}
+ size="xsm"
+ color={direction != null ? 'accent' : 'secondary'}
+ />
+ </span>
+ {rank != null && (
+ <span {...stylex.props(sortStyles.rank)} aria-hidden="true">
+ {rank}
+ </span>
+ )}
+ </button>
{rank != null && (
- <span {...stylex.props(sortStyles.rank)} aria-hidden="true">
- {rank}
+ // Hidden, so it adds nothing to the button's or the header's name;
+ // aria-describedby still reads it.
+ <span id={priorityId} hidden>
+ {t('@astryx.table.sort.priority', {rank, total: config.sort.length})}
</span>
)}
- </button>
+ </>
);
}
diff --git a/packages/core/src/Table/plugins/sortable/useTableSortableState.test.tsx b/packages/core/src/Table/plugins/sortable/useTableSortableState.test.tsx
index 5b1b7777f1..195b606e7d 100644
--- a/packages/core/src/Table/plugins/sortable/useTableSortableState.test.tsx
+++ b/packages/core/src/Table/plugins/sortable/useTableSortableState.test.tsx
@@ -186,9 +186,7 @@ describe('useTableSortableState', () => {
render(<SortableStateTable />);
// Click Name header to sort ascending
- await userEvent.click(
- screen.getByRole('button', {name: /sort by name/i}),
- );
+ await userEvent.click(screen.getByRole('button', {name: 'Name'}));
expect(getNameColumnValues()).toEqual([
'Alice',
'Bob',
@@ -197,9 +195,7 @@ describe('useTableSortableState', () => {
]);
// Click again to sort descending
- await userEvent.click(
- screen.getByRole('button', {name: /sort by name/i}),
- );
+ await userEvent.click(screen.getByRole('button', {name: 'Name'}));
expect(getNameColumnValues()).toEqual([
'Diana',
'Charlie',
@@ -223,7 +219,7 @@ describe('useTableSortableState', () => {
]);
// Sort by age instead
- await userEvent.click(screen.getByRole('button', {name: /sort by age/i}));
+ await userEvent.click(screen.getByRole('button', {name: 'Age'}));
// Age ascending: Alice(28), Diana(31), Charlie(35), Bob(42)
expect(getNameColumnValues()).toEqual([
@@ -243,13 +239,9 @@ describe('useTableSortableState', () => {
);
// Click to descending
- await userEvent.click(
- screen.getByRole('button', {name: /sort by name/i}),
- );
+ await userEvent.click(screen.getByRole('button', {name: 'Name'}));
// Click to unsorted
- await userEvent.click(
- screen.getByRole('button', {name: /sort by name/i}),
- );
+ await userEvent.click(screen.getByRole('button', {name: 'Name'}));
// Back to original order
expect(getNameColumnValues()).toEqual([
@@ -265,7 +257,7 @@ describe('useTableSortableState', () => {
it('sorts numbers correctly without custom comparator', async () => {
render(<SortableStateTable />);
- await userEvent.click(screen.getByRole('button', {name: /sort by age/i}));
+ await userEvent.click(screen.getByRole('button', {name: 'Age'}));
// Age ascending: 28, 31, 35, 42
expect(getNameColumnValues()).toEqual([
@@ -397,9 +389,7 @@ describe('useTableSortableState', () => {
render(<ControlledWithSpy />);
- await userEvent.click(
- screen.getByRole('button', {name: /sort by name/i}),
- );
+ await userEvent.click(screen.getByRole('button', {name: 'Name'}));
expect(onSortChange).toHaveBeenCalledWith([
{sortKey: 'name', direction: 'ascending'},
@@ -442,7 +432,7 @@ describe('useTableSortableState', () => {
// Department ascending: Design(Bob, Diana), Engineering(Alice, Charlie)
// Now shift+click Name to add secondary sort
await user.keyboard('{Shift>}');
- await user.click(screen.getByRole('button', {name: /sort by name/i}));
+ await user.click(screen.getByRole('button', {name: 'Name'}));
await user.keyboard('{/Shift}');
// Design: Bob, Diana; Engineering: Alice, Charlie
@@ -541,9 +531,7 @@ describe('useTableSortableState', () => {
// Should render without throwing — table still mounts with empty data
expect(screen.getByRole('table')).toBeInTheDocument();
// Sort headers should still be interactive
- expect(
- screen.getByRole('button', {name: /sort by name/i}),
- ).toBeInTheDocument();
+ expect(screen.getByRole('button', {name: 'Name'})).toBeInTheDocument();
});
});