diff --git a/.gitignore b/.gitignore
index 8aca6d7b3..684e62b5e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,6 +11,7 @@ node_modules
*.hot-update.js
*.log
dist
+dist-vite
build
Thumbs.db
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 7e2a0fe4e..5aad0eda6 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -28,12 +28,21 @@
"statusBar.background": "#017ce6",
"statusBar.foreground": "#e7e7e7",
"statusBarItem.hoverBackground": "#1c95fe",
- "statusBarItem.remoteBackground": "#017ce6",
+ "statusBarItem.remoteBackground": "#ffa0d3",
"statusBarItem.remoteForeground": "#e7e7e7",
"titleBar.activeBackground": "#017ce6",
"titleBar.activeForeground": "#e7e7e7",
"titleBar.inactiveBackground": "#017ce699",
- "titleBar.inactiveForeground": "#e7e7e799"
+ "titleBar.inactiveForeground": "#e7e7e799",
+ "activityBarTop.activeBackground": "#1c95fe",
+ "activityBarTop.background": "#1c95fe",
+ "activityBarTop.foreground": "#e7e7e7",
+ "activityBarTop.inactiveForeground": "#e7e7e799",
+ "commandCenter.foreground": "#e7e7e7",
+ "statusBar.debuggingBackground": "#017ce6",
+ "statusBar.debuggingForeground": "#e7e7e7",
+ "activityBar.activeBorder": "#e7e7e7",
+ "activityBarTop.activeBorder": "#e7e7e7"
},
"peacock.color": "#017ce6"
}
diff --git a/packages/cx/src/charts/Legend.tsx b/packages/cx/src/charts/Legend.tsx
index 6eecec463..aeee88401 100644
--- a/packages/cx/src/charts/Legend.tsx
+++ b/packages/cx/src/charts/Legend.tsx
@@ -41,6 +41,15 @@ export interface LegendConfig extends HtmlElementConfig {
/** Default shape to use for all entries. */
shape?: StringProp;
+ /** ARIA role for each entry's shape `svg`. Defaults to `img` when `shapeAriaLabel` is set. */
+ shapeRole?: StringProp;
+
+ /**
+ * Accessible name for each entry's shape `svg`. Unnamed shapes are hidden from assistive
+ * technology, since the entry text already says what they mean.
+ */
+ shapeAriaLabel?: StringProp;
+
/** Style applied to each entry. */
entryStyle?: StyleProp;
@@ -97,6 +106,8 @@ export class Legend extends HtmlElement {
declareData(...args: any[]): void {
super.declareData(...args, {
shape: undefined,
+ shapeRole: undefined,
+ shapeAriaLabel: undefined,
entryStyle: { structured: true },
entryClass: { structured: true },
valueStyle: { structured: true },
@@ -124,6 +135,8 @@ export class Legend extends HtmlElement {
case "shapeSize":
case "svgSize":
case "shape":
+ case "shapeRole":
+ case "shapeAriaLabel":
case "entryStyle":
case "entryClass":
case "valueStyle":
@@ -177,7 +190,7 @@ export class Legend extends HtmlElement {
instance.legends[this.name] && instance.legends[this.name].entries,
list: React.ReactNode;
- let { entryClass, entryStyle, shape, valueClass, valueStyle } =
+ let { entryClass, entryStyle, shape, shapeRole, shapeAriaLabel, valueClass, valueStyle } =
instance.data;
let valueFormatter = Format.parse(this.valueFormat);
@@ -210,7 +223,7 @@ export class Legend extends HtmlElement {
onMouseMove={onMouseMove}
onMouseLeave={onMouseLeave}
>
- {this.renderShape(e, shape)}
+ {this.renderShape(e, shape, shapeRole, shapeAriaLabel)}
{e.displayText || e.name}
{this.showValues && (
@@ -229,6 +242,8 @@ export class Legend extends HtmlElement {
renderShape(
entry: LegendEntryData,
legendEntriesShape: string | null | undefined,
+ role?: string,
+ ariaLabel?: string,
): React.ReactNode {
const className = this.CSS.element(this.baseClass, "shape", {
[`color-${entry.colorIndex}`]:
@@ -244,6 +259,11 @@ export class Legend extends HtmlElement {
return (