@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
@@ -8,7 +8,19 @@
8
8
  */
9
9
  /* stylelint-disable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
10
10
  /* stylelint-enable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
11
- .awsui_root_cdujn_1nrwo_11:not(#\9) {
11
+ /*
12
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
13
+ SPDX-License-Identifier: Apache-2.0
14
+ */
15
+ /*
16
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
17
+ SPDX-License-Identifier: Apache-2.0
18
+ */
19
+ /* awsui:style-api-slot name=root tokens= properties=column-gap */
20
+ /* awsui:style-api-description slot=root kind=property name=column-gap text=Space between the avatar and the bubble. */
21
+ /* awsui:style-api-slot name=bubble tokens= properties=background, color, border, border-radius, box-shadow, padding, row-gap, font-family, font-size, font-weight, letter-spacing */
22
+ /* awsui:style-api-description slot=bubble kind=property name=row-gap text=Space between the message content and the actions. */
23
+ .awsui_root_cdujn_1tmn6_23:not(#\9) {
12
24
  border-collapse: separate;
13
25
  border-spacing: 0;
14
26
  box-sizing: border-box;
@@ -41,11 +53,11 @@
41
53
  font-size: var(--font-size-body-m-diae7s, 14px);
42
54
  line-height: var(--line-height-heading-m-1ujjlo, 22px);
43
55
  }
44
- .awsui_root_cdujn_1nrwo_11.awsui_alignment-end_cdujn_1nrwo_44:not(#\9) {
56
+ .awsui_root_cdujn_1tmn6_23.awsui_alignment-end_cdujn_1tmn6_56:not(#\9) {
45
57
  justify-content: flex-end;
46
58
  }
47
59
 
48
- .awsui_message-area_cdujn_1nrwo_48:not(#\9) {
60
+ .awsui_message-area_cdujn_1tmn6_60:not(#\9) {
49
61
  position: relative;
50
62
  display: flex;
51
63
  flex-direction: column;
@@ -58,37 +70,39 @@
58
70
  border-start-end-radius: var(--border-radius-chat-bubble-212ijm, 8px);
59
71
  border-end-start-radius: var(--border-radius-chat-bubble-212ijm, 8px);
60
72
  border-end-end-radius: var(--border-radius-chat-bubble-212ijm, 8px);
73
+ border-block: 0 solid;
74
+ border-inline: 0 solid;
61
75
  }
62
- .awsui_message-area_cdujn_1nrwo_48.awsui_chat-bubble-type-outgoing_cdujn_1nrwo_62:not(#\9) {
76
+ .awsui_message-area_cdujn_1tmn6_60.awsui_chat-bubble-type-outgoing_cdujn_1tmn6_76:not(#\9) {
63
77
  color: var(--color-text-chat-bubble-outgoing-vvn3a2, #0f141a);
64
78
  background-color: var(--color-background-chat-bubble-outgoing-7enozt, transparent);
65
79
  }
66
- .awsui_message-area_cdujn_1nrwo_48.awsui_chat-bubble-type-incoming_cdujn_1nrwo_66:not(#\9) {
80
+ .awsui_message-area_cdujn_1tmn6_60.awsui_chat-bubble-type-incoming_cdujn_1tmn6_80:not(#\9) {
67
81
  color: var(--color-text-chat-bubble-incoming-oxgg5c, #0f141a);
68
82
  background-color: var(--color-background-chat-bubble-incoming-0fkfr6, #f6f6f9);
69
83
  }
70
- .awsui_message-area_cdujn_1nrwo_48.awsui_stretch_cdujn_1nrwo_70:not(#\9) {
84
+ .awsui_message-area_cdujn_1tmn6_60.awsui_stretch_cdujn_1tmn6_84:not(#\9) {
71
85
  flex: 1;
72
86
  }
73
87
 
74
- .awsui_loading-bar-wrapper_cdujn_1nrwo_74:not(#\9) {
88
+ .awsui_loading-bar-wrapper_cdujn_1tmn6_88:not(#\9) {
75
89
  position: absolute;
76
90
  inset-block-end: 0;
77
91
  inset-inline-start: 0;
78
92
  inline-size: 100%;
79
93
  }
80
94
 
81
- .awsui_avatar_cdujn_1nrwo_81:not(#\9) {
95
+ .awsui_avatar_cdujn_1tmn6_95:not(#\9) {
82
96
  padding-block: var(--space-scaled-xs-65ylh6, 8px);
83
97
  }
84
- .awsui_avatar_cdujn_1nrwo_81.awsui_hide_cdujn_1nrwo_84:not(#\9) {
98
+ .awsui_avatar_cdujn_1tmn6_95.awsui_hide_cdujn_1tmn6_98:not(#\9) {
85
99
  opacity: 0;
86
100
  }
87
101
 
88
- .awsui_content_cdujn_1nrwo_88:not(#\9) {
102
+ .awsui_content_cdujn_1tmn6_102:not(#\9) {
89
103
  /* Used in test utils */
90
104
  }
91
105
 
92
- .awsui_actions_cdujn_1nrwo_92:not(#\9) {
106
+ .awsui_actions_cdujn_1tmn6_106:not(#\9) {
93
107
  /* Used in test utils */
94
108
  }
@@ -2,16 +2,16 @@
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_cdujn_1nrwo_11",
6
- "alignment-end": "awsui_alignment-end_cdujn_1nrwo_44",
7
- "message-area": "awsui_message-area_cdujn_1nrwo_48",
8
- "chat-bubble-type-outgoing": "awsui_chat-bubble-type-outgoing_cdujn_1nrwo_62",
9
- "chat-bubble-type-incoming": "awsui_chat-bubble-type-incoming_cdujn_1nrwo_66",
10
- "stretch": "awsui_stretch_cdujn_1nrwo_70",
11
- "loading-bar-wrapper": "awsui_loading-bar-wrapper_cdujn_1nrwo_74",
12
- "avatar": "awsui_avatar_cdujn_1nrwo_81",
13
- "hide": "awsui_hide_cdujn_1nrwo_84",
14
- "content": "awsui_content_cdujn_1nrwo_88",
15
- "actions": "awsui_actions_cdujn_1nrwo_92"
5
+ "root": "awsui_root_cdujn_1tmn6_23",
6
+ "alignment-end": "awsui_alignment-end_cdujn_1tmn6_56",
7
+ "message-area": "awsui_message-area_cdujn_1tmn6_60",
8
+ "chat-bubble-type-outgoing": "awsui_chat-bubble-type-outgoing_cdujn_1tmn6_76",
9
+ "chat-bubble-type-incoming": "awsui_chat-bubble-type-incoming_cdujn_1tmn6_80",
10
+ "stretch": "awsui_stretch_cdujn_1tmn6_84",
11
+ "loading-bar-wrapper": "awsui_loading-bar-wrapper_cdujn_1tmn6_88",
12
+ "avatar": "awsui_avatar_cdujn_1tmn6_95",
13
+ "hide": "awsui_hide_cdujn_1tmn6_98",
14
+ "content": "awsui_content_cdujn_1tmn6_102",
15
+ "actions": "awsui_actions_cdujn_1tmn6_106"
16
16
  };
17
17
 
@@ -0,0 +1,28 @@
1
+ {
2
+ "slots": [
3
+ {
4
+ "name": "root",
5
+ "tokens": [
6
+ "border-color",
7
+ "border-width",
8
+ "focus-ring-color",
9
+ "focus-ring-width",
10
+ "focus-ring-radius"
11
+ ],
12
+ "tokenDescriptions": {
13
+ "focus-ring-radius": "Defaults to the avatar border radius."
14
+ },
15
+ "properties": [
16
+ "background",
17
+ "color",
18
+ "border-radius",
19
+ "border-start-start-radius",
20
+ "border-start-end-radius",
21
+ "border-end-start-radius",
22
+ "border-end-end-radius",
23
+ "box-shadow"
24
+ ],
25
+ "propertyDescriptions": {}
26
+ }
27
+ ]
28
+ }
@@ -0,0 +1,50 @@
1
+ {
2
+ "slots": [
3
+ {
4
+ "name": "root",
5
+ "tokens": [],
6
+ "tokenDescriptions": {},
7
+ "properties": [
8
+ "column-gap"
9
+ ],
10
+ "propertyDescriptions": {
11
+ "column-gap": "Space between the avatar and the bubble."
12
+ }
13
+ },
14
+ {
15
+ "name": "bubble",
16
+ "tokens": [],
17
+ "tokenDescriptions": {},
18
+ "properties": [
19
+ "background",
20
+ "color",
21
+ "border-color",
22
+ "border-width",
23
+ "border-style",
24
+ "border-block-color",
25
+ "border-block-width",
26
+ "border-block-style",
27
+ "border-inline-color",
28
+ "border-inline-width",
29
+ "border-inline-style",
30
+ "border-radius",
31
+ "border-start-start-radius",
32
+ "border-start-end-radius",
33
+ "border-end-start-radius",
34
+ "border-end-end-radius",
35
+ "box-shadow",
36
+ "padding",
37
+ "padding-block",
38
+ "padding-inline",
39
+ "row-gap",
40
+ "font-family",
41
+ "font-size",
42
+ "font-weight",
43
+ "letter-spacing"
44
+ ],
45
+ "propertyDescriptions": {
46
+ "row-gap": "Space between the message content and the actions."
47
+ }
48
+ }
49
+ ]
50
+ }
@@ -0,0 +1,39 @@
1
+ {
2
+ "slots": [
3
+ {
4
+ "name": "item",
5
+ "tokens": [
6
+ "focus-ring-color",
7
+ "focus-ring-width",
8
+ "focus-ring-radius"
9
+ ],
10
+ "tokenDescriptions": {},
11
+ "properties": [
12
+ "color",
13
+ "background",
14
+ "border-color",
15
+ "border-width",
16
+ "border-style",
17
+ "border-block-color",
18
+ "border-block-width",
19
+ "border-block-style",
20
+ "border-inline-color",
21
+ "border-inline-width",
22
+ "border-inline-style",
23
+ "border-radius",
24
+ "border-start-start-radius",
25
+ "border-start-end-radius",
26
+ "border-end-start-radius",
27
+ "border-end-end-radius",
28
+ "padding",
29
+ "padding-block",
30
+ "padding-inline",
31
+ "box-shadow",
32
+ "font-family",
33
+ "font-size",
34
+ "font-weight"
35
+ ],
36
+ "propertyDescriptions": {}
37
+ }
38
+ ]
39
+ }
@@ -1,5 +1,5 @@
1
1
  export var PACKAGE_SOURCE = "chat-components";
2
- export var PACKAGE_VERSION = "1.0.0 (6d8f9d37)";
2
+ export var PACKAGE_VERSION = "1.0.0 (f08e0985)";
3
3
  export var THEME = "open-source-visual-refresh";
4
4
  export var SYSTEM = "core";
5
5
  export var ALWAYS_VISUAL_REFRESH = true;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "PACKAGE_SOURCE": "chat-components",
3
- "PACKAGE_VERSION": "1.0.0 (6d8f9d37)",
3
+ "PACKAGE_VERSION": "1.0.0 (f08e0985)",
4
4
  "THEME": "open-source-visual-refresh",
5
5
  "SYSTEM": "core",
6
6
  "ALWAYS_VISUAL_REFRESH": true
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "6d8f9d3756f679155c393b76d5391431de6d4be2"
2
+ "commit": "f08e098593734262f00c8f3e121b8a654aea6e63"
3
3
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudscape-design/chat-components",
3
- "version": "1.0.186",
3
+ "version": "1.0.188",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/cloudscape-design/chat-components.git"
@@ -0,0 +1,39 @@
1
+ // GENERATED from the avatar Style API docs — do not edit.
2
+ @use '@cloudscape-design/component-toolkit/internal/style-api/slot-mixins' as slot-mixins;
3
+
4
+ @mixin root(
5
+ $border-color: null,
6
+ $border-width: null,
7
+ $focus-ring-color: null,
8
+ $focus-ring-width: null,
9
+ $focus-ring-radius: null,
10
+ $background: null,
11
+ $color: null,
12
+ $border-radius: null,
13
+ $border-start-start-radius: null,
14
+ $border-start-end-radius: null,
15
+ $border-end-start-radius: null,
16
+ $border-end-end-radius: null,
17
+ $box-shadow: null
18
+ ) {
19
+ @include slot-mixins.apply(
20
+ 'avatar.root',
21
+ $tokens: (
22
+ 'border-color': $border-color,
23
+ 'border-width': $border-width,
24
+ 'focus-ring-color': $focus-ring-color,
25
+ 'focus-ring-width': $focus-ring-width,
26
+ 'focus-ring-radius': $focus-ring-radius,
27
+ ),
28
+ $properties: (
29
+ 'background': $background,
30
+ 'color': $color,
31
+ 'border-radius': $border-radius,
32
+ 'border-start-start-radius': $border-start-start-radius,
33
+ 'border-start-end-radius': $border-start-end-radius,
34
+ 'border-end-start-radius': $border-end-start-radius,
35
+ 'border-end-end-radius': $border-end-end-radius,
36
+ 'box-shadow': $box-shadow,
37
+ ),
38
+ );
39
+ }
@@ -0,0 +1,72 @@
1
+ // GENERATED from the chat-bubble Style API docs — do not edit.
2
+ @use '@cloudscape-design/component-toolkit/internal/style-api/slot-mixins' as slot-mixins;
3
+
4
+ @mixin root(
5
+ $column-gap: null
6
+ ) {
7
+ @include slot-mixins.apply(
8
+ 'chat-bubble.root',
9
+ $properties: (
10
+ 'column-gap': $column-gap,
11
+ ),
12
+ );
13
+ }
14
+
15
+ @mixin bubble(
16
+ $background: null,
17
+ $color: null,
18
+ $border-color: null,
19
+ $border-width: null,
20
+ $border-style: null,
21
+ $border-block-color: null,
22
+ $border-block-width: null,
23
+ $border-block-style: null,
24
+ $border-inline-color: null,
25
+ $border-inline-width: null,
26
+ $border-inline-style: null,
27
+ $border-radius: null,
28
+ $border-start-start-radius: null,
29
+ $border-start-end-radius: null,
30
+ $border-end-start-radius: null,
31
+ $border-end-end-radius: null,
32
+ $box-shadow: null,
33
+ $padding: null,
34
+ $padding-block: null,
35
+ $padding-inline: null,
36
+ $row-gap: null,
37
+ $font-family: null,
38
+ $font-size: null,
39
+ $font-weight: null,
40
+ $letter-spacing: null
41
+ ) {
42
+ @include slot-mixins.apply(
43
+ 'chat-bubble.bubble',
44
+ $properties: (
45
+ 'background': $background,
46
+ 'color': $color,
47
+ 'border-color': $border-color,
48
+ 'border-width': $border-width,
49
+ 'border-style': $border-style,
50
+ 'border-block-color': $border-block-color,
51
+ 'border-block-width': $border-block-width,
52
+ 'border-block-style': $border-block-style,
53
+ 'border-inline-color': $border-inline-color,
54
+ 'border-inline-width': $border-inline-width,
55
+ 'border-inline-style': $border-inline-style,
56
+ 'border-radius': $border-radius,
57
+ 'border-start-start-radius': $border-start-start-radius,
58
+ 'border-start-end-radius': $border-start-end-radius,
59
+ 'border-end-start-radius': $border-end-start-radius,
60
+ 'border-end-end-radius': $border-end-end-radius,
61
+ 'box-shadow': $box-shadow,
62
+ 'padding': $padding,
63
+ 'padding-block': $padding-block,
64
+ 'padding-inline': $padding-inline,
65
+ 'row-gap': $row-gap,
66
+ 'font-family': $font-family,
67
+ 'font-size': $font-size,
68
+ 'font-weight': $font-weight,
69
+ 'letter-spacing': $letter-spacing,
70
+ ),
71
+ );
72
+ }
@@ -0,0 +1,65 @@
1
+ // GENERATED from the support-prompt-group Style API docs — do not edit.
2
+ @use '@cloudscape-design/component-toolkit/internal/style-api/slot-mixins' as slot-mixins;
3
+
4
+ @mixin item(
5
+ $focus-ring-color: null,
6
+ $focus-ring-width: null,
7
+ $focus-ring-radius: null,
8
+ $color: null,
9
+ $background: null,
10
+ $border-color: null,
11
+ $border-width: null,
12
+ $border-style: null,
13
+ $border-block-color: null,
14
+ $border-block-width: null,
15
+ $border-block-style: null,
16
+ $border-inline-color: null,
17
+ $border-inline-width: null,
18
+ $border-inline-style: null,
19
+ $border-radius: null,
20
+ $border-start-start-radius: null,
21
+ $border-start-end-radius: null,
22
+ $border-end-start-radius: null,
23
+ $border-end-end-radius: null,
24
+ $padding: null,
25
+ $padding-block: null,
26
+ $padding-inline: null,
27
+ $box-shadow: null,
28
+ $font-family: null,
29
+ $font-size: null,
30
+ $font-weight: null
31
+ ) {
32
+ @include slot-mixins.apply(
33
+ 'support-prompt-group.item',
34
+ $tokens: (
35
+ 'focus-ring-color': $focus-ring-color,
36
+ 'focus-ring-width': $focus-ring-width,
37
+ 'focus-ring-radius': $focus-ring-radius,
38
+ ),
39
+ $properties: (
40
+ 'color': $color,
41
+ 'background': $background,
42
+ 'border-color': $border-color,
43
+ 'border-width': $border-width,
44
+ 'border-style': $border-style,
45
+ 'border-block-color': $border-block-color,
46
+ 'border-block-width': $border-block-width,
47
+ 'border-block-style': $border-block-style,
48
+ 'border-inline-color': $border-inline-color,
49
+ 'border-inline-width': $border-inline-width,
50
+ 'border-inline-style': $border-inline-style,
51
+ 'border-radius': $border-radius,
52
+ 'border-start-start-radius': $border-start-start-radius,
53
+ 'border-start-end-radius': $border-start-end-radius,
54
+ 'border-end-start-radius': $border-end-start-radius,
55
+ 'border-end-end-radius': $border-end-end-radius,
56
+ 'padding': $padding,
57
+ 'padding-block': $padding-block,
58
+ 'padding-inline': $padding-inline,
59
+ 'box-shadow': $box-shadow,
60
+ 'font-family': $font-family,
61
+ 'font-size': $font-size,
62
+ 'font-weight': $font-weight,
63
+ ),
64
+ );
65
+ }
@@ -1,3 +1,10 @@
1
1
  import { InternalBaseComponentProps } from "../internal/base-component/use-base-component";
2
2
  import { SupportPromptGroupProps } from "./interfaces";
3
- export declare const InternalSupportPromptGroup: import("react").ForwardRefExoticComponent<SupportPromptGroupProps & InternalBaseComponentProps & import("react").RefAttributes<SupportPromptGroupProps.Ref>>;
3
+ export interface StyleClassNames {
4
+ item?: string | ((args: {
5
+ item: SupportPromptGroupProps.Item;
6
+ }) => string);
7
+ }
8
+ export declare const InternalSupportPromptGroup: import("react").ForwardRefExoticComponent<SupportPromptGroupProps & InternalBaseComponentProps & {
9
+ styleClassNames?: StyleClassNames | undefined;
10
+ } & import("react").RefAttributes<SupportPromptGroupProps.Ref>>;
@@ -9,7 +9,7 @@ import { fireNonCancelableEvent } from "../internal/events";
9
9
  import { getNextFocusTarget, onUnregisterActive } from "./focus-helpers";
10
10
  import { Prompt } from "./prompt";
11
11
  import styles from "./styles.css.js";
12
- export const InternalSupportPromptGroup = forwardRef(({ alignment = "vertical", onItemClick, items, __internalRootRef, ariaLabel, ...rest }, ref) => {
12
+ export const InternalSupportPromptGroup = forwardRef(({ alignment = "vertical", onItemClick, items, __internalRootRef, ariaLabel, styleClassNames, ...rest }, ref) => {
13
13
  const focusedIdRef = useRef(null);
14
14
  const navigationAPI = useRef(null);
15
15
  const containerObjectRef = useRef(null);
@@ -96,7 +96,7 @@ export const InternalSupportPromptGroup = forwardRef(({ alignment = "vertical",
96
96
  return _jsx("div", {});
97
97
  }
98
98
  return (_jsx("div", { ...getDataAttributes(rest), role: "menubar", className: clsx(styles.root, { [styles.vertical]: alignment !== "horizontal" }), "aria-label": ariaLabel, onFocus: onFocus, onBlur: onBlur, onKeyDown: onKeyDown, ref: mergedRef, children: _jsx(SingleTabStopNavigationProvider, { ref: navigationAPI, navigationActive: true, getNextFocusTarget: () => getNextFocusTarget(containerObjectRef, focusedIdRef), onUnregisterActive: (element) => onUnregisterActive(element, navigationAPI), children: items.map((item, index) => {
99
- return (_jsx(Prompt, { onClick: (event) => handleClick(event, item.id), id: item.id, ref: (element) => (itemsRef.current[item.id] = element), iconName: item.iconName, iconSvg: item.iconSvg, iconPosition: item.iconPosition, iconVerticalAlignment: item.iconVerticalAlignment, ariaLabel: item.ariaLabel, children: item.text }, index));
99
+ return (_jsx(Prompt, { onClick: (event) => handleClick(event, item.id), id: item.id, ref: (element) => (itemsRef.current[item.id] = element), iconName: item.iconName, iconSvg: item.iconSvg, iconPosition: item.iconPosition, iconVerticalAlignment: item.iconVerticalAlignment, ariaLabel: item.ariaLabel, className: typeof (styleClassNames === null || styleClassNames === void 0 ? void 0 : styleClassNames.item) === "function" ? styleClassNames.item({ item }) : styleClassNames === null || styleClassNames === void 0 ? void 0 : styleClassNames.item, children: item.text }, index));
100
100
  }) }) }));
101
101
  });
102
102
  //# sourceMappingURL=internal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/support-prompt-group/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,UAAU,EAAO,SAAS,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAChF,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,SAAS,EACT,OAAO,EAEP,+BAA+B,EAC/B,YAAY,EACZ,QAAQ,GACT,MAAM,+CAA+C,CAAC;AAEvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AAEnF,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAEzE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,MAAM,CAAC,MAAM,0BAA0B,GAAG,UAAU,CAClD,CACE,EACE,SAAS,GAAG,UAAU,EACtB,WAAW,EACX,KAAK,EACL,iBAAiB,EACjB,SAAS,EACT,GAAG,IAAI,EAC8C,EACvD,GAAqC,EACrC,EAAE;IACF,MAAM,YAAY,GAAG,MAAM,CAAgB,IAAI,CAAC,CAAC;IACjD,MAAM,aAAa,GAAG,MAAM,CAA6B,IAAI,CAAC,CAAC;IAC/D,MAAM,kBAAkB,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IACxD,MAAM,QAAQ,GAAG,MAAM,CAA6B,EAAE,CAAC,CAAC;IAExD,MAAM,SAAS,GAAG,YAAY,CAAC,kBAAkB,EAAE,iBAAiB,CAAC,CAAC;IAEtE,mBAAm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E,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,SAAS,KAAK,YAAY,EAAE,CAAC,gBACnE,SAAS,EACrB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,SAAS,YAEd,KAAC,+BAA+B,IAC9B,GAAG,EAAE,aAAa,EAClB,gBAAgB,EAAE,IAAI,EACtB,kBAAkB,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,kBAAkB,EAAE,YAAY,CAAC,EAC9E,kBAAkB,EAAE,CAAC,OAAoB,EAAE,EAAE,CAAC,kBAAkB,CAAC,OAAO,EAAE,aAAa,CAAC,YAEvF,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;gBACzB,OAAO,CACL,KAAC,MAAM,IAEL,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,EAC/C,EAAE,EAAE,IAAI,CAAC,EAAE,EACX,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,EACvD,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,YAAY,EAAE,IAAI,CAAC,YAAY,EAC/B,qBAAqB,EAAE,IAAI,CAAC,qBAAqB,EACjD,SAAS,EAAE,IAAI,CAAC,SAAS,YAExB,IAAI,CAAC,IAAI,IAVL,KAAK,CAWH,CACV,CAAC;YACJ,CAAC,CAAC,GAC8B,GAC9B,CACP,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { forwardRef, Ref, useEffect, useImperativeHandle, useRef } from \"react\";\nimport clsx from \"clsx\";\n\nimport {\n circleIndex,\n getAllFocusables,\n handleKey,\n KeyCode,\n SingleTabStopNavigationAPI,\n SingleTabStopNavigationProvider,\n useMergeRefs,\n warnOnce,\n} from \"@cloudscape-design/component-toolkit/internal\";\n\nimport { getDataAttributes } from \"../internal/base-component/get-data-attributes\";\nimport { InternalBaseComponentProps } from \"../internal/base-component/use-base-component\";\nimport { fireNonCancelableEvent } from \"../internal/events\";\nimport { getNextFocusTarget, onUnregisterActive } from \"./focus-helpers\";\nimport { SupportPromptGroupProps } from \"./interfaces\";\nimport { Prompt } from \"./prompt\";\n\nimport styles from \"./styles.css.js\";\n\nexport const InternalSupportPromptGroup = forwardRef(\n (\n {\n alignment = \"vertical\",\n onItemClick,\n items,\n __internalRootRef,\n ariaLabel,\n ...rest\n }: SupportPromptGroupProps & InternalBaseComponentProps,\n ref: Ref<SupportPromptGroupProps.Ref>,\n ) => {\n const focusedIdRef = useRef<null | string>(null);\n const navigationAPI = useRef<SingleTabStopNavigationAPI>(null);\n const containerObjectRef = useRef<HTMLDivElement>(null);\n const itemsRef = useRef<Record<string, any | null>>({});\n\n const mergedRef = useMergeRefs(containerObjectRef, __internalRootRef);\n\n useImperativeHandle(ref, () => ({\n focus: (id) => {\n if (!itemsRef.current[id]) {\n warnOnce(\"SupportPromptGroup\", \"No matching ID found to focus.\");\n }\n itemsRef.current[id]?.focus();\n },\n }));\n\n const handleClick = (event: React.MouseEvent, id: string) => {\n const { altKey, button, ctrlKey, metaKey, shiftKey } = event;\n\n fireNonCancelableEvent(onItemClick, { id, altKey, button, ctrlKey, metaKey, shiftKey });\n };\n\n useEffect(() => {\n navigationAPI.current?.updateFocusTarget();\n });\n\n function onFocus(event: React.FocusEvent) {\n if (event.target instanceof HTMLElement && event.target.dataset.itemid) {\n focusedIdRef.current = event.target.dataset.itemid;\n }\n\n navigationAPI.current?.updateFocusTarget();\n }\n\n function onBlur() {\n navigationAPI.current?.updateFocusTarget();\n }\n\n function onKeyDown(event: React.KeyboardEvent) {\n const focusTarget = navigationAPI.current?.getFocusTarget();\n const specialKeys = [\n KeyCode.right,\n KeyCode.left,\n KeyCode.up,\n KeyCode.down,\n KeyCode.end,\n KeyCode.home,\n KeyCode.pageUp,\n KeyCode.pageDown,\n ];\n\n const hasModifierKeys = (event: React.MouseEvent | React.KeyboardEvent) => {\n return event.ctrlKey || event.altKey || event.shiftKey || event.metaKey;\n };\n\n if (hasModifierKeys(event) || !specialKeys.includes(event.keyCode)) {\n return;\n }\n if (!containerObjectRef.current || !focusTarget) {\n return;\n }\n // Ignore navigation when the focused element is not an item.\n if (document.activeElement && !document.activeElement.matches(`.${styles[\"support-prompt\"]}`)) {\n return;\n }\n event.preventDefault();\n\n const focusables = getFocusablesFrom(containerObjectRef.current);\n const activeIndex = focusables.indexOf(focusTarget);\n handleKey(event as any, {\n onHome: () => focusElement(focusables[0]),\n onEnd: () => focusElement(focusables[focusables.length - 1]),\n onInlineStart: () => focusElement(focusables[circleIndex(activeIndex - 1, [0, focusables.length - 1])]),\n onInlineEnd: () => focusElement(focusables[circleIndex(activeIndex + 1, [0, focusables.length - 1])]),\n onBlockStart: () => focusElement(focusables[circleIndex(activeIndex - 1, [0, focusables.length - 1])]),\n onBlockEnd: () => focusElement(focusables[circleIndex(activeIndex + 1, [0, focusables.length - 1])]),\n });\n }\n\n function focusElement(element: HTMLElement) {\n element.focus();\n }\n\n // List all non-disabled and registered focusables: those are eligible for keyboard navigation.\n function getFocusablesFrom(target: HTMLElement) {\n function isElementRegistered(element: HTMLElement) {\n return navigationAPI.current?.isRegistered(element) ?? false;\n }\n\n return getAllFocusables(target).filter((el) => isElementRegistered(el));\n }\n\n if (!items || items.length === 0) {\n return <div />;\n }\n\n return (\n <div\n {...getDataAttributes(rest)}\n role=\"menubar\"\n className={clsx(styles.root, { [styles.vertical]: alignment !== \"horizontal\" })}\n aria-label={ariaLabel}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyDown={onKeyDown}\n ref={mergedRef}\n >\n <SingleTabStopNavigationProvider\n ref={navigationAPI}\n navigationActive={true}\n getNextFocusTarget={() => getNextFocusTarget(containerObjectRef, focusedIdRef)}\n onUnregisterActive={(element: HTMLElement) => onUnregisterActive(element, navigationAPI)}\n >\n {items.map((item, index) => {\n return (\n <Prompt\n key={index}\n onClick={(event) => handleClick(event, item.id)}\n id={item.id}\n ref={(element) => (itemsRef.current[item.id] = element)}\n iconName={item.iconName}\n iconSvg={item.iconSvg}\n iconPosition={item.iconPosition}\n iconVerticalAlignment={item.iconVerticalAlignment}\n ariaLabel={item.ariaLabel}\n >\n {item.text}\n </Prompt>\n );\n })}\n </SingleTabStopNavigationProvider>\n </div>\n );\n },\n);\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/support-prompt-group/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,UAAU,EAAO,SAAS,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAChF,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,SAAS,EACT,OAAO,EAEP,+BAA+B,EAC/B,YAAY,EACZ,QAAQ,GACT,MAAM,+CAA+C,CAAC;AAEvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AAEnF,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAEzE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAOrC,MAAM,CAAC,MAAM,0BAA0B,GAAG,UAAU,CAClD,CACE,EACE,SAAS,GAAG,UAAU,EACtB,WAAW,EACX,KAAK,EACL,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,GAAG,IAAI,EACsF,EAC/F,GAAqC,EACrC,EAAE;IACF,MAAM,Y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D,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,SAAS,EACP,OAAO,CAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,IAAI,CAAA,KAAK,UAAU,CAAC,CAAC,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,IAAI,YAGrG,IAAI,CAAC,IAAI,IAbL,KAAK,CAcH,CACV,CAAC;YACJ,CAAC,CAAC,GAC8B,GAC9B,CACP,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { forwardRef, Ref, useEffect, useImperativeHandle, useRef } from \"react\";\nimport clsx from \"clsx\";\n\nimport {\n circleIndex,\n getAllFocusables,\n handleKey,\n KeyCode,\n SingleTabStopNavigationAPI,\n SingleTabStopNavigationProvider,\n useMergeRefs,\n warnOnce,\n} from \"@cloudscape-design/component-toolkit/internal\";\n\nimport { getDataAttributes } from \"../internal/base-component/get-data-attributes\";\nimport { InternalBaseComponentProps } from \"../internal/base-component/use-base-component\";\nimport { fireNonCancelableEvent } from \"../internal/events\";\nimport { getNextFocusTarget, onUnregisterActive } from \"./focus-helpers\";\nimport { SupportPromptGroupProps } from \"./interfaces\";\nimport { Prompt } from \"./prompt\";\n\nimport styles from \"./styles.css.js\";\n\n// Style API v2\nexport interface StyleClassNames {\n item?: string | ((args: { item: SupportPromptGroupProps.Item }) => string);\n}\n\nexport const InternalSupportPromptGroup = forwardRef(\n (\n {\n alignment = \"vertical\",\n onItemClick,\n items,\n __internalRootRef,\n ariaLabel,\n styleClassNames,\n ...rest\n }: SupportPromptGroupProps & InternalBaseComponentProps & { styleClassNames?: StyleClassNames },\n ref: Ref<SupportPromptGroupProps.Ref>,\n ) => {\n const focusedIdRef = useRef<null | string>(null);\n const navigationAPI = useRef<SingleTabStopNavigationAPI>(null);\n const containerObjectRef = useRef<HTMLDivElement>(null);\n const itemsRef = useRef<Record<string, any | null>>({});\n\n const mergedRef = useMergeRefs(containerObjectRef, __internalRootRef);\n\n useImperativeHandle(ref, () => ({\n focus: (id) => {\n if (!itemsRef.current[id]) {\n warnOnce(\"SupportPromptGroup\", \"No matching ID found to focus.\");\n }\n itemsRef.current[id]?.focus();\n },\n }));\n\n const handleClick = (event: React.MouseEvent, id: string) => {\n const { altKey, button, ctrlKey, metaKey, shiftKey } = event;\n\n fireNonCancelableEvent(onItemClick, { id, altKey, button, ctrlKey, metaKey, shiftKey });\n };\n\n useEffect(() => {\n navigationAPI.current?.updateFocusTarget();\n });\n\n function onFocus(event: React.FocusEvent) {\n if (event.target instanceof HTMLElement && event.target.dataset.itemid) {\n focusedIdRef.current = event.target.dataset.itemid;\n }\n\n navigationAPI.current?.updateFocusTarget();\n }\n\n function onBlur() {\n navigationAPI.current?.updateFocusTarget();\n }\n\n function onKeyDown(event: React.KeyboardEvent) {\n const focusTarget = navigationAPI.current?.getFocusTarget();\n const specialKeys = [\n KeyCode.right,\n KeyCode.left,\n KeyCode.up,\n KeyCode.down,\n KeyCode.end,\n KeyCode.home,\n KeyCode.pageUp,\n KeyCode.pageDown,\n ];\n\n const hasModifierKeys = (event: React.MouseEvent | React.KeyboardEvent) => {\n return event.ctrlKey || event.altKey || event.shiftKey || event.metaKey;\n };\n\n if (hasModifierKeys(event) || !specialKeys.includes(event.keyCode)) {\n return;\n }\n if (!containerObjectRef.current || !focusTarget) {\n return;\n }\n // Ignore navigation when the focused element is not an item.\n if (document.activeElement && !document.activeElement.matches(`.${styles[\"support-prompt\"]}`)) {\n return;\n }\n event.preventDefault();\n\n const focusables = getFocusablesFrom(containerObjectRef.current);\n const activeIndex = focusables.indexOf(focusTarget);\n handleKey(event as any, {\n onHome: () => focusElement(focusables[0]),\n onEnd: () => focusElement(focusables[focusables.length - 1]),\n onInlineStart: () => focusElement(focusables[circleIndex(activeIndex - 1, [0, focusables.length - 1])]),\n onInlineEnd: () => focusElement(focusables[circleIndex(activeIndex + 1, [0, focusables.length - 1])]),\n onBlockStart: () => focusElement(focusables[circleIndex(activeIndex - 1, [0, focusables.length - 1])]),\n onBlockEnd: () => focusElement(focusables[circleIndex(activeIndex + 1, [0, focusables.length - 1])]),\n });\n }\n\n function focusElement(element: HTMLElement) {\n element.focus();\n }\n\n // List all non-disabled and registered focusables: those are eligible for keyboard navigation.\n function getFocusablesFrom(target: HTMLElement) {\n function isElementRegistered(element: HTMLElement) {\n return navigationAPI.current?.isRegistered(element) ?? false;\n }\n\n return getAllFocusables(target).filter((el) => isElementRegistered(el));\n }\n\n if (!items || items.length === 0) {\n return <div />;\n }\n\n return (\n <div\n {...getDataAttributes(rest)}\n role=\"menubar\"\n className={clsx(styles.root, { [styles.vertical]: alignment !== \"horizontal\" })}\n aria-label={ariaLabel}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyDown={onKeyDown}\n ref={mergedRef}\n >\n <SingleTabStopNavigationProvider\n ref={navigationAPI}\n navigationActive={true}\n getNextFocusTarget={() => getNextFocusTarget(containerObjectRef, focusedIdRef)}\n onUnregisterActive={(element: HTMLElement) => onUnregisterActive(element, navigationAPI)}\n >\n {items.map((item, index) => {\n return (\n <Prompt\n key={index}\n onClick={(event) => handleClick(event, item.id)}\n id={item.id}\n ref={(element) => (itemsRef.current[item.id] = element)}\n iconName={item.iconName}\n iconSvg={item.iconSvg}\n iconPosition={item.iconPosition}\n iconVerticalAlignment={item.iconVerticalAlignment}\n ariaLabel={item.ariaLabel}\n className={\n typeof styleClassNames?.item === \"function\" ? styleClassNames.item({ item }) : styleClassNames?.item\n }\n >\n {item.text}\n </Prompt>\n );\n })}\n </SingleTabStopNavigationProvider>\n </div>\n );\n },\n);\n"]}
@@ -9,5 +9,6 @@ export interface PromptProps {
9
9
  iconPosition?: "left" | "right";
10
10
  iconVerticalAlignment?: "center" | "start" | "end";
11
11
  ariaLabel?: string;
12
+ className?: string;
12
13
  }
13
14
  export declare const Prompt: import("react").ForwardRefExoticComponent<PromptProps & import("react").RefAttributes<HTMLButtonElement>>;
@@ -7,7 +7,7 @@ import { useSingleTabStopNavigation } from "@cloudscape-design/component-toolkit
7
7
  import Icon from "@cloudscape-design/components/icon";
8
8
  import useForwardFocus from "../internal/utils/use-forward-focus";
9
9
  import styles from "./styles.css.js";
10
- export const Prompt = forwardRef(({ children, id, onClick, iconName, iconSvg, iconPosition = "left", iconVerticalAlignment = "start", ariaLabel, }, ref) => {
10
+ export const Prompt = forwardRef(({ children, id, onClick, iconName, iconSvg, iconPosition = "left", iconVerticalAlignment = "start", ariaLabel, className, }, ref) => {
11
11
  const buttonRef = useRef(null);
12
12
  useForwardFocus(ref, buttonRef);
13
13
  const { tabIndex } = useSingleTabStopNavigation(buttonRef);
@@ -21,6 +21,6 @@ export const Prompt = forwardRef(({ children, id, onClick, iconName, iconSvg, ic
21
21
  };
22
22
  return (_jsxs("button", { role: "menuitem", tabIndex: tabIndex, ref: buttonRef, onClick: (event) => {
23
23
  onClick(event, id);
24
- }, id: id, "data-testid": id, "data-itemid": id, className: clsx(styles["support-prompt"]), "aria-label": ariaLabel, children: [iconPosition !== "right" && renderIcon(), _jsx("span", { className: styles["support-prompt-text"], children: children }), iconPosition === "right" && renderIcon()] }));
24
+ }, id: id, "data-testid": id, "data-itemid": id, className: clsx(className, styles["support-prompt"]), "aria-label": ariaLabel, children: [iconPosition !== "right" && renderIcon(), _jsx("span", { className: styles["support-prompt-text"], children: children }), iconPosition === "right" && renderIcon()] }));
25
25
  });
26
26
  //# sourceMappingURL=prompt.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../src/support-prompt-group/prompt.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,UAAU,EAAkB,MAAM,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,0BAA0B,E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aAEpB,YAAY,KAAK,OAAO,IAAI,UAAU,EAAE,EACzC,eAAM,SAAS,EAAE,MAAM,CAAC,qBAAqB,CAAC,YAAG,QAAQ,GAAQ,EAChE,YAAY,KAAK,OAAO,IAAI,UAAU,EAAE,IAClC,CACV,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { forwardRef, ReactNode, Ref, useRef } from \"react\";\nimport clsx from \"clsx\";\n\nimport { useSingleTabStopNavigation } from \"@cloudscape-design/component-toolkit/internal\";\nimport Icon, { IconProps } from \"@cloudscape-design/components/icon\";\n\nimport useForwardFocus from \"../internal/utils/use-forward-focus\";\n\nimport styles from \"./styles.css.js\";\n\nexport interface PromptProps {\n children: ReactNode;\n id: string;\n onClick: (event: React.MouseEvent, id: string) => void;\n iconName?: IconProps.Name;\n iconSvg?: React.ReactNode;\n iconPosition?: \"left\" | \"right\";\n iconVerticalAlignment?: \"center\" | \"start\" | \"end\";\n ariaLabel?: string;\n}\n\nexport const Prompt = forwardRef(\n (\n {\n children,\n id,\n onClick,\n iconName,\n iconSvg,\n iconPosition = \"left\",\n iconVerticalAlignment = \"start\",\n ariaLabel,\n }: PromptProps,\n ref: Ref<HTMLButtonElement | null>,\n ) => {\n const buttonRef = useRef<HTMLButtonElement>(null);\n useForwardFocus(ref, buttonRef);\n\n const { tabIndex } = useSingleTabStopNavigation(buttonRef);\n\n // Helper function to conditionally render the icon\n // iconSvg takes precedence over iconName\n const renderIcon = () => {\n if (!iconSvg && !iconName) {\n return null;\n }\n\n return (\n <span className={clsx(styles[\"support-prompt-icon\"], styles[`icon-align-${iconVerticalAlignment}`])}>\n <Icon name={iconName} svg={iconSvg} size=\"inherit\" />\n </span>\n );\n };\n\n return (\n <button\n role=\"menuitem\"\n tabIndex={tabIndex}\n ref={buttonRef}\n onClick={(event) => {\n onClick(event, id);\n }}\n id={id}\n data-testid={id}\n data-itemid={id}\n className={clsx(styles[\"support-prompt\"])}\n aria-label={ariaLabel}\n >\n {iconPosition !== \"right\" && renderIcon()}\n <span className={styles[\"support-prompt-text\"]}>{children}</span>\n {iconPosition === \"right\" && renderIcon()}\n </button>\n );\n },\n);\n"]}
1
+ {"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../src/support-prompt-group/prompt.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,UAAU,EAAkB,MAAM,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAC3F,OAAO,IAAmB,MAAM,oCAAoC,CAAC;AAErE,OAAO,eAAe,MAAM,qCAAqC,CAAC;AAElE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAcrC,MAAM,CAAC,MAAM,MAAM,GAAG,UAAU,CAC9B,CACE,EACE,QAAQ,EACR,EAAE,EACF,OAAO,EACP,QAAQ,EACR,OAAO,EACP,YAAY,GAAG,MAAM,EACrB,qBAAqB,GAAG,OAAO,EAC/B,SAAS,EACT,SAAS,GACG,EACd,GAAkC,EAClC,EAAE;IACF,MAAM,SAAS,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAC;IAClD,eAAe,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;IAEhC,MAAM,EAAE,QAAQ,EAAE,GAAG,0BAA0B,CAAC,SAAS,CAAC,CAAC;IAE3D,mDAAmD;IACnD,yCAAyC;IACzC,MAAM,UAAU,GAAG,GAAG,EAAE;QACtB,IAAI,CAAC,OAAO,IAAI,CAAC,QAAQ,EAAE;YACzB,OAAO,IAAI,CAAC;SACb;QAED,OAAO,CACL,eAAM,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,qBAAqB,CAAC,EAAE,MAAM,CAAC,cAAc,qBAAqB,EAAE,CAAC,CAAC,YACjG,KAAC,IAAI,IAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAC,SAAS,GAAG,GAChD,CACR,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,CACL,kBACE,IAAI,EAAC,UAAU,EACf,QAAQ,EAAE,QAAQ,EAClB,GAAG,EAAE,SAAS,EACd,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;YACjB,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACrB,CAAC,EACD,EAAE,EAAE,EAAE,iBACO,EAAE,iBACF,EAAE,EACf,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,CAAC,gBACxC,SAAS,aAEpB,YAAY,KAAK,OAAO,IAAI,UAAU,EAAE,EACzC,eAAM,SAAS,EAAE,MAAM,CAAC,qBAAqB,CAAC,YAAG,QAAQ,GAAQ,EAChE,YAAY,KAAK,OAAO,IAAI,UAAU,EAAE,IAClC,CACV,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { forwardRef, ReactNode, Ref, useRef } from \"react\";\nimport clsx from \"clsx\";\n\nimport { useSingleTabStopNavigation } from \"@cloudscape-design/component-toolkit/internal\";\nimport Icon, { IconProps } from \"@cloudscape-design/components/icon\";\n\nimport useForwardFocus from \"../internal/utils/use-forward-focus\";\n\nimport styles from \"./styles.css.js\";\n\nexport interface PromptProps {\n children: ReactNode;\n id: string;\n onClick: (event: React.MouseEvent, id: string) => void;\n iconName?: IconProps.Name;\n iconSvg?: React.ReactNode;\n iconPosition?: \"left\" | \"right\";\n iconVerticalAlignment?: \"center\" | \"start\" | \"end\";\n ariaLabel?: string;\n className?: string;\n}\n\nexport const Prompt = forwardRef(\n (\n {\n children,\n id,\n onClick,\n iconName,\n iconSvg,\n iconPosition = \"left\",\n iconVerticalAlignment = \"start\",\n ariaLabel,\n className,\n }: PromptProps,\n ref: Ref<HTMLButtonElement | null>,\n ) => {\n const buttonRef = useRef<HTMLButtonElement>(null);\n useForwardFocus(ref, buttonRef);\n\n const { tabIndex } = useSingleTabStopNavigation(buttonRef);\n\n // Helper function to conditionally render the icon\n // iconSvg takes precedence over iconName\n const renderIcon = () => {\n if (!iconSvg && !iconName) {\n return null;\n }\n\n return (\n <span className={clsx(styles[\"support-prompt-icon\"], styles[`icon-align-${iconVerticalAlignment}`])}>\n <Icon name={iconName} svg={iconSvg} size=\"inherit\" />\n </span>\n );\n };\n\n return (\n <button\n role=\"menuitem\"\n tabIndex={tabIndex}\n ref={buttonRef}\n onClick={(event) => {\n onClick(event, id);\n }}\n id={id}\n data-testid={id}\n data-itemid={id}\n className={clsx(className, styles[\"support-prompt\"])}\n aria-label={ariaLabel}\n >\n {iconPosition !== \"right\" && renderIcon()}\n <span className={styles[\"support-prompt-text\"]}>{children}</span>\n {iconPosition === \"right\" && renderIcon()}\n </button>\n );\n },\n);\n"]}
@@ -1,13 +1,13 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "root": "awsui_root_1wevk_5hz0n_11",
5
- "vertical": "awsui_vertical_1wevk_5hz0n_41",
6
- "support-prompt": "awsui_support-prompt_1wevk_5hz0n_45",
7
- "support-prompt-icon": "awsui_support-prompt-icon_1wevk_5hz0n_102",
8
- "icon-align-center": "awsui_icon-align-center_1wevk_5hz0n_106",
9
- "icon-align-start": "awsui_icon-align-start_1wevk_5hz0n_109",
10
- "icon-align-end": "awsui_icon-align-end_1wevk_5hz0n_112",
11
- "support-prompt-text": "awsui_support-prompt-text_1wevk_5hz0n_116"
4
+ "root": "awsui_root_1wevk_1bb15_32",
5
+ "vertical": "awsui_vertical_1wevk_1bb15_62",
6
+ "support-prompt": "awsui_support-prompt_1wevk_1bb15_66",
7
+ "support-prompt-icon": "awsui_support-prompt-icon_1wevk_1bb15_126",
8
+ "icon-align-center": "awsui_icon-align-center_1wevk_1bb15_130",
9
+ "icon-align-start": "awsui_icon-align-start_1wevk_1bb15_133",
10
+ "icon-align-end": "awsui_icon-align-end_1wevk_1bb15_136",
11
+ "support-prompt-text": "awsui_support-prompt-text_1wevk_1bb15_140"
12
12
  };
13
13