@cloudscape-design/components 3.0.116 → 3.0.117

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 (110) hide show
  1. package/area-chart/model/use-chart-model.d.ts.map +1 -1
  2. package/area-chart/model/use-chart-model.js +2 -1
  3. package/area-chart/model/use-chart-model.js.map +1 -1
  4. package/area-chart/model/utils.d.ts +0 -6
  5. package/area-chart/model/utils.d.ts.map +1 -1
  6. package/area-chart/model/utils.js +0 -52
  7. package/area-chart/model/utils.js.map +1 -1
  8. package/button/index.d.ts.map +1 -1
  9. package/button/index.js +2 -2
  10. package/button/index.js.map +1 -1
  11. package/button/interfaces.d.ts +4 -0
  12. package/button/interfaces.d.ts.map +1 -1
  13. package/button/interfaces.js.map +1 -1
  14. package/button/internal.d.ts.map +1 -1
  15. package/button/internal.js +10 -5
  16. package/button/internal.js.map +1 -1
  17. package/button-dropdown/index.d.ts.map +1 -1
  18. package/button-dropdown/index.js +2 -2
  19. package/button-dropdown/index.js.map +1 -1
  20. package/button-dropdown/interfaces.d.ts +4 -0
  21. package/button-dropdown/interfaces.d.ts.map +1 -1
  22. package/button-dropdown/interfaces.js.map +1 -1
  23. package/button-dropdown/internal.d.ts.map +1 -1
  24. package/button-dropdown/internal.js +2 -2
  25. package/button-dropdown/internal.js.map +1 -1
  26. package/cards/index.d.ts.map +1 -1
  27. package/cards/index.js +3 -1
  28. package/cards/index.js.map +1 -1
  29. package/code-editor/index.d.ts.map +1 -1
  30. package/code-editor/index.js +3 -1
  31. package/code-editor/index.js.map +1 -1
  32. package/expandable-section/expandable-section-header.d.ts +12 -4
  33. package/expandable-section/expandable-section-header.d.ts.map +1 -1
  34. package/expandable-section/expandable-section-header.js +51 -11
  35. package/expandable-section/expandable-section-header.js.map +1 -1
  36. package/expandable-section/interfaces.d.ts +21 -3
  37. package/expandable-section/interfaces.d.ts.map +1 -1
  38. package/expandable-section/interfaces.js.map +1 -1
  39. package/expandable-section/internal.d.ts +1 -1
  40. package/expandable-section/internal.d.ts.map +1 -1
  41. package/expandable-section/internal.js +2 -2
  42. package/expandable-section/internal.js.map +1 -1
  43. package/expandable-section/styles.css.js +21 -20
  44. package/expandable-section/styles.scoped.css +56 -39
  45. package/expandable-section/styles.selectors.js +21 -20
  46. package/flashbar/flash.d.ts +3 -3
  47. package/flashbar/flash.d.ts.map +1 -1
  48. package/flashbar/flash.js +31 -15
  49. package/flashbar/flash.js.map +1 -1
  50. package/flashbar/index.d.ts.map +1 -1
  51. package/flashbar/index.js +61 -14
  52. package/flashbar/index.js.map +1 -1
  53. package/flashbar/interfaces.d.ts +16 -0
  54. package/flashbar/interfaces.d.ts.map +1 -1
  55. package/flashbar/interfaces.js.map +1 -1
  56. package/flashbar/styles.css.js +33 -29
  57. package/flashbar/styles.scoped.css +151 -112
  58. package/flashbar/styles.selectors.js +33 -29
  59. package/help-panel/index.d.ts.map +1 -1
  60. package/help-panel/index.js +3 -1
  61. package/help-panel/index.js.map +1 -1
  62. package/internal/components/chart-status-container/index.d.ts +2 -2
  63. package/internal/components/chart-status-container/index.d.ts.map +1 -1
  64. package/internal/components/chart-status-container/index.js +2 -3
  65. package/internal/components/chart-status-container/index.js.map +1 -1
  66. package/internal/components/live-region/index.d.ts +2 -1
  67. package/internal/components/live-region/index.d.ts.map +1 -1
  68. package/internal/components/live-region/index.js +6 -5
  69. package/internal/components/live-region/index.js.map +1 -1
  70. package/internal/environment.js +1 -1
  71. package/internal/manifest.json +1 -1
  72. package/internal/utils/throttle.d.ts +10 -0
  73. package/internal/utils/throttle.d.ts.map +1 -0
  74. package/internal/utils/throttle.js +57 -0
  75. package/internal/utils/throttle.js.map +1 -0
  76. package/package.json +1 -1
  77. package/s3-resource-selector/s3-in-context/index.d.ts.map +1 -1
  78. package/s3-resource-selector/s3-in-context/index.js +3 -1
  79. package/s3-resource-selector/s3-in-context/index.js.map +1 -1
  80. package/side-navigation/internal.js +2 -2
  81. package/side-navigation/internal.js.map +1 -1
  82. package/table/internal.d.ts.map +1 -1
  83. package/table/internal.js +3 -1
  84. package/table/internal.js.map +1 -1
  85. package/tag-editor/index.d.ts.map +1 -1
  86. package/tag-editor/index.js +3 -1
  87. package/tag-editor/index.js.map +1 -1
  88. package/test-utils/dom/flashbar/flash.js +1 -1
  89. package/test-utils/dom/flashbar/flash.js.map +1 -1
  90. package/test-utils/dom/flashbar/index.js +1 -1
  91. package/test-utils/dom/flashbar/index.js.map +1 -1
  92. package/test-utils/selectors/flashbar/flash.js +1 -1
  93. package/test-utils/selectors/flashbar/flash.js.map +1 -1
  94. package/test-utils/selectors/flashbar/index.js +1 -1
  95. package/test-utils/selectors/flashbar/index.js.map +1 -1
  96. package/test-utils/tsconfig.tsbuildinfo +1 -1
  97. package/tutorial-panel/components/tutorial-detail-view/task.js +1 -1
  98. package/tutorial-panel/components/tutorial-detail-view/task.js.map +1 -1
  99. package/tutorial-panel/components/tutorial-list/index.d.ts.map +1 -1
  100. package/tutorial-panel/components/tutorial-list/index.js +3 -1
  101. package/tutorial-panel/components/tutorial-list/index.js.map +1 -1
  102. package/wizard/index.d.ts.map +1 -1
  103. package/wizard/index.js +2 -20
  104. package/wizard/index.js.map +1 -1
  105. package/wizard/styles.css.js +32 -31
  106. package/wizard/styles.scoped.css +70 -58
  107. package/wizard/styles.selectors.js +32 -31
  108. package/wizard/wizard-form.d.ts.map +1 -1
  109. package/wizard/wizard-form.js +15 -3
  110. package/wizard/wizard-form.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/expandable-section/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport namespace ExpandableSectionProps {\n export type Variant = 'default' | 'footer' | 'container' | 'navigation';\n export interface ChangeDetail {\n expanded: boolean;\n }\n}\n\nexport interface ExpandableSectionProps extends BaseComponentProps {\n /**\n * Determines whether the component initially displays in expanded state (that is, with content visible). The component operates in an uncontrolled\n * manner even if you provide a value for this property.\n */\n defaultExpanded?: boolean;\n\n /**\n * Determines whether the component is in the expanded state (that is, with content visible). The component operates in a controlled\n * manner if you provide a value for this property.\n */\n expanded?: boolean;\n\n /**\n * The possible variants of an expandable section are as follows:\n * * `default` - Use this variant in any context.\n * * `footer` - Use this variant in container footers.\n * * `container` - Use this variant in a detail page alongside other containers.\n * * `navigation` - Use this variant in the navigation panel with anchors and custom styled content.\n * It doesn't have any default styles.\n * */\n variant?: ExpandableSectionProps.Variant;\n\n /**\n * Determines whether the content section's default padding is removed. This default padding is only present for the `container` variant.\n */\n disableContentPaddings?: boolean;\n\n /**\n * Primary content displayed in the expandable section element.\n */\n children?: React.ReactNode;\n\n /**\n * Heading displayed above the content text.\n *\n * When using the container variant, use the Header component. Otherwise, use plain text.\n */\n header?: React.ReactNode;\n\n /**\n * Adds `aria-label` to the header element.\n * Use to assign unique labels when there are multiple expandable sections with the same header text on one page.\n */\n headerAriaLabel?: string;\n\n /**\n * Called when the state changes (that is, when the user expands or collapses the component).\n * The event `detail` contains the current value of the `expanded` property.\n */\n onChange?: NonCancelableEventHandler<ExpandableSectionProps.ChangeDetail>;\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/expandable-section/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport namespace ExpandableSectionProps {\n export type Variant = 'default' | 'footer' | 'container' | 'navigation';\n export interface ChangeDetail {\n expanded: boolean;\n }\n export type HeadingTag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5';\n}\n\nexport interface ExpandableSectionProps extends BaseComponentProps {\n /**\n * Determines whether the component initially displays in expanded state (that is, with content visible). The component operates in an uncontrolled\n * manner even if you provide a value for this property.\n */\n defaultExpanded?: boolean;\n\n /**\n * Determines whether the component is in the expanded state (that is, with content visible). The component operates in a controlled\n * manner if you provide a value for this property.\n */\n expanded?: boolean;\n\n /**\n * The possible variants of an expandable section are as follows:\n * * `default` - Use this variant in any context.\n * * `footer` - Use this variant in container footers.\n * * `container` - Use this variant in a detail page alongside other containers.\n * * `navigation` - Use this variant in the navigation panel with anchors and custom styled content.\n * It doesn't have any default styles.\n * */\n variant?: ExpandableSectionProps.Variant;\n\n /**\n * Determines whether the content section's default padding is removed. This default padding is only present for the `container` variant.\n */\n disableContentPaddings?: boolean;\n\n /**\n * Primary content displayed in the expandable section element.\n */\n children?: React.ReactNode;\n\n /**\n * **Deprecated**, use headerText instead.\n * @deprecated\n */\n header?: React.ReactNode;\n\n /**\n * Heading displayed above the content text. When using the container variant, use it with additional header props. Otherwise, use plain text.\n */\n headerText?: React.ReactNode;\n\n /**\n * Supplementary text below the heading. Use with container variant.\n */\n headerDescription?: string;\n\n /**\n * Specifies secondary text that's displayed to the right of the heading title. Use with container variant.\n * Behaves similar to the Header component counter.\n */\n headerCounter?: string;\n\n /**\n * Overrides the default [HTML heading tag](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements)\n * h2. Use with container variant.\n */\n headingTagOverride?: ExpandableSectionProps.HeadingTag;\n\n /**\n * Adds `aria-label` to the header element.\n * Use to assign unique labels when there are multiple expandable sections with the same header text on one page.\n */\n headerAriaLabel?: string;\n\n /**\n * Called when the state changes (that is, when the user expands or collapses the component).\n * The event `detail` contains the current value of the `expanded` property.\n */\n onChange?: NonCancelableEventHandler<ExpandableSectionProps.ChangeDetail>;\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import { ExpandableSectionProps } from './interfaces';
2
2
  import { InternalBaseComponentProps } from '../internal/hooks/use-base-component';
3
3
  declare type InternalExpandableSectionProps = ExpandableSectionProps & InternalBaseComponentProps;
4
- export default function InternalExpandableSection({ expanded: controlledExpanded, defaultExpanded, onChange, variant, children, header, disableContentPaddings, headerAriaLabel, __internalRootRef, ...props }: InternalExpandableSectionProps): JSX.Element;
4
+ export default function InternalExpandableSection({ expanded: controlledExpanded, defaultExpanded, onChange, variant, children, header, headerText, headerCounter, headerDescription, headingTagOverride, disableContentPaddings, headerAriaLabel, __internalRootRef, ...props }: InternalExpandableSectionProps): JSX.Element;
5
5
  export {};
6
6
  //# sourceMappingURL=internal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/expandable-section/internal.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAKtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,aAAK,8BAA8B,GAAG,sBAAsB,GAAG,0BAA0B,CAAC;AAE1F,MAAM,CAAC,OAAO,UAAU,yBAAyB,CAAC,EAChD,QAAQ,EAAE,kBAAkB,EAC5B,eAAe,EACf,QAAQ,EACR,OAAmB,EACnB,QAAQ,EACR,MAAM,EACN,sBAAsB,EACtB,eAAe,EACf,iBAAiB,EACjB,GAAG,KAAK,EACT,EAAE,8BAA8B,eAqFhC"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/expandable-section/internal.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAKtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,aAAK,8BAA8B,GAAG,sBAAsB,GAAG,0BAA0B,CAAC;AAE1F,MAAM,CAAC,OAAO,UAAU,yBAAyB,CAAC,EAChD,QAAQ,EAAE,kBAAkB,EAC5B,eAAe,EACf,QAAQ,EACR,OAAmB,EACnB,QAAQ,EACR,MAAM,EACN,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,eAAe,EACf,iBAAiB,EACjB,GAAG,KAAK,EACT,EAAE,8BAA8B,eAwFhC"}
@@ -13,7 +13,7 @@ import styles from './styles.css.js';
13
13
  import { ExpandableSectionContainer } from './expandable-section-container';
14
14
  import { ExpandableSectionHeader } from './expandable-section-header';
15
15
  export default function InternalExpandableSection(_a) {
16
- var controlledExpanded = _a.expanded, defaultExpanded = _a.defaultExpanded, onChange = _a.onChange, _b = _a.variant, variant = _b === void 0 ? 'default' : _b, children = _a.children, header = _a.header, disableContentPaddings = _a.disableContentPaddings, headerAriaLabel = _a.headerAriaLabel, __internalRootRef = _a.__internalRootRef, props = __rest(_a, ["expanded", "defaultExpanded", "onChange", "variant", "children", "header", "disableContentPaddings", "headerAriaLabel", "__internalRootRef"]);
16
+ var controlledExpanded = _a.expanded, defaultExpanded = _a.defaultExpanded, onChange = _a.onChange, _b = _a.variant, variant = _b === void 0 ? 'default' : _b, children = _a.children, header = _a.header, headerText = _a.headerText, headerCounter = _a.headerCounter, headerDescription = _a.headerDescription, headingTagOverride = _a.headingTagOverride, disableContentPaddings = _a.disableContentPaddings, headerAriaLabel = _a.headerAriaLabel, __internalRootRef = _a.__internalRootRef, props = __rest(_a, ["expanded", "defaultExpanded", "onChange", "variant", "children", "header", "headerText", "headerCounter", "headerDescription", "headingTagOverride", "disableContentPaddings", "headerAriaLabel", "__internalRootRef"]);
17
17
  var ref = useRef(null);
18
18
  var controlId = useUniqueId();
19
19
  var triggerControlId = "".concat(controlId, "-trigger");
@@ -50,7 +50,7 @@ export default function InternalExpandableSection(_a) {
50
50
  onKeyDown: onKeyDown,
51
51
  onClick: onClick
52
52
  };
53
- return (React.createElement(ExpandableSectionContainer, __assign({}, baseProps, { expanded: expanded, className: clsx(baseProps.className, styles.root), variant: variant, disableContentPaddings: disableContentPaddings, header: React.createElement(ExpandableSectionHeader, __assign({ id: triggerControlId, className: clsx(styles.header, styles["header-".concat(variant)]), variant: variant, expanded: !!expanded }, triggerProps), header), __internalRootRef: __internalRootRef }),
53
+ return (React.createElement(ExpandableSectionContainer, __assign({}, baseProps, { expanded: expanded, className: clsx(baseProps.className, styles.root), variant: variant, disableContentPaddings: disableContentPaddings, header: React.createElement(ExpandableSectionHeader, __assign({ id: triggerControlId, className: clsx(styles.header, styles["header-".concat(variant)]), variant: variant, expanded: !!expanded, header: header, headerText: headerText, headerDescription: headerDescription, headerCounter: headerCounter, headingTagOverride: headingTagOverride }, triggerProps)), __internalRootRef: __internalRootRef }),
54
54
  React.createElement(CSSTransition, { "in": expanded, timeout: 30, classNames: { enter: styles['content-enter'] }, nodeRef: ref },
55
55
  React.createElement("div", { id: controlId, ref: ref, className: clsx(styles.content, styles["content-".concat(variant)], expanded && styles['content-expanded']), role: "group", "aria-label": triggerProps.ariaLabel, "aria-labelledby": triggerProps.ariaLabelledBy }, children))));
56
56
  }
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/expandable-section/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAiB,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAI5D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAKtE,MAAM,CAAC,OAAO,U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EAAE,GAAG,EACR,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,kBAAW,OAAO,CAAE,CAAC,EAAE,QAAQ,IAAI,MAAM,CAAC,kBAAkB,CAAC,CAAC,EACrG,IAAI,EAAC,OAAO,gBACA,YAAY,CAAC,SAAS,qBACjB,YAAY,CAAC,cAAc,IAE3C,QAAQ,CACL,CACQ,CACW,CAC9B,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { KeyboardEvent, useCallback, useRef } from 'react';\nimport { CSSTransition } from 'react-transition-group';\nimport clsx from 'clsx';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { useControllable } from '../internal/hooks/use-controllable';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { KeyCode } from '../internal/keycode';\nimport { fireNonCancelableEvent } from '../internal/events';\n\nimport { ExpandableSectionProps } from './interfaces';\n\nimport styles from './styles.css.js';\nimport { ExpandableSectionContainer } from './expandable-section-container';\nimport { ExpandableSectionHeader } from './expandable-section-header';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\n\ntype InternalExpandableSectionProps = ExpandableSectionProps & InternalBaseComponentProps;\n\nexport default function InternalExpandableSection({\n expanded: controlledExpanded,\n defaultExpanded,\n onChange,\n variant = 'default',\n children,\n header,\n disableContentPaddings,\n headerAriaLabel,\n __internalRootRef,\n ...props\n}: InternalExpandableSectionProps) {\n const ref = useRef<HTMLDivElement>(null);\n const controlId = useUniqueId();\n const triggerControlId = `${controlId}-trigger`;\n\n const baseProps = getBaseProps(props);\n const [expanded, setExpanded] = useControllable(controlledExpanded, onChange, defaultExpanded, {\n componentName: 'ExpandableSection',\n controlledProp: 'expanded',\n changeHandler: 'onChange',\n });\n\n const onExpandChange = useCallback(\n (expanded: boolean) => {\n setExpanded(expanded);\n fireNonCancelableEvent(onChange, { expanded });\n },\n [onChange, setExpanded]\n );\n\n const onClick = useCallback(() => {\n onExpandChange(!expanded);\n }, [onExpandChange, expanded]);\n\n const onKeyUp = useCallback(\n (event: KeyboardEvent<Element>) => {\n const interactionKeys = [KeyCode.enter, KeyCode.space];\n\n if (interactionKeys.indexOf(event.keyCode) !== -1) {\n onExpandChange(!expanded);\n }\n },\n [onExpandChange, expanded]\n );\n\n const onKeyDown = useCallback((event: KeyboardEvent<Element>) => {\n if (event.keyCode === KeyCode.space) {\n // Prevent the page from scrolling when toggling the component with the space bar.\n event.preventDefault();\n }\n }, []);\n\n const triggerProps = {\n ariaControls: controlId,\n ariaLabel: headerAriaLabel,\n ariaLabelledBy: headerAriaLabel ? undefined : triggerControlId,\n onKeyUp,\n onKeyDown,\n onClick,\n };\n\n return (\n <ExpandableSectionContainer\n {...baseProps}\n expanded={expanded}\n className={clsx(baseProps.className, styles.root)}\n variant={variant}\n disableContentPaddings={disableContentPaddings}\n header={\n <ExpandableSectionHeader\n id={triggerControlId}\n className={clsx(styles.header, styles[`header-${variant}`])}\n variant={variant}\n expanded={!!expanded}\n {...triggerProps}\n >\n {header}\n </ExpandableSectionHeader>\n }\n __internalRootRef={__internalRootRef}\n >\n <CSSTransition in={expanded} timeout={30} classNames={{ enter: styles['content-enter'] }} nodeRef={ref}>\n <div\n id={controlId}\n ref={ref}\n className={clsx(styles.content, styles[`content-${variant}`], expanded && styles['content-expanded'])}\n role=\"group\"\n aria-label={triggerProps.ariaLabel}\n aria-labelledby={triggerProps.ariaLabelledBy}\n >\n {children}\n </div>\n </CSSTransition>\n </ExpandableSectionContainer>\n );\n}\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/expandable-section/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAiB,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,IAA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AAO,EAAE,OAAO,EAChB,sBAAsB,EAAE,sBAAsB,EAC9C,MAAM,EACJ,oBAAC,uBAAuB,aACtB,EAAE,EAAE,gBAAgB,EACpB,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,iBAAU,OAAO,CAAE,CAAC,CAAC,EAC3D,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,CAAC,CAAC,QAAQ,EACpB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,iBAAiB,EAAE,iBAAiB,EACpC,aAAa,EAAE,aAAa,EAC5B,kBAAkB,EAAE,kBAAkB,IAClC,YAAY,EAChB,EAEJ,iBAAiB,EAAE,iBAAiB;QAEpC,oBAAC,aAAa,IAAC,IAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,eAAe,CAAC,EAAE,EAAE,OAAO,EAAE,GAAG;YACpG,6BACE,EAAE,EAAE,SAAS,EACb,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,kBAAW,OAAO,CAAE,CAAC,EAAE,QAAQ,IAAI,MAAM,CAAC,kBAAkB,CAAC,CAAC,EACrG,IAAI,EAAC,OAAO,gBACA,YAAY,CAAC,SAAS,qBACjB,YAAY,CAAC,cAAc,IAE3C,QAAQ,CACL,CACQ,CACW,CAC9B,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { KeyboardEvent, useCallback, useRef } from 'react';\nimport { CSSTransition } from 'react-transition-group';\nimport clsx from 'clsx';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { useControllable } from '../internal/hooks/use-controllable';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { KeyCode } from '../internal/keycode';\nimport { fireNonCancelableEvent } from '../internal/events';\n\nimport { ExpandableSectionProps } from './interfaces';\n\nimport styles from './styles.css.js';\nimport { ExpandableSectionContainer } from './expandable-section-container';\nimport { ExpandableSectionHeader } from './expandable-section-header';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\n\ntype InternalExpandableSectionProps = ExpandableSectionProps & InternalBaseComponentProps;\n\nexport default function InternalExpandableSection({\n expanded: controlledExpanded,\n defaultExpanded,\n onChange,\n variant = 'default',\n children,\n header,\n headerText,\n headerCounter,\n headerDescription,\n headingTagOverride,\n disableContentPaddings,\n headerAriaLabel,\n __internalRootRef,\n ...props\n}: InternalExpandableSectionProps) {\n const ref = useRef<HTMLDivElement>(null);\n const controlId = useUniqueId();\n const triggerControlId = `${controlId}-trigger`;\n\n const baseProps = getBaseProps(props);\n const [expanded, setExpanded] = useControllable(controlledExpanded, onChange, defaultExpanded, {\n componentName: 'ExpandableSection',\n controlledProp: 'expanded',\n changeHandler: 'onChange',\n });\n\n const onExpandChange = useCallback(\n (expanded: boolean) => {\n setExpanded(expanded);\n fireNonCancelableEvent(onChange, { expanded });\n },\n [onChange, setExpanded]\n );\n\n const onClick = useCallback(() => {\n onExpandChange(!expanded);\n }, [onExpandChange, expanded]);\n\n const onKeyUp = useCallback(\n (event: KeyboardEvent<Element>) => {\n const interactionKeys = [KeyCode.enter, KeyCode.space];\n\n if (interactionKeys.indexOf(event.keyCode) !== -1) {\n onExpandChange(!expanded);\n }\n },\n [onExpandChange, expanded]\n );\n\n const onKeyDown = useCallback((event: KeyboardEvent<Element>) => {\n if (event.keyCode === KeyCode.space) {\n // Prevent the page from scrolling when toggling the component with the space bar.\n event.preventDefault();\n }\n }, []);\n\n const triggerProps = {\n ariaControls: controlId,\n ariaLabel: headerAriaLabel,\n ariaLabelledBy: headerAriaLabel ? undefined : triggerControlId,\n onKeyUp,\n onKeyDown,\n onClick,\n };\n\n return (\n <ExpandableSectionContainer\n {...baseProps}\n expanded={expanded}\n className={clsx(baseProps.className, styles.root)}\n variant={variant}\n disableContentPaddings={disableContentPaddings}\n header={\n <ExpandableSectionHeader\n id={triggerControlId}\n className={clsx(styles.header, styles[`header-${variant}`])}\n variant={variant}\n expanded={!!expanded}\n header={header}\n headerText={headerText}\n headerDescription={headerDescription}\n headerCounter={headerCounter}\n headingTagOverride={headingTagOverride}\n {...triggerProps}\n />\n }\n __internalRootRef={__internalRootRef}\n >\n <CSSTransition in={expanded} timeout={30} classNames={{ enter: styles['content-enter'] }} nodeRef={ref}>\n <div\n id={controlId}\n ref={ref}\n className={clsx(styles.content, styles[`content-${variant}`], expanded && styles['content-expanded'])}\n role=\"group\"\n aria-label={triggerProps.ariaLabel}\n aria-labelledby={triggerProps.ariaLabelledBy}\n >\n {children}\n </div>\n </CSSTransition>\n </ExpandableSectionContainer>\n );\n}\n"]}
@@ -1,25 +1,26 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "content-enter": "awsui_content-enter_gwq0h_1k4hj_97",
5
- "awsui-motion-fade-in": "awsui_awsui-motion-fade-in_gwq0h_1k4hj_1",
6
- "trigger-expanded": "awsui_trigger-expanded_gwq0h_1k4hj_119",
7
- "icon": "awsui_icon_gwq0h_1k4hj_133",
8
- "root": "awsui_root_gwq0h_1k4hj_151",
9
- "expanded": "awsui_expanded_gwq0h_1k4hj_169",
10
- "icon-container": "awsui_icon-container_gwq0h_1k4hj_173",
11
- "trigger": "awsui_trigger_gwq0h_1k4hj_119",
12
- "trigger-default": "awsui_trigger-default_gwq0h_1k4hj_188",
13
- "trigger-footer": "awsui_trigger-footer_gwq0h_1k4hj_191",
14
- "trigger-navigation": "awsui_trigger-navigation_gwq0h_1k4hj_197",
15
- "trigger-container": "awsui_trigger-container_gwq0h_1k4hj_209",
16
- "header": "awsui_header_gwq0h_1k4hj_219",
17
- "header-container": "awsui_header-container_gwq0h_1k4hj_222",
18
- "header-navigation": "awsui_header-navigation_gwq0h_1k4hj_229",
19
- "content": "awsui_content_gwq0h_1k4hj_97",
20
- "content-default": "awsui_content-default_gwq0h_1k4hj_265",
21
- "content-footer": "awsui_content-footer_gwq0h_1k4hj_268",
22
- "content-expanded": "awsui_content-expanded_gwq0h_1k4hj_271",
23
- "focusable": "awsui_focusable_gwq0h_1k4hj_275"
4
+ "content-enter": "awsui_content-enter_gwq0h_mztld_97",
5
+ "awsui-motion-fade-in": "awsui_awsui-motion-fade-in_gwq0h_mztld_1",
6
+ "trigger-expanded": "awsui_trigger-expanded_gwq0h_mztld_119",
7
+ "icon": "awsui_icon_gwq0h_mztld_133",
8
+ "root": "awsui_root_gwq0h_mztld_151",
9
+ "expanded": "awsui_expanded_gwq0h_mztld_169",
10
+ "icon-container": "awsui_icon-container_gwq0h_mztld_173",
11
+ "trigger": "awsui_trigger_gwq0h_mztld_119",
12
+ "trigger-default": "awsui_trigger-default_gwq0h_mztld_188",
13
+ "trigger-footer": "awsui_trigger-footer_gwq0h_mztld_191",
14
+ "trigger-navigation": "awsui_trigger-navigation_gwq0h_mztld_197",
15
+ "trigger-container": "awsui_trigger-container_gwq0h_mztld_209",
16
+ "header": "awsui_header_gwq0h_mztld_219",
17
+ "header-container": "awsui_header-container_gwq0h_mztld_222",
18
+ "header-container-button": "awsui_header-container-button_gwq0h_mztld_238",
19
+ "header-navigation": "awsui_header-navigation_gwq0h_mztld_246",
20
+ "content": "awsui_content_gwq0h_mztld_97",
21
+ "content-default": "awsui_content-default_gwq0h_mztld_282",
22
+ "content-footer": "awsui_content-footer_gwq0h_mztld_285",
23
+ "content-expanded": "awsui_content-expanded_gwq0h_mztld_288",
24
+ "focusable": "awsui_focusable_gwq0h_mztld_292"
24
25
  };
25
26
 
@@ -94,10 +94,10 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
94
94
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
95
95
  SPDX-License-Identifier: Apache-2.0
96
96
  */
97
- .awsui_content-enter_gwq0h_1k4hj_97:not(#\9) {
98
- animation: awsui_awsui-motion-fade-in_gwq0h_1k4hj_1 var(--motion-duration-show-paced-7wspqf, 180ms) var(--motion-easing-show-paced-wj4ybn, ease-out);
97
+ .awsui_content-enter_gwq0h_mztld_97:not(#\9) {
98
+ animation: awsui_awsui-motion-fade-in_gwq0h_mztld_1 var(--motion-duration-show-paced-7wspqf, 180ms) var(--motion-easing-show-paced-wj4ybn, ease-out);
99
99
  }
100
- @keyframes awsui_awsui-motion-fade-in_gwq0h_1k4hj_1 {
100
+ @keyframes awsui_awsui-motion-fade-in_gwq0h_mztld_1 {
101
101
  from {
102
102
  opacity: 0.2;
103
103
  }
@@ -106,40 +106,40 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
106
106
  }
107
107
  }
108
108
  @media (prefers-reduced-motion: reduce) {
109
- .awsui_content-enter_gwq0h_1k4hj_97:not(#\9) {
109
+ .awsui_content-enter_gwq0h_mztld_97:not(#\9) {
110
110
  animation: none;
111
111
  transition: none;
112
112
  }
113
113
  }
114
- .awsui-motion-disabled .awsui_content-enter_gwq0h_1k4hj_97:not(#\9), .awsui-mode-entering .awsui_content-enter_gwq0h_1k4hj_97:not(#\9) {
114
+ .awsui-motion-disabled .awsui_content-enter_gwq0h_mztld_97:not(#\9), .awsui-mode-entering .awsui_content-enter_gwq0h_mztld_97:not(#\9) {
115
115
  animation: none;
116
116
  transition: none;
117
117
  }
118
118
 
119
- .awsui_trigger-expanded_gwq0h_1k4hj_119:not(#\9) {
119
+ .awsui_trigger-expanded_gwq0h_mztld_119:not(#\9) {
120
120
  transition: border-bottom-color var(--motion-duration-show-paced-7wspqf, 180ms) var(--motion-easing-show-paced-wj4ybn, ease-out);
121
121
  }
122
122
  @media (prefers-reduced-motion: reduce) {
123
- .awsui_trigger-expanded_gwq0h_1k4hj_119:not(#\9) {
123
+ .awsui_trigger-expanded_gwq0h_mztld_119:not(#\9) {
124
124
  animation: none;
125
125
  transition: none;
126
126
  }
127
127
  }
128
- .awsui-motion-disabled .awsui_trigger-expanded_gwq0h_1k4hj_119:not(#\9), .awsui-mode-entering .awsui_trigger-expanded_gwq0h_1k4hj_119:not(#\9) {
128
+ .awsui-motion-disabled .awsui_trigger-expanded_gwq0h_mztld_119:not(#\9), .awsui-mode-entering .awsui_trigger-expanded_gwq0h_mztld_119:not(#\9) {
129
129
  animation: none;
130
130
  transition: none;
131
131
  }
132
132
 
133
- .awsui_icon_gwq0h_1k4hj_133:not(#\9) {
133
+ .awsui_icon_gwq0h_mztld_133:not(#\9) {
134
134
  transition: transform var(--motion-duration-rotate-90-ux18sr, 135ms) var(--motion-easing-rotate-90-eoew89, cubic-bezier(0.165, 0.84, 0.44, 1));
135
135
  }
136
136
  @media (prefers-reduced-motion: reduce) {
137
- .awsui_icon_gwq0h_1k4hj_133:not(#\9) {
137
+ .awsui_icon_gwq0h_mztld_133:not(#\9) {
138
138
  animation: none;
139
139
  transition: none;
140
140
  }
141
141
  }
142
- .awsui-motion-disabled .awsui_icon_gwq0h_1k4hj_133:not(#\9), .awsui-mode-entering .awsui_icon_gwq0h_1k4hj_133:not(#\9) {
142
+ .awsui-motion-disabled .awsui_icon_gwq0h_mztld_133:not(#\9), .awsui-mode-entering .awsui_icon_gwq0h_mztld_133:not(#\9) {
143
143
  animation: none;
144
144
  transition: none;
145
145
  }
@@ -148,7 +148,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
148
148
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
149
149
  SPDX-License-Identifier: Apache-2.0
150
150
  */
151
- .awsui_root_gwq0h_1k4hj_151:not(#\9) {
151
+ .awsui_root_gwq0h_mztld_151:not(#\9) {
152
152
  /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
153
153
  border-collapse: separate;
154
154
  border-spacing: 0;
@@ -189,20 +189,20 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
189
189
  display: block;
190
190
  }
191
191
 
192
- .awsui_icon_gwq0h_1k4hj_133:not(#\9) {
192
+ .awsui_icon_gwq0h_mztld_133:not(#\9) {
193
193
  transform: rotate(-90deg);
194
194
  }
195
- .awsui_icon_gwq0h_1k4hj_133.awsui_expanded_gwq0h_1k4hj_169:not(#\9) {
195
+ .awsui_icon_gwq0h_mztld_133.awsui_expanded_gwq0h_mztld_169:not(#\9) {
196
196
  transform: rotate(0deg);
197
197
  }
198
198
 
199
- .awsui_icon-container_gwq0h_1k4hj_173:not(#\9) {
199
+ .awsui_icon-container_gwq0h_mztld_173:not(#\9) {
200
200
  position: relative;
201
201
  margin-left: calc((var(--font-body-m-line-height-i7xxvv, 22px) - var(--size-icon-normal-j1z5fn, 16px)) / -2);
202
202
  margin-right: calc(var(--space-xxs-ynfts5, 4px) + var(--border-divider-list-width-hacikr, 1px));
203
203
  }
204
204
 
205
- .awsui_trigger_gwq0h_1k4hj_119:not(#\9) {
205
+ .awsui_trigger_gwq0h_mztld_119:not(#\9) {
206
206
  cursor: pointer;
207
207
  box-sizing: border-box;
208
208
  display: flex;
@@ -211,48 +211,65 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
211
211
  line-height: var(--font-body-m-line-height-i7xxvv, 22px);
212
212
  text-align: left;
213
213
  }
214
- .awsui_trigger-default_gwq0h_1k4hj_188:not(#\9) {
214
+ .awsui_trigger-default_gwq0h_mztld_188:not(#\9) {
215
215
  padding: var(--space-scaled-xxs-95dhkm, 4px) var(--space-xxs-ynfts5, 4px);
216
216
  }
217
- .awsui_trigger-footer_gwq0h_1k4hj_191:not(#\9) {
217
+ .awsui_trigger-footer_gwq0h_mztld_191:not(#\9) {
218
218
  padding: var(--space-scaled-xxs-95dhkm, 4px) 0;
219
219
  }
220
- .awsui_trigger-default_gwq0h_1k4hj_188:not(#\9), .awsui_trigger-footer_gwq0h_1k4hj_191:not(#\9) {
220
+ .awsui_trigger-default_gwq0h_mztld_188:not(#\9), .awsui_trigger-footer_gwq0h_mztld_191:not(#\9) {
221
221
  border: var(--border-divider-section-width-4wm2it, 2px) solid transparent;
222
222
  }
223
- .awsui_trigger-navigation_gwq0h_1k4hj_197:not(#\9) {
223
+ .awsui_trigger-navigation_gwq0h_mztld_197:not(#\9) {
224
224
  border-left: var(--border-divider-section-width-4wm2it, 2px) solid transparent;
225
225
  }
226
- .awsui_trigger-default_gwq0h_1k4hj_188:not(#\9), .awsui_trigger-navigation_gwq0h_1k4hj_197:not(#\9), .awsui_trigger-footer_gwq0h_1k4hj_191:not(#\9) {
226
+ .awsui_trigger-default_gwq0h_mztld_188:not(#\9), .awsui_trigger-navigation_gwq0h_mztld_197:not(#\9), .awsui_trigger-footer_gwq0h_mztld_191:not(#\9) {
227
227
  color: var(--color-text-expandable-section-default-k03p1p, #000716);
228
228
  font-weight: var(--font-heading-s-weight-k8ys41, 800);
229
229
  font-size: var(--font-expandable-heading-size-m2wptt, 16px);
230
230
  letter-spacing: var(--font-heading-s-letter-spacing-4d69jc, -0.005em);
231
231
  }
232
- .awsui_trigger-default_gwq0h_1k4hj_188:not(#\9):hover, .awsui_trigger-navigation_gwq0h_1k4hj_197:not(#\9):hover, .awsui_trigger-footer_gwq0h_1k4hj_191:not(#\9):hover {
232
+ .awsui_trigger-default_gwq0h_mztld_188:not(#\9):hover, .awsui_trigger-navigation_gwq0h_mztld_197:not(#\9):hover, .awsui_trigger-footer_gwq0h_mztld_191:not(#\9):hover {
233
233
  color: var(--color-text-expandable-section-hover-73g3du, #0972d3);
234
234
  }
235
- .awsui_trigger-container_gwq0h_1k4hj_209:not(#\9) {
235
+ .awsui_trigger-container_gwq0h_mztld_209:not(#\9) {
236
236
  padding: var(--space-container-header-vertical-zsjhel, 12px) var(--space-container-horizontal-ddrezg, 24px);
237
237
  }
238
- .awsui_trigger-container_gwq0h_1k4hj_209[data-awsui-focus-visible=true]:not(#\9):focus {
238
+ .awsui_trigger-container_gwq0h_mztld_209[data-awsui-focus-visible=true]:not(#\9):focus {
239
239
  padding: calc(var(--space-scaled-s-cu1hzn, 12px) - var(--border-divider-section-width-4wm2it, 2px)) calc(var(--space-l-4vl6xu, 20px) - var(--border-divider-section-width-4wm2it, 2px));
240
240
  }
241
- .awsui_trigger-default_gwq0h_1k4hj_188.awsui_trigger-expanded_gwq0h_1k4hj_119:not(#\9) {
241
+ .awsui_trigger-default_gwq0h_mztld_188.awsui_trigger-expanded_gwq0h_mztld_119:not(#\9) {
242
242
  border-bottom-color: var(--color-border-divider-default-7s2wjw, #e9ebed);
243
243
  }
244
244
 
245
- .awsui_header_gwq0h_1k4hj_219:not(#\9) {
245
+ .awsui_header_gwq0h_mztld_219:not(#\9) {
246
246
  display: flex;
247
247
  }
248
- .awsui_header-container_gwq0h_1k4hj_222:not(#\9) {
248
+ .awsui_header-container_gwq0h_mztld_222:not(#\9) {
249
249
  width: 100%;
250
250
  }
251
- .awsui_header-container_gwq0h_1k4hj_222 > .awsui_icon-container_gwq0h_1k4hj_173:not(#\9) {
251
+ .awsui_header-container_gwq0h_mztld_222 > .awsui_icon-container_gwq0h_mztld_173:not(#\9) {
252
252
  margin-top: var(--space-expandable-section-icon-offset-top-svbirl, 4px);
253
253
  margin-right: var(--space-xs-rsr2qu, 8px);
254
254
  }
255
- .awsui_header-navigation_gwq0h_1k4hj_229 > .awsui_icon-container_gwq0h_1k4hj_173:not(#\9) {
255
+ .awsui_header-container_gwq0h_mztld_222[data-awsui-focus-visible=true]:not(#\9):focus-within {
256
+ outline: none;
257
+ text-decoration: none;
258
+ padding: calc(var(--space-scaled-s-cu1hzn, 12px) - var(--border-divider-section-width-4wm2it, 2px)) calc(var(--space-l-4vl6xu, 20px) - var(--border-divider-section-width-4wm2it, 2px));
259
+ outline: 2px dotted transparent;
260
+ border: var(--border-field-width-idlekx, 2px) solid var(--color-border-item-focused-ap3b6s, #0972d3);
261
+ border-radius: var(--border-radius-control-default-focus-ring-7661kz, 4px);
262
+ box-shadow: 0 0 0 var(--border-control-focus-ring-shadow-spread-srzyiu, 0px) var(--color-border-item-focused-ap3b6s, #0972d3);
263
+ }
264
+ .awsui_header-container-button_gwq0h_mztld_238:not(#\9):focus {
265
+ outline: none;
266
+ text-decoration: none;
267
+ }
268
+ .awsui_header-container-button_gwq0h_mztld_238 > .awsui_icon-container_gwq0h_mztld_173:not(#\9) {
269
+ margin-top: var(--space-expandable-section-icon-offset-top-svbirl, 4px);
270
+ margin-right: var(--space-xs-rsr2qu, 8px);
271
+ }
272
+ .awsui_header-navigation_gwq0h_mztld_246 > .awsui_icon-container_gwq0h_mztld_173:not(#\9) {
256
273
  display: inline-flex;
257
274
  cursor: pointer;
258
275
  color: var(--color-text-expandable-section-navigation-icon-default-lb9rm0, #414d5c);
@@ -263,17 +280,17 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
263
280
  text-decoration: none;
264
281
  flex-direction: column;
265
282
  }
266
- .awsui_header-navigation_gwq0h_1k4hj_229 > .awsui_icon-container_gwq0h_1k4hj_173:not(#\9):hover {
283
+ .awsui_header-navigation_gwq0h_mztld_246 > .awsui_icon-container_gwq0h_mztld_173:not(#\9):hover {
267
284
  color: var(--color-text-expandable-section-hover-73g3du, #0972d3);
268
285
  }
269
- .awsui_header-navigation_gwq0h_1k4hj_229 > .awsui_icon-container_gwq0h_1k4hj_173[data-awsui-focus-visible=true]:not(#\9):focus {
286
+ .awsui_header-navigation_gwq0h_mztld_246 > .awsui_icon-container_gwq0h_mztld_173[data-awsui-focus-visible=true]:not(#\9):focus {
270
287
  position: relative;
271
288
  }
272
- .awsui_header-navigation_gwq0h_1k4hj_229 > .awsui_icon-container_gwq0h_1k4hj_173[data-awsui-focus-visible=true]:not(#\9):focus {
289
+ .awsui_header-navigation_gwq0h_mztld_246 > .awsui_icon-container_gwq0h_mztld_173[data-awsui-focus-visible=true]:not(#\9):focus {
273
290
  outline: 2px dotted transparent;
274
291
  outline-offset: calc(2px - 1px);
275
292
  }
276
- .awsui_header-navigation_gwq0h_1k4hj_229 > .awsui_icon-container_gwq0h_1k4hj_173[data-awsui-focus-visible=true]:not(#\9):focus::before {
293
+ .awsui_header-navigation_gwq0h_mztld_246 > .awsui_icon-container_gwq0h_mztld_173[data-awsui-focus-visible=true]:not(#\9):focus::before {
277
294
  content: " ";
278
295
  display: block;
279
296
  position: absolute;
@@ -285,24 +302,24 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
285
302
  box-shadow: 0 0 0 2px var(--color-border-item-focused-ap3b6s, #0972d3);
286
303
  }
287
304
 
288
- .awsui_content_gwq0h_1k4hj_97:not(#\9) {
305
+ .awsui_content_gwq0h_mztld_97:not(#\9) {
289
306
  display: none;
290
307
  }
291
- .awsui_content-default_gwq0h_1k4hj_265:not(#\9) {
308
+ .awsui_content-default_gwq0h_mztld_282:not(#\9) {
292
309
  padding: var(--space-scaled-xs-6859qs, 8px) 0;
293
310
  }
294
- .awsui_content-footer_gwq0h_1k4hj_268:not(#\9) {
311
+ .awsui_content-footer_gwq0h_mztld_285:not(#\9) {
295
312
  padding: var(--space-xs-rsr2qu, 8px) 0;
296
313
  }
297
- .awsui_content-expanded_gwq0h_1k4hj_271:not(#\9) {
314
+ .awsui_content-expanded_gwq0h_mztld_288:not(#\9) {
298
315
  display: block;
299
316
  }
300
317
 
301
- .awsui_focusable_gwq0h_1k4hj_275:not(#\9):focus {
318
+ .awsui_focusable_gwq0h_mztld_292:not(#\9):focus {
302
319
  outline: none;
303
320
  text-decoration: none;
304
321
  }
305
- .awsui_focusable_gwq0h_1k4hj_275[data-awsui-focus-visible=true]:not(#\9):focus {
322
+ .awsui_focusable_gwq0h_mztld_292[data-awsui-focus-visible=true]:not(#\9):focus {
306
323
  outline: 2px dotted transparent;
307
324
  border: var(--border-field-width-idlekx, 2px) solid var(--color-border-item-focused-ap3b6s, #0972d3);
308
325
  border-radius: var(--border-radius-control-default-focus-ring-7661kz, 4px);
@@ -2,25 +2,26 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "content-enter": "awsui_content-enter_gwq0h_1k4hj_97",
6
- "awsui-motion-fade-in": "awsui_awsui-motion-fade-in_gwq0h_1k4hj_1",
7
- "trigger-expanded": "awsui_trigger-expanded_gwq0h_1k4hj_119",
8
- "icon": "awsui_icon_gwq0h_1k4hj_133",
9
- "root": "awsui_root_gwq0h_1k4hj_151",
10
- "expanded": "awsui_expanded_gwq0h_1k4hj_169",
11
- "icon-container": "awsui_icon-container_gwq0h_1k4hj_173",
12
- "trigger": "awsui_trigger_gwq0h_1k4hj_119",
13
- "trigger-default": "awsui_trigger-default_gwq0h_1k4hj_188",
14
- "trigger-footer": "awsui_trigger-footer_gwq0h_1k4hj_191",
15
- "trigger-navigation": "awsui_trigger-navigation_gwq0h_1k4hj_197",
16
- "trigger-container": "awsui_trigger-container_gwq0h_1k4hj_209",
17
- "header": "awsui_header_gwq0h_1k4hj_219",
18
- "header-container": "awsui_header-container_gwq0h_1k4hj_222",
19
- "header-navigation": "awsui_header-navigation_gwq0h_1k4hj_229",
20
- "content": "awsui_content_gwq0h_1k4hj_97",
21
- "content-default": "awsui_content-default_gwq0h_1k4hj_265",
22
- "content-footer": "awsui_content-footer_gwq0h_1k4hj_268",
23
- "content-expanded": "awsui_content-expanded_gwq0h_1k4hj_271",
24
- "focusable": "awsui_focusable_gwq0h_1k4hj_275"
5
+ "content-enter": "awsui_content-enter_gwq0h_mztld_97",
6
+ "awsui-motion-fade-in": "awsui_awsui-motion-fade-in_gwq0h_mztld_1",
7
+ "trigger-expanded": "awsui_trigger-expanded_gwq0h_mztld_119",
8
+ "icon": "awsui_icon_gwq0h_mztld_133",
9
+ "root": "awsui_root_gwq0h_mztld_151",
10
+ "expanded": "awsui_expanded_gwq0h_mztld_169",
11
+ "icon-container": "awsui_icon-container_gwq0h_mztld_173",
12
+ "trigger": "awsui_trigger_gwq0h_mztld_119",
13
+ "trigger-default": "awsui_trigger-default_gwq0h_mztld_188",
14
+ "trigger-footer": "awsui_trigger-footer_gwq0h_mztld_191",
15
+ "trigger-navigation": "awsui_trigger-navigation_gwq0h_mztld_197",
16
+ "trigger-container": "awsui_trigger-container_gwq0h_mztld_209",
17
+ "header": "awsui_header_gwq0h_mztld_219",
18
+ "header-container": "awsui_header-container_gwq0h_mztld_222",
19
+ "header-container-button": "awsui_header-container-button_gwq0h_mztld_238",
20
+ "header-navigation": "awsui_header-navigation_gwq0h_mztld_246",
21
+ "content": "awsui_content_gwq0h_mztld_97",
22
+ "content-default": "awsui_content-default_gwq0h_mztld_282",
23
+ "content-footer": "awsui_content-footer_gwq0h_mztld_285",
24
+ "content-expanded": "awsui_content-expanded_gwq0h_mztld_288",
25
+ "focusable": "awsui_focusable_gwq0h_mztld_292"
25
26
  };
26
27
 
@@ -1,9 +1,9 @@
1
1
  import { FlashbarProps } from './interfaces';
2
2
  import React from 'react';
3
- interface Flash extends FlashbarProps.MessageDefinition {
3
+ export declare const focusFlashById: import("../internal/utils/throttle").ThrottledFunction<(element: HTMLElement | null, itemId: string) => void>;
4
+ export interface FlashProps extends FlashbarProps.MessageDefinition {
4
5
  className: string;
5
6
  transitionState?: string;
6
7
  }
7
- export declare const Flash: React.ForwardRefExoticComponent<Flash & React.RefAttributes<HTMLDivElement>>;
8
- export {};
8
+ export declare const Flash: React.ForwardRefExoticComponent<FlashProps & React.RefAttributes<HTMLDivElement>>;
9
9
  //# sourceMappingURL=flash.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"flash.d.ts","sourceRoot":"","sources":["../../../src/flashbar/flash.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,KAAK,MAAM,OAAO,CAAC;AA6C1B,UAAU,KAAM,SAAQ,aAAa,CAAC,iBAAiB;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,eAAO,MAAM,KAAK,8EA4EjB,CAAC"}
1
+ {"version":3,"file":"flash.d.ts","sourceRoot":"","sources":["../../../src/flashbar/flash.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,KAAK,MAAM,OAAO,CAAC;AAkD1B,eAAO,MAAM,cAAc,mEACf,WAAW,GAAG,IAAI,UAAU,MAAM,UAM7C,CAAC;AAEF,MAAM,WAAW,UAAW,SAAQ,aAAa,CAAC,iBAAiB;IACjE,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,eAAO,MAAM,KAAK,mFAgGjB,CAAC"}
package/flashbar/flash.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { __assign } from "tslib";
1
2
  import React from 'react';
2
3
  import InternalSpinner from '../spinner/internal';
3
4
  import InternalIcon from '../icon/internal';
@@ -6,6 +7,10 @@ import styles from './styles.css.js';
6
7
  import { InternalButton } from '../button/internal';
7
8
  import { warnOnce } from '../internal/logging';
8
9
  import { isDevelopment } from '../internal/is-development';
10
+ import { throttle } from '../internal/utils/throttle';
11
+ import useFocusVisible from '../internal/hooks/focus-visible';
12
+ import LiveRegion from '../internal/components/live-region';
13
+ var FOCUS_THROTTLE_DELAY = 2000;
9
14
  var ICON_TYPES = {
10
15
  success: 'status-positive',
11
16
  warning: 'status-warning',
@@ -19,9 +24,15 @@ function dismissButton(dismissLabel, onDismiss) {
19
24
  return (React.createElement("div", { className: styles['dismiss-button-wrapper'] },
20
25
  React.createElement(InternalButton, { onClick: onDismiss, className: styles['dismiss-button'], variant: "flashbar-icon", iconName: "close", formAction: "none", ariaLabel: dismissLabel })));
21
26
  }
27
+ export var focusFlashById = throttle(function (element, itemId) {
28
+ var _a;
29
+ var selector = "[data-itemid=\"".concat(CSS.escape(itemId), "\"] .").concat(styles['flash-focus-container']);
30
+ (_a = element === null || element === void 0 ? void 0 : element.querySelector(selector)) === null || _a === void 0 ? void 0 : _a.focus();
31
+ }, FOCUS_THROTTLE_DELAY, { trailing: false });
22
32
  export var Flash = React.forwardRef(function (_a, ref) {
23
33
  var _b;
24
- var header = _a.header, content = _a.content, dismissible = _a.dismissible, dismissLabel = _a.dismissLabel, statusIconAriaLabel = _a.statusIconAriaLabel, loading = _a.loading, action = _a.action, buttonText = _a.buttonText, onButtonClick = _a.onButtonClick, onDismiss = _a.onDismiss, className = _a.className, transitionState = _a.transitionState, _c = _a.type, type = _c === void 0 ? 'info' : _c;
34
+ var id = _a.id, header = _a.header, content = _a.content, dismissible = _a.dismissible, dismissLabel = _a.dismissLabel, statusIconAriaLabel = _a.statusIconAriaLabel, loading = _a.loading, action = _a.action, buttonText = _a.buttonText, onButtonClick = _a.onButtonClick, onDismiss = _a.onDismiss, className = _a.className, transitionState = _a.transitionState, ariaRole = _a.ariaRole, _c = _a.type, type = _c === void 0 ? 'info' : _c;
35
+ var focusVisible = useFocusVisible();
25
36
  if (isDevelopment) {
26
37
  if (buttonText && !onButtonClick) {
27
38
  warnOnce('Flashbar', "You provided a `buttonText` prop without an `onButtonClick` handler. This will render a non-interactive action button.");
@@ -34,21 +45,26 @@ export var Flash = React.forwardRef(function (_a, ref) {
34
45
  var iconType = ICON_TYPES[type];
35
46
  var icon = loading ? React.createElement(InternalSpinner, null) : React.createElement(InternalIcon, { name: iconType });
36
47
  var effectiveType = loading ? 'info' : type;
37
- return (React.createElement("div", { ref: ref, className: clsx(styles.flash, styles["flash-type-".concat(effectiveType)], className, transitionState
38
- ? (_b = {},
39
- _b[styles.enter] = transitionState === 'enter',
40
- _b[styles.entering] = transitionState === 'entering',
41
- _b[styles.entered] = transitionState === 'entered',
42
- _b[styles.exit] = transitionState === 'exit',
43
- _b[styles.exiting] = transitionState === 'exiting',
44
- _b[styles.exited] = transitionState === 'exited',
45
- _b) : '') },
46
- React.createElement("div", { className: clsx(styles['flash-icon'], styles['flash-text']), role: "img", "aria-label": statusIconAriaLabel }, icon),
48
+ var announcement = [statusIconAriaLabel, header, content].filter(Boolean).join(' ');
49
+ return (
50
+ // We're not using "polite" or "assertive" here, just turning default behavior off.
51
+ // eslint-disable-next-line @cloudscape-design/prefer-live-region
52
+ React.createElement("div", { ref: ref, role: ariaRole, "aria-live": ariaRole ? 'off' : undefined, "data-itemid": id, className: clsx(styles.flash, styles["flash-type-".concat(effectiveType)], className, transitionState && (_b = {},
53
+ _b[styles.enter] = transitionState === 'enter',
54
+ _b[styles.entering] = transitionState === 'entering',
55
+ _b[styles.entered] = transitionState === 'entered',
56
+ _b[styles.exit] = transitionState === 'exit',
57
+ _b[styles.exiting] = transitionState === 'exiting',
58
+ _b[styles.exited] = transitionState === 'exited',
59
+ _b)) },
47
60
  React.createElement("div", { className: styles['flash-body'] },
48
- React.createElement("div", { className: clsx(styles['flash-message'], styles['flash-text']) },
49
- React.createElement("div", { className: styles['flash-header'] }, header),
50
- React.createElement("div", { className: styles['flash-content'] }, content)),
61
+ React.createElement("div", __assign({}, focusVisible, { className: styles['flash-focus-container'], tabIndex: ariaRole === 'alert' ? -1 : undefined }),
62
+ React.createElement("div", { className: clsx(styles['flash-icon'], styles['flash-text']), role: "img", "aria-label": statusIconAriaLabel }, icon),
63
+ React.createElement("div", { className: clsx(styles['flash-message'], styles['flash-text']) },
64
+ React.createElement("div", { className: styles['flash-header'] }, header),
65
+ React.createElement("div", { className: styles['flash-content'] }, content))),
51
66
  button && React.createElement("div", { className: styles['action-button-wrapper'] }, button)),
52
- dismissible && dismissButton(dismissLabel, onDismiss)));
67
+ dismissible && dismissButton(dismissLabel, onDismiss),
68
+ ariaRole === 'status' && React.createElement(LiveRegion, null, announcement)));
53
69
  });
54
70
  //# sourceMappingURL=flash.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"flash.js","sourceRoot":"","sources":["../../../src/flashbar/flash.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,eAAe,MAAM,qBAAqB,CAAC;AAClD,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,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gBAAa,mBAAmB,IACzG,IAAI,CACD;QACN,6BAAK,SAAS,EAAE,MAAM,CAAC,YAAY,CAAC;YAClC,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;gBACjE,6BAAK,SAAS,EAAE,MAAM,CAAC,cAAc,CAAC,IAAG,MAAM,CAAO;gBACtD,6BAAK,SAAS,EAAE,MAAM,CAAC,eAAe,CAAC,IAAG,OAAO,CAAO,CACpD;YACL,MAAM,IAAI,6BAAK,SAAS,EAAE,MAAM,CAAC,uBAAuB,CAAC,IAAG,MAAM,CAAO,CACtE;QACL,WAAW,IAAI,aAAa,CAAC,YAAY,EAAE,SAAS,CAAC,CAClD,CACP,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { FlashbarProps } from './interfaces';\nimport React from 'react';\nimport InternalSpinner from '../spinner/internal';\nimport InternalIcon from '../icon/internal';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport { InternalButton } from '../button/internal';\nimport { warnOnce } from '../internal/logging';\nimport { isDevelopment } from '../internal/is-development';\n\nconst ICON_TYPES = {\n success: 'status-positive',\n warning: 'status-warning',\n info: 'status-info',\n error: 'status-negative',\n} as const;\n\nfunction actionButton(\n buttonText: FlashbarProps.MessageDefinition['buttonText'],\n onButtonClick: FlashbarProps.MessageDefinition['onButtonClick']\n) {\n return (\n <InternalButton onClick={onButtonClick} className={styles['action-button']} formAction=\"none\">\n {buttonText}\n </InternalButton>\n );\n}\n\nfunction dismissButton(\n dismissLabel: FlashbarProps.MessageDefinition['dismissLabel'],\n onDismiss: FlashbarProps.MessageDefinition['onDismiss']\n) {\n return (\n <div className={styles['dismiss-button-wrapper']}>\n <InternalButton\n onClick={onDismiss}\n className={styles['dismiss-button']}\n variant=\"flashbar-icon\"\n iconName=\"close\"\n formAction=\"none\"\n ariaLabel={dismissLabel}\n />\n </div>\n );\n}\n\ninterface Flash extends FlashbarProps.MessageDefinition {\n className: string;\n transitionState?: string;\n}\n\nexport const Flash = React.forwardRef(\n (\n {\n header,\n content,\n dismissible,\n dismissLabel,\n statusIconAriaLabel,\n loading,\n action,\n buttonText,\n onButtonClick,\n onDismiss,\n className,\n transitionState,\n type = 'info',\n }: Flash,\n ref: React.Ref<HTMLDivElement>\n ) => {\n if (isDevelopment) {\n if (buttonText && !onButtonClick) {\n warnOnce(\n 'Flashbar',\n `You provided a \\`buttonText\\` prop without an \\`onButtonClick\\` handler. This will render a non-interactive action button.`\n );\n }\n\n if (dismissible && !onDismiss) {\n warnOnce(\n 'Flashbar',\n `You have set the \\`dismissible\\` prop without an \\`onDismiss\\` handler. This will render a non-interactive dismiss button.`\n );\n }\n }\n\n const button = action || (buttonText && actionButton(buttonText, onButtonClick));\n\n const iconType = ICON_TYPES[type];\n\n const icon = loading ? <InternalSpinner /> : <InternalIcon name={iconType} />;\n\n const effectiveType = loading ? 'info' : type;\n\n return (\n <div\n ref={ref}\n className={clsx(\n styles.flash,\n styles[`flash-type-${effectiveType}`],\n className,\n transitionState\n ? {\n [styles.enter]: transitionState === 'enter',\n [styles.entering]: transitionState === 'entering',\n [styles.entered]: transitionState === 'entered',\n [styles.exit]: transitionState === 'exit',\n [styles.exiting]: transitionState === 'exiting',\n [styles.exited]: transitionState === 'exited',\n }\n : ''\n )}\n >\n <div className={clsx(styles['flash-icon'], styles['flash-text'])} role=\"img\" aria-label={statusIconAriaLabel}>\n {icon}\n </div>\n <div className={styles['flash-body']}>\n <div className={clsx(styles['flash-message'], styles['flash-text'])}>\n <div className={styles['flash-header']}>{header}</div>\n <div className={styles['flash-content']}>{content}</div>\n </div>\n {button && <div className={styles['action-button-wrapper']}>{button}</div>}\n </div>\n {dismissible && dismissButton(dismissLabel, onDismiss)}\n </div>\n );\n }\n);\n"]}
1
+ {"version":3,"file":"flash.js","sourceRoot":"","sources":["../../../src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KAAK,gBACE,mBAAmB,IAE9B,IAAI,CACD;gBACN,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;oBACjE,6BAAK,SAAS,EAAE,MAAM,CAAC,cAAc,CAAC,IAAG,MAAM,CAAO;oBACtD,6BAAK,SAAS,EAAE,MAAM,CAAC,eAAe,CAAC,IAAG,OAAO,CAAO,CACpD,CACF;YACL,MAAM,IAAI,6BAAK,SAAS,EAAE,MAAM,CAAC,uBAAuB,CAAC,IAAG,MAAM,CAAO,CACtE;QACL,WAAW,IAAI,aAAa,CAAC,YAAY,EAAE,SAAS,CAAC;QACrD,QAAQ,KAAK,QAAQ,IAAI,oBAAC,UAAU,QAAE,YAAY,CAAc,CAC7D,CACP,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { FlashbarProps } from './interfaces';\nimport React from 'react';\nimport InternalSpinner from '../spinner/internal';\nimport InternalIcon from '../icon/internal';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport { InternalButton } from '../button/internal';\nimport { warnOnce } from '../internal/logging';\nimport { isDevelopment } from '../internal/is-development';\nimport { throttle } from '../internal/utils/throttle';\nimport useFocusVisible from '../internal/hooks/focus-visible';\nimport LiveRegion from '../internal/components/live-region';\n\nconst FOCUS_THROTTLE_DELAY = 2000;\n\nconst ICON_TYPES = {\n success: 'status-positive',\n warning: 'status-warning',\n info: 'status-info',\n error: 'status-negative',\n} as const;\n\nfunction actionButton(\n buttonText: FlashbarProps.MessageDefinition['buttonText'],\n onButtonClick: FlashbarProps.MessageDefinition['onButtonClick']\n) {\n return (\n <InternalButton onClick={onButtonClick} className={styles['action-button']} formAction=\"none\">\n {buttonText}\n </InternalButton>\n );\n}\n\nfunction dismissButton(\n dismissLabel: FlashbarProps.MessageDefinition['dismissLabel'],\n onDismiss: FlashbarProps.MessageDefinition['onDismiss']\n) {\n return (\n <div className={styles['dismiss-button-wrapper']}>\n <InternalButton\n onClick={onDismiss}\n className={styles['dismiss-button']}\n variant=\"flashbar-icon\"\n iconName=\"close\"\n formAction=\"none\"\n ariaLabel={dismissLabel}\n />\n </div>\n );\n}\n\nexport const focusFlashById = throttle(\n (element: HTMLElement | null, itemId: string) => {\n const selector = `[data-itemid=\"${CSS.escape(itemId)}\"] .${styles['flash-focus-container']}`;\n element?.querySelector<HTMLElement>(selector)?.focus();\n },\n FOCUS_THROTTLE_DELAY,\n { trailing: false }\n);\n\nexport interface FlashProps extends FlashbarProps.MessageDefinition {\n className: string;\n transitionState?: string;\n}\n\nexport const Flash = React.forwardRef(\n (\n {\n id,\n header,\n content,\n dismissible,\n dismissLabel,\n statusIconAriaLabel,\n loading,\n action,\n buttonText,\n onButtonClick,\n onDismiss,\n className,\n transitionState,\n ariaRole,\n type = 'info',\n }: FlashProps,\n ref: React.Ref<HTMLDivElement>\n ) => {\n const focusVisible = useFocusVisible();\n\n if (isDevelopment) {\n if (buttonText && !onButtonClick) {\n warnOnce(\n 'Flashbar',\n `You provided a \\`buttonText\\` prop without an \\`onButtonClick\\` handler. This will render a non-interactive action button.`\n );\n }\n\n if (dismissible && !onDismiss) {\n warnOnce(\n 'Flashbar',\n `You have set the \\`dismissible\\` prop without an \\`onDismiss\\` handler. This will render a non-interactive dismiss button.`\n );\n }\n }\n\n const button = action || (buttonText && actionButton(buttonText, onButtonClick));\n\n const iconType = ICON_TYPES[type];\n\n const icon = loading ? <InternalSpinner /> : <InternalIcon name={iconType} />;\n\n const effectiveType = loading ? 'info' : type;\n\n const announcement = [statusIconAriaLabel, header, content].filter(Boolean).join(' ');\n\n return (\n // We're not using \"polite\" or \"assertive\" here, just turning default behavior off.\n // eslint-disable-next-line @cloudscape-design/prefer-live-region\n <div\n ref={ref}\n role={ariaRole}\n aria-live={ariaRole ? 'off' : undefined}\n data-itemid={id}\n className={clsx(\n styles.flash,\n styles[`flash-type-${effectiveType}`],\n className,\n transitionState && {\n [styles.enter]: transitionState === 'enter',\n [styles.entering]: transitionState === 'entering',\n [styles.entered]: transitionState === 'entered',\n [styles.exit]: transitionState === 'exit',\n [styles.exiting]: transitionState === 'exiting',\n [styles.exited]: transitionState === 'exited',\n }\n )}\n >\n <div className={styles['flash-body']}>\n <div\n {...focusVisible}\n className={styles['flash-focus-container']}\n tabIndex={ariaRole === 'alert' ? -1 : undefined}\n >\n <div\n className={clsx(styles['flash-icon'], styles['flash-text'])}\n role=\"img\"\n aria-label={statusIconAriaLabel}\n >\n {icon}\n </div>\n <div className={clsx(styles['flash-message'], styles['flash-text'])}>\n <div className={styles['flash-header']}>{header}</div>\n <div className={styles['flash-content']}>{content}</div>\n </div>\n </div>\n {button && <div className={styles['action-button-wrapper']}>{button}</div>}\n </div>\n {dismissible && dismissButton(dismissLabel, onDismiss)}\n {ariaRole === 'status' && <LiveRegion>{announcement}</LiveRegion>}\n </div>\n );\n }\n);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/flashbar/index.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAc7C,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAAE,KAAK,EAAE,GAAG,SAAS,EAAE,EAAE,aAAa,eAgKtE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/flashbar/index.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,aAAa,EAAwB,MAAM,cAAc,CAAC;AAenE,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAAE,KAAK,EAAE,GAAG,SAAS,EAAE,EAAE,aAAa,eA8MtE"}