@cloudscape-design/chart-components 1.0.26 → 1.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -58,10 +58,12 @@ export class ChartExtraLegend extends AsyncStore {
58
58
  this.updateLegendItems(nextItems);
59
59
  };
60
60
  this.initLegend = () => {
61
+ const prevState = this.get().items.reduce((map, item) => map.set(item.id, item), new Map());
61
62
  const itemSpecs = getChartLegendItems(this.context.chart());
62
63
  const legendItems = itemSpecs.map(({ id, name, color, markerType, visible, isSecondary }) => {
64
+ var _a, _b;
63
65
  const marker = this.renderMarker(markerType, color, visible);
64
- return { id, name, marker, visible, isSecondary, highlighted: false };
66
+ return { id, name, marker, visible, isSecondary, highlighted: (_b = (_a = prevState.get(id)) === null || _a === void 0 ? void 0 : _a.highlighted) !== null && _b !== void 0 ? _b : false };
65
67
  });
66
68
  this.updateLegendItems(legendItems);
67
69
  };
@@ -1 +1 @@
1
- {"version":3,"file":"chart-extra-legend.js","sourceRoot":"","sources":["../../../../src/core/chart-api/chart-extra-legend.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,iBAAiB,EAAyB,MAAM,yCAAyC,CAAC;AACnG,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,UAAU,MAAM,kCAAkC,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAQxE,wDAAwD;AACxD,MAAM,OAAO,gBAAiB,SAAQ,UAA+B;IAInE,YAAY,OAA0B;QACpC,KAAK,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;QAHf,mBAAc,GAA4B,UAAU,CAAC;QAOtD,kBAAa,GAAG,GAAG,EAAE;YAC1B,IAAI,CAAC,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C,MAAM,CAAC,CAAC,EAAE;YAC9C,MAAM,CAAC,UAAU,CAAC,kBAAkB,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,CAAC;SACnF;QACD,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,IAAI,EAAE;YAC/B,IAAI,OAAO,KAAK,CAAC,UAAU,KAAK,UAAU,IAAI,iBAAiB,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE;gBACtF,KAAK,CAAC,UAAU,CAAC,kBAAkB,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,CAAC;aAC/E;SACF;KACF;IAED,+GAA+G;IAC/G,gHAAgH;IAChH,IAAI,cAAc,GAAG,CAAC,EAAE;QACtB,KAAK,CAAC,MAAM,EAAE,CAAC;KAChB;AACH,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type Highcharts from \"highcharts\";\n\nimport { ChartSeriesMarker, ChartSeriesMarkerType } from \"../../internal/components/series-marker\";\nimport { fireNonCancelableEvent } from \"../../internal/events\";\nimport AsyncStore from \"../../internal/utils/async-store\";\nimport { getChartSeries } from \"../../internal/utils/chart-series\";\nimport { isEqualArrays } from \"../../internal/utils/utils\";\nimport { CoreChartProps } from \"../interfaces\";\nimport { getChartLegendItems, getPointId, getSeriesId } from \"../utils\";\nimport { ChartExtraContext } from \"./chart-extra-context\";\n\n// The reactive state is used to propagate changes in legend items to the core legend React component.\nexport interface ReactiveLegendState {\n items: readonly CoreChartProps.LegendItem[];\n}\n\n// Chart helper that implements custom legend behaviors.\nexport class ChartExtraLegend extends AsyncStore<ReactiveLegendState> {\n private context: ChartExtraContext;\n private visibilityMode: \"internal\" | \"external\" = \"external\";\n\n constructor(context: ChartExtraContext) {\n super({ items: [] });\n this.context = context;\n }\n\n public onChartRender = () => {\n this.initLegend();\n this.updateItemsVisibility();\n };\n\n // If visible items are explicitly provided, we use them to update visibility of chart's series or points (by ID).\n // If not provided, the visibility state is managed internally.\n public updateItemsVisibility = () => {\n if (this.context.state.visibleItems) {\n this.visibilityMode = \"external\";\n updateItemsVisibility(this.context.chart(), this.get().items, this.context.state.visibleItems);\n } else {\n this.visibilityMode = \"internal\";\n }\n };\n\n // A callback to be called when items visibility changes from the outside or from the legend.\n public onItemVisibilityChange = (visibleItems: readonly string[], { isApiCall }: { isApiCall: boolean }) => {\n const currentItems = this.get().items;\n const updatedItems = currentItems.map((i) => ({ ...i, visible: visibleItems.includes(i.id) }));\n if (this.visibilityMode === \"internal\") {\n this.updateLegendItems(updatedItems);\n updateItemsVisibility(this.context.chart(), this.get().items, visibleItems);\n }\n fireNonCancelableEvent(this.context.handlers.onVisibleItemsChange, { items: updatedItems, isApiCall });\n };\n\n // Updates legend highlight state when chart's point is highlighted.\n public onHighlightPoint = (point: Highcharts.Point) => {\n const visibleItems = point.series.type === \"pie\" ? [getPointId(point)] : [getSeriesId(point.series)];\n this.onHighlightItems(visibleItems);\n };\n\n // Updates legend highlight state when chart's group of points is highlighted.\n public onHighlightGroup = (group: readonly Highcharts.Point[]) => {\n const visibleItems = group.map((point) => getSeriesId(point.series));\n this.onHighlightItems(visibleItems);\n };\n\n // Updates legend highlight state given an explicit list of item IDs. This is used to update state\n // when a legend item gets hovered or focused.\n public onHighlightItems = (highlightedItems: readonly string[]) => {\n const currentItems = this.get().items;\n const updatedItems = currentItems.map(({ ...i }) => ({ ...i, highlighted: highlightedItems.includes(i.id) }));\n this.updateLegendItems(updatedItems);\n };\n\n // Clears legend highlight state.\n public onClearHighlight = () => {\n const nextItems = this.get().items.map(({ ...item }) => ({ ...item, highlighted: false }));\n this.updateLegendItems(nextItems);\n };\n\n private initLegend = () => {\n const itemSpecs = getChartLegendItems(this.context.chart());\n const legendItems = itemSpecs.map(({ id, name, color, markerType, visible, isSecondary }) => {\n const marker = this.renderMarker(markerType, color, visible);\n return { id, name, marker, visible, isSecondary, highlighted: false };\n });\n this.updateLegendItems(legendItems);\n };\n\n private updateLegendItems = (nextItems: CoreChartProps.LegendItem[]) => {\n function isLegendItemsEqual(a: CoreChartProps.LegendItem, b: CoreChartProps.LegendItem) {\n return (\n a.id === b.id &&\n a.name === b.name &&\n a.marker === b.marker &&\n a.visible === b.visible &&\n a.highlighted === b.highlighted\n );\n }\n if (!isEqualArrays(this.get().items, nextItems, isLegendItemsEqual)) {\n this.set(() => ({ items: nextItems }));\n }\n };\n\n // The chart markers derive from type and color and are cached to avoid unnecessary renders,\n // and allow comparing them by reference.\n private markersCache = new Map<string, React.ReactNode>();\n public renderMarker(type: ChartSeriesMarkerType, color: string, visible = true): React.ReactNode {\n const key = `${type}:${color}:${visible}`;\n const marker = this.markersCache.get(key) ?? <ChartSeriesMarker type={type} color={color} visible={visible} />;\n this.markersCache.set(key, marker);\n return marker;\n }\n}\n\nfunction updateItemsVisibility(\n chart: Highcharts.Chart,\n legendItems: readonly CoreChartProps.LegendItem[],\n visibleItems?: readonly string[],\n) {\n const availableItemsSet = new Set(legendItems.map((i) => i.id));\n const visibleItemsSet = new Set(visibleItems);\n\n let updatesCounter = 0;\n const getVisibleAndCount = (id: string, visible: boolean) => {\n const nextVisible = visibleItemsSet.has(id);\n updatesCounter += nextVisible !== visible ? 1 : 0;\n return nextVisible;\n };\n\n for (const series of getChartSeries(chart.series)) {\n if (availableItemsSet.has(getSeriesId(series))) {\n series.setVisible(getVisibleAndCount(getSeriesId(series), series.visible), false);\n }\n for (const point of series.data) {\n if (typeof point.setVisible === \"function\" && availableItemsSet.has(getPointId(point))) {\n point.setVisible(getVisibleAndCount(getPointId(point), point.visible), false);\n }\n }\n }\n\n // The call `seriesOrPoint.setVisible(visible, false)` does not trigger the chart redraw, as it would otherwise\n // impact the performance. Instead, we trigger the redraw explicitly, if any change to visibility has been made.\n if (updatesCounter > 0) {\n chart.redraw();\n }\n}\n"]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AAK,CAAC,CAAC,EAAE;gBACtF,KAAK,CAAC,UAAU,CAAC,kBAAkB,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,CAAC;aAC/E;SACF;KACF;IAED,+GAA+G;IAC/G,gHAAgH;IAChH,IAAI,cAAc,GAAG,CAAC,EAAE;QACtB,KAAK,CAAC,MAAM,EAAE,CAAC;KAChB;AACH,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type Highcharts from \"highcharts\";\n\nimport { LegendItem } from \"../../internal/components/interfaces\";\nimport { ChartSeriesMarker, ChartSeriesMarkerType } from \"../../internal/components/series-marker\";\nimport { fireNonCancelableEvent } from \"../../internal/events\";\nimport AsyncStore from \"../../internal/utils/async-store\";\nimport { getChartSeries } from \"../../internal/utils/chart-series\";\nimport { isEqualArrays } from \"../../internal/utils/utils\";\nimport { CoreChartProps } from \"../interfaces\";\nimport { getChartLegendItems, getPointId, getSeriesId } from \"../utils\";\nimport { ChartExtraContext } from \"./chart-extra-context\";\n\n// The reactive state is used to propagate changes in legend items to the core legend React component.\nexport interface ReactiveLegendState {\n items: readonly CoreChartProps.LegendItem[];\n}\n\n// Chart helper that implements custom legend behaviors.\nexport class ChartExtraLegend extends AsyncStore<ReactiveLegendState> {\n private context: ChartExtraContext;\n private visibilityMode: \"internal\" | \"external\" = \"external\";\n\n constructor(context: ChartExtraContext) {\n super({ items: [] });\n this.context = context;\n }\n\n public onChartRender = () => {\n this.initLegend();\n this.updateItemsVisibility();\n };\n\n // If visible items are explicitly provided, we use them to update visibility of chart's series or points (by ID).\n // If not provided, the visibility state is managed internally.\n public updateItemsVisibility = () => {\n if (this.context.state.visibleItems) {\n this.visibilityMode = \"external\";\n updateItemsVisibility(this.context.chart(), this.get().items, this.context.state.visibleItems);\n } else {\n this.visibilityMode = \"internal\";\n }\n };\n\n // A callback to be called when items visibility changes from the outside or from the legend.\n public onItemVisibilityChange = (visibleItems: readonly string[], { isApiCall }: { isApiCall: boolean }) => {\n const currentItems = this.get().items;\n const updatedItems = currentItems.map((i) => ({ ...i, visible: visibleItems.includes(i.id) }));\n if (this.visibilityMode === \"internal\") {\n this.updateLegendItems(updatedItems);\n updateItemsVisibility(this.context.chart(), this.get().items, visibleItems);\n }\n fireNonCancelableEvent(this.context.handlers.onVisibleItemsChange, { items: updatedItems, isApiCall });\n };\n\n // Updates legend highlight state when chart's point is highlighted.\n public onHighlightPoint = (point: Highcharts.Point) => {\n const visibleItems = point.series.type === \"pie\" ? [getPointId(point)] : [getSeriesId(point.series)];\n this.onHighlightItems(visibleItems);\n };\n\n // Updates legend highlight state when chart's group of points is highlighted.\n public onHighlightGroup = (group: readonly Highcharts.Point[]) => {\n const visibleItems = group.map((point) => getSeriesId(point.series));\n this.onHighlightItems(visibleItems);\n };\n\n // Updates legend highlight state given an explicit list of item IDs. This is used to update state\n // when a legend item gets hovered or focused.\n public onHighlightItems = (highlightedItems: readonly string[]) => {\n const currentItems = this.get().items;\n const updatedItems = currentItems.map(({ ...i }) => ({ ...i, highlighted: highlightedItems.includes(i.id) }));\n this.updateLegendItems(updatedItems);\n };\n\n // Clears legend highlight state.\n public onClearHighlight = () => {\n const nextItems = this.get().items.map(({ ...item }) => ({ ...item, highlighted: false }));\n this.updateLegendItems(nextItems);\n };\n\n private initLegend = () => {\n const prevState = this.get().items.reduce((map, item) => map.set(item.id, item), new Map<string, LegendItem>());\n const itemSpecs = getChartLegendItems(this.context.chart());\n const legendItems = itemSpecs.map(({ id, name, color, markerType, visible, isSecondary }) => {\n const marker = this.renderMarker(markerType, color, visible);\n return { id, name, marker, visible, isSecondary, highlighted: prevState.get(id)?.highlighted ?? false };\n });\n this.updateLegendItems(legendItems);\n };\n\n private updateLegendItems = (nextItems: CoreChartProps.LegendItem[]) => {\n function isLegendItemsEqual(a: CoreChartProps.LegendItem, b: CoreChartProps.LegendItem) {\n return (\n a.id === b.id &&\n a.name === b.name &&\n a.marker === b.marker &&\n a.visible === b.visible &&\n a.highlighted === b.highlighted\n );\n }\n if (!isEqualArrays(this.get().items, nextItems, isLegendItemsEqual)) {\n this.set(() => ({ items: nextItems }));\n }\n };\n\n // The chart markers derive from type and color and are cached to avoid unnecessary renders,\n // and allow comparing them by reference.\n private markersCache = new Map<string, React.ReactNode>();\n public renderMarker(type: ChartSeriesMarkerType, color: string, visible = true): React.ReactNode {\n const key = `${type}:${color}:${visible}`;\n const marker = this.markersCache.get(key) ?? <ChartSeriesMarker type={type} color={color} visible={visible} />;\n this.markersCache.set(key, marker);\n return marker;\n }\n}\n\nfunction updateItemsVisibility(\n chart: Highcharts.Chart,\n legendItems: readonly CoreChartProps.LegendItem[],\n visibleItems?: readonly string[],\n) {\n const availableItemsSet = new Set(legendItems.map((i) => i.id));\n const visibleItemsSet = new Set(visibleItems);\n\n let updatesCounter = 0;\n const getVisibleAndCount = (id: string, visible: boolean) => {\n const nextVisible = visibleItemsSet.has(id);\n updatesCounter += nextVisible !== visible ? 1 : 0;\n return nextVisible;\n };\n\n for (const series of getChartSeries(chart.series)) {\n if (availableItemsSet.has(getSeriesId(series))) {\n series.setVisible(getVisibleAndCount(getSeriesId(series), series.visible), false);\n }\n for (const point of series.data) {\n if (typeof point.setVisible === \"function\" && availableItemsSet.has(getPointId(point))) {\n point.setVisible(getVisibleAndCount(getPointId(point), point.visible), false);\n }\n }\n }\n\n // The call `seriesOrPoint.setVisible(visible, false)` does not trigger the chart redraw, as it would otherwise\n // impact the performance. Instead, we trigger the redraw explicitly, if any change to visibility has been made.\n if (updatesCounter > 0) {\n chart.redraw();\n }\n}\n"]}
@@ -116,6 +116,8 @@ export class ChartAPI {
116
116
  if (!this.isTooltipPinned) {
117
117
  this.chartExtraHighlight.clearChartItemsHighlight();
118
118
  this.chartExtraLegend.onClearHighlight();
119
+ // Notify the consumer that a clear-highlight action was made.
120
+ fireNonCancelableEvent(this.context.handlers.onClearHighlight, { isApiCall: false });
119
121
  }
120
122
  };
121
123
  // Callbacks used for hover and keyboard navigation, and also exposed to the public API to give the ability
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/chart-api/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEjE,OAAO,EACL,6BAA6B,EAC7B,6BAA6B,EAC7B,6BAA6B,EAC7B,YAAY,GACb,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,oBAAoB,EAA2B,MAAM,2BAA2B,CAAC;AAC1F,OAAO,EAAqB,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAClG,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAuB,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAgC,MAAM,0BAA0B,CAAC;AAC9F,OAAO,EAAE,gBAAgB,EAAuB,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAA6B,MAAM,uBAAuB,CAAC;AACrF,OAAO,EAAE,iBAAiB,EAAwB,MAAM,uBAAuB,CAAC;AAEhF,mGAAmG;AACnG,kGAAkG;AAClG,qEAAqE;AACrE,MAAM,UAAU,WAAW,CACzB,QAAoC,EACpC,QAAoC,EACpC,KAA8B;IAE9B,gGAAgG;IAChG,iGAAiG;IACjG,2DAA2D;IAC3D,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,QAAQ,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC;IACpE,o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,gBAAgB,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;gBAC9C,IAAI,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,KAAK,EAAE,mBAAmB,CAAC,CAAC;aACvE;YAED,wDAAwD;YACxD,sBAAsB,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;SACxF;IACH,CAAC;IAgBD,IAAY,eAAe;QACzB,OAAO,IAAI,CAAC,iBAAiB,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC;IAC7C,CAAC;CACF;AAED,SAAS,sBAAsB,CAAC,OAA0B,EAAE,IAAuB;IACjF,OAAO,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,CAAC,OAAK,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,CAAC,CAAA,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,CAAC,OAAK,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,CAAC,CAAA,CAAC;AAC1D,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useEffect, useRef } from \"react\";\nimport type Highcharts from \"highcharts\";\n\nimport { fireNonCancelableEvent } from \"../../internal/events\";\nimport { ReadonlyAsyncStore } from \"../../internal/utils/async-store\";\nimport { getChartSeries } from \"../../internal/utils/chart-series\";\nimport { getSeriesData } from \"../../internal/utils/series-data\";\nimport { Writeable } from \"../../internal/utils/utils\";\nimport {\n getChartAccessibleDescription,\n getGroupAccessibleDescription,\n getPointAccessibleDescription,\n isXThreshold,\n} from \"../utils\";\nimport { ChartExtraAxisTitles, ReactiveAxisTitlesState } from \"./chart-extra-axis-titles\";\nimport { ChartExtraContext, createChartContext, updateChartContext } from \"./chart-extra-context\";\nimport { ChartExtraHighlight } from \"./chart-extra-highlight\";\nimport { ChartExtraLegend, ReactiveLegendState } from \"./chart-extra-legend\";\nimport { ChartExtraNavigation, ChartExtraNavigationHandlers } from \"./chart-extra-navigation\";\nimport { ChartExtraNodata, ReactiveNodataState } from \"./chart-extra-nodata\";\nimport { ChartExtraPointer, ChartExtraPointerHandlers } from \"./chart-extra-pointer\";\nimport { ChartExtraTooltip, ReactiveTooltipState } from \"./chart-extra-tooltip\";\n\n// The API helper injects Cloudscape custom behaviors, and returns the API instance that comes with\n// reactive state and handlers to be assigned as Highcharts options, used by Cloudscape components\n// (tooltip, legend, and other), or exposed as public core chart API.\nexport function useChartAPI(\n settings: ChartExtraContext.Settings,\n handlers: ChartExtraContext.Handlers,\n state: ChartExtraContext.State,\n) {\n // The API helper instance defines many pieces of internal state with different lifecycles, most\n // of which are not be invalidated when the hook re-renders, or properties change. That is why we\n // create the instance once, when the component is mounted.\n const api = useRef(new ChartAPI(settings, handlers, state)).current;\n // The consumer-defined properties can still change during the component lifecycle. We propagate the\n // changes by updating the helper's context directly. That is fine for most of the properties, as those\n // are only used in event-based callbacks, and require nothing to recompute when there is a change.\n useEffect(() => {\n api.context.settings = settings;\n api.context.handlers = handlers;\n api.context.state = state;\n });\n\n // The only property that does require notifying the helper when it changes, is the visible items state.\n // We stringify the visible items array so that it is compared by value, and the effect is only fired when\n // there is an actual change to the visible items, including items order.\n const visibleItemsIndex = state.visibleItems ? state.visibleItems.join(\"::\") : null;\n useEffect(() => {\n // When visibleItemsIndex === null, it means the visible items state is managed internally inside the helper,\n // so no need to call the API method.\n // The api.updateItemsVisibility() can only be used once the chart is initialized, so we check for api.ready.\n // The initialization happens after the first React render, so the chart is expected to not be ready when the\n // effect is called for the first time. This is fine, as the initial visibility state is handled by the helper.\n // The code below is needed to notify the helper any time the visible items state changes.\n if (api.ready && visibleItemsIndex !== null) {\n api.updateItemsVisibility();\n }\n }, [api, visibleItemsIndex]);\n\n // Run cleanup code when the component unmounts.\n useEffect(() => () => api.onChartDestroy(), [api]);\n\n return api;\n}\n\n// The main chart helper that provides customizations to Highcharts, including tooltip, legend, keyboard navigation, and more.\n// It is split into multiple dedicated (chart-extra) helpers (highlight, tooltip, navigation, and other), most of which define\n// internal state, and have a lifecycle based on Highcharts render event.\n// The helper code has a shared context, which includes the consumer settings, visible items state, and derived state, computed\n// from Highcharts.Chart on each render, and reused for downstream computations for better efficiency.\nexport class ChartAPI {\n public context = createChartContext();\n private chartExtraHighlight = new ChartExtraHighlight(this.context);\n private chartExtraTooltip = new ChartExtraTooltip(this.context);\n private chartExtraNavigation = new ChartExtraNavigation(this.context, this.navigationHandlers);\n private chartExtraPointer = new ChartExtraPointer(this.context, this.pointerHandlers);\n private chartExtraLegend = new ChartExtraLegend(this.context);\n private chartExtraNodata = new ChartExtraNodata(this.context);\n private chartExtraAxisTitles = new ChartExtraAxisTitles(this.context);\n\n constructor(\n settings: ChartExtraContext.Settings,\n handlers: ChartExtraContext.Handlers,\n state: ChartExtraContext.State,\n ) {\n this.context.settings = settings;\n this.context.handlers = handlers;\n this.context.state = state;\n }\n\n // The ready() returns true if the chart is initialized and helper methods are safe to use (after Highcharts triggers onChartRender).\n // Using any of the helper methods before the chart is initialized will result in an exception.\n public get ready() {\n return !!this.context.chartOrNull;\n }\n\n // The Highcharts options to be merged with the rest of the configuration defined in the chart-core.\n public getOptions() {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const chartAPI = this;\n const onChartLoad: Highcharts.ChartLoadCallbackFunction = function (this) {\n chartAPI.chartExtraPointer.onChartLoad(this);\n };\n const onChartRender: Highcharts.ChartRenderCallbackFunction = function (this) {\n updateChartContext(chartAPI.context, this);\n chartAPI.chartExtraHighlight.onChartRender();\n chartAPI.chartExtraLegend.onChartRender();\n chartAPI.chartExtraNodata.onChartRender();\n chartAPI.chartExtraAxisTitles.onChartRender();\n chartAPI.chartExtraTooltip.onChartRender();\n chartAPI.handleDestroyedPoints();\n chartAPI.resetColorCounter();\n chartAPI.showMarkersForIsolatedPoints();\n };\n const onChartClick: Highcharts.ChartClickCallbackFunction = function () {\n chartAPI.chartExtraPointer.onChartClick(this.hoverPoint);\n };\n const onSeriesPointMouseOver: Highcharts.PointMouseOverCallbackFunction = function () {\n chartAPI.chartExtraPointer.onSeriesPointMouseOver(this);\n };\n const onSeriesPointMouseOut: Highcharts.PointMouseOutCallbackFunction = function () {\n chartAPI.chartExtraPointer.onSeriesPointMouseOut();\n };\n const onSeriesPointClick: Highcharts.PointClickCallbackFunction = function () {\n chartAPI.chartExtraPointer.onSeriesPointClick(this);\n };\n return {\n onChartLoad,\n onChartRender,\n onChartClick,\n onSeriesPointMouseOver,\n onSeriesPointMouseOut,\n onSeriesPointClick,\n };\n }\n\n // There is no cleanup or destroy event in Highcharts options, so we define a custom one\n // to be used when the React component unmounts.\n public onChartDestroy = () => {\n this.chartExtraNavigation.onChartDestroy();\n this.chartExtraPointer.onChartDestroy();\n this.chartExtraTooltip.onChartDestroy();\n };\n\n // Reactive state stores.\n public get tooltipStore() {\n return this.chartExtraTooltip as ReadonlyAsyncStore<ReactiveTooltipState>;\n }\n public get legendStore() {\n return this.chartExtraLegend as ReadonlyAsyncStore<ReactiveLegendState>;\n }\n public get nodataStore() {\n return this.chartExtraNodata as ReadonlyAsyncStore<ReactiveNodataState>;\n }\n public get axisTitlesStore() {\n return this.chartExtraAxisTitles as ReadonlyAsyncStore<ReactiveAxisTitlesState>;\n }\n\n // References to SVG elements used for tooltip placement.\n public getTargetTrack = this.chartExtraTooltip.getTargetTrack.bind(this.chartExtraTooltip);\n public getGroupTrack = this.chartExtraTooltip.getGroupTrack.bind(this.chartExtraTooltip);\n\n // Legend marker renderer.\n public renderMarker = this.chartExtraLegend.renderMarker.bind(this.chartExtraLegend);\n\n // Callbacks assigned to the tooltip.\n public onMouseEnterTooltip = this.chartExtraPointer.onMouseEnterTooltip.bind(this.chartExtraPointer);\n public onMouseLeaveTooltip = this.chartExtraPointer.onMouseLeaveTooltip.bind(this.chartExtraPointer);\n public onDismissTooltip = (outsideClick?: boolean) => {\n const { pinned, point, group } = this.chartExtraTooltip.get();\n if (pinned) {\n this.chartExtraTooltip.hideTooltip();\n // The chart highlight is preserved while the tooltip is pinned. We need to clear it manually here, for the case\n // when the pointer lands outside the chart after the tooltip is dismissed, so that the mouse-out event won't fire.\n this.clearChartHighlight({ isApiCall: false });\n // If the tooltip was not dismissed by clicking outside, we bring focus to the point or group, that was\n // associated with the tooltip, so that we user can continue keyboard navigation from that spot.\n if (!outsideClick) {\n this.chartExtraNavigation.focusApplication(point, group);\n }\n }\n };\n\n // Hide the tooltip from an action initiated by the tooltip's content\n public hideTooltip = () => {\n this.chartExtraTooltip.hideTooltip();\n // The chart highlight is preserved while the tooltip is pinned. We need to clear it manually here, for the case\n // when the pointer lands outside the chart after the tooltip is dismissed, so that the mouse-out event won't fire.\n this.clearChartHighlight({ isApiCall: false });\n };\n\n // Reference to the role=\"application\" element used for navigation.\n public setApplication = this.chartExtraNavigation.setApplication.bind(this.chartExtraNavigation);\n\n // A callback to notify the helper when items visibility state changes.\n public updateItemsVisibility = this.chartExtraLegend.updateItemsVisibility.bind(this.chartExtraLegend);\n\n // A callback used by the legend and filter components when series/segments visibility changes.\n public onItemVisibilityChange = (items: readonly string[]) =>\n this.chartExtraLegend.onItemVisibilityChange(items, { isApiCall: false });\n\n // Callbacks used by the legend component when items highlight state changes.\n public onHighlightChartItems = (itemIds: readonly string[]) => {\n if (!this.isTooltipPinned) {\n this.chartExtraHighlight.highlightChartItems(itemIds);\n this.chartExtraLegend.onHighlightItems(itemIds);\n }\n };\n public onClearChartItemsHighlight = () => {\n if (!this.isTooltipPinned) {\n this.chartExtraHighlight.clearChartItemsHighlight();\n this.chartExtraLegend.onClearHighlight();\n }\n };\n\n // Callbacks used for hover and keyboard navigation, and also exposed to the public API to give the ability\n // to highlight and show tooltip for the given point or group manually.\n public highlightChartItems = (itemIds: readonly string[]) => {\n if (!this.isTooltipPinned) {\n this.chartExtraHighlight.highlightChartItems(itemIds);\n this.chartExtraLegend.onHighlightItems(itemIds);\n }\n };\n public setItemsVisible = (visibleItemsIds: readonly string[], { isApiCall }: { isApiCall: boolean }) => {\n this.chartExtraLegend.onItemVisibilityChange(visibleItemsIds, { isApiCall });\n };\n public highlightChartPoint = (point: Highcharts.Point, { isApiCall }: { isApiCall: boolean }) => {\n if (!this.isTooltipPinned) {\n this.highlightActions(point, { isApiCall });\n }\n };\n public highlightChartGroup = (group: readonly Highcharts.Point[], { isApiCall }: { isApiCall: boolean }) => {\n if (!this.isTooltipPinned) {\n this.highlightActions(group as Writeable<Highcharts.Point[]>, { isApiCall });\n }\n };\n public clearChartHighlight = ({ isApiCall }: { isApiCall: boolean }) => {\n if (!this.isTooltipPinned) {\n this.clearHighlightActions({ isApiCall });\n }\n };\n public get publicApi() {\n return {\n highlightItems: (itemIds: readonly string[]) => this.highlightChartItems(itemIds),\n setItemsVisible: (visibleItemIds: readonly string[]) => this.setItemsVisible(visibleItemIds, { isApiCall: true }),\n highlightChartPoint: (point: Highcharts.Point) => this.highlightChartPoint(point, { isApiCall: true }),\n highlightChartGroup: (group: readonly Highcharts.Point[]) => this.highlightChartGroup(group, { isApiCall: true }),\n clearChartHighlight: () => this.clearChartHighlight({ isApiCall: true }),\n };\n }\n\n // A set of callbacks required for keyboard navigation.\n private get navigationHandlers(): ChartExtraNavigationHandlers {\n return {\n onFocusChart: () => {\n this.clearChartHighlight({ isApiCall: false });\n this.chartExtraNavigation.announceChart(getChartAccessibleDescription(this.context.chart()));\n },\n onFocusGroup: (group: Highcharts.Point[]) => {\n this.highlightActions(group, { isApiCall: false, overrideTooltipLock: true });\n this.chartExtraNavigation.announceElement(getGroupAccessibleDescription(group), false);\n },\n onFocusPoint: (point: Highcharts.Point) => {\n const labels = this.context.settings.labels;\n this.highlightActions(point, { isApiCall: false, overrideTooltipLock: true });\n this.chartExtraNavigation.announceElement(getPointAccessibleDescription(point, labels), false);\n },\n onBlur: () => this.clearChartHighlight({ isApiCall: false }),\n onActivateGroup: () => {\n const current = this.chartExtraTooltip.get();\n if (current.group.length > 0) {\n this.chartExtraTooltip.pinTooltip();\n this.chartExtraNavigation.announceElement(getGroupAccessibleDescription(current.group), true);\n }\n },\n onActivatePoint: () => {\n const current = this.chartExtraTooltip.get();\n if (current.point) {\n const labels = this.context.settings.labels;\n this.chartExtraTooltip.pinTooltip();\n this.chartExtraNavigation.announceElement(getPointAccessibleDescription(current.point, labels), true);\n }\n },\n };\n }\n\n // A set of callbacks required for pointer navigation.\n private get pointerHandlers(): ChartExtraPointerHandlers {\n return {\n onPointHover: (point) => {\n this.highlightChartPoint(point, { isApiCall: false });\n },\n onGroupHover: (group) => {\n this.highlightChartGroup(group, { isApiCall: false });\n },\n onHoverLost: () => {\n this.clearChartHighlight({ isApiCall: false });\n },\n onPointClick: (point) => {\n this.pinTooltipOnPoint(point);\n },\n onGroupClick: (group) => {\n this.pinTooltipOnGroup(group);\n },\n };\n }\n\n // Area- or line series can be defined with just a single point, or include missing data (y=null) in such\n // a way, that certain points become isolated. As we prefer the markers to not be shown for area- and line\n // series by default, those points become invisible, unless hovered. To fix this, we use the function below,\n // that finds isolates points and overrides the marker.enabled configuration for those.\n // See: https://github.com/highcharts/highcharts/issues/1210.\n private showMarkersForIsolatedPoints() {\n let shouldRedraw = false;\n for (const s of this.context.chart().series) {\n const seriesData = getSeriesData(s.data);\n for (let i = 0; i < seriesData.length; i++) {\n const isEligibleSeries = !isXThreshold(s) && s.type !== \"scatter\" && !seriesData[i].options.marker?.enabled;\n if (\n isEligibleSeries &&\n (seriesData[i - 1]?.y === undefined || seriesData[i - 1]?.y === null) &&\n (seriesData[i + 1]?.y === undefined || seriesData[i + 1]?.y === null)\n ) {\n seriesData[i].update({ marker: { enabled: true } }, false);\n shouldRedraw = true;\n }\n }\n }\n if (shouldRedraw) {\n this.context.chart().redraw();\n }\n }\n\n // Highcharts sometimes destroys points upon re-rendering. As result, the already stored points can get\n // replaced by `{ destroyed: true }`. This can affect the tooltip state, making the component crash when\n // obtaining data from points, or making it hidden yet pinned, so not visible on hover until a click is made.\n // To prevent these issues, on each render we check for destroyed points in the tooltip state, and proactively\n // hide the tooltip if found. The behavior is only observed during the initial chart loading, and is not expected\n // to cause UX issues with the tooltip being closed unexpectedly.\n // See: https://github.com/highcharts/highcharts/issues/23175.\n private handleDestroyedPoints() {\n const tooltipState = this.chartExtraTooltip.get();\n if (tooltipState.group.some((p) => !p.series)) {\n this.chartExtraTooltip.hideTooltip();\n }\n }\n\n // We reset color counter so that when a series is removed and then added back - it will\n // have the same color as before, not the next one in the color sequence.\n // See: https://github.com/highcharts/highcharts/issues/23077.\n private resetColorCounter() {\n const chart = this.context.chart();\n if (\"colorCounter\" in chart && typeof chart.colorCounter === \"number\") {\n chart.colorCounter = getChartSeries(chart.series).length;\n }\n }\n\n private pinTooltipOnPoint = (point: Highcharts.Point) => {\n const currentPoint = this.chartExtraTooltip.get().point;\n const currentGroup = this.chartExtraTooltip.get().group;\n const positionsMatch = isPointsPositionsEqual(currentPoint ?? currentGroup[0], point);\n\n // If the previously hovered and now clicked positions match, and the the tooltip wasn't\n // dismissed just a moment ago, we make the tooltip pinned in this position.\n if (positionsMatch && !this.chartExtraTooltip.tooltipLock) {\n this.highlightActions(point, { isApiCall: false });\n this.chartExtraTooltip.pinTooltip();\n }\n // If the tooltip was just dismissed, it means this happened by clicking somewhere in the plot area.\n // If the clicked position differs from the one that was pinned - we show tooltip in the new position.\n else if (!positionsMatch && this.chartExtraTooltip.tooltipLock) {\n this.highlightActions(point, { isApiCall: false, overrideTooltipLock: true });\n }\n };\n\n private pinTooltipOnGroup = (group: Highcharts.Point[]) => {\n const currentPoint = this.chartExtraTooltip.get().point;\n const currentGroup = this.chartExtraTooltip.get().group;\n const positionsMatch = isPointsPositionsEqual(currentPoint ?? currentGroup[0], group[0]);\n\n // If the previously hovered and now clicked positions match, and the the tooltip wasn't\n // dismissed just a moment ago, we make the tooltip pinned in this position.\n if (positionsMatch && !this.chartExtraTooltip.tooltipLock) {\n this.highlightActions(group, { isApiCall: false });\n this.chartExtraTooltip.pinTooltip();\n }\n // If the tooltip was just dismissed, it means this happened by clicking somewhere in the plot area.\n // If the clicked position differs from the one that was pinned - we show tooltip in the new position.\n else if (!positionsMatch && this.chartExtraTooltip.tooltipLock) {\n this.highlightActions(group, { isApiCall: false, overrideTooltipLock: true });\n }\n };\n\n private highlightActions(\n target: Highcharts.Point | Highcharts.Point[],\n { isApiCall, overrideTooltipLock }: { isApiCall: boolean; overrideTooltipLock?: boolean },\n ) {\n const point = Array.isArray(target) ? null : target;\n const group = Array.isArray(target) ? target : this.context.derived.getPointsByX(target.x);\n\n if (!this.isTooltipPinned) {\n // Update Highcharts elements state.\n if (point) {\n this.chartExtraHighlight.highlightChartPoint(point);\n } else {\n this.chartExtraHighlight.highlightChartGroup(group);\n }\n\n // Update tooltip and legend state.\n if (point) {\n this.chartExtraLegend.onHighlightPoint(point);\n this.chartExtraTooltip.showTooltipOnPoint(point, group, overrideTooltipLock);\n } else {\n this.chartExtraLegend.onHighlightGroup(group);\n this.chartExtraTooltip.showTooltipOnGroup(group, overrideTooltipLock);\n }\n\n // Notify the consumer that a highlight action was made.\n fireNonCancelableEvent(this.context.handlers.onHighlight, { point, group, isApiCall });\n }\n }\n\n private clearHighlightActions = ({ isApiCall }: { isApiCall: boolean }) => {\n if (!this.isTooltipPinned) {\n // Update Highcharts elements state.\n this.chartExtraHighlight.clearChartItemsHighlight();\n\n // Update tooltip and legend state.\n this.chartExtraTooltip.hideTooltip();\n this.chartExtraLegend.onClearHighlight();\n\n // Notify the consumer that a clear-highlight action was made.\n fireNonCancelableEvent(this.context.handlers.onClearHighlight, { isApiCall });\n }\n };\n\n private get isTooltipPinned() {\n return this.chartExtraTooltip.get().pinned;\n }\n}\n\nfunction isPointsPositionsEqual(current?: Highcharts.Point, next?: Highcharts.Point) {\n return current?.x === next?.x && current?.y === next?.y;\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/chart-api/index.tsx"],"names":[],"mappings":"AAAA,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K,CAAC,CAAC;gBAC9C,IAAI,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,KAAK,EAAE,mBAAmB,CAAC,CAAC;aACvE;YAED,wDAAwD;YACxD,sBAAsB,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;SACxF;IACH,CAAC;IAgBD,IAAY,eAAe;QACzB,OAAO,IAAI,CAAC,iBAAiB,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC;IAC7C,CAAC;CACF;AAED,SAAS,sBAAsB,CAAC,OAA0B,EAAE,IAAuB;IACjF,OAAO,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,CAAC,OAAK,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,CAAC,CAAA,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,CAAC,OAAK,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,CAAC,CAAA,CAAC;AAC1D,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useEffect, useRef } from \"react\";\nimport type Highcharts from \"highcharts\";\n\nimport { fireNonCancelableEvent } from \"../../internal/events\";\nimport { ReadonlyAsyncStore } from \"../../internal/utils/async-store\";\nimport { getChartSeries } from \"../../internal/utils/chart-series\";\nimport { getSeriesData } from \"../../internal/utils/series-data\";\nimport { Writeable } from \"../../internal/utils/utils\";\nimport {\n getChartAccessibleDescription,\n getGroupAccessibleDescription,\n getPointAccessibleDescription,\n isXThreshold,\n} from \"../utils\";\nimport { ChartExtraAxisTitles, ReactiveAxisTitlesState } from \"./chart-extra-axis-titles\";\nimport { ChartExtraContext, createChartContext, updateChartContext } from \"./chart-extra-context\";\nimport { ChartExtraHighlight } from \"./chart-extra-highlight\";\nimport { ChartExtraLegend, ReactiveLegendState } from \"./chart-extra-legend\";\nimport { ChartExtraNavigation, ChartExtraNavigationHandlers } from \"./chart-extra-navigation\";\nimport { ChartExtraNodata, ReactiveNodataState } from \"./chart-extra-nodata\";\nimport { ChartExtraPointer, ChartExtraPointerHandlers } from \"./chart-extra-pointer\";\nimport { ChartExtraTooltip, ReactiveTooltipState } from \"./chart-extra-tooltip\";\n\n// The API helper injects Cloudscape custom behaviors, and returns the API instance that comes with\n// reactive state and handlers to be assigned as Highcharts options, used by Cloudscape components\n// (tooltip, legend, and other), or exposed as public core chart API.\nexport function useChartAPI(\n settings: ChartExtraContext.Settings,\n handlers: ChartExtraContext.Handlers,\n state: ChartExtraContext.State,\n) {\n // The API helper instance defines many pieces of internal state with different lifecycles, most\n // of which are not be invalidated when the hook re-renders, or properties change. That is why we\n // create the instance once, when the component is mounted.\n const api = useRef(new ChartAPI(settings, handlers, state)).current;\n // The consumer-defined properties can still change during the component lifecycle. We propagate the\n // changes by updating the helper's context directly. That is fine for most of the properties, as those\n // are only used in event-based callbacks, and require nothing to recompute when there is a change.\n useEffect(() => {\n api.context.settings = settings;\n api.context.handlers = handlers;\n api.context.state = state;\n });\n\n // The only property that does require notifying the helper when it changes, is the visible items state.\n // We stringify the visible items array so that it is compared by value, and the effect is only fired when\n // there is an actual change to the visible items, including items order.\n const visibleItemsIndex = state.visibleItems ? state.visibleItems.join(\"::\") : null;\n useEffect(() => {\n // When visibleItemsIndex === null, it means the visible items state is managed internally inside the helper,\n // so no need to call the API method.\n // The api.updateItemsVisibility() can only be used once the chart is initialized, so we check for api.ready.\n // The initialization happens after the first React render, so the chart is expected to not be ready when the\n // effect is called for the first time. This is fine, as the initial visibility state is handled by the helper.\n // The code below is needed to notify the helper any time the visible items state changes.\n if (api.ready && visibleItemsIndex !== null) {\n api.updateItemsVisibility();\n }\n }, [api, visibleItemsIndex]);\n\n // Run cleanup code when the component unmounts.\n useEffect(() => () => api.onChartDestroy(), [api]);\n\n return api;\n}\n\n// The main chart helper that provides customizations to Highcharts, including tooltip, legend, keyboard navigation, and more.\n// It is split into multiple dedicated (chart-extra) helpers (highlight, tooltip, navigation, and other), most of which define\n// internal state, and have a lifecycle based on Highcharts render event.\n// The helper code has a shared context, which includes the consumer settings, visible items state, and derived state, computed\n// from Highcharts.Chart on each render, and reused for downstream computations for better efficiency.\nexport class ChartAPI {\n public context = createChartContext();\n private chartExtraHighlight = new ChartExtraHighlight(this.context);\n private chartExtraTooltip = new ChartExtraTooltip(this.context);\n private chartExtraNavigation = new ChartExtraNavigation(this.context, this.navigationHandlers);\n private chartExtraPointer = new ChartExtraPointer(this.context, this.pointerHandlers);\n private chartExtraLegend = new ChartExtraLegend(this.context);\n private chartExtraNodata = new ChartExtraNodata(this.context);\n private chartExtraAxisTitles = new ChartExtraAxisTitles(this.context);\n\n constructor(\n settings: ChartExtraContext.Settings,\n handlers: ChartExtraContext.Handlers,\n state: ChartExtraContext.State,\n ) {\n this.context.settings = settings;\n this.context.handlers = handlers;\n this.context.state = state;\n }\n\n // The ready() returns true if the chart is initialized and helper methods are safe to use (after Highcharts triggers onChartRender).\n // Using any of the helper methods before the chart is initialized will result in an exception.\n public get ready() {\n return !!this.context.chartOrNull;\n }\n\n // The Highcharts options to be merged with the rest of the configuration defined in the chart-core.\n public getOptions() {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const chartAPI = this;\n const onChartLoad: Highcharts.ChartLoadCallbackFunction = function (this) {\n chartAPI.chartExtraPointer.onChartLoad(this);\n };\n const onChartRender: Highcharts.ChartRenderCallbackFunction = function (this) {\n updateChartContext(chartAPI.context, this);\n chartAPI.chartExtraHighlight.onChartRender();\n chartAPI.chartExtraLegend.onChartRender();\n chartAPI.chartExtraNodata.onChartRender();\n chartAPI.chartExtraAxisTitles.onChartRender();\n chartAPI.chartExtraTooltip.onChartRender();\n chartAPI.handleDestroyedPoints();\n chartAPI.resetColorCounter();\n chartAPI.showMarkersForIsolatedPoints();\n };\n const onChartClick: Highcharts.ChartClickCallbackFunction = function () {\n chartAPI.chartExtraPointer.onChartClick(this.hoverPoint);\n };\n const onSeriesPointMouseOver: Highcharts.PointMouseOverCallbackFunction = function () {\n chartAPI.chartExtraPointer.onSeriesPointMouseOver(this);\n };\n const onSeriesPointMouseOut: Highcharts.PointMouseOutCallbackFunction = function () {\n chartAPI.chartExtraPointer.onSeriesPointMouseOut();\n };\n const onSeriesPointClick: Highcharts.PointClickCallbackFunction = function () {\n chartAPI.chartExtraPointer.onSeriesPointClick(this);\n };\n return {\n onChartLoad,\n onChartRender,\n onChartClick,\n onSeriesPointMouseOver,\n onSeriesPointMouseOut,\n onSeriesPointClick,\n };\n }\n\n // There is no cleanup or destroy event in Highcharts options, so we define a custom one\n // to be used when the React component unmounts.\n public onChartDestroy = () => {\n this.chartExtraNavigation.onChartDestroy();\n this.chartExtraPointer.onChartDestroy();\n this.chartExtraTooltip.onChartDestroy();\n };\n\n // Reactive state stores.\n public get tooltipStore() {\n return this.chartExtraTooltip as ReadonlyAsyncStore<ReactiveTooltipState>;\n }\n public get legendStore() {\n return this.chartExtraLegend as ReadonlyAsyncStore<ReactiveLegendState>;\n }\n public get nodataStore() {\n return this.chartExtraNodata as ReadonlyAsyncStore<ReactiveNodataState>;\n }\n public get axisTitlesStore() {\n return this.chartExtraAxisTitles as ReadonlyAsyncStore<ReactiveAxisTitlesState>;\n }\n\n // References to SVG elements used for tooltip placement.\n public getTargetTrack = this.chartExtraTooltip.getTargetTrack.bind(this.chartExtraTooltip);\n public getGroupTrack = this.chartExtraTooltip.getGroupTrack.bind(this.chartExtraTooltip);\n\n // Legend marker renderer.\n public renderMarker = this.chartExtraLegend.renderMarker.bind(this.chartExtraLegend);\n\n // Callbacks assigned to the tooltip.\n public onMouseEnterTooltip = this.chartExtraPointer.onMouseEnterTooltip.bind(this.chartExtraPointer);\n public onMouseLeaveTooltip = this.chartExtraPointer.onMouseLeaveTooltip.bind(this.chartExtraPointer);\n public onDismissTooltip = (outsideClick?: boolean) => {\n const { pinned, point, group } = this.chartExtraTooltip.get();\n if (pinned) {\n this.chartExtraTooltip.hideTooltip();\n // The chart highlight is preserved while the tooltip is pinned. We need to clear it manually here, for the case\n // when the pointer lands outside the chart after the tooltip is dismissed, so that the mouse-out event won't fire.\n this.clearChartHighlight({ isApiCall: false });\n // If the tooltip was not dismissed by clicking outside, we bring focus to the point or group, that was\n // associated with the tooltip, so that we user can continue keyboard navigation from that spot.\n if (!outsideClick) {\n this.chartExtraNavigation.focusApplication(point, group);\n }\n }\n };\n\n // Hide the tooltip from an action initiated by the tooltip's content\n public hideTooltip = () => {\n this.chartExtraTooltip.hideTooltip();\n // The chart highlight is preserved while the tooltip is pinned. We need to clear it manually here, for the case\n // when the pointer lands outside the chart after the tooltip is dismissed, so that the mouse-out event won't fire.\n this.clearChartHighlight({ isApiCall: false });\n };\n\n // Reference to the role=\"application\" element used for navigation.\n public setApplication = this.chartExtraNavigation.setApplication.bind(this.chartExtraNavigation);\n\n // A callback to notify the helper when items visibility state changes.\n public updateItemsVisibility = this.chartExtraLegend.updateItemsVisibility.bind(this.chartExtraLegend);\n\n // A callback used by the legend and filter components when series/segments visibility changes.\n public onItemVisibilityChange = (items: readonly string[]) =>\n this.chartExtraLegend.onItemVisibilityChange(items, { isApiCall: false });\n\n // Callbacks used by the legend component when items highlight state changes.\n public onHighlightChartItems = (itemIds: readonly string[]) => {\n if (!this.isTooltipPinned) {\n this.chartExtraHighlight.highlightChartItems(itemIds);\n this.chartExtraLegend.onHighlightItems(itemIds);\n }\n };\n public onClearChartItemsHighlight = () => {\n if (!this.isTooltipPinned) {\n this.chartExtraHighlight.clearChartItemsHighlight();\n this.chartExtraLegend.onClearHighlight();\n\n // Notify the consumer that a clear-highlight action was made.\n fireNonCancelableEvent(this.context.handlers.onClearHighlight, { isApiCall: false });\n }\n };\n\n // Callbacks used for hover and keyboard navigation, and also exposed to the public API to give the ability\n // to highlight and show tooltip for the given point or group manually.\n public highlightChartItems = (itemIds: readonly string[]) => {\n if (!this.isTooltipPinned) {\n this.chartExtraHighlight.highlightChartItems(itemIds);\n this.chartExtraLegend.onHighlightItems(itemIds);\n }\n };\n public setItemsVisible = (visibleItemsIds: readonly string[], { isApiCall }: { isApiCall: boolean }) => {\n this.chartExtraLegend.onItemVisibilityChange(visibleItemsIds, { isApiCall });\n };\n public highlightChartPoint = (point: Highcharts.Point, { isApiCall }: { isApiCall: boolean }) => {\n if (!this.isTooltipPinned) {\n this.highlightActions(point, { isApiCall });\n }\n };\n public highlightChartGroup = (group: readonly Highcharts.Point[], { isApiCall }: { isApiCall: boolean }) => {\n if (!this.isTooltipPinned) {\n this.highlightActions(group as Writeable<Highcharts.Point[]>, { isApiCall });\n }\n };\n public clearChartHighlight = ({ isApiCall }: { isApiCall: boolean }) => {\n if (!this.isTooltipPinned) {\n this.clearHighlightActions({ isApiCall });\n }\n };\n public get publicApi() {\n return {\n highlightItems: (itemIds: readonly string[]) => this.highlightChartItems(itemIds),\n setItemsVisible: (visibleItemIds: readonly string[]) => this.setItemsVisible(visibleItemIds, { isApiCall: true }),\n highlightChartPoint: (point: Highcharts.Point) => this.highlightChartPoint(point, { isApiCall: true }),\n highlightChartGroup: (group: readonly Highcharts.Point[]) => this.highlightChartGroup(group, { isApiCall: true }),\n clearChartHighlight: () => this.clearChartHighlight({ isApiCall: true }),\n };\n }\n\n // A set of callbacks required for keyboard navigation.\n private get navigationHandlers(): ChartExtraNavigationHandlers {\n return {\n onFocusChart: () => {\n this.clearChartHighlight({ isApiCall: false });\n this.chartExtraNavigation.announceChart(getChartAccessibleDescription(this.context.chart()));\n },\n onFocusGroup: (group: Highcharts.Point[]) => {\n this.highlightActions(group, { isApiCall: false, overrideTooltipLock: true });\n this.chartExtraNavigation.announceElement(getGroupAccessibleDescription(group), false);\n },\n onFocusPoint: (point: Highcharts.Point) => {\n const labels = this.context.settings.labels;\n this.highlightActions(point, { isApiCall: false, overrideTooltipLock: true });\n this.chartExtraNavigation.announceElement(getPointAccessibleDescription(point, labels), false);\n },\n onBlur: () => this.clearChartHighlight({ isApiCall: false }),\n onActivateGroup: () => {\n const current = this.chartExtraTooltip.get();\n if (current.group.length > 0) {\n this.chartExtraTooltip.pinTooltip();\n this.chartExtraNavigation.announceElement(getGroupAccessibleDescription(current.group), true);\n }\n },\n onActivatePoint: () => {\n const current = this.chartExtraTooltip.get();\n if (current.point) {\n const labels = this.context.settings.labels;\n this.chartExtraTooltip.pinTooltip();\n this.chartExtraNavigation.announceElement(getPointAccessibleDescription(current.point, labels), true);\n }\n },\n };\n }\n\n // A set of callbacks required for pointer navigation.\n private get pointerHandlers(): ChartExtraPointerHandlers {\n return {\n onPointHover: (point) => {\n this.highlightChartPoint(point, { isApiCall: false });\n },\n onGroupHover: (group) => {\n this.highlightChartGroup(group, { isApiCall: false });\n },\n onHoverLost: () => {\n this.clearChartHighlight({ isApiCall: false });\n },\n onPointClick: (point) => {\n this.pinTooltipOnPoint(point);\n },\n onGroupClick: (group) => {\n this.pinTooltipOnGroup(group);\n },\n };\n }\n\n // Area- or line series can be defined with just a single point, or include missing data (y=null) in such\n // a way, that certain points become isolated. As we prefer the markers to not be shown for area- and line\n // series by default, those points become invisible, unless hovered. To fix this, we use the function below,\n // that finds isolates points and overrides the marker.enabled configuration for those.\n // See: https://github.com/highcharts/highcharts/issues/1210.\n private showMarkersForIsolatedPoints() {\n let shouldRedraw = false;\n for (const s of this.context.chart().series) {\n const seriesData = getSeriesData(s.data);\n for (let i = 0; i < seriesData.length; i++) {\n const isEligibleSeries = !isXThreshold(s) && s.type !== \"scatter\" && !seriesData[i].options.marker?.enabled;\n if (\n isEligibleSeries &&\n (seriesData[i - 1]?.y === undefined || seriesData[i - 1]?.y === null) &&\n (seriesData[i + 1]?.y === undefined || seriesData[i + 1]?.y === null)\n ) {\n seriesData[i].update({ marker: { enabled: true } }, false);\n shouldRedraw = true;\n }\n }\n }\n if (shouldRedraw) {\n this.context.chart().redraw();\n }\n }\n\n // Highcharts sometimes destroys points upon re-rendering. As result, the already stored points can get\n // replaced by `{ destroyed: true }`. This can affect the tooltip state, making the component crash when\n // obtaining data from points, or making it hidden yet pinned, so not visible on hover until a click is made.\n // To prevent these issues, on each render we check for destroyed points in the tooltip state, and proactively\n // hide the tooltip if found. The behavior is only observed during the initial chart loading, and is not expected\n // to cause UX issues with the tooltip being closed unexpectedly.\n // See: https://github.com/highcharts/highcharts/issues/23175.\n private handleDestroyedPoints() {\n const tooltipState = this.chartExtraTooltip.get();\n if (tooltipState.group.some((p) => !p.series)) {\n this.chartExtraTooltip.hideTooltip();\n }\n }\n\n // We reset color counter so that when a series is removed and then added back - it will\n // have the same color as before, not the next one in the color sequence.\n // See: https://github.com/highcharts/highcharts/issues/23077.\n private resetColorCounter() {\n const chart = this.context.chart();\n if (\"colorCounter\" in chart && typeof chart.colorCounter === \"number\") {\n chart.colorCounter = getChartSeries(chart.series).length;\n }\n }\n\n private pinTooltipOnPoint = (point: Highcharts.Point) => {\n const currentPoint = this.chartExtraTooltip.get().point;\n const currentGroup = this.chartExtraTooltip.get().group;\n const positionsMatch = isPointsPositionsEqual(currentPoint ?? currentGroup[0], point);\n\n // If the previously hovered and now clicked positions match, and the the tooltip wasn't\n // dismissed just a moment ago, we make the tooltip pinned in this position.\n if (positionsMatch && !this.chartExtraTooltip.tooltipLock) {\n this.highlightActions(point, { isApiCall: false });\n this.chartExtraTooltip.pinTooltip();\n }\n // If the tooltip was just dismissed, it means this happened by clicking somewhere in the plot area.\n // If the clicked position differs from the one that was pinned - we show tooltip in the new position.\n else if (!positionsMatch && this.chartExtraTooltip.tooltipLock) {\n this.highlightActions(point, { isApiCall: false, overrideTooltipLock: true });\n }\n };\n\n private pinTooltipOnGroup = (group: Highcharts.Point[]) => {\n const currentPoint = this.chartExtraTooltip.get().point;\n const currentGroup = this.chartExtraTooltip.get().group;\n const positionsMatch = isPointsPositionsEqual(currentPoint ?? currentGroup[0], group[0]);\n\n // If the previously hovered and now clicked positions match, and the the tooltip wasn't\n // dismissed just a moment ago, we make the tooltip pinned in this position.\n if (positionsMatch && !this.chartExtraTooltip.tooltipLock) {\n this.highlightActions(group, { isApiCall: false });\n this.chartExtraTooltip.pinTooltip();\n }\n // If the tooltip was just dismissed, it means this happened by clicking somewhere in the plot area.\n // If the clicked position differs from the one that was pinned - we show tooltip in the new position.\n else if (!positionsMatch && this.chartExtraTooltip.tooltipLock) {\n this.highlightActions(group, { isApiCall: false, overrideTooltipLock: true });\n }\n };\n\n private highlightActions(\n target: Highcharts.Point | Highcharts.Point[],\n { isApiCall, overrideTooltipLock }: { isApiCall: boolean; overrideTooltipLock?: boolean },\n ) {\n const point = Array.isArray(target) ? null : target;\n const group = Array.isArray(target) ? target : this.context.derived.getPointsByX(target.x);\n\n if (!this.isTooltipPinned) {\n // Update Highcharts elements state.\n if (point) {\n this.chartExtraHighlight.highlightChartPoint(point);\n } else {\n this.chartExtraHighlight.highlightChartGroup(group);\n }\n\n // Update tooltip and legend state.\n if (point) {\n this.chartExtraLegend.onHighlightPoint(point);\n this.chartExtraTooltip.showTooltipOnPoint(point, group, overrideTooltipLock);\n } else {\n this.chartExtraLegend.onHighlightGroup(group);\n this.chartExtraTooltip.showTooltipOnGroup(group, overrideTooltipLock);\n }\n\n // Notify the consumer that a highlight action was made.\n fireNonCancelableEvent(this.context.handlers.onHighlight, { point, group, isApiCall });\n }\n }\n\n private clearHighlightActions = ({ isApiCall }: { isApiCall: boolean }) => {\n if (!this.isTooltipPinned) {\n // Update Highcharts elements state.\n this.chartExtraHighlight.clearChartItemsHighlight();\n\n // Update tooltip and legend state.\n this.chartExtraTooltip.hideTooltip();\n this.chartExtraLegend.onClearHighlight();\n\n // Notify the consumer that a clear-highlight action was made.\n fireNonCancelableEvent(this.context.handlers.onClearHighlight, { isApiCall });\n }\n };\n\n private get isTooltipPinned() {\n return this.chartExtraTooltip.get().pinned;\n }\n}\n\nfunction isPointsPositionsEqual(current?: Highcharts.Point, next?: Highcharts.Point) {\n return current?.x === next?.x && current?.y === next?.y;\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import { ChartAPI } from "../chart-api";
2
2
  import { BaseI18nStrings, CoreChartProps } from "../interfaces";
3
- export declare function ChartTooltip({ placement, size, getTooltipContent: getTooltipContentOverrides, api, i18nStrings, debounce, }: CoreChartProps.TooltipOptions & {
3
+ export declare function ChartTooltip({ placement, size, getTooltipContent: getTooltipContentOverrides, api, i18nStrings, debounce, seriesSorting, }: CoreChartProps.TooltipOptions & {
4
4
  i18nStrings?: BaseI18nStrings;
5
5
  getTooltipContent?: CoreChartProps.GetTooltipContent;
6
6
  api: ChartAPI;
@@ -15,7 +15,7 @@ import { getPointColor, getSeriesColor, getSeriesId, getSeriesMarkerType, isXThr
15
15
  import styles from "../styles.css.js";
16
16
  const MIN_VISIBLE_BLOCK_SIZE = 200;
17
17
  const DEFAULT_DEBOUNCE = 200;
18
- export function ChartTooltip({ placement = "target", size, getTooltipContent: getTooltipContentOverrides, api, i18nStrings, debounce = false, }) {
18
+ export function ChartTooltip({ placement = "target", size, getTooltipContent: getTooltipContentOverrides, api, i18nStrings, debounce = false, seriesSorting = "as-added", }) {
19
19
  var _a;
20
20
  const [expandedSeries, setExpandedSeries] = useState({});
21
21
  const tooltip = useSelector(api.tooltipStore, (s) => s);
@@ -40,6 +40,7 @@ export function ChartTooltip({ placement = "target", size, getTooltipContent: ge
40
40
  group: debouncedTooltip.group,
41
41
  expandedSeries,
42
42
  setExpandedSeries,
43
+ seriesSorting,
43
44
  hideTooltip: () => {
44
45
  api.hideTooltip();
45
46
  },
@@ -70,14 +71,14 @@ function getTooltipContent(api, props) {
70
71
  return null;
71
72
  }
72
73
  }
73
- function getTooltipContentCartesian(api, { point, group, expandedSeries, renderers = {}, setExpandedSeries, hideTooltip, }) {
74
+ function getTooltipContentCartesian(api, { point, group, expandedSeries, renderers = {}, setExpandedSeries, hideTooltip, seriesSorting, }) {
74
75
  var _a, _b, _c, _d, _e;
75
76
  // The cartesian tooltip might or might not have a selected point, but it always has a non-empty group.
76
77
  // By design, every point of the group has the same x value.
77
78
  const x = group[0].x;
78
79
  const chart = group[0].series.chart;
79
80
  const getSeriesMarker = (series) => api.renderMarker(getSeriesMarkerType(series), getSeriesColor(series), true);
80
- const matchedItems = findTooltipSeriesItems(getChartSeries(chart.series), group);
81
+ const matchedItems = findTooltipSeriesItems(getChartSeries(chart.series), group, seriesSorting);
81
82
  const detailItems = matchedItems.map((item) => {
82
83
  var _a, _b, _c;
83
84
  const valueFormatter = getFormatter(item.point.series.yAxis);
@@ -144,7 +145,7 @@ function getTooltipContentPie(api, { point, renderers = {}, hideTooltip, }) {
144
145
  footer: (_f = renderers.footer) === null || _f === void 0 ? void 0 : _f.call(renderers, tooltipDetails),
145
146
  };
146
147
  }
147
- function findTooltipSeriesItems(series, group) {
148
+ function findTooltipSeriesItems(series, group, seriesSorting) {
148
149
  const seriesOrder = series.reduce((d, s, i) => d.set(s, i), new Map());
149
150
  const getSeriesIndex = (s) => { var _a; return (_a = seriesOrder.get(s)) !== null && _a !== void 0 ? _a : -1; };
150
151
  const seriesErrors = new Map();
@@ -188,11 +189,14 @@ function findTooltipSeriesItems(series, group) {
188
189
  }
189
190
  }
190
191
  return (matchedItems
191
- // We sort matched items by series order. If there are multiple items that belong to the same series, we sort them by value.
192
192
  .sort((i1, i2) => {
193
- var _a, _b;
193
+ var _a, _b, _c, _d;
194
+ if (seriesSorting === "by-value-desc") {
195
+ return ((_a = i2.point.y) !== null && _a !== void 0 ? _a : 0) - ((_b = i1.point.y) !== null && _b !== void 0 ? _b : 0);
196
+ }
197
+ // We sort matched items by series order. If there are multiple items that belong to the same series, we sort them by value.
194
198
  const s1 = getSeriesIndex(i1.point.series) - getSeriesIndex(i2.point.series);
195
- return s1 || ((_a = i1.point.y) !== null && _a !== void 0 ? _a : 0) - ((_b = i2.point.y) !== null && _b !== void 0 ? _b : 0);
199
+ return s1 || ((_c = i1.point.y) !== null && _c !== void 0 ? _c : 0) - ((_d = i2.point.y) !== null && _d !== void 0 ? _d : 0);
196
200
  })
197
201
  // For each series item we add linked error ranges, sorted by their respective series indices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AAE,EAAE,EAAE,EAAE;;QACf,MAAM,EAAE,GAAG,cAAc,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,cAAc,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC7E,OAAO,EAAE,IAAI,CAAC,MAAA,EAAE,CAAC,KAAK,CAAC,CAAC,mCAAI,CAAC,CAAC,GAAG,CAAC,MAAA,EAAE,CAAC,KAAK,CAAC,CAAC,mCAAI,CAAC,CAAC,CAAC;IACrD,CAAC,CAAC;QACF,8FAA8F;SAC7F,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;;QACZ,MAAM,WAAW,GAAG,MAAA,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,mCAAI,EAAE,CAAC;QAC3E,MAAM,iBAAiB,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,cAAc,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;QAC9G,OAAO,EAAE,GAAG,IAAI,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACrD,CAAC,CAAC,CACL,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useState } from \"react\";\n\nimport { warnOnce } from \"@cloudscape-design/component-toolkit/internal\";\nimport Box from \"@cloudscape-design/components/box\";\nimport { InternalChartTooltip } from \"@cloudscape-design/components/internal/do-not-use/chart-tooltip\";\nimport LiveRegion from \"@cloudscape-design/components/live-region\";\n\nimport ChartSeriesDetails, { ChartSeriesDetailItem } from \"../../internal/components/series-details\";\nimport { useSelector } from \"../../internal/utils/async-store\";\nimport { getChartSeries } from \"../../internal/utils/chart-series\";\nimport { useDebouncedValue } from \"../../internal/utils/use-debounced-value\";\nimport { ChartAPI } from \"../chart-api\";\nimport { getFormatter } from \"../formatters\";\nimport { BaseI18nStrings, CoreChartProps } from \"../interfaces\";\nimport { getPointColor, getSeriesColor, getSeriesId, getSeriesMarkerType, isXThreshold } from \"../utils\";\n\nimport styles from \"../styles.css.js\";\n\nconst MIN_VISIBLE_BLOCK_SIZE = 200;\nconst DEFAULT_DEBOUNCE = 200;\n\ntype ExpandedSeriesState = Record<string, Set<string>>;\n\ninterface ExpandedSeriesStateProps {\n expandedSeries: ExpandedSeriesState;\n setExpandedSeries: (cb: (state: ExpandedSeriesState) => ExpandedSeriesState) => void;\n}\n\ninterface RenderedTooltipContent {\n header: React.ReactNode;\n body: React.ReactNode;\n footer: React.ReactNode;\n}\n\ninterface MatchedItem {\n point: Highcharts.Point;\n errorRanges: Highcharts.Point[];\n}\n\nexport function ChartTooltip({\n placement = \"target\",\n size,\n getTooltipContent: getTooltipContentOverrides,\n api,\n i18nStrings,\n debounce = false,\n}: CoreChartProps.TooltipOptions & {\n i18nStrings?: BaseI18nStrings;\n getTooltipContent?: CoreChartProps.GetTooltipContent;\n api: ChartAPI;\n}) {\n const [expandedSeries, setExpandedSeries] = useState<ExpandedSeriesState>({});\n const tooltip = useSelector(api.tooltipStore, (s) => s);\n const debouncedTooltip = useDebouncedValue(tooltip, debounce === true ? DEFAULT_DEBOUNCE : debounce || 0);\n\n if (!debouncedTooltip || !debouncedTooltip.visible || debouncedTooltip.group.length === 0) {\n return null;\n }\n\n const chart = debouncedTooltip.group[0]?.series.chart;\n const renderers = getTooltipContentOverrides?.({ point: debouncedTooltip.point, group: debouncedTooltip.group });\n const getTrack = placement === \"target\" ? api.getTargetTrack : api.getGroupTrack;\n const position = (() => {\n if (placement === \"target\" || placement === \"middle\") {\n return !chart.inverted ? \"right\" : \"bottom\";\n } else {\n return !chart.inverted ? \"bottom\" : \"right\";\n }\n })();\n const content = getTooltipContent(api, {\n renderers,\n point: debouncedTooltip.point,\n group: debouncedTooltip.group,\n expandedSeries,\n setExpandedSeries,\n hideTooltip: () => {\n api.hideTooltip();\n },\n });\n if (!content) {\n return null;\n }\n return (\n <InternalChartTooltip\n getTrack={getTrack}\n trackKey={getTrackKey(debouncedTooltip.point, debouncedTooltip.group)}\n container={null}\n dismissButton={debouncedTooltip.pinned}\n dismissAriaLabel={i18nStrings?.detailPopoverDismissAriaLabel}\n onDismiss={api.onDismissTooltip}\n onMouseEnter={api.onMouseEnterTooltip}\n onMouseLeave={api.onMouseLeaveTooltip}\n title={content.header}\n footer={\n content.footer ? (\n <>\n <hr aria-hidden={true} />\n {content.footer}\n </>\n ) : null\n }\n size={size}\n position={position}\n minVisibleBlockSize={MIN_VISIBLE_BLOCK_SIZE}\n >\n <LiveRegion>{content.body}</LiveRegion>\n </InternalChartTooltip>\n );\n}\n\nfunction getTrackKey(point: null | Highcharts.Point, group: readonly Highcharts.Point[]) {\n const pointId = point && (point.options.id || point.options.name);\n if (point && pointId) {\n return `p-${pointId}-${point.x}-${point.y}`;\n }\n if (point) {\n return `p-${point.x}-${point.y}`;\n }\n return `g_${group.length}_${group[0].x}`;\n}\n\nfunction getTooltipContent(\n api: ChartAPI,\n props: CoreChartProps.GetTooltipContentProps & {\n renderers?: CoreChartProps.TooltipContentRenderer;\n hideTooltip: () => void;\n } & ExpandedSeriesStateProps,\n): null | RenderedTooltipContent {\n if (props.point && props.point.series.type === \"pie\") {\n return getTooltipContentPie(api, { ...props, point: props.point });\n } else if (props.group.length > 0 && props.group[0].series.type !== \"pie\") {\n return getTooltipContentCartesian(api, props);\n } else {\n return null;\n }\n}\n\nfunction getTooltipContentCartesian(\n api: ChartAPI,\n {\n point,\n group,\n expandedSeries,\n renderers = {},\n setExpandedSeries,\n hideTooltip,\n }: CoreChartProps.GetTooltipContentProps & {\n renderers?: CoreChartProps.TooltipContentRenderer;\n hideTooltip: () => void;\n } & ExpandedSeriesStateProps,\n): RenderedTooltipContent {\n // The cartesian tooltip might or might not have a selected point, but it always has a non-empty group.\n // By design, every point of the group has the same x value.\n const x = group[0].x;\n const chart = group[0].series.chart;\n const getSeriesMarker = (series: Highcharts.Series) =>\n api.renderMarker(getSeriesMarkerType(series), getSeriesColor(series), true);\n const matchedItems = findTooltipSeriesItems(getChartSeries(chart.series), group);\n const detailItems: ChartSeriesDetailItem[] = matchedItems.map((item) => {\n const valueFormatter = getFormatter(item.point.series.yAxis);\n const itemY = isXThreshold(item.point.series) ? null : (item.point.y ?? null);\n const customContent = renderers.point\n ? renderers.point({\n item,\n hideTooltip,\n })\n : undefined;\n return {\n key: customContent?.key ?? item.point.series.name,\n value: customContent?.value ?? valueFormatter(itemY),\n marker: getSeriesMarker(item.point.series),\n subItems: customContent?.subItems,\n expandableId: customContent?.expandable ? item.point.series.name : undefined,\n highlighted: item.point.x === point?.x && item.point.y === point?.y,\n description:\n customContent?.description === undefined && item.errorRanges.length ? (\n <>\n {item.errorRanges.map((errorBarPoint, index) => (\n <div key={index} className={styles[\"error-range\"]}>\n <span>{errorBarPoint.series.userOptions.name ? errorBarPoint.series.userOptions.name : \"\"}</span>\n <span>\n {valueFormatter(errorBarPoint.options.low ?? 0)} - {valueFormatter(errorBarPoint.options.high ?? 0)}\n </span>\n </div>\n ))}\n </>\n ) : (\n customContent?.description\n ),\n };\n });\n // We only support cartesian charts with a single x axis.\n const titleFormatter = getFormatter(chart.xAxis[0]);\n const slotRenderProps: CoreChartProps.TooltipSlotProps = {\n x,\n items: matchedItems,\n hideTooltip: hideTooltip,\n };\n return {\n header: renderers.header?.(slotRenderProps) ?? titleFormatter(x),\n body: renderers.body?.(slotRenderProps) ?? (\n <ChartSeriesDetails\n details={detailItems}\n expandedSeries={expandedSeries[x]}\n setExpandedState={(id, isExpanded) => {\n setExpandedSeries((oldState) => {\n const expandedSeriesInCurrentCoordinate = new Set(oldState[x]);\n if (isExpanded) {\n expandedSeriesInCurrentCoordinate.add(id);\n } else {\n expandedSeriesInCurrentCoordinate.delete(id);\n }\n return { ...oldState, [x]: expandedSeriesInCurrentCoordinate };\n });\n }}\n />\n ),\n footer: renderers.footer?.(slotRenderProps),\n };\n}\n\nfunction getTooltipContentPie(\n api: ChartAPI,\n {\n point,\n renderers = {},\n hideTooltip,\n }: { point: Highcharts.Point } & { renderers?: CoreChartProps.TooltipContentRenderer; hideTooltip: () => void },\n): RenderedTooltipContent {\n const tooltipDetails: CoreChartProps.TooltipSlotProps = {\n x: point.x,\n items: [{ point, errorRanges: [] }],\n hideTooltip,\n };\n return {\n header: renderers.header?.(tooltipDetails) ?? (\n <div className={styles[\"tooltip-default-header\"]}>\n {api.renderMarker(getSeriesMarkerType(point.series), getPointColor(point))}\n <Box variant=\"span\" fontWeight=\"bold\">\n {point.name}\n </Box>\n </div>\n ),\n body:\n renderers.body?.(tooltipDetails) ??\n (renderers.details ? (\n <ChartSeriesDetails\n details={renderers.details({\n point,\n hideTooltip,\n })}\n compactList={true}\n />\n ) : (\n // We expect all pie chart segments to have defined y values. We use y=0 as fallback\n // because the property is optional in Highcharts types.\n <ChartSeriesDetails details={[{ key: point.series.name, value: point.y ?? 0 }]} />\n )),\n footer: renderers.footer?.(tooltipDetails),\n };\n}\n\nfunction findTooltipSeriesItems(\n series: readonly Highcharts.Series[],\n group: readonly Highcharts.Point[],\n): MatchedItem[] {\n const seriesOrder = series.reduce((d, s, i) => d.set(s, i), new Map<Highcharts.Series, number>());\n const getSeriesIndex = (s: Highcharts.Series) => seriesOrder.get(s) ?? -1;\n const seriesErrors = new Map<string, Highcharts.Point[]>();\n const matchedSeries = new Set<Highcharts.Series>();\n const matchedItems: MatchedItem[] = [];\n for (const point of group) {\n // We only support errorbar series that are linked to other series. In tooltip content we add\n // linked error bars to series detail slot.\n if (point.series.type === \"errorbar\") {\n if (point.series.linkedParent) {\n addError(getSeriesId(point.series.linkedParent), point);\n } else {\n warnOnce(\n \"chart-components\",\n 'The `linkedTo` property of \"errorbar\" series is missing, or points to a series that does not exist.',\n );\n }\n } else {\n addMatchedPoints(point);\n }\n }\n function addError(seriesId: string, errorPoint: Highcharts.Point) {\n if (errorPoint.options.low !== undefined && errorPoint.options.high !== undefined) {\n const errorRanges = seriesErrors.get(seriesId) ?? [];\n errorRanges.push(errorPoint);\n seriesErrors.set(seriesId, errorRanges);\n }\n }\n function addMatchedPoints(point: Highcharts.Point) {\n if (!matchedSeries.has(point.series)) {\n matchedSeries.add(point.series);\n if (isXThreshold(point.series)) {\n matchedItems.push({ point, errorRanges: [] });\n } else {\n point.series.data\n .filter((d) => d.x === point.x)\n .sort((a, b) => (a.y ?? 0) - (b.y ?? 0))\n .forEach((point) => matchedItems.push({ point, errorRanges: [] }));\n }\n }\n }\n return (\n matchedItems\n // We sort matched items by series order. If there are multiple items that belong to the same series, we sort them by value.\n .sort((i1, i2) => {\n const s1 = getSeriesIndex(i1.point.series) - getSeriesIndex(i2.point.series);\n return s1 || (i1.point.y ?? 0) - (i2.point.y ?? 0);\n })\n // For each series item we add linked error ranges, sorted by their respective series indices.\n .map((item) => {\n const errorRanges = seriesErrors.get(getSeriesId(item.point.series)) ?? [];\n const sortedErrorRanges = errorRanges.sort((i1, i2) => getSeriesIndex(i1.series) - getSeriesIndex(i2.series));\n return { ...item, errorRanges: sortedErrorRanges };\n })\n );\n}\n"]}
1
+ {"version":3,"file":"core-tooltip.js","sourceRoot":"","sources":["../../../../src/core/components/core-tooltip.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AACzE,OAAO,GAAG,MAAM,mCAAmC,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iEAAiE,CAAC;AACvG,OAAO,UAAU,MAAM,2CAA2C,CAAC;AAEnE,OAAO,kBAA6C,MAAM,0CAA0C,CAAC;AACrG,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,C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AAA,EAAE,CAAC,KAAK,CAAC,CAAC,mCAAI,CAAC,CAAC,CAAC;IACrD,CAAC,CAAC;QACF,8FAA8F;SAC7F,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;;QACZ,MAAM,WAAW,GAAG,MAAA,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,mCAAI,EAAE,CAAC;QAC3E,MAAM,iBAAiB,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,cAAc,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;QAC9G,OAAO,EAAE,GAAG,IAAI,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACrD,CAAC,CAAC,CACL,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useState } from \"react\";\n\nimport { warnOnce } from \"@cloudscape-design/component-toolkit/internal\";\nimport Box from \"@cloudscape-design/components/box\";\nimport { InternalChartTooltip } from \"@cloudscape-design/components/internal/do-not-use/chart-tooltip\";\nimport LiveRegion from \"@cloudscape-design/components/live-region\";\n\nimport ChartSeriesDetails, { ChartSeriesDetailItem } from \"../../internal/components/series-details\";\nimport { useSelector } from \"../../internal/utils/async-store\";\nimport { getChartSeries } from \"../../internal/utils/chart-series\";\nimport { useDebouncedValue } from \"../../internal/utils/use-debounced-value\";\nimport { ChartAPI } from \"../chart-api\";\nimport { getFormatter } from \"../formatters\";\nimport { BaseI18nStrings, CoreChartProps } from \"../interfaces\";\nimport { getPointColor, getSeriesColor, getSeriesId, getSeriesMarkerType, isXThreshold } from \"../utils\";\n\nimport styles from \"../styles.css.js\";\n\nconst MIN_VISIBLE_BLOCK_SIZE = 200;\nconst DEFAULT_DEBOUNCE = 200;\n\ntype ExpandedSeriesState = Record<string, Set<string>>;\n\ninterface ExpandedSeriesStateProps {\n expandedSeries: ExpandedSeriesState;\n setExpandedSeries: (cb: (state: ExpandedSeriesState) => ExpandedSeriesState) => void;\n}\n\ninterface RenderedTooltipContent {\n header: React.ReactNode;\n body: React.ReactNode;\n footer: React.ReactNode;\n}\n\ninterface MatchedItem {\n point: Highcharts.Point;\n errorRanges: Highcharts.Point[];\n}\n\nexport function ChartTooltip({\n placement = \"target\",\n size,\n getTooltipContent: getTooltipContentOverrides,\n api,\n i18nStrings,\n debounce = false,\n seriesSorting = \"as-added\",\n}: CoreChartProps.TooltipOptions & {\n i18nStrings?: BaseI18nStrings;\n getTooltipContent?: CoreChartProps.GetTooltipContent;\n api: ChartAPI;\n}) {\n const [expandedSeries, setExpandedSeries] = useState<ExpandedSeriesState>({});\n const tooltip = useSelector(api.tooltipStore, (s) => s);\n const debouncedTooltip = useDebouncedValue(tooltip, debounce === true ? DEFAULT_DEBOUNCE : debounce || 0);\n\n if (!debouncedTooltip || !debouncedTooltip.visible || debouncedTooltip.group.length === 0) {\n return null;\n }\n\n const chart = debouncedTooltip.group[0]?.series.chart;\n const renderers = getTooltipContentOverrides?.({ point: debouncedTooltip.point, group: debouncedTooltip.group });\n const getTrack = placement === \"target\" ? api.getTargetTrack : api.getGroupTrack;\n const position = (() => {\n if (placement === \"target\" || placement === \"middle\") {\n return !chart.inverted ? \"right\" : \"bottom\";\n } else {\n return !chart.inverted ? \"bottom\" : \"right\";\n }\n })();\n const content = getTooltipContent(api, {\n renderers,\n point: debouncedTooltip.point,\n group: debouncedTooltip.group,\n expandedSeries,\n setExpandedSeries,\n seriesSorting,\n hideTooltip: () => {\n api.hideTooltip();\n },\n });\n if (!content) {\n return null;\n }\n return (\n <InternalChartTooltip\n getTrack={getTrack}\n trackKey={getTrackKey(debouncedTooltip.point, debouncedTooltip.group)}\n container={null}\n dismissButton={debouncedTooltip.pinned}\n dismissAriaLabel={i18nStrings?.detailPopoverDismissAriaLabel}\n onDismiss={api.onDismissTooltip}\n onMouseEnter={api.onMouseEnterTooltip}\n onMouseLeave={api.onMouseLeaveTooltip}\n title={content.header}\n footer={\n content.footer ? (\n <>\n <hr aria-hidden={true} />\n {content.footer}\n </>\n ) : null\n }\n size={size}\n position={position}\n minVisibleBlockSize={MIN_VISIBLE_BLOCK_SIZE}\n >\n <LiveRegion>{content.body}</LiveRegion>\n </InternalChartTooltip>\n );\n}\n\nfunction getTrackKey(point: null | Highcharts.Point, group: readonly Highcharts.Point[]) {\n const pointId = point && (point.options.id || point.options.name);\n if (point && pointId) {\n return `p-${pointId}-${point.x}-${point.y}`;\n }\n if (point) {\n return `p-${point.x}-${point.y}`;\n }\n return `g_${group.length}_${group[0].x}`;\n}\n\nfunction getTooltipContent(\n api: ChartAPI,\n props: CoreChartProps.GetTooltipContentProps & {\n renderers?: CoreChartProps.TooltipContentRenderer;\n hideTooltip: () => void;\n seriesSorting: NonNullable<CoreChartProps.TooltipOptions[\"seriesSorting\"]>;\n } & ExpandedSeriesStateProps,\n): null | RenderedTooltipContent {\n if (props.point && props.point.series.type === \"pie\") {\n return getTooltipContentPie(api, { ...props, point: props.point });\n } else if (props.group.length > 0 && props.group[0].series.type !== \"pie\") {\n return getTooltipContentCartesian(api, props);\n } else {\n return null;\n }\n}\n\nfunction getTooltipContentCartesian(\n api: ChartAPI,\n {\n point,\n group,\n expandedSeries,\n renderers = {},\n setExpandedSeries,\n hideTooltip,\n seriesSorting,\n }: CoreChartProps.GetTooltipContentProps & {\n renderers?: CoreChartProps.TooltipContentRenderer;\n hideTooltip: () => void;\n seriesSorting: NonNullable<CoreChartProps.TooltipOptions[\"seriesSorting\"]>;\n } & ExpandedSeriesStateProps,\n): RenderedTooltipContent {\n // The cartesian tooltip might or might not have a selected point, but it always has a non-empty group.\n // By design, every point of the group has the same x value.\n const x = group[0].x;\n const chart = group[0].series.chart;\n const getSeriesMarker = (series: Highcharts.Series) =>\n api.renderMarker(getSeriesMarkerType(series), getSeriesColor(series), true);\n const matchedItems = findTooltipSeriesItems(getChartSeries(chart.series), group, seriesSorting);\n const detailItems: ChartSeriesDetailItem[] = matchedItems.map((item) => {\n const valueFormatter = getFormatter(item.point.series.yAxis);\n const itemY = isXThreshold(item.point.series) ? null : (item.point.y ?? null);\n const customContent = renderers.point\n ? renderers.point({\n item,\n hideTooltip,\n })\n : undefined;\n return {\n key: customContent?.key ?? item.point.series.name,\n value: customContent?.value ?? valueFormatter(itemY),\n marker: getSeriesMarker(item.point.series),\n subItems: customContent?.subItems,\n expandableId: customContent?.expandable ? item.point.series.name : undefined,\n highlighted: item.point.x === point?.x && item.point.y === point?.y,\n description:\n customContent?.description === undefined && item.errorRanges.length ? (\n <>\n {item.errorRanges.map((errorBarPoint, index) => (\n <div key={index} className={styles[\"error-range\"]}>\n <span>{errorBarPoint.series.userOptions.name ? errorBarPoint.series.userOptions.name : \"\"}</span>\n <span>\n {valueFormatter(errorBarPoint.options.low ?? 0)} - {valueFormatter(errorBarPoint.options.high ?? 0)}\n </span>\n </div>\n ))}\n </>\n ) : (\n customContent?.description\n ),\n };\n });\n // We only support cartesian charts with a single x axis.\n const titleFormatter = getFormatter(chart.xAxis[0]);\n const slotRenderProps: CoreChartProps.TooltipSlotProps = {\n x,\n items: matchedItems,\n hideTooltip: hideTooltip,\n };\n return {\n header: renderers.header?.(slotRenderProps) ?? titleFormatter(x),\n body: renderers.body?.(slotRenderProps) ?? (\n <ChartSeriesDetails\n details={detailItems}\n expandedSeries={expandedSeries[x]}\n setExpandedState={(id, isExpanded) => {\n setExpandedSeries((oldState) => {\n const expandedSeriesInCurrentCoordinate = new Set(oldState[x]);\n if (isExpanded) {\n expandedSeriesInCurrentCoordinate.add(id);\n } else {\n expandedSeriesInCurrentCoordinate.delete(id);\n }\n return { ...oldState, [x]: expandedSeriesInCurrentCoordinate };\n });\n }}\n />\n ),\n footer: renderers.footer?.(slotRenderProps),\n };\n}\n\nfunction getTooltipContentPie(\n api: ChartAPI,\n {\n point,\n renderers = {},\n hideTooltip,\n }: { point: Highcharts.Point } & { renderers?: CoreChartProps.TooltipContentRenderer; hideTooltip: () => void },\n): RenderedTooltipContent {\n const tooltipDetails: CoreChartProps.TooltipSlotProps = {\n x: point.x,\n items: [{ point, errorRanges: [] }],\n hideTooltip,\n };\n return {\n header: renderers.header?.(tooltipDetails) ?? (\n <div className={styles[\"tooltip-default-header\"]}>\n {api.renderMarker(getSeriesMarkerType(point.series), getPointColor(point))}\n <Box variant=\"span\" fontWeight=\"bold\">\n {point.name}\n </Box>\n </div>\n ),\n body:\n renderers.body?.(tooltipDetails) ??\n (renderers.details ? (\n <ChartSeriesDetails\n details={renderers.details({\n point,\n hideTooltip,\n })}\n compactList={true}\n />\n ) : (\n // We expect all pie chart segments to have defined y values. We use y=0 as fallback\n // because the property is optional in Highcharts types.\n <ChartSeriesDetails details={[{ key: point.series.name, value: point.y ?? 0 }]} />\n )),\n footer: renderers.footer?.(tooltipDetails),\n };\n}\n\nfunction findTooltipSeriesItems(\n series: readonly Highcharts.Series[],\n group: readonly Highcharts.Point[],\n seriesSorting: NonNullable<CoreChartProps.TooltipOptions[\"seriesSorting\"]>,\n): MatchedItem[] {\n const seriesOrder = series.reduce((d, s, i) => d.set(s, i), new Map<Highcharts.Series, number>());\n const getSeriesIndex = (s: Highcharts.Series) => seriesOrder.get(s) ?? -1;\n const seriesErrors = new Map<string, Highcharts.Point[]>();\n const matchedSeries = new Set<Highcharts.Series>();\n const matchedItems: MatchedItem[] = [];\n for (const point of group) {\n // We only support errorbar series that are linked to other series. In tooltip content we add\n // linked error bars to series detail slot.\n if (point.series.type === \"errorbar\") {\n if (point.series.linkedParent) {\n addError(getSeriesId(point.series.linkedParent), point);\n } else {\n warnOnce(\n \"chart-components\",\n 'The `linkedTo` property of \"errorbar\" series is missing, or points to a series that does not exist.',\n );\n }\n } else {\n addMatchedPoints(point);\n }\n }\n function addError(seriesId: string, errorPoint: Highcharts.Point) {\n if (errorPoint.options.low !== undefined && errorPoint.options.high !== undefined) {\n const errorRanges = seriesErrors.get(seriesId) ?? [];\n errorRanges.push(errorPoint);\n seriesErrors.set(seriesId, errorRanges);\n }\n }\n function addMatchedPoints(point: Highcharts.Point) {\n if (!matchedSeries.has(point.series)) {\n matchedSeries.add(point.series);\n if (isXThreshold(point.series)) {\n matchedItems.push({ point, errorRanges: [] });\n } else {\n point.series.data\n .filter((d) => d.x === point.x)\n .sort((a, b) => (a.y ?? 0) - (b.y ?? 0))\n .forEach((point) => matchedItems.push({ point, errorRanges: [] }));\n }\n }\n }\n return (\n matchedItems\n .sort((i1, i2) => {\n if (seriesSorting === \"by-value-desc\") {\n return (i2.point.y ?? 0) - (i1.point.y ?? 0);\n }\n // We sort matched items by series order. If there are multiple items that belong to the same series, we sort them by value.\n const s1 = getSeriesIndex(i1.point.series) - getSeriesIndex(i2.point.series);\n return s1 || (i1.point.y ?? 0) - (i2.point.y ?? 0);\n })\n // For each series item we add linked error ranges, sorted by their respective series indices.\n .map((item) => {\n const errorRanges = seriesErrors.get(getSeriesId(item.point.series)) ?? [];\n const sortedErrorRanges = errorRanges.sort((i1, i2) => getSeriesIndex(i1.series) - getSeriesIndex(i2.series));\n return { ...item, errorRanges: sortedErrorRanges };\n })\n );\n}\n"]}
@@ -389,6 +389,7 @@ export declare namespace CoreChartProps {
389
389
  placement?: "middle" | "outside" | "target";
390
390
  size?: "small" | "medium" | "large";
391
391
  debounce?: number | boolean;
392
+ seriesSorting?: "as-added" | "by-value-desc";
392
393
  }
393
394
  type GetTooltipContent = (props: GetTooltipContentProps) => TooltipContentRenderer;
394
395
  interface GetTooltipContentProps {
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/core/interfaces.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type Highcharts from \"highcharts\";\n\nimport type * as InternalComponentTypes from \"../internal/components/interfaces\";\nimport { type NonCancelableEventHandler } from \"../internal/events\";\n\n// All charts take `highcharts` instance, that can be served statically or dynamically.\n// Although it has to be of type Highcharts, the TS type we use is `null | object`, so\n// that it is ignored by the documenter.\n\n/**\n * This interface includes common public chart properties, applicable for all chart types.\n */\nexport interface BaseChartOptions {\n /**\n * The Highcharts instance, which can be obtained using `import Highcharts from \"highcharts\"`.\n * Supported Highcharts versions: 12.\n */\n highcharts: null | object;\n\n /**\n * Custom content that renders when `highcharts=null`. It renders a spinner if not defined.\n */\n fallback?: React.ReactNode;\n\n /**\n * The height of the chart plot in pixels. It does not include legend and filter.\n */\n chartHeight?: number;\n\n /**\n * The chart automatically adjusts its height to fill the parent container when this property is set.\n */\n fitHeight?: boolean;\n\n /**\n * Defines the minimum allowed height of the chart plot. Use this when `fitHeight=true` to\n * prevent the chart plot from becoming too small to display its content. When the parent\n * container is shorter than the minimum height, a vertical scrollbar appears automatically.\n */\n chartMinHeight?: number;\n\n /**\n * Defines the minimum allowed width of the chart plot. When the parent container is narrower than the\n * minimum width, the horizontal scrollbar is automatically added.\n */\n chartMinWidth?: number;\n\n /**\n * Defines the ARIA label for the chart container.\n * This property corresponds to [lang.chartContainerLabel](https://api.highcharts.com/highcharts/lang.accessibility.chartContainerLabel),\n * and requires the [accessibility module](https://www.highcharts.com/docs/accessibility/accessibility-module).\n */\n ariaLabel?: string;\n\n /**\n * Defines the ARIA description of the chart container.\n * This property corresponds to [accessibility.description](https://api.highcharts.com/highcharts/accessibility.description),\n * and requires the [accessibility module](https://www.highcharts.com/docs/accessibility/accessibility-module).\n */\n ariaDescription?: string;\n\n /**\n * Defines chart legend options, including:\n * * `enabled` (optional, boolean) - Hides legend when set to `false`.\n * * `title` (optional, string) - Visible label, shown above the legend.\n * * `actions` (optional, slot) - A slot before the legend that can be used to render custom actions.\n */\n legend?: BaseLegendOptions;\n\n /**\n * Defines options to represent empty, no-match, loading, and error state of the chart, including:\n * * `statusType` (optional, \"finished\" | \"loading\" | \"error\") - Specifies the current status of loading data.\n * * `empty` (optional, ReactNode) - Content displayed when the chart data is empty.\n * * `noMatch` (optional, ReactNode) - Content displayed when there is no data to display due to the built-in filtering.\n * * `loading` (optional, ReactNode) - Content displayed when `statusType=\"loading\"`. If omitted, the default loading state\n * is shown, using `i18n.loadingText` or built-in i18n.\n * * `error` (optional, ReactNode) - Content displayed when `statusType=\"error\"`. If omitted, the default error state\n * is shown, using `i18n.errorText` and `i18n.recoveryText` (when `onRecoveryClick` is provided), or built-in i18n.\n * * `onRecoveryClick` (optional, function) - Called when the user clicks the recovery button that appears when using default error\n * state, and only if `onRecoveryClick` is provided. Use this to enable the user to retry a failed request or provide another option\n * for the user to recover from the error.\n */\n noData?: BaseNoDataOptions;\n\n /**\n * Defines options for filtering in the chart, including:\n * * `seriesFilter` (optional, boolean) - Displays default series filter at the top of the chart.\n * * `additionalFilters` (optional, slot) - A slot for custom chart filters at the top of the chart.\n */\n filter?: BaseFilterOptions;\n}\n\nexport interface BaseLegendOptions {\n enabled?: boolean;\n title?: string;\n actions?: React.ReactNode;\n}\n\nexport interface BaseNoDataOptions {\n statusType?: \"finished\" | \"loading\" | \"error\";\n empty?: React.ReactNode;\n error?: React.ReactNode;\n loading?: React.ReactNode;\n noMatch?: React.ReactNode;\n onRecoveryClick?: NonCancelableEventHandler;\n}\n\nexport interface BaseTooltipDetail {\n key: React.ReactNode;\n value: React.ReactNode;\n}\n\nexport interface BaseI18nStrings {\n loadingText?: string;\n errorText?: string;\n recoveryText?: string;\n seriesFilterLabel?: string;\n seriesFilterPlaceholder?: string;\n seriesFilterSelectedAriaLabel?: string;\n legendAriaLabel?: string;\n detailPopoverDismissAriaLabel?: string;\n chartRoleDescription?: string;\n}\n\nexport interface CoreI18nStrings extends BaseI18nStrings {\n /**\n * ARIA label for the secondary legend when using dual axes charts.\n *\n * **Important**: When using dual axes, you should explicitly provide visible titles or ARIA labels\n * for both the primary and secondary legends to ensure proper accessibility. The primary legend\n * has built-in i18n support through `legendAriaLabel`, but the secondary legend currently requires\n * this property to be explicitly provided.\n */\n secondaryLegendAriaLabel?: string;\n}\n\nexport interface WithCartesianI18nStrings {\n /**\n * An object that contains all of the localized strings required by the component.\n * @i18n\n *\n * Available properties:\n * * `loadingText` (optional, string) - Text, displayed when the chart is loading, i.e. when `noData.statusType` is set to \"loading\".\n * * `errorText` (optional, string) - Text, displayed when the chart is in error state, i.e. when `noData.statusType` is set to \"error\".\n * * `recoveryText` (optional, string) - Text for the recovery button, displayed next to the error text.\n * * `seriesFilterLabel` (optional, string) - Text for the visible label of the default series filter.\n * * `seriesFilterPlaceholder` (optional, string) - Text for the default series filter placeholder.\n * * `seriesFilterSelectedAriaLabel` (optional, string) - ARIA label of the default series filter which is appended to any option that is selected.\n * * `legendAriaLabel` (optional, string) - ARIA label that is associated with the legend in case there is no visible `legend.title` defined.\n * * `detailPopoverDismissAriaLabel` (optional, string) - ARIA label for the details popover dismiss button.\n * * `chartRoleDescription` (optional, string) - Accessible role description of the chart plot area, e.g. \"interactive chart\".\n * * `xAxisRoleDescription` (optional, string) - Accessible role description of the x axis, e.g. \"x axis\".\n * * `yAxisRoleDescription` (optional, string) - Accessible role description of the y axis, e.g. \"y axis\".\n */\n i18nStrings?: CartesianI18nStrings;\n}\n\nexport interface WithPieI18nStrings {\n /**\n * An object that contains all of the localized strings required by the component.\n * @i18n\n *\n * Available properties:\n * * `loadingText` (optional, string) - Text, displayed when the chart is loading, i.e. when `noData.statusType` is set to \"loading\".\n * * `errorText` (optional, string) - Text, displayed when the chart is in error state, i.e. when `noData.statusType` is set to \"error\".\n * * `recoveryText` (optional, string) - Text for the recovery button, displayed next to the error text.\n * * `seriesFilterLabel` (optional, string) - Text for the visible label of the default series filter.\n * * `seriesFilterPlaceholder` (optional, string) - Text for the default series filter placeholder.\n * * `seriesFilterSelectedAriaLabel` (optional, string) - ARIA label of the default series filter which is appended to any option that is selected.\n * * `legendAriaLabel` (optional, string) - ARIA label that is associated with the legend in case there is no visible `legend.title` defined.\n * * `detailPopoverDismissAriaLabel` (optional, string) - ARIA label for the details popover dismiss button.\n * * `chartRoleDescription` (optional, string) - Accessible role description of the chart plot area, e.g. \"interactive chart\".\n * * `segmentRoleDescription` (optional, string) - Accessible role description of the segment.\n */\n i18nStrings?: PieI18nStrings;\n}\n\nexport interface CartesianI18nStrings extends BaseI18nStrings {\n xAxisRoleDescription?: string;\n yAxisRoleDescription?: string;\n}\n\nexport interface PieI18nStrings extends BaseI18nStrings {\n segmentRoleDescription?: string;\n}\n\nexport interface BaseFilterOptions {\n seriesFilter?: boolean;\n additionalFilters?: React.ReactNode;\n}\n\nexport interface BaseTooltipPointFormatted {\n key?: React.ReactNode;\n value?: React.ReactNode;\n description?: React.ReactNode;\n expandable?: boolean;\n subItems?: ReadonlyArray<{ key: React.ReactNode; value: React.ReactNode }>;\n}\n\nexport interface AreaSeriesOptions extends BaseCartesianLineLikeOptions {\n type: \"area\";\n data: readonly PointDataItemType[];\n}\n\nexport interface AreaSplineSeriesOptions extends BaseCartesianLineLikeOptions {\n type: \"areaspline\";\n data: readonly PointDataItemType[];\n}\n\nexport interface ColumnSeriesOptions extends BaseCartesianSeriesOptions {\n type: \"column\";\n data: readonly PointDataItemType[];\n}\n\nexport interface LineSeriesOptions extends BaseCartesianLineLikeOptions {\n type: \"line\";\n data: readonly PointDataItemType[];\n}\n\nexport interface SplineSeriesOptions extends BaseCartesianLineLikeOptions {\n type: \"spline\";\n data: readonly PointDataItemType[];\n}\n\nexport interface ScatterSeriesOptions extends BaseCartesianSeriesOptions {\n type: \"scatter\";\n data: readonly PointDataItemType[];\n marker?: PointMarkerOptions;\n}\n\nexport interface ErrorBarSeriesOptions extends Omit<BaseCartesianSeriesOptions, \"name\"> {\n type: \"errorbar\";\n name?: string;\n data: readonly RangeDataItemOptions[];\n linkedTo: string;\n}\n\nexport interface XThresholdSeriesOptions extends BaseCartesianLineLikeOptions {\n type: \"x-threshold\";\n value: number;\n}\n\nexport interface YThresholdSeriesOptions extends BaseCartesianLineLikeOptions {\n type: \"y-threshold\";\n value: number;\n}\n\nexport interface PieSeriesOptions extends BaseSeriesOptions {\n type: \"pie\";\n data: readonly PieSegmentOptions[];\n}\n\nexport interface DonutSeriesOptions extends BaseSeriesOptions {\n type: \"donut\";\n data: readonly PieSegmentOptions[];\n}\n\nexport interface PieSegmentOptions {\n y: number | null;\n id?: string;\n name: string;\n color?: string;\n}\n\nexport type PointDataItemType = null | number | PointDataItemOptions;\n\nexport interface PointDataItemOptions {\n x?: number;\n y: number | null;\n}\n\nexport interface RangeDataItemOptions {\n x?: number;\n low: number;\n high: number;\n}\n\ninterface BaseSeriesOptions {\n id?: string;\n name: string;\n color?: string;\n}\n\ntype BaseCartesianSeriesOptions = BaseSeriesOptions;\n\ninterface BaseCartesianLineLikeOptions extends BaseCartesianSeriesOptions {\n dashStyle?: Highcharts.DashStyleValue;\n}\n\n// The symbols union matches that of Highcharts.PointMarkerOptionsObject\ninterface PointMarkerOptions {\n symbol?: \"circle\" | \"diamond\" | \"square\" | \"triangle\" | \"triangle-down\";\n}\n\nexport interface CoreCartesianOptions {\n /**\n * When set to `true`, adds a visual emphasis on the zero baseline axis.\n */\n emphasizeBaseline?: boolean;\n /**\n * Controls the placement of the vertical axis title.\n * When set to \"side\", displays the title along the axis line.\n */\n verticalAxisTitlePlacement?: \"top\" | \"side\";\n}\n\nexport interface CoreChartProps\n extends Pick<\n BaseChartOptions,\n | \"highcharts\"\n | \"fallback\"\n | \"fitHeight\"\n | \"chartHeight\"\n | \"chartMinHeight\"\n | \"chartMinWidth\"\n | \"ariaLabel\"\n | \"ariaDescription\"\n | \"filter\"\n | \"noData\"\n >,\n CoreCartesianOptions {\n /**\n * The Highcharts options. Cloudscape injects custom styles and settings, but all can be\n * overridden with explicitly provided options. An exception is event handlers - those are\n * not overridden, but merged with Cloudscape event handlers so that both are getting called.\n */\n options: CoreChartProps.ChartOptions;\n /**\n * The Cloudscape tooltip, that comes with a vertical cursor when used on cartesian series.\n * The tooltip content is only shown when `getContent` property is defined, which is called\n * for each visited { x, y } point.\n */\n tooltip?: CoreChartProps.TooltipOptions;\n /**\n * A custom slot above the chart plot, chart's axis title, and filter.\n */\n header?: CoreChartProps.HeaderOptions;\n /**\n * Prop for passing a custom navigation control component to be rendered with the chart.\n * Use this property to add timeline navigation, range selectors, or other custom navigation elements.\n */\n navigator?: React.ReactNode;\n /**\n * A custom slot below the chart plot and legend.\n */\n footer?: CoreChartProps.FooterOptions;\n /**\n * Chart legend options.\n */\n legend?: CoreChartProps.LegendOptions;\n /**\n * The callback to init the chart's API when it is ready. The API includes the Highcharts chart object, and\n * additional Cloudscape methods.\n */\n callback?: (chart: CoreChartProps.ChartAPI) => void;\n /**\n * This is used to provide a test-utils selector. Do not use this property to provide custom styles.\n */\n className?: string;\n /**\n * IDs of visible series or points.\n */\n visibleItems?: readonly string[];\n /**\n * Called when a legend item is highlighted.\n */\n onLegendItemHighlight?: NonCancelableEventHandler<CoreChartProps.LegendItemHighlightDetail>;\n /**\n * Called when series/points visibility changes due to user interaction with legend or filter.\n */\n onVisibleItemsChange?: NonCancelableEventHandler<CoreChartProps.VisibleItemsChangeDetail>;\n /**\n * Called whenever chart tooltip is rendered to provide content for tooltip's header, body, and (optional) footer.\n */\n getTooltipContent?: CoreChartProps.GetTooltipContent;\n /**\n * Called whenever a legend item is hovered to provide content for legend tooltip's header, body, and (optional) footer.\n * If not provided, no tooltip will be displayed.\n */\n getLegendTooltipContent?: CoreChartProps.GetLegendTooltipContent;\n /**\n * Called whenever chart point or group is highlighted.\n */\n onHighlight?: NonCancelableEventHandler<CoreChartProps.HighlightChangeDetail>;\n /**\n * Called whenever chart point or group loses highlight.\n */\n onClearHighlight?: NonCancelableEventHandler<CoreChartProps.HighlightClearDetail>;\n /**\n * Use Cloudscape keyboard navigation.\n */\n keyboardNavigation?: boolean;\n /**\n * An object that contains all of the localized strings required by the component.\n * @i18n\n */\n i18nStrings?: CartesianI18nStrings & PieI18nStrings & CoreI18nStrings;\n}\n\nexport namespace CoreChartProps {\n // The API methods allow programmatic triggering of chart's behaviors, some of which are not accessible via React state.\n // This enables advanced integration scenarios, such as building a custom legend, or making multiple charts synchronized.\n export interface ChartAPI {\n chart: Highcharts.Chart;\n highcharts: typeof Highcharts;\n highlightItems(itemIds: readonly string[]): void;\n setItemsVisible(itemIds: readonly string[]): void;\n highlightChartPoint(point: Highcharts.Point): void;\n highlightChartGroup(group: readonly Highcharts.Point[]): void;\n clearChartHighlight(): void;\n }\n\n // The extended version of Highcharts.Options. The axes types are extended with Cloudscape value formatter.\n // We use a custom formatter because we cannot use the built-in Highcharts formatter for our tooltip.\n export type ChartOptions = Omit<Highcharts.Options, \"xAxis\" | \"yAxis\"> & {\n xAxis?: XAxisOptions | XAxisOptions[];\n yAxis?: YAxisOptions | YAxisOptions[];\n };\n export type XAxisOptions = Highcharts.XAxisOptions & { valueFormatter?: (value: null | number) => string };\n export type YAxisOptions = Highcharts.YAxisOptions & { valueFormatter?: (value: null | number) => string };\n\n export interface HeaderOptions {\n content: React.ReactNode;\n }\n export interface FooterOptions {\n content: React.ReactNode;\n }\n\n export interface LegendOptions extends BaseLegendOptions {\n bottomMaxHeight?: number;\n position?: \"bottom\" | \"side\";\n /**\n * This property only applies when there are secondary items.\n */\n secondaryLegendTitle?: string;\n /**\n * This property only applies when there are secondary items.\n */\n secondaryLegendActions?: React.ReactNode;\n /**\n * This property only applies when there are no secondary items and `position=\"bottom\"`.\n */\n horizontalAlignment?: LegendOptionsHorizontalAlignment;\n }\n\n export type LegendOptionsHorizontalAlignment = \"start\" | \"center\";\n\n export type LegendItem = InternalComponentTypes.LegendItem;\n export type LegendTooltipContent = InternalComponentTypes.LegendTooltipContent;\n export type GetLegendTooltipContent = InternalComponentTypes.GetLegendTooltipContent;\n export type GetLegendTooltipContentProps = InternalComponentTypes.GetLegendTooltipContentProps;\n\n export interface TooltipOptions {\n enabled?: boolean;\n placement?: \"middle\" | \"outside\" | \"target\";\n size?: \"small\" | \"medium\" | \"large\";\n debounce?: number | boolean;\n }\n\n export type GetTooltipContent = (props: GetTooltipContentProps) => TooltipContentRenderer;\n export interface GetTooltipContentProps {\n point: null | Highcharts.Point;\n group: readonly Highcharts.Point[];\n }\n export interface TooltipContentRenderer {\n point?: (props: TooltipPointProps) => TooltipPointFormatted;\n details?: (props: TooltipDetailsProps) => readonly TooltipDetail[];\n header?: (props: TooltipSlotProps) => React.ReactNode;\n body?: (props: TooltipSlotProps) => React.ReactNode;\n footer?: (props: TooltipSlotProps) => React.ReactNode;\n }\n export type TooltipPointFormatted = BaseTooltipPointFormatted;\n export interface TooltipContentItem {\n point: Highcharts.Point;\n errorRanges: Highcharts.Point[];\n }\n export interface TooltipPointProps {\n item: TooltipContentItem;\n hideTooltip: () => void;\n }\n export interface TooltipSlotProps {\n x: number;\n items: TooltipContentItem[];\n hideTooltip: () => void;\n }\n\n export interface TooltipDetailsProps {\n point: Highcharts.Point;\n hideTooltip: () => void;\n }\n\n export type TooltipDetail = BaseTooltipDetail;\n\n export interface LegendItemHighlightDetail {\n item: LegendItem;\n }\n export interface VisibleItemsChangeDetail {\n items: readonly LegendItem[];\n isApiCall: boolean;\n }\n export interface HighlightChangeDetail {\n point: null | Highcharts.Point;\n group: readonly Highcharts.Point[];\n isApiCall: boolean;\n }\n export interface HighlightClearDetail {\n isApiCall: boolean;\n }\n\n export type I18nStrings = CartesianI18nStrings & PieI18nStrings;\n}\n\nexport interface CoreLegendProps {\n items: readonly CoreLegendProps.Item[];\n title?: string;\n ariaLabel?: string;\n actions?: React.ReactNode;\n alignment?: \"horizontal\" | \"vertical\";\n horizontalAlignment?: CoreChartProps.LegendOptionsHorizontalAlignment;\n onClearHighlight?: NonCancelableEventHandler;\n onItemHighlight?: NonCancelableEventHandler<CoreLegendProps.ItemHighlightDetail>;\n onVisibleItemsChange?: NonCancelableEventHandler<CoreLegendProps.VisibleItemsChangeDetail>;\n getLegendTooltipContent?: CoreLegendProps.GetTooltipContent;\n}\n\nexport namespace CoreLegendProps {\n export type Item = InternalComponentTypes.LegendItem;\n export type GetTooltipContent = InternalComponentTypes.GetLegendTooltipContent;\n export interface ItemHighlightDetail {\n item: Item;\n }\n export interface VisibleItemsChangeDetail {\n items: readonly string[];\n }\n}\n\n// Utility types\n\nexport interface Rect {\n x: number;\n y: number;\n height: number;\n width: number;\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/core/interfaces.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type Highcharts from \"highcharts\";\n\nimport type * as InternalComponentTypes from \"../internal/components/interfaces\";\nimport { type NonCancelableEventHandler } from \"../internal/events\";\n\n// All charts take `highcharts` instance, that can be served statically or dynamically.\n// Although it has to be of type Highcharts, the TS type we use is `null | object`, so\n// that it is ignored by the documenter.\n\n/**\n * This interface includes common public chart properties, applicable for all chart types.\n */\nexport interface BaseChartOptions {\n /**\n * The Highcharts instance, which can be obtained using `import Highcharts from \"highcharts\"`.\n * Supported Highcharts versions: 12.\n */\n highcharts: null | object;\n\n /**\n * Custom content that renders when `highcharts=null`. It renders a spinner if not defined.\n */\n fallback?: React.ReactNode;\n\n /**\n * The height of the chart plot in pixels. It does not include legend and filter.\n */\n chartHeight?: number;\n\n /**\n * The chart automatically adjusts its height to fill the parent container when this property is set.\n */\n fitHeight?: boolean;\n\n /**\n * Defines the minimum allowed height of the chart plot. Use this when `fitHeight=true` to\n * prevent the chart plot from becoming too small to display its content. When the parent\n * container is shorter than the minimum height, a vertical scrollbar appears automatically.\n */\n chartMinHeight?: number;\n\n /**\n * Defines the minimum allowed width of the chart plot. When the parent container is narrower than the\n * minimum width, the horizontal scrollbar is automatically added.\n */\n chartMinWidth?: number;\n\n /**\n * Defines the ARIA label for the chart container.\n * This property corresponds to [lang.chartContainerLabel](https://api.highcharts.com/highcharts/lang.accessibility.chartContainerLabel),\n * and requires the [accessibility module](https://www.highcharts.com/docs/accessibility/accessibility-module).\n */\n ariaLabel?: string;\n\n /**\n * Defines the ARIA description of the chart container.\n * This property corresponds to [accessibility.description](https://api.highcharts.com/highcharts/accessibility.description),\n * and requires the [accessibility module](https://www.highcharts.com/docs/accessibility/accessibility-module).\n */\n ariaDescription?: string;\n\n /**\n * Defines chart legend options, including:\n * * `enabled` (optional, boolean) - Hides legend when set to `false`.\n * * `title` (optional, string) - Visible label, shown above the legend.\n * * `actions` (optional, slot) - A slot before the legend that can be used to render custom actions.\n */\n legend?: BaseLegendOptions;\n\n /**\n * Defines options to represent empty, no-match, loading, and error state of the chart, including:\n * * `statusType` (optional, \"finished\" | \"loading\" | \"error\") - Specifies the current status of loading data.\n * * `empty` (optional, ReactNode) - Content displayed when the chart data is empty.\n * * `noMatch` (optional, ReactNode) - Content displayed when there is no data to display due to the built-in filtering.\n * * `loading` (optional, ReactNode) - Content displayed when `statusType=\"loading\"`. If omitted, the default loading state\n * is shown, using `i18n.loadingText` or built-in i18n.\n * * `error` (optional, ReactNode) - Content displayed when `statusType=\"error\"`. If omitted, the default error state\n * is shown, using `i18n.errorText` and `i18n.recoveryText` (when `onRecoveryClick` is provided), or built-in i18n.\n * * `onRecoveryClick` (optional, function) - Called when the user clicks the recovery button that appears when using default error\n * state, and only if `onRecoveryClick` is provided. Use this to enable the user to retry a failed request or provide another option\n * for the user to recover from the error.\n */\n noData?: BaseNoDataOptions;\n\n /**\n * Defines options for filtering in the chart, including:\n * * `seriesFilter` (optional, boolean) - Displays default series filter at the top of the chart.\n * * `additionalFilters` (optional, slot) - A slot for custom chart filters at the top of the chart.\n */\n filter?: BaseFilterOptions;\n}\n\nexport interface BaseLegendOptions {\n enabled?: boolean;\n title?: string;\n actions?: React.ReactNode;\n}\n\nexport interface BaseNoDataOptions {\n statusType?: \"finished\" | \"loading\" | \"error\";\n empty?: React.ReactNode;\n error?: React.ReactNode;\n loading?: React.ReactNode;\n noMatch?: React.ReactNode;\n onRecoveryClick?: NonCancelableEventHandler;\n}\n\nexport interface BaseTooltipDetail {\n key: React.ReactNode;\n value: React.ReactNode;\n}\n\nexport interface BaseI18nStrings {\n loadingText?: string;\n errorText?: string;\n recoveryText?: string;\n seriesFilterLabel?: string;\n seriesFilterPlaceholder?: string;\n seriesFilterSelectedAriaLabel?: string;\n legendAriaLabel?: string;\n detailPopoverDismissAriaLabel?: string;\n chartRoleDescription?: string;\n}\n\nexport interface CoreI18nStrings extends BaseI18nStrings {\n /**\n * ARIA label for the secondary legend when using dual axes charts.\n *\n * **Important**: When using dual axes, you should explicitly provide visible titles or ARIA labels\n * for both the primary and secondary legends to ensure proper accessibility. The primary legend\n * has built-in i18n support through `legendAriaLabel`, but the secondary legend currently requires\n * this property to be explicitly provided.\n */\n secondaryLegendAriaLabel?: string;\n}\n\nexport interface WithCartesianI18nStrings {\n /**\n * An object that contains all of the localized strings required by the component.\n * @i18n\n *\n * Available properties:\n * * `loadingText` (optional, string) - Text, displayed when the chart is loading, i.e. when `noData.statusType` is set to \"loading\".\n * * `errorText` (optional, string) - Text, displayed when the chart is in error state, i.e. when `noData.statusType` is set to \"error\".\n * * `recoveryText` (optional, string) - Text for the recovery button, displayed next to the error text.\n * * `seriesFilterLabel` (optional, string) - Text for the visible label of the default series filter.\n * * `seriesFilterPlaceholder` (optional, string) - Text for the default series filter placeholder.\n * * `seriesFilterSelectedAriaLabel` (optional, string) - ARIA label of the default series filter which is appended to any option that is selected.\n * * `legendAriaLabel` (optional, string) - ARIA label that is associated with the legend in case there is no visible `legend.title` defined.\n * * `detailPopoverDismissAriaLabel` (optional, string) - ARIA label for the details popover dismiss button.\n * * `chartRoleDescription` (optional, string) - Accessible role description of the chart plot area, e.g. \"interactive chart\".\n * * `xAxisRoleDescription` (optional, string) - Accessible role description of the x axis, e.g. \"x axis\".\n * * `yAxisRoleDescription` (optional, string) - Accessible role description of the y axis, e.g. \"y axis\".\n */\n i18nStrings?: CartesianI18nStrings;\n}\n\nexport interface WithPieI18nStrings {\n /**\n * An object that contains all of the localized strings required by the component.\n * @i18n\n *\n * Available properties:\n * * `loadingText` (optional, string) - Text, displayed when the chart is loading, i.e. when `noData.statusType` is set to \"loading\".\n * * `errorText` (optional, string) - Text, displayed when the chart is in error state, i.e. when `noData.statusType` is set to \"error\".\n * * `recoveryText` (optional, string) - Text for the recovery button, displayed next to the error text.\n * * `seriesFilterLabel` (optional, string) - Text for the visible label of the default series filter.\n * * `seriesFilterPlaceholder` (optional, string) - Text for the default series filter placeholder.\n * * `seriesFilterSelectedAriaLabel` (optional, string) - ARIA label of the default series filter which is appended to any option that is selected.\n * * `legendAriaLabel` (optional, string) - ARIA label that is associated with the legend in case there is no visible `legend.title` defined.\n * * `detailPopoverDismissAriaLabel` (optional, string) - ARIA label for the details popover dismiss button.\n * * `chartRoleDescription` (optional, string) - Accessible role description of the chart plot area, e.g. \"interactive chart\".\n * * `segmentRoleDescription` (optional, string) - Accessible role description of the segment.\n */\n i18nStrings?: PieI18nStrings;\n}\n\nexport interface CartesianI18nStrings extends BaseI18nStrings {\n xAxisRoleDescription?: string;\n yAxisRoleDescription?: string;\n}\n\nexport interface PieI18nStrings extends BaseI18nStrings {\n segmentRoleDescription?: string;\n}\n\nexport interface BaseFilterOptions {\n seriesFilter?: boolean;\n additionalFilters?: React.ReactNode;\n}\n\nexport interface BaseTooltipPointFormatted {\n key?: React.ReactNode;\n value?: React.ReactNode;\n description?: React.ReactNode;\n expandable?: boolean;\n subItems?: ReadonlyArray<{ key: React.ReactNode; value: React.ReactNode }>;\n}\n\nexport interface AreaSeriesOptions extends BaseCartesianLineLikeOptions {\n type: \"area\";\n data: readonly PointDataItemType[];\n}\n\nexport interface AreaSplineSeriesOptions extends BaseCartesianLineLikeOptions {\n type: \"areaspline\";\n data: readonly PointDataItemType[];\n}\n\nexport interface ColumnSeriesOptions extends BaseCartesianSeriesOptions {\n type: \"column\";\n data: readonly PointDataItemType[];\n}\n\nexport interface LineSeriesOptions extends BaseCartesianLineLikeOptions {\n type: \"line\";\n data: readonly PointDataItemType[];\n}\n\nexport interface SplineSeriesOptions extends BaseCartesianLineLikeOptions {\n type: \"spline\";\n data: readonly PointDataItemType[];\n}\n\nexport interface ScatterSeriesOptions extends BaseCartesianSeriesOptions {\n type: \"scatter\";\n data: readonly PointDataItemType[];\n marker?: PointMarkerOptions;\n}\n\nexport interface ErrorBarSeriesOptions extends Omit<BaseCartesianSeriesOptions, \"name\"> {\n type: \"errorbar\";\n name?: string;\n data: readonly RangeDataItemOptions[];\n linkedTo: string;\n}\n\nexport interface XThresholdSeriesOptions extends BaseCartesianLineLikeOptions {\n type: \"x-threshold\";\n value: number;\n}\n\nexport interface YThresholdSeriesOptions extends BaseCartesianLineLikeOptions {\n type: \"y-threshold\";\n value: number;\n}\n\nexport interface PieSeriesOptions extends BaseSeriesOptions {\n type: \"pie\";\n data: readonly PieSegmentOptions[];\n}\n\nexport interface DonutSeriesOptions extends BaseSeriesOptions {\n type: \"donut\";\n data: readonly PieSegmentOptions[];\n}\n\nexport interface PieSegmentOptions {\n y: number | null;\n id?: string;\n name: string;\n color?: string;\n}\n\nexport type PointDataItemType = null | number | PointDataItemOptions;\n\nexport interface PointDataItemOptions {\n x?: number;\n y: number | null;\n}\n\nexport interface RangeDataItemOptions {\n x?: number;\n low: number;\n high: number;\n}\n\ninterface BaseSeriesOptions {\n id?: string;\n name: string;\n color?: string;\n}\n\ntype BaseCartesianSeriesOptions = BaseSeriesOptions;\n\ninterface BaseCartesianLineLikeOptions extends BaseCartesianSeriesOptions {\n dashStyle?: Highcharts.DashStyleValue;\n}\n\n// The symbols union matches that of Highcharts.PointMarkerOptionsObject\ninterface PointMarkerOptions {\n symbol?: \"circle\" | \"diamond\" | \"square\" | \"triangle\" | \"triangle-down\";\n}\n\nexport interface CoreCartesianOptions {\n /**\n * When set to `true`, adds a visual emphasis on the zero baseline axis.\n */\n emphasizeBaseline?: boolean;\n /**\n * Controls the placement of the vertical axis title.\n * When set to \"side\", displays the title along the axis line.\n */\n verticalAxisTitlePlacement?: \"top\" | \"side\";\n}\n\nexport interface CoreChartProps\n extends Pick<\n BaseChartOptions,\n | \"highcharts\"\n | \"fallback\"\n | \"fitHeight\"\n | \"chartHeight\"\n | \"chartMinHeight\"\n | \"chartMinWidth\"\n | \"ariaLabel\"\n | \"ariaDescription\"\n | \"filter\"\n | \"noData\"\n >,\n CoreCartesianOptions {\n /**\n * The Highcharts options. Cloudscape injects custom styles and settings, but all can be\n * overridden with explicitly provided options. An exception is event handlers - those are\n * not overridden, but merged with Cloudscape event handlers so that both are getting called.\n */\n options: CoreChartProps.ChartOptions;\n /**\n * The Cloudscape tooltip, that comes with a vertical cursor when used on cartesian series.\n * The tooltip content is only shown when `getContent` property is defined, which is called\n * for each visited { x, y } point.\n */\n tooltip?: CoreChartProps.TooltipOptions;\n /**\n * A custom slot above the chart plot, chart's axis title, and filter.\n */\n header?: CoreChartProps.HeaderOptions;\n /**\n * Prop for passing a custom navigation control component to be rendered with the chart.\n * Use this property to add timeline navigation, range selectors, or other custom navigation elements.\n */\n navigator?: React.ReactNode;\n /**\n * A custom slot below the chart plot and legend.\n */\n footer?: CoreChartProps.FooterOptions;\n /**\n * Chart legend options.\n */\n legend?: CoreChartProps.LegendOptions;\n /**\n * The callback to init the chart's API when it is ready. The API includes the Highcharts chart object, and\n * additional Cloudscape methods.\n */\n callback?: (chart: CoreChartProps.ChartAPI) => void;\n /**\n * This is used to provide a test-utils selector. Do not use this property to provide custom styles.\n */\n className?: string;\n /**\n * IDs of visible series or points.\n */\n visibleItems?: readonly string[];\n /**\n * Called when a legend item is highlighted.\n */\n onLegendItemHighlight?: NonCancelableEventHandler<CoreChartProps.LegendItemHighlightDetail>;\n /**\n * Called when series/points visibility changes due to user interaction with legend or filter.\n */\n onVisibleItemsChange?: NonCancelableEventHandler<CoreChartProps.VisibleItemsChangeDetail>;\n /**\n * Called whenever chart tooltip is rendered to provide content for tooltip's header, body, and (optional) footer.\n */\n getTooltipContent?: CoreChartProps.GetTooltipContent;\n /**\n * Called whenever a legend item is hovered to provide content for legend tooltip's header, body, and (optional) footer.\n * If not provided, no tooltip will be displayed.\n */\n getLegendTooltipContent?: CoreChartProps.GetLegendTooltipContent;\n /**\n * Called whenever chart point or group is highlighted.\n */\n onHighlight?: NonCancelableEventHandler<CoreChartProps.HighlightChangeDetail>;\n /**\n * Called whenever chart point or group loses highlight.\n */\n onClearHighlight?: NonCancelableEventHandler<CoreChartProps.HighlightClearDetail>;\n /**\n * Use Cloudscape keyboard navigation.\n */\n keyboardNavigation?: boolean;\n /**\n * An object that contains all of the localized strings required by the component.\n * @i18n\n */\n i18nStrings?: CartesianI18nStrings & PieI18nStrings & CoreI18nStrings;\n}\n\nexport namespace CoreChartProps {\n // The API methods allow programmatic triggering of chart's behaviors, some of which are not accessible via React state.\n // This enables advanced integration scenarios, such as building a custom legend, or making multiple charts synchronized.\n export interface ChartAPI {\n chart: Highcharts.Chart;\n highcharts: typeof Highcharts;\n highlightItems(itemIds: readonly string[]): void;\n setItemsVisible(itemIds: readonly string[]): void;\n highlightChartPoint(point: Highcharts.Point): void;\n highlightChartGroup(group: readonly Highcharts.Point[]): void;\n clearChartHighlight(): void;\n }\n\n // The extended version of Highcharts.Options. The axes types are extended with Cloudscape value formatter.\n // We use a custom formatter because we cannot use the built-in Highcharts formatter for our tooltip.\n export type ChartOptions = Omit<Highcharts.Options, \"xAxis\" | \"yAxis\"> & {\n xAxis?: XAxisOptions | XAxisOptions[];\n yAxis?: YAxisOptions | YAxisOptions[];\n };\n export type XAxisOptions = Highcharts.XAxisOptions & { valueFormatter?: (value: null | number) => string };\n export type YAxisOptions = Highcharts.YAxisOptions & { valueFormatter?: (value: null | number) => string };\n\n export interface HeaderOptions {\n content: React.ReactNode;\n }\n export interface FooterOptions {\n content: React.ReactNode;\n }\n\n export interface LegendOptions extends BaseLegendOptions {\n bottomMaxHeight?: number;\n position?: \"bottom\" | \"side\";\n /**\n * This property only applies when there are secondary items.\n */\n secondaryLegendTitle?: string;\n /**\n * This property only applies when there are secondary items.\n */\n secondaryLegendActions?: React.ReactNode;\n /**\n * This property only applies when there are no secondary items and `position=\"bottom\"`.\n */\n horizontalAlignment?: LegendOptionsHorizontalAlignment;\n }\n\n export type LegendOptionsHorizontalAlignment = \"start\" | \"center\";\n\n export type LegendItem = InternalComponentTypes.LegendItem;\n export type LegendTooltipContent = InternalComponentTypes.LegendTooltipContent;\n export type GetLegendTooltipContent = InternalComponentTypes.GetLegendTooltipContent;\n export type GetLegendTooltipContentProps = InternalComponentTypes.GetLegendTooltipContentProps;\n\n export interface TooltipOptions {\n enabled?: boolean;\n placement?: \"middle\" | \"outside\" | \"target\";\n size?: \"small\" | \"medium\" | \"large\";\n debounce?: number | boolean;\n seriesSorting?: \"as-added\" | \"by-value-desc\";\n }\n\n export type GetTooltipContent = (props: GetTooltipContentProps) => TooltipContentRenderer;\n export interface GetTooltipContentProps {\n point: null | Highcharts.Point;\n group: readonly Highcharts.Point[];\n }\n export interface TooltipContentRenderer {\n point?: (props: TooltipPointProps) => TooltipPointFormatted;\n details?: (props: TooltipDetailsProps) => readonly TooltipDetail[];\n header?: (props: TooltipSlotProps) => React.ReactNode;\n body?: (props: TooltipSlotProps) => React.ReactNode;\n footer?: (props: TooltipSlotProps) => React.ReactNode;\n }\n export type TooltipPointFormatted = BaseTooltipPointFormatted;\n export interface TooltipContentItem {\n point: Highcharts.Point;\n errorRanges: Highcharts.Point[];\n }\n export interface TooltipPointProps {\n item: TooltipContentItem;\n hideTooltip: () => void;\n }\n export interface TooltipSlotProps {\n x: number;\n items: TooltipContentItem[];\n hideTooltip: () => void;\n }\n\n export interface TooltipDetailsProps {\n point: Highcharts.Point;\n hideTooltip: () => void;\n }\n\n export type TooltipDetail = BaseTooltipDetail;\n\n export interface LegendItemHighlightDetail {\n item: LegendItem;\n }\n export interface VisibleItemsChangeDetail {\n items: readonly LegendItem[];\n isApiCall: boolean;\n }\n export interface HighlightChangeDetail {\n point: null | Highcharts.Point;\n group: readonly Highcharts.Point[];\n isApiCall: boolean;\n }\n export interface HighlightClearDetail {\n isApiCall: boolean;\n }\n\n export type I18nStrings = CartesianI18nStrings & PieI18nStrings;\n}\n\nexport interface CoreLegendProps {\n items: readonly CoreLegendProps.Item[];\n title?: string;\n ariaLabel?: string;\n actions?: React.ReactNode;\n alignment?: \"horizontal\" | \"vertical\";\n horizontalAlignment?: CoreChartProps.LegendOptionsHorizontalAlignment;\n onClearHighlight?: NonCancelableEventHandler;\n onItemHighlight?: NonCancelableEventHandler<CoreLegendProps.ItemHighlightDetail>;\n onVisibleItemsChange?: NonCancelableEventHandler<CoreLegendProps.VisibleItemsChangeDetail>;\n getLegendTooltipContent?: CoreLegendProps.GetTooltipContent;\n}\n\nexport namespace CoreLegendProps {\n export type Item = InternalComponentTypes.LegendItem;\n export type GetTooltipContent = InternalComponentTypes.GetLegendTooltipContent;\n export interface ItemHighlightDetail {\n item: Item;\n }\n export interface VisibleItemsChangeDetail {\n items: readonly string[];\n }\n}\n\n// Utility types\n\nexport interface Rect {\n x: number;\n y: number;\n height: number;\n width: number;\n}\n"]}
@@ -1,22 +1,22 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "focus-outline": "awsui_focus-outline_1no4y_1pjth_15",
5
- "marker": "awsui_marker_1no4y_1pjth_27",
6
- "value": "awsui_value_1no4y_1pjth_65",
7
- "expandable": "awsui_expandable_1no4y_1pjth_69",
8
- "list-item": "awsui_list-item_1no4y_1pjth_73",
9
- "inner-list-item": "awsui_inner-list-item_1no4y_1pjth_74",
10
- "key-value-pair": "awsui_key-value-pair_1no4y_1pjth_80",
11
- "expandable-section": "awsui_expandable-section_1no4y_1pjth_81",
12
- "key": "awsui_key_1no4y_1pjth_80",
13
- "sub-items": "awsui_sub-items_1no4y_1pjth_96",
14
- "list": "awsui_list_1no4y_1pjth_73",
15
- "dimmed": "awsui_dimmed_1no4y_1pjth_115",
16
- "compact": "awsui_compact_1no4y_1pjth_119",
17
- "with-sub-items": "awsui_with-sub-items_1no4y_1pjth_124",
18
- "description": "awsui_description_1no4y_1pjth_129",
19
- "full-width": "awsui_full-width_1no4y_1pjth_138",
20
- "highlight-indicator": "awsui_highlight-indicator_1no4y_1pjth_142"
4
+ "focus-outline": "awsui_focus-outline_1no4y_g0z0r_15",
5
+ "marker": "awsui_marker_1no4y_g0z0r_27",
6
+ "value": "awsui_value_1no4y_g0z0r_65",
7
+ "expandable": "awsui_expandable_1no4y_g0z0r_69",
8
+ "list-item": "awsui_list-item_1no4y_g0z0r_73",
9
+ "inner-list-item": "awsui_inner-list-item_1no4y_g0z0r_74",
10
+ "key-value-pair": "awsui_key-value-pair_1no4y_g0z0r_80",
11
+ "expandable-section": "awsui_expandable-section_1no4y_g0z0r_81",
12
+ "key": "awsui_key_1no4y_g0z0r_80",
13
+ "sub-items": "awsui_sub-items_1no4y_g0z0r_96",
14
+ "list": "awsui_list_1no4y_g0z0r_73",
15
+ "dimmed": "awsui_dimmed_1no4y_g0z0r_115",
16
+ "compact": "awsui_compact_1no4y_g0z0r_119",
17
+ "with-sub-items": "awsui_with-sub-items_1no4y_g0z0r_124",
18
+ "description": "awsui_description_1no4y_g0z0r_129",
19
+ "full-width": "awsui_full-width_1no4y_g0z0r_138",
20
+ "highlight-indicator": "awsui_highlight-indicator_1no4y_g0z0r_142"
21
21
  };
22
22
 
@@ -12,7 +12,7 @@
12
12
  */
13
13
  /* stylelint-disable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
14
14
  /* stylelint-enable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
15
- body[data-awsui-focus-visible=true] .awsui_focus-outline_1no4y_1pjth_15:not(#\9) {
15
+ body[data-awsui-focus-visible=true] .awsui_focus-outline_1no4y_g0z0r_15:not(#\9) {
16
16
  stroke: var(--color-border-item-focused-uk47pl, #006ce0);
17
17
  }
18
18
 
@@ -24,7 +24,7 @@ body[data-awsui-focus-visible=true] .awsui_focus-outline_1no4y_1pjth_15:not(#\9)
24
24
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
25
25
  SPDX-License-Identifier: Apache-2.0
26
26
  */
27
- .awsui_marker_1no4y_1pjth_27:not(#\9) {
27
+ .awsui_marker_1no4y_g0z0r_27:not(#\9) {
28
28
  border-collapse: separate;
29
29
  border-spacing: 0;
30
30
  box-sizing: border-box;
@@ -62,48 +62,48 @@ body[data-awsui-focus-visible=true] .awsui_focus-outline_1no4y_1pjth_15:not(#\9)
62
62
  cursor: inherit;
63
63
  }
64
64
 
65
- .awsui_value_1no4y_1pjth_65:not(#\9) {
65
+ .awsui_value_1no4y_g0z0r_65:not(#\9) {
66
66
  text-align: end;
67
67
  margin-inline-start: var(--space-static-xxl-ifa9j8, 32px);
68
68
  }
69
- .awsui_value_1no4y_1pjth_65.awsui_expandable_1no4y_1pjth_69:not(#\9) {
69
+ .awsui_value_1no4y_g0z0r_65.awsui_expandable_1no4y_g0z0r_69:not(#\9) {
70
70
  font-weight: var(--font-weight-heading-s-lcx0ai, 700);
71
71
  }
72
72
 
73
- .awsui_list-item_1no4y_1pjth_73:not(#\9),
74
- .awsui_inner-list-item_1no4y_1pjth_74:not(#\9) {
73
+ .awsui_list-item_1no4y_g0z0r_73:not(#\9),
74
+ .awsui_inner-list-item_1no4y_g0z0r_74:not(#\9) {
75
75
  list-style: none;
76
76
  position: relative;
77
77
  }
78
78
 
79
- .awsui_inner-list-item_1no4y_1pjth_74:not(#\9),
80
- .awsui_list-item_1no4y_1pjth_73 > .awsui_key-value-pair_1no4y_1pjth_80:not(#\9),
81
- .awsui_list-item_1no4y_1pjth_73 > .awsui_expandable-section_1no4y_1pjth_81:not(#\9) {
79
+ .awsui_inner-list-item_1no4y_g0z0r_74:not(#\9),
80
+ .awsui_list-item_1no4y_g0z0r_73 > .awsui_key-value-pair_1no4y_g0z0r_80:not(#\9),
81
+ .awsui_list-item_1no4y_g0z0r_73 > .awsui_expandable-section_1no4y_g0z0r_81:not(#\9) {
82
82
  display: flex;
83
83
  flex-direction: row;
84
84
  justify-content: space-between;
85
85
  inline-size: 100%;
86
86
  }
87
- .awsui_inner-list-item_1no4y_1pjth_74 > .awsui_key_1no4y_1pjth_80:not(#\9),
88
- .awsui_list-item_1no4y_1pjth_73 > .awsui_key-value-pair_1no4y_1pjth_80 > .awsui_key_1no4y_1pjth_80:not(#\9),
89
- .awsui_list-item_1no4y_1pjth_73 > .awsui_expandable-section_1no4y_1pjth_81 > .awsui_key_1no4y_1pjth_80:not(#\9) {
87
+ .awsui_inner-list-item_1no4y_g0z0r_74 > .awsui_key_1no4y_g0z0r_80:not(#\9),
88
+ .awsui_list-item_1no4y_g0z0r_73 > .awsui_key-value-pair_1no4y_g0z0r_80 > .awsui_key_1no4y_g0z0r_80:not(#\9),
89
+ .awsui_list-item_1no4y_g0z0r_73 > .awsui_expandable-section_1no4y_g0z0r_81 > .awsui_key_1no4y_g0z0r_80:not(#\9) {
90
90
  min-inline-size: 0;
91
91
  word-break: break-word;
92
92
  display: inline-flex;
93
93
  color: var(--color-text-group-label-a2qc05, #424650);
94
94
  }
95
95
 
96
- .awsui_sub-items_1no4y_1pjth_96:not(#\9):not(.awsui_expandable_1no4y_1pjth_69) {
96
+ .awsui_sub-items_1no4y_g0z0r_96:not(#\9):not(.awsui_expandable_1no4y_g0z0r_69) {
97
97
  padding-inline-start: calc(16px + var(--space-static-xxs-ns94dp, 4px));
98
98
  }
99
- .awsui_sub-items_1no4y_1pjth_96.awsui_expandable_1no4y_1pjth_69:not(#\9) {
99
+ .awsui_sub-items_1no4y_g0z0r_96.awsui_expandable_1no4y_g0z0r_69:not(#\9) {
100
100
  padding-inline-start: 0;
101
101
  }
102
- .awsui_sub-items_1no4y_1pjth_96.awsui_expandable_1no4y_1pjth_69 > .awsui_inner-list-item_1no4y_1pjth_74 > .awsui_value_1no4y_1pjth_65:not(#\9) {
102
+ .awsui_sub-items_1no4y_g0z0r_96.awsui_expandable_1no4y_g0z0r_69 > .awsui_inner-list-item_1no4y_g0z0r_74 > .awsui_value_1no4y_g0z0r_65:not(#\9) {
103
103
  white-space: nowrap;
104
104
  }
105
105
 
106
- .awsui_list_1no4y_1pjth_73:not(#\9) {
106
+ .awsui_list_1no4y_g0z0r_73:not(#\9) {
107
107
  display: flex;
108
108
  margin-block: 0;
109
109
  margin-inline: 0;
@@ -112,39 +112,39 @@ body[data-awsui-focus-visible=true] .awsui_focus-outline_1no4y_1pjth_15:not(#\9)
112
112
  list-style: none;
113
113
  flex-direction: column;
114
114
  }
115
- .awsui_list_1no4y_1pjth_73 > .awsui_list-item_1no4y_1pjth_73.awsui_dimmed_1no4y_1pjth_115:not(#\9) {
115
+ .awsui_list_1no4y_g0z0r_73 > .awsui_list-item_1no4y_g0z0r_73.awsui_dimmed_1no4y_g0z0r_115:not(#\9) {
116
116
  opacity: 0.35;
117
117
  }
118
118
 
119
- .awsui_list_1no4y_1pjth_73:not(#\9):not(.awsui_compact_1no4y_1pjth_119) > .awsui_list-item_1no4y_1pjth_73:not(:first-child),
120
- .awsui_inner-list-item_1no4y_1pjth_74:not(#\9) {
119
+ .awsui_list_1no4y_g0z0r_73:not(#\9):not(.awsui_compact_1no4y_g0z0r_119) > .awsui_list-item_1no4y_g0z0r_73:not(:first-child),
120
+ .awsui_inner-list-item_1no4y_g0z0r_74:not(#\9) {
121
121
  margin-block-start: var(--space-scaled-xxs-pfm1nx, 4px);
122
122
  }
123
123
 
124
- .awsui_list-item_1no4y_1pjth_73.awsui_with-sub-items_1no4y_1pjth_124:not(#\9):not(.awsui_expandable_1no4y_1pjth_69) > .awsui_key-value-pair_1no4y_1pjth_80 > .awsui_key_1no4y_1pjth_80,
125
- .awsui_list-item_1no4y_1pjth_73.awsui_with-sub-items_1no4y_1pjth_124:not(#\9):not(.awsui_expandable_1no4y_1pjth_69) > .awsui_key-value-pair_1no4y_1pjth_80 > .awsui_value_1no4y_1pjth_65 {
124
+ .awsui_list-item_1no4y_g0z0r_73.awsui_with-sub-items_1no4y_g0z0r_124:not(#\9):not(.awsui_expandable_1no4y_g0z0r_69) > .awsui_key-value-pair_1no4y_g0z0r_80 > .awsui_key_1no4y_g0z0r_80,
125
+ .awsui_list-item_1no4y_g0z0r_73.awsui_with-sub-items_1no4y_g0z0r_124:not(#\9):not(.awsui_expandable_1no4y_g0z0r_69) > .awsui_key-value-pair_1no4y_g0z0r_80 > .awsui_value_1no4y_g0z0r_65 {
126
126
  font-weight: var(--font-weight-heading-s-lcx0ai, 700);
127
127
  }
128
128
 
129
- .awsui_list-item_1no4y_1pjth_73 .awsui_description_1no4y_1pjth_129:not(#\9) {
130
- color: var(--color-text-body-secondary-bcbgoi, #424650);
129
+ .awsui_list-item_1no4y_g0z0r_73 .awsui_description_1no4y_g0z0r_129:not(#\9) {
130
+ color: var(--color-text-body-secondary-yna5sb, #424650);
131
131
  font-size: var(--font-size-body-s-smc8cv, 12px);
132
132
  }
133
133
 
134
- .awsui_list-item_1no4y_1pjth_73.awsui_with-sub-items_1no4y_1pjth_124 .awsui_description_1no4y_1pjth_129:not(#\9) {
134
+ .awsui_list-item_1no4y_g0z0r_73.awsui_with-sub-items_1no4y_g0z0r_124 .awsui_description_1no4y_g0z0r_129:not(#\9) {
135
135
  margin-top: var(--space-scaled-xxs-pfm1nx, 4px);
136
136
  }
137
137
 
138
- .awsui_full-width_1no4y_1pjth_138:not(#\9) {
138
+ .awsui_full-width_1no4y_g0z0r_138:not(#\9) {
139
139
  inline-size: 100%;
140
140
  }
141
141
 
142
- .awsui_highlight-indicator_1no4y_1pjth_142:not(#\9) {
142
+ .awsui_highlight-indicator_1no4y_g0z0r_142:not(#\9) {
143
143
  position: absolute;
144
144
  top: 3px;
145
145
  left: -6px;
146
146
  inline-size: 3px;
147
147
  block-size: 14px;
148
148
  border-radius: 4px;
149
- background: var(--color-text-body-secondary-bcbgoi, #424650);
149
+ background: var(--color-text-body-secondary-yna5sb, #424650);
150
150
  }
@@ -2,22 +2,22 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "focus-outline": "awsui_focus-outline_1no4y_1pjth_15",
6
- "marker": "awsui_marker_1no4y_1pjth_27",
7
- "value": "awsui_value_1no4y_1pjth_65",
8
- "expandable": "awsui_expandable_1no4y_1pjth_69",
9
- "list-item": "awsui_list-item_1no4y_1pjth_73",
10
- "inner-list-item": "awsui_inner-list-item_1no4y_1pjth_74",
11
- "key-value-pair": "awsui_key-value-pair_1no4y_1pjth_80",
12
- "expandable-section": "awsui_expandable-section_1no4y_1pjth_81",
13
- "key": "awsui_key_1no4y_1pjth_80",
14
- "sub-items": "awsui_sub-items_1no4y_1pjth_96",
15
- "list": "awsui_list_1no4y_1pjth_73",
16
- "dimmed": "awsui_dimmed_1no4y_1pjth_115",
17
- "compact": "awsui_compact_1no4y_1pjth_119",
18
- "with-sub-items": "awsui_with-sub-items_1no4y_1pjth_124",
19
- "description": "awsui_description_1no4y_1pjth_129",
20
- "full-width": "awsui_full-width_1no4y_1pjth_138",
21
- "highlight-indicator": "awsui_highlight-indicator_1no4y_1pjth_142"
5
+ "focus-outline": "awsui_focus-outline_1no4y_g0z0r_15",
6
+ "marker": "awsui_marker_1no4y_g0z0r_27",
7
+ "value": "awsui_value_1no4y_g0z0r_65",
8
+ "expandable": "awsui_expandable_1no4y_g0z0r_69",
9
+ "list-item": "awsui_list-item_1no4y_g0z0r_73",
10
+ "inner-list-item": "awsui_inner-list-item_1no4y_g0z0r_74",
11
+ "key-value-pair": "awsui_key-value-pair_1no4y_g0z0r_80",
12
+ "expandable-section": "awsui_expandable-section_1no4y_g0z0r_81",
13
+ "key": "awsui_key_1no4y_g0z0r_80",
14
+ "sub-items": "awsui_sub-items_1no4y_g0z0r_96",
15
+ "list": "awsui_list_1no4y_g0z0r_73",
16
+ "dimmed": "awsui_dimmed_1no4y_g0z0r_115",
17
+ "compact": "awsui_compact_1no4y_g0z0r_119",
18
+ "with-sub-items": "awsui_with-sub-items_1no4y_g0z0r_124",
19
+ "description": "awsui_description_1no4y_g0z0r_129",
20
+ "full-width": "awsui_full-width_1no4y_g0z0r_138",
21
+ "highlight-indicator": "awsui_highlight-indicator_1no4y_g0z0r_142"
22
22
  };
23
23
 
@@ -1,5 +1,5 @@
1
1
  export var PACKAGE_SOURCE = "chart-components";
2
- export var PACKAGE_VERSION = "1.0.0 (1e9c64fd)";
2
+ export var PACKAGE_VERSION = "1.0.0 (2e81e972)";
3
3
  export var THEME = "open-source-visual-refresh";
4
4
  export var ALWAYS_VISUAL_REFRESH = true;
5
5
  export var SYSTEM = "console";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "PACKAGE_SOURCE": "chart-components",
3
- "PACKAGE_VERSION": "1.0.0 (1e9c64fd)",
3
+ "PACKAGE_VERSION": "1.0.0 (2e81e972)",
4
4
  "THEME": "open-source-visual-refresh",
5
5
  "ALWAYS_VISUAL_REFRESH": true,
6
6
  "SYSTEM": "console"
@@ -444,18 +444,18 @@ export var colorStrokeCodeEditorGutterActiveLineDefault = "var(--color-stroke-co
444
444
  export var colorStrokeCodeEditorGutterActiveLineHover = "var(--color-stroke-code-editor-gutter-active-line-hover-vqrb6s, #f9f9fa)";
445
445
  export var colorTextAccent = "var(--color-text-accent-n1kmht, #006ce0)";
446
446
  export var colorTextBodyDefault = "var(--color-text-body-default-vvtq8u, #0f141a)";
447
- export var colorTextBodySecondary = "var(--color-text-body-secondary-bcbgoi, #424650)";
447
+ export var colorTextBodySecondary = "var(--color-text-body-secondary-yna5sb, #424650)";
448
448
  export var colorTextBreadcrumbCurrent = "var(--color-text-breadcrumb-current-2mqnkk, #656871)";
449
449
  export var colorTextBreadcrumbIcon = "var(--color-text-breadcrumb-icon-9j48ot, #8c8c94)";
450
- export var colorTextButtonInlineIconDefault = "var(--color-text-button-inline-icon-default-f8xgpk, #006ce0)";
450
+ export var colorTextButtonInlineIconDefault = "var(--color-text-button-inline-icon-default-sm4ql6, #006ce0)";
451
451
  export var colorTextButtonInlineIconDisabled = "var(--color-text-button-inline-icon-disabled-82hho0, #b4b4bb)";
452
- export var colorTextButtonInlineIconHover = "var(--color-text-button-inline-icon-hover-c08r6g, #002b66)";
452
+ export var colorTextButtonInlineIconHover = "var(--color-text-button-inline-icon-hover-rbyzfc, #002b66)";
453
453
  export var colorTextButtonNormalActive = "var(--color-text-button-normal-active-vihsxh, #002b66)";
454
454
  export var colorTextToggleButtonNormalPressed = "var(--color-text-toggle-button-normal-pressed-wnx2zl, #002b66)";
455
455
  export var colorTextButtonNormalDefault = "var(--color-text-button-normal-default-nzalii, #006ce0)";
456
456
  export var colorTextButtonNormalHover = "var(--color-text-button-normal-hover-gusgyv, #002b66)";
457
- export var colorTextLinkButtonNormalDefault = "var(--color-text-link-button-normal-default-5w3m67, #006ce0)";
458
- export var colorTextLinkButtonNormalHover = "var(--color-text-link-button-normal-hover-4awpjm, #002b66)";
457
+ export var colorTextLinkButtonNormalDefault = "var(--color-text-link-button-normal-default-srprth, #006ce0)";
458
+ export var colorTextLinkButtonNormalHover = "var(--color-text-link-button-normal-hover-jrnyw3, #002b66)";
459
459
  export var colorTextLinkButtonNormalActive = "var(--color-text-link-button-normal-active-js9ryu, #002b66)";
460
460
  export var colorTextButtonPrimaryActive = "var(--color-text-button-primary-active-refmba, #ffffff)";
461
461
  export var colorTextButtonPrimaryDefault = "var(--color-text-button-primary-default-mwl31m, #ffffff)";
@@ -507,13 +507,13 @@ export var colorTextToggleButtonIconPressed = "var(--color-text-toggle-button-ic
507
507
  export var colorTextInteractiveInvertedDefault = "var(--color-text-interactive-inverted-default-xlc0d5, #dedee3)";
508
508
  export var colorTextInteractiveInvertedHover = "var(--color-text-interactive-inverted-hover-65rnp7, #f9f9fa)";
509
509
  export var colorTextInverted = "var(--color-text-inverted-4v4dmq, #ffffff)";
510
- export var colorTextLabel = "var(--color-text-label-8248dg, #0f141a)";
510
+ export var colorTextLabel = "var(--color-text-label-28gfmc, #0f141a)";
511
511
  export var colorTextLayoutToggle = "var(--color-text-layout-toggle-1a15s3, #ffffff)";
512
512
  export var colorTextLayoutToggleActive = "var(--color-text-layout-toggle-active-ifu7qp, #ffffff)";
513
513
  export var colorTextLayoutToggleHover = "var(--color-text-layout-toggle-hover-9jwdce, #006ce0)";
514
514
  export var colorTextLayoutToggleSelected = "var(--color-text-layout-toggle-selected-xpximc, #ffffff)";
515
- export var colorTextLinkDefault = "var(--color-text-link-default-1dmm7z, #006ce0)";
516
- export var colorTextLinkHover = "var(--color-text-link-hover-sq1gxg, #002b66)";
515
+ export var colorTextLinkDefault = "var(--color-text-link-default-hude44, #006ce0)";
516
+ export var colorTextLinkHover = "var(--color-text-link-hover-2hfec2, #002b66)";
517
517
  export var colorTextLinkInvertedHover = "var(--color-text-link-inverted-hover-ocd3u3, #ffffff)";
518
518
  export var colorTextLinkButtonUnderline = "var(--color-text-link-button-underline-z4wjnv, transparent)";
519
519
  export var colorTextLinkButtonUnderlineHover = "var(--color-text-link-button-underline-hover-cn3mqh, transparent)";
@@ -6631,8 +6631,8 @@ module.exports.preset = {
6631
6631
  "dark": "{colorNeutral100}"
6632
6632
  },
6633
6633
  "colorTextBodySecondary": {
6634
- "light": "{colorNeutral650}",
6635
- "dark": "{colorNeutral350}"
6634
+ "light": "{colorNeutral100}",
6635
+ "dark": "{colorNeutral100}"
6636
6636
  },
6637
6637
  "colorTextBreadcrumbCurrent": {
6638
6638
  "light": "{colorNeutral600}",
@@ -6883,8 +6883,8 @@ module.exports.preset = {
6883
6883
  "dark": "{colorNeutral950}"
6884
6884
  },
6885
6885
  "colorTextLabel": {
6886
- "light": "{colorTextFormLabel}",
6887
- "dark": "{colorTextFormLabel}"
6886
+ "light": "{colorNeutral100}",
6887
+ "dark": "{colorNeutral100}"
6888
6888
  },
6889
6889
  "colorTextLayoutToggle": {
6890
6890
  "light": "{colorWhite}",
@@ -6903,12 +6903,12 @@ module.exports.preset = {
6903
6903
  "dark": "{colorNeutral950}"
6904
6904
  },
6905
6905
  "colorTextLinkDefault": {
6906
- "light": "{colorPrimary600}",
6907
- "dark": "{colorPrimary400}"
6906
+ "light": "{colorNeutral100}",
6907
+ "dark": "{colorNeutral100}"
6908
6908
  },
6909
6909
  "colorTextLinkHover": {
6910
- "light": "{colorPrimary900}",
6911
- "dark": "{colorPrimary300}"
6910
+ "light": "{colorWhite}",
6911
+ "dark": "{colorWhite}"
6912
6912
  },
6913
6913
  "colorTextLinkInvertedHover": {
6914
6914
  "light": "{colorWhite}",
@@ -7745,8 +7745,8 @@ module.exports.preset = {
7745
7745
  "dark": "{colorTextNotificationYellow}"
7746
7746
  },
7747
7747
  "colorTextBodySecondary": {
7748
- "light": "{colorNeutral650}",
7749
- "dark": "{colorNeutral350}"
7748
+ "light": "{colorTextNotificationYellow}",
7749
+ "dark": "{colorTextNotificationYellow}"
7750
7750
  },
7751
7751
  "colorTextBreadcrumbCurrent": {
7752
7752
  "light": "{colorNeutral600}",
@@ -7997,8 +7997,8 @@ module.exports.preset = {
7997
7997
  "dark": "{colorNeutral950}"
7998
7998
  },
7999
7999
  "colorTextLabel": {
8000
- "light": "{colorTextFormLabel}",
8001
- "dark": "{colorTextFormLabel}"
8000
+ "light": "{colorTextNotificationYellow}",
8001
+ "dark": "{colorTextNotificationYellow}"
8002
8002
  },
8003
8003
  "colorTextLayoutToggle": {
8004
8004
  "light": "{colorWhite}",
@@ -8017,12 +8017,12 @@ module.exports.preset = {
8017
8017
  "dark": "{colorNeutral950}"
8018
8018
  },
8019
8019
  "colorTextLinkDefault": {
8020
- "light": "{colorPrimary600}",
8021
- "dark": "{colorPrimary400}"
8020
+ "light": "{colorTextNotificationYellow}",
8021
+ "dark": "{colorTextNotificationYellow}"
8022
8022
  },
8023
8023
  "colorTextLinkHover": {
8024
- "light": "{colorPrimary900}",
8025
- "dark": "{colorPrimary300}"
8024
+ "light": "{colorTextNotificationYellow}",
8025
+ "dark": "{colorTextNotificationYellow}"
8026
8026
  },
8027
8027
  "colorTextLinkInvertedHover": {
8028
8028
  "light": "{colorTextNotificationYellow}",
@@ -13269,18 +13269,18 @@ module.exports.preset = {
13269
13269
  "colorStrokeCodeEditorGutterActiveLineHover": "--color-stroke-code-editor-gutter-active-line-hover-vqrb6s",
13270
13270
  "colorTextAccent": "--color-text-accent-n1kmht",
13271
13271
  "colorTextBodyDefault": "--color-text-body-default-vvtq8u",
13272
- "colorTextBodySecondary": "--color-text-body-secondary-bcbgoi",
13272
+ "colorTextBodySecondary": "--color-text-body-secondary-yna5sb",
13273
13273
  "colorTextBreadcrumbCurrent": "--color-text-breadcrumb-current-2mqnkk",
13274
13274
  "colorTextBreadcrumbIcon": "--color-text-breadcrumb-icon-9j48ot",
13275
- "colorTextButtonInlineIconDefault": "--color-text-button-inline-icon-default-f8xgpk",
13275
+ "colorTextButtonInlineIconDefault": "--color-text-button-inline-icon-default-sm4ql6",
13276
13276
  "colorTextButtonInlineIconDisabled": "--color-text-button-inline-icon-disabled-82hho0",
13277
- "colorTextButtonInlineIconHover": "--color-text-button-inline-icon-hover-c08r6g",
13277
+ "colorTextButtonInlineIconHover": "--color-text-button-inline-icon-hover-rbyzfc",
13278
13278
  "colorTextButtonNormalActive": "--color-text-button-normal-active-vihsxh",
13279
13279
  "colorTextToggleButtonNormalPressed": "--color-text-toggle-button-normal-pressed-wnx2zl",
13280
13280
  "colorTextButtonNormalDefault": "--color-text-button-normal-default-nzalii",
13281
13281
  "colorTextButtonNormalHover": "--color-text-button-normal-hover-gusgyv",
13282
- "colorTextLinkButtonNormalDefault": "--color-text-link-button-normal-default-5w3m67",
13283
- "colorTextLinkButtonNormalHover": "--color-text-link-button-normal-hover-4awpjm",
13282
+ "colorTextLinkButtonNormalDefault": "--color-text-link-button-normal-default-srprth",
13283
+ "colorTextLinkButtonNormalHover": "--color-text-link-button-normal-hover-jrnyw3",
13284
13284
  "colorTextLinkButtonNormalActive": "--color-text-link-button-normal-active-js9ryu",
13285
13285
  "colorTextButtonPrimaryActive": "--color-text-button-primary-active-refmba",
13286
13286
  "colorTextButtonPrimaryDefault": "--color-text-button-primary-default-mwl31m",
@@ -13332,13 +13332,13 @@ module.exports.preset = {
13332
13332
  "colorTextInteractiveInvertedDefault": "--color-text-interactive-inverted-default-xlc0d5",
13333
13333
  "colorTextInteractiveInvertedHover": "--color-text-interactive-inverted-hover-65rnp7",
13334
13334
  "colorTextInverted": "--color-text-inverted-4v4dmq",
13335
- "colorTextLabel": "--color-text-label-8248dg",
13335
+ "colorTextLabel": "--color-text-label-28gfmc",
13336
13336
  "colorTextLayoutToggle": "--color-text-layout-toggle-1a15s3",
13337
13337
  "colorTextLayoutToggleActive": "--color-text-layout-toggle-active-ifu7qp",
13338
13338
  "colorTextLayoutToggleHover": "--color-text-layout-toggle-hover-9jwdce",
13339
13339
  "colorTextLayoutToggleSelected": "--color-text-layout-toggle-selected-xpximc",
13340
- "colorTextLinkDefault": "--color-text-link-default-1dmm7z",
13341
- "colorTextLinkHover": "--color-text-link-hover-sq1gxg",
13340
+ "colorTextLinkDefault": "--color-text-link-default-hude44",
13341
+ "colorTextLinkHover": "--color-text-link-hover-2hfec2",
13342
13342
  "colorTextLinkInvertedHover": "--color-text-link-inverted-hover-ocd3u3",
13343
13343
  "colorTextLinkButtonUnderline": "--color-text-link-button-underline-z4wjnv",
13344
13344
  "colorTextLinkButtonUnderlineHover": "--color-text-link-button-underline-hover-cn3mqh",
@@ -6631,8 +6631,8 @@ export var preset = {
6631
6631
  "dark": "{colorNeutral100}"
6632
6632
  },
6633
6633
  "colorTextBodySecondary": {
6634
- "light": "{colorNeutral650}",
6635
- "dark": "{colorNeutral350}"
6634
+ "light": "{colorNeutral100}",
6635
+ "dark": "{colorNeutral100}"
6636
6636
  },
6637
6637
  "colorTextBreadcrumbCurrent": {
6638
6638
  "light": "{colorNeutral600}",
@@ -6883,8 +6883,8 @@ export var preset = {
6883
6883
  "dark": "{colorNeutral950}"
6884
6884
  },
6885
6885
  "colorTextLabel": {
6886
- "light": "{colorTextFormLabel}",
6887
- "dark": "{colorTextFormLabel}"
6886
+ "light": "{colorNeutral100}",
6887
+ "dark": "{colorNeutral100}"
6888
6888
  },
6889
6889
  "colorTextLayoutToggle": {
6890
6890
  "light": "{colorWhite}",
@@ -6903,12 +6903,12 @@ export var preset = {
6903
6903
  "dark": "{colorNeutral950}"
6904
6904
  },
6905
6905
  "colorTextLinkDefault": {
6906
- "light": "{colorPrimary600}",
6907
- "dark": "{colorPrimary400}"
6906
+ "light": "{colorNeutral100}",
6907
+ "dark": "{colorNeutral100}"
6908
6908
  },
6909
6909
  "colorTextLinkHover": {
6910
- "light": "{colorPrimary900}",
6911
- "dark": "{colorPrimary300}"
6910
+ "light": "{colorWhite}",
6911
+ "dark": "{colorWhite}"
6912
6912
  },
6913
6913
  "colorTextLinkInvertedHover": {
6914
6914
  "light": "{colorWhite}",
@@ -7745,8 +7745,8 @@ export var preset = {
7745
7745
  "dark": "{colorTextNotificationYellow}"
7746
7746
  },
7747
7747
  "colorTextBodySecondary": {
7748
- "light": "{colorNeutral650}",
7749
- "dark": "{colorNeutral350}"
7748
+ "light": "{colorTextNotificationYellow}",
7749
+ "dark": "{colorTextNotificationYellow}"
7750
7750
  },
7751
7751
  "colorTextBreadcrumbCurrent": {
7752
7752
  "light": "{colorNeutral600}",
@@ -7997,8 +7997,8 @@ export var preset = {
7997
7997
  "dark": "{colorNeutral950}"
7998
7998
  },
7999
7999
  "colorTextLabel": {
8000
- "light": "{colorTextFormLabel}",
8001
- "dark": "{colorTextFormLabel}"
8000
+ "light": "{colorTextNotificationYellow}",
8001
+ "dark": "{colorTextNotificationYellow}"
8002
8002
  },
8003
8003
  "colorTextLayoutToggle": {
8004
8004
  "light": "{colorWhite}",
@@ -8017,12 +8017,12 @@ export var preset = {
8017
8017
  "dark": "{colorNeutral950}"
8018
8018
  },
8019
8019
  "colorTextLinkDefault": {
8020
- "light": "{colorPrimary600}",
8021
- "dark": "{colorPrimary400}"
8020
+ "light": "{colorTextNotificationYellow}",
8021
+ "dark": "{colorTextNotificationYellow}"
8022
8022
  },
8023
8023
  "colorTextLinkHover": {
8024
- "light": "{colorPrimary900}",
8025
- "dark": "{colorPrimary300}"
8024
+ "light": "{colorTextNotificationYellow}",
8025
+ "dark": "{colorTextNotificationYellow}"
8026
8026
  },
8027
8027
  "colorTextLinkInvertedHover": {
8028
8028
  "light": "{colorTextNotificationYellow}",
@@ -13269,18 +13269,18 @@ export var preset = {
13269
13269
  "colorStrokeCodeEditorGutterActiveLineHover": "--color-stroke-code-editor-gutter-active-line-hover-vqrb6s",
13270
13270
  "colorTextAccent": "--color-text-accent-n1kmht",
13271
13271
  "colorTextBodyDefault": "--color-text-body-default-vvtq8u",
13272
- "colorTextBodySecondary": "--color-text-body-secondary-bcbgoi",
13272
+ "colorTextBodySecondary": "--color-text-body-secondary-yna5sb",
13273
13273
  "colorTextBreadcrumbCurrent": "--color-text-breadcrumb-current-2mqnkk",
13274
13274
  "colorTextBreadcrumbIcon": "--color-text-breadcrumb-icon-9j48ot",
13275
- "colorTextButtonInlineIconDefault": "--color-text-button-inline-icon-default-f8xgpk",
13275
+ "colorTextButtonInlineIconDefault": "--color-text-button-inline-icon-default-sm4ql6",
13276
13276
  "colorTextButtonInlineIconDisabled": "--color-text-button-inline-icon-disabled-82hho0",
13277
- "colorTextButtonInlineIconHover": "--color-text-button-inline-icon-hover-c08r6g",
13277
+ "colorTextButtonInlineIconHover": "--color-text-button-inline-icon-hover-rbyzfc",
13278
13278
  "colorTextButtonNormalActive": "--color-text-button-normal-active-vihsxh",
13279
13279
  "colorTextToggleButtonNormalPressed": "--color-text-toggle-button-normal-pressed-wnx2zl",
13280
13280
  "colorTextButtonNormalDefault": "--color-text-button-normal-default-nzalii",
13281
13281
  "colorTextButtonNormalHover": "--color-text-button-normal-hover-gusgyv",
13282
- "colorTextLinkButtonNormalDefault": "--color-text-link-button-normal-default-5w3m67",
13283
- "colorTextLinkButtonNormalHover": "--color-text-link-button-normal-hover-4awpjm",
13282
+ "colorTextLinkButtonNormalDefault": "--color-text-link-button-normal-default-srprth",
13283
+ "colorTextLinkButtonNormalHover": "--color-text-link-button-normal-hover-jrnyw3",
13284
13284
  "colorTextLinkButtonNormalActive": "--color-text-link-button-normal-active-js9ryu",
13285
13285
  "colorTextButtonPrimaryActive": "--color-text-button-primary-active-refmba",
13286
13286
  "colorTextButtonPrimaryDefault": "--color-text-button-primary-default-mwl31m",
@@ -13332,13 +13332,13 @@ export var preset = {
13332
13332
  "colorTextInteractiveInvertedDefault": "--color-text-interactive-inverted-default-xlc0d5",
13333
13333
  "colorTextInteractiveInvertedHover": "--color-text-interactive-inverted-hover-65rnp7",
13334
13334
  "colorTextInverted": "--color-text-inverted-4v4dmq",
13335
- "colorTextLabel": "--color-text-label-8248dg",
13335
+ "colorTextLabel": "--color-text-label-28gfmc",
13336
13336
  "colorTextLayoutToggle": "--color-text-layout-toggle-1a15s3",
13337
13337
  "colorTextLayoutToggleActive": "--color-text-layout-toggle-active-ifu7qp",
13338
13338
  "colorTextLayoutToggleHover": "--color-text-layout-toggle-hover-9jwdce",
13339
13339
  "colorTextLayoutToggleSelected": "--color-text-layout-toggle-selected-xpximc",
13340
- "colorTextLinkDefault": "--color-text-link-default-1dmm7z",
13341
- "colorTextLinkHover": "--color-text-link-hover-sq1gxg",
13340
+ "colorTextLinkDefault": "--color-text-link-default-hude44",
13341
+ "colorTextLinkHover": "--color-text-link-hover-2hfec2",
13342
13342
  "colorTextLinkInvertedHover": "--color-text-link-inverted-hover-ocd3u3",
13343
13343
  "colorTextLinkButtonUnderline": "--color-text-link-button-underline-z4wjnv",
13344
13344
  "colorTextLinkButtonUnderlineHover": "--color-text-link-button-underline-hover-cn3mqh",
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "1e9c64fdb944d339e7609cf8d7abe084835d035c"
2
+ "commit": "2e81e972af7d07b77e61b1db5c8667a65bb3c998"
3
3
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudscape-design/chart-components",
3
- "version": "1.0.26",
3
+ "version": "1.0.28",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/cloudscape-design/chart-components.git"
@@ -88,7 +88,8 @@
88
88
  },
89
89
  "//": "ensure that typedoc uses latest typescript. It prints a warning, but works",
90
90
  "overrides": {
91
- "typescript": "^4.9.4"
91
+ "typescript": "^4.9.4",
92
+ "glob": "^10.5.0"
92
93
  },
93
94
  "lint-staged": {
94
95
  "*.{js,jsx,ts,tsx}": [