An open source design system that's fully customizable and agent ready
TypeScript
fix(table): localize tree expander aria-label to unbreak lint on main (#4149)
nynexman4464996fcf0a27de
diff --git a/packages/core/locales/en.json b/packages/core/locales/en.jsonindex a302162ea4..48c36a87c6 100644--- a/packages/core/locales/en.json+++ b/packages/core/locales/en.json@@ -723,6 +723,14 @@"defaultMessage": "Expand all rows","description": "Aria label for the Table expand-all / collapse-all header button when not all rows are currently expanded."},+ "@astryx.tableTree.collapseRow": {+ "defaultMessage": "Collapse row",+ "description": "Aria label for the Table tree-data expander chevron when the row is currently expanded."+ },+ "@astryx.tableTree.expandRow": {+ "defaultMessage": "Expand row",+ "description": "Aria label for the Table tree-data expander chevron when the row is currently collapsed."+ },"@astryx.textInput.clearLabel": {"defaultMessage": "Clear {label}","description": "Aria label for the TextInput clear button. `label` is the input's own visible label."diff --git a/packages/core/src/Table/plugins/tree/useTableTreeData.tsx b/packages/core/src/Table/plugins/tree/useTableTreeData.tsxindex 3d7acc1458..4e33164b54 100644--- a/packages/core/src/Table/plugins/tree/useTableTreeData.tsx+++ b/packages/core/src/Table/plugins/tree/useTableTreeData.tsx@@ -4,7 +4,7 @@/*** @file useTableTreeData.tsx- * @input React, StyleX, Icon, Table types, theme tokens+ * @input React, StyleX, Icon, Table types, theme tokens, i18n (useTranslator)* @output Exports useTableTreeData hook + config/meta types* @position Tree plugin; consumed by Table via plugins prop.* Pairs with useTableTreeState (owns expansion state + flattening).@@ -44,6 +44,7 @@ import {colorVars, radiusVars, spacingVars} from '../../../theme/tokens.stylex';import {Icon} from '../../../Icon';import {mergeRefs} from '../../../utils';import type {TablePlugin, TableColumn, BodyRowRenderProps} from '../../types';+import {useTranslator} from '../../../i18n';// =============================================================================// Types@@ -255,6 +256,7 @@ function TreeExpander({isExpanded: boolean;onToggle: () => void;}) {+ const t = useTranslator();return (<buttontype="button"@@ -263,7 +265,11 @@ function TreeExpander({e.stopPropagation();onToggle();}}- aria-label={isExpanded ? 'Collapse row' : 'Expand row'}+ aria-label={+ isExpanded+ ? t('@astryx.tableTree.collapseRow')+ : t('@astryx.tableTree.expandRow')+ }aria-expanded={isExpanded}><span{...stylex.props(