@cloudscape-design/components-themeable 3.0.1108 → 3.0.1110

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.
Files changed (120) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/alert/styles.scss +1 -1
  3. package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +86 -85
  4. package/lib/internal/template/alert/interfaces.d.ts +3 -0
  5. package/lib/internal/template/alert/interfaces.d.ts.map +1 -1
  6. package/lib/internal/template/alert/interfaces.js.map +1 -1
  7. package/lib/internal/template/alert/internal.js +2 -2
  8. package/lib/internal/template/alert/internal.js.map +1 -1
  9. package/lib/internal/template/alert/style.d.ts +3 -0
  10. package/lib/internal/template/alert/style.d.ts.map +1 -1
  11. package/lib/internal/template/alert/style.js +9 -0
  12. package/lib/internal/template/alert/style.js.map +1 -1
  13. package/lib/internal/template/alert/styles.css.js +27 -27
  14. package/lib/internal/template/alert/styles.scoped.css +50 -50
  15. package/lib/internal/template/alert/styles.selectors.js +27 -27
  16. package/lib/internal/template/annotation-context/annotation/styles.css.js +24 -24
  17. package/lib/internal/template/annotation-context/annotation/styles.scoped.css +32 -32
  18. package/lib/internal/template/annotation-context/annotation/styles.selectors.js +24 -24
  19. package/lib/internal/template/app-layout/classic.js +11 -11
  20. package/lib/internal/template/app-layout/classic.js.map +1 -1
  21. package/lib/internal/template/app-layout/notifications/styles.css.js +3 -3
  22. package/lib/internal/template/app-layout/notifications/styles.scoped.css +7 -7
  23. package/lib/internal/template/app-layout/notifications/styles.selectors.js +3 -3
  24. package/lib/internal/template/app-layout/utils/use-focus-control.d.ts +4 -1
  25. package/lib/internal/template/app-layout/utils/use-focus-control.d.ts.map +1 -1
  26. package/lib/internal/template/app-layout/utils/use-focus-control.js +7 -4
  27. package/lib/internal/template/app-layout/utils/use-focus-control.js.map +1 -1
  28. package/lib/internal/template/app-layout/visual-refresh/context.d.ts.map +1 -1
  29. package/lib/internal/template/app-layout/visual-refresh/context.js +10 -12
  30. package/lib/internal/template/app-layout/visual-refresh/context.js.map +1 -1
  31. package/lib/internal/template/app-layout/visual-refresh/styles.css.js +86 -86
  32. package/lib/internal/template/app-layout/visual-refresh/styles.scoped.css +258 -258
  33. package/lib/internal/template/app-layout/visual-refresh/styles.selectors.js +86 -86
  34. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.css.js +25 -25
  35. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.scoped.css +73 -73
  36. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.selectors.js +25 -25
  37. package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/styles.css.js +4 -4
  38. package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/styles.scoped.css +7 -7
  39. package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/styles.selectors.js +4 -4
  40. package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/styles.css.js +25 -25
  41. package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/styles.scoped.css +50 -50
  42. package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/styles.selectors.js +25 -25
  43. package/lib/internal/template/app-layout/visual-refresh-toolbar/state/use-app-layout.js +10 -10
  44. package/lib/internal/template/app-layout/visual-refresh-toolbar/state/use-app-layout.js.map +1 -1
  45. package/lib/internal/template/area-chart/model/use-chart-model.d.ts.map +1 -1
  46. package/lib/internal/template/area-chart/model/use-chart-model.js +6 -0
  47. package/lib/internal/template/area-chart/model/use-chart-model.js.map +1 -1
  48. package/lib/internal/template/area-chart/model/utils.d.ts +1 -1
  49. package/lib/internal/template/area-chart/model/utils.d.ts.map +1 -1
  50. package/lib/internal/template/area-chart/model/utils.js +1 -1
  51. package/lib/internal/template/area-chart/model/utils.js.map +1 -1
  52. package/lib/internal/template/attribute-editor/styles.css.js +15 -15
  53. package/lib/internal/template/attribute-editor/styles.scoped.css +28 -28
  54. package/lib/internal/template/attribute-editor/styles.selectors.js +15 -15
  55. package/lib/internal/template/breadcrumb-group/item/styles.css.js +7 -7
  56. package/lib/internal/template/breadcrumb-group/item/styles.scoped.css +28 -28
  57. package/lib/internal/template/breadcrumb-group/item/styles.selectors.js +7 -7
  58. package/lib/internal/template/button/styles.css.js +22 -22
  59. package/lib/internal/template/button/styles.scoped.css +256 -256
  60. package/lib/internal/template/button/styles.selectors.js +22 -22
  61. package/lib/internal/template/button-dropdown/item-element/styles.css.js +16 -16
  62. package/lib/internal/template/button-dropdown/item-element/styles.scoped.css +27 -27
  63. package/lib/internal/template/button-dropdown/item-element/styles.selectors.js +16 -16
  64. package/lib/internal/template/checkbox/styles.css.js +3 -3
  65. package/lib/internal/template/checkbox/styles.scoped.css +11 -11
  66. package/lib/internal/template/checkbox/styles.selectors.js +3 -3
  67. package/lib/internal/template/content-layout/styles.css.js +14 -14
  68. package/lib/internal/template/content-layout/styles.scoped.css +27 -27
  69. package/lib/internal/template/content-layout/styles.selectors.js +14 -14
  70. package/lib/internal/template/flashbar/styles.css.js +50 -50
  71. package/lib/internal/template/flashbar/styles.scoped.css +187 -187
  72. package/lib/internal/template/flashbar/styles.selectors.js +50 -50
  73. package/lib/internal/template/help-panel/styles.css.js +6 -6
  74. package/lib/internal/template/help-panel/styles.scoped.css +73 -73
  75. package/lib/internal/template/help-panel/styles.selectors.js +6 -6
  76. package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
  77. package/lib/internal/template/internal/components/drag-handle/hooks/use-drag-handle-interaction-state.js +1 -1
  78. package/lib/internal/template/internal/components/drag-handle/hooks/use-drag-handle-interaction-state.js.map +1 -1
  79. package/lib/internal/template/internal/components/drag-handle-wrapper/styles.css.js +21 -21
  80. package/lib/internal/template/internal/components/drag-handle-wrapper/styles.scoped.css +44 -44
  81. package/lib/internal/template/internal/components/drag-handle-wrapper/styles.selectors.js +21 -21
  82. package/lib/internal/template/internal/components/dropdown/styles.css.js +20 -20
  83. package/lib/internal/template/internal/components/dropdown/styles.scoped.css +38 -38
  84. package/lib/internal/template/internal/components/dropdown/styles.selectors.js +20 -20
  85. package/lib/internal/template/internal/components/token-list/styles.css.js +10 -10
  86. package/lib/internal/template/internal/components/token-list/styles.scoped.css +25 -25
  87. package/lib/internal/template/internal/components/token-list/styles.selectors.js +10 -10
  88. package/lib/internal/template/internal/environment.js +2 -2
  89. package/lib/internal/template/internal/environment.json +2 -2
  90. package/lib/internal/template/internal/generated/custom-css-properties/index.d.ts +1 -0
  91. package/lib/internal/template/internal/generated/custom-css-properties/index.d.ts.map +1 -1
  92. package/lib/internal/template/internal/generated/custom-css-properties/index.js +85 -84
  93. package/lib/internal/template/internal/generated/custom-css-properties/index.js.map +1 -1
  94. package/lib/internal/template/link/styles.css.js +20 -20
  95. package/lib/internal/template/link/styles.scoped.css +103 -103
  96. package/lib/internal/template/link/styles.selectors.js +20 -20
  97. package/lib/internal/template/mixed-line-bar-chart/chart-container.js +1 -1
  98. package/lib/internal/template/mixed-line-bar-chart/chart-container.js.map +1 -1
  99. package/lib/internal/template/property-filter/interfaces.d.ts +2 -0
  100. package/lib/internal/template/property-filter/interfaces.d.ts.map +1 -1
  101. package/lib/internal/template/property-filter/interfaces.js.map +1 -1
  102. package/lib/internal/template/radio-group/styles.css.js +10 -10
  103. package/lib/internal/template/radio-group/styles.scoped.css +22 -22
  104. package/lib/internal/template/radio-group/styles.selectors.js +10 -10
  105. package/lib/internal/template/slider/styles.css.js +26 -26
  106. package/lib/internal/template/slider/styles.scoped.css +86 -86
  107. package/lib/internal/template/slider/styles.selectors.js +26 -26
  108. package/lib/internal/template/spinner/styles.css.js +13 -13
  109. package/lib/internal/template/spinner/styles.scoped.css +39 -39
  110. package/lib/internal/template/spinner/styles.selectors.js +13 -13
  111. package/lib/internal/template/tag-editor/styles.css.js +3 -3
  112. package/lib/internal/template/tag-editor/styles.scoped.css +13 -13
  113. package/lib/internal/template/tag-editor/styles.selectors.js +3 -3
  114. package/lib/internal/template/text-content/styles.css.js +1 -1
  115. package/lib/internal/template/text-content/styles.scoped.css +66 -66
  116. package/lib/internal/template/text-content/styles.selectors.js +1 -1
  117. package/lib/internal/template/toggle/styles.css.js +10 -10
  118. package/lib/internal/template/toggle/styles.scoped.css +23 -23
  119. package/lib/internal/template/toggle/styles.selectors.js +10 -10
  120. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"use-chart-model.js","sourceRoot":"","sources":["../../../../src/area-chart/model/use-chart-model.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAc,EAAyB,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEjF,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAIlF,OAAO,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAC7F,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,SAAS,MAAM,iCAAiC,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,iBAAiB,MAAM,uBAAuB,CAAC;AACtD,OAAO,qBAAqB,MAAM,2BAA2B,CAAC;AAE9D,OAAO,iBAAiB,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAC3B,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAC9B,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAoB5B,6FAA6F;AAC7F,MAAM,CAAC,OAAO,UAAU,aAAa,CAAqC,EACxE,KAAK,EACL,SAAS,EACT,cAAc,EAAE,SA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AAE,cAAc;gBAC3B,SAAS,EAAE,YAAY;gBACvB,cAAc,EAAE,iBAAiB;gBACjC,UAAU;aACX;SACF,CAAC;IACJ,CAAC,EAAE;QACD,SAAS;QACT,MAAM;QACN,OAAO;QACP,OAAO;QACP,UAAU;QACV,UAAU;QACV,MAAM;QACN,KAAK;QACL,sBAAsB;QACtB,UAAU;QACV,KAAK;KACN,CAAC,CAAC;IAEH,8CAA8C;IAC9C,WAAW,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,CAAC;IAExF,uEAAuE;IACvE,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,iBAAiB,KAAK,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,iBAAiB,EAAE;YACpE,KAAK,CAAC,YAAY,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAAC;SACvD;IACH,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAE/B,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { MouseEvent, RefObject, useEffect, useMemo, useRef } from 'react';\n\nimport { nodeContains } from '@cloudscape-design/component-toolkit/dom';\nimport { useStableCallback } from '@cloudscape-design/component-toolkit/internal';\n\nimport { XDomain, XScaleType, YDomain, YScaleType } from '../../internal/components/cartesian-chart/interfaces';\nimport { ChartPlotRef } from '../../internal/components/chart-plot';\nimport { useHeightMeasure } from '../../internal/hooks/container-queries/use-height-measure';\nimport { KeyCode } from '../../internal/keycode';\nimport { circleIndex } from '../../internal/utils/circle-index';\nimport handleKey from '../../internal/utils/handle-key';\nimport { nodeBelongs } from '../../internal/utils/node-belongs';\nimport { throttle } from '../../internal/utils/throttle';\nimport { useReaction } from '../async-store';\nimport { AreaChartProps } from '../interfaces';\nimport computeChartProps from './compute-chart-props';\nimport createSeriesDecorator from './create-series-decorator';\nimport { ChartModel } from './index';\nimport InteractionsStore from './interactions-store';\nimport { findClosest } from './utils';\n\nconst MAX_HOVER_MARGIN = 6;\nconst SVG_HOVER_THROTTLE = 25;\nconst POPOVER_DEADZONE = 12;\n\nexport interface UseChartModelProps<T extends AreaChartProps.DataTypes> {\n isRtl?: boolean;\n fitHeight?: boolean;\n externalSeries: readonly AreaChartProps.Series<T>[];\n visibleSeries: readonly AreaChartProps.Series<T>[];\n setVisibleSeries: (series: readonly AreaChartProps.Series<T>[]) => void;\n highlightedSeries: null | AreaChartProps.Series<T>;\n setHighlightedSeries: (series: null | AreaChartProps.Series<T>) => void;\n xDomain?: XDomain<T>;\n yDomain?: YDomain;\n xScaleType: XScaleType;\n yScaleType: YScaleType;\n height: number;\n width: number;\n popoverRef: RefObject<HTMLElement>;\n statusType: 'loading' | 'finished' | 'error';\n}\n\n// Represents the core the chart logic, including the model of all allowed user interactions.\nexport default function useChartModel<T extends AreaChartProps.DataTypes>({\n isRtl,\n fitHeight,\n externalSeries: allSeries,\n visibleSeries: series,\n setVisibleSeries,\n highlightedSeries,\n setHighlightedSeries,\n xDomain,\n yDomain,\n xScaleType,\n yScaleType,\n height: explicitHeight,\n width,\n popoverRef,\n statusType,\n}: UseChartModelProps<T>): ChartModel<T> {\n // Chart elements refs used in handlers.\n const plotRef = useRef<ChartPlotRef>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const verticalMarkerRef = useRef<SVGLineElement>(null);\n\n const plotMeasureRef = useRef<SVGLineElement>(null);\n const hasVisibleSeries = series.length > 0;\n const height =\n useHeightMeasure(() => plotMeasureRef.current, !fitHeight, [hasVisibleSeries, statusType]) ?? explicitHeight;\n const stableSetVisibleSeries = useStableCallback(setVisibleSeries);\n\n const model = useMemo(() => {\n // Compute scales, ticks and two-dimensional plots.\n const computed = computeChartProps({\n isRtl,\n series,\n xDomain,\n yDomain,\n xScaleType,\n yScaleType,\n height,\n width,\n });\n\n // A store for chart interactions that don't require plot recomputation.\n const interactions = new InteractionsStore(series, computed.plot);\n\n const containsMultipleSeries = interactions.series.length > 1;\n\n // A series decorator to provide extra props such as color and marker type.\n const getInternalSeries = createSeriesDecorator(allSeries);\n\n const isMouseOverPopover = (clientX: number, clientY: number) => {\n if (popoverRef.current?.firstChild) {\n const popoverPosition = (popoverRef.current.firstChild as HTMLElement).getBoundingClientRect();\n if (\n clientX > popoverPosition.x - POPOVER_DEADZONE &&\n clientX < popoverPosition.x + popoverPosition.width + POPOVER_DEADZONE &&\n clientY > popoverPosition.y - POPOVER_DEADZONE &&\n clientY < popoverPosition.y + popoverPosition.height + POPOVER_DEADZONE\n ) {\n return true;\n }\n }\n return false;\n };\n\n // A Callback for svg mouseover to hover the plot points.\n // Throttling is necessary for a substantially smoother customer experience.\n const onSVGMouseMoveThrottled = throttle((clientX: number, clientY: number) => {\n // No hover logic when the popover is pinned or no data available.\n if (\n interactions.get().isPopoverPinned ||\n !plotRef.current ||\n interactions.plot.xy.length === 0 ||\n isMouseOverPopover(clientX, clientY)\n ) {\n return;\n }\n\n const svgRect = plotRef.current.svg.getBoundingClientRect();\n const offsetX = clientX - svgRect.left;\n const offsetY = clientY - svgRect.top;\n\n const closestX = findClosest(interactions.plot.xy, offsetX, xPoints => xPoints[0].scaled.x);\n const closestPoint = findClosest(closestX, offsetY, point => point.scaled.y1);\n\n // If close enough to the point - highlight the point and its column.\n // If not - only highlight the closest column.\n if (\n Math.abs(offsetX - closestPoint.scaled.x) < MAX_HOVER_MARGIN &&\n Math.abs(offsetY - closestPoint.scaled.y1) < MAX_HOVER_MARGIN\n ) {\n interactions.highlightPoint(closestPoint);\n } else {\n interactions.highlightX(closestX);\n }\n }, SVG_HOVER_THROTTLE);\n\n const onSVGMouseMove = ({ clientX, clientY }: React.MouseEvent<SVGElement>) =>\n onSVGMouseMoveThrottled(clientX, clientY);\n\n // A callback for svg mouseout to clear all highlights.\n const onSVGMouseOut = (event: React.MouseEvent<SVGElement>) => {\n // Because the mouseover is throttled, in can occur slightly after the mouseout,\n // neglecting its effect; cancelling the throttled function prevents that.\n onSVGMouseMoveThrottled.cancel();\n\n // No hover logic when the popover is pinned or mouse is over popover\n if (interactions.get().isPopoverPinned || isMouseOverPopover(event.clientX, event.clientY)) {\n return;\n }\n\n // Check if the target is contained within svg to allow hovering on the popover body.\n if (!nodeContains(plotRef.current!.svg, event.relatedTarget as Element)) {\n interactions.clearHighlightedLegend();\n interactions.clearHighlight();\n }\n };\n\n // A callback for svg click to pin/unpin the popover.\n const onSVGMouseDown = (event: React.MouseEvent<SVGSVGElement>) => {\n interactions.togglePopoverPin();\n event.preventDefault();\n };\n\n const moveWithinXAxis = (direction: -1 | 1) => {\n if (interactions.get().highlightedPoint) {\n return moveWithinSeries(direction);\n } else if (containsMultipleSeries) {\n const { highlightedX } = interactions.get();\n if (highlightedX) {\n const currentXIndex = highlightedX[0].index.x;\n const nextXIndex = circleIndex(currentXIndex + direction, [0, interactions.plot.xy.length - 1]);\n interactions.highlightX(interactions.plot.xy[nextXIndex]);\n }\n }\n };\n\n // A helper function to highlight the next or previous point within selected series.\n const moveWithinSeries = (direction: -1 | 1) => {\n // Can only use motion when a particular point is highlighted.\n const point = interactions.get().highlightedPoint;\n if (!point) {\n return;\n }\n\n // Take the index of the currently highlighted series.\n const sIndex = point.index.s;\n // Take the incremented(circularly) x-index of the currently highlighted point.\n const xIndex = circleIndex(point.index.x + direction, [0, interactions.plot.xs.length - 1]);\n // Highlight the next point using x:s grouped data.\n interactions.highlightPoint(interactions.plot.xs[xIndex][sIndex]);\n };\n\n // A helper function to highlight the next or previous point within the selected column.\n const moveBetweenSeries = (direction: -1 | 1) => {\n const point = interactions.get().highlightedPoint;\n if (!point) {\n const { highlightedX } = interactions.get();\n if (highlightedX) {\n const xIndex = highlightedX[0].index.x;\n const points = interactions.plot.xy[xIndex];\n const yIndex = direction === 1 ? 0 : points.length - 1;\n interactions.highlightPoint(points[yIndex]);\n }\n return;\n }\n\n // Take the index of the currently highlighted column.\n const xIndex = point.index.x;\n const currentYIndex = point.index.y;\n\n if (\n containsMultipleSeries &&\n ((currentYIndex === 0 && direction === -1) ||\n (currentYIndex === interactions.plot.xy[xIndex].length - 1 && direction === 1))\n ) {\n interactions.highlightX(interactions.plot.xy[xIndex]);\n } else {\n // Take the incremented(circularly) y-index of the currently highlighted point.\n const nextYIndex = circleIndex(currentYIndex + direction, [0, interactions.plot.xy[xIndex].length - 1]);\n // Highlight the next point using x:y grouped data.\n interactions.highlightPoint(interactions.plot.xy[xIndex][nextYIndex]);\n }\n };\n\n // A callback for svg keydown to enable motions and popover pin with the keyboard.\n const onSVGKeyDown = (event: React.KeyboardEvent<HTMLElement | SVGElement>) => {\n const keyCode = event.keyCode;\n if (\n keyCode !== KeyCode.up &&\n keyCode !== KeyCode.right &&\n keyCode !== KeyCode.down &&\n keyCode !== KeyCode.left &&\n keyCode !== KeyCode.space &&\n keyCode !== KeyCode.enter\n ) {\n return;\n }\n\n // Preventing default fixes an issue in Safari+VO when VO additionally interprets arrow keys as its commands.\n event.preventDefault();\n\n // No keydown logic when the popover is pinned.\n if (interactions.get().isPopoverPinned) {\n return;\n }\n\n handleKey(event, {\n onBlockEnd: () => moveBetweenSeries(-1),\n onBlockStart: () => moveBetweenSeries(1),\n onInlineStart: () => moveWithinXAxis(-1),\n onInlineEnd: () => moveWithinXAxis(1),\n onActivate: () => interactions.pinPopover(),\n });\n };\n\n const highlightFirstX = () => {\n interactions.highlightX(interactions.plot.xy[0]);\n };\n\n // A callback for application focus to highlight series.\n const onApplicationFocus = (_event: React.FocusEvent, trigger: 'mouse' | 'keyboard') => {\n // When focus is caused by a click event nothing is expected as clicks are handled separately.\n if (trigger === 'keyboard') {\n const { highlightedX, highlightedPoint, highlightedSeries, legendSeries } = interactions.get();\n if (containsMultipleSeries && !highlightedX && !highlightedPoint && !highlightedSeries && !legendSeries) {\n highlightFirstX();\n } else if (!highlightedX) {\n interactions.highlightFirstPoint();\n }\n }\n };\n\n // A callback for application blur to clear all highlights unless the popover is pinned.\n const onApplicationBlur = (event: React.FocusEvent<Element>) => {\n // Pinned popover stays pinned even if the focus is lost.\n // If blur is not caused by the popover, forget the previously highlighted point.\n if (!nodeBelongs(containerRef.current, event.relatedTarget) && !interactions.get().isPopoverPinned) {\n interactions.clearHighlight();\n }\n };\n\n const onFilterSeries = (series: readonly AreaChartProps.Series<T>[]) => {\n stableSetVisibleSeries(series);\n };\n\n const onLegendHighlight = (series: null | AreaChartProps.Series<T>) => {\n interactions.highlightSeries(series);\n };\n\n const onPopoverDismiss = (outsideClick?: boolean) => {\n interactions.unpinPopover();\n\n // Return focus back to the application or plot (when no point is highlighted).\n if (!outsideClick) {\n // The delay is needed to bypass focus events caused by click or keypress needed to unpin the popover.\n setTimeout(() => {\n if (interactions.get().highlightedPoint || interactions.get().highlightedX) {\n plotRef.current!.focusApplication();\n } else {\n interactions.clearHighlight();\n plotRef.current!.focusPlot();\n }\n }, 0);\n }\n };\n\n const onContainerBlur = () => {\n interactions.clearState();\n };\n\n const onDocumentKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n interactions.clearHighlight();\n interactions.clearHighlightedLegend();\n }\n };\n\n const onPopoverLeave = (event: MouseEvent) => {\n if (nodeContains(plotRef.current!.svg, event.relatedTarget as Element) || interactions.get().isPopoverPinned) {\n return;\n }\n interactions.clearHighlight();\n interactions.clearHighlightedLegend();\n };\n return {\n width,\n height,\n series,\n allSeries,\n getInternalSeries,\n computed,\n interactions,\n handlers: {\n onSVGMouseMove,\n onSVGMouseOut,\n onSVGMouseDown,\n onSVGKeyDown,\n onApplicationFocus,\n onApplicationBlur,\n onFilterSeries,\n onLegendHighlight,\n onPopoverDismiss,\n onContainerBlur,\n onDocumentKeyDown,\n onPopoverLeave,\n },\n refs: {\n plot: plotRef,\n plotMeasure: plotMeasureRef,\n container: containerRef,\n verticalMarker: verticalMarkerRef,\n popoverRef,\n },\n };\n }, [\n allSeries,\n series,\n xDomain,\n yDomain,\n xScaleType,\n yScaleType,\n height,\n width,\n stableSetVisibleSeries,\n popoverRef,\n isRtl,\n ]);\n\n // Notify client when series highlight change.\n useReaction(model.interactions, state => state.highlightedSeries, setHighlightedSeries);\n\n // Update interactions store when series highlight in a controlled way.\n useEffect(() => {\n if (highlightedSeries !== model.interactions.get().highlightedSeries) {\n model.interactions.highlightSeries(highlightedSeries);\n }\n }, [model, highlightedSeries]);\n\n return model;\n}\n"]}
1
+ {"version":3,"file":"use-chart-model.js","sourceRoot":"","sources":["../../../../src/area-chart/model/use-chart-model.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAc,EAAyB,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEjF,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAIlF,OAAO,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAC7F,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,SAAS,MAAM,iCAAiC,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,iBAAiB,MAAM,uBAAuB,CAAC;AACtD,OAAO,qBAAqB,MAAM,2BAA2B,CAAC;AAE9D,OAAO,iBAAiB,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAC3B,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAC9B,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAoB5B,6FAA6F;AAC7F,MAA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,YAAY;gBACZ,kBAAkB;gBAClB,iBAAiB;gBACjB,cAAc;gBACd,iBAAiB;gBACjB,gBAAgB;gBAChB,eAAe;gBACf,iBAAiB;gBACjB,cAAc;aACf;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,cAAc;gBAC3B,SAAS,EAAE,YAAY;gBACvB,cAAc,EAAE,iBAAiB;gBACjC,UAAU;aACX;SACF,CAAC;IACJ,CAAC,EAAE;QACD,SAAS;QACT,MAAM;QACN,OAAO;QACP,OAAO;QACP,UAAU;QACV,UAAU;QACV,MAAM;QACN,KAAK;QACL,sBAAsB;QACtB,UAAU;QACV,KAAK;KACN,CAAC,CAAC;IAEH,8CAA8C;IAC9C,WAAW,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,CAAC;IAExF,uEAAuE;IACvE,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,iBAAiB,KAAK,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,iBAAiB,EAAE;YACpE,KAAK,CAAC,YAAY,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAAC;SACvD;IACH,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAE/B,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { MouseEvent, RefObject, useEffect, useMemo, useRef } from 'react';\n\nimport { nodeContains } from '@cloudscape-design/component-toolkit/dom';\nimport { useStableCallback } from '@cloudscape-design/component-toolkit/internal';\n\nimport { XDomain, XScaleType, YDomain, YScaleType } from '../../internal/components/cartesian-chart/interfaces';\nimport { ChartPlotRef } from '../../internal/components/chart-plot';\nimport { useHeightMeasure } from '../../internal/hooks/container-queries/use-height-measure';\nimport { KeyCode } from '../../internal/keycode';\nimport { circleIndex } from '../../internal/utils/circle-index';\nimport handleKey from '../../internal/utils/handle-key';\nimport { nodeBelongs } from '../../internal/utils/node-belongs';\nimport { throttle } from '../../internal/utils/throttle';\nimport { useReaction } from '../async-store';\nimport { AreaChartProps } from '../interfaces';\nimport computeChartProps from './compute-chart-props';\nimport createSeriesDecorator from './create-series-decorator';\nimport { ChartModel } from './index';\nimport InteractionsStore from './interactions-store';\nimport { findClosest } from './utils';\n\nconst MAX_HOVER_MARGIN = 6;\nconst SVG_HOVER_THROTTLE = 25;\nconst POPOVER_DEADZONE = 12;\n\nexport interface UseChartModelProps<T extends AreaChartProps.DataTypes> {\n isRtl?: boolean;\n fitHeight?: boolean;\n externalSeries: readonly AreaChartProps.Series<T>[];\n visibleSeries: readonly AreaChartProps.Series<T>[];\n setVisibleSeries: (series: readonly AreaChartProps.Series<T>[]) => void;\n highlightedSeries: null | AreaChartProps.Series<T>;\n setHighlightedSeries: (series: null | AreaChartProps.Series<T>) => void;\n xDomain?: XDomain<T>;\n yDomain?: YDomain;\n xScaleType: XScaleType;\n yScaleType: YScaleType;\n height: number;\n width: number;\n popoverRef: RefObject<HTMLElement>;\n statusType: 'loading' | 'finished' | 'error';\n}\n\n// Represents the core the chart logic, including the model of all allowed user interactions.\nexport default function useChartModel<T extends AreaChartProps.DataTypes>({\n isRtl,\n fitHeight,\n externalSeries: allSeries,\n visibleSeries: series,\n setVisibleSeries,\n highlightedSeries,\n setHighlightedSeries,\n xDomain,\n yDomain,\n xScaleType,\n yScaleType,\n height: explicitHeight,\n width,\n popoverRef,\n statusType,\n}: UseChartModelProps<T>): ChartModel<T> {\n // Chart elements refs used in handlers.\n const plotRef = useRef<ChartPlotRef>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const verticalMarkerRef = useRef<SVGLineElement>(null);\n\n const plotMeasureRef = useRef<SVGLineElement>(null);\n const hasVisibleSeries = series.length > 0;\n const height =\n useHeightMeasure(() => plotMeasureRef.current, !fitHeight, [hasVisibleSeries, statusType]) ?? explicitHeight;\n const stableSetVisibleSeries = useStableCallback(setVisibleSeries);\n\n const model = useMemo(() => {\n // Compute scales, ticks and two-dimensional plots.\n const computed = computeChartProps({\n isRtl,\n series,\n xDomain,\n yDomain,\n xScaleType,\n yScaleType,\n height,\n width,\n });\n\n // A store for chart interactions that don't require plot recomputation.\n const interactions = new InteractionsStore(series, computed.plot);\n\n const containsMultipleSeries = interactions.series.length > 1;\n\n // A series decorator to provide extra props such as color and marker type.\n const getInternalSeries = createSeriesDecorator(allSeries);\n\n const isMouseOverPopover = (clientX: number, clientY: number) => {\n if (popoverRef.current?.firstChild) {\n const popoverPosition = (popoverRef.current.firstChild as HTMLElement).getBoundingClientRect();\n if (\n clientX > popoverPosition.x - POPOVER_DEADZONE &&\n clientX < popoverPosition.x + popoverPosition.width + POPOVER_DEADZONE &&\n clientY > popoverPosition.y - POPOVER_DEADZONE &&\n clientY < popoverPosition.y + popoverPosition.height + POPOVER_DEADZONE\n ) {\n return true;\n }\n }\n return false;\n };\n\n // A Callback for svg mouseover to hover the plot points.\n // Throttling is necessary for a substantially smoother customer experience.\n const onSVGMouseMoveThrottled = throttle((clientX: number, clientY: number) => {\n // No hover logic when the popover is pinned or no data available.\n if (\n interactions.get().isPopoverPinned ||\n !plotRef.current ||\n interactions.plot.xy.length === 0 ||\n isMouseOverPopover(clientX, clientY)\n ) {\n return;\n }\n\n const svgRect = plotRef.current.svg.getBoundingClientRect();\n const offsetX = clientX - svgRect.left;\n const offsetY = clientY - svgRect.top;\n\n const closestX = findClosest(interactions.plot.xy, offsetX, xPoints => xPoints[0].scaled.x);\n if (closestX === null) {\n return;\n }\n\n const closestPoint = findClosest(closestX, offsetY, point => point.scaled.y1);\n if (closestPoint === null) {\n return;\n }\n\n // If close enough to the point - highlight the point and its column.\n // If not - only highlight the closest column.\n if (\n Math.abs(offsetX - closestPoint.scaled.x) < MAX_HOVER_MARGIN &&\n Math.abs(offsetY - closestPoint.scaled.y1) < MAX_HOVER_MARGIN\n ) {\n interactions.highlightPoint(closestPoint);\n } else {\n interactions.highlightX(closestX);\n }\n }, SVG_HOVER_THROTTLE);\n\n const onSVGMouseMove = ({ clientX, clientY }: React.MouseEvent<SVGElement>) =>\n onSVGMouseMoveThrottled(clientX, clientY);\n\n // A callback for svg mouseout to clear all highlights.\n const onSVGMouseOut = (event: React.MouseEvent<SVGElement>) => {\n // Because the mouseover is throttled, in can occur slightly after the mouseout,\n // neglecting its effect; cancelling the throttled function prevents that.\n onSVGMouseMoveThrottled.cancel();\n\n // No hover logic when the popover is pinned or mouse is over popover\n if (interactions.get().isPopoverPinned || isMouseOverPopover(event.clientX, event.clientY)) {\n return;\n }\n\n // Check if the target is contained within svg to allow hovering on the popover body.\n if (!nodeContains(plotRef.current!.svg, event.relatedTarget as Element)) {\n interactions.clearHighlightedLegend();\n interactions.clearHighlight();\n }\n };\n\n // A callback for svg click to pin/unpin the popover.\n const onSVGMouseDown = (event: React.MouseEvent<SVGSVGElement>) => {\n interactions.togglePopoverPin();\n event.preventDefault();\n };\n\n const moveWithinXAxis = (direction: -1 | 1) => {\n if (interactions.get().highlightedPoint) {\n return moveWithinSeries(direction);\n } else if (containsMultipleSeries) {\n const { highlightedX } = interactions.get();\n if (highlightedX) {\n const currentXIndex = highlightedX[0].index.x;\n const nextXIndex = circleIndex(currentXIndex + direction, [0, interactions.plot.xy.length - 1]);\n interactions.highlightX(interactions.plot.xy[nextXIndex]);\n }\n }\n };\n\n // A helper function to highlight the next or previous point within selected series.\n const moveWithinSeries = (direction: -1 | 1) => {\n // Can only use motion when a particular point is highlighted.\n const point = interactions.get().highlightedPoint;\n if (!point) {\n return;\n }\n\n // Take the index of the currently highlighted series.\n const sIndex = point.index.s;\n // Take the incremented(circularly) x-index of the currently highlighted point.\n const xIndex = circleIndex(point.index.x + direction, [0, interactions.plot.xs.length - 1]);\n // Highlight the next point using x:s grouped data.\n interactions.highlightPoint(interactions.plot.xs[xIndex][sIndex]);\n };\n\n // A helper function to highlight the next or previous point within the selected column.\n const moveBetweenSeries = (direction: -1 | 1) => {\n const point = interactions.get().highlightedPoint;\n if (!point) {\n const { highlightedX } = interactions.get();\n if (highlightedX) {\n const xIndex = highlightedX[0].index.x;\n const points = interactions.plot.xy[xIndex];\n const yIndex = direction === 1 ? 0 : points.length - 1;\n interactions.highlightPoint(points[yIndex]);\n }\n return;\n }\n\n // Take the index of the currently highlighted column.\n const xIndex = point.index.x;\n const currentYIndex = point.index.y;\n\n if (\n containsMultipleSeries &&\n ((currentYIndex === 0 && direction === -1) ||\n (currentYIndex === interactions.plot.xy[xIndex].length - 1 && direction === 1))\n ) {\n interactions.highlightX(interactions.plot.xy[xIndex]);\n } else {\n // Take the incremented(circularly) y-index of the currently highlighted point.\n const nextYIndex = circleIndex(currentYIndex + direction, [0, interactions.plot.xy[xIndex].length - 1]);\n // Highlight the next point using x:y grouped data.\n interactions.highlightPoint(interactions.plot.xy[xIndex][nextYIndex]);\n }\n };\n\n // A callback for svg keydown to enable motions and popover pin with the keyboard.\n const onSVGKeyDown = (event: React.KeyboardEvent<HTMLElement | SVGElement>) => {\n const keyCode = event.keyCode;\n if (\n keyCode !== KeyCode.up &&\n keyCode !== KeyCode.right &&\n keyCode !== KeyCode.down &&\n keyCode !== KeyCode.left &&\n keyCode !== KeyCode.space &&\n keyCode !== KeyCode.enter\n ) {\n return;\n }\n\n // Preventing default fixes an issue in Safari+VO when VO additionally interprets arrow keys as its commands.\n event.preventDefault();\n\n // No keydown logic when the popover is pinned.\n if (interactions.get().isPopoverPinned) {\n return;\n }\n\n handleKey(event, {\n onBlockEnd: () => moveBetweenSeries(-1),\n onBlockStart: () => moveBetweenSeries(1),\n onInlineStart: () => moveWithinXAxis(-1),\n onInlineEnd: () => moveWithinXAxis(1),\n onActivate: () => interactions.pinPopover(),\n });\n };\n\n const highlightFirstX = () => {\n interactions.highlightX(interactions.plot.xy[0]);\n };\n\n // A callback for application focus to highlight series.\n const onApplicationFocus = (_event: React.FocusEvent, trigger: 'mouse' | 'keyboard') => {\n // When focus is caused by a click event nothing is expected as clicks are handled separately.\n if (trigger === 'keyboard') {\n const { highlightedX, highlightedPoint, highlightedSeries, legendSeries } = interactions.get();\n if (containsMultipleSeries && !highlightedX && !highlightedPoint && !highlightedSeries && !legendSeries) {\n highlightFirstX();\n } else if (!highlightedX) {\n interactions.highlightFirstPoint();\n }\n }\n };\n\n // A callback for application blur to clear all highlights unless the popover is pinned.\n const onApplicationBlur = (event: React.FocusEvent<Element>) => {\n // Pinned popover stays pinned even if the focus is lost.\n // If blur is not caused by the popover, forget the previously highlighted point.\n if (!nodeBelongs(containerRef.current, event.relatedTarget) && !interactions.get().isPopoverPinned) {\n interactions.clearHighlight();\n }\n };\n\n const onFilterSeries = (series: readonly AreaChartProps.Series<T>[]) => {\n stableSetVisibleSeries(series);\n };\n\n const onLegendHighlight = (series: null | AreaChartProps.Series<T>) => {\n interactions.highlightSeries(series);\n };\n\n const onPopoverDismiss = (outsideClick?: boolean) => {\n interactions.unpinPopover();\n\n // Return focus back to the application or plot (when no point is highlighted).\n if (!outsideClick) {\n // The delay is needed to bypass focus events caused by click or keypress needed to unpin the popover.\n setTimeout(() => {\n if (interactions.get().highlightedPoint || interactions.get().highlightedX) {\n plotRef.current!.focusApplication();\n } else {\n interactions.clearHighlight();\n plotRef.current!.focusPlot();\n }\n }, 0);\n }\n };\n\n const onContainerBlur = () => {\n interactions.clearState();\n };\n\n const onDocumentKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n interactions.clearHighlight();\n interactions.clearHighlightedLegend();\n }\n };\n\n const onPopoverLeave = (event: MouseEvent) => {\n if (nodeContains(plotRef.current!.svg, event.relatedTarget as Element) || interactions.get().isPopoverPinned) {\n return;\n }\n interactions.clearHighlight();\n interactions.clearHighlightedLegend();\n };\n return {\n width,\n height,\n series,\n allSeries,\n getInternalSeries,\n computed,\n interactions,\n handlers: {\n onSVGMouseMove,\n onSVGMouseOut,\n onSVGMouseDown,\n onSVGKeyDown,\n onApplicationFocus,\n onApplicationBlur,\n onFilterSeries,\n onLegendHighlight,\n onPopoverDismiss,\n onContainerBlur,\n onDocumentKeyDown,\n onPopoverLeave,\n },\n refs: {\n plot: plotRef,\n plotMeasure: plotMeasureRef,\n container: containerRef,\n verticalMarker: verticalMarkerRef,\n popoverRef,\n },\n };\n }, [\n allSeries,\n series,\n xDomain,\n yDomain,\n xScaleType,\n yScaleType,\n height,\n width,\n stableSetVisibleSeries,\n popoverRef,\n isRtl,\n ]);\n\n // Notify client when series highlight change.\n useReaction(model.interactions, state => state.highlightedSeries, setHighlightedSeries);\n\n // Update interactions store when series highlight in a controlled way.\n useEffect(() => {\n if (highlightedSeries !== model.interactions.get().highlightedSeries) {\n model.interactions.highlightSeries(highlightedSeries);\n }\n }, [model, highlightedSeries]);\n\n return model;\n}\n"]}
@@ -9,6 +9,6 @@ export declare function computePlotPoints<T>(series: readonly AreaChartProps.Ser
9
9
  xs: ChartModel.PlotPoint<T>[][];
10
10
  sx: ChartModel.PlotPoint<T>[][];
11
11
  };
12
- export declare function findClosest<T>(sortedArray: readonly T[], target: number, getter: (item: T) => number): T;
12
+ export declare function findClosest<T>(sortedArray: readonly T[], target: number, getter: (item: T) => number): null | T;
13
13
  export declare function isSeriesValid<T>(series: readonly AreaChartProps.Series<T>[]): boolean;
14
14
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/area-chart/model/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,sDAAsD,CAAC;AACpH,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,kDAAkD,CAAC;AACjG,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAQrC,wBAAgB,cAAc,CAAC,CAAC,SAAS,cAAc,EAAE,MAAM,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,wBAAgB,cAAc,CAAC,CAAC,SAAS,cAAc,EAAE,MAAM,EAAE,SAAS,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,CAkBhH;AAGD,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,SAAS,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,SAAS,EAAE,UAAU,GAAG,OAAO,CAqC7G;AAID,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,MAAM,EAAE,SAAS,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAC3C,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,iBAAiB,GACxB;IACD,EAAE,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IAChC,EAAE,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IAChC,EAAE,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;CACjC,CA6DA;AAGD,wBAAgB,WAAW,CAAC,CAAC,EAAE,WAAW,EAAE,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,GAAG,IAAI,GAAG,CAAC,CAqB/G;AAGD,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,SAAS,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,WAc3E"}
@@ -112,7 +112,7 @@ export function computePlotPoints(series, xScale, yScale) {
112
112
  export function findClosest(sortedArray, target, getter) {
113
113
  // The method guarantees to return a point hence empty arrays are not allowed.
114
114
  if (sortedArray.length === 0) {
115
- throw new Error('Invariant violation: array is empty.');
115
+ return null;
116
116
  }
117
117
  const isAscending = getter(sortedArray[0]) < getter(sortedArray[sortedArray.length - 1]);
118
118
  const compare = (x) => (isAscending ? getter(x) < target :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AC,OAAO,CAAC,CAAQ,CAAC,CAAC;QAEzC,IAAI,OAAO,KAAK,SAAS,EAAE;YACzB,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,GAAG,aAAa,EAAE,CAAC,CAAC;SAC3D;KACF;IACD,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,oDAAoD;AACpD,SAAS,gBAAgB,CAAI,MAAa,EAAE,GAAW,EAAE,GAAW,EAAE,KAAQ;IAC5E,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;QAChB,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;KAClB;IACD,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAC3B,CAAC;AAED,kEAAkE;AAClE,SAAS,IAAI,CAAI,GAAiB;IAChC,MAAM,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC;IACtB,MAAM,SAAS,GAAQ,EAAE,CAAC;IAE1B,KAAK,MAAM,KAAK,IAAI,GAAG,EAAE;QACvB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;YACnB,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YACf,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACvB;KACF;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ChartDataTypes, XDomain, YDomain, YScaleType } from '../../internal/components/cartesian-chart/interfaces';\nimport { ChartScale, NumericChartScale } from '../../internal/components/cartesian-chart/scales';\nimport { AreaChartProps } from '../interfaces';\nimport { ChartModel } from './index';\n\n// A sufficiently small value.\n// The Number.EPSILON is not available in the target ECMA version.\n// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON\nconst EPSILON = 0.0000000000001;\n\n// When x-domain is not set explicitly - guess it based on the available data.\nexport function computeDomainX<T extends ChartDataTypes>(series: readonly AreaChartProps.Series<T>[]): XDomain<T> {\n const xValues = getXValues(series);\n\n if (xValues.length === 0) {\n return [] as unknown as XDomain<T>;\n }\n\n // Assuming categorical domain.\n // In that case, all values are to be included.\n if (typeof xValues[0] === 'string') {\n return uniq(xValues) as unknown as XDomain<T>;\n }\n\n // For non-categorical domain find min and max bounds.\n return xValues.reduce(\n ([min, max], x) => [x < min ? x : min, max < x ? x : max],\n [xValues[0], xValues[0]]\n ) as unknown as XDomain<T>;\n}\n\n// When y-domain is not set explicitly - guess it based on the available data and series.\nexport function computeDomainY<T>(series: readonly AreaChartProps.Series<T>[], scaleType: YScaleType): YDomain {\n let min = Number.POSITIVE_INFINITY;\n let max = Number.NEGATIVE_INFINITY;\n\n // Find the min and max for threshold series.\n series.forEach(s => {\n if (s.type === 'threshold') {\n min = Math.min(min, s.y);\n max = Math.max(max, s.y);\n }\n });\n\n // Find the min and max for area series considering their stacking.\n getXValues(series).forEach((_, xIndex) => {\n // Maintains the prev stack level.\n let stackY = scaleType === 'linear' ? 0 : EPSILON;\n\n for (const s of series) {\n if (s.type === 'area') {\n stackY = stackY + (s.data[xIndex]?.y || 0);\n min = Math.min(min, stackY);\n max = Math.max(max, stackY);\n }\n }\n });\n\n // If min/max is not overridden than either series or series data is empty.\n if (min === Number.POSITIVE_INFINITY) {\n return [];\n }\n\n // Log scales can't start from 0, so, if possible, start from 1.\n if (scaleType === 'log' && min === 0 && max > 1) {\n return [1, max];\n }\n\n return [min, max];\n}\n\n// For given data, series and scales, compute all points and group them as\n// x:y, x:series and series:x to allow constant time access to the required point or subset.\nexport function computePlotPoints<T>(\n series: readonly AreaChartProps.Series<T>[],\n xScale: ChartScale,\n yScale: NumericChartScale\n): {\n xy: ChartModel.PlotPoint<T>[][];\n xs: ChartModel.PlotPoint<T>[][];\n sx: ChartModel.PlotPoint<T>[][];\n} {\n const xValues = getXValues(series);\n\n // Lookup for xy[xIndex][yIndex]\n const xy: ChartModel.PlotPoint<T>[][] = [];\n // Lookup for xs[xIndex][seriesIndex]\n const xs: ChartModel.PlotPoint<T>[][] = [];\n // Lookup for sx[seriesIndex][xIndex]\n const sx: ChartModel.PlotPoint<T>[][] = [];\n\n // Filter out the data which is beyond the plot for whatever reason.\n getVisibleData(xValues, xScale).forEach(({ x, scaledX }, xIndex) => {\n // Maintains the prev stack level. Starting from epsilon to not break log scales.\n let stackY = yScale.scaleType === 'linear' ? 0 : EPSILON;\n\n // A column of series points related to the same x.\n const points: ChartModel.PlotPoint<T>[] = [];\n\n // Collect the points, leaving y-index as 0 for now.\n series.forEach((s, sIndex) => {\n if (s.type === 'threshold') {\n const scaledY = yScale.d3Scale(s.y) || 0;\n points.push({\n x: x,\n y0: s.y,\n y1: s.y,\n scaled: { x: scaledX, y0: scaledY, y1: scaledY },\n index: { x: xIndex, s: sIndex, y: 0 },\n value: 0,\n });\n } else {\n const value = s.data[xIndex]?.y || 0;\n const y0 = stackY;\n const y1 = stackY + value;\n points.push({\n x: x,\n y0: y0,\n y1: y1,\n scaled: { x: scaledX, y0: yScale.d3Scale(y0) || 0, y1: yScale.d3Scale(y1) || 0 },\n index: { x: xIndex, s: sIndex, y: 0 },\n value: value,\n });\n\n stackY = y1;\n }\n });\n\n // Sort points by y and insert the missing y-index.\n points\n .sort((p1, p2) => p1.y1 - p2.y1)\n .forEach((point, index) => {\n point.index.y = index;\n\n // Insert the points to the respective two-dimensional lookup arrays.\n insertIntoMatrix(xy, point.index.x, point.index.y, point);\n insertIntoMatrix(xs, point.index.x, point.index.s, point);\n insertIntoMatrix(sx, point.index.s, point.index.x, point);\n });\n });\n\n return { xy, xs, sx };\n}\n\n// Finds the closest point in the sorted array.\nexport function findClosest<T>(sortedArray: readonly T[], target: number, getter: (item: T) => number): T {\n // The method guarantees to return a point hence empty arrays are not allowed.\n if (sortedArray.length === 0) {\n throw new Error('Invariant violation: array is empty.');\n }\n\n const isAscending = getter(sortedArray[0]) < getter(sortedArray[sortedArray.length - 1]);\n const compare = (x: T) => (isAscending ? getter(x) < target : getter(x) > target);\n const delta = (x: T) => Math.abs(getter(x) - target);\n\n // Use binary search to find the closest value in a sorted array.\n let lo = 0;\n let hi = sortedArray.length - 1;\n while (hi - lo > 1) {\n const mid = Math.floor((lo + hi) / 2);\n if (compare(sortedArray[mid])) {\n lo = mid;\n } else {\n hi = mid;\n }\n }\n return delta(sortedArray[lo]) < delta(sortedArray[hi]) ? sortedArray[lo] : sortedArray[hi];\n}\n\n// Compares all x-values between series to ensure they are consistent.\nexport function isSeriesValid<T>(series: readonly AreaChartProps.Series<T>[]) {\n const sampleXValues = getXValues(series);\n\n for (const s of series) {\n if (s.type === 'area') {\n for (let i = 0; i < Math.max(s.data.length, sampleXValues.length); i++) {\n if (s.data[i]?.x !== sampleXValues[i]) {\n return false;\n }\n }\n }\n }\n\n return true;\n}\n\n// Takes first area series x-values as all data x-values are to match across series.\nfunction getXValues<T>(series: readonly AreaChartProps.Series<T>[]) {\n for (const s of series) {\n if (s.type === 'area') {\n return s.data.map(({ x }) => x);\n }\n }\n\n return [];\n}\n\n// Returns data that is visible in the given scale.\nfunction getVisibleData<T>(data: readonly T[], xScale: ChartScale) {\n const scaledOffsetX = xScale.isCategorical() ? Math.max(0, xScale.d3Scale.bandwidth() - 1) / 2 : 0;\n\n const visibleData = [];\n for (const x of data) {\n const scaledX = xScale.d3Scale(x as any);\n\n if (scaledX !== undefined) {\n visibleData.push({ x, scaledX: scaledX + scaledOffsetX });\n }\n }\n return visibleData;\n}\n\n// Inserts given value into a two-dimensional array.\nfunction insertIntoMatrix<T>(matrix: T[][], row: number, col: number, value: T) {\n if (!matrix[row]) {\n matrix[row] = [];\n }\n matrix[row][col] = value;\n}\n\n// Creates new array with only unique elements of the given array.\nfunction uniq<T>(arr: readonly T[]): readonly T[] {\n const set = new Set();\n const uniqArray: T[] = [];\n\n for (const value of arr) {\n if (!set.has(value)) {\n set.add(value);\n uniqArray.push(value);\n }\n }\n\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AC;QAEzC,IAAI,OAAO,KAAK,SAAS,EAAE;YACzB,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,GAAG,aAAa,EAAE,CAAC,CAAC;SAC3D;KACF;IACD,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,oDAAoD;AACpD,SAAS,gBAAgB,CAAI,MAAa,EAAE,GAAW,EAAE,GAAW,EAAE,KAAQ;IAC5E,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;QAChB,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;KAClB;IACD,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAC3B,CAAC;AAED,kEAAkE;AAClE,SAAS,IAAI,CAAI,GAAiB;IAChC,MAAM,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC;IACtB,MAAM,SAAS,GAAQ,EAAE,CAAC;IAE1B,KAAK,MAAM,KAAK,IAAI,GAAG,EAAE;QACvB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;YACnB,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YACf,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACvB;KACF;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ChartDataTypes, XDomain, YDomain, YScaleType } from '../../internal/components/cartesian-chart/interfaces';\nimport { ChartScale, NumericChartScale } from '../../internal/components/cartesian-chart/scales';\nimport { AreaChartProps } from '../interfaces';\nimport { ChartModel } from './index';\n\n// A sufficiently small value.\n// The Number.EPSILON is not available in the target ECMA version.\n// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON\nconst EPSILON = 0.0000000000001;\n\n// When x-domain is not set explicitly - guess it based on the available data.\nexport function computeDomainX<T extends ChartDataTypes>(series: readonly AreaChartProps.Series<T>[]): XDomain<T> {\n const xValues = getXValues(series);\n\n if (xValues.length === 0) {\n return [] as unknown as XDomain<T>;\n }\n\n // Assuming categorical domain.\n // In that case, all values are to be included.\n if (typeof xValues[0] === 'string') {\n return uniq(xValues) as unknown as XDomain<T>;\n }\n\n // For non-categorical domain find min and max bounds.\n return xValues.reduce(\n ([min, max], x) => [x < min ? x : min, max < x ? x : max],\n [xValues[0], xValues[0]]\n ) as unknown as XDomain<T>;\n}\n\n// When y-domain is not set explicitly - guess it based on the available data and series.\nexport function computeDomainY<T>(series: readonly AreaChartProps.Series<T>[], scaleType: YScaleType): YDomain {\n let min = Number.POSITIVE_INFINITY;\n let max = Number.NEGATIVE_INFINITY;\n\n // Find the min and max for threshold series.\n series.forEach(s => {\n if (s.type === 'threshold') {\n min = Math.min(min, s.y);\n max = Math.max(max, s.y);\n }\n });\n\n // Find the min and max for area series considering their stacking.\n getXValues(series).forEach((_, xIndex) => {\n // Maintains the prev stack level.\n let stackY = scaleType === 'linear' ? 0 : EPSILON;\n\n for (const s of series) {\n if (s.type === 'area') {\n stackY = stackY + (s.data[xIndex]?.y || 0);\n min = Math.min(min, stackY);\n max = Math.max(max, stackY);\n }\n }\n });\n\n // If min/max is not overridden than either series or series data is empty.\n if (min === Number.POSITIVE_INFINITY) {\n return [];\n }\n\n // Log scales can't start from 0, so, if possible, start from 1.\n if (scaleType === 'log' && min === 0 && max > 1) {\n return [1, max];\n }\n\n return [min, max];\n}\n\n// For given data, series and scales, compute all points and group them as\n// x:y, x:series and series:x to allow constant time access to the required point or subset.\nexport function computePlotPoints<T>(\n series: readonly AreaChartProps.Series<T>[],\n xScale: ChartScale,\n yScale: NumericChartScale\n): {\n xy: ChartModel.PlotPoint<T>[][];\n xs: ChartModel.PlotPoint<T>[][];\n sx: ChartModel.PlotPoint<T>[][];\n} {\n const xValues = getXValues(series);\n\n // Lookup for xy[xIndex][yIndex]\n const xy: ChartModel.PlotPoint<T>[][] = [];\n // Lookup for xs[xIndex][seriesIndex]\n const xs: ChartModel.PlotPoint<T>[][] = [];\n // Lookup for sx[seriesIndex][xIndex]\n const sx: ChartModel.PlotPoint<T>[][] = [];\n\n // Filter out the data which is beyond the plot for whatever reason.\n getVisibleData(xValues, xScale).forEach(({ x, scaledX }, xIndex) => {\n // Maintains the prev stack level. Starting from epsilon to not break log scales.\n let stackY = yScale.scaleType === 'linear' ? 0 : EPSILON;\n\n // A column of series points related to the same x.\n const points: ChartModel.PlotPoint<T>[] = [];\n\n // Collect the points, leaving y-index as 0 for now.\n series.forEach((s, sIndex) => {\n if (s.type === 'threshold') {\n const scaledY = yScale.d3Scale(s.y) || 0;\n points.push({\n x: x,\n y0: s.y,\n y1: s.y,\n scaled: { x: scaledX, y0: scaledY, y1: scaledY },\n index: { x: xIndex, s: sIndex, y: 0 },\n value: 0,\n });\n } else {\n const value = s.data[xIndex]?.y || 0;\n const y0 = stackY;\n const y1 = stackY + value;\n points.push({\n x: x,\n y0: y0,\n y1: y1,\n scaled: { x: scaledX, y0: yScale.d3Scale(y0) || 0, y1: yScale.d3Scale(y1) || 0 },\n index: { x: xIndex, s: sIndex, y: 0 },\n value: value,\n });\n\n stackY = y1;\n }\n });\n\n // Sort points by y and insert the missing y-index.\n points\n .sort((p1, p2) => p1.y1 - p2.y1)\n .forEach((point, index) => {\n point.index.y = index;\n\n // Insert the points to the respective two-dimensional lookup arrays.\n insertIntoMatrix(xy, point.index.x, point.index.y, point);\n insertIntoMatrix(xs, point.index.x, point.index.s, point);\n insertIntoMatrix(sx, point.index.s, point.index.x, point);\n });\n });\n\n return { xy, xs, sx };\n}\n\n// Finds the closest point in the sorted array.\nexport function findClosest<T>(sortedArray: readonly T[], target: number, getter: (item: T) => number): null | T {\n // The method guarantees to return a point hence empty arrays are not allowed.\n if (sortedArray.length === 0) {\n return null;\n }\n const isAscending = getter(sortedArray[0]) < getter(sortedArray[sortedArray.length - 1]);\n const compare = (x: T) => (isAscending ? getter(x) < target : getter(x) > target);\n const delta = (x: T) => Math.abs(getter(x) - target);\n\n // Use binary search to find the closest value in a sorted array.\n let lo = 0;\n let hi = sortedArray.length - 1;\n while (hi - lo > 1) {\n const mid = Math.floor((lo + hi) / 2);\n if (compare(sortedArray[mid])) {\n lo = mid;\n } else {\n hi = mid;\n }\n }\n return delta(sortedArray[lo]) < delta(sortedArray[hi]) ? sortedArray[lo] : sortedArray[hi];\n}\n\n// Compares all x-values between series to ensure they are consistent.\nexport function isSeriesValid<T>(series: readonly AreaChartProps.Series<T>[]) {\n const sampleXValues = getXValues(series);\n\n for (const s of series) {\n if (s.type === 'area') {\n for (let i = 0; i < Math.max(s.data.length, sampleXValues.length); i++) {\n if (s.data[i]?.x !== sampleXValues[i]) {\n return false;\n }\n }\n }\n }\n\n return true;\n}\n\n// Takes first area series x-values as all data x-values are to match across series.\nfunction getXValues<T>(series: readonly AreaChartProps.Series<T>[]) {\n for (const s of series) {\n if (s.type === 'area') {\n return s.data.map(({ x }) => x);\n }\n }\n\n return [];\n}\n\n// Returns data that is visible in the given scale.\nfunction getVisibleData<T>(data: readonly T[], xScale: ChartScale) {\n const scaledOffsetX = xScale.isCategorical() ? Math.max(0, xScale.d3Scale.bandwidth() - 1) / 2 : 0;\n\n const visibleData = [];\n for (const x of data) {\n const scaledX = xScale.d3Scale(x as any);\n\n if (scaledX !== undefined) {\n visibleData.push({ x, scaledX: scaledX + scaledOffsetX });\n }\n }\n return visibleData;\n}\n\n// Inserts given value into a two-dimensional array.\nfunction insertIntoMatrix<T>(matrix: T[][], row: number, col: number, value: T) {\n if (!matrix[row]) {\n matrix[row] = [];\n }\n matrix[row][col] = value;\n}\n\n// Creates new array with only unique elements of the given array.\nfunction uniq<T>(arr: readonly T[]): readonly T[] {\n const set = new Set();\n const uniqArray: T[] = [];\n\n for (const value of arr) {\n if (!set.has(value)) {\n set.add(value);\n uniqArray.push(value);\n }\n }\n\n return uniqArray;\n}\n"]}
@@ -1,20 +1,20 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "empty-appear": "awsui_empty-appear_n4qlp_f96wm_153",
5
- "awsui-motion-fade-in": "awsui_awsui-motion-fade-in_n4qlp_f96wm_1",
6
- "root": "awsui_root_n4qlp_f96wm_175",
7
- "empty": "awsui_empty_n4qlp_f96wm_153",
8
- "row": "awsui_row_n4qlp_f96wm_218",
9
- "divider": "awsui_divider_n4qlp_f96wm_222",
10
- "row-control": "awsui_row-control_n4qlp_f96wm_227",
11
- "field": "awsui_field_n4qlp_f96wm_231",
12
- "additional-info": "awsui_additional-info_n4qlp_f96wm_235",
13
- "add-row": "awsui_add-row_n4qlp_f96wm_281",
14
- "add-button": "awsui_add-button_n4qlp_f96wm_285",
15
- "remove-button-container": "awsui_remove-button-container_n4qlp_f96wm_289",
16
- "remove-button-field-padding": "awsui_remove-button-field-padding_n4qlp_f96wm_293",
17
- "remove-button-own-row": "awsui_remove-button-own-row_n4qlp_f96wm_297",
18
- "remove-button": "awsui_remove-button_n4qlp_f96wm_289"
4
+ "empty-appear": "awsui_empty-appear_n4qlp_ql29y_153",
5
+ "awsui-motion-fade-in": "awsui_awsui-motion-fade-in_n4qlp_ql29y_1",
6
+ "root": "awsui_root_n4qlp_ql29y_175",
7
+ "empty": "awsui_empty_n4qlp_ql29y_153",
8
+ "row": "awsui_row_n4qlp_ql29y_218",
9
+ "divider": "awsui_divider_n4qlp_ql29y_222",
10
+ "row-control": "awsui_row-control_n4qlp_ql29y_227",
11
+ "field": "awsui_field_n4qlp_ql29y_231",
12
+ "additional-info": "awsui_additional-info_n4qlp_ql29y_235",
13
+ "add-row": "awsui_add-row_n4qlp_ql29y_281",
14
+ "add-button": "awsui_add-button_n4qlp_ql29y_285",
15
+ "remove-button-container": "awsui_remove-button-container_n4qlp_ql29y_289",
16
+ "remove-button-field-padding": "awsui_remove-button-field-padding_n4qlp_ql29y_293",
17
+ "remove-button-own-row": "awsui_remove-button-own-row_n4qlp_ql29y_297",
18
+ "remove-button": "awsui_remove-button_n4qlp_ql29y_289"
19
19
  };
20
20
 
@@ -150,10 +150,10 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
150
150
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
151
151
  SPDX-License-Identifier: Apache-2.0
152
152
  */
153
- .awsui_empty-appear_n4qlp_f96wm_153:not(#\9) {
154
- animation: awsui_awsui-motion-fade-in_n4qlp_f96wm_1 var(--motion-duration-transition-show-paced-0w35xp, 180ms) var(--motion-easing-transition-show-paced-ufdgkj, ease-out);
153
+ .awsui_empty-appear_n4qlp_ql29y_153:not(#\9) {
154
+ animation: awsui_awsui-motion-fade-in_n4qlp_ql29y_1 var(--motion-duration-transition-show-paced-0w35xp, 180ms) var(--motion-easing-transition-show-paced-ufdgkj, ease-out);
155
155
  }
156
- @keyframes awsui_awsui-motion-fade-in_n4qlp_f96wm_1 {
156
+ @keyframes awsui_awsui-motion-fade-in_n4qlp_ql29y_1 {
157
157
  from {
158
158
  opacity: 0.2;
159
159
  }
@@ -162,17 +162,17 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
162
162
  }
163
163
  }
164
164
  @media (prefers-reduced-motion: reduce) {
165
- .awsui_empty-appear_n4qlp_f96wm_153:not(#\9) {
165
+ .awsui_empty-appear_n4qlp_ql29y_153:not(#\9) {
166
166
  animation: none;
167
167
  transition: none;
168
168
  }
169
169
  }
170
- .awsui-motion-disabled .awsui_empty-appear_n4qlp_f96wm_153:not(#\9), .awsui-mode-entering .awsui_empty-appear_n4qlp_f96wm_153:not(#\9) {
170
+ .awsui-motion-disabled .awsui_empty-appear_n4qlp_ql29y_153:not(#\9), .awsui-mode-entering .awsui_empty-appear_n4qlp_ql29y_153:not(#\9) {
171
171
  animation: none;
172
172
  transition: none;
173
173
  }
174
174
 
175
- .awsui_root_n4qlp_f96wm_175:not(#\9) {
175
+ .awsui_root_n4qlp_ql29y_175:not(#\9) {
176
176
  border-collapse: separate;
177
177
  border-spacing: 0;
178
178
  box-sizing: border-box;
@@ -208,31 +208,31 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
208
208
  align-items: start;
209
209
  }
210
210
 
211
- .awsui_empty_n4qlp_f96wm_153:not(#\9) {
211
+ .awsui_empty_n4qlp_ql29y_153:not(#\9) {
212
212
  font-size: var(--font-size-body-m-vv54cm, 14px);
213
213
  line-height: var(--line-height-body-m-bedeoh, 22px);
214
214
  color: var(--color-text-empty-vtt4l2, #687078);
215
215
  grid-column: 1/-1;
216
216
  }
217
217
 
218
- .awsui_row_n4qlp_f96wm_218:not(#\9) {
218
+ .awsui_row_n4qlp_ql29y_218:not(#\9) {
219
219
  display: contents;
220
220
  }
221
221
 
222
- .awsui_divider_n4qlp_f96wm_222:not(#\9) {
222
+ .awsui_divider_n4qlp_ql29y_222:not(#\9) {
223
223
  grid-column: 1/-1;
224
224
  border-block-start: var(--border-divider-section-width-sznrdy, 1px) solid var(--color-border-divider-default-ipvpev, #eaeded);
225
225
  }
226
226
 
227
- .awsui_row-control_n4qlp_f96wm_227:not(#\9) {
227
+ .awsui_row-control_n4qlp_ql29y_227:not(#\9) {
228
228
  /* used in test-utils */
229
229
  }
230
230
 
231
- .awsui_field_n4qlp_f96wm_231:not(#\9) {
231
+ .awsui_field_n4qlp_ql29y_231:not(#\9) {
232
232
  /* used in test-utils */
233
233
  }
234
234
 
235
- .awsui_additional-info_n4qlp_f96wm_235:not(#\9) {
235
+ .awsui_additional-info_n4qlp_ql29y_235:not(#\9) {
236
236
  color: var(--color-text-form-secondary-4sp9un, #687078);
237
237
  font-size: var(--font-size-body-s-psgqn2, 12px);
238
238
  line-height: var(--line-height-body-s-otgtsr, 16px);
@@ -242,10 +242,10 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
242
242
  margin-block-start: var(--space-xxs-jnczic, 4px);
243
243
  /* stylelint-disable-next-line selector-max-type */
244
244
  }
245
- .awsui_additional-info_n4qlp_f96wm_235 > a:not(#\9) {
245
+ .awsui_additional-info_n4qlp_ql29y_235 > a:not(#\9) {
246
246
  text-underline-offset: 0.3em;
247
247
  text-decoration-thickness: 1px;
248
- color: var(--awsui-style-color-default-y15yd5, var(--color-text-link-default-x6cnv5, #0073bb));
248
+ color: var(--awsui-style-color-default-vl73au, var(--color-text-link-default-x6cnv5, #0073bb));
249
249
  font-weight: inherit;
250
250
  letter-spacing: normal;
251
251
  text-decoration-line: underline;
@@ -256,50 +256,50 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
256
256
  transition-duration: var(--motion-duration-refresh-only-medium-h3wrr6, 0ms);
257
257
  }
258
258
  @media (prefers-reduced-motion: reduce) {
259
- .awsui_additional-info_n4qlp_f96wm_235 > a:not(#\9) {
259
+ .awsui_additional-info_n4qlp_ql29y_235 > a:not(#\9) {
260
260
  animation: none;
261
261
  transition: none;
262
262
  }
263
263
  }
264
- .awsui-motion-disabled .awsui_additional-info_n4qlp_f96wm_235 > a:not(#\9), .awsui-mode-entering .awsui_additional-info_n4qlp_f96wm_235 > a:not(#\9) {
264
+ .awsui-motion-disabled .awsui_additional-info_n4qlp_ql29y_235 > a:not(#\9), .awsui-mode-entering .awsui_additional-info_n4qlp_ql29y_235 > a:not(#\9) {
265
265
  animation: none;
266
266
  transition: none;
267
267
  }
268
- .awsui_additional-info_n4qlp_f96wm_235 > a:not(#\9):hover {
268
+ .awsui_additional-info_n4qlp_ql29y_235 > a:not(#\9):hover {
269
269
  cursor: pointer;
270
- color: var(--awsui-style-color-hover-y15yd5, var(--color-text-link-hover-tk5gkv, #0a4a74));
270
+ color: var(--awsui-style-color-hover-vl73au, var(--color-text-link-hover-tk5gkv, #0a4a74));
271
271
  }
272
- .awsui_additional-info_n4qlp_f96wm_235 > a:not(#\9):focus {
272
+ .awsui_additional-info_n4qlp_ql29y_235 > a:not(#\9):focus {
273
273
  outline: none;
274
274
  }
275
- .awsui_additional-info_n4qlp_f96wm_235 > a:not(#\9):active {
276
- color: var(--awsui-style-color-active-y15yd5, var(--color-text-link-hover-tk5gkv, #0a4a74));
275
+ .awsui_additional-info_n4qlp_ql29y_235 > a:not(#\9):active {
276
+ color: var(--awsui-style-color-active-vl73au, var(--color-text-link-hover-tk5gkv, #0a4a74));
277
277
  }
278
- .awsui_additional-info_n4qlp_f96wm_235 > a:not(#\9):active, .awsui_additional-info_n4qlp_f96wm_235 > a:not(#\9):focus, .awsui_additional-info_n4qlp_f96wm_235 > a:not(#\9):hover {
278
+ .awsui_additional-info_n4qlp_ql29y_235 > a:not(#\9):active, .awsui_additional-info_n4qlp_ql29y_235 > a:not(#\9):focus, .awsui_additional-info_n4qlp_ql29y_235 > a:not(#\9):hover {
279
279
  text-decoration-line: underline;
280
280
  text-decoration-color: currentColor;
281
281
  }
282
282
 
283
- .awsui_add-row_n4qlp_f96wm_281:not(#\9) {
283
+ .awsui_add-row_n4qlp_ql29y_281:not(#\9) {
284
284
  grid-column: 1/-1;
285
285
  }
286
286
 
287
- .awsui_add-button_n4qlp_f96wm_285:not(#\9) {
287
+ .awsui_add-button_n4qlp_ql29y_285:not(#\9) {
288
288
  /* used in test-utils */
289
289
  }
290
290
 
291
- .awsui_remove-button-container_n4qlp_f96wm_289:not(#\9) {
291
+ .awsui_remove-button-container_n4qlp_ql29y_289:not(#\9) {
292
292
  display: inline-block;
293
293
  }
294
294
 
295
- .awsui_remove-button-field-padding_n4qlp_f96wm_293:not(#\9) {
295
+ .awsui_remove-button-field-padding_n4qlp_ql29y_293:not(#\9) {
296
296
  padding-block-start: calc(var(--space-xxs-jnczic, 4px) + var(--line-height-body-m-bedeoh, 22px));
297
297
  }
298
298
 
299
- .awsui_remove-button-own-row_n4qlp_f96wm_297:not(#\9) {
299
+ .awsui_remove-button-own-row_n4qlp_ql29y_297:not(#\9) {
300
300
  justify-self: end;
301
301
  }
302
302
 
303
- .awsui_remove-button_n4qlp_f96wm_289:not(#\9) {
303
+ .awsui_remove-button_n4qlp_ql29y_289:not(#\9) {
304
304
  /* used in test-utils */
305
305
  }
@@ -2,20 +2,20 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "empty-appear": "awsui_empty-appear_n4qlp_f96wm_153",
6
- "awsui-motion-fade-in": "awsui_awsui-motion-fade-in_n4qlp_f96wm_1",
7
- "root": "awsui_root_n4qlp_f96wm_175",
8
- "empty": "awsui_empty_n4qlp_f96wm_153",
9
- "row": "awsui_row_n4qlp_f96wm_218",
10
- "divider": "awsui_divider_n4qlp_f96wm_222",
11
- "row-control": "awsui_row-control_n4qlp_f96wm_227",
12
- "field": "awsui_field_n4qlp_f96wm_231",
13
- "additional-info": "awsui_additional-info_n4qlp_f96wm_235",
14
- "add-row": "awsui_add-row_n4qlp_f96wm_281",
15
- "add-button": "awsui_add-button_n4qlp_f96wm_285",
16
- "remove-button-container": "awsui_remove-button-container_n4qlp_f96wm_289",
17
- "remove-button-field-padding": "awsui_remove-button-field-padding_n4qlp_f96wm_293",
18
- "remove-button-own-row": "awsui_remove-button-own-row_n4qlp_f96wm_297",
19
- "remove-button": "awsui_remove-button_n4qlp_f96wm_289"
5
+ "empty-appear": "awsui_empty-appear_n4qlp_ql29y_153",
6
+ "awsui-motion-fade-in": "awsui_awsui-motion-fade-in_n4qlp_ql29y_1",
7
+ "root": "awsui_root_n4qlp_ql29y_175",
8
+ "empty": "awsui_empty_n4qlp_ql29y_153",
9
+ "row": "awsui_row_n4qlp_ql29y_218",
10
+ "divider": "awsui_divider_n4qlp_ql29y_222",
11
+ "row-control": "awsui_row-control_n4qlp_ql29y_227",
12
+ "field": "awsui_field_n4qlp_ql29y_231",
13
+ "additional-info": "awsui_additional-info_n4qlp_ql29y_235",
14
+ "add-row": "awsui_add-row_n4qlp_ql29y_281",
15
+ "add-button": "awsui_add-button_n4qlp_ql29y_285",
16
+ "remove-button-container": "awsui_remove-button-container_n4qlp_ql29y_289",
17
+ "remove-button-field-padding": "awsui_remove-button-field-padding_n4qlp_ql29y_293",
18
+ "remove-button-own-row": "awsui_remove-button-own-row_n4qlp_ql29y_297",
19
+ "remove-button": "awsui_remove-button_n4qlp_ql29y_289"
20
20
  };
21
21
 
@@ -1,12 +1,12 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "link": "awsui_link_1kosq_ea5lw_145",
5
- "breadcrumb": "awsui_breadcrumb_1kosq_ea5lw_149",
6
- "ghost-breadcrumb": "awsui_ghost-breadcrumb_1kosq_ea5lw_150",
7
- "icon": "awsui_icon_1kosq_ea5lw_153",
8
- "anchor": "awsui_anchor_1kosq_ea5lw_159",
9
- "text": "awsui_text_1kosq_ea5lw_206",
10
- "last": "awsui_last_1kosq_ea5lw_225"
4
+ "link": "awsui_link_1kosq_4isks_145",
5
+ "breadcrumb": "awsui_breadcrumb_1kosq_4isks_149",
6
+ "ghost-breadcrumb": "awsui_ghost-breadcrumb_1kosq_4isks_150",
7
+ "icon": "awsui_icon_1kosq_4isks_153",
8
+ "anchor": "awsui_anchor_1kosq_4isks_159",
9
+ "text": "awsui_text_1kosq_4isks_206",
10
+ "last": "awsui_last_1kosq_4isks_225"
11
11
  };
12
12
 
@@ -142,27 +142,27 @@
142
142
  */
143
143
  /* Style used for links in slots/components that are text heavy, to help links stand out among
144
144
  surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
145
- .awsui_link_1kosq_ea5lw_145:not(#\9):after {
145
+ .awsui_link_1kosq_4isks_145:not(#\9):after {
146
146
  display: none;
147
147
  }
148
148
 
149
- .awsui_breadcrumb_1kosq_ea5lw_149:not(#\9),
150
- .awsui_ghost-breadcrumb_1kosq_ea5lw_150:not(#\9) {
149
+ .awsui_breadcrumb_1kosq_4isks_149:not(#\9),
150
+ .awsui_ghost-breadcrumb_1kosq_4isks_150:not(#\9) {
151
151
  display: flex;
152
152
  }
153
- .awsui_breadcrumb_1kosq_ea5lw_149 > .awsui_icon_1kosq_ea5lw_153:not(#\9),
154
- .awsui_ghost-breadcrumb_1kosq_ea5lw_150 > .awsui_icon_1kosq_ea5lw_153:not(#\9) {
153
+ .awsui_breadcrumb_1kosq_4isks_149 > .awsui_icon_1kosq_4isks_153:not(#\9),
154
+ .awsui_ghost-breadcrumb_1kosq_4isks_150 > .awsui_icon_1kosq_4isks_153:not(#\9) {
155
155
  margin-block: 0;
156
156
  margin-inline: var(--space-xs-kw7k3v, 8px);
157
157
  color: var(--color-text-breadcrumb-icon-c379ty, #687078);
158
158
  }
159
- .awsui_breadcrumb_1kosq_ea5lw_149 > .awsui_anchor_1kosq_ea5lw_159:not(#\9),
160
- .awsui_ghost-breadcrumb_1kosq_ea5lw_150 > .awsui_anchor_1kosq_ea5lw_159:not(#\9) {
159
+ .awsui_breadcrumb_1kosq_4isks_149 > .awsui_anchor_1kosq_4isks_159:not(#\9),
160
+ .awsui_ghost-breadcrumb_1kosq_4isks_150 > .awsui_anchor_1kosq_4isks_159:not(#\9) {
161
161
  min-inline-size: 0;
162
162
  overflow: hidden;
163
163
  text-underline-offset: 0.25em;
164
164
  text-decoration-thickness: 1px;
165
- color: var(--awsui-style-color-default-y15yd5, var(--color-text-link-default-x6cnv5, #0073bb));
165
+ color: var(--awsui-style-color-default-vl73au, var(--color-text-link-default-x6cnv5, #0073bb));
166
166
  font-weight: inherit;
167
167
  letter-spacing: normal;
168
168
  text-decoration-line: underline;
@@ -173,42 +173,42 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
173
173
  transition-duration: var(--motion-duration-refresh-only-medium-h3wrr6, 0ms);
174
174
  }
175
175
  @media (prefers-reduced-motion: reduce) {
176
- .awsui_breadcrumb_1kosq_ea5lw_149 > .awsui_anchor_1kosq_ea5lw_159:not(#\9),
177
- .awsui_ghost-breadcrumb_1kosq_ea5lw_150 > .awsui_anchor_1kosq_ea5lw_159:not(#\9) {
176
+ .awsui_breadcrumb_1kosq_4isks_149 > .awsui_anchor_1kosq_4isks_159:not(#\9),
177
+ .awsui_ghost-breadcrumb_1kosq_4isks_150 > .awsui_anchor_1kosq_4isks_159:not(#\9) {
178
178
  animation: none;
179
179
  transition: none;
180
180
  }
181
181
  }
182
- .awsui-motion-disabled .awsui_breadcrumb_1kosq_ea5lw_149 > .awsui_anchor_1kosq_ea5lw_159:not(#\9), .awsui-mode-entering .awsui_breadcrumb_1kosq_ea5lw_149 > .awsui_anchor_1kosq_ea5lw_159:not(#\9), .awsui-motion-disabled .awsui_ghost-breadcrumb_1kosq_ea5lw_150 > .awsui_anchor_1kosq_ea5lw_159:not(#\9), .awsui-mode-entering .awsui_ghost-breadcrumb_1kosq_ea5lw_150 > .awsui_anchor_1kosq_ea5lw_159:not(#\9) {
182
+ .awsui-motion-disabled .awsui_breadcrumb_1kosq_4isks_149 > .awsui_anchor_1kosq_4isks_159:not(#\9), .awsui-mode-entering .awsui_breadcrumb_1kosq_4isks_149 > .awsui_anchor_1kosq_4isks_159:not(#\9), .awsui-motion-disabled .awsui_ghost-breadcrumb_1kosq_4isks_150 > .awsui_anchor_1kosq_4isks_159:not(#\9), .awsui-mode-entering .awsui_ghost-breadcrumb_1kosq_4isks_150 > .awsui_anchor_1kosq_4isks_159:not(#\9) {
183
183
  animation: none;
184
184
  transition: none;
185
185
  }
186
- .awsui_breadcrumb_1kosq_ea5lw_149 > .awsui_anchor_1kosq_ea5lw_159:not(#\9):hover,
187
- .awsui_ghost-breadcrumb_1kosq_ea5lw_150 > .awsui_anchor_1kosq_ea5lw_159:not(#\9):hover {
186
+ .awsui_breadcrumb_1kosq_4isks_149 > .awsui_anchor_1kosq_4isks_159:not(#\9):hover,
187
+ .awsui_ghost-breadcrumb_1kosq_4isks_150 > .awsui_anchor_1kosq_4isks_159:not(#\9):hover {
188
188
  cursor: pointer;
189
- color: var(--awsui-style-color-hover-y15yd5, var(--color-text-link-hover-tk5gkv, #0a4a74));
189
+ color: var(--awsui-style-color-hover-vl73au, var(--color-text-link-hover-tk5gkv, #0a4a74));
190
190
  }
191
- .awsui_breadcrumb_1kosq_ea5lw_149 > .awsui_anchor_1kosq_ea5lw_159:not(#\9):focus,
192
- .awsui_ghost-breadcrumb_1kosq_ea5lw_150 > .awsui_anchor_1kosq_ea5lw_159:not(#\9):focus {
191
+ .awsui_breadcrumb_1kosq_4isks_149 > .awsui_anchor_1kosq_4isks_159:not(#\9):focus,
192
+ .awsui_ghost-breadcrumb_1kosq_4isks_150 > .awsui_anchor_1kosq_4isks_159:not(#\9):focus {
193
193
  outline: none;
194
194
  }
195
- .awsui_breadcrumb_1kosq_ea5lw_149 > .awsui_anchor_1kosq_ea5lw_159:not(#\9):active,
196
- .awsui_ghost-breadcrumb_1kosq_ea5lw_150 > .awsui_anchor_1kosq_ea5lw_159:not(#\9):active {
197
- color: var(--awsui-style-color-active-y15yd5, var(--color-text-link-hover-tk5gkv, #0a4a74));
195
+ .awsui_breadcrumb_1kosq_4isks_149 > .awsui_anchor_1kosq_4isks_159:not(#\9):active,
196
+ .awsui_ghost-breadcrumb_1kosq_4isks_150 > .awsui_anchor_1kosq_4isks_159:not(#\9):active {
197
+ color: var(--awsui-style-color-active-vl73au, var(--color-text-link-hover-tk5gkv, #0a4a74));
198
198
  }
199
- .awsui_breadcrumb_1kosq_ea5lw_149 > .awsui_anchor_1kosq_ea5lw_159:not(#\9):active, .awsui_breadcrumb_1kosq_ea5lw_149 > .awsui_anchor_1kosq_ea5lw_159:not(#\9):focus, .awsui_breadcrumb_1kosq_ea5lw_149 > .awsui_anchor_1kosq_ea5lw_159:not(#\9):hover, .awsui_ghost-breadcrumb_1kosq_ea5lw_150 > .awsui_anchor_1kosq_ea5lw_159:not(#\9):active, .awsui_ghost-breadcrumb_1kosq_ea5lw_150 > .awsui_anchor_1kosq_ea5lw_159:not(#\9):focus, .awsui_ghost-breadcrumb_1kosq_ea5lw_150 > .awsui_anchor_1kosq_ea5lw_159:not(#\9):hover {
199
+ .awsui_breadcrumb_1kosq_4isks_149 > .awsui_anchor_1kosq_4isks_159:not(#\9):active, .awsui_breadcrumb_1kosq_4isks_149 > .awsui_anchor_1kosq_4isks_159:not(#\9):focus, .awsui_breadcrumb_1kosq_4isks_149 > .awsui_anchor_1kosq_4isks_159:not(#\9):hover, .awsui_ghost-breadcrumb_1kosq_4isks_150 > .awsui_anchor_1kosq_4isks_159:not(#\9):active, .awsui_ghost-breadcrumb_1kosq_4isks_150 > .awsui_anchor_1kosq_4isks_159:not(#\9):focus, .awsui_ghost-breadcrumb_1kosq_4isks_150 > .awsui_anchor_1kosq_4isks_159:not(#\9):hover {
200
200
  text-decoration-line: underline;
201
201
  text-decoration-color: currentColor;
202
202
  }
203
- .awsui_breadcrumb_1kosq_ea5lw_149 > .awsui_anchor_1kosq_ea5lw_159 > .awsui_text_1kosq_ea5lw_206:not(#\9),
204
- .awsui_ghost-breadcrumb_1kosq_ea5lw_150 > .awsui_anchor_1kosq_ea5lw_159 > .awsui_text_1kosq_ea5lw_206:not(#\9) {
203
+ .awsui_breadcrumb_1kosq_4isks_149 > .awsui_anchor_1kosq_4isks_159 > .awsui_text_1kosq_4isks_206:not(#\9),
204
+ .awsui_ghost-breadcrumb_1kosq_4isks_150 > .awsui_anchor_1kosq_4isks_159 > .awsui_text_1kosq_4isks_206:not(#\9) {
205
205
  overflow: hidden;
206
206
  text-overflow: ellipsis;
207
207
  white-space: nowrap;
208
208
  display: block;
209
209
  }
210
- body[data-awsui-focus-visible=true] .awsui_breadcrumb_1kosq_ea5lw_149 > .awsui_anchor_1kosq_ea5lw_159:not(#\9):focus,
211
- body[data-awsui-focus-visible=true] .awsui_ghost-breadcrumb_1kosq_ea5lw_150 > .awsui_anchor_1kosq_ea5lw_159:not(#\9):focus {
210
+ body[data-awsui-focus-visible=true] .awsui_breadcrumb_1kosq_4isks_149 > .awsui_anchor_1kosq_4isks_159:not(#\9):focus,
211
+ body[data-awsui-focus-visible=true] .awsui_ghost-breadcrumb_1kosq_4isks_150 > .awsui_anchor_1kosq_4isks_159:not(#\9):focus {
212
212
  outline: thin dotted;
213
213
  outline: var(--border-link-focus-ring-outline-c5423y, 5px auto Highlight);
214
214
  outline-offset: 2px;
@@ -219,12 +219,12 @@ body[data-awsui-focus-visible=true] .awsui_ghost-breadcrumb_1kosq_ea5lw_150 > .a
219
219
  border-end-end-radius: var(--border-radius-control-default-focus-ring-9xsko1, 2px);
220
220
  box-shadow: 0 0 0 var(--border-link-focus-ring-shadow-spread-woh62o, 0px) var(--color-border-item-focused-r5f6xl, #0073bb);
221
221
  }
222
- .awsui_breadcrumb_1kosq_ea5lw_149.awsui_last_1kosq_ea5lw_225 > .awsui_icon_1kosq_ea5lw_153:not(#\9),
223
- .awsui_ghost-breadcrumb_1kosq_ea5lw_150.awsui_last_1kosq_ea5lw_225 > .awsui_icon_1kosq_ea5lw_153:not(#\9) {
222
+ .awsui_breadcrumb_1kosq_4isks_149.awsui_last_1kosq_4isks_225 > .awsui_icon_1kosq_4isks_153:not(#\9),
223
+ .awsui_ghost-breadcrumb_1kosq_4isks_150.awsui_last_1kosq_4isks_225 > .awsui_icon_1kosq_4isks_153:not(#\9) {
224
224
  display: none;
225
225
  }
226
- .awsui_breadcrumb_1kosq_ea5lw_149.awsui_last_1kosq_ea5lw_225 > .awsui_anchor_1kosq_ea5lw_159:not(#\9),
227
- .awsui_ghost-breadcrumb_1kosq_ea5lw_150.awsui_last_1kosq_ea5lw_225 > .awsui_anchor_1kosq_ea5lw_159:not(#\9) {
226
+ .awsui_breadcrumb_1kosq_4isks_149.awsui_last_1kosq_4isks_225 > .awsui_anchor_1kosq_4isks_159:not(#\9),
227
+ .awsui_ghost-breadcrumb_1kosq_4isks_150.awsui_last_1kosq_4isks_225 > .awsui_anchor_1kosq_4isks_159:not(#\9) {
228
228
  color: var(--color-text-breadcrumb-current-hwvp31, #687078);
229
229
  font-weight: 700;
230
230
  text-decoration: none;
@@ -2,12 +2,12 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "link": "awsui_link_1kosq_ea5lw_145",
6
- "breadcrumb": "awsui_breadcrumb_1kosq_ea5lw_149",
7
- "ghost-breadcrumb": "awsui_ghost-breadcrumb_1kosq_ea5lw_150",
8
- "icon": "awsui_icon_1kosq_ea5lw_153",
9
- "anchor": "awsui_anchor_1kosq_ea5lw_159",
10
- "text": "awsui_text_1kosq_ea5lw_206",
11
- "last": "awsui_last_1kosq_ea5lw_225"
5
+ "link": "awsui_link_1kosq_4isks_145",
6
+ "breadcrumb": "awsui_breadcrumb_1kosq_4isks_149",
7
+ "ghost-breadcrumb": "awsui_ghost-breadcrumb_1kosq_4isks_150",
8
+ "icon": "awsui_icon_1kosq_4isks_153",
9
+ "anchor": "awsui_anchor_1kosq_4isks_159",
10
+ "text": "awsui_text_1kosq_4isks_206",
11
+ "last": "awsui_last_1kosq_4isks_225"
12
12
  };
13
13