@cloudscape-design/chat-components 1.0.24 → 1.0.26
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/avatar/interfaces.d.ts +11 -5
- package/avatar/interfaces.js.map +1 -1
- package/avatar/internal.d.ts +1 -1
- package/avatar/internal.js +12 -7
- package/avatar/internal.js.map +1 -1
- package/avatar/loading-dots/index.d.ts +2 -1
- package/avatar/loading-dots/index.js +3 -2
- package/avatar/loading-dots/index.js.map +1 -1
- package/avatar/loading-dots/styles.css.js +7 -7
- package/avatar/loading-dots/styles.scoped.css +36 -36
- package/avatar/loading-dots/styles.selectors.js +7 -7
- package/avatar/styles.css.js +6 -5
- package/avatar/styles.scoped.css +20 -8
- package/avatar/styles.selectors.js +6 -5
- package/internal/api-docs/components/avatar.js +17 -2
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/events/index.js.map +1 -1
- package/internal/manifest.json +1 -1
- package/package.json +1 -1
package/avatar/interfaces.d.ts
CHANGED
|
@@ -39,18 +39,24 @@ export interface AvatarProps {
|
|
|
39
39
|
iconName?: IconProps.Name;
|
|
40
40
|
/**
|
|
41
41
|
* Specifies the URL of a custom icon. Use this property if the icon you want isn't available, and your custom icon can't be an SVG.
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* If you set both `iconUrl` and `iconSvg`, `iconSvg` will take precedence.
|
|
42
|
+
* @deprecated Use `iconSvg` or `imgUrl` instead.
|
|
45
43
|
*/
|
|
46
44
|
iconUrl?: string;
|
|
47
45
|
/**
|
|
48
46
|
* Specifies the SVG of a custom icon.
|
|
49
|
-
*
|
|
50
47
|
* Use this property if the icon you want isn't available.
|
|
51
|
-
* If you set both `iconUrl` and `iconSvg`, `iconSvg` will take precedence.
|
|
52
48
|
*/
|
|
53
49
|
iconSvg?: React.ReactNode;
|
|
50
|
+
/**
|
|
51
|
+
* Specifies the URL of a custom image. If you set both `iconUrl` and `imgUrl`, `imgUrl` will take precedence.
|
|
52
|
+
*/
|
|
53
|
+
imgUrl?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Defines the width and height of the avatar.
|
|
56
|
+
* This value corresponds to the `width` CSS-property and will center and crop images using `object-fit: cover`.
|
|
57
|
+
* The default and minimum width value is 28px.
|
|
58
|
+
*/
|
|
59
|
+
width?: number;
|
|
54
60
|
}
|
|
55
61
|
export declare namespace AvatarProps {
|
|
56
62
|
type Color = "default" | "gen-ai";
|
package/avatar/interfaces.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/avatar/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { IconProps } from \"@cloudscape-design/components/icon\";\n\nexport interface AvatarProps {\n /**\n * Determines the color of the avatar.\n * Use `gen-ai` for AI assistants and `default` otherwise.\n */\n color?: AvatarProps.Color;\n\n /**\n * The text content shown in the avatar's tooltip.\n *\n * When you use this property, make sure to include it in the `ariaLabel`.\n */\n tooltipText?: string;\n\n /**\n * The text content shown directly in the avatar's body.\n * Can be 1 or 2 symbols long, every subsequent symbol is ignored.\n * Use it to define initials that uniquely identify the avatar's owner.\n */\n initials?: string;\n\n /**\n * When set to true, a loading indicator is shown in avatar.\n */\n loading?: boolean;\n\n /**\n * Text to describe the avatar for assistive technology.\n * When more than one avatar is used, provide a unique label for each.\n * For example, \"Avatar of John Doe\" or \"Avatar of generative AI assistant\".\n *\n * If `tooltipText` is used make sure to include it in the `ariaLabel`.\n */\n ariaLabel: string;\n\n /**\n * Specifies the icon to be displayed as Avatar.\n * Use `gen-ai` icon for AI assistants. By default `user-profile` icon is used.\n *\n * If you set both `iconName` and `initials`, `initials` will take precedence.\n */\n iconName?: IconProps.Name;\n\n /**\n * Specifies the URL of a custom icon. Use this property if the icon you want isn't available, and your custom icon can't be an SVG.\n *
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/avatar/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { IconProps } from \"@cloudscape-design/components/icon\";\n\nexport interface AvatarProps {\n /**\n * Determines the color of the avatar.\n * Use `gen-ai` for AI assistants and `default` otherwise.\n */\n color?: AvatarProps.Color;\n\n /**\n * The text content shown in the avatar's tooltip.\n *\n * When you use this property, make sure to include it in the `ariaLabel`.\n */\n tooltipText?: string;\n\n /**\n * The text content shown directly in the avatar's body.\n * Can be 1 or 2 symbols long, every subsequent symbol is ignored.\n * Use it to define initials that uniquely identify the avatar's owner.\n */\n initials?: string;\n\n /**\n * When set to true, a loading indicator is shown in avatar.\n */\n loading?: boolean;\n\n /**\n * Text to describe the avatar for assistive technology.\n * When more than one avatar is used, provide a unique label for each.\n * For example, \"Avatar of John Doe\" or \"Avatar of generative AI assistant\".\n *\n * If `tooltipText` is used make sure to include it in the `ariaLabel`.\n */\n ariaLabel: string;\n\n /**\n * Specifies the icon to be displayed as Avatar.\n * Use `gen-ai` icon for AI assistants. By default `user-profile` icon is used.\n *\n * If you set both `iconName` and `initials`, `initials` will take precedence.\n */\n iconName?: IconProps.Name;\n\n /**\n * Specifies the URL of a custom icon. Use this property if the icon you want isn't available, and your custom icon can't be an SVG.\n * @deprecated Use `iconSvg` or `imgUrl` instead.\n */\n iconUrl?: string;\n\n /**\n * Specifies the SVG of a custom icon.\n * Use this property if the icon you want isn't available.\n */\n iconSvg?: React.ReactNode;\n\n /**\n * Specifies the URL of a custom image. If you set both `iconUrl` and `imgUrl`, `imgUrl` will take precedence.\n */\n imgUrl?: string;\n\n /**\n * Defines the width and height of the avatar.\n * This value corresponds to the `width` CSS-property and will center and crop images using `object-fit: cover`.\n * The default and minimum width value is 28px.\n */\n width?: number;\n}\n\nexport namespace AvatarProps {\n export type Color = \"default\" | \"gen-ai\";\n}\n"]}
|
package/avatar/internal.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ import { InternalBaseComponentProps } from "../internal/base-component/use-base-
|
|
|
2
2
|
import { AvatarProps } from "./interfaces.js";
|
|
3
3
|
export interface InternalAvatarProps extends AvatarProps, InternalBaseComponentProps {
|
|
4
4
|
}
|
|
5
|
-
export default function InternalAvatar({ color, tooltipText, initials, loading, ariaLabel, iconName, iconSvg, iconUrl, __internalRootRef, ...rest }: InternalAvatarProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export default function InternalAvatar({ color, tooltipText, initials, loading, ariaLabel, iconName, iconSvg, iconUrl, imgUrl, width, __internalRootRef, ...rest }: InternalAvatarProps): import("react/jsx-runtime").JSX.Element;
|
package/avatar/internal.js
CHANGED
|
@@ -6,27 +6,32 @@ import clsx from "clsx";
|
|
|
6
6
|
import { warnOnce } from "@cloudscape-design/component-toolkit/internal";
|
|
7
7
|
import Icon from "@cloudscape-design/components/icon";
|
|
8
8
|
import Tooltip from "@cloudscape-design/components/internal/tooltip-do-not-use";
|
|
9
|
+
import * as awsui from "@cloudscape-design/design-tokens";
|
|
9
10
|
import { getDataAttributes } from "../internal/base-component/get-data-attributes";
|
|
10
11
|
import { useMergeRefs } from "../internal/utils/use-merge-refs";
|
|
11
12
|
import LoadingDots from "./loading-dots";
|
|
12
13
|
import styles from "./styles.css.js";
|
|
13
|
-
const AvatarContent = ({ color, loading, initials, iconName, iconSvg, iconUrl, ariaLabel }) => {
|
|
14
|
+
const AvatarContent = ({ color, loading, initials, iconName, iconSvg, iconUrl, ariaLabel, width, imgUrl, }) => {
|
|
14
15
|
if (loading) {
|
|
15
|
-
return _jsx(LoadingDots, { color: color });
|
|
16
|
+
return _jsx(LoadingDots, { color: color, width: width });
|
|
17
|
+
}
|
|
18
|
+
if (imgUrl) {
|
|
19
|
+
return _jsx("img", { className: styles.image, src: imgUrl, style: { height: width, width: width } });
|
|
16
20
|
}
|
|
17
21
|
if (initials) {
|
|
18
22
|
const letters = initials.length > 2 ? initials.slice(0, 2) : initials;
|
|
19
23
|
if (initials.length > 2) {
|
|
20
24
|
warnOnce("Avatar", `"initials" is longer than 2 characters. Only the first two characters are shown.`);
|
|
21
25
|
}
|
|
22
|
-
return _jsx("span", { children: letters });
|
|
26
|
+
return (_jsx("span", { style: { fontSize: `clamp(${awsui.fontSizeBodyS}, calc(0.4px * ${width}), calc(0.4px * ${width}))` }, children: letters }));
|
|
23
27
|
}
|
|
24
|
-
return _jsx(Icon, { name: iconName, svg: iconSvg, url: iconUrl, alt: ariaLabel });
|
|
28
|
+
return _jsx(Icon, { name: iconName, svg: iconSvg, url: iconUrl, alt: ariaLabel, size: "inherit" });
|
|
25
29
|
};
|
|
26
|
-
export default function InternalAvatar({ color, tooltipText, initials, loading = false, ariaLabel, iconName, iconSvg, iconUrl, __internalRootRef = null, ...rest }) {
|
|
30
|
+
export default function InternalAvatar({ color, tooltipText, initials, loading = false, ariaLabel, iconName, iconSvg, iconUrl, imgUrl, width = 28, __internalRootRef = null, ...rest }) {
|
|
27
31
|
const handleRef = useRef(null);
|
|
28
32
|
const [showTooltip, setShowTooltip] = useState(false);
|
|
29
33
|
const mergedRef = useMergeRefs(handleRef, __internalRootRef);
|
|
34
|
+
const computedSize = width < 28 ? 28 : width;
|
|
30
35
|
const tooltipAttributes = {
|
|
31
36
|
onFocus: () => {
|
|
32
37
|
setShowTooltip(true);
|
|
@@ -49,8 +54,8 @@ export default function InternalAvatar({ color, tooltipText, initials, loading =
|
|
|
49
54
|
};
|
|
50
55
|
return (_jsxs("div", { ...getDataAttributes(rest), ref: mergedRef, tabIndex: 0, className: clsx(styles.root, styles[`avatar-color-${color}`], {
|
|
51
56
|
[styles.initials]: initials,
|
|
52
|
-
}), role: "img", "aria-label": ariaLabel, ...tooltipAttributes, children: [showTooltip && tooltipText && (_jsx(Tooltip, { value: tooltipText, trackRef: handleRef,
|
|
57
|
+
}), role: "img", "aria-label": ariaLabel, ...tooltipAttributes, style: { height: computedSize, width: computedSize }, children: [showTooltip && tooltipText && (_jsx(Tooltip, { value: tooltipText, trackRef: handleRef,
|
|
53
58
|
// This is added to ensure tooltip is closed when clicked for consistency with other tooltip usages
|
|
54
|
-
contentAttributes: { onPointerDown: () => setShowTooltip(false) } })), _jsx("div", { className: styles.content, "aria-hidden": "true", children: _jsx(AvatarContent, { color: color, ariaLabel: ariaLabel, initials: initials, loading: loading, iconName: iconName, iconSvg: iconSvg, iconUrl: iconUrl }) })] }));
|
|
59
|
+
contentAttributes: { onPointerDown: () => setShowTooltip(false) } })), _jsx("div", { className: styles.content, "aria-hidden": "true", style: { lineHeight: `calc(.8px * ${computedSize})` }, children: _jsx(AvatarContent, { color: color, ariaLabel: ariaLabel, initials: initials, loading: loading, iconName: iconName, iconSvg: iconSvg, iconUrl: iconUrl, imgUrl: imgUrl, width: computedSize }) })] }));
|
|
55
60
|
}
|
|
56
61
|
//# sourceMappingURL=internal.js.map
|
package/avatar/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/avatar/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AACzE,OAAO,IAAI,MAAM,oCAAoC,CAAC;AACtD,OAAO,OAAO,MAAM,2DAA2D,CAAC;
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/avatar/internal.tsx"],"names":[],"mappings":"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","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useRef, useState } from \"react\";\nimport clsx from \"clsx\";\n\nimport { warnOnce } from \"@cloudscape-design/component-toolkit/internal\";\nimport Icon from \"@cloudscape-design/components/icon\";\nimport Tooltip from \"@cloudscape-design/components/internal/tooltip-do-not-use\";\nimport * as awsui from \"@cloudscape-design/design-tokens\";\n\nimport { getDataAttributes } from \"../internal/base-component/get-data-attributes\";\nimport { InternalBaseComponentProps } from \"../internal/base-component/use-base-component\";\nimport { useMergeRefs } from \"../internal/utils/use-merge-refs\";\nimport { AvatarProps } from \"./interfaces.js\";\nimport LoadingDots from \"./loading-dots\";\n\nimport styles from \"./styles.css.js\";\n\nexport interface InternalAvatarProps extends AvatarProps, InternalBaseComponentProps {}\n\nconst AvatarContent = ({\n color,\n loading,\n initials,\n iconName,\n iconSvg,\n iconUrl,\n ariaLabel,\n width,\n imgUrl,\n}: AvatarProps) => {\n if (loading) {\n return <LoadingDots color={color} width={width} />;\n }\n\n if (imgUrl) {\n return <img className={styles.image} src={imgUrl} style={{ height: width, width: width }} />;\n }\n\n if (initials) {\n const letters = initials.length > 2 ? initials.slice(0, 2) : initials;\n\n if (initials.length > 2) {\n warnOnce(\"Avatar\", `\"initials\" is longer than 2 characters. Only the first two characters are shown.`);\n }\n\n return (\n <span style={{ fontSize: `clamp(${awsui.fontSizeBodyS}, calc(0.4px * ${width}), calc(0.4px * ${width}))` }}>\n {letters}\n </span>\n );\n }\n\n return <Icon name={iconName} svg={iconSvg} url={iconUrl} alt={ariaLabel} size=\"inherit\" />;\n};\n\nexport default function InternalAvatar({\n color,\n tooltipText,\n initials,\n loading = false,\n ariaLabel,\n iconName,\n iconSvg,\n iconUrl,\n imgUrl,\n width = 28,\n __internalRootRef = null,\n ...rest\n}: InternalAvatarProps) {\n const handleRef = useRef<HTMLDivElement>(null);\n const [showTooltip, setShowTooltip] = useState(false);\n\n const mergedRef = useMergeRefs(handleRef, __internalRootRef);\n const computedSize = width < 28 ? 28 : width;\n\n const tooltipAttributes = {\n onFocus: () => {\n setShowTooltip(true);\n },\n onBlur: () => {\n setShowTooltip(false);\n },\n onMouseEnter: () => {\n setShowTooltip(true);\n },\n onMouseLeave: () => {\n setShowTooltip(false);\n },\n onTouchStart: () => {\n setShowTooltip(true);\n },\n onTouchEnd: () => {\n setShowTooltip(false);\n },\n };\n\n return (\n <div\n {...getDataAttributes(rest)}\n ref={mergedRef}\n tabIndex={0}\n className={clsx(styles.root, styles[`avatar-color-${color}`], {\n [styles.initials]: initials,\n })}\n role=\"img\"\n aria-label={ariaLabel}\n {...tooltipAttributes}\n style={{ height: computedSize, width: computedSize }}\n >\n {showTooltip && tooltipText && (\n <Tooltip\n value={tooltipText}\n trackRef={handleRef}\n // This is added to ensure tooltip is closed when clicked for consistency with other tooltip usages\n contentAttributes={{ onPointerDown: () => setShowTooltip(false) }}\n />\n )}\n\n {/* aria-hidden is added so that screen readers focus only the parent div */}\n {/* when it is not hidden, it becomes unstable in JAWS */}\n <div className={styles.content} aria-hidden=\"true\" style={{ lineHeight: `calc(.8px * ${computedSize})` }}>\n <AvatarContent\n color={color}\n ariaLabel={ariaLabel}\n initials={initials}\n loading={loading}\n iconName={iconName}\n iconSvg={iconSvg}\n iconUrl={iconUrl}\n imgUrl={imgUrl}\n width={computedSize}\n />\n </div>\n </div>\n );\n}\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
interface LoadingDotsProps {
|
|
2
2
|
color?: string;
|
|
3
|
+
width?: number;
|
|
3
4
|
}
|
|
4
|
-
export default function LoadingDots({ color }: LoadingDotsProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export default function LoadingDots({ color, width }: LoadingDotsProps): import("react/jsx-runtime").JSX.Element;
|
|
5
6
|
export {};
|
|
@@ -3,9 +3,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
import clsx from "clsx";
|
|
5
5
|
import styles from "./styles.css.js";
|
|
6
|
-
export default function LoadingDots({ color }) {
|
|
6
|
+
export default function LoadingDots({ color, width }) {
|
|
7
|
+
const dotSize = `calc(.14px * ${width})`;
|
|
7
8
|
return (
|
|
8
9
|
// "gen-ai" class is added so that the gradient background animates.
|
|
9
|
-
_jsx("div", { className: clsx(styles.root, { [styles["gen-ai"]]: color === "gen-ai" }), children: _jsxs("div", { className: styles.typing, children: [_jsx("div", { className: styles.dot }), _jsx("div", { className: styles.dot }), _jsx("div", { className: styles.dot })] }) }));
|
|
10
|
+
_jsx("div", { className: clsx(styles.root, { [styles["gen-ai"]]: color === "gen-ai" }), children: _jsxs("div", { className: styles.typing, children: [_jsx("div", { className: styles.dot, style: { blockSize: dotSize, inlineSize: dotSize } }), _jsx("div", { className: styles.dot, style: { blockSize: dotSize, inlineSize: dotSize } }), _jsx("div", { className: styles.dot, style: { blockSize: dotSize, inlineSize: dotSize } })] }) }));
|
|
10
11
|
}
|
|
11
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/avatar/loading-dots/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,MAAM,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/avatar/loading-dots/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAOrC,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAAE,KAAK,EAAE,KAAK,EAAoB;IACpE,MAAM,OAAO,GAAG,gBAAgB,KAAK,GAAG,CAAC;IAEzC,OAAO;IACL,oEAAoE;IACpE,cAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,KAAK,KAAK,QAAQ,EAAE,CAAC,YAC3E,eAAK,SAAS,EAAE,MAAM,CAAC,MAAM,aAC3B,cAAK,SAAS,EAAE,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,GAAQ,EACtF,cAAK,SAAS,EAAE,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,GAAQ,EACtF,cAAK,SAAS,EAAE,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,GAAQ,IAClF,GACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from \"clsx\";\n\nimport styles from \"./styles.css.js\";\n\ninterface LoadingDotsProps {\n color?: string;\n width?: number;\n}\n\nexport default function LoadingDots({ color, width }: LoadingDotsProps) {\n const dotSize = `calc(.14px * ${width})`;\n\n return (\n // \"gen-ai\" class is added so that the gradient background animates.\n <div className={clsx(styles.root, { [styles[\"gen-ai\"]]: color === \"gen-ai\" })}>\n <div className={styles.typing}>\n <div className={styles.dot} style={{ blockSize: dotSize, inlineSize: dotSize }}></div>\n <div className={styles.dot} style={{ blockSize: dotSize, inlineSize: dotSize }}></div>\n <div className={styles.dot} style={{ blockSize: dotSize, inlineSize: dotSize }}></div>\n </div>\n </div>\n );\n}\n"]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"gen-ai": "awsui_gen-
|
|
5
|
-
"gradientMove": "
|
|
6
|
-
"gradientMoveReverse": "
|
|
7
|
-
"dot": "
|
|
8
|
-
"dotsDancing": "
|
|
9
|
-
"root": "
|
|
10
|
-
"typing": "
|
|
4
|
+
"gen-ai": "awsui_gen-ai_12y5i_7q8l3_19",
|
|
5
|
+
"gradientMove": "awsui_gradientMove_12y5i_7q8l3_1",
|
|
6
|
+
"gradientMoveReverse": "awsui_gradientMoveReverse_12y5i_7q8l3_1",
|
|
7
|
+
"dot": "awsui_dot_12y5i_7q8l3_81",
|
|
8
|
+
"dotsDancing": "awsui_dotsDancing_12y5i_7q8l3_1",
|
|
9
|
+
"root": "awsui_root_12y5i_7q8l3_162",
|
|
10
|
+
"typing": "awsui_typing_12y5i_7q8l3_176"
|
|
11
11
|
};
|
|
12
12
|
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
/* stylelint-disable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
|
|
18
18
|
/* stylelint-enable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
|
|
19
|
-
.awsui_gen-
|
|
19
|
+
.awsui_gen-ai_12y5i_7q8l3_19:not(#\9)::before {
|
|
20
20
|
content: "";
|
|
21
21
|
position: absolute;
|
|
22
22
|
inline-size: inherit;
|
|
@@ -25,52 +25,52 @@
|
|
|
25
25
|
inset-inline-start: 50%;
|
|
26
26
|
transform: translate(-50%, -50%);
|
|
27
27
|
background: var(--color-background-avatar-gen-ai-i9hcw6, radial-gradient(circle farthest-corner at top left, rgb(0, 150, 250) -25%, rgba(0, 150, 250, 0) 55%), radial-gradient(circle farthest-corner at top right, rgb(216, 178, 255) -10%, rgb(115, 0, 229) 50%));
|
|
28
|
-
animation:
|
|
28
|
+
animation: awsui_gradientMove_12y5i_7q8l3_1 var(--motion-duration-avatar-gen-ai-gradient-xetl2o, 3600ms) infinite var(--motion-easing-avatar-gen-ai-gradient-tjyrpp, cubic-bezier(0.7, 0, 0.3, 1));
|
|
29
29
|
}
|
|
30
30
|
@media (prefers-reduced-motion: reduce) {
|
|
31
|
-
.awsui_gen-
|
|
31
|
+
.awsui_gen-ai_12y5i_7q8l3_19:not(#\9)::before {
|
|
32
32
|
animation: none;
|
|
33
33
|
transition: none;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
.awsui-motion-disabled .awsui_gen-
|
|
36
|
+
.awsui-motion-disabled .awsui_gen-ai_12y5i_7q8l3_19:not(#\9)::before, .awsui-mode-entering .awsui_gen-ai_12y5i_7q8l3_19:not(#\9)::before {
|
|
37
37
|
animation: none;
|
|
38
38
|
transition: none;
|
|
39
39
|
}
|
|
40
|
-
.awsui_gen-
|
|
41
|
-
animation:
|
|
40
|
+
.awsui_gen-ai_12y5i_7q8l3_19:not(#\9):dir(rtl)::before {
|
|
41
|
+
animation: awsui_gradientMoveReverse_12y5i_7q8l3_1 var(--motion-duration-avatar-gen-ai-gradient-xetl2o, 3600ms) infinite var(--motion-easing-avatar-gen-ai-gradient-tjyrpp, cubic-bezier(0.7, 0, 0.3, 1));
|
|
42
42
|
}
|
|
43
43
|
@media (prefers-reduced-motion: reduce) {
|
|
44
|
-
.awsui_gen-
|
|
44
|
+
.awsui_gen-ai_12y5i_7q8l3_19:not(#\9):dir(rtl)::before {
|
|
45
45
|
animation: none;
|
|
46
46
|
transition: none;
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
.awsui-motion-disabled .awsui_gen-
|
|
49
|
+
.awsui-motion-disabled .awsui_gen-ai_12y5i_7q8l3_19:not(#\9):dir(rtl)::before, .awsui-mode-entering .awsui_gen-ai_12y5i_7q8l3_19:not(#\9):dir(rtl)::before {
|
|
50
50
|
animation: none;
|
|
51
51
|
transition: none;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
@keyframes
|
|
54
|
+
@keyframes awsui_gradientMove_12y5i_7q8l3_1 {
|
|
55
55
|
0% {
|
|
56
56
|
transform: translate(-50%, -50%) rotate(0deg);
|
|
57
57
|
}
|
|
58
58
|
50% {
|
|
59
|
-
block-size:
|
|
60
|
-
inline-size:
|
|
59
|
+
block-size: 150%;
|
|
60
|
+
inline-size: 150%;
|
|
61
61
|
}
|
|
62
62
|
100% {
|
|
63
63
|
transform: translate(-50%, -50%) rotate(360deg);
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
@keyframes
|
|
66
|
+
@keyframes awsui_gradientMoveReverse_12y5i_7q8l3_1 {
|
|
67
67
|
0% {
|
|
68
68
|
transform: translate(-50%, -50%) rotate(360deg);
|
|
69
69
|
inset-inline-start: -50%;
|
|
70
70
|
}
|
|
71
71
|
50% {
|
|
72
|
-
block-size:
|
|
73
|
-
inline-size:
|
|
72
|
+
block-size: 150%;
|
|
73
|
+
inline-size: 150%;
|
|
74
74
|
inset-inline-start: -100%;
|
|
75
75
|
}
|
|
76
76
|
100% {
|
|
@@ -78,88 +78,88 @@
|
|
|
78
78
|
inset-inline-start: -50%;
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
.
|
|
82
|
-
animation:
|
|
81
|
+
.awsui_dot_12y5i_7q8l3_81:not(#\9) {
|
|
82
|
+
animation: awsui_dotsDancing_12y5i_7q8l3_1 var(--motion-duration-avatar-loading-dots-pe8a3q, 1200ms) infinite ease-in-out;
|
|
83
83
|
}
|
|
84
84
|
@media (prefers-reduced-motion: reduce) {
|
|
85
|
-
.
|
|
85
|
+
.awsui_dot_12y5i_7q8l3_81:not(#\9) {
|
|
86
86
|
animation: none;
|
|
87
87
|
transition: none;
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
.awsui-motion-disabled .
|
|
90
|
+
.awsui-motion-disabled .awsui_dot_12y5i_7q8l3_81:not(#\9), .awsui-mode-entering .awsui_dot_12y5i_7q8l3_81:not(#\9) {
|
|
91
91
|
animation: none;
|
|
92
92
|
transition: none;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
.
|
|
95
|
+
.awsui_dot_12y5i_7q8l3_81:not(#\9):nth-child(1) {
|
|
96
96
|
animation-delay: 100ms;
|
|
97
97
|
}
|
|
98
98
|
@media (prefers-reduced-motion: reduce) {
|
|
99
|
-
.
|
|
99
|
+
.awsui_dot_12y5i_7q8l3_81:not(#\9):nth-child(1) {
|
|
100
100
|
animation: none;
|
|
101
101
|
transition: none;
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
.awsui-motion-disabled .
|
|
104
|
+
.awsui-motion-disabled .awsui_dot_12y5i_7q8l3_81:not(#\9):nth-child(1), .awsui-mode-entering .awsui_dot_12y5i_7q8l3_81:not(#\9):nth-child(1) {
|
|
105
105
|
animation: none;
|
|
106
106
|
transition: none;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
.
|
|
109
|
+
.awsui_dot_12y5i_7q8l3_81:not(#\9):nth-child(2) {
|
|
110
110
|
animation-delay: 200ms;
|
|
111
111
|
}
|
|
112
112
|
@media (prefers-reduced-motion: reduce) {
|
|
113
|
-
.
|
|
113
|
+
.awsui_dot_12y5i_7q8l3_81:not(#\9):nth-child(2) {
|
|
114
114
|
animation: none;
|
|
115
115
|
transition: none;
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
|
-
.awsui-motion-disabled .
|
|
118
|
+
.awsui-motion-disabled .awsui_dot_12y5i_7q8l3_81:not(#\9):nth-child(2), .awsui-mode-entering .awsui_dot_12y5i_7q8l3_81:not(#\9):nth-child(2) {
|
|
119
119
|
animation: none;
|
|
120
120
|
transition: none;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
.
|
|
123
|
+
.awsui_dot_12y5i_7q8l3_81:not(#\9):nth-child(3) {
|
|
124
124
|
animation-delay: 300ms;
|
|
125
125
|
}
|
|
126
126
|
@media (prefers-reduced-motion: reduce) {
|
|
127
|
-
.
|
|
127
|
+
.awsui_dot_12y5i_7q8l3_81:not(#\9):nth-child(3) {
|
|
128
128
|
animation: none;
|
|
129
129
|
transition: none;
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
|
-
.awsui-motion-disabled .
|
|
132
|
+
.awsui-motion-disabled .awsui_dot_12y5i_7q8l3_81:not(#\9):nth-child(3), .awsui-mode-entering .awsui_dot_12y5i_7q8l3_81:not(#\9):nth-child(3) {
|
|
133
133
|
animation: none;
|
|
134
134
|
transition: none;
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
.
|
|
137
|
+
.awsui_dot_12y5i_7q8l3_81:not(#\9):last-child {
|
|
138
138
|
margin-inline-end: 0;
|
|
139
139
|
}
|
|
140
140
|
@media (prefers-reduced-motion: reduce) {
|
|
141
|
-
.
|
|
141
|
+
.awsui_dot_12y5i_7q8l3_81:not(#\9):last-child {
|
|
142
142
|
animation: none;
|
|
143
143
|
transition: none;
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
|
-
.awsui-motion-disabled .
|
|
146
|
+
.awsui-motion-disabled .awsui_dot_12y5i_7q8l3_81:not(#\9):last-child, .awsui-mode-entering .awsui_dot_12y5i_7q8l3_81:not(#\9):last-child {
|
|
147
147
|
animation: none;
|
|
148
148
|
transition: none;
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
@keyframes
|
|
151
|
+
@keyframes awsui_dotsDancing_12y5i_7q8l3_1 {
|
|
152
152
|
0% {
|
|
153
153
|
transform: translateY(0px);
|
|
154
154
|
}
|
|
155
155
|
28% {
|
|
156
|
-
transform: translateY(-
|
|
156
|
+
transform: translateY(-100%);
|
|
157
157
|
}
|
|
158
158
|
44% {
|
|
159
159
|
transform: translateY(0px);
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
|
-
.
|
|
162
|
+
.awsui_root_12y5i_7q8l3_162:not(#\9) {
|
|
163
163
|
inline-size: inherit;
|
|
164
164
|
block-size: inherit;
|
|
165
165
|
border-start-start-radius: 50%;
|
|
@@ -173,14 +173,14 @@
|
|
|
173
173
|
overflow: hidden;
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
.
|
|
176
|
+
.awsui_typing_12y5i_7q8l3_176:not(#\9) {
|
|
177
177
|
align-items: center;
|
|
178
178
|
justify-content: space-between;
|
|
179
179
|
display: flex;
|
|
180
|
-
inline-size:
|
|
180
|
+
inline-size: 64%;
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
-
.
|
|
183
|
+
.awsui_dot_12y5i_7q8l3_81:not(#\9) {
|
|
184
184
|
background-color: var(--color-text-avatar-jddpvm, #ffffff);
|
|
185
185
|
border-start-start-radius: 50%;
|
|
186
186
|
border-start-end-radius: 50%;
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"gen-ai": "awsui_gen-
|
|
6
|
-
"gradientMove": "
|
|
7
|
-
"gradientMoveReverse": "
|
|
8
|
-
"dot": "
|
|
9
|
-
"dotsDancing": "
|
|
10
|
-
"root": "
|
|
11
|
-
"typing": "
|
|
5
|
+
"gen-ai": "awsui_gen-ai_12y5i_7q8l3_19",
|
|
6
|
+
"gradientMove": "awsui_gradientMove_12y5i_7q8l3_1",
|
|
7
|
+
"gradientMoveReverse": "awsui_gradientMoveReverse_12y5i_7q8l3_1",
|
|
8
|
+
"dot": "awsui_dot_12y5i_7q8l3_81",
|
|
9
|
+
"dotsDancing": "awsui_dotsDancing_12y5i_7q8l3_1",
|
|
10
|
+
"root": "awsui_root_12y5i_7q8l3_162",
|
|
11
|
+
"typing": "awsui_typing_12y5i_7q8l3_176"
|
|
12
12
|
};
|
|
13
13
|
|
package/avatar/styles.css.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"root": "
|
|
5
|
-
"avatar-color-default": "awsui_avatar-color-
|
|
6
|
-
"avatar-color-gen-ai": "awsui_avatar-color-gen-
|
|
7
|
-
"initials": "
|
|
8
|
-
"
|
|
4
|
+
"root": "awsui_root_1qkal_155wn_15",
|
|
5
|
+
"avatar-color-default": "awsui_avatar-color-default_1qkal_155wn_50",
|
|
6
|
+
"avatar-color-gen-ai": "awsui_avatar-color-gen-ai_1qkal_155wn_53",
|
|
7
|
+
"initials": "awsui_initials_1qkal_155wn_56",
|
|
8
|
+
"image": "awsui_image_1qkal_155wn_83",
|
|
9
|
+
"content": "awsui_content_1qkal_155wn_87"
|
|
9
10
|
};
|
|
10
11
|
|
package/avatar/styles.scoped.css
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
/* stylelint-disable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
|
|
14
14
|
/* stylelint-enable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
|
|
15
|
-
.
|
|
15
|
+
.awsui_root_1qkal_155wn_15:not(#\9) {
|
|
16
16
|
border-collapse: separate;
|
|
17
17
|
border-spacing: 0;
|
|
18
18
|
box-sizing: border-box;
|
|
@@ -48,28 +48,28 @@
|
|
|
48
48
|
border-end-start-radius: 50%;
|
|
49
49
|
border-end-end-radius: 50%;
|
|
50
50
|
}
|
|
51
|
-
.
|
|
51
|
+
.awsui_root_1qkal_155wn_15.awsui_avatar-color-default_1qkal_155wn_50:not(#\9) {
|
|
52
52
|
background-color: var(--color-background-avatar-default-rci9zy, #424650);
|
|
53
53
|
}
|
|
54
|
-
.
|
|
54
|
+
.awsui_root_1qkal_155wn_15.awsui_avatar-color-gen-ai_1qkal_155wn_53:not(#\9) {
|
|
55
55
|
background: var(--color-background-avatar-gen-ai-i9hcw6, radial-gradient(circle farthest-corner at top left, rgb(0, 150, 250) -25%, rgba(0, 150, 250, 0) 55%), radial-gradient(circle farthest-corner at top right, rgb(216, 178, 255) -10%, rgb(115, 0, 229) 50%));
|
|
56
56
|
}
|
|
57
|
-
.
|
|
57
|
+
.awsui_root_1qkal_155wn_15.awsui_initials_1qkal_155wn_56:not(#\9) {
|
|
58
58
|
font-family: var(--font-family-base-dnvic8, "Open Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
|
|
59
59
|
font-size: var(--font-size-body-s-asqx2i, 12px);
|
|
60
60
|
line-height: var(--line-height-body-s-7zv1j5, 16px);
|
|
61
61
|
font-weight: var(--font-weight-heading-l-f8711v, 700);
|
|
62
62
|
}
|
|
63
|
-
.
|
|
63
|
+
.awsui_root_1qkal_155wn_15:not(#\9):focus {
|
|
64
64
|
outline: none;
|
|
65
65
|
}
|
|
66
|
-
body[data-awsui-focus-visible=true] .
|
|
66
|
+
body[data-awsui-focus-visible=true] .awsui_root_1qkal_155wn_15:not(#\9):focus:focus {
|
|
67
67
|
position: relative;
|
|
68
68
|
box-sizing: border-box;
|
|
69
69
|
outline: 2px dotted transparent;
|
|
70
70
|
outline-offset: 0px;
|
|
71
71
|
}
|
|
72
|
-
body[data-awsui-focus-visible=true] .
|
|
72
|
+
body[data-awsui-focus-visible=true] .awsui_root_1qkal_155wn_15:not(#\9):focus:focus::before {
|
|
73
73
|
content: " ";
|
|
74
74
|
display: block;
|
|
75
75
|
position: absolute;
|
|
@@ -81,12 +81,24 @@ body[data-awsui-focus-visible=true] .awsui_root_1qkal_gzyqx_15:not(#\9):focus:fo
|
|
|
81
81
|
border-radius: 50%;
|
|
82
82
|
border: 2px solid var(--color-border-item-focused-nv6mhz, #006ce0);
|
|
83
83
|
}
|
|
84
|
+
.awsui_root_1qkal_155wn_15:not(#\9):has(.awsui_image_1qkal_155wn_83) {
|
|
85
|
+
background: transparent;
|
|
86
|
+
}
|
|
84
87
|
|
|
85
|
-
.
|
|
88
|
+
.awsui_content_1qkal_155wn_87:not(#\9) {
|
|
86
89
|
display: flex;
|
|
87
90
|
align-items: center;
|
|
88
91
|
justify-content: center;
|
|
89
92
|
block-size: inherit;
|
|
90
93
|
inline-size: inherit;
|
|
91
94
|
overflow: hidden;
|
|
95
|
+
}
|
|
96
|
+
.awsui_content_1qkal_155wn_87 .awsui_image_1qkal_155wn_83:not(#\9) {
|
|
97
|
+
border-start-start-radius: 50%;
|
|
98
|
+
border-start-end-radius: 50%;
|
|
99
|
+
border-end-start-radius: 50%;
|
|
100
|
+
border-end-end-radius: 50%;
|
|
101
|
+
block-size: 28px;
|
|
102
|
+
inline-size: 28px;
|
|
103
|
+
object-fit: cover;
|
|
92
104
|
}
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"root": "
|
|
6
|
-
"avatar-color-default": "awsui_avatar-color-
|
|
7
|
-
"avatar-color-gen-ai": "awsui_avatar-color-gen-
|
|
8
|
-
"initials": "
|
|
9
|
-
"
|
|
5
|
+
"root": "awsui_root_1qkal_155wn_15",
|
|
6
|
+
"avatar-color-default": "awsui_avatar-color-default_1qkal_155wn_50",
|
|
7
|
+
"avatar-color-gen-ai": "awsui_avatar-color-gen-ai_1qkal_155wn_53",
|
|
8
|
+
"initials": "awsui_initials_1qkal_155wn_56",
|
|
9
|
+
"image": "awsui_image_1qkal_155wn_83",
|
|
10
|
+
"content": "awsui_content_1qkal_155wn_87"
|
|
10
11
|
};
|
|
11
12
|
|
|
@@ -4,7 +4,7 @@ module.exports = {
|
|
|
4
4
|
"regions": [
|
|
5
5
|
{
|
|
6
6
|
"name": "iconSvg",
|
|
7
|
-
"description": "Specifies the SVG of a custom icon.\nUse this property if the icon you want isn't available
|
|
7
|
+
"description": "Specifies the SVG of a custom icon.\nUse this property if the icon you want isn't available.",
|
|
8
8
|
"isDefault": false
|
|
9
9
|
}
|
|
10
10
|
],
|
|
@@ -48,6 +48,8 @@ module.exports = {
|
|
|
48
48
|
"angle-down",
|
|
49
49
|
"arrow-left",
|
|
50
50
|
"arrow-right",
|
|
51
|
+
"arrow-up",
|
|
52
|
+
"arrow-down",
|
|
51
53
|
"audio-full",
|
|
52
54
|
"audio-half",
|
|
53
55
|
"audio-off",
|
|
@@ -173,7 +175,14 @@ module.exports = {
|
|
|
173
175
|
"name": "iconUrl",
|
|
174
176
|
"type": "string",
|
|
175
177
|
"optional": true,
|
|
176
|
-
"description": "Specifies the URL of a custom icon. Use this property if the icon you want isn't available, and your custom icon can't be an SVG
|
|
178
|
+
"description": "Specifies the URL of a custom icon. Use this property if the icon you want isn't available, and your custom icon can't be an SVG.",
|
|
179
|
+
"deprecatedTag": "Use `iconSvg` or `imgUrl` instead."
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"name": "imgUrl",
|
|
183
|
+
"type": "string",
|
|
184
|
+
"optional": true,
|
|
185
|
+
"description": "Specifies the URL of a custom image. If you set both `iconUrl` and `imgUrl`, `imgUrl` will take precedence."
|
|
177
186
|
},
|
|
178
187
|
{
|
|
179
188
|
"name": "initials",
|
|
@@ -192,6 +201,12 @@ module.exports = {
|
|
|
192
201
|
"type": "string",
|
|
193
202
|
"optional": true,
|
|
194
203
|
"description": "The text content shown in the avatar's tooltip.\nWhen you use this property, make sure to include it in the `ariaLabel`.\n"
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"name": "width",
|
|
207
|
+
"type": "number",
|
|
208
|
+
"optional": true,
|
|
209
|
+
"description": "Defines the width and height of the avatar.\nThis value corresponds to the `width` CSS-property and will center and crop images using `object-fit: cover`.\nThe default and minimum width value is 28px."
|
|
195
210
|
}
|
|
196
211
|
],
|
|
197
212
|
"events": []
|
package/internal/environment.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/internal/events/index.ts"],"names":[],"mappings":"AAiBA,MAAM,OAAO,eAAe;IAG1B,YACS,aAAsB,KAAK,EAC3B,SAAmB,IAAI;QADvB,eAAU,GAAV,UAAU,CAAiB;QAC3B,WAAM,GAAN,MAAM,CAAiB;QAJhC,qBAAgB,GAAG,KAAK,CAAC;QACzB,iBAAY,GAAG,KAAK,CAAC;IAIlB,CAAC;IAEJ,cAAc;QACZ,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAC/B,CAAC;IAED,eAAe;QACb,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;IAC3B,CAAC;CACF;AAED,MAAM,UAAU,iBAAiB,CAAI,EAAE,UAAU,EAAE,MAAM,EAAsB;IAC7E,OAAO,IAAI,eAAe,CAAC,UAAU,EAAE,MAAM,CAAgB,CAAC;AAChE,CAAC;AAED,MAAM,UAAU,mBAAmB,CACjC,OAA8C,EAC9C,MAAS,EACT,WAA0C;IAE1C,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,KAAK,CAAC;KACd;IACD,MAAM,KAAK,GAAG,iBAAiB,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IAC9D,OAAO,CAAC,KAAK,CAAC,CAAC;IACf,IAAI,KAAK,CAAC,gBAAgB,IAAI,WAAW,EAAE;QACzC,WAAW,CAAC,cAAc,EAAE,CAAC;KAC9B;IACD,IAAI,KAAK,CAAC,YAAY,IAAI,WAAW,EAAE;QACrC,WAAW,CAAC,eAAe,EAAE,CAAC;KAC/B;IACD,OAAO,KAAK,CAAC,gBAAgB,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAW,OAAiD,EAAE,MAAU;IAC5G,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO;KACR;IACD,MAAM,KAAK,GAAG,iBAAiB,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;IAC/D,OAAO,CAAC,KAAK,CAAC,CAAC;AACjB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport type CancelableEventHandler<Detail = object> = (event: CustomEvent<Detail>) => void;\n\n// eslint-disable-next-line @typescript-eslint/
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/internal/events/index.ts"],"names":[],"mappings":"AAiBA,MAAM,OAAO,eAAe;IAG1B,YACS,aAAsB,KAAK,EAC3B,SAAmB,IAAI;QADvB,eAAU,GAAV,UAAU,CAAiB;QAC3B,WAAM,GAAN,MAAM,CAAiB;QAJhC,qBAAgB,GAAG,KAAK,CAAC;QACzB,iBAAY,GAAG,KAAK,CAAC;IAIlB,CAAC;IAEJ,cAAc;QACZ,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAC/B,CAAC;IAED,eAAe;QACb,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;IAC3B,CAAC;CACF;AAED,MAAM,UAAU,iBAAiB,CAAI,EAAE,UAAU,EAAE,MAAM,EAAsB;IAC7E,OAAO,IAAI,eAAe,CAAC,UAAU,EAAE,MAAM,CAAgB,CAAC;AAChE,CAAC;AAED,MAAM,UAAU,mBAAmB,CACjC,OAA8C,EAC9C,MAAS,EACT,WAA0C;IAE1C,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,KAAK,CAAC;KACd;IACD,MAAM,KAAK,GAAG,iBAAiB,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IAC9D,OAAO,CAAC,KAAK,CAAC,CAAC;IACf,IAAI,KAAK,CAAC,gBAAgB,IAAI,WAAW,EAAE;QACzC,WAAW,CAAC,cAAc,EAAE,CAAC;KAC9B;IACD,IAAI,KAAK,CAAC,YAAY,IAAI,WAAW,EAAE;QACrC,WAAW,CAAC,eAAe,EAAE,CAAC;KAC/B;IACD,OAAO,KAAK,CAAC,gBAAgB,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAW,OAAiD,EAAE,MAAU;IAC5G,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO;KACR;IACD,MAAM,KAAK,GAAG,iBAAiB,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;IAC/D,OAAO,CAAC,KAAK,CAAC,CAAC;AACjB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport type CancelableEventHandler<Detail = object> = (event: CustomEvent<Detail>) => void;\n\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport type NonCancelableEventHandler<Detail = {}> = (event: NonCancelableCustomEvent<Detail>) => void;\n\nexport type NonCancelableCustomEvent<DetailType> = Omit<CustomEvent<DetailType>, \"preventDefault\">;\n\nexport interface ClickDetail {\n button: number;\n ctrlKey: boolean;\n shiftKey: boolean;\n altKey: boolean;\n metaKey: boolean;\n}\n\nexport class CustomEventStub<T> {\n defaultPrevented = false;\n cancelBubble = false;\n constructor(\n public cancelable: boolean = false,\n public detail: T | null = null,\n ) {}\n\n preventDefault() {\n this.defaultPrevented = true;\n }\n\n stopPropagation() {\n this.cancelBubble = true;\n }\n}\n\nexport function createCustomEvent<T>({ cancelable, detail }: CustomEventInit<T>): CustomEvent<T> {\n return new CustomEventStub(cancelable, detail) as CustomEvent;\n}\n\nexport function fireCancelableEvent<T>(\n handler: CancelableEventHandler<T> | undefined,\n detail: T,\n sourceEvent?: React.SyntheticEvent | Event,\n) {\n if (!handler) {\n return false;\n }\n const event = createCustomEvent({ cancelable: true, detail });\n handler(event);\n if (event.defaultPrevented && sourceEvent) {\n sourceEvent.preventDefault();\n }\n if (event.cancelBubble && sourceEvent) {\n sourceEvent.stopPropagation();\n }\n return event.defaultPrevented;\n}\n\nexport function fireNonCancelableEvent<T = null>(handler: NonCancelableEventHandler<T> | undefined, detail?: T) {\n if (!handler) {\n return;\n }\n const event = createCustomEvent({ cancelable: false, detail });\n handler(event);\n}\n"]}
|
package/internal/manifest.json
CHANGED