@cloudscape-design/chart-components 1.0.114 → 1.0.116

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.
@@ -1,5 +1,5 @@
1
1
  import * as CoreTypes from "../core/interfaces";
2
- import { NonCancelableEventHandler } from "../internal/events";
2
+ import { NonCancelableEventHandler } from "../types/events";
3
3
  export interface CartesianChartProps extends CoreTypes.BaseChartOptions, CoreTypes.CoreCartesianOptions, CoreTypes.WithCartesianI18nStrings {
4
4
  /**
5
5
  * Inverts X and Y axes. Use it to show horizontal columns (bars).
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/cartesian-chart/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 * as CoreTypes from \"../core/interfaces\";\nimport { NonCancelableEventHandler } from \"../internal/events\";\n\n// CartesianChartProps is the type for CartesianChart React component properties. Unlike in Highcharts API,\n// we pass options directly to the component, instead of grouping them all into a single \"options\" property.\n// We do still organize related options in groups, e.g.: \"SeriesOptions\", \"TooltipOptions\".\nexport interface CartesianChartProps\n extends CoreTypes.BaseChartOptions, CoreTypes.CoreCartesianOptions, CoreTypes.WithCartesianI18nStrings {\n /**\n * Inverts X and Y axes. Use it to show horizontal columns (bars).\n * This property corresponds to [chart.inverted](https://api.highcharts.com/highcharts/chart.inverted).\n */\n inverted?: boolean;\n\n /**\n * Enables series stacking behavior. Use it for column- or area- series.\n * This property corresponds to \"normal\" stacking type in Highcharts ([plotOptions.series.stacking](https://api.highcharts.com/highcharts/plotOptions.series.stacking)).\n */\n stacking?: \"normal\";\n\n /**\n * Defines series options of the chart.\n * This property corresponds to [series](https://api.highcharts.com/highcharts/series), and extends it\n * with two additional series types: \"x-threshold\", and \"y-threshold\".\n *\n * Supported types:\n * * [area](https://api.highcharts.com/highcharts/series.area).\n * * [areaspline](https://api.highcharts.com/highcharts/series.areaspline).\n * * [column](https://api.highcharts.com/highcharts/series.column).\n * * [errorbar](https://api.highcharts.com/highcharts/series.errorbar) - requires \"highcharts/highcharts-more\" module.\n * * [line](https://api.highcharts.com/highcharts/series.line).\n * * [bubble](https://api.highcharts.com/highcharts/series.bubble) - requires \"highcharts/highcharts-more\" module.\n * * [scatter](https://api.highcharts.com/highcharts/series.scatter).\n * * [spline](https://api.highcharts.com/highcharts/series.spline).\n * * x-threshold - The line-like series to represent x-axis threshold (vertical, when `inverted=false`).\n * * y-threshold - The line-like series to represent y-axis threshold (horizontal, when `inverted=false`).\n */\n series: readonly CartesianChartProps.SeriesOptions[];\n\n /**\n * Defines tooltip options of the chart, including:\n * * `enabled` - (optional, boolean) - Hides the tooltip when set to false.\n * * `size` - (optional, \"small\" | \"medium\" | \"large\") - Specifies max tooltip size.\n * * `placement` - (optional, \"middle\" | \"outside\") - Specifies preferred tooltip placement.\n * * `point` - (optional, function) - Customizes tooltip series point rendering.\n * * `header` - (optional, function) - Renders a custom tooltip header.\n * * `body` - (optional, function) - Renders a custom tooltip body.\n * * `footer` - (optional, function) - Renders a custom tooltip footer.\n */\n tooltip?: CartesianChartProps.TooltipOptions;\n\n /**\n * Defines options of the chart's x axis.\n * This property corresponds to [xAxis](https://api.highcharts.com/highcharts/xAxis), and extends it\n * with a custom value formatter.\n *\n * Supported options:\n * * `title` (optional, string) - Axis title.\n * * `type` (optional, \"linear\" | \"datetime\" | \"category\" | \"logarithmic\") - Axis type.\n * * * \"linear\" - Uses continuous proportional values scale.\n * * * \"datetime\" - Similar to linear, but takes epoch time as values.\n * * * \"category\" - Uses discrete scale, requires `categories` to be set.\n * * * \"logarithmic\" - Uses continuous logarithmic values scale.\n * * `min` (optional, number) - Axis min value boundary.\n * * `max` (optional, number) - Axis max value boundary.\n * * `tickInterval` (optional, number) - Distance between axis ticks.\n * * `categories` (optional, Array<string>) - Predefined list of values, used for categorical axis type.\n * * `valueFormatter` (optional, function) - Takes axis tick as input and returns a formatted string. This formatter also\n * applies to the tooltip header.\n */\n xAxis?: CartesianChartProps.XAxisOptions;\n\n /**\n * Defines options of the chart's y axis.\n * This property corresponds to [yAxis](https://api.highcharts.com/highcharts/yAxis), and extends it\n * with a custom value formatter.\n *\n * Use a single object for a single y axis, or a tuple of two objects for a dual-axis chart.\n * When using a tuple, both axes must have an `id`. The second axis is automatically rendered on the opposite (inline-end) side.\n * Series reference their axis by setting `yAxis` to the axis `id`.\n *\n * Supported options:\n * * `title` (optional, string) - Axis title.\n * * `type` (optional, \"linear\" | \"datetime\" | \"category\" | \"logarithmic\") - Axis type.\n * * * \"linear\" - Uses continuous proportional values scale.\n * * * \"datetime\" - Similar to linear, but takes epoch time as values.\n * * * \"category\" - Uses discrete scale, requires `categories` to be set.\n * * * \"logarithmic\" - Uses continuous logarithmic values scale.\n * * `min` (optional, number) - Axis min value boundary.\n * * `max` (optional, number) - Axis max value boundary.\n * * `tickInterval` (optional, number) - Distance between axis ticks.\n * * `categories` (optional, Array<string>) - Predefined list of values, used for categorical axis type.\n * * `reversedStacks` (optional, boolean) - Reverts series order in stacked series.\n * * `valueFormatter` (optional, function) - Takes axis tick as input and returns a formatted string. This formatter also\n * applies to the tooltip points values.\n */\n yAxis?: CartesianChartProps.YAxisOptions | [CartesianChartProps.YAxisWithId, CartesianChartProps.YAxisWithId];\n\n /**\n * One or multiple axes to provide size details formatting for bubble series.\n *\n * Supported options:\n * * `id` (optional, string) - Use it to connect axes with respective series when multiple size axes are present. The axis id must correspond `sizeAxis` property of the bubble series.\n * * `title` (string) - Axis title, shown in the tooltip details for bubble series.\n * * `valueFormatter` (optional, function) - Value formatter for `size` values of the bubble series data.\n */\n sizeAxis?: CartesianChartProps.SizeAxisOptions | readonly CartesianChartProps.SizeAxisOptions[];\n\n /**\n * Specifies which series to show using their IDs. By default, all series are visible and managed by the component.\n * If a series doesn't have an ID, its name is used. When using this property, manage state updates with `onVisibleSeriesChange`.\n */\n visibleSeries?: readonly string[];\n\n /**\n * A callback function, triggered when series visibility changes as a result of user interaction with the legend or filter.\n */\n onVisibleSeriesChange?: NonCancelableEventHandler<{ visibleSeries: string[] }>;\n}\n\nexport namespace CartesianChartProps {\n export interface Ref {\n /**\n * Controls series visibility and works with both controlled and uncontrolled visibility modes.\n */\n setVisibleSeries(visibleSeries: readonly string[]): void;\n /**\n * Functions similarly to `setVisibleSeries`, but applies to all series and doesn't require series IDs as input.\n * Use this when implementing clear-filter actions in no-match states.\n */\n showAllSeries(): void;\n }\n\n export type SeriesOptions =\n | AreaSeriesOptions\n | AreaSplineSeriesOptions\n | BubbleSeriesOptions\n | ColumnSeriesOptions\n | ErrorBarSeriesOptions\n | LineSeriesOptions\n | ScatterSeriesOptions\n | SplineSeriesOptions\n | XThresholdSeriesOptions\n | YThresholdSeriesOptions;\n\n export type AreaSeriesOptions = CoreTypes.AreaSeriesOptions;\n export type AreaSplineSeriesOptions = CoreTypes.AreaSplineSeriesOptions;\n export type BubbleSeriesOptions = CoreTypes.BubbleSeriesOptions;\n export type ColumnSeriesOptions = CoreTypes.ColumnSeriesOptions;\n export type ErrorBarSeriesOptions = CoreTypes.ErrorBarSeriesOptions;\n export type LineSeriesOptions = CoreTypes.LineSeriesOptions;\n export type ScatterSeriesOptions = CoreTypes.ScatterSeriesOptions;\n export type SplineSeriesOptions = CoreTypes.SplineSeriesOptions;\n export type XThresholdSeriesOptions = CoreTypes.XThresholdSeriesOptions;\n export type YThresholdSeriesOptions = CoreTypes.YThresholdSeriesOptions;\n\n interface AxisOptions {\n id?: string;\n title?: string;\n type?: \"linear\" | \"datetime\" | \"category\" | \"logarithmic\";\n min?: number;\n max?: number;\n tickInterval?: number;\n categories?: string[];\n valueFormatter?: (value: null | number) => string;\n }\n\n export interface SizeAxisOptions {\n id?: string;\n title: string;\n valueFormatter?: (value: null | number) => string;\n }\n\n export type XAxisOptions = AxisOptions;\n\n export interface YAxisOptions extends AxisOptions {\n reversedStacks?: boolean;\n }\n\n export interface YAxisWithId extends YAxisOptions {\n id: string;\n }\n\n export interface TooltipOptions {\n enabled?: boolean;\n placement?: \"middle\" | \"outside\";\n size?: \"small\" | \"medium\" | \"large\";\n point?: (props: TooltipPointRenderProps) => TooltipPointFormatted;\n header?: (props: TooltipHeaderRenderProps) => React.ReactNode;\n body?: (props: TooltipBodyRenderProps) => React.ReactNode;\n footer?: (props: TooltipFooterRenderProps) => React.ReactNode;\n }\n export type TooltipHeaderRenderProps = TooltipSlotRenderProps;\n export type TooltipBodyRenderProps = TooltipSlotRenderProps;\n export type TooltipFooterRenderProps = TooltipSlotRenderProps;\n export interface TooltipSlotRenderProps {\n x: number;\n items: TooltipPointItem[];\n }\n export interface TooltipPointRenderProps {\n item: TooltipPointItem;\n }\n export interface TooltipPointItem {\n x: number;\n y: number | null;\n size?: number | null;\n errorRanges: { low: number; high: number; series: CartesianChartProps.ErrorBarSeriesOptions }[];\n series: NonErrorBarSeriesOptions;\n }\n export type TooltipPointFormatted = CoreTypes.BaseTooltipPointFormatted;\n\n export type SeriesZone = CoreTypes.SeriesZone;\n\n export type LegendOptions = CoreTypes.BaseLegendOptions;\n\n export type FilterOptions = CoreTypes.BaseFilterOptions;\n\n export type NoDataOptions = CoreTypes.BaseNoDataOptions;\n}\n\n// Internal types\n\nexport type NonErrorBarSeriesOptions = Exclude<\n CartesianChartProps.SeriesOptions,\n CartesianChartProps.ErrorBarSeriesOptions\n>;\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/cartesian-chart/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 * as CoreTypes from \"../core/interfaces\";\nimport { NonCancelableEventHandler } from \"../types/events\";\n\n// CartesianChartProps is the type for CartesianChart React component properties. Unlike in Highcharts API,\n// we pass options directly to the component, instead of grouping them all into a single \"options\" property.\n// We do still organize related options in groups, e.g.: \"SeriesOptions\", \"TooltipOptions\".\nexport interface CartesianChartProps\n extends CoreTypes.BaseChartOptions, CoreTypes.CoreCartesianOptions, CoreTypes.WithCartesianI18nStrings {\n /**\n * Inverts X and Y axes. Use it to show horizontal columns (bars).\n * This property corresponds to [chart.inverted](https://api.highcharts.com/highcharts/chart.inverted).\n */\n inverted?: boolean;\n\n /**\n * Enables series stacking behavior. Use it for column- or area- series.\n * This property corresponds to \"normal\" stacking type in Highcharts ([plotOptions.series.stacking](https://api.highcharts.com/highcharts/plotOptions.series.stacking)).\n */\n stacking?: \"normal\";\n\n /**\n * Defines series options of the chart.\n * This property corresponds to [series](https://api.highcharts.com/highcharts/series), and extends it\n * with two additional series types: \"x-threshold\", and \"y-threshold\".\n *\n * Supported types:\n * * [area](https://api.highcharts.com/highcharts/series.area).\n * * [areaspline](https://api.highcharts.com/highcharts/series.areaspline).\n * * [column](https://api.highcharts.com/highcharts/series.column).\n * * [errorbar](https://api.highcharts.com/highcharts/series.errorbar) - requires \"highcharts/highcharts-more\" module.\n * * [line](https://api.highcharts.com/highcharts/series.line).\n * * [bubble](https://api.highcharts.com/highcharts/series.bubble) - requires \"highcharts/highcharts-more\" module.\n * * [scatter](https://api.highcharts.com/highcharts/series.scatter).\n * * [spline](https://api.highcharts.com/highcharts/series.spline).\n * * x-threshold - The line-like series to represent x-axis threshold (vertical, when `inverted=false`).\n * * y-threshold - The line-like series to represent y-axis threshold (horizontal, when `inverted=false`).\n */\n series: readonly CartesianChartProps.SeriesOptions[];\n\n /**\n * Defines tooltip options of the chart, including:\n * * `enabled` - (optional, boolean) - Hides the tooltip when set to false.\n * * `size` - (optional, \"small\" | \"medium\" | \"large\") - Specifies max tooltip size.\n * * `placement` - (optional, \"middle\" | \"outside\") - Specifies preferred tooltip placement.\n * * `point` - (optional, function) - Customizes tooltip series point rendering.\n * * `header` - (optional, function) - Renders a custom tooltip header.\n * * `body` - (optional, function) - Renders a custom tooltip body.\n * * `footer` - (optional, function) - Renders a custom tooltip footer.\n */\n tooltip?: CartesianChartProps.TooltipOptions;\n\n /**\n * Defines options of the chart's x axis.\n * This property corresponds to [xAxis](https://api.highcharts.com/highcharts/xAxis), and extends it\n * with a custom value formatter.\n *\n * Supported options:\n * * `title` (optional, string) - Axis title.\n * * `type` (optional, \"linear\" | \"datetime\" | \"category\" | \"logarithmic\") - Axis type.\n * * * \"linear\" - Uses continuous proportional values scale.\n * * * \"datetime\" - Similar to linear, but takes epoch time as values.\n * * * \"category\" - Uses discrete scale, requires `categories` to be set.\n * * * \"logarithmic\" - Uses continuous logarithmic values scale.\n * * `min` (optional, number) - Axis min value boundary.\n * * `max` (optional, number) - Axis max value boundary.\n * * `tickInterval` (optional, number) - Distance between axis ticks.\n * * `categories` (optional, Array<string>) - Predefined list of values, used for categorical axis type.\n * * `valueFormatter` (optional, function) - Takes axis tick as input and returns a formatted string. This formatter also\n * applies to the tooltip header.\n */\n xAxis?: CartesianChartProps.XAxisOptions;\n\n /**\n * Defines options of the chart's y axis.\n * This property corresponds to [yAxis](https://api.highcharts.com/highcharts/yAxis), and extends it\n * with a custom value formatter.\n *\n * Use a single object for a single y axis, or a tuple of two objects for a dual-axis chart.\n * When using a tuple, both axes must have an `id`. The second axis is automatically rendered on the opposite (inline-end) side.\n * Series reference their axis by setting `yAxis` to the axis `id`.\n *\n * Supported options:\n * * `title` (optional, string) - Axis title.\n * * `type` (optional, \"linear\" | \"datetime\" | \"category\" | \"logarithmic\") - Axis type.\n * * * \"linear\" - Uses continuous proportional values scale.\n * * * \"datetime\" - Similar to linear, but takes epoch time as values.\n * * * \"category\" - Uses discrete scale, requires `categories` to be set.\n * * * \"logarithmic\" - Uses continuous logarithmic values scale.\n * * `min` (optional, number) - Axis min value boundary.\n * * `max` (optional, number) - Axis max value boundary.\n * * `tickInterval` (optional, number) - Distance between axis ticks.\n * * `categories` (optional, Array<string>) - Predefined list of values, used for categorical axis type.\n * * `reversedStacks` (optional, boolean) - Reverts series order in stacked series.\n * * `valueFormatter` (optional, function) - Takes axis tick as input and returns a formatted string. This formatter also\n * applies to the tooltip points values.\n */\n yAxis?: CartesianChartProps.YAxisOptions | [CartesianChartProps.YAxisWithId, CartesianChartProps.YAxisWithId];\n\n /**\n * One or multiple axes to provide size details formatting for bubble series.\n *\n * Supported options:\n * * `id` (optional, string) - Use it to connect axes with respective series when multiple size axes are present. The axis id must correspond `sizeAxis` property of the bubble series.\n * * `title` (string) - Axis title, shown in the tooltip details for bubble series.\n * * `valueFormatter` (optional, function) - Value formatter for `size` values of the bubble series data.\n */\n sizeAxis?: CartesianChartProps.SizeAxisOptions | readonly CartesianChartProps.SizeAxisOptions[];\n\n /**\n * Specifies which series to show using their IDs. By default, all series are visible and managed by the component.\n * If a series doesn't have an ID, its name is used. When using this property, manage state updates with `onVisibleSeriesChange`.\n */\n visibleSeries?: readonly string[];\n\n /**\n * A callback function, triggered when series visibility changes as a result of user interaction with the legend or filter.\n */\n onVisibleSeriesChange?: NonCancelableEventHandler<{ visibleSeries: string[] }>;\n}\n\nexport namespace CartesianChartProps {\n export interface Ref {\n /**\n * Controls series visibility and works with both controlled and uncontrolled visibility modes.\n */\n setVisibleSeries(visibleSeries: readonly string[]): void;\n /**\n * Functions similarly to `setVisibleSeries`, but applies to all series and doesn't require series IDs as input.\n * Use this when implementing clear-filter actions in no-match states.\n */\n showAllSeries(): void;\n }\n\n export type SeriesOptions =\n | AreaSeriesOptions\n | AreaSplineSeriesOptions\n | BubbleSeriesOptions\n | ColumnSeriesOptions\n | ErrorBarSeriesOptions\n | LineSeriesOptions\n | ScatterSeriesOptions\n | SplineSeriesOptions\n | XThresholdSeriesOptions\n | YThresholdSeriesOptions;\n\n export type AreaSeriesOptions = CoreTypes.AreaSeriesOptions;\n export type AreaSplineSeriesOptions = CoreTypes.AreaSplineSeriesOptions;\n export type BubbleSeriesOptions = CoreTypes.BubbleSeriesOptions;\n export type ColumnSeriesOptions = CoreTypes.ColumnSeriesOptions;\n export type ErrorBarSeriesOptions = CoreTypes.ErrorBarSeriesOptions;\n export type LineSeriesOptions = CoreTypes.LineSeriesOptions;\n export type ScatterSeriesOptions = CoreTypes.ScatterSeriesOptions;\n export type SplineSeriesOptions = CoreTypes.SplineSeriesOptions;\n export type XThresholdSeriesOptions = CoreTypes.XThresholdSeriesOptions;\n export type YThresholdSeriesOptions = CoreTypes.YThresholdSeriesOptions;\n\n interface AxisOptions {\n id?: string;\n title?: string;\n type?: \"linear\" | \"datetime\" | \"category\" | \"logarithmic\";\n min?: number;\n max?: number;\n tickInterval?: number;\n categories?: string[];\n valueFormatter?: (value: null | number) => string;\n }\n\n export interface SizeAxisOptions {\n id?: string;\n title: string;\n valueFormatter?: (value: null | number) => string;\n }\n\n export type XAxisOptions = AxisOptions;\n\n export interface YAxisOptions extends AxisOptions {\n reversedStacks?: boolean;\n }\n\n export interface YAxisWithId extends YAxisOptions {\n id: string;\n }\n\n export interface TooltipOptions {\n enabled?: boolean;\n placement?: \"middle\" | \"outside\";\n size?: \"small\" | \"medium\" | \"large\";\n point?: (props: TooltipPointRenderProps) => TooltipPointFormatted;\n header?: (props: TooltipHeaderRenderProps) => React.ReactNode;\n body?: (props: TooltipBodyRenderProps) => React.ReactNode;\n footer?: (props: TooltipFooterRenderProps) => React.ReactNode;\n }\n export type TooltipHeaderRenderProps = TooltipSlotRenderProps;\n export type TooltipBodyRenderProps = TooltipSlotRenderProps;\n export type TooltipFooterRenderProps = TooltipSlotRenderProps;\n export interface TooltipSlotRenderProps {\n x: number;\n items: TooltipPointItem[];\n }\n export interface TooltipPointRenderProps {\n item: TooltipPointItem;\n }\n export interface TooltipPointItem {\n x: number;\n y: number | null;\n size?: number | null;\n errorRanges: { low: number; high: number; series: CartesianChartProps.ErrorBarSeriesOptions }[];\n series: NonErrorBarSeriesOptions;\n }\n export type TooltipPointFormatted = CoreTypes.BaseTooltipPointFormatted;\n\n export type SeriesZone = CoreTypes.SeriesZone;\n\n export type LegendOptions = CoreTypes.BaseLegendOptions;\n\n export type FilterOptions = CoreTypes.BaseFilterOptions;\n\n export type NoDataOptions = CoreTypes.BaseNoDataOptions;\n}\n\n// Internal types\n\nexport type NonErrorBarSeriesOptions = Exclude<\n CartesianChartProps.SeriesOptions,\n CartesianChartProps.ErrorBarSeriesOptions\n>;\n"]}
@@ -1,7 +1,6 @@
1
1
  import type Highcharts from "highcharts";
2
- import type * as InternalComponentTypes from "../internal/components/interfaces";
3
- import { ChartSeriesMarkerStatus } from "../internal/components/series-marker/interfaces";
4
- import { type NonCancelableEventHandler } from "../internal/events";
2
+ import { type NonCancelableEventHandler } from "../types/events";
3
+ export type ChartSeriesMarkerStatus = "warning" | "default";
5
4
  /**
6
5
  * This interface includes common public chart properties, applicable for all chart types.
7
6
  */
@@ -445,10 +444,23 @@ export declare namespace CoreChartProps {
445
444
  horizontalAlignment?: LegendOptionsHorizontalAlignment;
446
445
  }
447
446
  type LegendOptionsHorizontalAlignment = "start" | "center";
448
- type LegendItem = InternalComponentTypes.LegendItem;
449
- type LegendTooltipContent = InternalComponentTypes.LegendTooltipContent;
450
- type GetLegendTooltipContent = InternalComponentTypes.GetLegendTooltipContent;
451
- type GetLegendTooltipContentProps = InternalComponentTypes.GetLegendTooltipContentProps;
447
+ interface LegendItem {
448
+ id: string;
449
+ name: string;
450
+ marker: React.ReactNode;
451
+ visible: boolean;
452
+ highlighted: boolean;
453
+ isSecondary?: boolean;
454
+ }
455
+ interface LegendTooltipContent {
456
+ header: React.ReactNode;
457
+ body: React.ReactNode;
458
+ footer?: React.ReactNode;
459
+ }
460
+ type GetLegendTooltipContent = (props: GetLegendTooltipContentProps) => LegendTooltipContent;
461
+ interface GetLegendTooltipContentProps {
462
+ legendItem: LegendItem;
463
+ }
452
464
  interface TooltipOptions {
453
465
  enabled?: boolean;
454
466
  placement?: "middle" | "outside" | "target";
@@ -532,8 +544,8 @@ export interface CoreLegendProps {
532
544
  getLegendTooltipContent?: CoreLegendProps.GetTooltipContent;
533
545
  }
534
546
  export declare namespace CoreLegendProps {
535
- type Item = InternalComponentTypes.LegendItem;
536
- type GetTooltipContent = InternalComponentTypes.GetLegendTooltipContent;
547
+ type Item = CoreChartProps.LegendItem;
548
+ type GetTooltipContent = CoreChartProps.GetLegendTooltipContent;
537
549
  interface ItemHighlightDetail {
538
550
  item: Item;
539
551
  }
@@ -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 { ChartSeriesMarkerStatus } from \"../internal/components/series-marker/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 /**\n * ARIA label for the marker of a series. Series with status \"default\" will not announce a label, thus excluded by this method.\n */\n itemMarkerStatusAriaLabel?: (status: Exclude<ChartSeriesMarkerStatus, \"default\">) => 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, LinkableSeries, WithZones {\n type: \"area\";\n data: readonly PointDataItemType[];\n /** Opacity of the area fill, from 0 (transparent) to 1 (opaque). Defaults to 0.4. */\n fillOpacity?: number;\n}\n\nexport interface AreaSplineSeriesOptions extends BaseCartesianLineLikeOptions, LinkableSeries, WithZones {\n type: \"areaspline\";\n data: readonly PointDataItemType[];\n /** Opacity of the area fill, from 0 (transparent) to 1 (opaque). Defaults to 0.4. */\n fillOpacity?: number;\n}\n\nexport interface ColumnSeriesOptions extends BaseCartesianSeriesOptions, LinkableSeries, WithZones {\n type: \"column\";\n data: readonly PointDataItemType[];\n}\n\nexport interface LineSeriesOptions extends BaseCartesianLineLikeOptions, LinkableSeries, WithZones {\n type: \"line\";\n data: readonly PointDataItemType[];\n}\n\nexport interface SplineSeriesOptions extends BaseCartesianLineLikeOptions, LinkableSeries, WithZones {\n type: \"spline\";\n data: readonly PointDataItemType[];\n}\n\nexport interface ScatterSeriesOptions extends BaseCartesianSeriesOptions, LinkableSeries {\n type: \"scatter\";\n data: readonly PointDataItemType[];\n marker?: PointMarkerOptions;\n}\n\nexport interface BubbleSeriesOptions extends BaseCartesianSeriesOptions, LinkableSeries {\n type: \"bubble\";\n sizeAxis?: string;\n data: readonly SizePointDataItemOptions[];\n}\n\nexport interface ErrorBarSeriesOptions extends Omit<BaseCartesianSeriesOptions, \"name\"> {\n type: \"errorbar\";\n name?: string;\n data: readonly RangeDataItemOptions[];\n linkedTo: string;\n}\n\n// X-threshold series render as vertical plot lines spanning the full chart height,\n// so they are not associated with a specific y-axis and omit yAxis.\nexport interface XThresholdSeriesOptions extends Omit<BaseCartesianLineLikeOptions, \"yAxis\"> {\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 SizePointDataItemOptions {\n x?: number;\n y: number | null;\n size: number;\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\ninterface BaseCartesianSeriesOptions extends BaseSeriesOptions {\n yAxis?: string;\n}\n\nexport interface LinkableSeries {\n /**\n * Links this series to another series by ID, or `\":previous\"` for the immediately preceding series.\n * A linked series does not appear as a separate item in the legend or series filter, and its visibility\n * follows the series it is linked to. It still renders in the chart and appears as a separate row in the tooltip.\n *\n * Use this to attach projected, forecast, or supplementary series to a primary series without cluttering the legend.\n */\n linkedTo?: string;\n}\n\nexport interface WithZones {\n zoneAxis?: \"x\" | \"y\";\n zones?: readonly SeriesZone[];\n}\n\nexport interface SeriesZone {\n value?: number;\n color?: string;\n dashStyle?: Highcharts.DashStyleValue;\n}\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\n 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?: CoreChartProps.I18nStrings;\n /**\n * Specifies the options for each item in the chart.\n */\n getItemOptions?: CoreChartProps.GetItemOptions;\n\n sizeAxis?: CoreChartProps.SizeAxisOptions | readonly CoreChartProps.SizeAxisOptions[];\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 /**\n * The item id. Can be the id of a series or a point.\n */\n export type GetItemOptions = (itemId: string) => CoreChartProps.ChartItemOptions;\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 SizeAxisOptions {\n id?: string;\n title: string;\n valueFormatter?: (value: null | number) => string;\n }\n\n export interface ChartItemOptions {\n /**\n * If specified, specifies the status of an item.\n * An item can be a point or a series.\n */\n status?: ChartSeriesMarkerStatus;\n }\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 * When set to true, enables horizontal scrolling for legend items with long text.\n * By default, long text is truncated with ellipsis.\n */\n enableHorizontalScroll?: boolean;\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\n export interface ApiInteraction {\n interactionType: \"api\";\n }\n export interface FilterInteraction {\n interactionType: \"filter\";\n }\n export interface ToggleInteraction {\n interactionType: \"toggle\";\n targetItemId: string;\n }\n export interface SelectInteraction {\n interactionType: \"select\";\n targetItemId: string;\n }\n\n export type InteractionKind = ApiInteraction | FilterInteraction | ToggleInteraction | SelectInteraction;\n\n export type VisibleItemsChangeDetail = { items: readonly LegendItem[] } & InteractionKind;\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 & CoreI18nStrings;\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 enableHorizontalScroll?: boolean;\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 type VisibleItemsChangeDetail = { items: readonly string[] } & (\n | CoreChartProps.ToggleInteraction\n | CoreChartProps.SelectInteraction\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 NonCancelableEventHandler } from \"../types/events\";\n\nexport type ChartSeriesMarkerStatus = \"warning\" | \"default\";\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 /**\n * ARIA label for the marker of a series. Series with status \"default\" will not announce a label, thus excluded by this method.\n */\n itemMarkerStatusAriaLabel?: (status: Exclude<ChartSeriesMarkerStatus, \"default\">) => 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, LinkableSeries, WithZones {\n type: \"area\";\n data: readonly PointDataItemType[];\n /** Opacity of the area fill, from 0 (transparent) to 1 (opaque). Defaults to 0.4. */\n fillOpacity?: number;\n}\n\nexport interface AreaSplineSeriesOptions extends BaseCartesianLineLikeOptions, LinkableSeries, WithZones {\n type: \"areaspline\";\n data: readonly PointDataItemType[];\n /** Opacity of the area fill, from 0 (transparent) to 1 (opaque). Defaults to 0.4. */\n fillOpacity?: number;\n}\n\nexport interface ColumnSeriesOptions extends BaseCartesianSeriesOptions, LinkableSeries, WithZones {\n type: \"column\";\n data: readonly PointDataItemType[];\n}\n\nexport interface LineSeriesOptions extends BaseCartesianLineLikeOptions, LinkableSeries, WithZones {\n type: \"line\";\n data: readonly PointDataItemType[];\n}\n\nexport interface SplineSeriesOptions extends BaseCartesianLineLikeOptions, LinkableSeries, WithZones {\n type: \"spline\";\n data: readonly PointDataItemType[];\n}\n\nexport interface ScatterSeriesOptions extends BaseCartesianSeriesOptions, LinkableSeries {\n type: \"scatter\";\n data: readonly PointDataItemType[];\n marker?: PointMarkerOptions;\n}\n\nexport interface BubbleSeriesOptions extends BaseCartesianSeriesOptions, LinkableSeries {\n type: \"bubble\";\n sizeAxis?: string;\n data: readonly SizePointDataItemOptions[];\n}\n\nexport interface ErrorBarSeriesOptions extends Omit<BaseCartesianSeriesOptions, \"name\"> {\n type: \"errorbar\";\n name?: string;\n data: readonly RangeDataItemOptions[];\n linkedTo: string;\n}\n\n// X-threshold series render as vertical plot lines spanning the full chart height,\n// so they are not associated with a specific y-axis and omit yAxis.\nexport interface XThresholdSeriesOptions extends Omit<BaseCartesianLineLikeOptions, \"yAxis\"> {\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 SizePointDataItemOptions {\n x?: number;\n y: number | null;\n size: number;\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\ninterface BaseCartesianSeriesOptions extends BaseSeriesOptions {\n yAxis?: string;\n}\n\nexport interface LinkableSeries {\n /**\n * Links this series to another series by ID, or `\":previous\"` for the immediately preceding series.\n * A linked series does not appear as a separate item in the legend or series filter, and its visibility\n * follows the series it is linked to. It still renders in the chart and appears as a separate row in the tooltip.\n *\n * Use this to attach projected, forecast, or supplementary series to a primary series without cluttering the legend.\n */\n linkedTo?: string;\n}\n\nexport interface WithZones {\n zoneAxis?: \"x\" | \"y\";\n zones?: readonly SeriesZone[];\n}\n\nexport interface SeriesZone {\n value?: number;\n color?: string;\n dashStyle?: Highcharts.DashStyleValue;\n}\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\n 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?: CoreChartProps.I18nStrings;\n /**\n * Specifies the options for each item in the chart.\n */\n getItemOptions?: CoreChartProps.GetItemOptions;\n\n sizeAxis?: CoreChartProps.SizeAxisOptions | readonly CoreChartProps.SizeAxisOptions[];\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 /**\n * The item id. Can be the id of a series or a point.\n */\n export type GetItemOptions = (itemId: string) => CoreChartProps.ChartItemOptions;\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 SizeAxisOptions {\n id?: string;\n title: string;\n valueFormatter?: (value: null | number) => string;\n }\n\n export interface ChartItemOptions {\n /**\n * If specified, specifies the status of an item.\n * An item can be a point or a series.\n */\n status?: ChartSeriesMarkerStatus;\n }\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 * When set to true, enables horizontal scrolling for legend items with long text.\n * By default, long text is truncated with ellipsis.\n */\n enableHorizontalScroll?: boolean;\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 interface LegendItem {\n id: string;\n name: string;\n marker: React.ReactNode;\n visible: boolean;\n highlighted: boolean;\n isSecondary?: boolean;\n }\n export interface LegendTooltipContent {\n header: React.ReactNode;\n body: React.ReactNode;\n footer?: React.ReactNode;\n }\n export type GetLegendTooltipContent = (props: GetLegendTooltipContentProps) => LegendTooltipContent;\n export interface GetLegendTooltipContentProps {\n legendItem: LegendItem;\n }\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\n export interface ApiInteraction {\n interactionType: \"api\";\n }\n export interface FilterInteraction {\n interactionType: \"filter\";\n }\n export interface ToggleInteraction {\n interactionType: \"toggle\";\n targetItemId: string;\n }\n export interface SelectInteraction {\n interactionType: \"select\";\n targetItemId: string;\n }\n\n export type InteractionKind = ApiInteraction | FilterInteraction | ToggleInteraction | SelectInteraction;\n\n export type VisibleItemsChangeDetail = { items: readonly LegendItem[] } & InteractionKind;\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 & CoreI18nStrings;\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 enableHorizontalScroll?: boolean;\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 = CoreChartProps.LegendItem;\n export type GetTooltipContent = CoreChartProps.GetLegendTooltipContent;\n export interface ItemHighlightDetail {\n item: Item;\n }\n export type VisibleItemsChangeDetail = { items: readonly string[] } & (\n | CoreChartProps.ToggleInteraction\n | CoreChartProps.SelectInteraction\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,5 +1,5 @@
1
1
  export var PACKAGE_SOURCE = "chart-components";
2
- export var PACKAGE_VERSION = "1.0.0 (b7905d65)";
2
+ export var PACKAGE_VERSION = "1.0.0 (53bc6e76)";
3
3
  export var THEME = "open-source-visual-refresh";
4
4
  export var ALWAYS_VISUAL_REFRESH = true;
5
5
  export var SYSTEM = "core";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "PACKAGE_SOURCE": "chart-components",
3
- "PACKAGE_VERSION": "1.0.0 (b7905d65)",
3
+ "PACKAGE_VERSION": "1.0.0 (53bc6e76)",
4
4
  "THEME": "open-source-visual-refresh",
5
5
  "ALWAYS_VISUAL_REFRESH": true,
6
6
  "SYSTEM": "core"
@@ -1,6 +1,6 @@
1
+ import { NonCancelableEventHandler } from "../../types/events";
2
+ export type { NonCancelableCustomEvent, NonCancelableEventHandler } from "../../types/events";
1
3
  export type CancelableEventHandler<Detail = object> = (event: CustomEvent<Detail>) => void;
2
- export type NonCancelableEventHandler<Detail = {}> = (event: NonCancelableCustomEvent<Detail>) => void;
3
- export type NonCancelableCustomEvent<DetailType> = Omit<CustomEvent<DetailType>, "preventDefault">;
4
4
  export interface ClickDetail {
5
5
  button: number;
6
6
  ctrlKey: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/internal/events/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAiBtC,MAAM,OAAO,eAAe;IAG1B,YACS,aAAsB,KAAK,EAC3B,SAAmB,IAAI;QADvB,eAAU,GAAV,UAAU,CAAiB;QAC3B,WAAM,GAAN,MAAM,CAAiB;QAJhC,qBAAgB,GAAG,KAAK,CAAC;QACzB,iBAAY,GAAG,KAAK,CAAC;IAIlB,CAAC;IAEJ,cAAc;QACZ,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAC/B,CAAC;IAED,eAAe;QACb,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;IAC3B,CAAC;CACF;AAED,MAAM,UAAU,iBAAiB,CAAI,EAAE,UAAU,EAAE,MAAM,EAAsB;IAC7E,OAAO,IAAI,eAAe,CAAC,UAAU,EAAE,MAAM,CAAgB,CAAC;AAChE,CAAC;AAED,MAAM,UAAU,mBAAmB,CACjC,OAA8C,EAC9C,MAAS,EACT,WAA0C;IAE1C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,KAAK,GAAG,iBAAiB,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IAC9D,OAAO,CAAC,KAAK,CAAC,CAAC;IACf,IAAI,KAAK,CAAC,gBAAgB,IAAI,WAAW,EAAE,CAAC;QAC1C,WAAW,CAAC,cAAc,EAAE,CAAC;IAC/B,CAAC;IACD,IAAI,KAAK,CAAC,YAAY,IAAI,WAAW,EAAE,CAAC;QACtC,WAAW,CAAC,eAAe,EAAE,CAAC;IAChC,CAAC;IACD,OAAO,KAAK,CAAC,gBAAgB,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAW,OAAiD,EAAE,MAAU;IAC5G,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO;IACT,CAAC;IACD,MAAM,KAAK,GAAG,iBAAiB,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;IAC/D,OAAO,CAAC,KAAK,CAAC,CAAC;AACjB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nexport type CancelableEventHandler<Detail = object> = (event: CustomEvent<Detail>) => void;\n\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport type NonCancelableEventHandler<Detail = {}> = (event: NonCancelableCustomEvent<Detail>) => void;\n\nexport type NonCancelableCustomEvent<DetailType> = Omit<CustomEvent<DetailType>, \"preventDefault\">;\n\nexport interface ClickDetail {\n button: number;\n ctrlKey: boolean;\n shiftKey: boolean;\n altKey: boolean;\n metaKey: boolean;\n}\n\nexport class CustomEventStub<T> {\n defaultPrevented = false;\n cancelBubble = false;\n constructor(\n public cancelable: boolean = false,\n public detail: T | null = null,\n ) {}\n\n preventDefault() {\n this.defaultPrevented = true;\n }\n\n stopPropagation() {\n this.cancelBubble = true;\n }\n}\n\nexport function createCustomEvent<T>({ cancelable, detail }: CustomEventInit<T>): CustomEvent<T> {\n return new CustomEventStub(cancelable, detail) as CustomEvent;\n}\n\nexport function fireCancelableEvent<T>(\n handler: CancelableEventHandler<T> | undefined,\n detail: T,\n sourceEvent?: React.SyntheticEvent | Event,\n) {\n if (!handler) {\n return false;\n }\n const event = createCustomEvent({ cancelable: true, detail });\n handler(event);\n if (event.defaultPrevented && sourceEvent) {\n sourceEvent.preventDefault();\n }\n if (event.cancelBubble && sourceEvent) {\n sourceEvent.stopPropagation();\n }\n return event.defaultPrevented;\n}\n\nexport function fireNonCancelableEvent<T = null>(handler: NonCancelableEventHandler<T> | undefined, detail?: T) {\n if (!handler) {\n return;\n }\n const event = createCustomEvent({ cancelable: false, detail });\n handler(event);\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/internal/events/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAgBtC,MAAM,OAAO,eAAe;IAG1B,YACS,aAAsB,KAAK,EAC3B,SAAmB,IAAI;QADvB,eAAU,GAAV,UAAU,CAAiB;QAC3B,WAAM,GAAN,MAAM,CAAiB;QAJhC,qBAAgB,GAAG,KAAK,CAAC;QACzB,iBAAY,GAAG,KAAK,CAAC;IAIlB,CAAC;IAEJ,cAAc;QACZ,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAC/B,CAAC;IAED,eAAe;QACb,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;IAC3B,CAAC;CACF;AAED,MAAM,UAAU,iBAAiB,CAAI,EAAE,UAAU,EAAE,MAAM,EAAsB;IAC7E,OAAO,IAAI,eAAe,CAAC,UAAU,EAAE,MAAM,CAAgB,CAAC;AAChE,CAAC;AAED,MAAM,UAAU,mBAAmB,CACjC,OAA8C,EAC9C,MAAS,EACT,WAA0C;IAE1C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,KAAK,GAAG,iBAAiB,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IAC9D,OAAO,CAAC,KAAK,CAAC,CAAC;IACf,IAAI,KAAK,CAAC,gBAAgB,IAAI,WAAW,EAAE,CAAC;QAC1C,WAAW,CAAC,cAAc,EAAE,CAAC;IAC/B,CAAC;IACD,IAAI,KAAK,CAAC,YAAY,IAAI,WAAW,EAAE,CAAC;QACtC,WAAW,CAAC,eAAe,EAAE,CAAC;IAChC,CAAC;IACD,OAAO,KAAK,CAAC,gBAAgB,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAW,OAAiD,EAAE,MAAU;IAC5G,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO;IACT,CAAC;IACD,MAAM,KAAK,GAAG,iBAAiB,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;IAC/D,OAAO,CAAC,KAAK,CAAC,CAAC;AACjB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { NonCancelableEventHandler } from \"../../types/events\";\n\nexport type { NonCancelableCustomEvent, NonCancelableEventHandler } from \"../../types/events\";\n\nexport type CancelableEventHandler<Detail = object> = (event: CustomEvent<Detail>) => void;\n\nexport interface ClickDetail {\n button: number;\n ctrlKey: boolean;\n shiftKey: boolean;\n altKey: boolean;\n metaKey: boolean;\n}\n\nexport class CustomEventStub<T> {\n defaultPrevented = false;\n cancelBubble = false;\n constructor(\n public cancelable: boolean = false,\n public detail: T | null = null,\n ) {}\n\n preventDefault() {\n this.defaultPrevented = true;\n }\n\n stopPropagation() {\n this.cancelBubble = true;\n }\n}\n\nexport function createCustomEvent<T>({ cancelable, detail }: CustomEventInit<T>): CustomEvent<T> {\n return new CustomEventStub(cancelable, detail) as CustomEvent;\n}\n\nexport function fireCancelableEvent<T>(\n handler: CancelableEventHandler<T> | undefined,\n detail: T,\n sourceEvent?: React.SyntheticEvent | Event,\n) {\n if (!handler) {\n return false;\n }\n const event = createCustomEvent({ cancelable: true, detail });\n handler(event);\n if (event.defaultPrevented && sourceEvent) {\n sourceEvent.preventDefault();\n }\n if (event.cancelBubble && sourceEvent) {\n sourceEvent.stopPropagation();\n }\n return event.defaultPrevented;\n}\n\nexport function fireNonCancelableEvent<T = null>(handler: NonCancelableEventHandler<T> | undefined, detail?: T) {\n if (!handler) {\n return;\n }\n const event = createCustomEvent({ cancelable: false, detail });\n handler(event);\n}\n"]}
@@ -8,6 +8,7 @@ export const colorPrimary600: string;
8
8
  export const colorPrimary700: string;
9
9
  export const colorPrimary800: string;
10
10
  export const colorPrimary900: string;
11
+ export const colorPrimary950: string;
11
12
  export const colorPrimary1000: string;
12
13
  export const colorNeutral50: string;
13
14
  export const colorNeutral100: string;
@@ -30,23 +31,38 @@ export const colorNeutral900: string;
30
31
  export const colorNeutral950: string;
31
32
  export const colorNeutral1000: string;
32
33
  export const colorError50: string;
34
+ export const colorError100: string;
33
35
  export const colorError400: string;
34
36
  export const colorError600: string;
37
+ export const colorError800: string;
35
38
  export const colorError900: string;
39
+ export const colorError950: string;
36
40
  export const colorError1000: string;
37
41
  export const colorSuccess50: string;
42
+ export const colorSuccess100: string;
43
+ export const colorSuccess400: string;
38
44
  export const colorSuccess500: string;
39
45
  export const colorSuccess600: string;
46
+ export const colorSuccess800: string;
47
+ export const colorSuccess950: string;
40
48
  export const colorSuccess1000: string;
41
49
  export const colorWarning50: string;
50
+ export const colorWarning100: string;
42
51
  export const colorWarning400: string;
43
52
  export const colorWarning500: string;
53
+ export const colorWarning600: string;
54
+ export const colorWarning800: string;
44
55
  export const colorWarning900: string;
56
+ export const colorWarning950: string;
45
57
  export const colorWarning1000: string;
46
58
  export const colorInfo50: string;
59
+ export const colorInfo100: string;
47
60
  export const colorInfo300: string;
48
61
  export const colorInfo400: string;
49
62
  export const colorInfo600: string;
63
+ export const colorInfo700: string;
64
+ export const colorInfo800: string;
65
+ export const colorInfo950: string;
50
66
  export const colorInfo1000: string;
51
67
  export const colorGrey50: string;
52
68
  export const colorGrey100: string;
@@ -95,6 +111,86 @@ export const colorPurple400: string;
95
111
  export const colorPurple700: string;
96
112
  export const colorAmber400: string;
97
113
  export const colorAmber500: string;
114
+ export const colorRed950: string;
115
+ export const colorOrange50: string;
116
+ export const colorOrange100: string;
117
+ export const colorOrange400: string;
118
+ export const colorOrange700: string;
119
+ export const colorOrange800: string;
120
+ export const colorOrange950: string;
121
+ export const colorYellow600: string;
122
+ export const colorYellow950: string;
123
+ export const colorLime50: string;
124
+ export const colorLime100: string;
125
+ export const colorLime400: string;
126
+ export const colorLime700: string;
127
+ export const colorLime800: string;
128
+ export const colorLime950: string;
129
+ export const colorGreen400: string;
130
+ export const colorGreen950: string;
131
+ export const colorMint50: string;
132
+ export const colorMint100: string;
133
+ export const colorMint400: string;
134
+ export const colorMint700: string;
135
+ export const colorMint800: string;
136
+ export const colorMint950: string;
137
+ export const colorIndigo50: string;
138
+ export const colorIndigo400: string;
139
+ export const colorIndigo600: string;
140
+ export const colorIndigo950: string;
141
+ export const colorPurple50: string;
142
+ export const colorPurple100: string;
143
+ export const colorPurple600: string;
144
+ export const colorPurple800: string;
145
+ export const colorPurple950: string;
146
+ export const colorTeal50: string;
147
+ export const colorTeal100: string;
148
+ export const colorTeal400: string;
149
+ export const colorTeal700: string;
150
+ export const colorTeal800: string;
151
+ export const colorTeal950: string;
152
+ export const colorCyan50: string;
153
+ export const colorCyan100: string;
154
+ export const colorCyan400: string;
155
+ export const colorCyan700: string;
156
+ export const colorCyan800: string;
157
+ export const colorCyan950: string;
158
+ export const colorBlue950: string;
159
+ export const colorViolet50: string;
160
+ export const colorViolet100: string;
161
+ export const colorViolet400: string;
162
+ export const colorViolet700: string;
163
+ export const colorViolet800: string;
164
+ export const colorViolet950: string;
165
+ export const colorFuchsia50: string;
166
+ export const colorFuchsia100: string;
167
+ export const colorFuchsia400: string;
168
+ export const colorFuchsia700: string;
169
+ export const colorFuchsia800: string;
170
+ export const colorFuchsia950: string;
171
+ export const colorMagenta50: string;
172
+ export const colorMagenta100: string;
173
+ export const colorMagenta400: string;
174
+ export const colorMagenta700: string;
175
+ export const colorMagenta800: string;
176
+ export const colorMagenta950: string;
177
+ export const colorPink50: string;
178
+ export const colorPink100: string;
179
+ export const colorPink400: string;
180
+ export const colorPink700: string;
181
+ export const colorPink800: string;
182
+ export const colorPink950: string;
183
+ export const colorRose50: string;
184
+ export const colorRose100: string;
185
+ export const colorRose400: string;
186
+ export const colorRose700: string;
187
+ export const colorRose800: string;
188
+ export const colorRose950: string;
189
+ export const colorAmber50: string;
190
+ export const colorAmber100: string;
191
+ export const colorAmber700: string;
192
+ export const colorAmber800: string;
193
+ export const colorAmber950: string;
98
194
  export const colorAwsSquidInk: string;
99
195
  export const colorTransparent: string;
100
196
  export const colorBlack: string;
@@ -643,6 +739,42 @@ export const colorTextBadgeGreen: string;
643
739
  export const colorTextBadgeBlue: string;
644
740
  export const colorTextBadgeRed: string;
645
741
  export const colorBackgroundCodeView: string;
742
+ export const colorBackgroundAccentRed: string;
743
+ export const colorBackgroundAccentYellow: string;
744
+ export const colorBackgroundAccentIndigo: string;
745
+ export const colorBackgroundAccentGreen: string;
746
+ export const colorBackgroundAccentOrange: string;
747
+ export const colorBackgroundAccentPurple: string;
748
+ export const colorBackgroundAccentMint: string;
749
+ export const colorBackgroundAccentLime: string;
750
+ export const colorBackgroundAccentGrey: string;
751
+ export const colorBackgroundAccentTeal: string;
752
+ export const colorBackgroundAccentCyan: string;
753
+ export const colorBackgroundAccentBlue: string;
754
+ export const colorBackgroundAccentViolet: string;
755
+ export const colorBackgroundAccentFuchsia: string;
756
+ export const colorBackgroundAccentMagenta: string;
757
+ export const colorBackgroundAccentPink: string;
758
+ export const colorBackgroundAccentRose: string;
759
+ export const colorBackgroundAccentAmber: string;
760
+ export const colorTextAccentRed: string;
761
+ export const colorTextAccentYellow: string;
762
+ export const colorTextAccentIndigo: string;
763
+ export const colorTextAccentGreen: string;
764
+ export const colorTextAccentOrange: string;
765
+ export const colorTextAccentPurple: string;
766
+ export const colorTextAccentMint: string;
767
+ export const colorTextAccentLime: string;
768
+ export const colorTextAccentGrey: string;
769
+ export const colorTextAccentTeal: string;
770
+ export const colorTextAccentCyan: string;
771
+ export const colorTextAccentBlue: string;
772
+ export const colorTextAccentViolet: string;
773
+ export const colorTextAccentFuchsia: string;
774
+ export const colorTextAccentMagenta: string;
775
+ export const colorTextAccentPink: string;
776
+ export const colorTextAccentRose: string;
777
+ export const colorTextAccentAmber: string;
646
778
  export const fontBoxValueLargeWeight: string;
647
779
  export const fontButtonLetterSpacing: string;
648
780
  export const fontChartDetailSize: string;