@cloudscape-design/components 3.0.774 → 3.0.776

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 (61) hide show
  1. package/index.d.ts +1 -0
  2. package/index.d.ts.map +1 -1
  3. package/index.js +1 -0
  4. package/index.js.map +1 -1
  5. package/internal/components/tooltip/index.d.ts +2 -1
  6. package/internal/components/tooltip/index.d.ts.map +1 -1
  7. package/internal/components/tooltip/index.js +2 -2
  8. package/internal/components/tooltip/index.js.map +1 -1
  9. package/internal/environment.js +1 -1
  10. package/internal/environment.json +1 -1
  11. package/internal/manifest.json +1 -1
  12. package/package.json +2 -1
  13. package/popover/container.d.ts +2 -1
  14. package/popover/container.d.ts.map +1 -1
  15. package/popover/container.js +5 -4
  16. package/popover/container.js.map +1 -1
  17. package/popover/interfaces.d.ts +4 -0
  18. package/popover/interfaces.d.ts.map +1 -1
  19. package/popover/interfaces.js.map +1 -1
  20. package/popover/use-popover-position.d.ts +3 -1
  21. package/popover/use-popover-position.d.ts.map +1 -1
  22. package/popover/use-popover-position.js +21 -5
  23. package/popover/use-popover-position.js.map +1 -1
  24. package/popover/utils/positions.d.ts +2 -1
  25. package/popover/utils/positions.d.ts.map +1 -1
  26. package/popover/utils/positions.js +6 -0
  27. package/popover/utils/positions.js.map +1 -1
  28. package/select/parts/item.d.ts.map +1 -1
  29. package/select/parts/item.js +1 -1
  30. package/select/parts/item.js.map +1 -1
  31. package/select/parts/multiselect-item.d.ts.map +1 -1
  32. package/select/parts/multiselect-item.js +1 -1
  33. package/select/parts/multiselect-item.js.map +1 -1
  34. package/steps/index.d.ts +6 -0
  35. package/steps/index.d.ts.map +1 -0
  36. package/steps/index.js +19 -0
  37. package/steps/index.js.map +1 -0
  38. package/steps/interfaces.d.ts +40 -0
  39. package/steps/interfaces.d.ts.map +1 -0
  40. package/steps/interfaces.js +2 -0
  41. package/steps/interfaces.js.map +1 -0
  42. package/steps/internal.d.ts +8 -0
  43. package/steps/internal.d.ts.map +1 -0
  44. package/steps/internal.js +21 -0
  45. package/steps/internal.js.map +1 -0
  46. package/steps/styles.css.js +11 -0
  47. package/steps/styles.scoped.css +247 -0
  48. package/steps/styles.selectors.js +12 -0
  49. package/test-utils/dom/index.d.ts +3 -0
  50. package/test-utils/dom/index.js +9 -1
  51. package/test-utils/dom/index.js.map +1 -1
  52. package/test-utils/dom/steps/index.d.ts +18 -0
  53. package/test-utils/dom/steps/index.js +33 -0
  54. package/test-utils/dom/steps/index.js.map +1 -0
  55. package/test-utils/selectors/index.d.ts +3 -0
  56. package/test-utils/selectors/index.js +9 -1
  57. package/test-utils/selectors/index.js.map +1 -1
  58. package/test-utils/selectors/steps/index.d.ts +18 -0
  59. package/test-utils/selectors/steps/index.js +33 -0
  60. package/test-utils/selectors/steps/index.js.map +1 -0
  61. package/test-utils/tsconfig.tsbuildinfo +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"positions.js","sourceRoot":"","sources":["../../../../src/popover/utils/positions.ts"],"names":[],"mappings":"AAiBA,MAAM,YAAY,GAAG,EAAE,CAAC;AAExB,MAAM,CAAC,MAAM,gBAAgB,GAAsD;IACjF,GAAG,EAAE;QACH,YAAY;QACZ,WAAW;QACX,UAAU;QACV,eAAe;QACf,cAAc;QACd,aAAa;QACb,WAAW;QACX,cAAc;QACd,UAAU;QACV,aAAa;KACd;IACD,MAAM,EAAE;QACN,eAAe;QACf,cAAc;QACd,aAAa;QACb,YAAY;QACZ,WAAW;QACX,UAAU;QACV,WAAW;QACX,cAAc;QACd,UAAU;QACV,aAAa;KACd;IACD,IAAI,EAAE;QACJ,UAAU;QACV,aAAa;QACb,WAAW;QACX,cAAc;QACd,eAAe;QACf,YAAY;QACZ,aAAa;QACb,UAAU;QACV,cAAc;QACd,WAAW;KACZ;IACD,KAAK,EAAE;QACL,WAAW;QACX,cAAc;QACd,UAAU;QACV,aAAa;QACb,eAAe;QACf,YAAY;QACZ,cAAc;QACd,WAAW;QACX,aAAa;QACb,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AAK,OAAO,CAAC,WAAW,CAAC,UAAU,EAAE;QACrE,OAAO,OAAO,CAAC,WAAW,CAAC,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;KAC1F;IACD,kEAAkE;IAClE,OAAO,OAAO,CAAC,WAAW,CAAC,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;AAC7F,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,OAAoB;IACtD,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,YAAY,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC;AAClF,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,OAAoB;IAChD,MAAM,aAAa,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAChD,OAAO;QACL,UAAU,EAAE,UAAU,CAAC,aAAa,CAAC,UAAU,CAAC;QAChD,SAAS,EAAE,UAAU,CAAC,aAAa,CAAC,SAAS,CAAC;KAC/C,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,gBAAkC;IACvD,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACpE,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BoundingBox, Dimensions, InternalPosition, PopoverProps } from '../interfaces';\n\n// A structure describing how the popover should be positioned\ninterface CalculatedPosition {\n scrollable?: boolean;\n internalPosition: InternalPosition;\n rect: BoundingBox;\n}\n\ninterface ElementGroup {\n body: Dimensions;\n trigger: BoundingBox;\n arrow: Dimensions;\n}\n\nconst ARROW_OFFSET = 12;\n\nexport const PRIORITY_MAPPING: Record<PopoverProps.Position, InternalPosition[]> = {\n top: [\n 'top-center',\n 'top-right',\n 'top-left',\n 'bottom-center',\n 'bottom-right',\n 'bottom-left',\n 'right-top',\n 'right-bottom',\n 'left-top',\n 'left-bottom',\n ],\n bottom: [\n 'bottom-center',\n 'bottom-right',\n 'bottom-left',\n 'top-center',\n 'top-right',\n 'top-left',\n 'right-top',\n 'right-bottom',\n 'left-top',\n 'left-bottom',\n ],\n left: [\n 'left-top',\n 'left-bottom',\n 'right-top',\n 'right-bottom',\n 'bottom-center',\n 'top-center',\n 'bottom-left',\n 'top-left',\n 'bottom-right',\n 'top-right',\n ],\n right: [\n 'right-top',\n 'right-bottom',\n 'left-top',\n 'left-bottom',\n 'bottom-center',\n 'top-center',\n 'bottom-right',\n 'top-right',\n 'bottom-left',\n 'top-left',\n ],\n};\n\nconst RECTANGLE_CALCULATIONS: Record<InternalPosition, (r: ElementGroup) => BoundingBox> = {\n 'top-center': ({ body, trigger, arrow }) => {\n return {\n insetBlockStart: trigger.insetBlockStart - body.blockSize - arrow.blockSize,\n insetInlineStart: trigger.insetInlineStart + trigger.inlineSize / 2 - body.inlineSize / 2,\n inlineSize: body.inlineSize,\n blockSize: body.blockSize,\n };\n },\n 'top-right': ({ body, trigger, arrow }) => {\n return {\n insetBlockStart: trigger.insetBlockStart - body.blockSize - arrow.blockSize,\n insetInlineStart: trigger.insetInlineStart + trigger.inlineSize / 2 - ARROW_OFFSET - arrow.inlineSize / 2,\n inlineSize: body.inlineSize,\n blockSize: body.blockSize,\n };\n },\n 'top-left': ({ body, trigger, arrow }) => {\n return {\n insetBlockStart: trigger.insetBlockStart - body.blockSize - arrow.blockSize,\n insetInlineStart:\n trigger.insetInlineStart + trigger.inlineSize / 2 + ARROW_OFFSET + arrow.inlineSize / 2 - body.inlineSize,\n inlineSize: body.inlineSize,\n blockSize: body.blockSize,\n };\n },\n 'bottom-center': ({ body, trigger, arrow }) => {\n return {\n insetBlockStart: trigger.insetBlockStart + trigger.blockSize + arrow.blockSize,\n insetInlineStart: trigger.insetInlineStart + trigger.inlineSize / 2 - body.inlineSize / 2,\n inlineSize: body.inlineSize,\n blockSize: body.blockSize,\n };\n },\n 'bottom-right': ({ body, trigger, arrow }) => {\n return {\n insetBlockStart: trigger.insetBlockStart + trigger.blockSize + arrow.blockSize,\n insetInlineStart: trigger.insetInlineStart + trigger.inlineSize / 2 - ARROW_OFFSET - arrow.inlineSize / 2,\n inlineSize: body.inlineSize,\n blockSize: body.blockSize,\n };\n },\n 'bottom-left': ({ body, trigger, arrow }) => {\n return {\n insetBlockStart: trigger.insetBlockStart + trigger.blockSize + arrow.blockSize,\n insetInlineStart:\n trigger.insetInlineStart + trigger.inlineSize / 2 + ARROW_OFFSET + arrow.inlineSize / 2 - body.inlineSize,\n inlineSize: body.inlineSize,\n blockSize: body.blockSize,\n };\n },\n 'right-top': ({ body, trigger, arrow }) => {\n return {\n insetBlockStart: trigger.insetBlockStart + trigger.blockSize / 2 - ARROW_OFFSET - arrow.blockSize,\n insetInlineStart: trigger.insetInlineStart + trigger.inlineSize + arrow.blockSize,\n inlineSize: body.inlineSize,\n blockSize: body.blockSize,\n };\n },\n 'right-bottom': ({ body, trigger, arrow }) => {\n return {\n insetBlockStart:\n trigger.insetBlockStart + trigger.blockSize / 2 - body.blockSize + ARROW_OFFSET + arrow.blockSize,\n insetInlineStart: trigger.insetInlineStart + trigger.inlineSize + arrow.blockSize,\n inlineSize: body.inlineSize,\n blockSize: body.blockSize,\n };\n },\n 'left-top': ({ body, trigger, arrow }) => {\n return {\n insetBlockStart: trigger.insetBlockStart + trigger.blockSize / 2 - ARROW_OFFSET - arrow.blockSize,\n insetInlineStart: trigger.insetInlineStart - body.inlineSize - arrow.blockSize,\n inlineSize: body.inlineSize,\n blockSize: body.blockSize,\n };\n },\n 'left-bottom': ({ body, trigger, arrow }) => {\n return {\n insetBlockStart:\n trigger.insetBlockStart + trigger.blockSize / 2 - body.blockSize + ARROW_OFFSET + arrow.blockSize,\n insetInlineStart: trigger.insetInlineStart - body.inlineSize - arrow.blockSize,\n inlineSize: body.inlineSize,\n blockSize: body.blockSize,\n };\n },\n};\n\nfunction fitIntoContainer(inner: BoundingBox, outer: BoundingBox): BoundingBox {\n let { insetInlineStart, inlineSize, insetBlockStart, blockSize } = inner;\n\n // Adjust left boundary.\n if (insetInlineStart < outer.insetInlineStart) {\n inlineSize = insetInlineStart + inlineSize - outer.insetInlineStart;\n insetInlineStart = outer.insetInlineStart;\n }\n // Adjust right boundary.\n else if (insetInlineStart + inlineSize > outer.insetInlineStart + outer.inlineSize) {\n inlineSize = outer.insetInlineStart + outer.inlineSize - insetInlineStart;\n }\n // Adjust top boundary.\n if (insetBlockStart < outer.insetBlockStart) {\n blockSize = insetBlockStart + blockSize - outer.insetBlockStart;\n insetBlockStart = outer.insetBlockStart;\n }\n // Adjust bottom boundary.\n else if (insetBlockStart + blockSize > outer.insetBlockStart + outer.blockSize) {\n blockSize = outer.insetBlockStart + outer.blockSize - insetBlockStart;\n }\n\n return { insetInlineStart, inlineSize, insetBlockStart, blockSize };\n}\n\nfunction getTallestRect(rect1: BoundingBox, rect2: BoundingBox): BoundingBox {\n return rect1.blockSize >= rect2.blockSize ? rect1 : rect2;\n}\n\nfunction getIntersection(rectangles: BoundingBox[]): BoundingBox | null {\n let boundingBox: BoundingBox | null = null;\n for (const currentRect of rectangles) {\n if (!boundingBox) {\n boundingBox = currentRect;\n continue;\n }\n const insetInlineStart = Math.max(boundingBox.insetInlineStart, currentRect.insetInlineStart);\n const insetBlockStart = Math.max(boundingBox.insetBlockStart, currentRect.insetBlockStart);\n const insetInlineEnd = Math.min(\n boundingBox.insetInlineStart + boundingBox.inlineSize,\n currentRect.insetInlineStart + currentRect.inlineSize\n );\n const insetBlockEnd = Math.min(\n boundingBox.insetBlockStart + boundingBox.blockSize,\n currentRect.insetBlockStart + currentRect.blockSize\n );\n\n if (insetInlineEnd < insetInlineStart || insetBlockEnd < insetBlockStart) {\n return null;\n }\n boundingBox = {\n insetInlineStart,\n insetBlockStart,\n inlineSize: insetInlineEnd - insetInlineStart,\n blockSize: insetBlockEnd - insetBlockStart,\n };\n }\n return boundingBox;\n}\n\n/**\n * Returns the area of the intersection of passed in rectangles or a null, if there is no intersection\n */\nexport function intersectRectangles(rectangles: BoundingBox[]): number | null {\n const boundingBox: BoundingBox | null = getIntersection(rectangles);\n return boundingBox && boundingBox.blockSize * boundingBox.inlineSize;\n}\n\ntype CandidatePosition = CalculatedPosition & { visibleArea: BoundingBox | null };\n\n/**\n * A functions that returns the correct popover position based on screen dimensions.\n */\nexport function calculatePosition({\n preferredPosition,\n fixedInternalPosition,\n trigger,\n arrow,\n body,\n container,\n viewport,\n // the popover is only bound by the viewport if it is rendered in a portal\n renderWithPortal,\n allowVerticalOverflow,\n}: {\n preferredPosition: PopoverProps.Position;\n fixedInternalPosition?: InternalPosition;\n trigger: BoundingBox;\n arrow: Dimensions;\n body: Dimensions;\n container: BoundingBox;\n viewport: BoundingBox;\n // the popover is only bound by the viewport if it is rendered in a portal\n renderWithPortal?: boolean;\n allowVerticalOverflow?: boolean;\n}): CalculatedPosition {\n let bestOption: CandidatePosition | null = null;\n\n // If a fixed internal position is passed, only consider this one.\n const preferredInternalPositions = fixedInternalPosition\n ? [fixedInternalPosition]\n : PRIORITY_MAPPING[preferredPosition];\n\n // Attempt to position the popover based on the priority list for this position.\n for (const internalPosition of preferredInternalPositions) {\n const rect = RECTANGLE_CALCULATIONS[internalPosition]({ body, trigger, arrow });\n const visibleArea = renderWithPortal\n ? getIntersection([rect, viewport])\n : getIntersection([rect, viewport, container]);\n\n const fitsWithoutOverflow =\n visibleArea && visibleArea.inlineSize === body.inlineSize && visibleArea.blockSize === body.blockSize;\n\n if (fitsWithoutOverflow) {\n return { internalPosition, rect };\n }\n\n const newOption = { rect, internalPosition, visibleArea };\n bestOption = getBestOption(newOption, bestOption);\n }\n\n // Use best possible placement.\n const internalPosition = bestOption?.internalPosition || 'right-top';\n // Get default rect for that placement.\n const rect = RECTANGLE_CALCULATIONS[internalPosition]({ body, trigger, arrow });\n\n // Get largest possible rect that fits into the viewport or container.\n\n // We allow the popover to overflow the viewport if allowVerticalOverflow is true _and_ the popover will be anchored to the top or the bottom.\n // If it is anchored to the right or left, we consider that it should have enough vertical space so that applying scroll to it is a better option.\n const tallestBoundingContainer = getTallestRect(viewport, container);\n const boundingContainer =\n allowVerticalOverflow && isTopOrBottom(internalPosition)\n ? {\n insetBlockStart: tallestBoundingContainer.insetBlockStart,\n blockSize: tallestBoundingContainer.blockSize,\n insetInlineStart: viewport.insetInlineStart,\n inlineSize: viewport.inlineSize,\n }\n : viewport;\n\n const optimizedRect = fitIntoContainer(rect, boundingContainer);\n\n // If largest possible rect is shorter than original - set body scroll.\n const scrollable = optimizedRect.blockSize < rect.blockSize;\n\n return { internalPosition, rect: optimizedRect, scrollable };\n}\n\nfunction getBestOption(option1: CandidatePosition, option2: CandidatePosition | null) {\n // Within calculatePosition, the only case where option2 will not be defined will be in the first call.\n // The only case where the visibleArea of an option will be null is when the popover is totally outside of the viewport.\n if (!option2?.visibleArea) {\n return option1;\n }\n if (!option1.visibleArea) {\n return option2;\n }\n // Only if none of the two options overflows horizontally, choose the best based on the visible height.\n if (option1.visibleArea.inlineSize === option2.visibleArea.inlineSize) {\n return option1.visibleArea.blockSize > option2.visibleArea.blockSize ? option1 : option2;\n }\n // Otherwise, choose the option that is less cut off horizontally.\n return option1.visibleArea.inlineSize > option2.visibleArea.inlineSize ? option1 : option2;\n}\n\nexport function getOffsetDimensions(element: HTMLElement) {\n return { offsetHeight: element.offsetHeight, offsetWidth: element.offsetWidth };\n}\n\nexport function getDimensions(element: HTMLElement) {\n const computedStyle = getComputedStyle(element);\n return {\n inlineSize: parseFloat(computedStyle.inlineSize),\n blockSize: parseFloat(computedStyle.blockSize),\n };\n}\n\nfunction isTopOrBottom(internalPosition: InternalPosition) {\n return ['top', 'bottom'].includes(internalPosition.split('-')[0]);\n}\n"]}
1
+ {"version":3,"file":"positions.js","sourceRoot":"","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AAU,EAAE,UAAU,CAAC,aAAa,CAAC,UAAU,CAAC;QAChD,SAAS,EAAE,UAAU,CAAC,aAAa,CAAC,SAAS,CAAC;KAC/C,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,gBAAkC;IACvD,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACpE,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAAW,EAAE,MAAY;IACvD,MAAM,WAAW,GAAG,KAAK,CAAC,eAAe,GAAG,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC;IAChE,MAAM,mBAAmB,GAAG,WAAW,GAAG,MAAM,CAAC,eAAe,CAAC;IACjE,MAAM,iBAAiB,GAAG,WAAW,GAAG,MAAM,CAAC,aAAa,CAAC;IAC7D,OAAO,mBAAmB,IAAI,iBAAiB,CAAC;AAClD,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BoundingBox, Dimensions, InternalPosition, PopoverProps, Rect } from '../interfaces';\n\n// A structure describing how the popover should be positioned\ninterface CalculatedPosition {\n scrollable?: boolean;\n internalPosition: InternalPosition;\n rect: BoundingBox;\n}\n\ninterface ElementGroup {\n body: Dimensions;\n trigger: BoundingBox;\n arrow: Dimensions;\n}\n\nconst ARROW_OFFSET = 12;\n\nexport const PRIORITY_MAPPING: Record<PopoverProps.Position, InternalPosition[]> = {\n top: [\n 'top-center',\n 'top-right',\n 'top-left',\n 'bottom-center',\n 'bottom-right',\n 'bottom-left',\n 'right-top',\n 'right-bottom',\n 'left-top',\n 'left-bottom',\n ],\n bottom: [\n 'bottom-center',\n 'bottom-right',\n 'bottom-left',\n 'top-center',\n 'top-right',\n 'top-left',\n 'right-top',\n 'right-bottom',\n 'left-top',\n 'left-bottom',\n ],\n left: [\n 'left-top',\n 'left-bottom',\n 'right-top',\n 'right-bottom',\n 'bottom-center',\n 'top-center',\n 'bottom-left',\n 'top-left',\n 'bottom-right',\n 'top-right',\n ],\n right: [\n 'right-top',\n 'right-bottom',\n 'left-top',\n 'left-bottom',\n 'bottom-center',\n 'top-center',\n 'bottom-right',\n 'top-right',\n 'bottom-left',\n 'top-left',\n ],\n};\n\nconst RECTANGLE_CALCULATIONS: Record<InternalPosition, (r: ElementGroup) => BoundingBox> = {\n 'top-center': ({ body, trigger, arrow }) => {\n return {\n insetBlockStart: trigger.insetBlockStart - body.blockSize - arrow.blockSize,\n insetInlineStart: trigger.insetInlineStart + trigger.inlineSize / 2 - body.inlineSize / 2,\n inlineSize: body.inlineSize,\n blockSize: body.blockSize,\n };\n },\n 'top-right': ({ body, trigger, arrow }) => {\n return {\n insetBlockStart: trigger.insetBlockStart - body.blockSize - arrow.blockSize,\n insetInlineStart: trigger.insetInlineStart + trigger.inlineSize / 2 - ARROW_OFFSET - arrow.inlineSize / 2,\n inlineSize: body.inlineSize,\n blockSize: body.blockSize,\n };\n },\n 'top-left': ({ body, trigger, arrow }) => {\n return {\n insetBlockStart: trigger.insetBlockStart - body.blockSize - arrow.blockSize,\n insetInlineStart:\n trigger.insetInlineStart + trigger.inlineSize / 2 + ARROW_OFFSET + arrow.inlineSize / 2 - body.inlineSize,\n inlineSize: body.inlineSize,\n blockSize: body.blockSize,\n };\n },\n 'bottom-center': ({ body, trigger, arrow }) => {\n return {\n insetBlockStart: trigger.insetBlockStart + trigger.blockSize + arrow.blockSize,\n insetInlineStart: trigger.insetInlineStart + trigger.inlineSize / 2 - body.inlineSize / 2,\n inlineSize: body.inlineSize,\n blockSize: body.blockSize,\n };\n },\n 'bottom-right': ({ body, trigger, arrow }) => {\n return {\n insetBlockStart: trigger.insetBlockStart + trigger.blockSize + arrow.blockSize,\n insetInlineStart: trigger.insetInlineStart + trigger.inlineSize / 2 - ARROW_OFFSET - arrow.inlineSize / 2,\n inlineSize: body.inlineSize,\n blockSize: body.blockSize,\n };\n },\n 'bottom-left': ({ body, trigger, arrow }) => {\n return {\n insetBlockStart: trigger.insetBlockStart + trigger.blockSize + arrow.blockSize,\n insetInlineStart:\n trigger.insetInlineStart + trigger.inlineSize / 2 + ARROW_OFFSET + arrow.inlineSize / 2 - body.inlineSize,\n inlineSize: body.inlineSize,\n blockSize: body.blockSize,\n };\n },\n 'right-top': ({ body, trigger, arrow }) => {\n return {\n insetBlockStart: trigger.insetBlockStart + trigger.blockSize / 2 - ARROW_OFFSET - arrow.blockSize,\n insetInlineStart: trigger.insetInlineStart + trigger.inlineSize + arrow.blockSize,\n inlineSize: body.inlineSize,\n blockSize: body.blockSize,\n };\n },\n 'right-bottom': ({ body, trigger, arrow }) => {\n return {\n insetBlockStart:\n trigger.insetBlockStart + trigger.blockSize / 2 - body.blockSize + ARROW_OFFSET + arrow.blockSize,\n insetInlineStart: trigger.insetInlineStart + trigger.inlineSize + arrow.blockSize,\n inlineSize: body.inlineSize,\n blockSize: body.blockSize,\n };\n },\n 'left-top': ({ body, trigger, arrow }) => {\n return {\n insetBlockStart: trigger.insetBlockStart + trigger.blockSize / 2 - ARROW_OFFSET - arrow.blockSize,\n insetInlineStart: trigger.insetInlineStart - body.inlineSize - arrow.blockSize,\n inlineSize: body.inlineSize,\n blockSize: body.blockSize,\n };\n },\n 'left-bottom': ({ body, trigger, arrow }) => {\n return {\n insetBlockStart:\n trigger.insetBlockStart + trigger.blockSize / 2 - body.blockSize + ARROW_OFFSET + arrow.blockSize,\n insetInlineStart: trigger.insetInlineStart - body.inlineSize - arrow.blockSize,\n inlineSize: body.inlineSize,\n blockSize: body.blockSize,\n };\n },\n};\n\nfunction fitIntoContainer(inner: BoundingBox, outer: BoundingBox): BoundingBox {\n let { insetInlineStart, inlineSize, insetBlockStart, blockSize } = inner;\n\n // Adjust left boundary.\n if (insetInlineStart < outer.insetInlineStart) {\n inlineSize = insetInlineStart + inlineSize - outer.insetInlineStart;\n insetInlineStart = outer.insetInlineStart;\n }\n // Adjust right boundary.\n else if (insetInlineStart + inlineSize > outer.insetInlineStart + outer.inlineSize) {\n inlineSize = outer.insetInlineStart + outer.inlineSize - insetInlineStart;\n }\n // Adjust top boundary.\n if (insetBlockStart < outer.insetBlockStart) {\n blockSize = insetBlockStart + blockSize - outer.insetBlockStart;\n insetBlockStart = outer.insetBlockStart;\n }\n // Adjust bottom boundary.\n else if (insetBlockStart + blockSize > outer.insetBlockStart + outer.blockSize) {\n blockSize = outer.insetBlockStart + outer.blockSize - insetBlockStart;\n }\n\n return { insetInlineStart, inlineSize, insetBlockStart, blockSize };\n}\n\nfunction getTallestRect(rect1: BoundingBox, rect2: BoundingBox): BoundingBox {\n return rect1.blockSize >= rect2.blockSize ? rect1 : rect2;\n}\n\nfunction getIntersection(rectangles: BoundingBox[]): BoundingBox | null {\n let boundingBox: BoundingBox | null = null;\n for (const currentRect of rectangles) {\n if (!boundingBox) {\n boundingBox = currentRect;\n continue;\n }\n const insetInlineStart = Math.max(boundingBox.insetInlineStart, currentRect.insetInlineStart);\n const insetBlockStart = Math.max(boundingBox.insetBlockStart, currentRect.insetBlockStart);\n const insetInlineEnd = Math.min(\n boundingBox.insetInlineStart + boundingBox.inlineSize,\n currentRect.insetInlineStart + currentRect.inlineSize\n );\n const insetBlockEnd = Math.min(\n boundingBox.insetBlockStart + boundingBox.blockSize,\n currentRect.insetBlockStart + currentRect.blockSize\n );\n\n if (insetInlineEnd < insetInlineStart || insetBlockEnd < insetBlockStart) {\n return null;\n }\n boundingBox = {\n insetInlineStart,\n insetBlockStart,\n inlineSize: insetInlineEnd - insetInlineStart,\n blockSize: insetBlockEnd - insetBlockStart,\n };\n }\n return boundingBox;\n}\n\n/**\n * Returns the area of the intersection of passed in rectangles or a null, if there is no intersection\n */\nexport function intersectRectangles(rectangles: BoundingBox[]): number | null {\n const boundingBox: BoundingBox | null = getIntersection(rectangles);\n return boundingBox && boundingBox.blockSize * boundingBox.inlineSize;\n}\n\ntype CandidatePosition = CalculatedPosition & { visibleArea: BoundingBox | null };\n\n/**\n * A functions that returns the correct popover position based on screen dimensions.\n */\nexport function calculatePosition({\n preferredPosition,\n fixedInternalPosition,\n trigger,\n arrow,\n body,\n container,\n viewport,\n // the popover is only bound by the viewport if it is rendered in a portal\n renderWithPortal,\n allowVerticalOverflow,\n}: {\n preferredPosition: PopoverProps.Position;\n fixedInternalPosition?: InternalPosition;\n trigger: BoundingBox;\n arrow: Dimensions;\n body: Dimensions;\n container: BoundingBox;\n viewport: BoundingBox;\n // the popover is only bound by the viewport if it is rendered in a portal\n renderWithPortal?: boolean;\n allowVerticalOverflow?: boolean;\n}): CalculatedPosition {\n let bestOption: CandidatePosition | null = null;\n\n // If a fixed internal position is passed, only consider this one.\n const preferredInternalPositions = fixedInternalPosition\n ? [fixedInternalPosition]\n : PRIORITY_MAPPING[preferredPosition];\n\n // Attempt to position the popover based on the priority list for this position.\n for (const internalPosition of preferredInternalPositions) {\n const rect = RECTANGLE_CALCULATIONS[internalPosition]({ body, trigger, arrow });\n const visibleArea = renderWithPortal\n ? getIntersection([rect, viewport])\n : getIntersection([rect, viewport, container]);\n\n const fitsWithoutOverflow =\n visibleArea && visibleArea.inlineSize === body.inlineSize && visibleArea.blockSize === body.blockSize;\n\n if (fitsWithoutOverflow) {\n return { internalPosition, rect };\n }\n\n const newOption = { rect, internalPosition, visibleArea };\n bestOption = getBestOption(newOption, bestOption);\n }\n\n // Use best possible placement.\n const internalPosition = bestOption?.internalPosition || 'right-top';\n // Get default rect for that placement.\n const rect = RECTANGLE_CALCULATIONS[internalPosition]({ body, trigger, arrow });\n\n // Get largest possible rect that fits into the viewport or container.\n\n // We allow the popover to overflow the viewport if allowVerticalOverflow is true _and_ the popover will be anchored to the top or the bottom.\n // If it is anchored to the right or left, we consider that it should have enough vertical space so that applying scroll to it is a better option.\n const tallestBoundingContainer = getTallestRect(viewport, container);\n const boundingContainer =\n allowVerticalOverflow && isTopOrBottom(internalPosition)\n ? {\n insetBlockStart: tallestBoundingContainer.insetBlockStart,\n blockSize: tallestBoundingContainer.blockSize,\n insetInlineStart: viewport.insetInlineStart,\n inlineSize: viewport.inlineSize,\n }\n : viewport;\n\n const optimizedRect = fitIntoContainer(rect, boundingContainer);\n\n // If largest possible rect is shorter than original - set body scroll.\n const scrollable = optimizedRect.blockSize < rect.blockSize;\n\n return { internalPosition, rect: optimizedRect, scrollable };\n}\n\nfunction getBestOption(option1: CandidatePosition, option2: CandidatePosition | null) {\n // Within calculatePosition, the only case where option2 will not be defined will be in the first call.\n // The only case where the visibleArea of an option will be null is when the popover is totally outside of the viewport.\n if (!option2?.visibleArea) {\n return option1;\n }\n if (!option1.visibleArea) {\n return option2;\n }\n // Only if none of the two options overflows horizontally, choose the best based on the visible height.\n if (option1.visibleArea.inlineSize === option2.visibleArea.inlineSize) {\n return option1.visibleArea.blockSize > option2.visibleArea.blockSize ? option1 : option2;\n }\n // Otherwise, choose the option that is less cut off horizontally.\n return option1.visibleArea.inlineSize > option2.visibleArea.inlineSize ? option1 : option2;\n}\n\nexport function getOffsetDimensions(element: HTMLElement) {\n return { offsetHeight: element.offsetHeight, offsetWidth: element.offsetWidth };\n}\n\nexport function getDimensions(element: HTMLElement) {\n const computedStyle = getComputedStyle(element);\n return {\n inlineSize: parseFloat(computedStyle.inlineSize),\n blockSize: parseFloat(computedStyle.blockSize),\n };\n}\n\nfunction isTopOrBottom(internalPosition: InternalPosition) {\n return ['top', 'bottom'].includes(internalPosition.split('-')[0]);\n}\n\nexport function isCenterOutside(child: Rect, parent: Rect) {\n const childCenter = child.insetBlockStart + child.blockSize / 2;\n const overflowsBlockStart = childCenter < parent.insetBlockStart;\n const overflowsBlockEnd = childCenter > parent.insetBlockEnd;\n return overflowsBlockStart || overflowsBlockEnd;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../../../src/select/parts/item.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAOtC,OAAO,EA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B,aAAa,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CACvC;;AAyFD,wBAAkD"}
@@ -32,7 +32,7 @@ const Item = (_a, ref) => {
32
32
  React.createElement(InternalIcon, { name: "check" }))),
33
33
  isDisabledWithReason && (React.createElement(React.Fragment, null,
34
34
  descriptionEl,
35
- highlighted && (React.createElement(Tooltip, { className: styles['disabled-reason-tooltip'], trackRef: internalRef, value: disabledReason, position: "right" })))))));
35
+ highlighted && (React.createElement(Tooltip, { className: styles['disabled-reason-tooltip'], trackRef: internalRef, value: disabledReason, position: "right", hideOnOverscroll: true })))))));
36
36
  };
37
37
  export default React.memo(React.forwardRef(Item));
38
38
  //# sourceMappingURL=item.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"item.js","sourceRoot":"","sources":["../../../../src/select/parts/item.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,YAAY,MAAM,yCAAyC,CAAC;AACnE,OAAO,MAAM,MAAM,kCAAkC,CAAC;AAGtD,OAAO,cAAc,MAAM,2CAA2C,CAAC;AACvE,OAAO,OAAO,MAAM,mCAAmC,CAAC;AACxD,OAAO,oBAAoB,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAEnE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAiBrC,MAAM,IAAI,GAAG,CACX,EAcY,EACZ,GAA8B,EAC9B,EAAE;QAhBF,EACE,MAAM,EACN,WAAW,EACX,QAAQ,EACR,cAAc,EACd,WAAW,EACX,eAAe,EACf,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,YAAY,EACZ,WAAW,EACX,a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AAS;QAEb,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,QAAQ,IAAI,aAAa,CAAC,QAAQ,IAAI,MAAM,CAAC,gBAAgB,CAAC,CAAC;YAC/F,WAAW,IAAI,CAAC,QAAQ,IAAI,CAC3B,6BAAK,SAAS,EAAE,MAAM,CAAC,QAAQ;gBAC7B,oBAAC,YAAY,IAAC,OAAO,EAAE,QAAQ,IAAI,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,GAAI,CACnE,CACP;YACD,oBAAC,MAAM,IACL,MAAM,kCAAO,aAAa,KAAE,QAAQ,KACpC,iBAAiB,EAAE,WAAW,EAC9B,cAAc,EAAE,QAAQ,EACxB,aAAa,EAAE,cAAc,EAC7B,aAAa,EAAE,QAAQ,GACvB;YACD,CAAC,WAAW,IAAI,CAAC,QAAQ,IAAI,QAAQ,IAAI,CACxC,6BAAK,SAAS,EAAE,MAAM,CAAC,eAAe,CAAC;gBACrC,oBAAC,YAAY,IAAC,IAAI,EAAC,OAAO,GAAG,CACzB,CACP;YACA,oBAAoB,IAAI,CACvB;gBACG,aAAa;gBACb,WAAW,IAAI,CACd,oBAAC,OAAO,IACN,SAAS,EAAE,MAAM,CAAC,yBAAyB,CAAC,EAC5C,QAAQ,EAAE,WAAW,EACrB,KAAK,EAAE,cAAe,EACtB,QAAQ,EAAC,OAAO,GAChB,CACH,CACA,CACJ,CACG,CACS,CAClB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\n\nimport InternalIcon from '../../icon/internal.js';\nimport { getBaseProps } from '../../internal/base-component';\nimport CheckboxIcon from '../../internal/components/checkbox-icon';\nimport Option from '../../internal/components/option';\nimport { DropdownOption, OptionDefinition } from '../../internal/components/option/interfaces';\nimport { HighlightType } from '../../internal/components/options-list/utils/use-highlight-option.js';\nimport SelectableItem from '../../internal/components/selectable-item';\nimport Tooltip from '../../internal/components/tooltip';\nimport useHiddenDescription from '../../internal/hooks/use-hidden-description';\nimport { useMergeRefs } from '../../internal/hooks/use-merge-refs';\n\nimport styles from './styles.css.js';\n\nexport interface ItemProps {\n option: DropdownOption;\n highlighted?: boolean;\n selected?: boolean;\n filteringValue?: string;\n hasCheckbox?: boolean;\n virtualPosition?: number;\n padBottom?: boolean;\n isNextSelected?: boolean;\n screenReaderContent?: string;\n ariaPosinset?: number;\n ariaSetsize?: number;\n highlightType?: HighlightType['type'];\n}\n\nconst Item = (\n {\n option,\n highlighted,\n selected,\n filteringValue,\n hasCheckbox,\n virtualPosition,\n padBottom,\n isNextSelected,\n screenReaderContent,\n ariaPosinset,\n ariaSetsize,\n highlightType,\n ...restProps\n }: ItemProps,\n ref: React.Ref<HTMLDivElement>\n) => {\n const baseProps = getBaseProps(restProps);\n\n const isParent = option.type === 'parent';\n const isChild = option.type === 'child';\n const wrappedOption: OptionDefinition = option.option;\n const disabled = option.disabled || wrappedOption.disabled;\n const disabledReason = disabled && wrappedOption.disabledReason ? wrappedOption.disabledReason : '';\n const isDisabledWithReason = !!disabledReason;\n const internalRef = useRef<HTMLDivElement>(null);\n\n const { descriptionEl, descriptionId } = useHiddenDescription(disabledReason);\n\n return (\n <SelectableItem\n ariaSelected={Boolean(selected)}\n selected={selected}\n isNextSelected={isNextSelected}\n highlighted={highlighted}\n disabled={option.disabled}\n isParent={isParent}\n isChild={isChild}\n ref={useMergeRefs(ref, internalRef)}\n virtualPosition={virtualPosition}\n padBottom={padBottom}\n screenReaderContent={screenReaderContent}\n ariaPosinset={ariaPosinset}\n ariaSetsize={ariaSetsize}\n highlightType={highlightType}\n ariaDescribedby={isDisabledWithReason ? descriptionId : ''}\n value={option.option.value}\n {...baseProps}\n >\n <div className={clsx(styles.item, !isParent && wrappedOption.labelTag && styles['show-label-tag'])}>\n {hasCheckbox && !isParent && (\n <div className={styles.checkbox}>\n <CheckboxIcon checked={selected || false} disabled={option.disabled} />\n </div>\n )}\n <Option\n option={{ ...wrappedOption, disabled }}\n highlightedOption={highlighted}\n selectedOption={selected}\n highlightText={filteringValue}\n isGroupOption={isParent}\n />\n {!hasCheckbox && !isParent && selected && (\n <div className={styles['selected-icon']}>\n <InternalIcon name=\"check\" />\n </div>\n )}\n {isDisabledWithReason && (\n <>\n {descriptionEl}\n {highlighted && (\n <Tooltip\n className={styles['disabled-reason-tooltip']}\n trackRef={internalRef}\n value={disabledReason!}\n position=\"right\"\n />\n )}\n </>\n )}\n </div>\n </SelectableItem>\n );\n};\n\nexport default React.memo(React.forwardRef(Item));\n"]}
1
+ {"version":3,"file":"item.js","sourceRoot":"","sources":["../../../../src/select/parts/item.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,YAAY,MAAM,yCAAyC,CAAC;AACnE,OAAO,MAAM,MAAM,kCAAkC,CAAC;AAGtD,OAAO,cAAc,MAAM,2CAA2C,CAAC;AACvE,OAAO,OAAO,MAAM,mCAAmC,CAAC;AACxD,OAAO,oBAAoB,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAEnE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAiBrC,MAAM,IAAI,GAAG,CACX,EAcY,EACZ,GAA8B,EAC9B,EAAE;QAhBF,EACE,MAAM,EACN,WAAW,EACX,QAAQ,EACR,cAAc,EACd,WAAW,EACX,eAAe,EACf,SAAS,EACT,cAAc,EACd,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,MAAM,CAAC,MAAM,CAAC,KAAK,IACtB,SAAS;QAEb,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,QAAQ,IAAI,aAAa,CAAC,QAAQ,IAAI,MAAM,CAAC,gBAAgB,CAAC,CAAC;YAC/F,WAAW,IAAI,CAAC,QAAQ,IAAI,CAC3B,6BAAK,SAAS,EAAE,MAAM,CAAC,QAAQ;gBAC7B,oBAAC,YAAY,IAAC,OAAO,EAAE,QAAQ,IAAI,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,GAAI,CACnE,CACP;YACD,oBAAC,MAAM,IACL,MAAM,kCAAO,aAAa,KAAE,QAAQ,KACpC,iBAAiB,EAAE,WAAW,EAC9B,cAAc,EAAE,QAAQ,EACxB,aAAa,EAAE,cAAc,EAC7B,aAAa,EAAE,QAAQ,GACvB;YACD,CAAC,WAAW,IAAI,CAAC,QAAQ,IAAI,QAAQ,IAAI,CACxC,6BAAK,SAAS,EAAE,MAAM,CAAC,eAAe,CAAC;gBACrC,oBAAC,YAAY,IAAC,IAAI,EAAC,OAAO,GAAG,CACzB,CACP;YACA,oBAAoB,IAAI,CACvB;gBACG,aAAa;gBACb,WAAW,IAAI,CACd,oBAAC,OAAO,IACN,SAAS,EAAE,MAAM,CAAC,yBAAyB,CAAC,EAC5C,QAAQ,EAAE,WAAW,EACrB,KAAK,EAAE,cAAe,EACtB,QAAQ,EAAC,OAAO,EAChB,gBAAgB,EAAE,IAAI,GACtB,CACH,CACA,CACJ,CACG,CACS,CAClB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\n\nimport InternalIcon from '../../icon/internal.js';\nimport { getBaseProps } from '../../internal/base-component';\nimport CheckboxIcon from '../../internal/components/checkbox-icon';\nimport Option from '../../internal/components/option';\nimport { DropdownOption, OptionDefinition } from '../../internal/components/option/interfaces';\nimport { HighlightType } from '../../internal/components/options-list/utils/use-highlight-option.js';\nimport SelectableItem from '../../internal/components/selectable-item';\nimport Tooltip from '../../internal/components/tooltip';\nimport useHiddenDescription from '../../internal/hooks/use-hidden-description';\nimport { useMergeRefs } from '../../internal/hooks/use-merge-refs';\n\nimport styles from './styles.css.js';\n\nexport interface ItemProps {\n option: DropdownOption;\n highlighted?: boolean;\n selected?: boolean;\n filteringValue?: string;\n hasCheckbox?: boolean;\n virtualPosition?: number;\n padBottom?: boolean;\n isNextSelected?: boolean;\n screenReaderContent?: string;\n ariaPosinset?: number;\n ariaSetsize?: number;\n highlightType?: HighlightType['type'];\n}\n\nconst Item = (\n {\n option,\n highlighted,\n selected,\n filteringValue,\n hasCheckbox,\n virtualPosition,\n padBottom,\n isNextSelected,\n screenReaderContent,\n ariaPosinset,\n ariaSetsize,\n highlightType,\n ...restProps\n }: ItemProps,\n ref: React.Ref<HTMLDivElement>\n) => {\n const baseProps = getBaseProps(restProps);\n\n const isParent = option.type === 'parent';\n const isChild = option.type === 'child';\n const wrappedOption: OptionDefinition = option.option;\n const disabled = option.disabled || wrappedOption.disabled;\n const disabledReason = disabled && wrappedOption.disabledReason ? wrappedOption.disabledReason : '';\n const isDisabledWithReason = !!disabledReason;\n const internalRef = useRef<HTMLDivElement>(null);\n\n const { descriptionEl, descriptionId } = useHiddenDescription(disabledReason);\n\n return (\n <SelectableItem\n ariaSelected={Boolean(selected)}\n selected={selected}\n isNextSelected={isNextSelected}\n highlighted={highlighted}\n disabled={option.disabled}\n isParent={isParent}\n isChild={isChild}\n ref={useMergeRefs(ref, internalRef)}\n virtualPosition={virtualPosition}\n padBottom={padBottom}\n screenReaderContent={screenReaderContent}\n ariaPosinset={ariaPosinset}\n ariaSetsize={ariaSetsize}\n highlightType={highlightType}\n ariaDescribedby={isDisabledWithReason ? descriptionId : ''}\n value={option.option.value}\n {...baseProps}\n >\n <div className={clsx(styles.item, !isParent && wrappedOption.labelTag && styles['show-label-tag'])}>\n {hasCheckbox && !isParent && (\n <div className={styles.checkbox}>\n <CheckboxIcon checked={selected || false} disabled={option.disabled} />\n </div>\n )}\n <Option\n option={{ ...wrappedOption, disabled }}\n highlightedOption={highlighted}\n selectedOption={selected}\n highlightText={filteringValue}\n isGroupOption={isParent}\n />\n {!hasCheckbox && !isParent && selected && (\n <div className={styles['selected-icon']}>\n <InternalIcon name=\"check\" />\n </div>\n )}\n {isDisabledWithReason && (\n <>\n {descriptionEl}\n {highlighted && (\n <Tooltip\n className={styles['disabled-reason-tooltip']}\n trackRef={internalRef}\n value={disabledReason!}\n position=\"right\"\n hideOnOverscroll={true}\n />\n )}\n </>\n )}\n </div>\n </SelectableItem>\n );\n};\n\nexport default React.memo(React.forwardRef(Item));\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"multiselect-item.d.ts","sourceRoot":"","sources":["../../../../src/select/parts/multiselect-item.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAUtC,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAGnC,UAAU,oBAAqB,SAAQ,SAAS;IAC9C,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;;AAyFD,wBAA6D"}
1
+ {"version":3,"file":"multiselect-item.d.ts","sourceRoot":"","sources":["../../../../src/select/parts/multiselect-item.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAUtC,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAGnC,UAAU,oBAAqB,SAAQ,SAAS;IAC9C,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;;AA0FD,wBAA6D"}
@@ -31,7 +31,7 @@ const MultiSelectItem = (_a, ref) => {
31
31
  React.createElement(Option, { option: Object.assign(Object.assign({}, wrappedOption), { disabled }), highlightedOption: highlighted, selectedOption: selected, highlightText: filteringValue, isGroupOption: isParent })),
32
32
  isDisabledWithReason && (React.createElement(React.Fragment, null,
33
33
  descriptionEl,
34
- highlighted && (React.createElement(Tooltip, { className: styles['disabled-reason-tooltip'], trackRef: internalRef, value: disabledReason, position: "right" }))))));
34
+ highlighted && (React.createElement(Tooltip, { className: styles['disabled-reason-tooltip'], trackRef: internalRef, value: disabledReason, position: "right", hideOnOverscroll: true }))))));
35
35
  };
36
36
  export default React.memo(React.forwardRef(MultiSelectItem));
37
37
  //# sourceMappingURL=multiselect-item.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"multiselect-item.js","sourceRoot":"","sources":["../../../../src/select/parts/multiselect-item.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,YAAY,MAAM,yCAAyC,CAAC;AACnE,OAAO,MAAM,MAAM,kCAAkC,CAAC;AAEtD,OAAO,cAAc,MAAM,2CAA2C,CAAC;AACvE,OAAO,OAAO,MAAM,mCAAmC,CAAC;AACxD,OAAO,oBAAoB,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAGnE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAKrC,MAAM,eAAe,GAAG,CACtB,EAeuB,EACvB,GAA8B,EAC9B,EAAE;QAjBF,EACE,MAAM,EACN,WAAW,EACX,QAAQ,EACR,cAAc,EACd,WAAW,EACX,eAAe,EACf,SAAS,EACT,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,YAAY,EACZ,WAAW,EACX,aAAa,OAEQ,EADlB,SAAS,cAdd,gNAeC,CADa;IAId,MAAM,SAAS,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;IAE1C,MAAM,QAAQ,GAAG,MAAM,C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EAC1D,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,IACtB,SAAS;QAEb,6BAAK,SAAS,EAAE,SAAS;YACtB,WAAW,IAAI,CACd,6BAAK,SAAS,EAAE,MAAM,CAAC,QAAQ;gBAC7B,oBAAC,YAAY,IAAC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,IAAI,aAAa,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,GAAI,CACpG,CACP;YACD,oBAAC,MAAM,IACL,MAAM,kCAAO,aAAa,KAAE,QAAQ,KACpC,iBAAiB,EAAE,WAAW,EAC9B,cAAc,EAAE,QAAQ,EACxB,aAAa,EAAE,cAAc,EAC7B,aAAa,EAAE,QAAQ,GACvB,CACE;QACL,oBAAoB,IAAI,CACvB;YACG,aAAa;YACb,WAAW,IAAI,CACd,oBAAC,OAAO,IACN,SAAS,EAAE,MAAM,CAAC,yBAAyB,CAAC,EAC5C,QAAQ,EAAE,WAAW,EACrB,KAAK,EAAE,cAAe,EACtB,QAAQ,EAAC,OAAO,GAChB,CACH,CACA,CACJ,CACc,CAClB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\n\nimport { getBaseProps } from '../../internal/base-component';\nimport CheckboxIcon from '../../internal/components/checkbox-icon';\nimport Option from '../../internal/components/option';\nimport { OptionDefinition } from '../../internal/components/option/interfaces';\nimport SelectableItem from '../../internal/components/selectable-item';\nimport Tooltip from '../../internal/components/tooltip';\nimport useHiddenDescription from '../../internal/hooks/use-hidden-description';\nimport { useMergeRefs } from '../../internal/hooks/use-merge-refs';\nimport { ItemProps } from './item';\n\nimport styles from './styles.css.js';\ninterface MultiselectItemProps extends ItemProps {\n indeterminate?: boolean;\n}\n\nconst MultiSelectItem = (\n {\n option,\n highlighted,\n selected,\n filteringValue,\n hasCheckbox,\n virtualPosition,\n padBottom,\n isNextSelected,\n indeterminate,\n screenReaderContent,\n ariaPosinset,\n ariaSetsize,\n highlightType,\n ...restProps\n }: MultiselectItemProps,\n ref: React.Ref<HTMLDivElement>\n) => {\n const baseProps = getBaseProps(restProps);\n\n const isParent = option.type === 'parent';\n const isChild = option.type === 'child';\n const wrappedOption: OptionDefinition = option.option;\n const disabled = option.disabled || wrappedOption.disabled;\n const disabledReason =\n disabled && (option.disabledReason || wrappedOption.disabledReason)\n ? option.disabledReason || wrappedOption.disabledReason\n : '';\n const isDisabledWithReason = !!disabledReason;\n const internalRef = useRef<HTMLDivElement>(null);\n const className = styles.item;\n\n const { descriptionId, descriptionEl } = useHiddenDescription(disabledReason);\n\n return (\n <SelectableItem\n ariaChecked={isParent && indeterminate ? 'mixed' : Boolean(selected)}\n selected={selected}\n isNextSelected={isNextSelected}\n highlighted={highlighted}\n disabled={disabled}\n isParent={isParent}\n isChild={isChild}\n highlightType={highlightType}\n ref={useMergeRefs(ref, internalRef)}\n virtualPosition={virtualPosition}\n padBottom={padBottom}\n useInteractiveGroups={true}\n screenReaderContent={screenReaderContent}\n ariaPosinset={ariaPosinset}\n ariaSetsize={ariaSetsize}\n ariaDescribedby={isDisabledWithReason ? descriptionId : ''}\n value={option.option.value}\n {...baseProps}\n >\n <div className={className}>\n {hasCheckbox && (\n <div className={styles.checkbox}>\n <CheckboxIcon checked={selected} indeterminate={isParent && indeterminate} disabled={option.disabled} />\n </div>\n )}\n <Option\n option={{ ...wrappedOption, disabled }}\n highlightedOption={highlighted}\n selectedOption={selected}\n highlightText={filteringValue}\n isGroupOption={isParent}\n />\n </div>\n {isDisabledWithReason && (\n <>\n {descriptionEl}\n {highlighted && (\n <Tooltip\n className={styles['disabled-reason-tooltip']}\n trackRef={internalRef}\n value={disabledReason!}\n position=\"right\"\n />\n )}\n </>\n )}\n </SelectableItem>\n );\n};\n\nexport default React.memo(React.forwardRef(MultiSelectItem));\n"]}
1
+ {"version":3,"file":"multiselect-item.js","sourceRoot":"","sources":["../../../../src/select/parts/multiselect-item.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,YAAY,MAAM,yCAAyC,CAAC;AACnE,OAAO,MAAM,MAAM,kCAAkC,CAAC;AAEtD,OAAO,cAAc,MAAM,2CAA2C,CAAC;AACvE,OAAO,OAAO,MAAM,mCAAmC,CAAC;AACxD,OAAO,oBAAoB,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAGnE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAKrC,MAAM,eAAe,GAAG,CACtB,EAeuB,EACvB,GAA8B,EAC9B,EAAE;QAjBF,EACE,MAAM,EACN,WAAW,EACX,QAAQ,EACR,cAAc,EACd,WAAW,EACX,eAAe,EACf,SAAS,EACT,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,YAAY,EACZ,WAAW,EACX,aAAa,OAEQ,EADlB,SAAS,cAdd,gNAeC,CADa;IAId,MAAM,SAAS,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;IAE1C,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC;IAC1C,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,KAAK,OAAO,CAAC;IACxC,MAAM,aAAa,GAAqB,MAAM,CAAC,MAAM,CAAC;IACtD,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI,aAAa,CAAC,QAAQ,CAAC;IAC3D,MAAM,cAAc,GAClB,QAAQ,IAAI,CAAC,MAAM,CAAC,cAAc,IAAI,aAAa,CAAC,cAAc,CAAC;QACjE,CAAC,CAAC,MAAM,CAAC,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E,QAAQ,KACpC,iBAAiB,EAAE,WAAW,EAC9B,cAAc,EAAE,QAAQ,EACxB,aAAa,EAAE,cAAc,EAC7B,aAAa,EAAE,QAAQ,GACvB,CACE;QACL,oBAAoB,IAAI,CACvB;YACG,aAAa;YACb,WAAW,IAAI,CACd,oBAAC,OAAO,IACN,SAAS,EAAE,MAAM,CAAC,yBAAyB,CAAC,EAC5C,QAAQ,EAAE,WAAW,EACrB,KAAK,EAAE,cAAe,EACtB,QAAQ,EAAC,OAAO,EAChB,gBAAgB,EAAE,IAAI,GACtB,CACH,CACA,CACJ,CACc,CAClB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\n\nimport { getBaseProps } from '../../internal/base-component';\nimport CheckboxIcon from '../../internal/components/checkbox-icon';\nimport Option from '../../internal/components/option';\nimport { OptionDefinition } from '../../internal/components/option/interfaces';\nimport SelectableItem from '../../internal/components/selectable-item';\nimport Tooltip from '../../internal/components/tooltip';\nimport useHiddenDescription from '../../internal/hooks/use-hidden-description';\nimport { useMergeRefs } from '../../internal/hooks/use-merge-refs';\nimport { ItemProps } from './item';\n\nimport styles from './styles.css.js';\ninterface MultiselectItemProps extends ItemProps {\n indeterminate?: boolean;\n}\n\nconst MultiSelectItem = (\n {\n option,\n highlighted,\n selected,\n filteringValue,\n hasCheckbox,\n virtualPosition,\n padBottom,\n isNextSelected,\n indeterminate,\n screenReaderContent,\n ariaPosinset,\n ariaSetsize,\n highlightType,\n ...restProps\n }: MultiselectItemProps,\n ref: React.Ref<HTMLDivElement>\n) => {\n const baseProps = getBaseProps(restProps);\n\n const isParent = option.type === 'parent';\n const isChild = option.type === 'child';\n const wrappedOption: OptionDefinition = option.option;\n const disabled = option.disabled || wrappedOption.disabled;\n const disabledReason =\n disabled && (option.disabledReason || wrappedOption.disabledReason)\n ? option.disabledReason || wrappedOption.disabledReason\n : '';\n const isDisabledWithReason = !!disabledReason;\n const internalRef = useRef<HTMLDivElement>(null);\n const className = styles.item;\n\n const { descriptionId, descriptionEl } = useHiddenDescription(disabledReason);\n\n return (\n <SelectableItem\n ariaChecked={isParent && indeterminate ? 'mixed' : Boolean(selected)}\n selected={selected}\n isNextSelected={isNextSelected}\n highlighted={highlighted}\n disabled={disabled}\n isParent={isParent}\n isChild={isChild}\n highlightType={highlightType}\n ref={useMergeRefs(ref, internalRef)}\n virtualPosition={virtualPosition}\n padBottom={padBottom}\n useInteractiveGroups={true}\n screenReaderContent={screenReaderContent}\n ariaPosinset={ariaPosinset}\n ariaSetsize={ariaSetsize}\n ariaDescribedby={isDisabledWithReason ? descriptionId : ''}\n value={option.option.value}\n {...baseProps}\n >\n <div className={className}>\n {hasCheckbox && (\n <div className={styles.checkbox}>\n <CheckboxIcon checked={selected} indeterminate={isParent && indeterminate} disabled={option.disabled} />\n </div>\n )}\n <Option\n option={{ ...wrappedOption, disabled }}\n highlightedOption={highlighted}\n selectedOption={selected}\n highlightText={filteringValue}\n isGroupOption={isParent}\n />\n </div>\n {isDisabledWithReason && (\n <>\n {descriptionEl}\n {highlighted && (\n <Tooltip\n className={styles['disabled-reason-tooltip']}\n trackRef={internalRef}\n value={disabledReason!}\n position=\"right\"\n hideOnOverscroll={true}\n />\n )}\n </>\n )}\n </SelectableItem>\n );\n};\n\nexport default React.memo(React.forwardRef(MultiSelectItem));\n"]}
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import { StepsProps } from './interfaces';
3
+ export { StepsProps };
4
+ declare const Steps: ({ steps, ...props }: StepsProps) => JSX.Element;
5
+ export default Steps;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/steps/index.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,QAAA,MAAM,KAAK,wBAAyB,UAAU,gBAM7C,CAAC;AAGF,eAAe,KAAK,CAAC"}
package/steps/index.js ADDED
@@ -0,0 +1,19 @@
1
+ import { __rest } from "tslib";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ import React from 'react';
5
+ import { getBaseProps } from '../internal/base-component';
6
+ import useBaseComponent from '../internal/hooks/use-base-component';
7
+ import { applyDisplayName } from '../internal/utils/apply-display-name';
8
+ import { getExternalProps } from '../internal/utils/external-props';
9
+ import InternalSteps from './internal';
10
+ const Steps = (_a) => {
11
+ var { steps } = _a, props = __rest(_a, ["steps"]);
12
+ const baseProps = getBaseProps(props);
13
+ const baseComponentProps = useBaseComponent('Steps');
14
+ const externalProps = getExternalProps(props);
15
+ return React.createElement(InternalSteps, Object.assign({}, baseProps, baseComponentProps, externalProps, { steps: steps }));
16
+ };
17
+ applyDisplayName(Steps, 'Steps');
18
+ export default Steps;
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/steps/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE,OAAO,aAAa,MAAM,YAAY,CAAC;AAIvC,MAAM,KAAK,GAAG,CAAC,EAA+B,EAAE,EAAE;QAAnC,EAAE,KAAK,OAAwB,EAAnB,KAAK,cAAjB,SAAmB,CAAF;IAC9B,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACtC,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACrD,MAAM,aAAa,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAE9C,OAAO,oBAAC,aAAa,oBAAK,SAAS,EAAM,kBAAkB,EAAM,aAAa,IAAE,KAAK,EAAE,KAAK,IAAI,CAAC;AACnG,CAAC,CAAC;AAEF,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AACjC,eAAe,KAAK,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { getBaseProps } from '../internal/base-component';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { getExternalProps } from '../internal/utils/external-props';\nimport { StepsProps } from './interfaces';\nimport InternalSteps from './internal';\n\nexport { StepsProps };\n\nconst Steps = ({ steps, ...props }: StepsProps) => {\n const baseProps = getBaseProps(props);\n const baseComponentProps = useBaseComponent('Steps');\n const externalProps = getExternalProps(props);\n\n return <InternalSteps {...baseProps} {...baseComponentProps} {...externalProps} steps={steps} />;\n};\n\napplyDisplayName(Steps, 'Steps');\nexport default Steps;\n"]}
@@ -0,0 +1,40 @@
1
+ /// <reference types="react" />
2
+ import { BaseComponentProps } from '../internal/base-component';
3
+ import { StatusIndicatorProps } from '../status-indicator/internal';
4
+ export interface StepsProps extends BaseComponentProps {
5
+ /**
6
+ * An array of individual steps
7
+ *
8
+ * Each step definition has the following properties:
9
+ * * `status` (string) - Status of the step corresponding to a status indicator.
10
+ * * `statusIconAriaLabel` - (string) - (Optional) Alternative text for the status icon.
11
+ * * `header` (ReactNode) - Summary corresponding to the step.
12
+ * * `details` (ReactNode) - (Optional) Additional information corresponding to the step.
13
+ */
14
+ steps: ReadonlyArray<StepsProps.Step>;
15
+ /**
16
+ * Provides an `aria-label` to the progress steps container.
17
+ * Don't use `ariaLabel` and `ariaLabelledby` at the same time.
18
+ */
19
+ ariaLabel?: string;
20
+ /**
21
+ * Sets the `aria-labelledby` property on the progress steps container.
22
+ * If there's a visible label element that you can reference, use this instead of `ariaLabel`.
23
+ * Don't use `ariaLabel` and `ariaLabelledby` at the same time.
24
+ */
25
+ ariaLabelledby?: string;
26
+ /**
27
+ * Sets the `aria-describedby` property on the progress steps container.
28
+ */
29
+ ariaDescribedby?: string;
30
+ }
31
+ export declare namespace StepsProps {
32
+ type Status = StatusIndicatorProps.Type;
33
+ interface Step {
34
+ status: Status;
35
+ statusIconAriaLabel?: string;
36
+ header: React.ReactNode;
37
+ details?: React.ReactNode;
38
+ }
39
+ }
40
+ //# sourceMappingURL=interfaces.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/steps/interfaces.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEpE,MAAM,WAAW,UAAW,SAAQ,kBAAkB;IACpD;;;;;;;;OAQG;IACH,KAAK,EAAE,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACtC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,yBAAiB,UAAU,CAAC;IAC1B,KAAY,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC;IAE/C,UAAiB,IAAI;QACnB,MAAM,EAAE,MAAM,CAAC;QACf,mBAAmB,CAAC,EAAE,MAAM,CAAC;QAC7B,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC;QACxB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;KAC3B;CACF"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/steps/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseComponentProps } from '../internal/base-component';\nimport { StatusIndicatorProps } from '../status-indicator/internal';\n\nexport interface StepsProps extends BaseComponentProps {\n /**\n * An array of individual steps\n *\n * Each step definition has the following properties:\n * * `status` (string) - Status of the step corresponding to a status indicator.\n * * `statusIconAriaLabel` - (string) - (Optional) Alternative text for the status icon.\n * * `header` (ReactNode) - Summary corresponding to the step.\n * * `details` (ReactNode) - (Optional) Additional information corresponding to the step.\n */\n steps: ReadonlyArray<StepsProps.Step>;\n /**\n * Provides an `aria-label` to the progress steps container.\n * Don't use `ariaLabel` and `ariaLabelledby` at the same time.\n */\n ariaLabel?: string;\n /**\n * Sets the `aria-labelledby` property on the progress steps container.\n * If there's a visible label element that you can reference, use this instead of `ariaLabel`.\n * Don't use `ariaLabel` and `ariaLabelledby` at the same time.\n */\n ariaLabelledby?: string;\n /**\n * Sets the `aria-describedby` property on the progress steps container.\n */\n ariaDescribedby?: string;\n}\n\nexport namespace StepsProps {\n export type Status = StatusIndicatorProps.Type;\n\n export interface Step {\n status: Status;\n statusIconAriaLabel?: string;\n header: React.ReactNode;\n details?: React.ReactNode;\n }\n}\n"]}
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { InternalBaseComponentProps } from '../internal/hooks/use-base-component';
3
+ import { SomeRequired } from '../internal/types';
4
+ import { StepsProps } from './interfaces';
5
+ type InternalStepsProps = SomeRequired<StepsProps, 'steps'> & InternalBaseComponentProps<HTMLDivElement>;
6
+ export declare const InternalSteps: ({ steps, ariaLabel, ariaLabelledby, ariaDescribedby, __internalRootRef, ...props }: InternalStepsProps) => JSX.Element;
7
+ export default InternalSteps;
8
+ //# sourceMappingURL=internal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/steps/internal.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI1C,KAAK,kBAAkB,GAAG,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,GAAG,0BAA0B,CAAC,cAAc,CAAC,CAAC;AAgBzG,eAAO,MAAM,aAAa,uFAOvB,kBAAkB,gBAqBpB,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { __rest } from "tslib";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ import React from 'react';
5
+ import clsx from 'clsx';
6
+ import StatusIndicator from '../status-indicator/internal';
7
+ import styles from './styles.css.js';
8
+ const InternalStep = ({ status, statusIconAriaLabel, header, details }) => {
9
+ return (React.createElement("li", { className: styles.container },
10
+ React.createElement("div", { className: styles.header },
11
+ React.createElement(StatusIndicator, { type: status, iconAriaLabel: statusIconAriaLabel }, header)),
12
+ React.createElement("hr", { className: styles.connector, role: "none" }),
13
+ details && React.createElement("div", { className: styles.details }, details)));
14
+ };
15
+ export const InternalSteps = (_a) => {
16
+ var { steps, ariaLabel, ariaLabelledby, ariaDescribedby, __internalRootRef } = _a, props = __rest(_a, ["steps", "ariaLabel", "ariaLabelledby", "ariaDescribedby", "__internalRootRef"]);
17
+ return (React.createElement("div", Object.assign({}, props, { className: clsx(styles.root, props.className), ref: __internalRootRef }),
18
+ React.createElement("ol", { className: styles.list, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby }, steps.map((step, index) => (React.createElement(InternalStep, { key: index, status: step.status, statusIconAriaLabel: step.statusIconAriaLabel, header: step.header, details: step.details }))))));
19
+ };
20
+ export default InternalSteps;
21
+ //# sourceMappingURL=internal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/steps/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAIxB,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAG3D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAIrC,MAAM,YAAY,GAAG,CAAC,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,EAAE,OAAO,EAAmB,EAAE,EAAE;IACzF,OAAO,CACL,4BAAI,SAAS,EAAE,MAAM,CAAC,SAAS;QAC7B,6BAAK,SAAS,EAAE,MAAM,CAAC,MAAM;YAC3B,oBAAC,eAAe,IAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,mBAAmB,IAC9D,MAAM,CACS,CACd;QACN,4BAAI,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,IAAI,EAAC,MAAM,GAAG;QAC9C,OAAO,IAAI,6BAAK,SAAS,EAAE,MAAM,CAAC,OAAO,IAAG,OAAO,CAAO,CACxD,CACN,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAOT,EAAE,EAAE;QAPK,EAC5B,KAAK,EACL,SAAS,EACT,cAAc,EACd,eAAe,EACf,iBAAiB,OAEE,EADhB,KAAK,cANoB,gFAO7B,CADS;IAER,OAAO,CACL,6CAAS,KAAK,IAAE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,iBAAiB;QACnF,4BACE,SAAS,EAAE,MAAM,CAAC,IAAI,gBACV,SAAS,qBACJ,cAAc,sBACb,eAAe,IAEhC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAC1B,oBAAC,YAAY,IACX,GAAG,EAAE,KAAK,EACV,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,EAC7C,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,OAAO,EAAE,IAAI,CAAC,OAAO,GACrB,CACH,CAAC,CACC,CACD,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { SomeRequired } from '../internal/types';\nimport StatusIndicator from '../status-indicator/internal';\nimport { StepsProps } from './interfaces';\n\nimport styles from './styles.css.js';\n\ntype InternalStepsProps = SomeRequired<StepsProps, 'steps'> & InternalBaseComponentProps<HTMLDivElement>;\n\nconst InternalStep = ({ status, statusIconAriaLabel, header, details }: StepsProps.Step) => {\n return (\n <li className={styles.container}>\n <div className={styles.header}>\n <StatusIndicator type={status} iconAriaLabel={statusIconAriaLabel}>\n {header}\n </StatusIndicator>\n </div>\n <hr className={styles.connector} role=\"none\" />\n {details && <div className={styles.details}>{details}</div>}\n </li>\n );\n};\n\nexport const InternalSteps = ({\n steps,\n ariaLabel,\n ariaLabelledby,\n ariaDescribedby,\n __internalRootRef,\n ...props\n}: InternalStepsProps) => {\n return (\n <div {...props} className={clsx(styles.root, props.className)} ref={__internalRootRef}>\n <ol\n className={styles.list}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n >\n {steps.map((step, index) => (\n <InternalStep\n key={index}\n status={step.status}\n statusIconAriaLabel={step.statusIconAriaLabel}\n header={step.header}\n details={step.details}\n />\n ))}\n </ol>\n </div>\n );\n};\n\nexport default InternalSteps;\n"]}
@@ -0,0 +1,11 @@
1
+
2
+ import './styles.scoped.css';
3
+ export default {
4
+ "root": "awsui_root_gxp9y_128ou_177",
5
+ "list": "awsui_list_gxp9y_128ou_211",
6
+ "container": "awsui_container_gxp9y_128ou_216",
7
+ "header": "awsui_header_gxp9y_128ou_221",
8
+ "details": "awsui_details_gxp9y_128ou_225",
9
+ "connector": "awsui_connector_gxp9y_128ou_231"
10
+ };
11
+
@@ -0,0 +1,247 @@
1
+ /*
2
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ /*
6
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
7
+ SPDX-License-Identifier: Apache-2.0
8
+ */
9
+ /*
10
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
11
+ SPDX-License-Identifier: Apache-2.0
12
+ */
13
+ /*
14
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
15
+ SPDX-License-Identifier: Apache-2.0
16
+ */
17
+ /*
18
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
19
+ SPDX-License-Identifier: Apache-2.0
20
+ */
21
+ /*
22
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
23
+ SPDX-License-Identifier: Apache-2.0
24
+ */
25
+ /*
26
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
27
+ SPDX-License-Identifier: Apache-2.0
28
+ */
29
+ /*
30
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
31
+ SPDX-License-Identifier: Apache-2.0
32
+ */
33
+ /*
34
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
35
+ SPDX-License-Identifier: Apache-2.0
36
+ */
37
+ /*
38
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
39
+ SPDX-License-Identifier: Apache-2.0
40
+ */
41
+ /*
42
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
43
+ SPDX-License-Identifier: Apache-2.0
44
+ */
45
+ /*
46
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
47
+ SPDX-License-Identifier: Apache-2.0
48
+ */
49
+ /*
50
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
51
+ SPDX-License-Identifier: Apache-2.0
52
+ */
53
+ /*
54
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
55
+ SPDX-License-Identifier: Apache-2.0
56
+ */
57
+ /*
58
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
59
+ SPDX-License-Identifier: Apache-2.0
60
+ */
61
+ /*
62
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
63
+ SPDX-License-Identifier: Apache-2.0
64
+ */
65
+ /*
66
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
67
+ SPDX-License-Identifier: Apache-2.0
68
+ */
69
+ /*
70
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
71
+ SPDX-License-Identifier: Apache-2.0
72
+ */
73
+ /*
74
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
75
+ SPDX-License-Identifier: Apache-2.0
76
+ */
77
+ /*
78
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
79
+ SPDX-License-Identifier: Apache-2.0
80
+ */
81
+ /*
82
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
83
+ SPDX-License-Identifier: Apache-2.0
84
+ */
85
+ /*
86
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
87
+ SPDX-License-Identifier: Apache-2.0
88
+ */
89
+ /*
90
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
91
+ SPDX-License-Identifier: Apache-2.0
92
+ */
93
+ /*
94
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
95
+ SPDX-License-Identifier: Apache-2.0
96
+ */
97
+ /*
98
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
99
+ SPDX-License-Identifier: Apache-2.0
100
+ */
101
+ /*
102
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
103
+ SPDX-License-Identifier: Apache-2.0
104
+ */
105
+ /*
106
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
107
+ SPDX-License-Identifier: Apache-2.0
108
+ */
109
+ /*
110
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
111
+ SPDX-License-Identifier: Apache-2.0
112
+ */
113
+ /*
114
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
115
+ SPDX-License-Identifier: Apache-2.0
116
+ */
117
+ /*
118
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
119
+ SPDX-License-Identifier: Apache-2.0
120
+ */
121
+ /*
122
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
123
+ SPDX-License-Identifier: Apache-2.0
124
+ */
125
+ /*
126
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
127
+ SPDX-License-Identifier: Apache-2.0
128
+ */
129
+ /*
130
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
131
+ SPDX-License-Identifier: Apache-2.0
132
+ */
133
+ /*
134
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
135
+ SPDX-License-Identifier: Apache-2.0
136
+ */
137
+ /*
138
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
139
+ SPDX-License-Identifier: Apache-2.0
140
+ */
141
+ /* stylelint-disable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
142
+ /* stylelint-enable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
143
+ /*
144
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
145
+ SPDX-License-Identifier: Apache-2.0
146
+ */
147
+ /*
148
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
149
+ SPDX-License-Identifier: Apache-2.0
150
+ */
151
+ /*
152
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
153
+ SPDX-License-Identifier: Apache-2.0
154
+ */
155
+ /*
156
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
157
+ SPDX-License-Identifier: Apache-2.0
158
+ */
159
+ /*
160
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
161
+ SPDX-License-Identifier: Apache-2.0
162
+ */
163
+ /*
164
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
165
+ SPDX-License-Identifier: Apache-2.0
166
+ */
167
+ /*
168
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
169
+ SPDX-License-Identifier: Apache-2.0
170
+ */
171
+ /*
172
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
173
+ SPDX-License-Identifier: Apache-2.0
174
+ */
175
+ /* Style used for links in slots/components that are text heavy, to help links stand out among
176
+ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
177
+ .awsui_root_gxp9y_128ou_177:not(#\9) {
178
+ border-collapse: separate;
179
+ border-spacing: 0;
180
+ box-sizing: border-box;
181
+ caption-side: top;
182
+ cursor: auto;
183
+ direction: inherit;
184
+ empty-cells: show;
185
+ font-family: serif;
186
+ font-size: medium;
187
+ font-style: normal;
188
+ font-variant: normal;
189
+ font-weight: 400;
190
+ font-stretch: normal;
191
+ line-height: normal;
192
+ -webkit-hyphens: none;
193
+ hyphens: none;
194
+ letter-spacing: normal;
195
+ list-style: disc outside none;
196
+ tab-size: 8;
197
+ text-align: start;
198
+ text-indent: 0;
199
+ text-shadow: none;
200
+ text-transform: none;
201
+ visibility: visible;
202
+ white-space: normal;
203
+ word-spacing: normal;
204
+ font-size: var(--font-size-body-m-x4okxb, 14px);
205
+ line-height: var(--line-height-body-m-30ar75, 20px);
206
+ color: var(--color-text-body-default-7v1jfn, #0f141a);
207
+ font-weight: 400;
208
+ font-family: var(--font-family-base-dnvic8, "Open Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
209
+ -webkit-font-smoothing: auto;
210
+ -moz-osx-font-smoothing: auto;
211
+ }
212
+ .awsui_root_gxp9y_128ou_177 > .awsui_list_gxp9y_128ou_211:not(#\9) {
213
+ list-style: none;
214
+ padding-inline-start: 0;
215
+ margin-block: 0;
216
+ }
217
+ .awsui_root_gxp9y_128ou_177 > .awsui_list_gxp9y_128ou_211 > .awsui_container_gxp9y_128ou_216:not(#\9) {
218
+ display: grid;
219
+ grid-template-columns: var(--space-static-l-0xsx8r, 20px) 1fr;
220
+ grid-template-rows: minmax(var(--space-static-l-0xsx8r, 20px), auto);
221
+ }
222
+ .awsui_root_gxp9y_128ou_177 > .awsui_list_gxp9y_128ou_211 > .awsui_container_gxp9y_128ou_216 > .awsui_header_gxp9y_128ou_221:not(#\9) {
223
+ grid-row: 1;
224
+ grid-column: 1/span 2;
225
+ }
226
+ .awsui_root_gxp9y_128ou_177 > .awsui_list_gxp9y_128ou_211 > .awsui_container_gxp9y_128ou_216 > .awsui_details_gxp9y_128ou_225:not(#\9) {
227
+ align-items: center;
228
+ grid-row: 2;
229
+ grid-column: 2;
230
+ margin-block-end: var(--space-static-xs-7sfb63, 8px);
231
+ }
232
+ .awsui_root_gxp9y_128ou_177 > .awsui_list_gxp9y_128ou_211 > .awsui_container_gxp9y_128ou_216 > .awsui_connector_gxp9y_128ou_231:not(#\9) {
233
+ grid-row: 2;
234
+ grid-column: 1;
235
+ background-color: var(--color-border-divider-default-cx07f2, #c6c6cd);
236
+ margin-block: 0;
237
+ border-block: 0;
238
+ border-inline: 0;
239
+ inline-size: var(--border-divider-list-width-27y3k5, 1px);
240
+ block-size: auto;
241
+ min-block-size: var(--space-static-xs-7sfb63, 8px);
242
+ position: relative;
243
+ inset-inline-end: var(--space-static-xxxs-3gu9os, 2px);
244
+ }
245
+ .awsui_root_gxp9y_128ou_177 > .awsui_list_gxp9y_128ou_211 > :not(#\9):last-of-type > .awsui_connector_gxp9y_128ou_231 {
246
+ display: none;
247
+ }
@@ -0,0 +1,12 @@
1
+
2
+ // es-module interop with Babel and Typescript
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ module.exports.default = {
5
+ "root": "awsui_root_gxp9y_128ou_177",
6
+ "list": "awsui_list_gxp9y_128ou_211",
7
+ "container": "awsui_container_gxp9y_128ou_216",
8
+ "header": "awsui_header_gxp9y_128ou_221",
9
+ "details": "awsui_details_gxp9y_128ou_225",
10
+ "connector": "awsui_connector_gxp9y_128ou_231"
11
+ };
12
+