@cloudscape-design/chat-components 1.0.186 → 1.0.188

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/avatar/internal.d.ts +5 -1
  2. package/avatar/internal.js +4 -2
  3. package/avatar/internal.js.map +1 -1
  4. package/avatar/loading-dots/styles.css.js +7 -7
  5. package/avatar/loading-dots/styles.scoped.css +34 -38
  6. package/avatar/loading-dots/styles.selectors.js +7 -7
  7. package/avatar/styles.css.js +7 -7
  8. package/avatar/styles.scoped.css +70 -30
  9. package/avatar/styles.selectors.js +7 -7
  10. package/chat-bubble/internal.d.ts +6 -1
  11. package/chat-bubble/internal.js +3 -3
  12. package/chat-bubble/internal.js.map +1 -1
  13. package/chat-bubble/styles.css.js +11 -11
  14. package/chat-bubble/styles.scoped.css +25 -11
  15. package/chat-bubble/styles.selectors.js +11 -11
  16. package/internal/api-docs/style-api-doc/avatar.json +28 -0
  17. package/internal/api-docs/style-api-doc/chat-bubble.json +50 -0
  18. package/internal/api-docs/style-api-doc/support-prompt-group.json +39 -0
  19. package/internal/environment.js +1 -1
  20. package/internal/environment.json +1 -1
  21. package/internal/manifest.json +1 -1
  22. package/package.json +1 -1
  23. package/styling/avatar.scss +39 -0
  24. package/styling/chat-bubble.scss +72 -0
  25. package/styling/support-prompt-group.scss +65 -0
  26. package/support-prompt-group/internal.d.ts +8 -1
  27. package/support-prompt-group/internal.js +2 -2
  28. package/support-prompt-group/internal.js.map +1 -1
  29. package/support-prompt-group/prompt.d.ts +1 -0
  30. package/support-prompt-group/prompt.js +2 -2
  31. package/support-prompt-group/prompt.js.map +1 -1
  32. package/support-prompt-group/styles.css.js +8 -8
  33. package/support-prompt-group/styles.scoped.css +43 -19
  34. package/support-prompt-group/styles.selectors.js +8 -8
@@ -1,5 +1,9 @@
1
1
  import { InternalBaseComponentProps } from "../internal/base-component/use-base-component";
2
2
  import { AvatarProps } from "./interfaces.js";
3
3
  export interface InternalAvatarProps extends AvatarProps, InternalBaseComponentProps {
4
+ styleClassNames?: StyleClassNames;
4
5
  }
5
- export default function InternalAvatar({ color, tooltipText, initials, loading, ariaLabel, iconName, iconSvg, iconUrl, imgUrl, style, width, __internalRootRef, ...rest }: InternalAvatarProps): import("react/jsx-runtime").JSX.Element;
6
+ export interface StyleClassNames {
7
+ root?: string;
8
+ }
9
+ export default function InternalAvatar({ color, tooltipText, initials, loading, ariaLabel, iconName, iconSvg, iconUrl, imgUrl, style, width, styleClassNames, __internalRootRef, ...rest }: InternalAvatarProps): import("react/jsx-runtime").JSX.Element;
@@ -27,7 +27,7 @@ const AvatarContent = ({ color, loading, initials, iconName, iconSvg, iconUrl, a
27
27
  }
28
28
  return _jsx(Icon, { name: iconName, svg: iconSvg, url: iconUrl, alt: ariaLabel, size: "inherit" });
29
29
  };
30
- export default function InternalAvatar({ color, tooltipText, initials, loading = false, ariaLabel, iconName, iconSvg, iconUrl, imgUrl, style, width = 28, __internalRootRef = null, ...rest }) {
30
+ export default function InternalAvatar({ color, tooltipText, initials, loading = false, ariaLabel, iconName, iconSvg, iconUrl, imgUrl, style, width = 28, styleClassNames, __internalRootRef = null, ...rest }) {
31
31
  const handleRef = useRef(null);
32
32
  const [showTooltip, setShowTooltip] = useState(false);
33
33
  const mergedRef = useMergeRefs(handleRef, __internalRootRef);
@@ -52,6 +52,8 @@ export default function InternalAvatar({ color, tooltipText, initials, loading =
52
52
  setShowTooltip(false);
53
53
  },
54
54
  };
55
- return (_jsxs("div", { ...getDataAttributes(rest), ref: mergedRef, tabIndex: 0, className: clsx(styles.root, styles[`avatar-color-${color}`], { [styles.initials]: initials }), role: "img", "aria-label": ariaLabel, ...tooltipAttributes, style: { [customCssProps.avatarSize]: `${computedSize}px`, ...getRootStyles(style) }, children: [showTooltip && tooltipText && _jsx(Tooltip, { className: styles.tooltip, value: tooltipText, trackRef: handleRef }), _jsx("div", { className: styles.content, "aria-hidden": "true", style: getContentStyles(style), children: _jsx(AvatarContent, { color: color, ariaLabel: ariaLabel, initials: initials, loading: loading, iconName: iconName, iconSvg: iconSvg, iconUrl: iconUrl, imgUrl: imgUrl, style: style, width: computedSize }) })] }));
55
+ return (_jsxs("div", { ...getDataAttributes(rest), ref: mergedRef, tabIndex: 0, className: clsx(styleClassNames === null || styleClassNames === void 0 ? void 0 : styleClassNames.root, styles.root, styles[`avatar-color-${color}`], {
56
+ [styles.initials]: initials,
57
+ }), role: "img", "aria-label": ariaLabel, ...tooltipAttributes, style: { [customCssProps.avatarSize]: `${computedSize}px`, ...getRootStyles(style) }, children: [showTooltip && tooltipText && _jsx(Tooltip, { className: styles.tooltip, value: tooltipText, trackRef: handleRef }), _jsx("div", { className: styles.content, "aria-hidden": "true", style: getContentStyles(style), children: _jsx(AvatarContent, { color: color, ariaLabel: ariaLabel, initials: initials, loading: loading, iconName: iconName, iconSvg: iconSvg, iconUrl: iconUrl, imgUrl: imgUrl, style: style, width: computedSize }) })] }));
56
58
  }
57
59
  //# sourceMappingURL=internal.js.map
@@ -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,YAAY,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,IAAI,MAAM,oCAAoC,CAAC;AACtD,OAAO,OAAO,MAAM,2DAA2D,CAAC;AAEhF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AAEnF,OAAO,cAAc,MAAM,6CAA6C,CAAC;AAEzE,OAAO,WAAW,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE1E,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAIr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nF,WAAW,IAAI,WAAW,IAAI,KAAC,OAAO,IAAC,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,GAAI,EAI9G,cAAK,SAAS,EAAE,MAAM,CAAC,OAAO,iBAAc,MAAM,EAAC,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC,YAC/E,KAAC,aAAa,IACZ,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,YAAY,GACnB,GACE,IACF,CACP,CAAC;AACJ,CAAC","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 { useMergeRefs, 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\";\n\nimport { getDataAttributes } from \"../internal/base-component/get-data-attributes\";\nimport { InternalBaseComponentProps } from \"../internal/base-component/use-base-component\";\nimport customCssProps from \"../internal/generated/custom-css-properties\";\nimport { AvatarProps } from \"./interfaces.js\";\nimport LoadingDots from \"./loading-dots\";\nimport { getContentStyles, getImageStyles, getRootStyles } from \"./style\";\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 style,\n}: AvatarProps) => {\n if (loading) {\n return <LoadingDots color={color} width={width} style={style} />;\n }\n\n if (imgUrl) {\n return <img className={styles.image} src={imgUrl} style={getImageStyles(style)} />;\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 <span className={styles.initials}>{letters}</span>;\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 style,\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}`], { [styles.initials]: initials })}\n role=\"img\"\n aria-label={ariaLabel}\n {...tooltipAttributes}\n style={{ [customCssProps.avatarSize]: `${computedSize}px`, ...getRootStyles(style) }}\n >\n {showTooltip && tooltipText && <Tooltip className={styles.tooltip} value={tooltipText} trackRef={handleRef} />}\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={getContentStyles(style)}>\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 style={style}\n width={computedSize}\n />\n </div>\n </div>\n );\n}\n"]}
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,YAAY,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,IAAI,MAAM,oCAAoC,CAAC;AACtD,OAAO,OAAO,MAAM,2DAA2D,CAAC;AAEhF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AAEnF,OAAO,cAAc,MAAM,6CAA6C,CAAC;AAEzE,OAAO,WAAW,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE1E,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAWrC,MAAM,aAAa,GAAG,CAAC,EACrB,KAAK,EACL,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,OAAO,EACP,SAAS,EACT,KAAK,EACL,MAAM,EACN,KAAK,GACO,EAAE,EAAE;IAChB,IAAI,OAAO,EAAE;QACX,OAAO,KAAC,WAAW,IAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,GAAI,CAAC;KAClE;IAED,IAAI,MAAM,EAAE;QACV,OAAO,cAAK,SAAS,EAAE,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,GAAI,CAAC;KACpF;IAED,IAAI,QAAQ,EAAE;QACZ,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAA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C;AACJ,CAAC","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 { useMergeRefs, 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\";\n\nimport { getDataAttributes } from \"../internal/base-component/get-data-attributes\";\nimport { InternalBaseComponentProps } from \"../internal/base-component/use-base-component\";\nimport customCssProps from \"../internal/generated/custom-css-properties\";\nimport { AvatarProps } from \"./interfaces.js\";\nimport LoadingDots from \"./loading-dots\";\nimport { getContentStyles, getImageStyles, getRootStyles } from \"./style\";\n\nimport styles from \"./styles.css.js\";\n\nexport interface InternalAvatarProps extends AvatarProps, InternalBaseComponentProps {\n styleClassNames?: StyleClassNames;\n}\n\n// Style API v2\nexport interface StyleClassNames {\n root?: string;\n}\n\nconst AvatarContent = ({\n color,\n loading,\n initials,\n iconName,\n iconSvg,\n iconUrl,\n ariaLabel,\n width,\n imgUrl,\n style,\n}: AvatarProps) => {\n if (loading) {\n return <LoadingDots color={color} width={width} style={style} />;\n }\n\n if (imgUrl) {\n return <img className={styles.image} src={imgUrl} style={getImageStyles(style)} />;\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 <span className={styles.initials}>{letters}</span>;\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 style,\n width = 28,\n styleClassNames,\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(styleClassNames?.root, styles.root, styles[`avatar-color-${color}`], {\n [styles.initials]: initials,\n })}\n role=\"img\"\n aria-label={ariaLabel}\n {...tooltipAttributes}\n style={{ [customCssProps.avatarSize]: `${computedSize}px`, ...getRootStyles(style) }}\n >\n {showTooltip && tooltipText && <Tooltip className={styles.tooltip} value={tooltipText} trackRef={handleRef} />}\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={getContentStyles(style)}>\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 style={style}\n width={computedSize}\n />\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-ai_12y5i_4dtd0_19",
5
- "gradientMove": "awsui_gradientMove_12y5i_4dtd0_1",
6
- "gradientMoveReverse": "awsui_gradientMoveReverse_12y5i_4dtd0_1",
7
- "dot": "awsui_dot_12y5i_4dtd0_81",
8
- "dotsDancing": "awsui_dotsDancing_12y5i_4dtd0_1",
9
- "root": "awsui_root_12y5i_4dtd0_162",
10
- "typing": "awsui_typing_12y5i_4dtd0_176"
4
+ "gen-ai": "awsui_gen-ai_12y5i_du1jk_15",
5
+ "gradientMove": "awsui_gradientMove_12y5i_du1jk_1",
6
+ "gradientMoveReverse": "awsui_gradientMoveReverse_12y5i_du1jk_1",
7
+ "dot": "awsui_dot_12y5i_du1jk_77",
8
+ "dotsDancing": "awsui_dotsDancing_12y5i_du1jk_1",
9
+ "root": "awsui_root_12y5i_du1jk_158",
10
+ "typing": "awsui_typing_12y5i_du1jk_172"
11
11
  };
12
12
 
@@ -10,13 +10,9 @@
10
10
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
11
11
  SPDX-License-Identifier: Apache-2.0
12
12
  */
13
- /*
14
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
15
- SPDX-License-Identifier: Apache-2.0
16
- */
17
13
  /* stylelint-disable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
18
14
  /* stylelint-enable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
19
- .awsui_gen-ai_12y5i_4dtd0_19:not(#\9)::before {
15
+ .awsui_gen-ai_12y5i_du1jk_15:not(#\9)::before {
20
16
  content: "";
21
17
  position: absolute;
22
18
  inline-size: inherit;
@@ -25,33 +21,33 @@
25
21
  inset-inline-start: 50%;
26
22
  transform: translate(-50%, -50%);
27
23
  background: var(--color-background-avatar-gen-ai-j5h85i, radial-gradient(circle farthest-corner at top right, #b8e7ff 0%, #0099ff 25%, #5c7fff 40%, #8575ff 60%, #962eff 80%));
28
- animation: awsui_gradientMove_12y5i_4dtd0_1 var(--motion-duration-avatar-gen-ai-gradient-nmu97k, 3600ms) infinite var(--motion-easing-avatar-gen-ai-gradient-pz8n6b, cubic-bezier(0.7, 0, 0.3, 1));
24
+ animation: awsui_gradientMove_12y5i_du1jk_1 var(--motion-duration-avatar-gen-ai-gradient-nmu97k, 3600ms) infinite var(--motion-easing-avatar-gen-ai-gradient-pz8n6b, cubic-bezier(0.7, 0, 0.3, 1));
29
25
  }
30
26
  @media (prefers-reduced-motion: reduce) {
31
- .awsui_gen-ai_12y5i_4dtd0_19:not(#\9)::before {
27
+ .awsui_gen-ai_12y5i_du1jk_15:not(#\9)::before {
32
28
  animation: none;
33
29
  transition: none;
34
30
  }
35
31
  }
36
- .awsui-motion-disabled .awsui_gen-ai_12y5i_4dtd0_19:not(#\9)::before, .awsui-mode-entering .awsui_gen-ai_12y5i_4dtd0_19:not(#\9)::before {
32
+ .awsui-motion-disabled .awsui_gen-ai_12y5i_du1jk_15:not(#\9)::before, .awsui-mode-entering .awsui_gen-ai_12y5i_du1jk_15:not(#\9)::before {
37
33
  animation: none;
38
34
  transition: none;
39
35
  }
40
- .awsui_gen-ai_12y5i_4dtd0_19:not(#\9):dir(rtl)::before {
41
- animation: awsui_gradientMoveReverse_12y5i_4dtd0_1 var(--motion-duration-avatar-gen-ai-gradient-nmu97k, 3600ms) infinite var(--motion-easing-avatar-gen-ai-gradient-pz8n6b, cubic-bezier(0.7, 0, 0.3, 1));
36
+ .awsui_gen-ai_12y5i_du1jk_15:not(#\9):dir(rtl)::before {
37
+ animation: awsui_gradientMoveReverse_12y5i_du1jk_1 var(--motion-duration-avatar-gen-ai-gradient-nmu97k, 3600ms) infinite var(--motion-easing-avatar-gen-ai-gradient-pz8n6b, cubic-bezier(0.7, 0, 0.3, 1));
42
38
  }
43
39
  @media (prefers-reduced-motion: reduce) {
44
- .awsui_gen-ai_12y5i_4dtd0_19:not(#\9):dir(rtl)::before {
40
+ .awsui_gen-ai_12y5i_du1jk_15:not(#\9):dir(rtl)::before {
45
41
  animation: none;
46
42
  transition: none;
47
43
  }
48
44
  }
49
- .awsui-motion-disabled .awsui_gen-ai_12y5i_4dtd0_19:not(#\9):dir(rtl)::before, .awsui-mode-entering .awsui_gen-ai_12y5i_4dtd0_19:not(#\9):dir(rtl)::before {
45
+ .awsui-motion-disabled .awsui_gen-ai_12y5i_du1jk_15:not(#\9):dir(rtl)::before, .awsui-mode-entering .awsui_gen-ai_12y5i_du1jk_15:not(#\9):dir(rtl)::before {
50
46
  animation: none;
51
47
  transition: none;
52
48
  }
53
49
 
54
- @keyframes awsui_gradientMove_12y5i_4dtd0_1 {
50
+ @keyframes awsui_gradientMove_12y5i_du1jk_1 {
55
51
  0% {
56
52
  transform: translate(-50%, -50%) rotate(0deg);
57
53
  }
@@ -63,7 +59,7 @@
63
59
  transform: translate(-50%, -50%) rotate(360deg);
64
60
  }
65
61
  }
66
- @keyframes awsui_gradientMoveReverse_12y5i_4dtd0_1 {
62
+ @keyframes awsui_gradientMoveReverse_12y5i_du1jk_1 {
67
63
  0% {
68
64
  transform: translate(-50%, -50%) rotate(360deg);
69
65
  inset-inline-start: -50%;
@@ -78,77 +74,77 @@
78
74
  inset-inline-start: -50%;
79
75
  }
80
76
  }
81
- .awsui_dot_12y5i_4dtd0_81:not(#\9) {
82
- animation: awsui_dotsDancing_12y5i_4dtd0_1 var(--motion-duration-avatar-loading-dots-9747r0, 1200ms) infinite ease-in-out;
77
+ .awsui_dot_12y5i_du1jk_77:not(#\9) {
78
+ animation: awsui_dotsDancing_12y5i_du1jk_1 var(--motion-duration-avatar-loading-dots-9747r0, 1200ms) infinite ease-in-out;
83
79
  }
84
80
  @media (prefers-reduced-motion: reduce) {
85
- .awsui_dot_12y5i_4dtd0_81:not(#\9) {
81
+ .awsui_dot_12y5i_du1jk_77:not(#\9) {
86
82
  animation: none;
87
83
  transition: none;
88
84
  }
89
85
  }
90
- .awsui-motion-disabled .awsui_dot_12y5i_4dtd0_81:not(#\9), .awsui-mode-entering .awsui_dot_12y5i_4dtd0_81:not(#\9) {
86
+ .awsui-motion-disabled .awsui_dot_12y5i_du1jk_77:not(#\9), .awsui-mode-entering .awsui_dot_12y5i_du1jk_77:not(#\9) {
91
87
  animation: none;
92
88
  transition: none;
93
89
  }
94
90
 
95
- .awsui_dot_12y5i_4dtd0_81:not(#\9):nth-child(1) {
91
+ .awsui_dot_12y5i_du1jk_77:not(#\9):nth-child(1) {
96
92
  animation-delay: 100ms;
97
93
  }
98
94
  @media (prefers-reduced-motion: reduce) {
99
- .awsui_dot_12y5i_4dtd0_81:not(#\9):nth-child(1) {
95
+ .awsui_dot_12y5i_du1jk_77:not(#\9):nth-child(1) {
100
96
  animation: none;
101
97
  transition: none;
102
98
  }
103
99
  }
104
- .awsui-motion-disabled .awsui_dot_12y5i_4dtd0_81:not(#\9):nth-child(1), .awsui-mode-entering .awsui_dot_12y5i_4dtd0_81:not(#\9):nth-child(1) {
100
+ .awsui-motion-disabled .awsui_dot_12y5i_du1jk_77:not(#\9):nth-child(1), .awsui-mode-entering .awsui_dot_12y5i_du1jk_77:not(#\9):nth-child(1) {
105
101
  animation: none;
106
102
  transition: none;
107
103
  }
108
104
 
109
- .awsui_dot_12y5i_4dtd0_81:not(#\9):nth-child(2) {
105
+ .awsui_dot_12y5i_du1jk_77:not(#\9):nth-child(2) {
110
106
  animation-delay: 200ms;
111
107
  }
112
108
  @media (prefers-reduced-motion: reduce) {
113
- .awsui_dot_12y5i_4dtd0_81:not(#\9):nth-child(2) {
109
+ .awsui_dot_12y5i_du1jk_77:not(#\9):nth-child(2) {
114
110
  animation: none;
115
111
  transition: none;
116
112
  }
117
113
  }
118
- .awsui-motion-disabled .awsui_dot_12y5i_4dtd0_81:not(#\9):nth-child(2), .awsui-mode-entering .awsui_dot_12y5i_4dtd0_81:not(#\9):nth-child(2) {
114
+ .awsui-motion-disabled .awsui_dot_12y5i_du1jk_77:not(#\9):nth-child(2), .awsui-mode-entering .awsui_dot_12y5i_du1jk_77:not(#\9):nth-child(2) {
119
115
  animation: none;
120
116
  transition: none;
121
117
  }
122
118
 
123
- .awsui_dot_12y5i_4dtd0_81:not(#\9):nth-child(3) {
119
+ .awsui_dot_12y5i_du1jk_77:not(#\9):nth-child(3) {
124
120
  animation-delay: 300ms;
125
121
  }
126
122
  @media (prefers-reduced-motion: reduce) {
127
- .awsui_dot_12y5i_4dtd0_81:not(#\9):nth-child(3) {
123
+ .awsui_dot_12y5i_du1jk_77:not(#\9):nth-child(3) {
128
124
  animation: none;
129
125
  transition: none;
130
126
  }
131
127
  }
132
- .awsui-motion-disabled .awsui_dot_12y5i_4dtd0_81:not(#\9):nth-child(3), .awsui-mode-entering .awsui_dot_12y5i_4dtd0_81:not(#\9):nth-child(3) {
128
+ .awsui-motion-disabled .awsui_dot_12y5i_du1jk_77:not(#\9):nth-child(3), .awsui-mode-entering .awsui_dot_12y5i_du1jk_77:not(#\9):nth-child(3) {
133
129
  animation: none;
134
130
  transition: none;
135
131
  }
136
132
 
137
- .awsui_dot_12y5i_4dtd0_81:not(#\9):last-child {
133
+ .awsui_dot_12y5i_du1jk_77:not(#\9):last-child {
138
134
  margin-inline-end: 0;
139
135
  }
140
136
  @media (prefers-reduced-motion: reduce) {
141
- .awsui_dot_12y5i_4dtd0_81:not(#\9):last-child {
137
+ .awsui_dot_12y5i_du1jk_77:not(#\9):last-child {
142
138
  animation: none;
143
139
  transition: none;
144
140
  }
145
141
  }
146
- .awsui-motion-disabled .awsui_dot_12y5i_4dtd0_81:not(#\9):last-child, .awsui-mode-entering .awsui_dot_12y5i_4dtd0_81:not(#\9):last-child {
142
+ .awsui-motion-disabled .awsui_dot_12y5i_du1jk_77:not(#\9):last-child, .awsui-mode-entering .awsui_dot_12y5i_du1jk_77:not(#\9):last-child {
147
143
  animation: none;
148
144
  transition: none;
149
145
  }
150
146
 
151
- @keyframes awsui_dotsDancing_12y5i_4dtd0_1 {
147
+ @keyframes awsui_dotsDancing_12y5i_du1jk_1 {
152
148
  0% {
153
149
  transform: translateY(0px);
154
150
  }
@@ -159,13 +155,13 @@
159
155
  transform: translateY(0px);
160
156
  }
161
157
  }
162
- .awsui_root_12y5i_4dtd0_162:not(#\9) {
158
+ .awsui_root_12y5i_du1jk_158:not(#\9) {
163
159
  inline-size: inherit;
164
160
  block-size: inherit;
165
- border-start-start-radius: 50%;
166
- border-start-end-radius: 50%;
167
- border-end-start-radius: 50%;
168
- border-end-end-radius: 50%;
161
+ border-start-start-radius: inherit;
162
+ border-start-end-radius: inherit;
163
+ border-end-start-radius: inherit;
164
+ border-end-end-radius: inherit;
169
165
  display: flex;
170
166
  justify-content: center;
171
167
  align-items: center;
@@ -173,14 +169,14 @@
173
169
  overflow: hidden;
174
170
  }
175
171
 
176
- .awsui_typing_12y5i_4dtd0_176:not(#\9) {
172
+ .awsui_typing_12y5i_du1jk_172:not(#\9) {
177
173
  align-items: center;
178
174
  justify-content: space-between;
179
175
  display: flex;
180
176
  inline-size: 64%;
181
177
  }
182
178
 
183
- .awsui_dot_12y5i_4dtd0_81:not(#\9) {
179
+ .awsui_dot_12y5i_du1jk_77:not(#\9) {
184
180
  background-color: var(--color-text-avatar-b0lbhn, #ffffff);
185
181
  border-start-start-radius: 50%;
186
182
  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-ai_12y5i_4dtd0_19",
6
- "gradientMove": "awsui_gradientMove_12y5i_4dtd0_1",
7
- "gradientMoveReverse": "awsui_gradientMoveReverse_12y5i_4dtd0_1",
8
- "dot": "awsui_dot_12y5i_4dtd0_81",
9
- "dotsDancing": "awsui_dotsDancing_12y5i_4dtd0_1",
10
- "root": "awsui_root_12y5i_4dtd0_162",
11
- "typing": "awsui_typing_12y5i_4dtd0_176"
5
+ "gen-ai": "awsui_gen-ai_12y5i_du1jk_15",
6
+ "gradientMove": "awsui_gradientMove_12y5i_du1jk_1",
7
+ "gradientMoveReverse": "awsui_gradientMoveReverse_12y5i_du1jk_1",
8
+ "dot": "awsui_dot_12y5i_du1jk_77",
9
+ "dotsDancing": "awsui_dotsDancing_12y5i_du1jk_1",
10
+ "root": "awsui_root_12y5i_du1jk_158",
11
+ "typing": "awsui_typing_12y5i_du1jk_172"
12
12
  };
13
13
 
@@ -1,12 +1,12 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "root": "awsui_root_1qkal_16vf1_15",
5
- "avatar-color-default": "awsui_avatar-color-default_1qkal_16vf1_53",
6
- "avatar-color-gen-ai": "awsui_avatar-color-gen-ai_1qkal_16vf1_56",
7
- "initials": "awsui_initials_1qkal_16vf1_59",
8
- "image": "awsui_image_1qkal_16vf1_90",
9
- "content": "awsui_content_1qkal_16vf1_94",
10
- "tooltip": "awsui_tooltip_1qkal_16vf1_116"
4
+ "root": "awsui_root_1qkal_1b3pg_41",
5
+ "avatar-color-default": "awsui_avatar-color-default_1qkal_1b3pg_84",
6
+ "avatar-color-gen-ai": "awsui_avatar-color-gen-ai_1qkal_1b3pg_87",
7
+ "initials": "awsui_initials_1qkal_1b3pg_90",
8
+ "image": "awsui_image_1qkal_1b3pg_121",
9
+ "content": "awsui_content_1qkal_1b3pg_125",
10
+ "tooltip": "awsui_tooltip_1qkal_1b3pg_156"
11
11
  };
12
12
 
@@ -6,13 +6,44 @@
6
6
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
7
7
  SPDX-License-Identifier: Apache-2.0
8
8
  */
9
+ /* stylelint-disable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
10
+ /* stylelint-enable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
9
11
  /*
10
12
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
11
13
  SPDX-License-Identifier: Apache-2.0
12
14
  */
13
- /* stylelint-disable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
14
- /* stylelint-enable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
15
- .awsui_root_1qkal_16vf1_15:not(#\9) {
15
+ /*
16
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
17
+ SPDX-License-Identifier: Apache-2.0
18
+ */
19
+ @property --awsui-style-border-color {
20
+ syntax: "*";
21
+ inherits: false;
22
+ }
23
+ @property --awsui-style-border-width {
24
+ syntax: "*";
25
+ inherits: false;
26
+ }
27
+ @property --awsui-style-focus-ring-color {
28
+ syntax: "*";
29
+ inherits: false;
30
+ }
31
+ @property --awsui-style-focus-ring-width {
32
+ syntax: "*";
33
+ inherits: false;
34
+ }
35
+ @property --awsui-style-focus-ring-radius {
36
+ syntax: "*";
37
+ inherits: false;
38
+ }
39
+ /* awsui:style-api-slot name=root tokens=border-color, border-width, focus-ring-color, focus-ring-width, focus-ring-radius properties=background, color, border-radius, box-shadow */
40
+ /* awsui:style-api-description slot=root kind=token name=focus-ring-radius text=Defaults to the avatar border radius. */
41
+ .awsui_root_1qkal_1b3pg_41:not(#\9) {
42
+ --awsui-internal-style-border-color: var(--awsui-style-border-color);
43
+ --awsui-internal-style-border-width: var(--awsui-style-border-width);
44
+ --awsui-internal-style-focus-ring-color: var(--awsui-style-focus-ring-color);
45
+ --awsui-internal-style-focus-ring-width: var(--awsui-style-focus-ring-width);
46
+ --awsui-internal-style-focus-ring-radius: var(--awsui-style-focus-ring-radius);
16
47
  border-collapse: separate;
17
48
  border-spacing: 0;
18
49
  box-sizing: border-box;
@@ -50,48 +81,57 @@
50
81
  border-end-start-radius: 50%;
51
82
  border-end-end-radius: 50%;
52
83
  }
53
- .awsui_root_1qkal_16vf1_15.awsui_avatar-color-default_1qkal_16vf1_53:not(#\9) {
84
+ .awsui_root_1qkal_1b3pg_41.awsui_avatar-color-default_1qkal_1b3pg_84:not(#\9) {
54
85
  background-color: var(--color-background-avatar-default-tmc43v, #424650);
55
86
  }
56
- .awsui_root_1qkal_16vf1_15.awsui_avatar-color-gen-ai_1qkal_16vf1_56:not(#\9) {
87
+ .awsui_root_1qkal_1b3pg_41.awsui_avatar-color-gen-ai_1qkal_1b3pg_87:not(#\9) {
57
88
  background: var(--color-background-avatar-gen-ai-j5h85i, radial-gradient(circle farthest-corner at top right, #b8e7ff 0%, #0099ff 25%, #5c7fff 40%, #8575ff 60%, #962eff 80%));
58
89
  }
59
- .awsui_root_1qkal_16vf1_15.awsui_initials_1qkal_16vf1_59:not(#\9) {
90
+ .awsui_root_1qkal_1b3pg_41.awsui_initials_1qkal_1b3pg_90:not(#\9) {
60
91
  font-family: var(--font-family-base-khplu5, "Open Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
61
92
  font-size: var(--font-size-body-s-ovzhcr, 12px);
62
93
  line-height: var(--line-height-body-s-31lmk3, 16px);
63
94
  font-weight: var(--font-weight-heading-l-fhfvdl, 700);
64
95
  }
65
- .awsui_root_1qkal_16vf1_15:not(#\9):focus {
96
+ .awsui_root_1qkal_1b3pg_41:not(#\9):focus {
66
97
  outline: none;
67
98
  }
68
- .awsui_root_1qkal_16vf1_15:not(#\9):focus-visible {
99
+ .awsui_root_1qkal_1b3pg_41:not(#\9):focus-visible {
69
100
  position: relative;
70
101
  box-sizing: border-box;
71
102
  outline: 2px dotted transparent;
72
- outline-offset: calc(4px + var(--awsui-avatar-root-border-width-qkxefc, 0px) + var(--awsui-avatar-focus-ring-border-width-qkxefc, 0px) - 1px);
103
+ outline-offset: calc(4px + var(--awsui-internal-style-focus-ring-width, var(--awsui-avatar-focus-ring-border-width-qkxefc, 0px)) - 1px);
73
104
  }
74
- .awsui_root_1qkal_16vf1_15:not(#\9):focus-visible::before {
105
+ .awsui_root_1qkal_1b3pg_41:not(#\9):focus-visible::before {
75
106
  content: " ";
76
107
  display: block;
77
108
  position: absolute;
78
109
  box-sizing: border-box;
79
- inset-inline-start: calc(-1 * calc(4px + var(--awsui-avatar-root-border-width-qkxefc, 0px) + var(--awsui-avatar-focus-ring-border-width-qkxefc, 0px)));
80
- inset-block-start: calc(-1 * calc(4px + var(--awsui-avatar-root-border-width-qkxefc, 0px) + var(--awsui-avatar-focus-ring-border-width-qkxefc, 0px)));
81
- inline-size: calc(100% + 2 * calc(4px + var(--awsui-avatar-root-border-width-qkxefc, 0px) + var(--awsui-avatar-focus-ring-border-width-qkxefc, 0px)));
82
- block-size: calc(100% + 2 * calc(4px + var(--awsui-avatar-root-border-width-qkxefc, 0px) + var(--awsui-avatar-focus-ring-border-width-qkxefc, 0px)));
83
- border-start-start-radius: var(--awsui-avatar-focus-ring-border-radius-qkxefc, 50%);
84
- border-start-end-radius: var(--awsui-avatar-focus-ring-border-radius-qkxefc, 50%);
85
- border-end-start-radius: var(--awsui-avatar-focus-ring-border-radius-qkxefc, 50%);
86
- border-end-end-radius: var(--awsui-avatar-focus-ring-border-radius-qkxefc, 50%);
87
- border-block: var(--awsui-avatar-focus-ring-border-width-qkxefc, 2px) solid var(--awsui-avatar-focus-ring-border-color-qkxefc, var(--color-border-item-focused-sb1fs0, #006ce0));
88
- border-inline: var(--awsui-avatar-focus-ring-border-width-qkxefc, 2px) solid var(--awsui-avatar-focus-ring-border-color-qkxefc, var(--color-border-item-focused-sb1fs0, #006ce0));
89
- }
90
- .awsui_root_1qkal_16vf1_15:not(#\9):has(.awsui_image_1qkal_16vf1_90) {
110
+ inset-inline-start: calc(-1 * calc(4px + var(--awsui-internal-style-focus-ring-width, var(--awsui-avatar-focus-ring-border-width-qkxefc, 0px))));
111
+ inset-block-start: calc(-1 * calc(4px + var(--awsui-internal-style-focus-ring-width, var(--awsui-avatar-focus-ring-border-width-qkxefc, 0px))));
112
+ inline-size: calc(100% + 2 * calc(4px + var(--awsui-internal-style-focus-ring-width, var(--awsui-avatar-focus-ring-border-width-qkxefc, 0px))));
113
+ block-size: calc(100% + 2 * calc(4px + var(--awsui-internal-style-focus-ring-width, var(--awsui-avatar-focus-ring-border-width-qkxefc, 0px))));
114
+ border-start-start-radius: var(--awsui-internal-style-focus-ring-radius, var(--awsui-avatar-focus-ring-border-radius-qkxefc, inherit));
115
+ border-start-end-radius: var(--awsui-internal-style-focus-ring-radius, var(--awsui-avatar-focus-ring-border-radius-qkxefc, inherit));
116
+ border-end-start-radius: var(--awsui-internal-style-focus-ring-radius, var(--awsui-avatar-focus-ring-border-radius-qkxefc, inherit));
117
+ border-end-end-radius: var(--awsui-internal-style-focus-ring-radius, var(--awsui-avatar-focus-ring-border-radius-qkxefc, inherit));
118
+ border-block: var(--awsui-internal-style-focus-ring-width, var(--awsui-avatar-focus-ring-border-width-qkxefc, 2px)) solid var(--awsui-internal-style-focus-ring-color, var(--awsui-avatar-focus-ring-border-color-qkxefc, var(--color-border-item-focused-sb1fs0, #006ce0)));
119
+ border-inline: var(--awsui-internal-style-focus-ring-width, var(--awsui-avatar-focus-ring-border-width-qkxefc, 2px)) solid var(--awsui-internal-style-focus-ring-color, var(--awsui-avatar-focus-ring-border-color-qkxefc, var(--color-border-item-focused-sb1fs0, #006ce0)));
120
+ }
121
+ .awsui_root_1qkal_1b3pg_41:not(#\9):has(.awsui_image_1qkal_1b3pg_121) {
91
122
  background: transparent;
92
123
  }
93
124
 
94
- .awsui_content_1qkal_16vf1_94:not(#\9) {
125
+ .awsui_content_1qkal_1b3pg_125:not(#\9) {
126
+ box-sizing: border-box;
127
+ border-start-start-radius: inherit;
128
+ border-start-end-radius: inherit;
129
+ border-end-start-radius: inherit;
130
+ border-end-end-radius: inherit;
131
+ border-color: var(--awsui-internal-style-border-color, currentColor);
132
+ border-width: var(--awsui-internal-style-border-width, 0);
133
+ border-block-style: solid;
134
+ border-inline-style: solid;
95
135
  display: flex;
96
136
  align-items: center;
97
137
  justify-content: center;
@@ -100,19 +140,19 @@
100
140
  overflow: hidden;
101
141
  line-height: calc(0.8 * var(--awsui-avatar-size-qkxefc));
102
142
  }
103
- .awsui_content_1qkal_16vf1_94 .awsui_image_1qkal_16vf1_90:not(#\9) {
104
- border-start-start-radius: 50%;
105
- border-start-end-radius: 50%;
106
- border-end-start-radius: 50%;
107
- border-end-end-radius: 50%;
143
+ .awsui_content_1qkal_1b3pg_125 .awsui_image_1qkal_1b3pg_121:not(#\9) {
144
+ border-start-start-radius: inherit;
145
+ border-start-end-radius: inherit;
146
+ border-end-start-radius: inherit;
147
+ border-end-end-radius: inherit;
108
148
  block-size: var(--awsui-avatar-size-qkxefc);
109
149
  inline-size: var(--awsui-avatar-size-qkxefc);
110
150
  object-fit: cover;
111
151
  }
112
- .awsui_content_1qkal_16vf1_94 .awsui_initials_1qkal_16vf1_59:not(#\9) {
152
+ .awsui_content_1qkal_1b3pg_125 .awsui_initials_1qkal_1b3pg_90:not(#\9) {
113
153
  font-size: clamp(var(--font-size-body-s-ovzhcr, 12px), 0.4 * var(--awsui-avatar-size-qkxefc), 0.4 * var(--awsui-avatar-size-qkxefc));
114
154
  }
115
155
 
116
- .awsui_tooltip_1qkal_16vf1_116:not(#\9) {
156
+ .awsui_tooltip_1qkal_1b3pg_156:not(#\9) {
117
157
  /* used in test-utils */
118
158
  }
@@ -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
- "root": "awsui_root_1qkal_16vf1_15",
6
- "avatar-color-default": "awsui_avatar-color-default_1qkal_16vf1_53",
7
- "avatar-color-gen-ai": "awsui_avatar-color-gen-ai_1qkal_16vf1_56",
8
- "initials": "awsui_initials_1qkal_16vf1_59",
9
- "image": "awsui_image_1qkal_16vf1_90",
10
- "content": "awsui_content_1qkal_16vf1_94",
11
- "tooltip": "awsui_tooltip_1qkal_16vf1_116"
5
+ "root": "awsui_root_1qkal_1b3pg_41",
6
+ "avatar-color-default": "awsui_avatar-color-default_1qkal_1b3pg_84",
7
+ "avatar-color-gen-ai": "awsui_avatar-color-gen-ai_1qkal_1b3pg_87",
8
+ "initials": "awsui_initials_1qkal_1b3pg_90",
9
+ "image": "awsui_image_1qkal_1b3pg_121",
10
+ "content": "awsui_content_1qkal_1b3pg_125",
11
+ "tooltip": "awsui_tooltip_1qkal_1b3pg_156"
12
12
  };
13
13
 
@@ -1,5 +1,10 @@
1
1
  import { InternalBaseComponentProps } from "../internal/base-component/use-base-component";
2
2
  import { ChatBubbleProps } from "./interfaces.js";
3
3
  export interface InternalChatBubbleProps extends ChatBubbleProps, InternalBaseComponentProps {
4
+ styleClassNames?: StyleClassNames;
4
5
  }
5
- export default function InternalChatBubble({ type, children, avatar, actions, showLoadingBar, hideAvatar, stretch, align, ariaLabel, style, __internalRootRef, ...rest }: InternalChatBubbleProps): import("react/jsx-runtime").JSX.Element;
6
+ export interface StyleClassNames {
7
+ root?: string;
8
+ bubble?: string;
9
+ }
10
+ export default function InternalChatBubble({ type, children, avatar, actions, showLoadingBar, hideAvatar, stretch, align, ariaLabel, style, styleClassNames, __internalRootRef, ...rest }: InternalChatBubbleProps): import("react/jsx-runtime").JSX.Element;
@@ -7,7 +7,7 @@ import { getDataAttributes } from "../internal/base-component/get-data-attribute
7
7
  import { InternalLoadingBar } from "../loading-bar/internal";
8
8
  import { getBubbleStyle, getChatBubbleRootStyle } from "./style";
9
9
  import styles from "./styles.css.js";
10
- export default function InternalChatBubble({ type, children, avatar, actions, showLoadingBar, hideAvatar = false, stretch = false, align, ariaLabel, style, __internalRootRef = null, ...rest }) {
10
+ export default function InternalChatBubble({ type, children, avatar, actions, showLoadingBar, hideAvatar = false, stretch = false, align, ariaLabel, style, styleClassNames, __internalRootRef = null, ...rest }) {
11
11
  const avatarRef = useRef(null);
12
12
  useEffect(() => {
13
13
  // We have to do this because `inert` isn't properly supported until
@@ -20,7 +20,7 @@ export default function InternalChatBubble({ type, children, avatar, actions, sh
20
20
  }
21
21
  }, [hideAvatar]);
22
22
  const avatarSlot = avatar && (_jsx("div", { ref: avatarRef, className: clsx(styles.avatar, hideAvatar && styles.hide), children: avatar }));
23
- const messageArea = (_jsxs("div", { className: clsx(styles["message-area"], styles[`chat-bubble-type-${type}`], stretch && styles.stretch), style: getBubbleStyle(style), children: [_jsx("div", { className: styles.content, children: children }), actions && _jsx("div", { className: styles.actions, children: actions }), showLoadingBar && (_jsx("div", { className: styles["loading-bar-wrapper"], children: _jsx(InternalLoadingBar, { variant: "gen-ai-masked" }) }))] }));
24
- return (_jsx("div", { className: clsx(styles.root, align === "end" && styles["alignment-end"]), ...getDataAttributes(rest), ref: __internalRootRef, role: "group", "aria-label": ariaLabel, style: getChatBubbleRootStyle(style), children: align === "end" ? (_jsxs(_Fragment, { children: [messageArea, avatarSlot] })) : (_jsxs(_Fragment, { children: [avatarSlot, messageArea] })) }));
23
+ const messageArea = (_jsxs("div", { className: clsx(styleClassNames === null || styleClassNames === void 0 ? void 0 : styleClassNames.bubble, styles["message-area"], styles[`chat-bubble-type-${type}`], stretch && styles.stretch), style: getBubbleStyle(style), children: [_jsx("div", { className: styles.content, children: children }), actions && _jsx("div", { className: styles.actions, children: actions }), showLoadingBar && (_jsx("div", { className: styles["loading-bar-wrapper"], children: _jsx(InternalLoadingBar, { variant: "gen-ai-masked" }) }))] }));
24
+ return (_jsx("div", { className: clsx(styleClassNames === null || styleClassNames === void 0 ? void 0 : styleClassNames.root, styles.root, align === "end" && styles["alignment-end"]), ...getDataAttributes(rest), ref: __internalRootRef, role: "group", "aria-label": ariaLabel, style: getChatBubbleRootStyle(style), children: align === "end" ? (_jsxs(_Fragment, { children: [messageArea, avatarSlot] })) : (_jsxs(_Fragment, { children: [avatarSlot, messageArea] })) }));
25
25
  }
26
26
  //# sourceMappingURL=internal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/chat-bubble/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AAEnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEjE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAIrC,MAA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S,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,KAAK,KAAK,IAAI,MAAM,CAAC,eAAe,CAAC,CAAC,KACpE,iBAAiB,CAAC,IAAI,CAAC,EAC3B,GAAG,EAAE,iBAAiB,EACtB,IAAI,EAAC,OAAO,gBACA,SAAS,EACrB,KAAK,EAAE,sBAAsB,CAAC,KAAK,CAAC,YAEnC,KAAK,KAAK,KAAK,CAAC,CAAC,CAAC,CACjB,8BACG,WAAW,EACX,UAAU,IACV,CACJ,CAAC,CAAC,CAAC,CACF,8BACG,UAAU,EACV,WAAW,IACX,CACJ,GACG,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useEffect, useRef } from \"react\";\nimport clsx from \"clsx\";\n\nimport { getDataAttributes } from \"../internal/base-component/get-data-attributes\";\nimport { InternalBaseComponentProps } from \"../internal/base-component/use-base-component\";\nimport { InternalLoadingBar } from \"../loading-bar/internal\";\nimport { ChatBubbleProps } from \"./interfaces.js\";\nimport { getBubbleStyle, getChatBubbleRootStyle } from \"./style\";\n\nimport styles from \"./styles.css.js\";\n\nexport interface InternalChatBubbleProps extends ChatBubbleProps, InternalBaseComponentProps {}\n\nexport default function InternalChatBubble({\n type,\n children,\n avatar,\n actions,\n showLoadingBar,\n hideAvatar = false,\n stretch = false,\n align,\n ariaLabel,\n style,\n __internalRootRef = null,\n ...rest\n}: InternalChatBubbleProps) {\n const avatarRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n // We have to do this because `inert` isn't properly supported until\n // React 19 and this seems much more maintainable than version detection.\n // `inert` is better than `hidden` because it also blocks pointer and\n // focus events as well as hiding the contents from screen readers.\n // https://github.com/facebook/react/issues/17157\n if (avatarRef.current) {\n avatarRef.current.inert = hideAvatar;\n }\n }, [hideAvatar]);\n\n const avatarSlot = avatar && (\n <div ref={avatarRef} className={clsx(styles.avatar, hideAvatar && styles.hide)}>\n {avatar}\n </div>\n );\n\n const messageArea = (\n <div\n className={clsx(styles[\"message-area\"], styles[`chat-bubble-type-${type}`], stretch && styles.stretch)}\n style={getBubbleStyle(style)}\n >\n <div className={styles.content}>{children}</div>\n {actions && <div className={styles.actions}>{actions}</div>}\n {showLoadingBar && (\n <div className={styles[\"loading-bar-wrapper\"]}>\n <InternalLoadingBar variant=\"gen-ai-masked\" />\n </div>\n )}\n </div>\n );\n\n return (\n <div\n className={clsx(styles.root, align === \"end\" && styles[\"alignment-end\"])}\n {...getDataAttributes(rest)}\n ref={__internalRootRef}\n role=\"group\"\n aria-label={ariaLabel}\n style={getChatBubbleRootStyle(style)}\n >\n {align === \"end\" ? (\n <>\n {messageArea}\n {avatarSlot}\n </>\n ) : (\n <>\n {avatarSlot}\n {messageArea}\n </>\n )}\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/chat-bubble/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AAEnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEjE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAYrC,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EACzC,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,OAAO,EACP,cAAc,EACd,UAAU,GAAG,KAAK,EAClB,OAAO,GAAG,KAAK,EACf,KAAK,EACL,SAAS,EACT,KAAK,EACL,eAAe,EACf,iBAAiB,GAAG,IAAI,EACxB,GAAG,IAAI,EACiB;IACxB,MAAM,SAAS,GAAG,MAAM,CAAiB,IAAI,CA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I,EAAC,OAAO,gBACA,SAAS,EACrB,KAAK,EAAE,sBAAsB,CAAC,KAAK,CAAC,YAEnC,KAAK,KAAK,KAAK,CAAC,CAAC,CAAC,CACjB,8BACG,WAAW,EACX,UAAU,IACV,CACJ,CAAC,CAAC,CAAC,CACF,8BACG,UAAU,EACV,WAAW,IACX,CACJ,GACG,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useEffect, useRef } from \"react\";\nimport clsx from \"clsx\";\n\nimport { getDataAttributes } from \"../internal/base-component/get-data-attributes\";\nimport { InternalBaseComponentProps } from \"../internal/base-component/use-base-component\";\nimport { InternalLoadingBar } from \"../loading-bar/internal\";\nimport { ChatBubbleProps } from \"./interfaces.js\";\nimport { getBubbleStyle, getChatBubbleRootStyle } from \"./style\";\n\nimport styles from \"./styles.css.js\";\n\nexport interface InternalChatBubbleProps extends ChatBubbleProps, InternalBaseComponentProps {\n styleClassNames?: StyleClassNames;\n}\n\n// Style API v2\nexport interface StyleClassNames {\n root?: string;\n bubble?: string;\n}\n\nexport default function InternalChatBubble({\n type,\n children,\n avatar,\n actions,\n showLoadingBar,\n hideAvatar = false,\n stretch = false,\n align,\n ariaLabel,\n style,\n styleClassNames,\n __internalRootRef = null,\n ...rest\n}: InternalChatBubbleProps) {\n const avatarRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n // We have to do this because `inert` isn't properly supported until\n // React 19 and this seems much more maintainable than version detection.\n // `inert` is better than `hidden` because it also blocks pointer and\n // focus events as well as hiding the contents from screen readers.\n // https://github.com/facebook/react/issues/17157\n if (avatarRef.current) {\n avatarRef.current.inert = hideAvatar;\n }\n }, [hideAvatar]);\n\n const avatarSlot = avatar && (\n <div ref={avatarRef} className={clsx(styles.avatar, hideAvatar && styles.hide)}>\n {avatar}\n </div>\n );\n\n const messageArea = (\n <div\n className={clsx(\n styleClassNames?.bubble,\n styles[\"message-area\"],\n styles[`chat-bubble-type-${type}`],\n stretch && styles.stretch,\n )}\n style={getBubbleStyle(style)}\n >\n <div className={styles.content}>{children}</div>\n {actions && <div className={styles.actions}>{actions}</div>}\n {showLoadingBar && (\n <div className={styles[\"loading-bar-wrapper\"]}>\n <InternalLoadingBar variant=\"gen-ai-masked\" />\n </div>\n )}\n </div>\n );\n\n return (\n <div\n className={clsx(styleClassNames?.root, styles.root, align === \"end\" && styles[\"alignment-end\"])}\n {...getDataAttributes(rest)}\n ref={__internalRootRef}\n role=\"group\"\n aria-label={ariaLabel}\n style={getChatBubbleRootStyle(style)}\n >\n {align === \"end\" ? (\n <>\n {messageArea}\n {avatarSlot}\n </>\n ) : (\n <>\n {avatarSlot}\n {messageArea}\n </>\n )}\n </div>\n );\n}\n"]}
@@ -1,16 +1,16 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "root": "awsui_root_cdujn_1nrwo_11",
5
- "alignment-end": "awsui_alignment-end_cdujn_1nrwo_44",
6
- "message-area": "awsui_message-area_cdujn_1nrwo_48",
7
- "chat-bubble-type-outgoing": "awsui_chat-bubble-type-outgoing_cdujn_1nrwo_62",
8
- "chat-bubble-type-incoming": "awsui_chat-bubble-type-incoming_cdujn_1nrwo_66",
9
- "stretch": "awsui_stretch_cdujn_1nrwo_70",
10
- "loading-bar-wrapper": "awsui_loading-bar-wrapper_cdujn_1nrwo_74",
11
- "avatar": "awsui_avatar_cdujn_1nrwo_81",
12
- "hide": "awsui_hide_cdujn_1nrwo_84",
13
- "content": "awsui_content_cdujn_1nrwo_88",
14
- "actions": "awsui_actions_cdujn_1nrwo_92"
4
+ "root": "awsui_root_cdujn_1tmn6_23",
5
+ "alignment-end": "awsui_alignment-end_cdujn_1tmn6_56",
6
+ "message-area": "awsui_message-area_cdujn_1tmn6_60",
7
+ "chat-bubble-type-outgoing": "awsui_chat-bubble-type-outgoing_cdujn_1tmn6_76",
8
+ "chat-bubble-type-incoming": "awsui_chat-bubble-type-incoming_cdujn_1tmn6_80",
9
+ "stretch": "awsui_stretch_cdujn_1tmn6_84",
10
+ "loading-bar-wrapper": "awsui_loading-bar-wrapper_cdujn_1tmn6_88",
11
+ "avatar": "awsui_avatar_cdujn_1tmn6_95",
12
+ "hide": "awsui_hide_cdujn_1tmn6_98",
13
+ "content": "awsui_content_cdujn_1tmn6_102",
14
+ "actions": "awsui_actions_cdujn_1tmn6_106"
15
15
  };
16
16