@cloudscape-design/components-themeable 3.0.1051 → 3.0.1052
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.
- package/lib/internal/manifest.json +1 -1
- package/lib/internal/scss/alert/styles.scss +12 -2
- package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
- package/lib/internal/template/alert/index.d.ts.map +1 -1
- package/lib/internal/template/alert/index.js +2 -2
- package/lib/internal/template/alert/index.js.map +1 -1
- package/lib/internal/template/alert/interfaces.d.ts +46 -0
- package/lib/internal/template/alert/interfaces.d.ts.map +1 -1
- package/lib/internal/template/alert/interfaces.js.map +1 -1
- package/lib/internal/template/alert/internal.d.ts +1 -0
- package/lib/internal/template/alert/internal.d.ts.map +1 -1
- package/lib/internal/template/alert/internal.js +4 -3
- package/lib/internal/template/alert/internal.js.map +1 -1
- package/lib/internal/template/alert/style.d.ts +23 -0
- package/lib/internal/template/alert/style.d.ts.map +1 -0
- package/lib/internal/template/alert/style.js +36 -0
- package/lib/internal/template/alert/style.js.map +1 -0
- package/lib/internal/template/alert/styles.css.js +27 -27
- package/lib/internal/template/alert/styles.scoped.css +47 -46
- package/lib/internal/template/alert/styles.selectors.js +27 -27
- package/lib/internal/template/container/interfaces.d.ts +46 -0
- package/lib/internal/template/container/interfaces.d.ts.map +1 -1
- package/lib/internal/template/container/interfaces.js.map +1 -1
- package/lib/internal/template/container/internal.d.ts +1 -1
- package/lib/internal/template/container/internal.d.ts.map +1 -1
- package/lib/internal/template/container/internal.js +9 -7
- package/lib/internal/template/container/internal.js.map +1 -1
- package/lib/internal/template/container/style.d.ts +7 -0
- package/lib/internal/template/container/style.d.ts.map +1 -0
- package/lib/internal/template/container/style.js +58 -0
- package/lib/internal/template/container/style.js.map +1 -0
- package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
- package/lib/internal/template/internal/environment.js +2 -2
- package/lib/internal/template/internal/environment.json +2 -2
- package/package.json +1 -1
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
@use '../internal/styles/tokens' as awsui;
|
|
8
8
|
@use '../internal/styles' as styles;
|
|
9
9
|
@use '@cloudscape-design/component-toolkit/internal/focus-visible' as focus-visible;
|
|
10
|
+
@use '../internal/generated/custom-css-properties/index.scss' as custom-props;
|
|
11
|
+
@use '../internal/styles/foundation' as foundation;
|
|
10
12
|
|
|
11
13
|
@use './motion';
|
|
12
14
|
|
|
@@ -34,6 +36,10 @@
|
|
|
34
36
|
padding-block: awsui.$space-alert-vertical;
|
|
35
37
|
padding-inline: awsui.$space-alert-horizontal;
|
|
36
38
|
background-color: awsui.$color-background-container-content;
|
|
39
|
+
|
|
40
|
+
#{custom-props.$styleFocusRingBoxShadow}: 0 0 0
|
|
41
|
+
var(#{custom-props.$styleFocusRingBorderWidth}, foundation.$box-shadow-focused-width)
|
|
42
|
+
var(#{custom-props.$styleFocusRingBorderColor}, awsui.$color-border-item-focused);
|
|
37
43
|
}
|
|
38
44
|
|
|
39
45
|
.alert-wrapper {
|
|
@@ -77,14 +83,18 @@
|
|
|
77
83
|
outline: none;
|
|
78
84
|
}
|
|
79
85
|
@include focus-visible.when-visible {
|
|
80
|
-
@include styles.focus-highlight(
|
|
86
|
+
@include styles.focus-highlight(
|
|
87
|
+
$gutter: awsui.$space-button-focus-outline-gutter,
|
|
88
|
+
$border-radius: var(#{custom-props.$styleFocusRingBorderRadius}, awsui.$border-radius-control-default-focus-ring),
|
|
89
|
+
$box-shadow: var(#{custom-props.$styleFocusRingBoxShadow})
|
|
90
|
+
);
|
|
81
91
|
}
|
|
82
92
|
}
|
|
83
93
|
|
|
84
94
|
.text {
|
|
85
95
|
min-inline-size: 0;
|
|
86
96
|
// To account for vertical misalignment due to button borders
|
|
87
|
-
padding-block: awsui.$border-width-
|
|
97
|
+
padding-block: awsui.$border-width-button;
|
|
88
98
|
padding-inline: 0;
|
|
89
99
|
margin-block: awsui.$space-scaled-xxs;
|
|
90
100
|
margin-inline: awsui.$space-xxs;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/alert/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAYzC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK1C,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,QAAA,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/alert/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAYzC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK1C,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,QAAA,MAAM,KAAK,mFAmGV,CAAC;AAGF,eAAe,KAAK,CAAC"}
|
|
@@ -14,7 +14,7 @@ import { applyDisplayName } from '../internal/utils/apply-display-name';
|
|
|
14
14
|
import InternalAlert from './internal';
|
|
15
15
|
import analyticsSelectors from './analytics-metadata/styles.css.js';
|
|
16
16
|
const Alert = React.forwardRef((_a, ref) => {
|
|
17
|
-
var { type = 'info', visible = true } = _a, props = __rest(_a, ["type", "visible"]);
|
|
17
|
+
var { type = 'info', visible = true, style } = _a, props = __rest(_a, ["type", "visible", "style"]);
|
|
18
18
|
const analyticsMetadata = getAnalyticsMetadataProps(props);
|
|
19
19
|
const baseComponentProps = useBaseComponent('Alert', {
|
|
20
20
|
props: { type, visible, dismissible: props.dismissible },
|
|
@@ -86,7 +86,7 @@ const Alert = React.forwardRef((_a, ref) => {
|
|
|
86
86
|
type,
|
|
87
87
|
},
|
|
88
88
|
};
|
|
89
|
-
return (React.createElement(InternalAlert, Object.assign({ type: type, visible: visible }, props, baseComponentProps, { ref: ref, messageSlotId: messageSlotId }, getAnalyticsMetadataAttribute({ component: componentAnalyticsMetadata }))));
|
|
89
|
+
return (React.createElement(InternalAlert, Object.assign({ type: type, visible: visible }, props, baseComponentProps, { ref: ref, messageSlotId: messageSlotId, style: style }, getAnalyticsMetadataAttribute({ component: componentAnalyticsMetadata }))));
|
|
90
90
|
});
|
|
91
91
|
applyDisplayName(Alert, 'Alert');
|
|
92
92
|
export default Alert;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/alert/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;;AACb,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC5E,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AACpG,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAC7F,OAAO,EAAkC,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvG,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAGxE,OAAO,aAAa,MAAM,YAAY,CAAC;AAEvC,OAAO,kBAAkB,MAAM,oCAAoC,CAAC;AAIpE,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAC5B,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/alert/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;;AACb,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC5E,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,EAAE,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wBACnE,iBAAiB,EAAE,GAAG,GAAG,aAAa;qBACvC,CAAC,CAAC;iBACJ;qBAAM;oBACL,aAAa,CAAC,WAAW,CAAC;wBACxB,gBAAgB;wBAChB,mBAAmB;wBACnB,YAAY,EAAE,iBAAiB,CAAC,YAAY,IAAI,kBAAkB;qBACnE,CAAC,CAAC;iBACJ;aACF;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,MAAM,0BAA0B,GAA6C;QAC3E,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,IAAI,kBAAkB,CAAC,MAAM,EAAE;QACtC,UAAU,EAAE;YACV,IAAI;SACL;KACF,CAAC;IAEF,OAAO,CACL,oBAAC,aAAa,kBACZ,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,IACZ,KAAK,EACL,kBAAkB,IACtB,GAAG,EAAE,GAAG,EACR,aAAa,EAAE,aAAa,EAC5B,KAAK,EAAE,KAAK,IACR,6BAA6B,CAAC,EAAE,SAAS,EAAE,0BAA0B,EAAE,CAAC,EAC5E,CACH,CAAC;AACJ,CAAC,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\n'use client';\nimport React, { useEffect } from 'react';\n\nimport { useUniqueId } from '@cloudscape-design/component-toolkit/internal';\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { FunnelMetrics } from '../internal/analytics';\nimport { useFunnel, useFunnelStep, useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';\nimport { getSubStepAllSelector, getTextFromSelector } from '../internal/analytics/selectors';\nimport { BasePropsWithAnalyticsMetadata, getAnalyticsMetadataProps } from '../internal/base-component';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { GeneratedAnalyticsMetadataAlertComponent } from './analytics-metadata/interfaces';\nimport { AlertProps } from './interfaces';\nimport InternalAlert from './internal';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\n\nexport { AlertProps };\n\nconst Alert = React.forwardRef(\n ({ type = 'info', visible = true, style, ...props }: AlertProps, ref: React.Ref<AlertProps.Ref>) => {\n const analyticsMetadata = getAnalyticsMetadataProps(props as BasePropsWithAnalyticsMetadata);\n const baseComponentProps = useBaseComponent<HTMLDivElement>(\n 'Alert',\n {\n props: { type, visible, dismissible: props.dismissible },\n },\n analyticsMetadata\n );\n\n const { funnelIdentifier, funnelInteractionId, funnelErrorContext, submissionAttempt, funnelState, errorCount } =\n useFunnel();\n const { stepNumber, stepNameSelector, stepIdentifier, subStepCount, stepErrorContext, subStepConfiguration } =\n useFunnelStep();\n const { subStepSelector, subStepNameSelector, subStepIdentifier, subStepErrorContext } = useFunnelSubStep();\n\n const messageSlotId = useUniqueId('alert-');\n\n useEffect(() => {\n if (funnelInteractionId && visible && type === 'error' && funnelState.current !== 'complete') {\n const stepName = getTextFromSelector(stepNameSelector);\n const subStepName = getTextFromSelector(subStepNameSelector);\n\n errorCount.current++;\n\n // We don't want to report an error if it is hidden, e.g. inside an Expandable Section.\n const errorIsVisible = (baseComponentProps.__internalRootRef.current?.getBoundingClientRect()?.width ?? 0) > 0;\n\n if (errorIsVisible) {\n if (subStepSelector) {\n FunnelMetrics.funnelSubStepError({\n funnelInteractionId,\n funnelIdentifier,\n stepIdentifier,\n subStepSelector,\n subStepName,\n subStepNameSelector,\n stepNumber,\n stepName,\n stepNameSelector,\n subStepAllSelector: getSubStepAllSelector(),\n subStepIdentifier,\n errorContext: analyticsMetadata.errorContext || subStepErrorContext,\n });\n } else if (stepNameSelector) {\n FunnelMetrics.funnelStepError({\n funnelInteractionId,\n stepNumber,\n stepNameSelector,\n stepName,\n stepIdentifier,\n currentDocument: baseComponentProps.__internalRootRef.current?.ownerDocument,\n totalSubSteps: subStepCount.current,\n funnelIdentifier,\n subStepAllSelector: getSubStepAllSelector(),\n errorContext: analyticsMetadata.errorContext || stepErrorContext,\n subStepConfiguration: subStepConfiguration.current?.get(stepNumber),\n stepErrorSelector: '#' + messageSlotId,\n });\n } else {\n FunnelMetrics.funnelError({\n funnelIdentifier,\n funnelInteractionId,\n errorContext: analyticsMetadata.errorContext || funnelErrorContext,\n });\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 const componentAnalyticsMetadata: GeneratedAnalyticsMetadataAlertComponent = {\n name: 'awsui.Alert',\n label: `.${analyticsSelectors.header}`,\n properties: {\n type,\n },\n };\n\n return (\n <InternalAlert\n type={type}\n visible={visible}\n {...props}\n {...baseComponentProps}\n ref={ref}\n messageSlotId={messageSlotId}\n style={style}\n {...getAnalyticsMetadataAttribute({ component: componentAnalyticsMetadata })}\n />\n );\n }\n);\n\napplyDisplayName(Alert, 'Alert');\nexport default Alert;\n"]}
|
|
@@ -20,6 +20,32 @@ export declare namespace AlertProps {
|
|
|
20
20
|
interface AnalyticsMetadata {
|
|
21
21
|
errorContext?: ErrorContext;
|
|
22
22
|
}
|
|
23
|
+
interface Style {
|
|
24
|
+
root?: {
|
|
25
|
+
background?: string;
|
|
26
|
+
borderColor?: string;
|
|
27
|
+
borderRadius?: string;
|
|
28
|
+
borderWidth?: string;
|
|
29
|
+
color?: string;
|
|
30
|
+
focusRing?: {
|
|
31
|
+
borderColor?: string;
|
|
32
|
+
borderRadius?: string;
|
|
33
|
+
borderWidth?: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
dismissButton?: {
|
|
37
|
+
color?: {
|
|
38
|
+
active?: string;
|
|
39
|
+
default?: string;
|
|
40
|
+
hover?: string;
|
|
41
|
+
};
|
|
42
|
+
focusRing?: {
|
|
43
|
+
borderColor?: string;
|
|
44
|
+
borderRadius?: string;
|
|
45
|
+
borderWidth?: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
}
|
|
23
49
|
}
|
|
24
50
|
export interface AlertProps extends BaseComponentProps {
|
|
25
51
|
/**
|
|
@@ -92,5 +118,25 @@ export interface AlertProps extends BaseComponentProps {
|
|
|
92
118
|
* @analytics
|
|
93
119
|
*/
|
|
94
120
|
analyticsMetadata?: AlertProps.AnalyticsMetadata;
|
|
121
|
+
/**
|
|
122
|
+
* Specifies an object of selectors and properties that are used to apply custom styles.
|
|
123
|
+
*
|
|
124
|
+
* - `root.background` - (string) (Optional) Background for alert.
|
|
125
|
+
* - `root.borderColor` - (string) (Optional) Border color for alert.
|
|
126
|
+
* - `root.borderRadius` (string) - (Optional) Alert border radius.
|
|
127
|
+
* - `root.borderWidth` (string) - (Optional) Alert border width.
|
|
128
|
+
* - `root.color` - (string) (Optional) Text color for alert.
|
|
129
|
+
* - `root.focusRing.borderColor` - (string) (Optional) Alert focus ring border color.
|
|
130
|
+
* - `root.focusRing.borderRadius` (string) - (Optional) Alert button focus ring border radius.
|
|
131
|
+
* - `root.focusRing.borderWidth` (string) - (Optional) Alert button focus ring border width.
|
|
132
|
+
* - `dismissButton.color.active` - (string) (Optional) Color for dismiss button active state.
|
|
133
|
+
* - `dismissButton.color.default` - (string) (Optional) Color for dismiss button default state.
|
|
134
|
+
* - `dismissButton.color.hover` - (string) (Optional) Color for dismiss button hover state.
|
|
135
|
+
* - `dismissButton.focusRing.borderColor` - (string) (Optional) Dismiss button focus ring border color.
|
|
136
|
+
* - `dismissButton.focusRing.borderRadius` (string) - (Optional) Dismiss button focus ring border radius.
|
|
137
|
+
* - `dismissButton.focusRing.borderWidth` (string) - (Optional) Dismiss button focus ring border width.
|
|
138
|
+
* @awsuiSystem core
|
|
139
|
+
*/
|
|
140
|
+
style?: AlertProps.Style;
|
|
95
141
|
}
|
|
96
142
|
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/alert/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,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;IAED,UAAiB,WAAW;QAK1B,oBAAoB,CAAC,EAAE,MAAM,CAAC;QAK9B,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAK5B,oBAAoB,CAAC,EAAE,MAAM,CAAC;QAK9B,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAK3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;KAC3B;IAED,UAAiB,iBAAiB;QAChC,YAAY,CAAC,EAAE,YAAY,CAAC;KAC7B;CACF;AAED,MAAM,WAAW,UAAW,SAAQ,kBAAkB;IACpD;;OAEG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC,IAAI,CAAC;IAEvB;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,QAAQ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C;IACzB;;;OAGG;IACH,SAAS,CAAC,EAAE,yBAAyB,CAAC;IACtC;;;OAGG;IACH,aAAa,CAAC,EAAE,yBAAyB,CAAC;IAC1C;;;;OAIG;IACH,WAAW,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC;IACrC;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC;IACjD;;;;;;;;;;;;;;;;;;OAkBG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC;CAC1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/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';\n\nimport { ErrorContext } from '../internal/analytics/interfaces';\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 export interface I18nStrings {\n /*\n * Specifies the ARIA label for the alert icon for type `success`.\n * @property {string} [successIconAriaLabel] - optional\n */\n successIconAriaLabel?: string;\n /*\n * Specifies the ARIA label for the alert icon for type `error`.\n * @property {string} [errorIconAriaLabel] - optional\n */\n errorIconAriaLabel?: string;\n /*\n * Specifies the ARIA label for the alert icon for type `warning`.\n * @property {string} [warningIconAriaLabel] - optional\n */\n warningIconAriaLabel?: string;\n /*\n * Specifies the ARIA label for the alert icon for type `info`.\n * @property {string} [infoIconAriaLabel] - optional\n */\n infoIconAriaLabel?: string;\n /*\n * Specifies the ARIA label for the dismiss button.\n * @property {string} [dismissAriaLabel] - optional\n */\n dismissAriaLabel?: string;\n }\n\n export interface AnalyticsMetadata {\n errorContext?: ErrorContext;\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 * @deprecated Use the label properties inside `i18nStrings` instead.\n * If the label is assigned via the `i18nStrings` property, this label will be ignored.\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 * @deprecated Use `i18nStrings.dismissAriaLabel` instead.\n * If the label is assigned via the `i18nStrings` property, this label will be ignored.\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 * An object containing all the necessary localized strings required by the component.\n * @property {AlertProps.I18nStrings} [i18nStrings] - optional\n * @i18n\n */\n i18nStrings?: AlertProps.I18nStrings;\n /**\n * Specifies additional analytics-related metadata.\n * * `errorContext` - Identifies the error category and sub-category.\n * @analytics\n */\n analyticsMetadata?: AlertProps.AnalyticsMetadata;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/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';\n\nimport { ErrorContext } from '../internal/analytics/interfaces';\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 export interface I18nStrings {\n /*\n * Specifies the ARIA label for the alert icon for type `success`.\n * @property {string} [successIconAriaLabel] - optional\n */\n successIconAriaLabel?: string;\n /*\n * Specifies the ARIA label for the alert icon for type `error`.\n * @property {string} [errorIconAriaLabel] - optional\n */\n errorIconAriaLabel?: string;\n /*\n * Specifies the ARIA label for the alert icon for type `warning`.\n * @property {string} [warningIconAriaLabel] - optional\n */\n warningIconAriaLabel?: string;\n /*\n * Specifies the ARIA label for the alert icon for type `info`.\n * @property {string} [infoIconAriaLabel] - optional\n */\n infoIconAriaLabel?: string;\n /*\n * Specifies the ARIA label for the dismiss button.\n * @property {string} [dismissAriaLabel] - optional\n */\n dismissAriaLabel?: string;\n }\n\n export interface AnalyticsMetadata {\n errorContext?: ErrorContext;\n }\n\n export interface Style {\n root?: {\n background?: string;\n borderColor?: string;\n borderRadius?: string;\n borderWidth?: string;\n color?: string;\n focusRing?: {\n borderColor?: string;\n borderRadius?: string;\n borderWidth?: string;\n };\n };\n dismissButton?: {\n color?: {\n active?: string;\n default?: string;\n hover?: string;\n };\n focusRing?: {\n borderColor?: string;\n borderRadius?: string;\n borderWidth?: string;\n };\n };\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 * @deprecated Use the label properties inside `i18nStrings` instead.\n * If the label is assigned via the `i18nStrings` property, this label will be ignored.\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 * @deprecated Use `i18nStrings.dismissAriaLabel` instead.\n * If the label is assigned via the `i18nStrings` property, this label will be ignored.\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 * An object containing all the necessary localized strings required by the component.\n * @property {AlertProps.I18nStrings} [i18nStrings] - optional\n * @i18n\n */\n i18nStrings?: AlertProps.I18nStrings;\n /**\n * Specifies additional analytics-related metadata.\n * * `errorContext` - Identifies the error category and sub-category.\n * @analytics\n */\n analyticsMetadata?: AlertProps.AnalyticsMetadata;\n /**\n * Specifies an object of selectors and properties that are used to apply custom styles.\n *\n * - `root.background` - (string) (Optional) Background for alert.\n * - `root.borderColor` - (string) (Optional) Border color for alert.\n * - `root.borderRadius` (string) - (Optional) Alert border radius.\n * - `root.borderWidth` (string) - (Optional) Alert border width.\n * - `root.color` - (string) (Optional) Text color for alert.\n * - `root.focusRing.borderColor` - (string) (Optional) Alert focus ring border color.\n * - `root.focusRing.borderRadius` (string) - (Optional) Alert button focus ring border radius.\n * - `root.focusRing.borderWidth` (string) - (Optional) Alert button focus ring border width.\n * - `dismissButton.color.active` - (string) (Optional) Color for dismiss button active state.\n * - `dismissButton.color.default` - (string) (Optional) Color for dismiss button default state.\n * - `dismissButton.color.hover` - (string) (Optional) Color for dismiss button hover state.\n * - `dismissButton.focusRing.borderColor` - (string) (Optional) Dismiss button focus ring border color.\n * - `dismissButton.focusRing.borderRadius` (string) - (Optional) Dismiss button focus ring border radius.\n * - `dismissButton.focusRing.borderWidth` (string) - (Optional) Dismiss button focus ring border width.\n * @awsuiSystem core\n */\n style?: AlertProps.Style;\n}\n"]}
|
|
@@ -5,6 +5,7 @@ declare const InternalAlert: React.ForwardRefExoticComponent<AlertProps & {
|
|
|
5
5
|
type: AlertProps.Type;
|
|
6
6
|
} & InternalBaseComponentProps<HTMLDivElement> & {
|
|
7
7
|
messageSlotId?: string | undefined;
|
|
8
|
+
style?: AlertProps['style'];
|
|
8
9
|
} & React.RefAttributes<AlertProps.Ref>>;
|
|
9
10
|
export default InternalAlert;
|
|
10
11
|
//# sourceMappingURL=internal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/alert/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAgBtC,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAQlF,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/alert/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAgBtC,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAQlF,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAsB1C,QAAA,MAAM,aAAa;;;;YANP,UAAU,CAAC,OAAO,CAAC;wCA4K9B,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -19,6 +19,7 @@ import { awsuiPluginsInternal } from '../internal/plugins/api';
|
|
|
19
19
|
import { createUseDiscoveredAction, createUseDiscoveredContent } from '../internal/plugins/helpers';
|
|
20
20
|
import useContainerWidth from '../internal/utils/use-container-width';
|
|
21
21
|
import { ActionsWrapper } from './actions-wrapper';
|
|
22
|
+
import { getAlertStyles, getDismissButtonStyles } from './style';
|
|
22
23
|
import analyticsSelectors from './analytics-metadata/styles.css.js';
|
|
23
24
|
import styles from './styles.css.js';
|
|
24
25
|
const typeToIcon = {
|
|
@@ -31,7 +32,7 @@ const useDiscoveredAction = createUseDiscoveredAction(awsuiPluginsInternal.alert
|
|
|
31
32
|
const useDiscoveredContent = createUseDiscoveredContent('alert', awsuiPluginsInternal.alertContent);
|
|
32
33
|
const InternalAlert = React.forwardRef((_a, ref) => {
|
|
33
34
|
var _b, _c;
|
|
34
|
-
var { type, i18nStrings, visible = true, dismissible, children, header, buttonText, action, onDismiss, onButtonClick, __internalRootRef = null, statusIconAriaLabel: deprecatedStatusIconAriaLabel, dismissAriaLabel: deprecatedDismissAriaLabel, messageSlotId } = _a, rest = __rest(_a, ["type", "i18nStrings", "visible", "dismissible", "children", "header", "buttonText", "action", "onDismiss", "onButtonClick", "__internalRootRef", "statusIconAriaLabel", "dismissAriaLabel", "messageSlotId"]);
|
|
35
|
+
var { type, i18nStrings, visible = true, dismissible, children, header, buttonText, action, onDismiss, onButtonClick, __internalRootRef = null, statusIconAriaLabel: deprecatedStatusIconAriaLabel, dismissAriaLabel: deprecatedDismissAriaLabel, messageSlotId, style } = _a, rest = __rest(_a, ["type", "i18nStrings", "visible", "dismissible", "children", "header", "buttonText", "action", "onDismiss", "onButtonClick", "__internalRootRef", "statusIconAriaLabel", "dismissAriaLabel", "messageSlotId", "style"]);
|
|
35
36
|
const baseProps = getBaseProps(rest);
|
|
36
37
|
const i18n = useInternalI18n('alert');
|
|
37
38
|
const focusRef = useRef(null);
|
|
@@ -57,7 +58,7 @@ const InternalAlert = React.forwardRef((_a, ref) => {
|
|
|
57
58
|
return (React.createElement("div", Object.assign({}, baseProps, analyticsAttributes, { "aria-hidden": !visible, className: clsx(styles.root, { [styles.hidden]: !visible, [styles['initial-hidden']]: initialHidden }, baseProps.className), ref: containerRef }),
|
|
58
59
|
React.createElement(LinkDefaultVariantContext.Provider, { value: { defaultVariant: 'primary' } },
|
|
59
60
|
React.createElement(VisualContext, { contextName: "alert" },
|
|
60
|
-
React.createElement("div", { className: clsx(styles.alert, styles[`type-${type}`], styles[`icon-size-${size}`], hasAction && styles['with-action'], dismissible && styles['with-dismiss']) },
|
|
61
|
+
React.createElement("div", { className: clsx(styles.alert, styles[`type-${type}`], styles[`icon-size-${size}`], hasAction && styles['with-action'], dismissible && styles['with-dismiss']), style: getAlertStyles(style) },
|
|
61
62
|
React.createElement("div", { className: styles['alert-wrapper'] },
|
|
62
63
|
React.createElement("div", { className: styles['alert-focus-wrapper'], tabIndex: -1, ref: focusRef, role: "group" },
|
|
63
64
|
React.createElement("div", { className: clsx(styles.icon, styles.text) },
|
|
@@ -74,7 +75,7 @@ const InternalAlert = React.forwardRef((_a, ref) => {
|
|
|
74
75
|
dismissible && (React.createElement("div", Object.assign({ className: styles.dismiss }, getAnalyticsMetadataAttribute({
|
|
75
76
|
action: 'dismiss',
|
|
76
77
|
})),
|
|
77
|
-
React.createElement(InternalButton, { className: styles['dismiss-button'], variant: "icon", iconName: "close", formAction: "none", ariaLabel: dismissAriaLabel, onClick: () => fireNonCancelableEvent(onDismiss) }))))))));
|
|
78
|
+
React.createElement(InternalButton, { className: styles['dismiss-button'], variant: "icon", iconName: "close", formAction: "none", ariaLabel: dismissAriaLabel, onClick: () => fireNonCancelableEvent(onDismiss), style: getDismissButtonStyles(style) }))))))));
|
|
78
79
|
});
|
|
79
80
|
export default InternalAlert;
|
|
80
81
|
//# sourceMappingURL=internal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/alert/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;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M,CAAC,qBAAqB,CAAC,EAC7B,sBAAsB,KAAK,UAAU,IAAI,MAAM,CAAC,MAAM,CACvD,EACD,GAAG,EAAE,qBAAqB,GACrB,CACH,CACF;wBACN,oBAAC,cAAc,IACb,SAAS,EAAE,MAAM,CAAC,MAAM,EACxB,eAAe,EAAE;gCACf,UAAU,EAAE,MAAM,CAAC,aAAa,CAAC;gCACjC,YAAY,EAAE,MAAM,CAAC,eAAe,CAAC;6BACtC,EACD,MAAM,EAAE,MAAM,EACd,iBAAiB,EAAE,iBAAiB,EACpC,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,GAAG,EAAE,CAAC,sBAAsB,CAAC,aAAa,CAAC,EAC1D,cAAc,EAAE,cAAc,EAC9B,YAAY,EAAE,MAAM,CAAC,gBAAgB,CAAC,GACtC,CACE;oBACL,WAAW,IAAI,CACd,2CACE,SAAS,EAAE,MAAM,CAAC,OAAO,IACrB,6BAA6B,CAAC;wBAChC,MAAM,EAAE,SAAS;qBACiC,CAAC;wBAErD,oBAAC,cAAc,IACb,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,EACnC,OAAO,EAAC,MAAM,EACd,QAAQ,EAAC,OAAO,EAChB,UAAU,EAAC,MAAM,EACjB,SAAS,EAAE,gBAAgB,EAC3B,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';\n\nimport { useMergeRefs } from '@cloudscape-design/component-toolkit/internal';\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { InternalButton } from '../button/internal';\nimport { useInternalI18n } from '../i18n/context';\nimport { IconProps } from '../icon/interfaces';\nimport InternalIcon from '../icon/internal';\nimport { DATA_ATTR_ANALYTICS_ALERT } from '../internal/analytics/selectors';\nimport { getBaseProps } from '../internal/base-component';\nimport VisualContext from '../internal/components/visual-context';\nimport { LinkDefaultVariantContext } from '../internal/context/link-default-variant-context';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { awsuiPluginsInternal } from '../internal/plugins/api';\nimport { createUseDiscoveredAction, createUseDiscoveredContent } from '../internal/plugins/helpers';\nimport { SomeRequired } from '../internal/types';\nimport useContainerWidth from '../internal/utils/use-container-width';\nimport { ActionsWrapper } from './actions-wrapper';\nimport { GeneratedAnalyticsMetadataAlertDismiss } from './analytics-metadata/interfaces';\nimport { AlertProps } from './interfaces';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\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'> &\n InternalBaseComponentProps<HTMLDivElement> & {\n messageSlotId?: string;\n };\n\nconst useDiscoveredAction = createUseDiscoveredAction(awsuiPluginsInternal.alert.onActionRegistered);\nconst useDiscoveredContent = createUseDiscoveredContent('alert', awsuiPluginsInternal.alertContent);\n\nconst InternalAlert = React.forwardRef(\n (\n {\n type,\n i18nStrings,\n visible = true,\n dismissible,\n children,\n header,\n buttonText,\n action,\n onDismiss,\n onButtonClick,\n __internalRootRef = null,\n statusIconAriaLabel: deprecatedStatusIconAriaLabel,\n dismissAriaLabel: deprecatedDismissAriaLabel,\n messageSlotId,\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 { discoveredActions, headerRef: headerRefAction, contentRef: contentRefAction } = useDiscoveredAction(type);\n const {\n initialHidden,\n headerReplacementType,\n contentReplacementType,\n headerRef: headerRefContent,\n contentRef: contentRefContent,\n replacementHeaderRef,\n replacementContentRef,\n } = useDiscoveredContent({ type, header, children });\n\n const [containerWidth, containerMeasureRef] = useContainerWidth();\n const containerRef = useMergeRefs(containerMeasureRef, __internalRootRef);\n const headerRef = useMergeRefs(headerRefAction, headerRefContent);\n const contentRef = useMergeRefs(contentRefAction, contentRefContent);\n\n const isRefresh = useVisualRefresh();\n const size = isRefresh\n ? 'normal'\n : headerReplacementType !== 'remove' && header && contentReplacementType !== 'remove' && children\n ? 'big'\n : 'normal';\n\n const hasAction = Boolean(action || buttonText || discoveredActions.length);\n\n const analyticsAttributes = {\n [DATA_ATTR_ANALYTICS_ALERT]: type,\n };\n\n const statusIconAriaLabel = i18n(\n `i18nStrings.${type}IconAriaLabel`,\n i18nStrings?.[`${type}IconAriaLabel`] ?? deprecatedStatusIconAriaLabel\n );\n\n const dismissAriaLabel = i18n(\n 'i18nStrings.dismissAriaLabel',\n i18nStrings?.dismissAriaLabel ?? i18n('dismissAriaLabel', deprecatedDismissAriaLabel)\n );\n\n return (\n <div\n {...baseProps}\n {...analyticsAttributes}\n aria-hidden={!visible}\n className={clsx(\n styles.root,\n { [styles.hidden]: !visible, [styles['initial-hidden']]: initialHidden },\n baseProps.className\n )}\n ref={containerRef}\n >\n <LinkDefaultVariantContext.Provider value={{ defaultVariant: 'primary' }}>\n <VisualContext contextName=\"alert\">\n <div\n className={clsx(\n styles.alert,\n styles[`type-${type}`],\n styles[`icon-size-${size}`],\n hasAction && styles['with-action'],\n dismissible && styles['with-dismiss']\n )}\n >\n <div className={styles['alert-wrapper']}>\n <div className={styles['alert-focus-wrapper']} tabIndex={-1} ref={focusRef} role=\"group\">\n <div className={clsx(styles.icon, styles.text)}>\n <InternalIcon name={typeToIcon[type]} size={size} ariaLabel={statusIconAriaLabel} />\n </div>\n <div className={clsx(styles.message, styles.text)} id={messageSlotId}>\n <div\n className={clsx(\n header && styles.header,\n headerReplacementType !== 'original' ? styles.hidden : analyticsSelectors.header\n )}\n ref={headerRef}\n >\n {header}\n </div>\n <div\n className={clsx(\n styles['header-replacement'],\n headerReplacementType !== 'replaced' ? styles.hidden : analyticsSelectors.header\n )}\n ref={replacementHeaderRef}\n ></div>\n <div\n className={clsx(styles.content, contentReplacementType !== 'original' && styles.hidden)}\n ref={contentRef}\n >\n {children}\n </div>\n <div\n className={clsx(\n styles['content-replacement'],\n contentReplacementType !== 'replaced' && styles.hidden\n )}\n ref={replacementContentRef}\n ></div>\n </div>\n </div>\n <ActionsWrapper\n className={styles.action}\n testUtilClasses={{\n actionSlot: styles['action-slot'],\n actionButton: styles['action-button'],\n }}\n action={action}\n discoveredActions={discoveredActions}\n buttonText={buttonText}\n onButtonClick={() => fireNonCancelableEvent(onButtonClick)}\n containerWidth={containerWidth}\n wrappedClass={styles['action-wrapped']}\n />\n </div>\n {dismissible && (\n <div\n className={styles.dismiss}\n {...getAnalyticsMetadataAttribute({\n action: 'dismiss',\n } as Partial<GeneratedAnalyticsMetadataAlertDismiss>)}\n >\n <InternalButton\n className={styles['dismiss-button']}\n variant=\"icon\"\n iconName=\"close\"\n formAction=\"none\"\n ariaLabel={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
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/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;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,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AQ,CACL;gCACN,6BACE,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,qBAAqB,CAAC,EAC7B,sBAAsB,KAAK,UAAU,IAAI,MAAM,CAAC,MAAM,CACvD,EACD,GAAG,EAAE,qBAAqB,GACrB,CACH,CACF;wBACN,oBAAC,cAAc,IACb,SAAS,EAAE,MAAM,CAAC,MAAM,EACxB,eAAe,EAAE;gCACf,UAAU,EAAE,MAAM,CAAC,aAAa,CAAC;gCACjC,YAAY,EAAE,MAAM,CAAC,eAAe,CAAC;6BACtC,EACD,MAAM,EAAE,MAAM,EACd,iBAAiB,EAAE,iBAAiB,EACpC,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,GAAG,EAAE,CAAC,sBAAsB,CAAC,aAAa,CAAC,EAC1D,cAAc,EAAE,cAAc,EAC9B,YAAY,EAAE,MAAM,CAAC,gBAAgB,CAAC,GACtC,CACE;oBACL,WAAW,IAAI,CACd,2CACE,SAAS,EAAE,MAAM,CAAC,OAAO,IACrB,6BAA6B,CAAC;wBAChC,MAAM,EAAE,SAAS;qBACiC,CAAC;wBAErD,oBAAC,cAAc,IACb,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,EACnC,OAAO,EAAC,MAAM,EACd,QAAQ,EAAC,OAAO,EAChB,UAAU,EAAC,MAAM,EACjB,SAAS,EAAE,gBAAgB,EAC3B,OAAO,EAAE,GAAG,EAAE,CAAC,sBAAsB,CAAC,SAAS,CAAC,EAChD,KAAK,EAAE,sBAAsB,CAAC,KAAK,CAAC,GACpC,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';\n\nimport { useMergeRefs } from '@cloudscape-design/component-toolkit/internal';\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { InternalButton } from '../button/internal';\nimport { useInternalI18n } from '../i18n/context';\nimport { IconProps } from '../icon/interfaces';\nimport InternalIcon from '../icon/internal';\nimport { DATA_ATTR_ANALYTICS_ALERT } from '../internal/analytics/selectors';\nimport { getBaseProps } from '../internal/base-component';\nimport VisualContext from '../internal/components/visual-context';\nimport { LinkDefaultVariantContext } from '../internal/context/link-default-variant-context';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { awsuiPluginsInternal } from '../internal/plugins/api';\nimport { createUseDiscoveredAction, createUseDiscoveredContent } from '../internal/plugins/helpers';\nimport { SomeRequired } from '../internal/types';\nimport useContainerWidth from '../internal/utils/use-container-width';\nimport { ActionsWrapper } from './actions-wrapper';\nimport { GeneratedAnalyticsMetadataAlertDismiss } from './analytics-metadata/interfaces';\nimport { AlertProps } from './interfaces';\nimport { getAlertStyles, getDismissButtonStyles } from './style';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\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'> &\n InternalBaseComponentProps<HTMLDivElement> & {\n messageSlotId?: string;\n style?: AlertProps['style'];\n };\n\nconst useDiscoveredAction = createUseDiscoveredAction(awsuiPluginsInternal.alert.onActionRegistered);\nconst useDiscoveredContent = createUseDiscoveredContent('alert', awsuiPluginsInternal.alertContent);\n\nconst InternalAlert = React.forwardRef(\n (\n {\n type,\n i18nStrings,\n visible = true,\n dismissible,\n children,\n header,\n buttonText,\n action,\n onDismiss,\n onButtonClick,\n __internalRootRef = null,\n statusIconAriaLabel: deprecatedStatusIconAriaLabel,\n dismissAriaLabel: deprecatedDismissAriaLabel,\n messageSlotId,\n style,\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 { discoveredActions, headerRef: headerRefAction, contentRef: contentRefAction } = useDiscoveredAction(type);\n const {\n initialHidden,\n headerReplacementType,\n contentReplacementType,\n headerRef: headerRefContent,\n contentRef: contentRefContent,\n replacementHeaderRef,\n replacementContentRef,\n } = useDiscoveredContent({ type, header, children });\n\n const [containerWidth, containerMeasureRef] = useContainerWidth();\n const containerRef = useMergeRefs(containerMeasureRef, __internalRootRef);\n const headerRef = useMergeRefs(headerRefAction, headerRefContent);\n const contentRef = useMergeRefs(contentRefAction, contentRefContent);\n\n const isRefresh = useVisualRefresh();\n const size = isRefresh\n ? 'normal'\n : headerReplacementType !== 'remove' && header && contentReplacementType !== 'remove' && children\n ? 'big'\n : 'normal';\n\n const hasAction = Boolean(action || buttonText || discoveredActions.length);\n\n const analyticsAttributes = {\n [DATA_ATTR_ANALYTICS_ALERT]: type,\n };\n\n const statusIconAriaLabel = i18n(\n `i18nStrings.${type}IconAriaLabel`,\n i18nStrings?.[`${type}IconAriaLabel`] ?? deprecatedStatusIconAriaLabel\n );\n\n const dismissAriaLabel = i18n(\n 'i18nStrings.dismissAriaLabel',\n i18nStrings?.dismissAriaLabel ?? i18n('dismissAriaLabel', deprecatedDismissAriaLabel)\n );\n\n return (\n <div\n {...baseProps}\n {...analyticsAttributes}\n aria-hidden={!visible}\n className={clsx(\n styles.root,\n { [styles.hidden]: !visible, [styles['initial-hidden']]: initialHidden },\n baseProps.className\n )}\n ref={containerRef}\n >\n <LinkDefaultVariantContext.Provider value={{ defaultVariant: 'primary' }}>\n <VisualContext contextName=\"alert\">\n <div\n className={clsx(\n styles.alert,\n styles[`type-${type}`],\n styles[`icon-size-${size}`],\n hasAction && styles['with-action'],\n dismissible && styles['with-dismiss']\n )}\n style={getAlertStyles(style)}\n >\n <div className={styles['alert-wrapper']}>\n <div className={styles['alert-focus-wrapper']} tabIndex={-1} ref={focusRef} role=\"group\">\n <div className={clsx(styles.icon, styles.text)}>\n <InternalIcon name={typeToIcon[type]} size={size} ariaLabel={statusIconAriaLabel} />\n </div>\n <div className={clsx(styles.message, styles.text)} id={messageSlotId}>\n <div\n className={clsx(\n header && styles.header,\n headerReplacementType !== 'original' ? styles.hidden : analyticsSelectors.header\n )}\n ref={headerRef}\n >\n {header}\n </div>\n <div\n className={clsx(\n styles['header-replacement'],\n headerReplacementType !== 'replaced' ? styles.hidden : analyticsSelectors.header\n )}\n ref={replacementHeaderRef}\n ></div>\n <div\n className={clsx(styles.content, contentReplacementType !== 'original' && styles.hidden)}\n ref={contentRef}\n >\n {children}\n </div>\n <div\n className={clsx(\n styles['content-replacement'],\n contentReplacementType !== 'replaced' && styles.hidden\n )}\n ref={replacementContentRef}\n ></div>\n </div>\n </div>\n <ActionsWrapper\n className={styles.action}\n testUtilClasses={{\n actionSlot: styles['action-slot'],\n actionButton: styles['action-button'],\n }}\n action={action}\n discoveredActions={discoveredActions}\n buttonText={buttonText}\n onButtonClick={() => fireNonCancelableEvent(onButtonClick)}\n containerWidth={containerWidth}\n wrappedClass={styles['action-wrapped']}\n />\n </div>\n {dismissible && (\n <div\n className={styles.dismiss}\n {...getAnalyticsMetadataAttribute({\n action: 'dismiss',\n } as Partial<GeneratedAnalyticsMetadataAlertDismiss>)}\n >\n <InternalButton\n className={styles['dismiss-button']}\n variant=\"icon\"\n iconName=\"close\"\n formAction=\"none\"\n ariaLabel={dismissAriaLabel}\n onClick={() => fireNonCancelableEvent(onDismiss)}\n style={getDismissButtonStyles(style)}\n />\n </div>\n )}\n </div>\n </VisualContext>\n </LinkDefaultVariantContext.Provider>\n </div>\n );\n }\n);\n\nexport default InternalAlert;\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { AlertProps } from './interfaces';
|
|
2
|
+
export declare function getAlertStyles(style: AlertProps['style']): {
|
|
3
|
+
background: string | undefined;
|
|
4
|
+
borderColor: string | undefined;
|
|
5
|
+
borderRadius: string | undefined;
|
|
6
|
+
borderWidth: string | undefined;
|
|
7
|
+
color: string | undefined;
|
|
8
|
+
} | undefined;
|
|
9
|
+
export declare function getDismissButtonStyles(style: AlertProps['style']): {
|
|
10
|
+
root: {
|
|
11
|
+
color: {
|
|
12
|
+
active: string | undefined;
|
|
13
|
+
default: string | undefined;
|
|
14
|
+
hover: string | undefined;
|
|
15
|
+
};
|
|
16
|
+
focusRing: {
|
|
17
|
+
borderColor: string | undefined;
|
|
18
|
+
borderRadius: string | undefined;
|
|
19
|
+
borderWidth: string | undefined;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
} | undefined;
|
|
23
|
+
//# sourceMappingURL=style.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../src/alert/style.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC;;;;;;cAiBxD;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC;;;;;;;;;;;;;cAmBhE"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { SYSTEM } from '../internal/environment';
|
|
4
|
+
import customCssProps from '../internal/generated/custom-css-properties';
|
|
5
|
+
export function getAlertStyles(style) {
|
|
6
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
7
|
+
if (SYSTEM !== 'core' || !(style === null || style === void 0 ? void 0 : style.root)) {
|
|
8
|
+
return undefined;
|
|
9
|
+
}
|
|
10
|
+
return Object.assign({ background: (_a = style.root) === null || _a === void 0 ? void 0 : _a.background, borderColor: (_b = style.root) === null || _b === void 0 ? void 0 : _b.borderColor, borderRadius: (_c = style.root) === null || _c === void 0 ? void 0 : _c.borderRadius, borderWidth: (_d = style.root) === null || _d === void 0 ? void 0 : _d.borderWidth, color: (_e = style.root) === null || _e === void 0 ? void 0 : _e.color }, (((_f = style.root) === null || _f === void 0 ? void 0 : _f.focusRing) && {
|
|
11
|
+
[customCssProps.styleFocusRingBorderColor]: (_g = style.root.focusRing) === null || _g === void 0 ? void 0 : _g.borderColor,
|
|
12
|
+
[customCssProps.styleFocusRingBorderRadius]: (_h = style.root.focusRing) === null || _h === void 0 ? void 0 : _h.borderRadius,
|
|
13
|
+
[customCssProps.styleFocusRingBorderWidth]: (_j = style.root.focusRing) === null || _j === void 0 ? void 0 : _j.borderWidth,
|
|
14
|
+
}));
|
|
15
|
+
}
|
|
16
|
+
export function getDismissButtonStyles(style) {
|
|
17
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
18
|
+
if (SYSTEM !== 'core' || !(style === null || style === void 0 ? void 0 : style.dismissButton)) {
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
root: {
|
|
23
|
+
color: {
|
|
24
|
+
active: (_b = (_a = style.dismissButton) === null || _a === void 0 ? void 0 : _a.color) === null || _b === void 0 ? void 0 : _b.active,
|
|
25
|
+
default: (_d = (_c = style.dismissButton) === null || _c === void 0 ? void 0 : _c.color) === null || _d === void 0 ? void 0 : _d.default,
|
|
26
|
+
hover: (_f = (_e = style.dismissButton) === null || _e === void 0 ? void 0 : _e.color) === null || _f === void 0 ? void 0 : _f.hover,
|
|
27
|
+
},
|
|
28
|
+
focusRing: {
|
|
29
|
+
borderColor: (_h = (_g = style.dismissButton) === null || _g === void 0 ? void 0 : _g.focusRing) === null || _h === void 0 ? void 0 : _h.borderColor,
|
|
30
|
+
borderRadius: (_k = (_j = style.dismissButton) === null || _j === void 0 ? void 0 : _j.focusRing) === null || _k === void 0 ? void 0 : _k.borderRadius,
|
|
31
|
+
borderWidth: (_m = (_l = style.dismissButton) === null || _l === void 0 ? void 0 : _l.focusRing) === null || _m === void 0 ? void 0 : _m.borderWidth,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.js","sourceRoot":"","sources":["../../../src/alert/style.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,cAAc,MAAM,6CAA6C,CAAC;AAGzE,MAAM,UAAU,cAAc,CAAC,KAA0B;;IACvD,IAAI,MAAM,KAAK,MAAM,IAAI,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,CAAA,EAAE;QACrC,OAAO,SAAS,CAAC;KAClB;IAED,uBACE,UAAU,EAAE,MAAA,KAAK,CAAC,IAAI,0CAAE,UAAU,EAClC,WAAW,EAAE,MAAA,KAAK,CAAC,IAAI,0CAAE,WAAW,EACpC,YAAY,EAAE,MAAA,KAAK,CAAC,IAAI,0CAAE,YAAY,EACtC,WAAW,EAAE,MAAA,KAAK,CAAC,IAAI,0CAAE,WAAW,EACpC,KAAK,EAAE,MAAA,KAAK,CAAC,IAAI,0CAAE,KAAK,IACrB,CAAC,CAAA,MAAA,KAAK,CAAC,IAAI,0CAAE,SAAS,KAAI;QAC3B,CAAC,cAAc,CAAC,yBAAyB,CAAC,EAAE,MAAA,KAAK,CAAC,IAAI,CAAC,SAAS,0CAAE,WAAW;QAC7E,CAAC,cAAc,CAAC,0BAA0B,CAAC,EAAE,MAAA,KAAK,CAAC,IAAI,CAAC,SAAS,0CAAE,YAAY;QAC/E,CAAC,cAAc,CAAC,yBAAyB,CAAC,EAAE,MAAA,KAAK,CAAC,IAAI,CAAC,SAAS,0CAAE,WAAW;KAC9E,CAAC,EACF;AACJ,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,KAA0B;;IAC/D,IAAI,MAAM,KAAK,MAAM,IAAI,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,aAAa,CAAA,EAAE;QAC9C,OAAO,SAAS,CAAC;KAClB;IAED,OAAO;QACL,IAAI,EAAE;YACJ,KAAK,EAAE;gBACL,MAAM,EAAE,MAAA,MAAA,KAAK,CAAC,aAAa,0CAAE,KAAK,0CAAE,MAAM;gBAC1C,OAAO,EAAE,MAAA,MAAA,KAAK,CAAC,aAAa,0CAAE,KAAK,0CAAE,OAAO;gBAC5C,KAAK,EAAE,MAAA,MAAA,KAAK,CAAC,aAAa,0CAAE,KAAK,0CAAE,KAAK;aACzC;YACD,SAAS,EAAE;gBACT,WAAW,EAAE,MAAA,MAAA,KAAK,CAAC,aAAa,0CAAE,SAAS,0CAAE,WAAW;gBACxD,YAAY,EAAE,MAAA,MAAA,KAAK,CAAC,aAAa,0CAAE,SAAS,0CAAE,YAAY;gBAC1D,WAAW,EAAE,MAAA,MAAA,KAAK,CAAC,aAAa,0CAAE,SAAS,0CAAE,WAAW;aACzD;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { SYSTEM } from '../internal/environment';\nimport customCssProps from '../internal/generated/custom-css-properties';\nimport { AlertProps } from './interfaces';\n\nexport function getAlertStyles(style: AlertProps['style']) {\n if (SYSTEM !== 'core' || !style?.root) {\n return undefined;\n }\n\n return {\n background: style.root?.background,\n borderColor: style.root?.borderColor,\n borderRadius: style.root?.borderRadius,\n borderWidth: style.root?.borderWidth,\n color: style.root?.color,\n ...(style.root?.focusRing && {\n [customCssProps.styleFocusRingBorderColor]: style.root.focusRing?.borderColor,\n [customCssProps.styleFocusRingBorderRadius]: style.root.focusRing?.borderRadius,\n [customCssProps.styleFocusRingBorderWidth]: style.root.focusRing?.borderWidth,\n }),\n };\n}\n\nexport function getDismissButtonStyles(style: AlertProps['style']) {\n if (SYSTEM !== 'core' || !style?.dismissButton) {\n return undefined;\n }\n\n return {\n root: {\n color: {\n active: style.dismissButton?.color?.active,\n default: style.dismissButton?.color?.default,\n hover: style.dismissButton?.color?.hover,\n },\n focusRing: {\n borderColor: style.dismissButton?.focusRing?.borderColor,\n borderRadius: style.dismissButton?.focusRing?.borderRadius,\n borderWidth: style.dismissButton?.focusRing?.borderWidth,\n },\n },\n };\n}\n"]}
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"alert": "
|
|
5
|
-
"awsui-motion-fade-in": "awsui_awsui-motion-fade-
|
|
6
|
-
"root": "
|
|
7
|
-
"hidden": "
|
|
8
|
-
"alert-wrapper": "awsui_alert-
|
|
9
|
-
"initial-hidden": "awsui_initial-
|
|
10
|
-
"header": "
|
|
11
|
-
"header-replacement": "awsui_header-
|
|
12
|
-
"action": "
|
|
13
|
-
"action-slot": "awsui_action-
|
|
14
|
-
"action-button": "awsui_action-
|
|
15
|
-
"alert-focus-wrapper": "awsui_alert-focus-
|
|
16
|
-
"text": "
|
|
17
|
-
"icon": "
|
|
18
|
-
"message": "
|
|
19
|
-
"action-wrapped": "awsui_action-
|
|
20
|
-
"icon-size-medium": "awsui_icon-size-
|
|
21
|
-
"icon-size-big": "awsui_icon-size-
|
|
22
|
-
"icon-size-normal": "awsui_icon-size-
|
|
23
|
-
"content": "
|
|
24
|
-
"content-replacement": "awsui_content-
|
|
25
|
-
"dismiss": "
|
|
26
|
-
"dismiss-button": "awsui_dismiss-
|
|
27
|
-
"type-error": "awsui_type-
|
|
28
|
-
"type-warning": "awsui_type-
|
|
29
|
-
"type-success": "awsui_type-
|
|
30
|
-
"type-info": "awsui_type-
|
|
4
|
+
"alert": "awsui_alert_mx3cw_bzq5z_193",
|
|
5
|
+
"awsui-motion-fade-in": "awsui_awsui-motion-fade-in_mx3cw_bzq5z_1",
|
|
6
|
+
"root": "awsui_root_mx3cw_bzq5z_215",
|
|
7
|
+
"hidden": "awsui_hidden_mx3cw_bzq5z_250",
|
|
8
|
+
"alert-wrapper": "awsui_alert-wrapper_mx3cw_bzq5z_299",
|
|
9
|
+
"initial-hidden": "awsui_initial-hidden_mx3cw_bzq5z_311",
|
|
10
|
+
"header": "awsui_header_mx3cw_bzq5z_316",
|
|
11
|
+
"header-replacement": "awsui_header-replacement_mx3cw_bzq5z_317",
|
|
12
|
+
"action": "awsui_action_mx3cw_bzq5z_321",
|
|
13
|
+
"action-slot": "awsui_action-slot_mx3cw_bzq5z_325",
|
|
14
|
+
"action-button": "awsui_action-button_mx3cw_bzq5z_326",
|
|
15
|
+
"alert-focus-wrapper": "awsui_alert-focus-wrapper_mx3cw_bzq5z_330",
|
|
16
|
+
"text": "awsui_text_mx3cw_bzq5z_361",
|
|
17
|
+
"icon": "awsui_icon_mx3cw_bzq5z_368",
|
|
18
|
+
"message": "awsui_message_mx3cw_bzq5z_371",
|
|
19
|
+
"action-wrapped": "awsui_action-wrapped_mx3cw_bzq5z_375",
|
|
20
|
+
"icon-size-medium": "awsui_icon-size-medium_mx3cw_bzq5z_379",
|
|
21
|
+
"icon-size-big": "awsui_icon-size-big_mx3cw_bzq5z_383",
|
|
22
|
+
"icon-size-normal": "awsui_icon-size-normal_mx3cw_bzq5z_387",
|
|
23
|
+
"content": "awsui_content_mx3cw_bzq5z_391",
|
|
24
|
+
"content-replacement": "awsui_content-replacement_mx3cw_bzq5z_392",
|
|
25
|
+
"dismiss": "awsui_dismiss_mx3cw_bzq5z_396",
|
|
26
|
+
"dismiss-button": "awsui_dismiss-button_mx3cw_bzq5z_401",
|
|
27
|
+
"type-error": "awsui_type-error_mx3cw_bzq5z_405",
|
|
28
|
+
"type-warning": "awsui_type-warning_mx3cw_bzq5z_413",
|
|
29
|
+
"type-success": "awsui_type-success_mx3cw_bzq5z_421",
|
|
30
|
+
"type-info": "awsui_type-info_mx3cw_bzq5z_429"
|
|
31
31
|
};
|
|
32
32
|
|
|
@@ -190,10 +190,10 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
190
190
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
191
191
|
SPDX-License-Identifier: Apache-2.0
|
|
192
192
|
*/
|
|
193
|
-
.
|
|
194
|
-
animation: awsui_awsui-motion-fade-
|
|
193
|
+
.awsui_alert_mx3cw_bzq5z_193:not(#\9) {
|
|
194
|
+
animation: awsui_awsui-motion-fade-in_mx3cw_bzq5z_1 var(--motion-duration-show-paced-agho9h, 180ms) var(--motion-easing-show-paced-vcekro, ease-out);
|
|
195
195
|
}
|
|
196
|
-
@keyframes awsui_awsui-motion-fade-
|
|
196
|
+
@keyframes awsui_awsui-motion-fade-in_mx3cw_bzq5z_1 {
|
|
197
197
|
from {
|
|
198
198
|
opacity: 0.2;
|
|
199
199
|
}
|
|
@@ -202,17 +202,17 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
@media (prefers-reduced-motion: reduce) {
|
|
205
|
-
.
|
|
205
|
+
.awsui_alert_mx3cw_bzq5z_193:not(#\9) {
|
|
206
206
|
animation: none;
|
|
207
207
|
transition: none;
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
|
-
.awsui-motion-disabled .
|
|
210
|
+
.awsui-motion-disabled .awsui_alert_mx3cw_bzq5z_193:not(#\9), .awsui-mode-entering .awsui_alert_mx3cw_bzq5z_193:not(#\9) {
|
|
211
211
|
animation: none;
|
|
212
212
|
transition: none;
|
|
213
213
|
}
|
|
214
214
|
|
|
215
|
-
.
|
|
215
|
+
.awsui_root_mx3cw_bzq5z_215:not(#\9) {
|
|
216
216
|
border-collapse: separate;
|
|
217
217
|
border-spacing: 0;
|
|
218
218
|
box-sizing: border-box;
|
|
@@ -247,11 +247,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
247
247
|
overflow: hidden;
|
|
248
248
|
display: block;
|
|
249
249
|
}
|
|
250
|
-
.
|
|
250
|
+
.awsui_root_mx3cw_bzq5z_215.awsui_hidden_mx3cw_bzq5z_250:not(#\9) {
|
|
251
251
|
display: none;
|
|
252
252
|
}
|
|
253
253
|
|
|
254
|
-
.
|
|
254
|
+
.awsui_alert_mx3cw_bzq5z_193:not(#\9) {
|
|
255
255
|
border-collapse: separate;
|
|
256
256
|
border-spacing: 0;
|
|
257
257
|
box-sizing: border-box;
|
|
@@ -293,9 +293,10 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
293
293
|
padding-block: var(--space-alert-vertical-7hsinh, 12px);
|
|
294
294
|
padding-inline: var(--space-alert-horizontal-vvafy5, 20px);
|
|
295
295
|
background-color: var(--color-background-container-content-aemn43, #ffffff);
|
|
296
|
+
--awsui-style-focus-ring-box-shadow-kcc2gu: 0 0 0 var(--awsui-style-focus-ring-border-width-kcc2gu, 2px) var(--awsui-style-focus-ring-border-color-kcc2gu, var(--color-border-item-focused-r5f6xl, #0073bb));
|
|
296
297
|
}
|
|
297
298
|
|
|
298
|
-
.awsui_alert-
|
|
299
|
+
.awsui_alert-wrapper_mx3cw_bzq5z_299:not(#\9) {
|
|
299
300
|
flex: 1;
|
|
300
301
|
display: flex;
|
|
301
302
|
flex-direction: row;
|
|
@@ -303,46 +304,46 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
303
304
|
column-gap: var(--space-alert-action-left-ii45xs, 20px);
|
|
304
305
|
}
|
|
305
306
|
|
|
306
|
-
.
|
|
307
|
+
.awsui_hidden_mx3cw_bzq5z_250:not(#\9) {
|
|
307
308
|
display: none;
|
|
308
309
|
}
|
|
309
310
|
|
|
310
|
-
.awsui_initial-
|
|
311
|
+
.awsui_initial-hidden_mx3cw_bzq5z_311:not(#\9) {
|
|
311
312
|
overflow: hidden;
|
|
312
313
|
block-size: 0;
|
|
313
314
|
}
|
|
314
315
|
|
|
315
|
-
.
|
|
316
|
-
.awsui_header-
|
|
316
|
+
.awsui_header_mx3cw_bzq5z_316:not(#\9),
|
|
317
|
+
.awsui_header-replacement_mx3cw_bzq5z_317:not(#\9) {
|
|
317
318
|
font-weight: 700;
|
|
318
319
|
}
|
|
319
320
|
|
|
320
|
-
.
|
|
321
|
+
.awsui_action_mx3cw_bzq5z_321:not(#\9) {
|
|
321
322
|
white-space: nowrap;
|
|
322
323
|
}
|
|
323
324
|
|
|
324
|
-
.awsui_action-
|
|
325
|
-
.awsui_action-
|
|
325
|
+
.awsui_action-slot_mx3cw_bzq5z_325:not(#\9),
|
|
326
|
+
.awsui_action-button_mx3cw_bzq5z_326:not(#\9) {
|
|
326
327
|
/* used in test-utils */
|
|
327
328
|
}
|
|
328
329
|
|
|
329
|
-
.awsui_alert-focus-
|
|
330
|
+
.awsui_alert-focus-wrapper_mx3cw_bzq5z_330:not(#\9) {
|
|
330
331
|
flex: 1;
|
|
331
332
|
min-inline-size: 70%;
|
|
332
333
|
display: grid;
|
|
333
334
|
grid-template-columns: min-content auto;
|
|
334
335
|
}
|
|
335
|
-
.awsui_alert-focus-
|
|
336
|
+
.awsui_alert-focus-wrapper_mx3cw_bzq5z_330:not(#\9):focus {
|
|
336
337
|
outline: none;
|
|
337
338
|
}
|
|
338
|
-
body[data-awsui-focus-visible=true] .awsui_alert-focus-
|
|
339
|
+
body[data-awsui-focus-visible=true] .awsui_alert-focus-wrapper_mx3cw_bzq5z_330:not(#\9):focus {
|
|
339
340
|
position: relative;
|
|
340
341
|
}
|
|
341
|
-
body[data-awsui-focus-visible=true] .awsui_alert-focus-
|
|
342
|
+
body[data-awsui-focus-visible=true] .awsui_alert-focus-wrapper_mx3cw_bzq5z_330:not(#\9):focus {
|
|
342
343
|
outline: 2px dotted transparent;
|
|
343
344
|
outline-offset: calc(var(--space-button-focus-outline-gutter-vsdlzg, 3px) - 1px);
|
|
344
345
|
}
|
|
345
|
-
body[data-awsui-focus-visible=true] .awsui_alert-focus-
|
|
346
|
+
body[data-awsui-focus-visible=true] .awsui_alert-focus-wrapper_mx3cw_bzq5z_330:not(#\9):focus::before {
|
|
346
347
|
content: " ";
|
|
347
348
|
display: block;
|
|
348
349
|
position: absolute;
|
|
@@ -350,85 +351,85 @@ body[data-awsui-focus-visible=true] .awsui_alert-focus-wrapper_mx3cw_gw44y_329:n
|
|
|
350
351
|
inset-block-start: calc(-1 * var(--space-button-focus-outline-gutter-vsdlzg, 3px));
|
|
351
352
|
inline-size: calc(100% + var(--space-button-focus-outline-gutter-vsdlzg, 3px) + var(--space-button-focus-outline-gutter-vsdlzg, 3px));
|
|
352
353
|
block-size: calc(100% + var(--space-button-focus-outline-gutter-vsdlzg, 3px) + var(--space-button-focus-outline-gutter-vsdlzg, 3px));
|
|
353
|
-
border-start-start-radius: var(--border-radius-control-default-focus-ring-9xsko1, 2px);
|
|
354
|
-
border-start-end-radius: var(--border-radius-control-default-focus-ring-9xsko1, 2px);
|
|
355
|
-
border-end-start-radius: var(--border-radius-control-default-focus-ring-9xsko1, 2px);
|
|
356
|
-
border-end-end-radius: var(--border-radius-control-default-focus-ring-9xsko1, 2px);
|
|
357
|
-
box-shadow:
|
|
354
|
+
border-start-start-radius: var(--awsui-style-focus-ring-border-radius-kcc2gu, var(--border-radius-control-default-focus-ring-9xsko1, 2px));
|
|
355
|
+
border-start-end-radius: var(--awsui-style-focus-ring-border-radius-kcc2gu, var(--border-radius-control-default-focus-ring-9xsko1, 2px));
|
|
356
|
+
border-end-start-radius: var(--awsui-style-focus-ring-border-radius-kcc2gu, var(--border-radius-control-default-focus-ring-9xsko1, 2px));
|
|
357
|
+
border-end-end-radius: var(--awsui-style-focus-ring-border-radius-kcc2gu, var(--border-radius-control-default-focus-ring-9xsko1, 2px));
|
|
358
|
+
box-shadow: var(--awsui-style-focus-ring-box-shadow-kcc2gu);
|
|
358
359
|
}
|
|
359
360
|
|
|
360
|
-
.
|
|
361
|
+
.awsui_text_mx3cw_bzq5z_361:not(#\9) {
|
|
361
362
|
min-inline-size: 0;
|
|
362
|
-
padding-block: var(--border-width-
|
|
363
|
+
padding-block: var(--border-width-button-40y1n5, 1px);
|
|
363
364
|
padding-inline: 0;
|
|
364
365
|
margin-block: var(--space-scaled-xxs-jatbiv, 4px);
|
|
365
366
|
margin-inline: var(--space-xxs-jnczic, 4px);
|
|
366
367
|
}
|
|
367
|
-
.
|
|
368
|
+
.awsui_text_mx3cw_bzq5z_361.awsui_icon_mx3cw_bzq5z_368:not(#\9) {
|
|
368
369
|
margin-inline-start: 0;
|
|
369
370
|
}
|
|
370
|
-
.
|
|
371
|
+
.awsui_text_mx3cw_bzq5z_361.awsui_message_mx3cw_bzq5z_371:not(#\9) {
|
|
371
372
|
margin-inline-end: var(--space-alert-message-right-ipx6aa, 0px);
|
|
372
373
|
}
|
|
373
374
|
|
|
374
|
-
.awsui_action-
|
|
375
|
+
.awsui_action-wrapped_mx3cw_bzq5z_375:not(#\9) {
|
|
375
376
|
margin-block-end: var(--space-xxs-jnczic, 4px);
|
|
376
377
|
}
|
|
377
378
|
|
|
378
|
-
.awsui_icon-size-
|
|
379
|
+
.awsui_icon-size-medium_mx3cw_bzq5z_379 > .awsui_alert-wrapper_mx3cw_bzq5z_299 > .awsui_action-wrapped_mx3cw_bzq5z_375:not(#\9) {
|
|
379
380
|
margin-inline-start: calc(var(--size-icon-medium-3ovt3t, 16px) + var(--space-xs-kw7k3v, 8px));
|
|
380
381
|
}
|
|
381
382
|
|
|
382
|
-
.awsui_icon-size-
|
|
383
|
+
.awsui_icon-size-big_mx3cw_bzq5z_383 > .awsui_alert-wrapper_mx3cw_bzq5z_299 > .awsui_action-wrapped_mx3cw_bzq5z_375:not(#\9) {
|
|
383
384
|
margin-inline-start: calc(var(--size-icon-big-hnqj8f, 32px) + var(--space-xs-kw7k3v, 8px));
|
|
384
385
|
}
|
|
385
386
|
|
|
386
|
-
.awsui_icon-size-
|
|
387
|
+
.awsui_icon-size-normal_mx3cw_bzq5z_387 > .awsui_alert-wrapper_mx3cw_bzq5z_299 > .awsui_action-wrapped_mx3cw_bzq5z_375:not(#\9) {
|
|
387
388
|
margin-inline-start: calc(var(--size-icon-normal-2f5zkr, 16px) + var(--space-xs-kw7k3v, 8px));
|
|
388
389
|
}
|
|
389
390
|
|
|
390
|
-
.
|
|
391
|
-
.awsui_content-
|
|
391
|
+
.awsui_content_mx3cw_bzq5z_391:not(#\9),
|
|
392
|
+
.awsui_content-replacement_mx3cw_bzq5z_392:not(#\9) {
|
|
392
393
|
/* used in test-utils */
|
|
393
394
|
}
|
|
394
395
|
|
|
395
|
-
.
|
|
396
|
+
.awsui_dismiss_mx3cw_bzq5z_396:not(#\9) {
|
|
396
397
|
margin-inline-end: calc(-1 * var(--space-xxs-jnczic, 4px));
|
|
397
398
|
margin-inline-start: var(--space-s-4a5hs8, 12px);
|
|
398
399
|
}
|
|
399
400
|
|
|
400
|
-
.awsui_dismiss-
|
|
401
|
+
.awsui_dismiss-button_mx3cw_bzq5z_401:not(#\9) {
|
|
401
402
|
/* used in test-utils */
|
|
402
403
|
}
|
|
403
404
|
|
|
404
|
-
.awsui_type-
|
|
405
|
+
.awsui_type-error_mx3cw_bzq5z_405:not(#\9) {
|
|
405
406
|
border-color: var(--color-border-status-error-jybbdz, #d13212);
|
|
406
407
|
background-color: var(--color-background-status-error-5i5ikf, #fdf3f1);
|
|
407
408
|
}
|
|
408
|
-
.awsui_type-
|
|
409
|
+
.awsui_type-error_mx3cw_bzq5z_405 > .awsui_alert-wrapper_mx3cw_bzq5z_299 > .awsui_alert-focus-wrapper_mx3cw_bzq5z_330 > .awsui_icon_mx3cw_bzq5z_368:not(#\9) {
|
|
409
410
|
color: var(--color-text-status-error-aknuvu, #d13212);
|
|
410
411
|
}
|
|
411
412
|
|
|
412
|
-
.awsui_type-
|
|
413
|
+
.awsui_type-warning_mx3cw_bzq5z_413:not(#\9) {
|
|
413
414
|
border-color: var(--color-border-status-warning-qmz1c4, #906806);
|
|
414
415
|
background-color: var(--color-background-status-warning-mvw8w7, #fffef0);
|
|
415
416
|
}
|
|
416
|
-
.awsui_type-
|
|
417
|
+
.awsui_type-warning_mx3cw_bzq5z_413 > .awsui_alert-wrapper_mx3cw_bzq5z_299 > .awsui_alert-focus-wrapper_mx3cw_bzq5z_330 > .awsui_icon_mx3cw_bzq5z_368:not(#\9) {
|
|
417
418
|
color: var(--color-text-status-warning-9b45qh, #906806);
|
|
418
419
|
}
|
|
419
420
|
|
|
420
|
-
.awsui_type-
|
|
421
|
+
.awsui_type-success_mx3cw_bzq5z_421:not(#\9) {
|
|
421
422
|
border-color: var(--color-border-status-success-e61wev, #1d8102);
|
|
422
423
|
background-color: var(--color-background-status-success-tkxjye, #f2f8f0);
|
|
423
424
|
}
|
|
424
|
-
.awsui_type-
|
|
425
|
+
.awsui_type-success_mx3cw_bzq5z_421 > .awsui_alert-wrapper_mx3cw_bzq5z_299 > .awsui_alert-focus-wrapper_mx3cw_bzq5z_330 > .awsui_icon_mx3cw_bzq5z_368:not(#\9) {
|
|
425
426
|
color: var(--color-text-status-success-yodf3z, #1d8102);
|
|
426
427
|
}
|
|
427
428
|
|
|
428
|
-
.awsui_type-
|
|
429
|
+
.awsui_type-info_mx3cw_bzq5z_429:not(#\9) {
|
|
429
430
|
border-color: var(--color-border-status-info-kp0iif, #0073bb);
|
|
430
431
|
background-color: var(--color-background-status-info-nzp1n3, #f1faff);
|
|
431
432
|
}
|
|
432
|
-
.awsui_type-
|
|
433
|
+
.awsui_type-info_mx3cw_bzq5z_429 > .awsui_alert-wrapper_mx3cw_bzq5z_299 > .awsui_alert-focus-wrapper_mx3cw_bzq5z_330 > .awsui_icon_mx3cw_bzq5z_368:not(#\9) {
|
|
433
434
|
color: var(--color-text-status-info-xt2ka7, #0073bb);
|
|
434
435
|
}
|
|
@@ -2,32 +2,32 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"alert": "
|
|
6
|
-
"awsui-motion-fade-in": "awsui_awsui-motion-fade-
|
|
7
|
-
"root": "
|
|
8
|
-
"hidden": "
|
|
9
|
-
"alert-wrapper": "awsui_alert-
|
|
10
|
-
"initial-hidden": "awsui_initial-
|
|
11
|
-
"header": "
|
|
12
|
-
"header-replacement": "awsui_header-
|
|
13
|
-
"action": "
|
|
14
|
-
"action-slot": "awsui_action-
|
|
15
|
-
"action-button": "awsui_action-
|
|
16
|
-
"alert-focus-wrapper": "awsui_alert-focus-
|
|
17
|
-
"text": "
|
|
18
|
-
"icon": "
|
|
19
|
-
"message": "
|
|
20
|
-
"action-wrapped": "awsui_action-
|
|
21
|
-
"icon-size-medium": "awsui_icon-size-
|
|
22
|
-
"icon-size-big": "awsui_icon-size-
|
|
23
|
-
"icon-size-normal": "awsui_icon-size-
|
|
24
|
-
"content": "
|
|
25
|
-
"content-replacement": "awsui_content-
|
|
26
|
-
"dismiss": "
|
|
27
|
-
"dismiss-button": "awsui_dismiss-
|
|
28
|
-
"type-error": "awsui_type-
|
|
29
|
-
"type-warning": "awsui_type-
|
|
30
|
-
"type-success": "awsui_type-
|
|
31
|
-
"type-info": "awsui_type-
|
|
5
|
+
"alert": "awsui_alert_mx3cw_bzq5z_193",
|
|
6
|
+
"awsui-motion-fade-in": "awsui_awsui-motion-fade-in_mx3cw_bzq5z_1",
|
|
7
|
+
"root": "awsui_root_mx3cw_bzq5z_215",
|
|
8
|
+
"hidden": "awsui_hidden_mx3cw_bzq5z_250",
|
|
9
|
+
"alert-wrapper": "awsui_alert-wrapper_mx3cw_bzq5z_299",
|
|
10
|
+
"initial-hidden": "awsui_initial-hidden_mx3cw_bzq5z_311",
|
|
11
|
+
"header": "awsui_header_mx3cw_bzq5z_316",
|
|
12
|
+
"header-replacement": "awsui_header-replacement_mx3cw_bzq5z_317",
|
|
13
|
+
"action": "awsui_action_mx3cw_bzq5z_321",
|
|
14
|
+
"action-slot": "awsui_action-slot_mx3cw_bzq5z_325",
|
|
15
|
+
"action-button": "awsui_action-button_mx3cw_bzq5z_326",
|
|
16
|
+
"alert-focus-wrapper": "awsui_alert-focus-wrapper_mx3cw_bzq5z_330",
|
|
17
|
+
"text": "awsui_text_mx3cw_bzq5z_361",
|
|
18
|
+
"icon": "awsui_icon_mx3cw_bzq5z_368",
|
|
19
|
+
"message": "awsui_message_mx3cw_bzq5z_371",
|
|
20
|
+
"action-wrapped": "awsui_action-wrapped_mx3cw_bzq5z_375",
|
|
21
|
+
"icon-size-medium": "awsui_icon-size-medium_mx3cw_bzq5z_379",
|
|
22
|
+
"icon-size-big": "awsui_icon-size-big_mx3cw_bzq5z_383",
|
|
23
|
+
"icon-size-normal": "awsui_icon-size-normal_mx3cw_bzq5z_387",
|
|
24
|
+
"content": "awsui_content_mx3cw_bzq5z_391",
|
|
25
|
+
"content-replacement": "awsui_content-replacement_mx3cw_bzq5z_392",
|
|
26
|
+
"dismiss": "awsui_dismiss_mx3cw_bzq5z_396",
|
|
27
|
+
"dismiss-button": "awsui_dismiss-button_mx3cw_bzq5z_401",
|
|
28
|
+
"type-error": "awsui_type-error_mx3cw_bzq5z_405",
|
|
29
|
+
"type-warning": "awsui_type-warning_mx3cw_bzq5z_413",
|
|
30
|
+
"type-success": "awsui_type-success_mx3cw_bzq5z_421",
|
|
31
|
+
"type-info": "awsui_type-info_mx3cw_bzq5z_429"
|
|
32
32
|
};
|
|
33
33
|
|
|
@@ -68,6 +68,25 @@ export interface ContainerProps extends BaseComponentProps {
|
|
|
68
68
|
* @visualrefresh `stacked` variant
|
|
69
69
|
*/
|
|
70
70
|
variant?: 'default' | 'stacked';
|
|
71
|
+
/**
|
|
72
|
+
* Specifies an object of selectors and properties that are used to apply custom styles.
|
|
73
|
+
*
|
|
74
|
+
* - `root.background` (string) - (Optional) Background of the container.
|
|
75
|
+
* - `root.borderColor` (string) - (Optional) Border color of the container.
|
|
76
|
+
* - `root.borderRadius` (string) - (Optional) Border radius of the container.
|
|
77
|
+
* - `root.borderWidth` (string) - (Optional) Border width of the container.
|
|
78
|
+
* - `root.boxShadow` (string) - (Optional) Box shadow of the container.
|
|
79
|
+
* - `content.paddingBlock` (string) - (Optional) Block dimension padding of the content slot.
|
|
80
|
+
* - `content.paddingInline` (string) - (Optional) Inline dimension padding of the content slot.
|
|
81
|
+
* - `header.paddingBlock` (string) - (Optional) Block dimension padding of the header slot.
|
|
82
|
+
* - `header.paddingInline` (string) - (Optional) Inline dimension padding of the header slot.
|
|
83
|
+
* - `footer.root.paddingBlock` (string) - (Optional) Block dimension padding of the footer slot.
|
|
84
|
+
* - `footer.root.paddingInline` (string) - (Optional) Inline dimension padding of the footer slot.
|
|
85
|
+
* - `footer.divider.borderColor` (string) - (Optional) Border color of the footer divider.
|
|
86
|
+
* - `footer.divider.borderWidth` (string) - (Optional) Border width of the footer divider.
|
|
87
|
+
* @awsuiSystem core
|
|
88
|
+
*/
|
|
89
|
+
style?: ContainerProps.Style;
|
|
71
90
|
}
|
|
72
91
|
export declare namespace ContainerProps {
|
|
73
92
|
interface AnalyticsMetadata {
|
|
@@ -99,5 +118,32 @@ export declare namespace ContainerProps {
|
|
|
99
118
|
*/
|
|
100
119
|
height?: string | number;
|
|
101
120
|
}
|
|
121
|
+
interface Style {
|
|
122
|
+
root?: {
|
|
123
|
+
background?: string;
|
|
124
|
+
borderColor?: string;
|
|
125
|
+
borderRadius?: string;
|
|
126
|
+
borderWidth?: string;
|
|
127
|
+
boxShadow?: string;
|
|
128
|
+
};
|
|
129
|
+
content?: {
|
|
130
|
+
paddingBlock?: string;
|
|
131
|
+
paddingInline?: string;
|
|
132
|
+
};
|
|
133
|
+
header?: {
|
|
134
|
+
paddingBlock?: string;
|
|
135
|
+
paddingInline?: string;
|
|
136
|
+
};
|
|
137
|
+
footer?: {
|
|
138
|
+
root: {
|
|
139
|
+
paddingBlock?: string;
|
|
140
|
+
paddingInline?: string;
|
|
141
|
+
};
|
|
142
|
+
divider: {
|
|
143
|
+
borderColor?: string;
|
|
144
|
+
borderWidth?: string;
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
}
|
|
102
148
|
}
|
|
103
149
|
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/container/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,MAAM,WAAW,cAAe,SAAQ,kBAAkB;IACxD;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,cAAc,CAAC,iBAAiB,CAAC;IAErD;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEzB;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;;;;;;;;;;;;;;;;OAkBG;IACH,KAAK,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B;;OAEG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAEjC;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEzB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/container/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAA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,MAAM,CAAC;YACpB,WAAW,CAAC,EAAE,MAAM,CAAC;YACrB,YAAY,CAAC,EAAE,MAAM,CAAC;YACtB,WAAW,CAAC,EAAE,MAAM,CAAC;YACrB,SAAS,CAAC,EAAE,MAAM,CAAC;SACpB,CAAC;QACF,OAAO,CAAC,EAAE;YACR,YAAY,CAAC,EAAE,MAAM,CAAC;YACtB,aAAa,CAAC,EAAE,MAAM,CAAC;SACxB,CAAC;QACF,MAAM,CAAC,EAAE;YACP,YAAY,CAAC,EAAE,MAAM,CAAC;YACtB,aAAa,CAAC,EAAE,MAAM,CAAC;SACxB,CAAC;QACF,MAAM,CAAC,EAAE;YACP,IAAI,EAAE;gBACJ,YAAY,CAAC,EAAE,MAAM,CAAC;gBACtB,aAAa,CAAC,EAAE,MAAM,CAAC;aACxB,CAAC;YACF,OAAO,EAAE;gBACP,WAAW,CAAC,EAAE,MAAM,CAAC;gBACrB,WAAW,CAAC,EAAE,MAAM,CAAC;aACtB,CAAC;SACH,CAAC;KACH;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/container/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';\n\nimport { BaseComponentProps } from '../internal/base-component';\n\nexport interface ContainerProps extends BaseComponentProps {\n /**\n * Specifies additional analytics-related metadata.\n * * `instanceIdentifier` - A unique string that identifies this component instance in your application.\n * @analytics\n */\n analyticsMetadata?: ContainerProps.AnalyticsMetadata;\n\n /**\n * Heading element of the container. Use the [header component](/components/header/).\n */\n header?: React.ReactNode;\n\n /**\n * Determines whether the container header has padding. If `true`, removes the default padding from the header.\n */\n disableHeaderPaddings?: boolean;\n\n /**\n *\n * Use this slot to render a media element. Supported element types are 'img', 'video', and 'picture'.\n * You can define different positions and sizes for the media element within the container.\n *\n * * `content` - Use this slot to render your media element. We support `img`, `video`, `picture`, and `iframe` elements.\n *\n * * `position` - Defines the media slot's position within the container. Defaults to `top`.\n *\n * * `width` - Defines the width of the media slot when positioned on the side. Corresponds to the `width` CSS-property.\n * When this value is set, media elements larger than the defined width may be cropped, with 'object-fit: cover' centering it.\n * Note: This value is considered only when `position` is set to `side`.\n * If no width is provided, the media slot will take a maximum of 66% of the container's width.\n *\n * * `height` - Defines the height of the media slot when position on the top. Corresponds to the `height` CSS-property.\n * When this value is set, media elements larger than the defined width may be cropped, with 'object-fit: cover' centering it. * Note: This value is only considered if `position` is set to `top`.\n * If no height is provided, the media slot will be displayed at its full height.\n *\n */\n media?: ContainerProps.Media;\n\n /**\n * Main content of the container.\n */\n children?: React.ReactNode;\n\n /**\n * Determines whether the container content has padding. If `true`, removes the default padding from the content area.\n */\n disableContentPaddings?: boolean;\n\n /**\n * Enabling this property will make the container to fit into available height. If content is too short, the container\n * will stretch, if too long, the container will shrink and show vertical scrollbar.\n *\n * Use this property to align heights of multiple containers displayed in a single row. It is recommended to stretch\n * all containers to the height of the longest one, to avoid extra vertical scroll areas.\n */\n fitHeight?: boolean;\n\n /**\n * Footer of the container.\n */\n footer?: React.ReactNode;\n\n /**\n * Determines whether the container footer has padding. If `true`, removes the default padding from the footer.\n * @awsuiSystem core\n */\n disableFooterPaddings?: boolean;\n\n /**\n * Specify a container variant with one of the following:\n * * `default` - Use this variant in standalone context.\n * * `stacked` - Use this variant adjacent to other stacked containers (such as a container,\n * table).\n * @visualrefresh `stacked` variant\n */\n variant?: 'default' | 'stacked';\n}\n\nexport namespace ContainerProps {\n export interface AnalyticsMetadata {\n instanceIdentifier?: string;\n }\n export interface Media {\n /**\n * Use this slot to render your media element. We support `img`, `video`, `picture`, and `iframe` elements.\n */\n content: React.ReactNode;\n\n /**\n * Defines the media slot's position within the container. Defaults to `top`.\n */\n position?: 'top' | 'side';\n\n /**\n * Defines the width of the media slot when positioned on the side. Corresponds to the `width` CSS-property.\n * When this value is set, the media element may be cropped, with `object-fit: cover` centering it.\n *\n * Note: This value is considered only when `position` is set to `side`.\n * If no width is provided, the media slot will take a maximum of 66% of the container's width.\n */\n width?: string | number;\n\n /**\n * Defines the height of the media slot when position on the top. Corresponds to the `height` CSS-property.\n * When this value is set, the media element may be cropped, with `object-fit: cover` centering it.\n *\n * Note: This value is only considered if `position` is set to `top`.\n * If no height is provided, the media slot will be displayed at its full height.\n */\n height?: string | number;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/container/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';\n\nimport { BaseComponentProps } from '../internal/base-component';\n\nexport interface ContainerProps extends BaseComponentProps {\n /**\n * Specifies additional analytics-related metadata.\n * * `instanceIdentifier` - A unique string that identifies this component instance in your application.\n * @analytics\n */\n analyticsMetadata?: ContainerProps.AnalyticsMetadata;\n\n /**\n * Heading element of the container. Use the [header component](/components/header/).\n */\n header?: React.ReactNode;\n\n /**\n * Determines whether the container header has padding. If `true`, removes the default padding from the header.\n */\n disableHeaderPaddings?: boolean;\n\n /**\n *\n * Use this slot to render a media element. Supported element types are 'img', 'video', and 'picture'.\n * You can define different positions and sizes for the media element within the container.\n *\n * * `content` - Use this slot to render your media element. We support `img`, `video`, `picture`, and `iframe` elements.\n *\n * * `position` - Defines the media slot's position within the container. Defaults to `top`.\n *\n * * `width` - Defines the width of the media slot when positioned on the side. Corresponds to the `width` CSS-property.\n * When this value is set, media elements larger than the defined width may be cropped, with 'object-fit: cover' centering it.\n * Note: This value is considered only when `position` is set to `side`.\n * If no width is provided, the media slot will take a maximum of 66% of the container's width.\n *\n * * `height` - Defines the height of the media slot when position on the top. Corresponds to the `height` CSS-property.\n * When this value is set, media elements larger than the defined width may be cropped, with 'object-fit: cover' centering it. * Note: This value is only considered if `position` is set to `top`.\n * If no height is provided, the media slot will be displayed at its full height.\n *\n */\n media?: ContainerProps.Media;\n\n /**\n * Main content of the container.\n */\n children?: React.ReactNode;\n\n /**\n * Determines whether the container content has padding. If `true`, removes the default padding from the content area.\n */\n disableContentPaddings?: boolean;\n\n /**\n * Enabling this property will make the container to fit into available height. If content is too short, the container\n * will stretch, if too long, the container will shrink and show vertical scrollbar.\n *\n * Use this property to align heights of multiple containers displayed in a single row. It is recommended to stretch\n * all containers to the height of the longest one, to avoid extra vertical scroll areas.\n */\n fitHeight?: boolean;\n\n /**\n * Footer of the container.\n */\n footer?: React.ReactNode;\n\n /**\n * Determines whether the container footer has padding. If `true`, removes the default padding from the footer.\n * @awsuiSystem core\n */\n disableFooterPaddings?: boolean;\n\n /**\n * Specify a container variant with one of the following:\n * * `default` - Use this variant in standalone context.\n * * `stacked` - Use this variant adjacent to other stacked containers (such as a container,\n * table).\n * @visualrefresh `stacked` variant\n */\n variant?: 'default' | 'stacked';\n\n /**\n * Specifies an object of selectors and properties that are used to apply custom styles.\n *\n * - `root.background` (string) - (Optional) Background of the container.\n * - `root.borderColor` (string) - (Optional) Border color of the container.\n * - `root.borderRadius` (string) - (Optional) Border radius of the container.\n * - `root.borderWidth` (string) - (Optional) Border width of the container.\n * - `root.boxShadow` (string) - (Optional) Box shadow of the container.\n * - `content.paddingBlock` (string) - (Optional) Block dimension padding of the content slot.\n * - `content.paddingInline` (string) - (Optional) Inline dimension padding of the content slot.\n * - `header.paddingBlock` (string) - (Optional) Block dimension padding of the header slot.\n * - `header.paddingInline` (string) - (Optional) Inline dimension padding of the header slot.\n * - `footer.root.paddingBlock` (string) - (Optional) Block dimension padding of the footer slot.\n * - `footer.root.paddingInline` (string) - (Optional) Inline dimension padding of the footer slot.\n * - `footer.divider.borderColor` (string) - (Optional) Border color of the footer divider.\n * - `footer.divider.borderWidth` (string) - (Optional) Border width of the footer divider.\n * @awsuiSystem core\n */\n style?: ContainerProps.Style;\n}\n\nexport namespace ContainerProps {\n export interface AnalyticsMetadata {\n instanceIdentifier?: string;\n }\n export interface Media {\n /**\n * Use this slot to render your media element. We support `img`, `video`, `picture`, and `iframe` elements.\n */\n content: React.ReactNode;\n\n /**\n * Defines the media slot's position within the container. Defaults to `top`.\n */\n position?: 'top' | 'side';\n\n /**\n * Defines the width of the media slot when positioned on the side. Corresponds to the `width` CSS-property.\n * When this value is set, the media element may be cropped, with `object-fit: cover` centering it.\n *\n * Note: This value is considered only when `position` is set to `side`.\n * If no width is provided, the media slot will take a maximum of 66% of the container's width.\n */\n width?: string | number;\n\n /**\n * Defines the height of the media slot when position on the top. Corresponds to the `height` CSS-property.\n * When this value is set, the media element may be cropped, with `object-fit: cover` centering it.\n *\n * Note: This value is only considered if `position` is set to `top`.\n * If no height is provided, the media slot will be displayed at its full height.\n */\n height?: string | number;\n }\n\n export interface Style {\n root?: {\n background?: string;\n borderColor?: string;\n borderRadius?: string;\n borderWidth?: string;\n boxShadow?: string;\n };\n content?: {\n paddingBlock?: string;\n paddingInline?: string;\n };\n header?: {\n paddingBlock?: string;\n paddingInline?: string;\n };\n footer?: {\n root: {\n paddingBlock?: string;\n paddingInline?: string;\n };\n divider: {\n borderColor?: string;\n borderWidth?: string;\n };\n };\n }\n}\n"]}
|
|
@@ -23,5 +23,5 @@ export interface InternalContainerProps extends Omit<ContainerProps, 'variant'>,
|
|
|
23
23
|
__subStepRef?: ReturnType<typeof useFunnelSubStep>['subStepRef'];
|
|
24
24
|
}
|
|
25
25
|
export declare function InternalContainerAsSubstep(props: InternalContainerProps): JSX.Element;
|
|
26
|
-
export default function InternalContainer({ header, footer, children, variant, disableHeaderPaddings, disableContentPaddings, disableFooterPaddings, fitHeight, media, __stickyOffset, __mobileStickyOffset, __stickyHeader, __internalRootRef, __disableFooterDivider, __hiddenContent, __headerRef, __fullPage, __disableStickyMobile, __funnelSubStepProps, __subStepRef, ...restProps }: InternalContainerProps): JSX.Element;
|
|
26
|
+
export default function InternalContainer({ header, footer, children, variant, disableHeaderPaddings, disableContentPaddings, disableFooterPaddings, fitHeight, media, style, __stickyOffset, __mobileStickyOffset, __stickyHeader, __internalRootRef, __disableFooterDivider, __hiddenContent, __headerRef, __fullPage, __disableStickyMobile, __funnelSubStepProps, __subStepRef, ...restProps }: InternalContainerProps): JSX.Element;
|
|
27
27
|
//# sourceMappingURL=internal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/container/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAMtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAI1E,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAGlF,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/container/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAMtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAI1E,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAGlF,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAQ9C,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,EAAE,0BAA0B;IACzG,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC9C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,cAAc,CAAC,SAAS,CAAC,GAAG,UAAU,GAAG,WAAW,GAAG,OAAO,CAAC;IAEzE,oBAAoB,CAAC,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC,oBAAoB,CAAC,CAAC;IACjF,YAAY,CAAC,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC,YAAY,CAAC,CAAC;CAClE;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,sBAAsB,eAWvE;AAED,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EACxC,MAAM,EACN,MAAM,EACN,QAAQ,EACR,OAAmB,EACnB,qBAA6B,EAC7B,sBAA8B,EAC9B,qBAA6B,EAC7B,SAAS,EACT,KAAK,EACL,KAAK,EACL,cAAc,EACd,oBAAoB,EACpB,cAAsB,EACtB,iBAAwB,EACxB,sBAA8B,EAC9B,eAAuB,EACvB,WAAW,EACX,UAAkB,EAClB,qBAA4B,EAC5B,oBAAoB,EACpB,YAAY,EACZ,GAAG,SAAS,EACb,EAAE,sBAAsB,eA2HxB"}
|
|
@@ -11,6 +11,7 @@ import { ContainerHeaderContextProvider } from '../internal/context/container-he
|
|
|
11
11
|
import { useModalContext } from '../internal/context/modal-context';
|
|
12
12
|
import { useMobile } from '../internal/hooks/use-mobile';
|
|
13
13
|
import { useVisualRefresh } from '../internal/hooks/use-visual-mode';
|
|
14
|
+
import { getContentStyles, getFooterStyles, getHeaderStyles, getMediaStyles, getRootStyles } from './style';
|
|
14
15
|
import { StickyHeaderContext, useStickyHeader } from './use-sticky-header';
|
|
15
16
|
import analyticsSelectors from './analytics-metadata/styles.css.js';
|
|
16
17
|
import styles from './styles.css.js';
|
|
@@ -22,7 +23,7 @@ export function InternalContainerAsSubstep(props) {
|
|
|
22
23
|
}
|
|
23
24
|
export default function InternalContainer(_a) {
|
|
24
25
|
var _b;
|
|
25
|
-
var { header, footer, children, variant = 'default', disableHeaderPaddings = false, disableContentPaddings = false, disableFooterPaddings = false, fitHeight, media, __stickyOffset, __mobileStickyOffset, __stickyHeader = false, __internalRootRef = null, __disableFooterDivider = false, __hiddenContent = false, __headerRef, __fullPage = false, __disableStickyMobile = true, __funnelSubStepProps, __subStepRef } = _a, restProps = __rest(_a, ["header", "footer", "children", "variant", "disableHeaderPaddings", "disableContentPaddings", "disableFooterPaddings", "fitHeight", "media", "__stickyOffset", "__mobileStickyOffset", "__stickyHeader", "__internalRootRef", "__disableFooterDivider", "__hiddenContent", "__headerRef", "__fullPage", "__disableStickyMobile", "__funnelSubStepProps", "__subStepRef"]);
|
|
26
|
+
var { header, footer, children, variant = 'default', disableHeaderPaddings = false, disableContentPaddings = false, disableFooterPaddings = false, fitHeight, media, style, __stickyOffset, __mobileStickyOffset, __stickyHeader = false, __internalRootRef = null, __disableFooterDivider = false, __hiddenContent = false, __headerRef, __fullPage = false, __disableStickyMobile = true, __funnelSubStepProps, __subStepRef } = _a, restProps = __rest(_a, ["header", "footer", "children", "variant", "disableHeaderPaddings", "disableContentPaddings", "disableFooterPaddings", "fitHeight", "media", "style", "__stickyOffset", "__mobileStickyOffset", "__stickyHeader", "__internalRootRef", "__disableFooterDivider", "__hiddenContent", "__headerRef", "__fullPage", "__disableStickyMobile", "__funnelSubStepProps", "__subStepRef"]);
|
|
26
27
|
const isMobile = useMobile();
|
|
27
28
|
const isRefresh = useVisualRefresh();
|
|
28
29
|
const baseProps = getBaseProps(restProps);
|
|
@@ -38,12 +39,13 @@ export default function InternalContainer(_a) {
|
|
|
38
39
|
const shouldHaveStickyStyles = isSticky && !isMobile;
|
|
39
40
|
const hasMedia = !!(media === null || media === void 0 ? void 0 : media.content);
|
|
40
41
|
const mediaPosition = (_b = media === null || media === void 0 ? void 0 : media.position) !== null && _b !== void 0 ? _b : 'top';
|
|
41
|
-
return (React.createElement("div", Object.assign({}, baseProps, __funnelSubStepProps, { className: clsx(baseProps.className, styles.root, styles[`variant-${variant}`], fitHeight && styles['fit-height'], hasMedia && (mediaPosition === 'side' ? styles['with-side-media'] : styles['with-top-media']), shouldHaveStickyStyles && [styles['sticky-enabled']], shouldHaveStickyStyles && isStuck && isStuckAtBottom && [styles['with-stuck-sticky-header-at-bottom']], isRefresh && styles.refresh), ref: mergedRef }, getAnalyticsLabelAttribute(`.${analyticsSelectors.header} h1, .${analyticsSelectors.header} h2, .${analyticsSelectors.header} h3`)),
|
|
42
|
-
hasMedia && (React.createElement("div", { className: clsx(styles[`media-${mediaPosition === 'side' ? 'side' : 'top'}`], styles.media), style: mediaPosition === 'top'
|
|
42
|
+
return (React.createElement("div", Object.assign({}, baseProps, __funnelSubStepProps, { className: clsx(baseProps.className, styles.root, styles[`variant-${variant}`], fitHeight && styles['fit-height'], hasMedia && (mediaPosition === 'side' ? styles['with-side-media'] : styles['with-top-media']), shouldHaveStickyStyles && [styles['sticky-enabled']], shouldHaveStickyStyles && isStuck && isStuckAtBottom && [styles['with-stuck-sticky-header-at-bottom']], isRefresh && styles.refresh), ref: mergedRef }, getAnalyticsLabelAttribute(`.${analyticsSelectors.header} h1, .${analyticsSelectors.header} h2, .${analyticsSelectors.header} h3`), { style: getRootStyles(style) }),
|
|
43
|
+
hasMedia && (React.createElement("div", { className: clsx(styles[`media-${mediaPosition === 'side' ? 'side' : 'top'}`], styles.media), style: mediaPosition === 'top'
|
|
44
|
+
? Object.assign(Object.assign({}, getMediaStyles(mediaPosition, style)), { height: (media === null || media === void 0 ? void 0 : media.height) || '' }) : Object.assign(Object.assign({}, getMediaStyles(mediaPosition, style)), { width: (media === null || media === void 0 ? void 0 : media.width) || '' }) }, media.content)),
|
|
43
45
|
React.createElement("div", { id: contentId, ref: __subStepRef, className: clsx(styles['content-wrapper'], fitHeight && styles['content-wrapper-fit-height']) },
|
|
44
46
|
header && (React.createElement(ContainerHeaderContextProvider, null,
|
|
45
47
|
React.createElement(StickyHeaderContext.Provider, { value: { isStuck, isStuckAtBottom } },
|
|
46
|
-
React.createElement("div",
|
|
48
|
+
React.createElement("div", { className: clsx(isRefresh && styles.refresh, styles.header, analyticsSelectors.header, styles[`header-variant-${variant}`], {
|
|
47
49
|
[styles['header-sticky-disabled']]: __stickyHeader && !isSticky,
|
|
48
50
|
[styles['header-sticky-enabled']]: isSticky,
|
|
49
51
|
[styles['header-dynamic-height']]: hasDynamicHeight,
|
|
@@ -52,17 +54,17 @@ export default function InternalContainer(_a) {
|
|
|
52
54
|
[styles['with-hidden-content']]: !children || __hiddenContent,
|
|
53
55
|
[styles['header-with-media']]: hasMedia,
|
|
54
56
|
[styles['header-full-page']]: __fullPage && isRefresh,
|
|
55
|
-
})
|
|
57
|
+
}), ref: headerMergedRef, style: Object.assign(Object.assign({}, stickyStyles.style), getHeaderStyles(style)) },
|
|
56
58
|
isStuck && !isMobile && isRefresh && __fullPage && React.createElement("div", { className: styles['header-cover'] }),
|
|
57
59
|
header)))),
|
|
58
60
|
React.createElement("div", { className: clsx(styles.content, fitHeight && styles['content-fit-height']) },
|
|
59
61
|
React.createElement("div", { className: clsx(styles['content-inner'], testStyles['content-inner'], {
|
|
60
62
|
[styles['with-paddings']]: !disableContentPaddings,
|
|
61
63
|
[styles['with-header']]: !!header,
|
|
62
|
-
}) }, children)),
|
|
64
|
+
}), style: getContentStyles(style) }, children)),
|
|
63
65
|
footer && (React.createElement("div", { className: clsx(styles.footer, {
|
|
64
66
|
[styles['with-divider']]: !__disableFooterDivider,
|
|
65
67
|
[styles['with-paddings']]: !disableFooterPaddings,
|
|
66
|
-
}) }, footer)))));
|
|
68
|
+
}), style: getFooterStyles(style) }, footer)))));
|
|
67
69
|
}
|
|
68
70
|
//# sourceMappingURL=internal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/container/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,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IAAI,MAAM,CAAC,oBAAoB,CAAC,CAAC;gBAC7E,6BACE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,UAAU,CAAC,eAAe,CAAC,EAAE;wBACpE,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,sBAAsB;wBAClD,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM;qBAClC,CAAC,IAED,QAAQ,CACL,CACF;YACL,MAAM,IAAI,CACT,6BACE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;oBAC7B,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,sBAAsB;oBACjD,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,qBAAqB;iBAClD,CAAC,IAED,MAAM,CACH,CACP,CACG,CACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, useUniqueId } from '@cloudscape-design/component-toolkit/internal';\nimport { getAnalyticsLabelAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';\nimport { getBaseProps } from '../internal/base-component';\nimport { ContainerHeaderContextProvider } from '../internal/context/container-header';\nimport { useModalContext } from '../internal/context/modal-context';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { ContainerProps } from './interfaces';\nimport { StickyHeaderContext, useStickyHeader } from './use-sticky-header';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\nimport testStyles from './test-classes/styles.css.js';\n\nexport interface InternalContainerProps extends Omit<ContainerProps, 'variant'>, InternalBaseComponentProps {\n disableFooterPaddings?: boolean;\n __stickyHeader?: boolean;\n __stickyOffset?: number;\n __mobileStickyOffset?: number;\n __disableFooterDivider?: boolean;\n __hiddenContent?: boolean;\n __headerRef?: React.RefObject<HTMLDivElement>;\n __fullPage?: boolean;\n __disableStickyMobile?: boolean;\n /**\n * Additional internal variant:\n * * `embedded` - Use this variant within a parent container (such as a modal,\n * expandable section, container or split panel).\n * * `full-page` – Only for internal use in table, cards and other components\n */\n variant?: ContainerProps['variant'] | 'embedded' | 'full-page' | 'cards';\n\n __funnelSubStepProps?: ReturnType<typeof useFunnelSubStep>['funnelSubStepProps'];\n __subStepRef?: ReturnType<typeof useFunnelSubStep>['subStepRef'];\n}\n\nexport function InternalContainerAsSubstep(props: InternalContainerProps) {\n const { subStepRef, funnelSubStepProps } = useFunnelSubStep();\n const modalContext = useModalContext();\n\n return (\n <InternalContainer\n {...props}\n __subStepRef={modalContext?.isInModal ? { current: null } : subStepRef}\n __funnelSubStepProps={modalContext?.isInModal ? {} : funnelSubStepProps}\n />\n );\n}\n\nexport default function InternalContainer({\n header,\n footer,\n children,\n variant = 'default',\n disableHeaderPaddings = false,\n disableContentPaddings = false,\n disableFooterPaddings = false,\n fitHeight,\n media,\n __stickyOffset,\n __mobileStickyOffset,\n __stickyHeader = false,\n __internalRootRef = null,\n __disableFooterDivider = false,\n __hiddenContent = false,\n __headerRef,\n __fullPage = false,\n __disableStickyMobile = true,\n __funnelSubStepProps,\n __subStepRef,\n ...restProps\n}: InternalContainerProps) {\n const isMobile = useMobile();\n const isRefresh = useVisualRefresh();\n const baseProps = getBaseProps(restProps);\n const rootRef = useRef<HTMLDivElement>(null);\n const headerRef = useRef<HTMLDivElement>(null);\n const { isSticky, isStuck, isStuckAtBottom, stickyStyles } = useStickyHeader(\n rootRef,\n headerRef,\n __stickyHeader,\n __stickyOffset,\n __mobileStickyOffset,\n __disableStickyMobile,\n __fullPage && isRefresh && !isMobile\n );\n const contentId = useUniqueId();\n\n const hasDynamicHeight = isRefresh && variant === 'full-page';\n\n const mergedRef = useMergeRefs(rootRef, __internalRootRef);\n const headerMergedRef = useMergeRefs(headerRef, __headerRef);\n\n // The container is only sticky on mobile if it is the header for the table.\n // In this case we don't want the container to have sticky styles, as only the table header row will show as stuck on scroll.\n const shouldHaveStickyStyles = isSticky && !isMobile;\n\n const hasMedia = !!media?.content;\n const mediaPosition = media?.position ?? 'top';\n return (\n <div\n {...baseProps}\n {...__funnelSubStepProps}\n className={clsx(\n baseProps.className,\n styles.root,\n styles[`variant-${variant}`],\n fitHeight && styles['fit-height'],\n hasMedia && (mediaPosition === 'side' ? styles['with-side-media'] : styles['with-top-media']),\n shouldHaveStickyStyles && [styles['sticky-enabled']],\n shouldHaveStickyStyles && isStuck && isStuckAtBottom && [styles['with-stuck-sticky-header-at-bottom']],\n isRefresh && styles.refresh\n )}\n ref={mergedRef}\n {...getAnalyticsLabelAttribute(\n `.${analyticsSelectors.header} h1, .${analyticsSelectors.header} h2, .${analyticsSelectors.header} h3`\n )}\n >\n {hasMedia && (\n <div\n className={clsx(styles[`media-${mediaPosition === 'side' ? 'side' : 'top'}`], styles.media)}\n style={mediaPosition === 'top' ? { height: media?.height || '' } : { width: media?.width || '' }}\n >\n {media.content}\n </div>\n )}\n <div\n id={contentId}\n ref={__subStepRef}\n className={clsx(styles['content-wrapper'], fitHeight && styles['content-wrapper-fit-height'])}\n >\n {header && (\n <ContainerHeaderContextProvider>\n <StickyHeaderContext.Provider value={{ isStuck, isStuckAtBottom }}>\n <div\n className={clsx(\n isRefresh && styles.refresh,\n styles.header,\n analyticsSelectors.header,\n styles[`header-variant-${variant}`],\n {\n [styles['header-sticky-disabled']]: __stickyHeader && !isSticky,\n [styles['header-sticky-enabled']]: isSticky,\n [styles['header-dynamic-height']]: hasDynamicHeight,\n [styles['header-stuck']]: isStuck,\n [styles['with-paddings']]: !disableHeaderPaddings,\n [styles['with-hidden-content']]: !children || __hiddenContent,\n [styles['header-with-media']]: hasMedia,\n [styles['header-full-page']]: __fullPage && isRefresh,\n }\n )}\n {...stickyStyles}\n ref={headerMergedRef}\n >\n {isStuck && !isMobile && isRefresh && __fullPage && <div className={styles['header-cover']}></div>}\n {header}\n </div>\n </StickyHeaderContext.Provider>\n </ContainerHeaderContextProvider>\n )}\n <div className={clsx(styles.content, fitHeight && styles['content-fit-height'])}>\n <div\n className={clsx(styles['content-inner'], testStyles['content-inner'], {\n [styles['with-paddings']]: !disableContentPaddings,\n [styles['with-header']]: !!header,\n })}\n >\n {children}\n </div>\n </div>\n {footer && (\n <div\n className={clsx(styles.footer, {\n [styles['with-divider']]: !__disableFooterDivider,\n [styles['with-paddings']]: !disableFooterPaddings,\n })}\n >\n {footer}\n </div>\n )}\n </div>\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/container/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC1F,OAAO,EAAE,0BAA0B,EAAE,MAAM,kEAAkE,CAAC;AAE9G,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,8BAA8B,EAAE,MAAM,sCAAsC,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAEpE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAErE,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,eAAe,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC5G,OAAO,EAAE,mBAA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M;qBAClC,CAAC,EACF,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC,IAE7B,QAAQ,CACL,CACF;YACL,MAAM,IAAI,CACT,6BACE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;oBAC7B,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,sBAAsB;oBACjD,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,qBAAqB;iBAClD,CAAC,EACF,KAAK,EAAE,eAAe,CAAC,KAAK,CAAC,IAE5B,MAAM,CACH,CACP,CACG,CACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, useUniqueId } from '@cloudscape-design/component-toolkit/internal';\nimport { getAnalyticsLabelAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';\nimport { getBaseProps } from '../internal/base-component';\nimport { ContainerHeaderContextProvider } from '../internal/context/container-header';\nimport { useModalContext } from '../internal/context/modal-context';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { ContainerProps } from './interfaces';\nimport { getContentStyles, getFooterStyles, getHeaderStyles, getMediaStyles, getRootStyles } from './style';\nimport { StickyHeaderContext, useStickyHeader } from './use-sticky-header';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\nimport testStyles from './test-classes/styles.css.js';\n\nexport interface InternalContainerProps extends Omit<ContainerProps, 'variant'>, InternalBaseComponentProps {\n disableFooterPaddings?: boolean;\n __stickyHeader?: boolean;\n __stickyOffset?: number;\n __mobileStickyOffset?: number;\n __disableFooterDivider?: boolean;\n __hiddenContent?: boolean;\n __headerRef?: React.RefObject<HTMLDivElement>;\n __fullPage?: boolean;\n __disableStickyMobile?: boolean;\n /**\n * Additional internal variant:\n * * `embedded` - Use this variant within a parent container (such as a modal,\n * expandable section, container or split panel).\n * * `full-page` – Only for internal use in table, cards and other components\n */\n variant?: ContainerProps['variant'] | 'embedded' | 'full-page' | 'cards';\n\n __funnelSubStepProps?: ReturnType<typeof useFunnelSubStep>['funnelSubStepProps'];\n __subStepRef?: ReturnType<typeof useFunnelSubStep>['subStepRef'];\n}\n\nexport function InternalContainerAsSubstep(props: InternalContainerProps) {\n const { subStepRef, funnelSubStepProps } = useFunnelSubStep();\n const modalContext = useModalContext();\n\n return (\n <InternalContainer\n {...props}\n __subStepRef={modalContext?.isInModal ? { current: null } : subStepRef}\n __funnelSubStepProps={modalContext?.isInModal ? {} : funnelSubStepProps}\n />\n );\n}\n\nexport default function InternalContainer({\n header,\n footer,\n children,\n variant = 'default',\n disableHeaderPaddings = false,\n disableContentPaddings = false,\n disableFooterPaddings = false,\n fitHeight,\n media,\n style,\n __stickyOffset,\n __mobileStickyOffset,\n __stickyHeader = false,\n __internalRootRef = null,\n __disableFooterDivider = false,\n __hiddenContent = false,\n __headerRef,\n __fullPage = false,\n __disableStickyMobile = true,\n __funnelSubStepProps,\n __subStepRef,\n ...restProps\n}: InternalContainerProps) {\n const isMobile = useMobile();\n const isRefresh = useVisualRefresh();\n const baseProps = getBaseProps(restProps);\n const rootRef = useRef<HTMLDivElement>(null);\n const headerRef = useRef<HTMLDivElement>(null);\n const { isSticky, isStuck, isStuckAtBottom, stickyStyles } = useStickyHeader(\n rootRef,\n headerRef,\n __stickyHeader,\n __stickyOffset,\n __mobileStickyOffset,\n __disableStickyMobile,\n __fullPage && isRefresh && !isMobile\n );\n const contentId = useUniqueId();\n\n const hasDynamicHeight = isRefresh && variant === 'full-page';\n\n const mergedRef = useMergeRefs(rootRef, __internalRootRef);\n const headerMergedRef = useMergeRefs(headerRef, __headerRef);\n\n // The container is only sticky on mobile if it is the header for the table.\n // In this case we don't want the container to have sticky styles, as only the table header row will show as stuck on scroll.\n const shouldHaveStickyStyles = isSticky && !isMobile;\n\n const hasMedia = !!media?.content;\n const mediaPosition = media?.position ?? 'top';\n\n return (\n <div\n {...baseProps}\n {...__funnelSubStepProps}\n className={clsx(\n baseProps.className,\n styles.root,\n styles[`variant-${variant}`],\n fitHeight && styles['fit-height'],\n hasMedia && (mediaPosition === 'side' ? styles['with-side-media'] : styles['with-top-media']),\n shouldHaveStickyStyles && [styles['sticky-enabled']],\n shouldHaveStickyStyles && isStuck && isStuckAtBottom && [styles['with-stuck-sticky-header-at-bottom']],\n isRefresh && styles.refresh\n )}\n ref={mergedRef}\n {...getAnalyticsLabelAttribute(\n `.${analyticsSelectors.header} h1, .${analyticsSelectors.header} h2, .${analyticsSelectors.header} h3`\n )}\n style={getRootStyles(style)}\n >\n {hasMedia && (\n <div\n className={clsx(styles[`media-${mediaPosition === 'side' ? 'side' : 'top'}`], styles.media)}\n style={\n mediaPosition === 'top'\n ? { ...getMediaStyles(mediaPosition, style), height: media?.height || '' }\n : { ...getMediaStyles(mediaPosition, style), width: media?.width || '' }\n }\n >\n {media.content}\n </div>\n )}\n <div\n id={contentId}\n ref={__subStepRef}\n className={clsx(styles['content-wrapper'], fitHeight && styles['content-wrapper-fit-height'])}\n >\n {header && (\n <ContainerHeaderContextProvider>\n <StickyHeaderContext.Provider value={{ isStuck, isStuckAtBottom }}>\n <div\n className={clsx(\n isRefresh && styles.refresh,\n styles.header,\n analyticsSelectors.header,\n styles[`header-variant-${variant}`],\n {\n [styles['header-sticky-disabled']]: __stickyHeader && !isSticky,\n [styles['header-sticky-enabled']]: isSticky,\n [styles['header-dynamic-height']]: hasDynamicHeight,\n [styles['header-stuck']]: isStuck,\n [styles['with-paddings']]: !disableHeaderPaddings,\n [styles['with-hidden-content']]: !children || __hiddenContent,\n [styles['header-with-media']]: hasMedia,\n [styles['header-full-page']]: __fullPage && isRefresh,\n }\n )}\n ref={headerMergedRef}\n style={{\n ...stickyStyles.style,\n ...getHeaderStyles(style),\n }}\n >\n {isStuck && !isMobile && isRefresh && __fullPage && <div className={styles['header-cover']}></div>}\n {header}\n </div>\n </StickyHeaderContext.Provider>\n </ContainerHeaderContextProvider>\n )}\n <div className={clsx(styles.content, fitHeight && styles['content-fit-height'])}>\n <div\n className={clsx(styles['content-inner'], testStyles['content-inner'], {\n [styles['with-paddings']]: !disableContentPaddings,\n [styles['with-header']]: !!header,\n })}\n style={getContentStyles(style)}\n >\n {children}\n </div>\n </div>\n {footer && (\n <div\n className={clsx(styles.footer, {\n [styles['with-divider']]: !__disableFooterDivider,\n [styles['with-paddings']]: !disableFooterPaddings,\n })}\n style={getFooterStyles(style)}\n >\n {footer}\n </div>\n )}\n </div>\n </div>\n );\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ContainerProps } from './interfaces';
|
|
2
|
+
export declare function getRootStyles(style: ContainerProps.Style | undefined): {};
|
|
3
|
+
export declare function getContentStyles(style: ContainerProps.Style | undefined): {};
|
|
4
|
+
export declare function getHeaderStyles(style: ContainerProps.Style | undefined): {};
|
|
5
|
+
export declare function getFooterStyles(style: ContainerProps.Style | undefined): {};
|
|
6
|
+
export declare function getMediaStyles(mediaPosition: string, style: ContainerProps.Style | undefined): {};
|
|
7
|
+
//# sourceMappingURL=style.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../src/container/style.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,GAAG,SAAS,MAcpE;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,GAAG,SAAS,MAWvE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,GAAG,SAAS,MAatE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,GAAG,SAAS,MAatE;AAED,wBAAgB,cAAc,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,CAAC,KAAK,GAAG,SAAS,MAY5F"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { SYSTEM } from '../internal/environment';
|
|
4
|
+
export function getRootStyles(style) {
|
|
5
|
+
var _a, _b, _c, _d, _e;
|
|
6
|
+
let properties = {};
|
|
7
|
+
if (SYSTEM === 'core' && (style === null || style === void 0 ? void 0 : style.root)) {
|
|
8
|
+
properties = {
|
|
9
|
+
background: (_a = style.root) === null || _a === void 0 ? void 0 : _a.background,
|
|
10
|
+
borderColor: (_b = style.root) === null || _b === void 0 ? void 0 : _b.borderColor,
|
|
11
|
+
borderRadius: (_c = style.root) === null || _c === void 0 ? void 0 : _c.borderRadius,
|
|
12
|
+
borderWidth: (_d = style.root) === null || _d === void 0 ? void 0 : _d.borderWidth,
|
|
13
|
+
boxShadow: (_e = style.root) === null || _e === void 0 ? void 0 : _e.boxShadow,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
return properties;
|
|
17
|
+
}
|
|
18
|
+
export function getContentStyles(style) {
|
|
19
|
+
var _a, _b;
|
|
20
|
+
let properties = {};
|
|
21
|
+
if (SYSTEM === 'core' && (style === null || style === void 0 ? void 0 : style.content)) {
|
|
22
|
+
properties = {
|
|
23
|
+
paddingBlock: (_a = style.content) === null || _a === void 0 ? void 0 : _a.paddingBlock,
|
|
24
|
+
paddingInline: (_b = style.content) === null || _b === void 0 ? void 0 : _b.paddingInline,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
return properties;
|
|
28
|
+
}
|
|
29
|
+
export function getHeaderStyles(style) {
|
|
30
|
+
var _a, _b, _c, _d, _e, _f;
|
|
31
|
+
let properties = {};
|
|
32
|
+
if (SYSTEM === 'core' && (style === null || style === void 0 ? void 0 : style.header)) {
|
|
33
|
+
properties = Object.assign(Object.assign(Object.assign({}, (((_a = style === null || style === void 0 ? void 0 : style.root) === null || _a === void 0 ? void 0 : _a.background) && { background: (_b = style === null || style === void 0 ? void 0 : style.root) === null || _b === void 0 ? void 0 : _b.background })), (((_c = style === null || style === void 0 ? void 0 : style.root) === null || _c === void 0 ? void 0 : _c.borderRadius) && { background: (_d = style === null || style === void 0 ? void 0 : style.root) === null || _d === void 0 ? void 0 : _d.borderRadius })), { paddingBlock: (_e = style.header) === null || _e === void 0 ? void 0 : _e.paddingBlock, paddingInline: (_f = style.header) === null || _f === void 0 ? void 0 : _f.paddingInline });
|
|
34
|
+
}
|
|
35
|
+
return properties;
|
|
36
|
+
}
|
|
37
|
+
export function getFooterStyles(style) {
|
|
38
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
39
|
+
let properties = {};
|
|
40
|
+
if (SYSTEM === 'core' && (style === null || style === void 0 ? void 0 : style.footer)) {
|
|
41
|
+
properties = {
|
|
42
|
+
borderColor: (_b = (_a = style.footer) === null || _a === void 0 ? void 0 : _a.divider) === null || _b === void 0 ? void 0 : _b.borderColor,
|
|
43
|
+
borderWidth: (_d = (_c = style.footer) === null || _c === void 0 ? void 0 : _c.divider) === null || _d === void 0 ? void 0 : _d.borderWidth,
|
|
44
|
+
paddingBlock: (_f = (_e = style.footer) === null || _e === void 0 ? void 0 : _e.root) === null || _f === void 0 ? void 0 : _f.paddingBlock,
|
|
45
|
+
paddingInline: (_h = (_g = style.footer) === null || _g === void 0 ? void 0 : _g.root) === null || _h === void 0 ? void 0 : _h.paddingInline,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
return properties;
|
|
49
|
+
}
|
|
50
|
+
export function getMediaStyles(mediaPosition, style) {
|
|
51
|
+
var _a, _b;
|
|
52
|
+
let properties = {};
|
|
53
|
+
if (SYSTEM === 'core' && ((_a = style === null || style === void 0 ? void 0 : style.root) === null || _a === void 0 ? void 0 : _a.borderRadius)) {
|
|
54
|
+
properties = Object.assign(Object.assign({ borderRadius: (_b = style === null || style === void 0 ? void 0 : style.root) === null || _b === void 0 ? void 0 : _b.borderRadius }, (mediaPosition === 'top' && { borderEndStartRadius: '0px', borderEndEndRadius: '0px' })), (mediaPosition === 'side' && { borderStartEndRadius: '0px', borderEndEndRadius: '0px' }));
|
|
55
|
+
}
|
|
56
|
+
return properties;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.js","sourceRoot":"","sources":["../../../src/container/style.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAGjD,MAAM,UAAU,aAAa,CAAC,KAAuC;;IACnE,IAAI,UAAU,GAAG,EAAE,CAAC;IAEpB,IAAI,MAAM,KAAK,MAAM,KAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,CAAA,EAAE;QACpC,UAAU,GAAG;YACX,UAAU,EAAE,MAAA,KAAK,CAAC,IAAI,0CAAE,UAAU;YAClC,WAAW,EAAE,MAAA,KAAK,CAAC,IAAI,0CAAE,WAAW;YACpC,YAAY,EAAE,MAAA,KAAK,CAAC,IAAI,0CAAE,YAAY;YACtC,WAAW,EAAE,MAAA,KAAK,CAAC,IAAI,0CAAE,WAAW;YACpC,SAAS,EAAE,MAAA,KAAK,CAAC,IAAI,0CAAE,SAAS;SACjC,CAAC;KACH;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,KAAuC;;IACtE,IAAI,UAAU,GAAG,EAAE,CAAC;IAEpB,IAAI,MAAM,KAAK,MAAM,KAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,CAAA,EAAE;QACvC,UAA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AAA,KAAK,CAAC,MAAM,0CAAE,IAAI,0CAAE,YAAY;YAC9C,aAAa,EAAE,MAAA,MAAA,KAAK,CAAC,MAAM,0CAAE,IAAI,0CAAE,aAAa;SACjD,CAAC;KACH;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,aAAqB,EAAE,KAAuC;;IAC3F,IAAI,UAAU,GAAG,EAAE,CAAC;IAEpB,IAAI,MAAM,KAAK,MAAM,KAAI,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,0CAAE,YAAY,CAAA,EAAE;QAClD,UAAU,iCACR,YAAY,EAAE,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,0CAAE,YAAY,IACpC,CAAC,aAAa,KAAK,KAAK,IAAI,EAAE,oBAAoB,EAAE,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,CAAC,GACvF,CAAC,aAAa,KAAK,MAAM,IAAI,EAAE,oBAAoB,EAAE,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,CAAC,CAC5F,CAAC;KACH;IAED,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { SYSTEM } from '../internal/environment';\nimport { ContainerProps } from './interfaces';\n\nexport function getRootStyles(style: ContainerProps.Style | undefined) {\n let properties = {};\n\n if (SYSTEM === 'core' && style?.root) {\n properties = {\n background: style.root?.background,\n borderColor: style.root?.borderColor,\n borderRadius: style.root?.borderRadius,\n borderWidth: style.root?.borderWidth,\n boxShadow: style.root?.boxShadow,\n };\n }\n\n return properties;\n}\n\nexport function getContentStyles(style: ContainerProps.Style | undefined) {\n let properties = {};\n\n if (SYSTEM === 'core' && style?.content) {\n properties = {\n paddingBlock: style.content?.paddingBlock,\n paddingInline: style.content?.paddingInline,\n };\n }\n\n return properties;\n}\n\nexport function getHeaderStyles(style: ContainerProps.Style | undefined) {\n let properties = {};\n\n if (SYSTEM === 'core' && style?.header) {\n properties = {\n ...(style?.root?.background && { background: style?.root?.background }),\n ...(style?.root?.borderRadius && { background: style?.root?.borderRadius }),\n paddingBlock: style.header?.paddingBlock,\n paddingInline: style.header?.paddingInline,\n };\n }\n\n return properties;\n}\n\nexport function getFooterStyles(style: ContainerProps.Style | undefined) {\n let properties = {};\n\n if (SYSTEM === 'core' && style?.footer) {\n properties = {\n borderColor: style.footer?.divider?.borderColor,\n borderWidth: style.footer?.divider?.borderWidth,\n paddingBlock: style.footer?.root?.paddingBlock,\n paddingInline: style.footer?.root?.paddingInline,\n };\n }\n\n return properties;\n}\n\nexport function getMediaStyles(mediaPosition: string, style: ContainerProps.Style | undefined) {\n let properties = {};\n\n if (SYSTEM === 'core' && style?.root?.borderRadius) {\n properties = {\n borderRadius: style?.root?.borderRadius,\n ...(mediaPosition === 'top' && { borderEndStartRadius: '0px', borderEndEndRadius: '0px' }),\n ...(mediaPosition === 'side' && { borderStartEndRadius: '0px', borderEndEndRadius: '0px' }),\n };\n }\n\n return properties;\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export var PACKAGE_SOURCE = "components";
|
|
2
|
-
export var PACKAGE_VERSION = "3.0.0 (
|
|
3
|
-
export var GIT_SHA = "
|
|
2
|
+
export var PACKAGE_VERSION = "3.0.0 (311693cb)";
|
|
3
|
+
export var GIT_SHA = "311693cb";
|
|
4
4
|
export var THEME = "open-source-visual-refresh";
|
|
5
5
|
export var SYSTEM = "console";
|
|
6
6
|
export var ALWAYS_VISUAL_REFRESH = true;
|