@cloudscape-design/components 3.0.352 → 3.0.354

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 (108) hide show
  1. package/alert/index.d.ts +3 -2
  2. package/alert/index.d.ts.map +1 -1
  3. package/alert/index.js +4 -3
  4. package/alert/index.js.map +1 -1
  5. package/alert/interfaces.d.ts +6 -0
  6. package/alert/interfaces.d.ts.map +1 -1
  7. package/alert/interfaces.js.map +1 -1
  8. package/alert/internal.d.ts +5 -5
  9. package/alert/internal.d.ts.map +1 -1
  10. package/alert/internal.js +22 -14
  11. package/alert/internal.js.map +1 -1
  12. package/alert/styles.css.js +24 -19
  13. package/alert/styles.scoped.css +72 -35
  14. package/alert/styles.selectors.js +24 -19
  15. package/app-layout/visual-refresh/background.d.ts.map +1 -1
  16. package/app-layout/visual-refresh/background.js +2 -2
  17. package/app-layout/visual-refresh/background.js.map +1 -1
  18. package/app-layout/visual-refresh/context.d.ts +2 -1
  19. package/app-layout/visual-refresh/context.d.ts.map +1 -1
  20. package/app-layout/visual-refresh/context.js +9 -11
  21. package/app-layout/visual-refresh/context.js.map +1 -1
  22. package/app-layout/visual-refresh/layout.d.ts.map +1 -1
  23. package/app-layout/visual-refresh/layout.js +3 -11
  24. package/app-layout/visual-refresh/layout.js.map +1 -1
  25. package/app-layout/visual-refresh/use-background-overlap.d.ts +16 -0
  26. package/app-layout/visual-refresh/use-background-overlap.d.ts.map +1 -0
  27. package/app-layout/visual-refresh/use-background-overlap.js +41 -0
  28. package/app-layout/visual-refresh/use-background-overlap.js.map +1 -0
  29. package/attribute-editor/styles.css.js +14 -14
  30. package/attribute-editor/styles.scoped.css +28 -29
  31. package/attribute-editor/styles.selectors.js +14 -14
  32. package/breadcrumb-group/item/styles.css.js +9 -9
  33. package/breadcrumb-group/item/styles.scoped.css +19 -19
  34. package/breadcrumb-group/item/styles.selectors.js +9 -9
  35. package/cards/index.d.ts.map +1 -1
  36. package/cards/index.js +9 -7
  37. package/cards/index.js.map +1 -1
  38. package/help-panel/index.d.ts.map +1 -1
  39. package/help-panel/index.js +3 -1
  40. package/help-panel/index.js.map +1 -1
  41. package/help-panel/styles.css.js +4 -4
  42. package/help-panel/styles.scoped.css +67 -68
  43. package/help-panel/styles.selectors.js +4 -4
  44. package/internal/base-component/styles.scoped.css +0 -8
  45. package/internal/context/link-default-variant-context.d.ts +6 -0
  46. package/internal/context/link-default-variant-context.d.ts.map +1 -0
  47. package/internal/context/link-default-variant-context.js +7 -0
  48. package/internal/context/link-default-variant-context.js.map +1 -0
  49. package/internal/environment.js +1 -1
  50. package/internal/environment.json +1 -1
  51. package/internal/generated/theming/index.cjs +0 -40
  52. package/internal/generated/theming/index.js +0 -40
  53. package/internal/hooks/container-queries/use-resize-observer.d.ts.map +1 -1
  54. package/internal/hooks/container-queries/use-resize-observer.js +1 -9
  55. package/internal/hooks/container-queries/use-resize-observer.js.map +1 -1
  56. package/internal/hooks/container-queries/utils.d.ts +4 -0
  57. package/internal/hooks/container-queries/utils.d.ts.map +1 -0
  58. package/internal/hooks/container-queries/utils.js +10 -0
  59. package/internal/hooks/container-queries/utils.js.map +1 -0
  60. package/internal/hooks/use-dynamic-overlap/index.d.ts +1 -1
  61. package/internal/hooks/use-dynamic-overlap/index.d.ts.map +1 -1
  62. package/internal/hooks/use-dynamic-overlap/index.js +11 -5
  63. package/internal/hooks/use-dynamic-overlap/index.js.map +1 -1
  64. package/internal/manifest.json +1 -1
  65. package/link/index.d.ts.map +1 -1
  66. package/link/index.js +2 -2
  67. package/link/index.js.map +1 -1
  68. package/link/interfaces.d.ts +7 -0
  69. package/link/interfaces.d.ts.map +1 -1
  70. package/link/interfaces.js.map +1 -1
  71. package/link/internal.d.ts.map +1 -1
  72. package/link/internal.js +4 -1
  73. package/link/internal.js.map +1 -1
  74. package/link/styles.css.js +20 -20
  75. package/link/styles.scoped.css +79 -78
  76. package/link/styles.selectors.js +20 -20
  77. package/package.json +1 -1
  78. package/popover/internal.d.ts.map +1 -1
  79. package/popover/internal.js +3 -1
  80. package/popover/internal.js.map +1 -1
  81. package/table/internal.d.ts.map +1 -1
  82. package/table/internal.js +58 -56
  83. package/table/internal.js.map +1 -1
  84. package/table/sticky-columns/index.d.ts +2 -1
  85. package/table/sticky-columns/index.d.ts.map +1 -1
  86. package/table/sticky-columns/index.js +1 -1
  87. package/table/sticky-columns/index.js.map +1 -1
  88. package/table/sticky-columns/interfaces.d.ts +31 -0
  89. package/table/sticky-columns/interfaces.d.ts.map +1 -0
  90. package/table/sticky-columns/interfaces.js +4 -0
  91. package/table/sticky-columns/interfaces.js.map +1 -0
  92. package/table/sticky-columns/use-sticky-columns.d.ts +1 -25
  93. package/table/sticky-columns/use-sticky-columns.d.ts.map +1 -1
  94. package/table/sticky-columns/use-sticky-columns.js +18 -51
  95. package/table/sticky-columns/use-sticky-columns.js.map +1 -1
  96. package/table/sticky-columns/utils.d.ts +5 -0
  97. package/table/sticky-columns/utils.d.ts.map +1 -0
  98. package/table/sticky-columns/utils.js +42 -0
  99. package/table/sticky-columns/utils.js.map +1 -0
  100. package/text-content/styles.css.js +1 -1
  101. package/text-content/styles.scoped.css +68 -70
  102. package/text-content/styles.selectors.js +1 -1
  103. package/tutorial-panel/components/tutorial-detail-view/congratulation-screen.js +1 -1
  104. package/tutorial-panel/components/tutorial-detail-view/congratulation-screen.js.map +1 -1
  105. package/tutorial-panel/components/tutorial-list/index.js +1 -1
  106. package/tutorial-panel/components/tutorial-list/index.js.map +1 -1
  107. package/wizard/wizard-navigation.js +1 -1
  108. package/wizard/wizard-navigation.js.map +1 -1
package/alert/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { AlertProps } from './interfaces';
3
3
  export { AlertProps };
4
- export default function Alert({ type, visible, ...props }: AlertProps): JSX.Element;
4
+ declare const Alert: React.ForwardRefExoticComponent<AlertProps & React.RefAttributes<AlertProps.Ref>>;
5
+ export default Alert;
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["alert/index.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAO1C,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,IAAa,EAAE,OAAc,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,eAyCpF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["alert/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAO1C,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,QAAA,MAAM,KAAK,mFA2CV,CAAC;AAGF,eAAe,KAAK,CAAC"}
package/alert/index.js CHANGED
@@ -8,7 +8,7 @@ import useBaseComponent from '../internal/hooks/use-base-component';
8
8
  import { FunnelMetrics } from '../internal/analytics';
9
9
  import { useFunnel, useFunnelStep, useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';
10
10
  import { getNameFromSelector, getSubStepAllSelector } from '../internal/analytics/selectors';
11
- export default function Alert(_a) {
11
+ const Alert = React.forwardRef((_a, ref) => {
12
12
  var { type = 'info', visible = true } = _a, props = __rest(_a, ["type", "visible"]);
13
13
  const baseComponentProps = useBaseComponent('Alert');
14
14
  const { funnelInteractionId, submissionAttempt, funnelState, errorCount } = useFunnel();
@@ -43,7 +43,8 @@ export default function Alert(_a) {
43
43
  }
44
44
  // eslint-disable-next-line react-hooks/exhaustive-deps
45
45
  }, [funnelInteractionId, visible, submissionAttempt, errorCount]);
46
- return React.createElement(InternalAlert, Object.assign({ type: type, visible: visible }, props, baseComponentProps));
47
- }
46
+ return React.createElement(InternalAlert, Object.assign({ type: type, visible: visible }, props, baseComponentProps, { ref: ref }));
47
+ });
48
48
  applyDisplayName(Alert, 'Alert');
49
+ export default Alert;
49
50
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["alert/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE,OAAO,aAAa,MAAM,YAAY,CAAC;AACvC,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AACpG,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAI7F,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAuD;QAAvD,EAAE,IAAI,GAAG,MAAM,EAAE,OAAO,GAAG,IAAI,OAAwB,EAAnB,KAAK,cAAzC,mBAA2C,CAAF;IACrE,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAErD,MAAM,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,SAAS,EAAE,CAAC;IACxF,MAAM,EAAE,UAAU,EAAE,gBAAgB,EAAE,GAAG,aAAa,EAAE,CAAC;IACzD,MAAM,EAAE,eAAe,EAAE,mBAAmB,EAAE,GAAG,gBAAgB,EAAE,CAAC;IAEpE,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,mBAAmB,IAAI,OAAO,IAAI,IAAI,KAAK,OAAO,IAAI,WAAW,CAAC,OAAO,KAAK,UAAU,EAAE;YAC5F,MAAM,QAAQ,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;YACvD,MAAM,WAAW,GAAG,mBAAmB,CAAC,mBAAmB,CAAC,CAAC;YAE7D,UAAU,CAAC,OAAO,EAAE,CAAC;YAErB,IAAI,eAAe,EAAE;gBACnB,aAAa,CAAC,kBAAkB,CAAC;oBAC/B,mBAAmB;oBACnB,eAAe;oBACf,WAAW;oBACX,mBAAmB;oBACnB,UAAU;oBACV,QAAQ;oBACR,gBAAgB;oBAChB,kBAAkB,EAAE,qBAAqB,EAAE;iBAC5C,CAAC,CAAC;aACJ;iBAAM;gBACL,aAAa,CAAC,WAAW,CAAC;oBACxB,mBAAmB;iBACpB,CAAC,CAAC;aACJ;YAED,OAAO,GAAG,EAAE;gBACV,uDAAuD;gBACvD,UAAU,CAAC,OAAO,EAAE,CAAC;YACvB,CAAC,CAAC;SACH;QAED,uDAAuD;IACzD,CAAC,EAAE,CAAC,mBAAmB,EAAE,OAAO,EAAE,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC;IAElE,OAAO,oBAAC,aAAa,kBAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,IAAM,KAAK,EAAM,kBAAkB,EAAI,CAAC;AAC5F,CAAC;AAED,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect } from 'react';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { AlertProps } from './interfaces';\nimport InternalAlert from './internal';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { FunnelMetrics } from '../internal/analytics';\nimport { useFunnel, useFunnelStep, useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';\nimport { getNameFromSelector, getSubStepAllSelector } from '../internal/analytics/selectors';\n\nexport { AlertProps };\n\nexport default function Alert({ type = 'info', visible = true, ...props }: AlertProps) {\n const baseComponentProps = useBaseComponent('Alert');\n\n const { funnelInteractionId, submissionAttempt, funnelState, errorCount } = useFunnel();\n const { stepNumber, stepNameSelector } = useFunnelStep();\n const { subStepSelector, subStepNameSelector } = useFunnelSubStep();\n\n useEffect(() => {\n if (funnelInteractionId && visible && type === 'error' && funnelState.current !== 'complete') {\n const stepName = getNameFromSelector(stepNameSelector);\n const subStepName = getNameFromSelector(subStepNameSelector);\n\n errorCount.current++;\n\n if (subStepSelector) {\n FunnelMetrics.funnelSubStepError({\n funnelInteractionId,\n subStepSelector,\n subStepName,\n subStepNameSelector,\n stepNumber,\n stepName,\n stepNameSelector,\n subStepAllSelector: getSubStepAllSelector(),\n });\n } else {\n FunnelMetrics.funnelError({\n funnelInteractionId,\n });\n }\n\n return () => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n errorCount.current--;\n };\n }\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [funnelInteractionId, visible, submissionAttempt, errorCount]);\n\n return <InternalAlert type={type} visible={visible} {...props} {...baseComponentProps} />;\n}\n\napplyDisplayName(Alert, 'Alert');\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["alert/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE,OAAO,aAAa,MAAM,YAAY,CAAC;AACvC,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AACpG,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAI7F,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAC5B,CAAC,EAAuD,EAAE,GAA8B,EAAE,EAAE;QAA3F,EAAE,IAAI,GAAG,MAAM,EAAE,OAAO,GAAG,IAAI,OAAwB,EAAnB,KAAK,cAAzC,mBAA2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,CACF,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, { useEffect } from 'react';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { AlertProps } from './interfaces';\nimport InternalAlert from './internal';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { FunnelMetrics } from '../internal/analytics';\nimport { useFunnel, useFunnelStep, useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';\nimport { getNameFromSelector, getSubStepAllSelector } from '../internal/analytics/selectors';\n\nexport { AlertProps };\n\nconst Alert = React.forwardRef(\n ({ type = 'info', visible = true, ...props }: AlertProps, ref: React.Ref<AlertProps.Ref>) => {\n const baseComponentProps = useBaseComponent('Alert');\n\n const { funnelInteractionId, submissionAttempt, funnelState, errorCount } = useFunnel();\n const { stepNumber, stepNameSelector } = useFunnelStep();\n const { subStepSelector, subStepNameSelector } = useFunnelSubStep();\n\n useEffect(() => {\n if (funnelInteractionId && visible && type === 'error' && funnelState.current !== 'complete') {\n const stepName = getNameFromSelector(stepNameSelector);\n const subStepName = getNameFromSelector(subStepNameSelector);\n\n errorCount.current++;\n\n if (subStepSelector) {\n FunnelMetrics.funnelSubStepError({\n funnelInteractionId,\n subStepSelector,\n subStepName,\n subStepNameSelector,\n stepNumber,\n stepName,\n stepNameSelector,\n subStepAllSelector: getSubStepAllSelector(),\n });\n } else {\n FunnelMetrics.funnelError({\n funnelInteractionId,\n });\n }\n\n return () => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n errorCount.current--;\n };\n }\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [funnelInteractionId, visible, submissionAttempt, errorCount]);\n\n return <InternalAlert type={type} visible={visible} {...props} {...baseComponentProps} ref={ref} />;\n }\n);\n\napplyDisplayName(Alert, 'Alert');\nexport default Alert;\n"]}
@@ -3,6 +3,12 @@ import { BaseComponentProps } from '../internal/base-component';
3
3
  import { NonCancelableEventHandler } from '../internal/events';
4
4
  export declare namespace AlertProps {
5
5
  type Type = 'success' | 'error' | 'warning' | 'info';
6
+ interface Ref {
7
+ /**
8
+ * Sets focus on the alert content.
9
+ */
10
+ focus(): void;
11
+ }
6
12
  }
7
13
  export interface AlertProps extends BaseComponentProps {
8
14
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"lib/default/","sources":["alert/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,yBAAiB,UAAU,CAAC;IAC1B,KAAY,IAAI,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;CAC7D;AAED,MAAM,WAAW,UAAW,SAAQ,kBAAkB;IACpD;;OAEG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC,IAAI,CAAC;IAEvB;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;;;OAIG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;;OAGG;IACH,SAAS,CAAC,EAAE,yBAAyB,CAAC;IACtC;;;OAGG;IACH,aAAa,CAAC,EAAE,yBAAyB,CAAC;CAC3C"}
1
+ {"version":3,"file":"interfaces.d.ts","sourceRoot":"lib/default/","sources":["alert/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,yBAAiB,UAAU,CAAC;IAC1B,KAAY,IAAI,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;IAE5D,UAAiB,GAAG;QAClB;;WAEG;QACH,KAAK,IAAI,IAAI,CAAC;KACf;CACF;AAED,MAAM,WAAW,UAAW,SAAQ,kBAAkB;IACpD;;OAEG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC,IAAI,CAAC;IAEvB;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;;;OAIG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;;OAGG;IACH,SAAS,CAAC,EAAE,yBAAyB,CAAC;IACtC;;;OAGG;IACH,aAAa,CAAC,EAAE,yBAAyB,CAAC;CAC3C"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["alert/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 AlertProps {\n export type Type = 'success' | 'error' | 'warning' | 'info';\n}\n\nexport interface AlertProps extends BaseComponentProps {\n /**\n * Specifies the type of message you want to display.\n */\n type?: AlertProps.Type;\n\n /**\n * Provides a text alternative for the icon.\n */\n statusIconAriaLabel?: string;\n\n /**\n * Determines whether the alert is displayed.\n * @deprecated Use conditional rendering in your code instead of this prop.\n */\n visible?: boolean;\n /**\n * Adds a close button to the alert when set to `true`.\n * An `onDismiss` event is fired when a user clicks the button.\n */\n dismissible?: boolean;\n /**\n * Adds an aria-label to the dismiss button.\n * @i18n\n */\n dismissAriaLabel?: string;\n /**\n * Primary text displayed in the element.\n */\n children?: React.ReactNode;\n /**\n * Heading text.\n */\n header?: React.ReactNode;\n /**\n * Displays an action button next to the message area when set.\n * An `onButtonClick` event is fired when the user clicks it.\n * @deprecated Replaced by `action`.\n */\n buttonText?: React.ReactNode;\n /**\n * Specifies an action for the alert message.\n * Although it is technically possible to insert any content, our UX guidelines only allow you to add a button.\n */\n action?: React.ReactNode;\n /**\n * Fired when the user clicks the close icon that is displayed\n * when the `dismissible` property is set to `true`.\n */\n onDismiss?: NonCancelableEventHandler;\n /**\n * Fired when the user clicks the action button.\n * **Deprecated** Replaced by `action`.\n */\n onButtonClick?: NonCancelableEventHandler;\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["alert/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 AlertProps {\n export type Type = 'success' | 'error' | 'warning' | 'info';\n\n export interface Ref {\n /**\n * Sets focus on the alert content.\n */\n focus(): void;\n }\n}\n\nexport interface AlertProps extends BaseComponentProps {\n /**\n * Specifies the type of message you want to display.\n */\n type?: AlertProps.Type;\n\n /**\n * Provides a text alternative for the icon.\n */\n statusIconAriaLabel?: string;\n\n /**\n * Determines whether the alert is displayed.\n * @deprecated Use conditional rendering in your code instead of this prop.\n */\n visible?: boolean;\n /**\n * Adds a close button to the alert when set to `true`.\n * An `onDismiss` event is fired when a user clicks the button.\n */\n dismissible?: boolean;\n /**\n * Adds an aria-label to the dismiss button.\n * @i18n\n */\n dismissAriaLabel?: string;\n /**\n * Primary text displayed in the element.\n */\n children?: React.ReactNode;\n /**\n * Heading text.\n */\n header?: React.ReactNode;\n /**\n * Displays an action button next to the message area when set.\n * An `onButtonClick` event is fired when the user clicks it.\n * @deprecated Replaced by `action`.\n */\n buttonText?: React.ReactNode;\n /**\n * Specifies an action for the alert message.\n * Although it is technically possible to insert any content, our UX guidelines only allow you to add a button.\n */\n action?: React.ReactNode;\n /**\n * Fired when the user clicks the close icon that is displayed\n * when the `dismissible` property is set to `true`.\n */\n onDismiss?: NonCancelableEventHandler;\n /**\n * Fired when the user clicks the action button.\n * **Deprecated** Replaced by `action`.\n */\n onButtonClick?: NonCancelableEventHandler;\n}\n"]}
@@ -1,8 +1,8 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { AlertProps } from './interfaces';
3
3
  import { InternalBaseComponentProps } from '../internal/hooks/use-base-component';
4
- import { SomeRequired } from '../internal/types';
5
- type InternalAlertProps = SomeRequired<AlertProps, 'type'> & InternalBaseComponentProps;
6
- export default function InternalAlert({ type, statusIconAriaLabel, visible, dismissible, dismissAriaLabel, children, header, buttonText, action, onDismiss, onButtonClick, __internalRootRef, ...rest }: InternalAlertProps): JSX.Element;
7
- export {};
4
+ declare const InternalAlert: React.ForwardRefExoticComponent<AlertProps & {
5
+ type: AlertProps.Type;
6
+ } & InternalBaseComponentProps & React.RefAttributes<AlertProps.Ref>>;
7
+ export default InternalAlert;
8
8
  //# sourceMappingURL=internal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"lib/default/","sources":["alert/internal.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAWjD,KAAK,kBAAkB,GAAG,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,GAAG,0BAA0B,CAAC;AAExF,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,IAAI,EACJ,mBAAmB,EACnB,OAAc,EACd,WAAW,EACX,gBAAgB,EAChB,QAAQ,EACR,MAAM,EACN,UAAU,EACV,MAAM,EACN,SAAS,EACT,aAAa,EACb,iBAAwB,EACxB,GAAG,IAAI,EACR,EAAE,kBAAkB,eAkEpB"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"lib/default/","sources":["alert/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAYtC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAgBlF,QAAA,MAAM,aAAa;;qEA8FlB,CAAC;AAEF,eAAe,aAAa,CAAC"}
package/alert/internal.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { __rest } from "tslib";
2
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  // SPDX-License-Identifier: Apache-2.0
4
- import React from 'react';
4
+ import React, { useRef } from 'react';
5
5
  import clsx from 'clsx';
6
6
  import { InternalButton } from '../button/internal';
7
7
  import InternalIcon from '../icon/internal';
@@ -11,19 +11,23 @@ import styles from './styles.css.js';
11
11
  import { fireNonCancelableEvent } from '../internal/events';
12
12
  import { useContainerBreakpoints } from '../internal/hooks/container-queries';
13
13
  import { useVisualRefresh } from '../internal/hooks/use-visual-mode';
14
+ import useForwardFocus from '../internal/hooks/forward-focus';
14
15
  import { useMergeRefs } from '../internal/hooks/use-merge-refs';
15
16
  import { useInternalI18n } from '../i18n/context';
16
17
  import { DATA_ATTR_ANALYTICS_ALERT } from '../internal/analytics/selectors';
18
+ import { LinkDefaultVariantContext } from '../internal/context/link-default-variant-context';
17
19
  const typeToIcon = {
18
20
  error: 'status-negative',
19
21
  warning: 'status-warning',
20
22
  success: 'status-positive',
21
23
  info: 'status-info',
22
24
  };
23
- export default function InternalAlert(_a) {
25
+ const InternalAlert = React.forwardRef((_a, ref) => {
24
26
  var { type, statusIconAriaLabel, visible = true, dismissible, dismissAriaLabel, children, header, buttonText, action, onDismiss, onButtonClick, __internalRootRef = null } = _a, rest = __rest(_a, ["type", "statusIconAriaLabel", "visible", "dismissible", "dismissAriaLabel", "children", "header", "buttonText", "action", "onDismiss", "onButtonClick", "__internalRootRef"]);
25
27
  const baseProps = getBaseProps(rest);
26
28
  const i18n = useInternalI18n('alert');
29
+ const focusRef = useRef(null);
30
+ useForwardFocus(ref, focusRef);
27
31
  const [breakpoint, breakpointRef] = useContainerBreakpoints(['xs']);
28
32
  const mergedRef = useMergeRefs(breakpointRef, __internalRootRef);
29
33
  const isRefresh = useVisualRefresh();
@@ -34,16 +38,20 @@ export default function InternalAlert(_a) {
34
38
  [DATA_ATTR_ANALYTICS_ALERT]: type,
35
39
  };
36
40
  return (React.createElement("div", Object.assign({}, baseProps, analyticsAttributes, { "aria-hidden": !visible, className: clsx(styles.root, { [styles.hidden]: !visible }, baseProps.className, styles[`breakpoint-${breakpoint}`]), ref: mergedRef }),
37
- React.createElement(VisualContext, { contextName: "alert" },
38
- React.createElement("div", { className: clsx(styles.alert, styles[`type-${type}`]) },
39
- React.createElement("div", { className: clsx(styles.icon, styles.text), role: "img", "aria-label": statusIconAriaLabel },
40
- React.createElement(InternalIcon, { name: typeToIcon[type], size: size })),
41
- React.createElement("div", { className: styles.body },
42
- React.createElement("div", { className: clsx(styles.message, styles.text) },
43
- header && React.createElement("div", { className: styles.header }, header),
44
- React.createElement("div", { className: styles.content }, children)),
45
- hasAction && React.createElement("div", { className: styles.action }, actionButton)),
46
- dismissible && (React.createElement("div", { className: styles.dismiss },
47
- React.createElement(InternalButton, { className: styles['dismiss-button'], variant: "icon", iconName: "close", formAction: "none", ariaLabel: i18n('dismissAriaLabel', dismissAriaLabel), onClick: () => fireNonCancelableEvent(onDismiss) })))))));
48
- }
41
+ React.createElement(LinkDefaultVariantContext.Provider, { value: { defaultVariant: 'primary' } },
42
+ React.createElement(VisualContext, { contextName: "alert" },
43
+ React.createElement("div", { className: clsx(styles.alert, styles[`type-${type}`], styles[`icon-size-${size}`]) },
44
+ React.createElement("div", { className: styles['alert-mobile-block'] },
45
+ React.createElement("div", { className: styles['alert-focus-wrapper'], tabIndex: -1, ref: focusRef },
46
+ React.createElement("div", { className: clsx(styles.icon, styles.text), role: "img", "aria-label": statusIconAriaLabel },
47
+ React.createElement(InternalIcon, { name: typeToIcon[type], size: size })),
48
+ React.createElement("div", { className: styles.body },
49
+ React.createElement("div", { className: clsx(styles.message, styles.text) },
50
+ header && React.createElement("div", { className: styles.header }, header),
51
+ React.createElement("div", { className: styles.content }, children)))),
52
+ hasAction && React.createElement("div", { className: styles.action }, actionButton)),
53
+ dismissible && (React.createElement("div", { className: styles.dismiss },
54
+ React.createElement(InternalButton, { className: styles['dismiss-button'], variant: "icon", iconName: "close", formAction: "none", ariaLabel: i18n('dismissAriaLabel', dismissAriaLabel), onClick: () => fireNonCancelableEvent(onDismiss) }))))))));
55
+ });
56
+ export default InternalAlert;
49
57
  //# sourceMappingURL=internal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"lib/default/","sources":["alert/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,cAAc,E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AC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC;wBAC9C,MAAM,IAAI,6BAAK,SAAS,EAAE,MAAM,CAAC,MAAM,IAAG,MAAM,CAAO;wBACxD,6BAAK,SAAS,EAAE,MAAM,CAAC,OAAO,IAAG,QAAQ,CAAO,CAC5C;oBACL,SAAS,IAAI,6BAAK,SAAS,EAAE,MAAM,CAAC,MAAM,IAAG,YAAY,CAAO,CAC7D;gBACL,WAAW,IAAI,CACd,6BAAK,SAAS,EAAE,MAAM,CAAC,OAAO;oBAC5B,oBAAC,cAAc,IACb,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,EACnC,OAAO,EAAC,MAAM,EACd,QAAQ,EAAC,OAAO,EAChB,UAAU,EAAC,MAAM,EACjB,SAAS,EAAE,IAAI,CAAC,kBAAkB,EAAE,gBAAgB,CAAC,EACrD,OAAO,EAAE,GAAG,EAAE,CAAC,sBAAsB,CAAC,SAAS,CAAC,GAChD,CACE,CACP,CACG,CACQ,CACZ,CACP,CAAC;AACJ,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';\nimport { InternalButton } from '../button/internal';\nimport { IconProps } from '../icon/interfaces';\nimport InternalIcon from '../icon/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport VisualContext from '../internal/components/visual-context';\nimport styles from './styles.css.js';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { useContainerBreakpoints } from '../internal/hooks/container-queries';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { AlertProps } from './interfaces';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { SomeRequired } from '../internal/types';\nimport { useInternalI18n } from '../i18n/context';\nimport { DATA_ATTR_ANALYTICS_ALERT } from '../internal/analytics/selectors';\n\nconst typeToIcon: Record<AlertProps.Type, IconProps['name']> = {\n error: 'status-negative',\n warning: 'status-warning',\n success: 'status-positive',\n info: 'status-info',\n};\n\ntype InternalAlertProps = SomeRequired<AlertProps, 'type'> & InternalBaseComponentProps;\n\nexport default function InternalAlert({\n type,\n statusIconAriaLabel,\n visible = true,\n dismissible,\n dismissAriaLabel,\n children,\n header,\n buttonText,\n action,\n onDismiss,\n onButtonClick,\n __internalRootRef = null,\n ...rest\n}: InternalAlertProps) {\n const baseProps = getBaseProps(rest);\n const i18n = useInternalI18n('alert');\n\n const [breakpoint, breakpointRef] = useContainerBreakpoints(['xs']);\n const mergedRef = useMergeRefs(breakpointRef, __internalRootRef);\n\n const isRefresh = useVisualRefresh();\n const size = isRefresh ? 'normal' : header && children ? 'big' : 'normal';\n\n const actionButton = action || (\n <InternalButton\n className={styles['action-button']}\n onClick={() => fireNonCancelableEvent(onButtonClick)}\n formAction=\"none\"\n >\n {buttonText}\n </InternalButton>\n );\n\n const hasAction = Boolean(action || buttonText);\n const analyticsAttributes = {\n [DATA_ATTR_ANALYTICS_ALERT]: type,\n };\n\n return (\n <div\n {...baseProps}\n {...analyticsAttributes}\n aria-hidden={!visible}\n className={clsx(\n styles.root,\n { [styles.hidden]: !visible },\n baseProps.className,\n styles[`breakpoint-${breakpoint}`]\n )}\n ref={mergedRef}\n >\n <VisualContext contextName=\"alert\">\n <div className={clsx(styles.alert, styles[`type-${type}`])}>\n <div className={clsx(styles.icon, styles.text)} role=\"img\" aria-label={statusIconAriaLabel}>\n <InternalIcon name={typeToIcon[type]} size={size} />\n </div>\n <div className={styles.body}>\n <div className={clsx(styles.message, styles.text)}>\n {header && <div className={styles.header}>{header}</div>}\n <div className={styles.content}>{children}</div>\n </div>\n {hasAction && <div className={styles.action}>{actionButton}</div>}\n </div>\n {dismissible && (\n <div className={styles.dismiss}>\n <InternalButton\n className={styles['dismiss-button']}\n variant=\"icon\"\n iconName=\"close\"\n formAction=\"none\"\n ariaLabel={i18n('dismissAriaLabel', dismissAriaLabel)}\n onClick={() => fireNonCancelableEvent(onDismiss)}\n />\n </div>\n )}\n </div>\n </VisualContext>\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"lib/default/","sources":["alert/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,aAAa,MAAM,uCAAuC,CAAC;AAClE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAG9D,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAEhE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,yBAAyB,EAAE,MAAM,kDAAkD,CAAC;AAE7F,MAAM,UAAU,GAA+C;IAC7D,KAAK,EAAE,iBAAiB;IACxB,OAAO,EAAE,gBAAgB;IACzB,OAAO,EAAE,iBAAiB;IAC1B,IAAI,EAAE,aAAa;CACpB,CAAC;AAIF,MAAM,aAAa,GAAG,KAAK,CAAC,UAAU,CACpC,CACE,EAcqB,EACrB,GAA8B,EAC9B,EAAE;QAhBF,EACE,IAAI,EACJ,mBAAmB,EACnB,OAAO,GAAG,IAAI,EACd,WAAW,EACX,gBAAgB,EAChB,QAAQ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gB,CAAC,EACnC,OAAO,EAAC,MAAM,EACd,QAAQ,EAAC,OAAO,EAChB,UAAU,EAAC,MAAM,EACjB,SAAS,EAAE,IAAI,CAAC,kBAAkB,EAAE,gBAAgB,CAAC,EACrD,OAAO,EAAE,GAAG,EAAE,CAAC,sBAAsB,CAAC,SAAS,CAAC,GAChD,CACE,CACP,CACG,CACQ,CACmB,CACjC,CACP,CAAC;AACJ,CAAC,CACF,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, { useRef } from 'react';\nimport clsx from 'clsx';\nimport { InternalButton } from '../button/internal';\nimport { IconProps } from '../icon/interfaces';\nimport InternalIcon from '../icon/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport VisualContext from '../internal/components/visual-context';\nimport styles from './styles.css.js';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { useContainerBreakpoints } from '../internal/hooks/container-queries';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport { AlertProps } from './interfaces';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { SomeRequired } from '../internal/types';\nimport { useInternalI18n } from '../i18n/context';\nimport { DATA_ATTR_ANALYTICS_ALERT } from '../internal/analytics/selectors';\nimport { LinkDefaultVariantContext } from '../internal/context/link-default-variant-context';\n\nconst typeToIcon: Record<AlertProps.Type, IconProps['name']> = {\n error: 'status-negative',\n warning: 'status-warning',\n success: 'status-positive',\n info: 'status-info',\n};\n\ntype InternalAlertProps = SomeRequired<AlertProps, 'type'> & InternalBaseComponentProps;\n\nconst InternalAlert = React.forwardRef(\n (\n {\n type,\n statusIconAriaLabel,\n visible = true,\n dismissible,\n dismissAriaLabel,\n children,\n header,\n buttonText,\n action,\n onDismiss,\n onButtonClick,\n __internalRootRef = null,\n ...rest\n }: InternalAlertProps,\n ref: React.Ref<AlertProps.Ref>\n ) => {\n const baseProps = getBaseProps(rest);\n const i18n = useInternalI18n('alert');\n\n const focusRef = useRef<HTMLDivElement>(null);\n useForwardFocus(ref, focusRef);\n\n const [breakpoint, breakpointRef] = useContainerBreakpoints(['xs']);\n const mergedRef = useMergeRefs(breakpointRef, __internalRootRef);\n\n const isRefresh = useVisualRefresh();\n const size = isRefresh ? 'normal' : header && children ? 'big' : 'normal';\n\n const actionButton = action || (\n <InternalButton\n className={styles['action-button']}\n onClick={() => fireNonCancelableEvent(onButtonClick)}\n formAction=\"none\"\n >\n {buttonText}\n </InternalButton>\n );\n\n const hasAction = Boolean(action || buttonText);\n const analyticsAttributes = {\n [DATA_ATTR_ANALYTICS_ALERT]: type,\n };\n\n return (\n <div\n {...baseProps}\n {...analyticsAttributes}\n aria-hidden={!visible}\n className={clsx(\n styles.root,\n { [styles.hidden]: !visible },\n baseProps.className,\n styles[`breakpoint-${breakpoint}`]\n )}\n ref={mergedRef}\n >\n <LinkDefaultVariantContext.Provider value={{ defaultVariant: 'primary' }}>\n <VisualContext contextName=\"alert\">\n <div className={clsx(styles.alert, styles[`type-${type}`], styles[`icon-size-${size}`])}>\n <div className={styles['alert-mobile-block']}>\n <div className={styles['alert-focus-wrapper']} tabIndex={-1} ref={focusRef}>\n <div className={clsx(styles.icon, styles.text)} role=\"img\" aria-label={statusIconAriaLabel}>\n <InternalIcon name={typeToIcon[type]} size={size} />\n </div>\n <div className={styles.body}>\n <div className={clsx(styles.message, styles.text)}>\n {header && <div className={styles.header}>{header}</div>}\n <div className={styles.content}>{children}</div>\n </div>\n </div>\n </div>\n {hasAction && <div className={styles.action}>{actionButton}</div>}\n </div>\n {dismissible && (\n <div className={styles.dismiss}>\n <InternalButton\n className={styles['dismiss-button']}\n variant=\"icon\"\n iconName=\"close\"\n formAction=\"none\"\n ariaLabel={i18n('dismissAriaLabel', dismissAriaLabel)}\n onClick={() => fireNonCancelableEvent(onDismiss)}\n />\n </div>\n )}\n </div>\n </VisualContext>\n </LinkDefaultVariantContext.Provider>\n </div>\n );\n }\n);\n\nexport default InternalAlert;\n"]}
@@ -1,24 +1,29 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "alert": "awsui_alert_mx3cw_1sjtq_93",
5
- "awsui-motion-fade-in": "awsui_awsui-motion-fade-in_mx3cw_1sjtq_1",
6
- "root": "awsui_root_mx3cw_1sjtq_119",
7
- "hidden": "awsui_hidden_mx3cw_1sjtq_135",
8
- "body": "awsui_body_mx3cw_1sjtq_160",
9
- "header": "awsui_header_mx3cw_1sjtq_166",
10
- "action": "awsui_action_mx3cw_1sjtq_170",
11
- "action-button": "awsui_action-button_mx3cw_1sjtq_175",
12
- "text": "awsui_text_mx3cw_1sjtq_179",
13
- "icon": "awsui_icon_mx3cw_1sjtq_183",
14
- "message": "awsui_message_mx3cw_1sjtq_186",
15
- "breakpoint-default": "awsui_breakpoint-default_mx3cw_1sjtq_194",
16
- "content": "awsui_content_mx3cw_1sjtq_208",
17
- "dismiss": "awsui_dismiss_mx3cw_1sjtq_212",
18
- "dismiss-button": "awsui_dismiss-button_mx3cw_1sjtq_218",
19
- "type-error": "awsui_type-error_mx3cw_1sjtq_226",
20
- "type-warning": "awsui_type-warning_mx3cw_1sjtq_234",
21
- "type-success": "awsui_type-success_mx3cw_1sjtq_242",
22
- "type-info": "awsui_type-info_mx3cw_1sjtq_250"
4
+ "alert": "awsui_alert_mx3cw_1kx9t_93",
5
+ "awsui-motion-fade-in": "awsui_awsui-motion-fade-in_mx3cw_1kx9t_1",
6
+ "root": "awsui_root_mx3cw_1kx9t_119",
7
+ "hidden": "awsui_hidden_mx3cw_1kx9t_135",
8
+ "body": "awsui_body_mx3cw_1kx9t_161",
9
+ "header": "awsui_header_mx3cw_1kx9t_167",
10
+ "action": "awsui_action_mx3cw_1kx9t_171",
11
+ "action-button": "awsui_action-button_mx3cw_1kx9t_176",
12
+ "alert-focus-wrapper": "awsui_alert-focus-wrapper_mx3cw_1kx9t_180",
13
+ "alert-mobile-block": "awsui_alert-mobile-block_mx3cw_1kx9t_206",
14
+ "text": "awsui_text_mx3cw_1kx9t_211",
15
+ "icon": "awsui_icon_mx3cw_1kx9t_215",
16
+ "message": "awsui_message_mx3cw_1kx9t_218",
17
+ "breakpoint-default": "awsui_breakpoint-default_mx3cw_1kx9t_223",
18
+ "icon-size-medium": "awsui_icon-size-medium_mx3cw_1kx9t_229",
19
+ "icon-size-big": "awsui_icon-size-big_mx3cw_1kx9t_232",
20
+ "icon-size-normal": "awsui_icon-size-normal_mx3cw_1kx9t_235",
21
+ "content": "awsui_content_mx3cw_1kx9t_245",
22
+ "dismiss": "awsui_dismiss_mx3cw_1kx9t_249",
23
+ "dismiss-button": "awsui_dismiss-button_mx3cw_1kx9t_255",
24
+ "type-error": "awsui_type-error_mx3cw_1kx9t_263",
25
+ "type-warning": "awsui_type-warning_mx3cw_1kx9t_271",
26
+ "type-success": "awsui_type-success_mx3cw_1kx9t_279",
27
+ "type-info": "awsui_type-info_mx3cw_1kx9t_287"
23
28
  };
24
29
 
@@ -90,10 +90,10 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
90
90
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
91
91
  SPDX-License-Identifier: Apache-2.0
92
92
  */
93
- .awsui_alert_mx3cw_1sjtq_93:not(#\9) {
94
- animation: awsui_awsui-motion-fade-in_mx3cw_1sjtq_1 var(--motion-duration-show-paced-q2lo2h, 180ms) var(--motion-easing-show-paced-ne2o0s, ease-out);
93
+ .awsui_alert_mx3cw_1kx9t_93:not(#\9) {
94
+ animation: awsui_awsui-motion-fade-in_mx3cw_1kx9t_1 var(--motion-duration-show-paced-q2lo2h, 180ms) var(--motion-easing-show-paced-ne2o0s, ease-out);
95
95
  }
96
- @keyframes awsui_awsui-motion-fade-in_mx3cw_1sjtq_1 {
96
+ @keyframes awsui_awsui-motion-fade-in_mx3cw_1kx9t_1 {
97
97
  from {
98
98
  opacity: 0.2;
99
99
  }
@@ -102,12 +102,12 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
102
102
  }
103
103
  }
104
104
  @media (prefers-reduced-motion: reduce) {
105
- .awsui_alert_mx3cw_1sjtq_93:not(#\9) {
105
+ .awsui_alert_mx3cw_1kx9t_93:not(#\9) {
106
106
  animation: none;
107
107
  transition: none;
108
108
  }
109
109
  }
110
- .awsui-motion-disabled .awsui_alert_mx3cw_1sjtq_93:not(#\9), .awsui-mode-entering .awsui_alert_mx3cw_1sjtq_93:not(#\9) {
110
+ .awsui-motion-disabled .awsui_alert_mx3cw_1kx9t_93:not(#\9), .awsui-mode-entering .awsui_alert_mx3cw_1kx9t_93:not(#\9) {
111
111
  animation: none;
112
112
  transition: none;
113
113
  }
@@ -116,7 +116,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
116
116
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
117
117
  SPDX-License-Identifier: Apache-2.0
118
118
  */
119
- .awsui_root_mx3cw_1sjtq_119:not(#\9) {
119
+ .awsui_root_mx3cw_1kx9t_119:not(#\9) {
120
120
  /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
121
121
  border-collapse: separate;
122
122
  border-spacing: 0;
@@ -158,11 +158,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
158
158
  overflow: hidden;
159
159
  display: block;
160
160
  }
161
- .awsui_root_mx3cw_1sjtq_119.awsui_hidden_mx3cw_1sjtq_135:not(#\9) {
161
+ .awsui_root_mx3cw_1kx9t_119.awsui_hidden_mx3cw_1kx9t_135:not(#\9) {
162
162
  display: none;
163
163
  }
164
164
 
165
- .awsui_alert_mx3cw_1sjtq_93:not(#\9) {
165
+ .awsui_alert_mx3cw_1kx9t_93:not(#\9) {
166
166
  /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
167
167
  border-collapse: separate;
168
168
  border-spacing: 0;
@@ -203,106 +203,143 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
203
203
  display: flex;
204
204
  justify-content: flex-start;
205
205
  align-items: flex-start;
206
+ grid-template-columns: auto auto 1fr;
206
207
  border-radius: var(--border-radius-alert-mdtrse, 12px);
207
208
  border: var(--border-field-width-09w7vk, 2px) solid;
208
209
  padding: var(--space-alert-vertical-l6cc71, 8px) var(--space-alert-horizontal-eyt1xx, 16px);
209
210
  background-color: var(--color-background-container-content-4un1ap, #ffffff);
210
211
  }
211
212
 
212
- .awsui_body_mx3cw_1sjtq_160:not(#\9) {
213
+ .awsui_body_mx3cw_1kx9t_161:not(#\9) {
213
214
  display: flex;
214
215
  flex: 1 1 0%;
215
216
  min-width: 0;
216
217
  }
217
218
 
218
- .awsui_header_mx3cw_1sjtq_166:not(#\9) {
219
+ .awsui_header_mx3cw_1kx9t_167:not(#\9) {
219
220
  font-weight: 700;
220
221
  }
221
222
 
222
- .awsui_action_mx3cw_1sjtq_170:not(#\9) {
223
+ .awsui_action_mx3cw_1kx9t_171:not(#\9) {
223
224
  white-space: nowrap;
224
- margin-left: var(--space-s-34lx8l, 12px);
225
+ margin-left: var(--space-alert-action-left-ea9czk, 12px);
225
226
  }
226
227
 
227
- .awsui_action-button_mx3cw_1sjtq_175:not(#\9) {
228
+ .awsui_action-button_mx3cw_1kx9t_176:not(#\9) {
228
229
  /* used in test-utils */
229
230
  }
230
231
 
231
- .awsui_text_mx3cw_1sjtq_179:not(#\9) {
232
+ .awsui_alert-focus-wrapper_mx3cw_1kx9t_180:not(#\9) {
233
+ display: flex;
234
+ flex: 1 1 0%;
235
+ }
236
+ .awsui_alert-focus-wrapper_mx3cw_1kx9t_180:not(#\9):focus {
237
+ outline: none;
238
+ }
239
+ body[data-awsui-focus-visible=true] .awsui_alert-focus-wrapper_mx3cw_1kx9t_180:not(#\9):focus {
240
+ position: relative;
241
+ }
242
+ body[data-awsui-focus-visible=true] .awsui_alert-focus-wrapper_mx3cw_1kx9t_180:not(#\9):focus {
243
+ outline: 2px dotted transparent;
244
+ outline-offset: calc(var(--space-button-focus-outline-gutter-cqfd0c, 4px) - 1px);
245
+ }
246
+ body[data-awsui-focus-visible=true] .awsui_alert-focus-wrapper_mx3cw_1kx9t_180:not(#\9):focus::before {
247
+ content: " ";
248
+ display: block;
249
+ position: absolute;
250
+ left: calc(-1 * var(--space-button-focus-outline-gutter-cqfd0c, 4px));
251
+ top: calc(-1 * var(--space-button-focus-outline-gutter-cqfd0c, 4px));
252
+ width: calc(100% + 2 * var(--space-button-focus-outline-gutter-cqfd0c, 4px));
253
+ height: calc(100% + 2 * var(--space-button-focus-outline-gutter-cqfd0c, 4px));
254
+ border-radius: var(--border-radius-control-default-focus-ring-u8zbsz, 4px);
255
+ box-shadow: 0 0 0 2px var(--color-border-item-focused-b2ntyl, #0972d3);
256
+ }
257
+
258
+ .awsui_alert-mobile-block_mx3cw_1kx9t_206:not(#\9) {
259
+ display: flex;
260
+ flex: 1 1 0%;
261
+ }
262
+
263
+ .awsui_text_mx3cw_1kx9t_211:not(#\9) {
232
264
  padding: var(--border-field-width-09w7vk, 2px) 0;
233
265
  margin: var(--space-scaled-xxs-7597g1, 4px) var(--space-xxs-p8yyaw, 4px);
234
266
  }
235
- .awsui_text_mx3cw_1sjtq_179.awsui_icon_mx3cw_1sjtq_183:not(#\9) {
267
+ .awsui_text_mx3cw_1kx9t_211.awsui_icon_mx3cw_1kx9t_215:not(#\9) {
236
268
  margin-left: 0;
237
269
  }
238
- .awsui_text_mx3cw_1sjtq_179.awsui_message_mx3cw_1sjtq_186:not(#\9) {
270
+ .awsui_text_mx3cw_1kx9t_211.awsui_message_mx3cw_1kx9t_218:not(#\9) {
239
271
  margin-right: var(--space-alert-message-right-knlb6u, 4px);
240
272
  }
241
- .awsui_text_mx3cw_1sjtq_179.awsui_message_mx3cw_1sjtq_186 + .awsui_action_mx3cw_1sjtq_170:not(#\9) {
242
- margin-left: var(--space-alert-action-left-ea9czk, 12px);
243
- }
244
273
 
245
274
  /* stylelint-disable selector-max-type */
246
- .awsui_root_mx3cw_1sjtq_119.awsui_breakpoint-default_mx3cw_1sjtq_194 > div > .awsui_alert_mx3cw_1sjtq_93 > .awsui_body_mx3cw_1sjtq_160:not(#\9) {
275
+ .awsui_root_mx3cw_1kx9t_119.awsui_breakpoint-default_mx3cw_1kx9t_223 > div > .awsui_alert_mx3cw_1kx9t_93 > .awsui_alert-mobile-block_mx3cw_1kx9t_206:not(#\9) {
247
276
  display: block;
248
277
  }
249
- .awsui_root_mx3cw_1sjtq_119.awsui_breakpoint-default_mx3cw_1sjtq_194 > div > .awsui_alert_mx3cw_1sjtq_93 > .awsui_body_mx3cw_1sjtq_160 > .awsui_action_mx3cw_1sjtq_170:not(#\9) {
250
- margin-left: var(--space-xxs-p8yyaw, 4px);
278
+ .awsui_root_mx3cw_1kx9t_119.awsui_breakpoint-default_mx3cw_1kx9t_223 > div > .awsui_alert_mx3cw_1kx9t_93 > .awsui_alert-mobile-block_mx3cw_1kx9t_206 > .awsui_action_mx3cw_1kx9t_171:not(#\9) {
251
279
  margin-bottom: var(--space-xxs-p8yyaw, 4px);
252
280
  }
281
+ .awsui_root_mx3cw_1kx9t_119.awsui_breakpoint-default_mx3cw_1kx9t_223 > div > .awsui_alert_mx3cw_1kx9t_93.awsui_icon-size-medium_mx3cw_1kx9t_229 > .awsui_alert-mobile-block_mx3cw_1kx9t_206 > .awsui_action_mx3cw_1kx9t_171:not(#\9) {
282
+ margin-left: calc(var(--size-icon-medium-y9xuoq, 20px) + var(--space-xs-zb16t3, 8px));
283
+ }
284
+ .awsui_root_mx3cw_1kx9t_119.awsui_breakpoint-default_mx3cw_1kx9t_223 > div > .awsui_alert_mx3cw_1kx9t_93.awsui_icon-size-big_mx3cw_1kx9t_232 > .awsui_alert-mobile-block_mx3cw_1kx9t_206 > .awsui_action_mx3cw_1kx9t_171:not(#\9) {
285
+ margin-left: calc(var(--size-icon-big-zkdryd, 32px) + var(--space-xs-zb16t3, 8px));
286
+ }
287
+ .awsui_root_mx3cw_1kx9t_119.awsui_breakpoint-default_mx3cw_1kx9t_223 > div > .awsui_alert_mx3cw_1kx9t_93.awsui_icon-size-normal_mx3cw_1kx9t_235 > .awsui_alert-mobile-block_mx3cw_1kx9t_206 > .awsui_action_mx3cw_1kx9t_171:not(#\9) {
288
+ margin-left: calc(var(--size-icon-normal-0m1722, 16px) + var(--space-xs-zb16t3, 8px));
289
+ }
253
290
 
254
291
  /* stylelint-enable selector-max-type */
255
- .awsui_message_mx3cw_1sjtq_186:not(#\9) {
292
+ .awsui_message_mx3cw_1kx9t_218:not(#\9) {
256
293
  flex: 1 1 0%;
257
294
  min-width: 0;
258
295
  }
259
296
 
260
- .awsui_content_mx3cw_1sjtq_208:not(#\9) {
297
+ .awsui_content_mx3cw_1kx9t_245:not(#\9) {
261
298
  /* used in test-utils */
262
299
  }
263
300
 
264
- .awsui_dismiss_mx3cw_1sjtq_212:not(#\9) {
301
+ .awsui_dismiss_mx3cw_1kx9t_249:not(#\9) {
265
302
  flex: 0 0 auto;
266
303
  margin-right: calc(-1 * var(--space-xxs-p8yyaw, 4px));
267
304
  margin-left: var(--space-s-34lx8l, 12px);
268
305
  }
269
306
 
270
- .awsui_dismiss-button_mx3cw_1sjtq_218:not(#\9) {
307
+ .awsui_dismiss-button_mx3cw_1kx9t_255:not(#\9) {
271
308
  /* used in test-utils */
272
309
  }
273
310
 
274
- .awsui_icon_mx3cw_1sjtq_183:not(#\9) {
311
+ .awsui_icon_mx3cw_1kx9t_215:not(#\9) {
275
312
  flex: 0 0 auto;
276
313
  }
277
314
 
278
- .awsui_type-error_mx3cw_1sjtq_226:not(#\9) {
315
+ .awsui_type-error_mx3cw_1kx9t_263:not(#\9) {
279
316
  border-color: var(--color-border-status-error-dj6icm, #d91515);
280
317
  background-color: var(--color-background-status-error-pbprvn, #fff7f7);
281
318
  }
282
- .awsui_type-error_mx3cw_1sjtq_226 > .awsui_icon_mx3cw_1sjtq_183:not(#\9) {
319
+ .awsui_type-error_mx3cw_1kx9t_263 > .awsui_alert-mobile-block_mx3cw_1kx9t_206 > .awsui_alert-focus-wrapper_mx3cw_1kx9t_180 > .awsui_icon_mx3cw_1kx9t_215:not(#\9) {
283
320
  color: var(--color-text-status-error-wdvepn, #d91515);
284
321
  }
285
322
 
286
- .awsui_type-warning_mx3cw_1sjtq_234:not(#\9) {
323
+ .awsui_type-warning_mx3cw_1kx9t_271:not(#\9) {
287
324
  border-color: var(--color-border-status-warning-52glov, #8d6605);
288
325
  background-color: var(--color-background-status-warning-oor4hw, #fffce9);
289
326
  }
290
- .awsui_type-warning_mx3cw_1sjtq_234 > .awsui_icon_mx3cw_1sjtq_183:not(#\9) {
327
+ .awsui_type-warning_mx3cw_1kx9t_271 > .awsui_alert-mobile-block_mx3cw_1kx9t_206 > .awsui_alert-focus-wrapper_mx3cw_1kx9t_180 > .awsui_icon_mx3cw_1kx9t_215:not(#\9) {
291
328
  color: var(--color-text-status-warning-yik8vi, #8d6605);
292
329
  }
293
330
 
294
- .awsui_type-success_mx3cw_1sjtq_242:not(#\9) {
331
+ .awsui_type-success_mx3cw_1kx9t_279:not(#\9) {
295
332
  border-color: var(--color-border-status-success-wmgb40, #037f0c);
296
333
  background-color: var(--color-background-status-success-jp14wa, #f2fcf3);
297
334
  }
298
- .awsui_type-success_mx3cw_1sjtq_242 > .awsui_icon_mx3cw_1sjtq_183:not(#\9) {
335
+ .awsui_type-success_mx3cw_1kx9t_279 > .awsui_alert-mobile-block_mx3cw_1kx9t_206 > .awsui_alert-focus-wrapper_mx3cw_1kx9t_180 > .awsui_icon_mx3cw_1kx9t_215:not(#\9) {
299
336
  color: var(--color-text-status-success-bpiyjm, #037f0c);
300
337
  }
301
338
 
302
- .awsui_type-info_mx3cw_1sjtq_250:not(#\9) {
339
+ .awsui_type-info_mx3cw_1kx9t_287:not(#\9) {
303
340
  border-color: var(--color-border-status-info-8upc6f, #0972d3);
304
341
  background-color: var(--color-background-status-info-mvnbre, #f2f8fd);
305
342
  }
306
- .awsui_type-info_mx3cw_1sjtq_250 > .awsui_icon_mx3cw_1sjtq_183:not(#\9) {
343
+ .awsui_type-info_mx3cw_1kx9t_287 > .awsui_alert-mobile-block_mx3cw_1kx9t_206 > .awsui_alert-focus-wrapper_mx3cw_1kx9t_180 > .awsui_icon_mx3cw_1kx9t_215:not(#\9) {
307
344
  color: var(--color-text-status-info-ahz8zp, #0972d3);
308
345
  }
@@ -2,24 +2,29 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "alert": "awsui_alert_mx3cw_1sjtq_93",
6
- "awsui-motion-fade-in": "awsui_awsui-motion-fade-in_mx3cw_1sjtq_1",
7
- "root": "awsui_root_mx3cw_1sjtq_119",
8
- "hidden": "awsui_hidden_mx3cw_1sjtq_135",
9
- "body": "awsui_body_mx3cw_1sjtq_160",
10
- "header": "awsui_header_mx3cw_1sjtq_166",
11
- "action": "awsui_action_mx3cw_1sjtq_170",
12
- "action-button": "awsui_action-button_mx3cw_1sjtq_175",
13
- "text": "awsui_text_mx3cw_1sjtq_179",
14
- "icon": "awsui_icon_mx3cw_1sjtq_183",
15
- "message": "awsui_message_mx3cw_1sjtq_186",
16
- "breakpoint-default": "awsui_breakpoint-default_mx3cw_1sjtq_194",
17
- "content": "awsui_content_mx3cw_1sjtq_208",
18
- "dismiss": "awsui_dismiss_mx3cw_1sjtq_212",
19
- "dismiss-button": "awsui_dismiss-button_mx3cw_1sjtq_218",
20
- "type-error": "awsui_type-error_mx3cw_1sjtq_226",
21
- "type-warning": "awsui_type-warning_mx3cw_1sjtq_234",
22
- "type-success": "awsui_type-success_mx3cw_1sjtq_242",
23
- "type-info": "awsui_type-info_mx3cw_1sjtq_250"
5
+ "alert": "awsui_alert_mx3cw_1kx9t_93",
6
+ "awsui-motion-fade-in": "awsui_awsui-motion-fade-in_mx3cw_1kx9t_1",
7
+ "root": "awsui_root_mx3cw_1kx9t_119",
8
+ "hidden": "awsui_hidden_mx3cw_1kx9t_135",
9
+ "body": "awsui_body_mx3cw_1kx9t_161",
10
+ "header": "awsui_header_mx3cw_1kx9t_167",
11
+ "action": "awsui_action_mx3cw_1kx9t_171",
12
+ "action-button": "awsui_action-button_mx3cw_1kx9t_176",
13
+ "alert-focus-wrapper": "awsui_alert-focus-wrapper_mx3cw_1kx9t_180",
14
+ "alert-mobile-block": "awsui_alert-mobile-block_mx3cw_1kx9t_206",
15
+ "text": "awsui_text_mx3cw_1kx9t_211",
16
+ "icon": "awsui_icon_mx3cw_1kx9t_215",
17
+ "message": "awsui_message_mx3cw_1kx9t_218",
18
+ "breakpoint-default": "awsui_breakpoint-default_mx3cw_1kx9t_223",
19
+ "icon-size-medium": "awsui_icon-size-medium_mx3cw_1kx9t_229",
20
+ "icon-size-big": "awsui_icon-size-big_mx3cw_1kx9t_232",
21
+ "icon-size-normal": "awsui_icon-size-normal_mx3cw_1kx9t_235",
22
+ "content": "awsui_content_mx3cw_1kx9t_245",
23
+ "dismiss": "awsui_dismiss_mx3cw_1kx9t_249",
24
+ "dismiss-button": "awsui_dismiss-button_mx3cw_1kx9t_255",
25
+ "type-error": "awsui_type-error_mx3cw_1kx9t_263",
26
+ "type-warning": "awsui_type-warning_mx3cw_1kx9t_271",
27
+ "type-success": "awsui_type-success_mx3cw_1kx9t_279",
28
+ "type-info": "awsui_type-info_mx3cw_1kx9t_287"
24
29
  };
25
30
 
@@ -1 +1 @@
1
- {"version":3,"file":"background.d.ts","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/background.tsx"],"names":[],"mappings":";AAOA,MAAM,CAAC,OAAO,UAAU,UAAU,uBA4BjC"}
1
+ {"version":3,"file":"background.d.ts","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/background.tsx"],"names":[],"mappings":";AAOA,MAAM,CAAC,OAAO,UAAU,UAAU,uBA2BjC"}
@@ -5,8 +5,8 @@ import clsx from 'clsx';
5
5
  import { useAppLayoutInternals } from './context';
6
6
  import styles from './styles.css.js';
7
7
  export default function Background() {
8
- const { breadcrumbs, contentHeader, dynamicOverlapHeight, hasNotificationsContent, hasStickyBackground, isMobile, stickyNotifications, } = useAppLayoutInternals();
9
- if (!hasNotificationsContent && (!breadcrumbs || isMobile) && !contentHeader && dynamicOverlapHeight <= 0) {
8
+ const { breadcrumbs, hasBackgroundOverlap, hasNotificationsContent, hasStickyBackground, isMobile, stickyNotifications, } = useAppLayoutInternals();
9
+ if (!hasNotificationsContent && (!breadcrumbs || isMobile) && !hasBackgroundOverlap) {
10
10
  return null;
11
11
  }
12
12
  return (React.createElement("div", { className: clsx(styles.background, 'awsui-context-content-header') },
@@ -1 +1 @@
1
- {"version":3,"file":"background.js","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/background.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,MAAM,CAAC,OAAO,UAAU,UAAU;IAChC,MAAM,EACJ,WAAW,EACX,aAAa,EACb,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACnB,QAAQ,EACR,mBAAmB,GACpB,GAAG,qBAAqB,EAAE,CAAC;IAE5B,IAAI,CAAC,uBAAuB,IAAI,CAAC,CAAC,WAAW,IAAI,QAAQ,CAAC,IAAI,CAAC,aAAa,IAAI,oBAAoB,IAAI,CAAC,EAAE;QACzG,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,8BAA8B,CAAC;QACrE,6BAAK,SAAS,EAAE,MAAM,CAAC,sBAAsB,CAAC,GAAI;QAEjD,CAAC,QAAQ,IAAI,mBAAmB,IAAI,CACnC,6BACE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,EAAE;gBAC3C,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC,EAAE,mBAAmB;aAC1D,CAAC,GACF,CACH,CACG,CACP,CAAC;AACJ,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';\nimport { useAppLayoutInternals } from './context';\nimport styles from './styles.css.js';\n\nexport default function Background() {\n const {\n breadcrumbs,\n contentHeader,\n dynamicOverlapHeight,\n hasNotificationsContent,\n hasStickyBackground,\n isMobile,\n stickyNotifications,\n } = useAppLayoutInternals();\n\n if (!hasNotificationsContent && (!breadcrumbs || isMobile) && !contentHeader && dynamicOverlapHeight <= 0) {\n return null;\n }\n\n return (\n <div className={clsx(styles.background, 'awsui-context-content-header')}>\n <div className={styles['scrolling-background']} />\n\n {!isMobile && hasStickyBackground && (\n <div\n className={clsx(styles['sticky-background'], {\n [styles['has-sticky-notifications']]: stickyNotifications,\n })}\n />\n )}\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"background.js","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/background.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,MAAM,CAAC,OAAO,UAAU,UAAU;IAChC,MAAM,EACJ,WAAW,EACX,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACnB,QAAQ,EACR,mBAAmB,GACpB,GAAG,qBAAqB,EAAE,CAAC;IAE5B,IAAI,CAAC,uBAAuB,IAAI,CAAC,CAAC,WAAW,IAAI,QAAQ,CAAC,IAAI,CAAC,oBAAoB,EAAE;QACnF,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,8BAA8B,CAAC;QACrE,6BAAK,SAAS,EAAE,MAAM,CAAC,sBAAsB,CAAC,GAAI;QAEjD,CAAC,QAAQ,IAAI,mBAAmB,IAAI,CACnC,6BACE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,EAAE;gBAC3C,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC,EAAE,mBAAmB;aAC1D,CAAC,GACF,CACH,CACG,CACP,CAAC;AACJ,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';\nimport { useAppLayoutInternals } from './context';\nimport styles from './styles.css.js';\n\nexport default function Background() {\n const {\n breadcrumbs,\n hasBackgroundOverlap,\n hasNotificationsContent,\n hasStickyBackground,\n isMobile,\n stickyNotifications,\n } = useAppLayoutInternals();\n\n if (!hasNotificationsContent && (!breadcrumbs || isMobile) && !hasBackgroundOverlap) {\n return null;\n }\n\n return (\n <div className={clsx(styles.background, 'awsui-context-content-header')}>\n <div className={styles['scrolling-background']} />\n\n {!isMobile && hasStickyBackground && (\n <div\n className={clsx(styles['sticky-background'], {\n [styles['has-sticky-notifications']]: stickyNotifications,\n })}\n />\n )}\n </div>\n );\n}\n"]}
@@ -14,7 +14,6 @@ interface AppLayoutInternals extends AppLayoutProps {
14
14
  drawerRef: React.Ref<HTMLElement>;
15
15
  resizeHandle: React.ReactElement;
16
16
  drawersTriggerCount: number;
17
- dynamicOverlapHeight: number;
18
17
  handleDrawersClick: (activeDrawerId: string | null, skipFocusControl?: boolean) => void;
19
18
  handleSplitPanelClick: () => void;
20
19
  handleNavigationClick: (isOpen: boolean) => void;
@@ -23,11 +22,13 @@ interface AppLayoutInternals extends AppLayoutProps {
23
22
  size: number;
24
23
  }) => void;
25
24
  handleToolsClick: (value: boolean, skipFocusControl?: boolean) => void;
25
+ hasBackgroundOverlap: boolean;
26
26
  hasDefaultToolsWidth: boolean;
27
27
  hasDrawerViewportOverlay: boolean;
28
28
  hasNotificationsContent: boolean;
29
29
  hasOpenDrawer?: boolean;
30
30
  hasStickyBackground: boolean;
31
+ isBackgroundOverlapDisabled: boolean;
31
32
  isMobile: boolean;
32
33
  isNavigationOpen: boolean;
33
34
  isSplitPanelForcedPosition: boolean;