@cloudscape-design/chat-components 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/NOTICE +2 -0
- package/README.md +20 -0
- package/avatar/index.d.ts +3 -0
- package/avatar/index.js +12 -0
- package/avatar/index.js.map +1 -0
- package/avatar/interfaces.d.ts +62 -0
- package/avatar/interfaces.js +4 -0
- package/avatar/interfaces.js.map +1 -0
- package/avatar/internal.d.ts +5 -0
- package/avatar/internal.js +56 -0
- package/avatar/internal.js.map +1 -0
- package/avatar/loading-dots/index.d.ts +5 -0
- package/avatar/loading-dots/index.js +11 -0
- package/avatar/loading-dots/index.js.map +1 -0
- package/avatar/loading-dots/styles.css.js +12 -0
- package/avatar/loading-dots/styles.scoped.css +187 -0
- package/avatar/loading-dots/styles.selectors.js +13 -0
- package/avatar/styles.css.js +10 -0
- package/avatar/styles.scoped.css +88 -0
- package/avatar/styles.selectors.js +11 -0
- package/index.d.ts +4 -0
- package/index.js +5 -0
- package/index.js.map +1 -0
- package/internal/api-docs/components/avatar.js +172 -0
- package/internal/api-docs/components/index.js +4 -0
- package/internal/api-docs/components/loading-bar.js +23 -0
- package/internal/api-docs/test-utils-doc/dom.js +4 -0
- package/internal/api-docs/test-utils-doc/selectors.js +4 -0
- package/internal/base-component/get-data-attributes.d.ts +1 -0
- package/internal/base-component/get-data-attributes.js +12 -0
- package/internal/base-component/get-data-attributes.js.map +1 -0
- package/internal/base-component/use-base-component.d.ts +13 -0
- package/internal/base-component/use-base-component.js +19 -0
- package/internal/base-component/use-base-component.js.map +1 -0
- package/internal/base-component/use-telemetry.d.ts +2 -0
- package/internal/base-component/use-telemetry.js +10 -0
- package/internal/base-component/use-telemetry.js.map +1 -0
- package/internal/base-component/use-visual-refresh.d.ts +1 -0
- package/internal/base-component/use-visual-refresh.js +6 -0
- package/internal/base-component/use-visual-refresh.js.map +1 -0
- package/internal/environment.d.ts +4 -0
- package/internal/environment.js +4 -0
- package/internal/environment.json +6 -0
- package/internal/keycode.d.ts +19 -0
- package/internal/keycode.js +26 -0
- package/internal/keycode.js.map +1 -0
- package/internal/manifest.json +3 -0
- package/internal/utils/apply-display-name.d.ts +1 -0
- package/internal/utils/apply-display-name.js +6 -0
- package/internal/utils/apply-display-name.js.map +1 -0
- package/internal/utils/focus-visible.d.ts +2 -0
- package/internal/utils/focus-visible.js +49 -0
- package/internal/utils/focus-visible.js.map +1 -0
- package/internal/utils/use-merge-refs.d.ts +9 -0
- package/internal/utils/use-merge-refs.js +30 -0
- package/internal/utils/use-merge-refs.js.map +1 -0
- package/loading-bar/index.d.ts +3 -0
- package/loading-bar/index.js +12 -0
- package/loading-bar/index.js.map +1 -0
- package/loading-bar/interfaces.d.ts +11 -0
- package/loading-bar/interfaces.js +4 -0
- package/loading-bar/interfaces.js.map +1 -0
- package/loading-bar/internal.d.ts +3 -0
- package/loading-bar/internal.js +10 -0
- package/loading-bar/internal.js.map +1 -0
- package/loading-bar/styles.css.js +10 -0
- package/loading-bar/styles.scoped.css +87 -0
- package/loading-bar/styles.selectors.js +11 -0
- package/package.json +30 -0
- package/test-utils/dom/avatar/index.d.ts +6 -0
- package/test-utils/dom/avatar/index.js +16 -0
- package/test-utils/dom/avatar/index.js.map +1 -0
- package/test-utils/dom/index.d.ts +13 -0
- package/test-utils/dom/index.js +25 -0
- package/test-utils/dom/index.js.map +1 -0
- package/test-utils/dom/loading-bar/index.d.ts +4 -0
- package/test-utils/dom/loading-bar/index.js +11 -0
- package/test-utils/dom/loading-bar/index.js.map +1 -0
- package/test-utils/selectors/avatar/index.d.ts +6 -0
- package/test-utils/selectors/avatar/index.js +16 -0
- package/test-utils/selectors/avatar/index.js.map +1 -0
- package/test-utils/selectors/index.d.ts +13 -0
- package/test-utils/selectors/index.js +25 -0
- package/test-utils/selectors/index.js.map +1 -0
- package/test-utils/selectors/loading-bar/index.d.ts +4 -0
- package/test-utils/selectors/loading-bar/index.js +11 -0
- package/test-utils/selectors/loading-bar/index.js.map +1 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/NOTICE
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
## Chat components for Cloudscape Design System
|
|
2
|
+
|
|
3
|
+
This package contains the source code of chat components in the [Cloudscape Design System](https://cloudscape.design/).
|
|
4
|
+
For more information about the chat components, see [the documentation](https://cloudscape.design/components/chat-components/).
|
|
5
|
+
|
|
6
|
+
Cloudscape is an open source design system for building intuitive, engaging, and inclusive user experiences at scale. It consists of an extensive set of guidelines to create web applications, along with the design resources and front-end components to streamline implementation.
|
|
7
|
+
|
|
8
|
+
Cloudscape was built for and is used by Amazon Web Services (AWS) products and services. We created it in 2016 to improve the user experience across AWS web applications, and also to help teams implement those applications faster. Since then, we have continued enhancing the system based on customer feedback and research.
|
|
9
|
+
|
|
10
|
+
## Getting help
|
|
11
|
+
|
|
12
|
+
You can [create bug reports or feature requests](https://github.com/cloudscape-design/chat-components/issues/new/choose), or [start a discussion](https://github.com/cloudscape-design/components/discussions) to ask a question. To minimize duplicates, we recommend that you search for existing bug reports, feature requests, or discussions before initiating a new thread.
|
|
13
|
+
|
|
14
|
+
## Contributing
|
|
15
|
+
|
|
16
|
+
The [contribution guidelines](/CONTRIBUTING.md) contains information on how to contribute, as well as our support model and versioning strategy.
|
|
17
|
+
|
|
18
|
+
## License
|
|
19
|
+
|
|
20
|
+
This project is licensed under the [Apache 2.0 License](/LICENSE).
|
package/avatar/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
import useBaseComponent from "../internal/base-component/use-base-component";
|
|
5
|
+
import { applyDisplayName } from "../internal/utils/apply-display-name";
|
|
6
|
+
import InternalAvatar from "./internal";
|
|
7
|
+
export default function Avatar({ color = "default", iconName = "user-profile", ...props }) {
|
|
8
|
+
const baseComponentProps = useBaseComponent("Avatar", { props: { color, iconName } });
|
|
9
|
+
return _jsx(InternalAvatar, { color: color, iconName: iconName, ...props, ...baseComponentProps });
|
|
10
|
+
}
|
|
11
|
+
applyDisplayName(Avatar, "Avatar");
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/avatar/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,gBAAgB,MAAM,+CAA+C,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE,OAAO,cAAc,MAAM,YAAY,CAAC;AAIxC,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,KAAK,GAAG,SAAS,EAAE,QAAQ,GAAG,cAAc,EAAE,GAAG,KAAK,EAAe;IACpG,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;IACtF,OAAO,KAAC,cAAc,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,KAAM,KAAK,KAAM,kBAAkB,GAAI,CAAC;AACjG,CAAC;AACD,gBAAgB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport useBaseComponent from \"../internal/base-component/use-base-component\";\nimport { applyDisplayName } from \"../internal/utils/apply-display-name\";\nimport { AvatarProps } from \"./interfaces\";\nimport InternalAvatar from \"./internal\";\n\nexport type { AvatarProps };\n\nexport default function Avatar({ color = \"default\", iconName = \"user-profile\", ...props }: AvatarProps) {\n const baseComponentProps = useBaseComponent(\"Avatar\", { props: { color, iconName } });\n return <InternalAvatar color={color} iconName={iconName} {...props} {...baseComponentProps} />;\n}\napplyDisplayName(Avatar, \"Avatar\");\n"]}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface AvatarProps {
|
|
3
|
+
/**
|
|
4
|
+
* Determines the color of the avatar.
|
|
5
|
+
* Use `gen-ai` for AI assistants and `default` otherwise.
|
|
6
|
+
*/
|
|
7
|
+
color?: AvatarProps.Color;
|
|
8
|
+
/**
|
|
9
|
+
* The text content shown in the avatar's tooltip.
|
|
10
|
+
*
|
|
11
|
+
* When you use this property, make sure to include it in the `ariaLabel`.
|
|
12
|
+
*/
|
|
13
|
+
tooltipText?: string;
|
|
14
|
+
/**
|
|
15
|
+
* The text content shown directly in the avatar's body.
|
|
16
|
+
* Can be 1 or 2 symbols long, every subsequent symbol is ignored.
|
|
17
|
+
* Use it to define initials that uniquely identify the avatar's owner.
|
|
18
|
+
*
|
|
19
|
+
* When you use this property, make sure to include it in the `ariaLabel`.
|
|
20
|
+
*/
|
|
21
|
+
initials?: string;
|
|
22
|
+
/**
|
|
23
|
+
* When set to true, a loading indicator is shown in avatar.
|
|
24
|
+
*/
|
|
25
|
+
loading?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Text to describe the avatar for assistive technology.
|
|
28
|
+
* When more than one avatar is used, provide a unique label for each.
|
|
29
|
+
* For example, "User avatar" and "AI assistant avatar" or "Your avatar" and "User avatar for John Doe".
|
|
30
|
+
*
|
|
31
|
+
* If `tooltipText` or `initials` are used make sure to include them in the `ariaLabel`.
|
|
32
|
+
*/
|
|
33
|
+
ariaLabel: string;
|
|
34
|
+
/**
|
|
35
|
+
* Specifies the icon to be displayed as Avatar.
|
|
36
|
+
* Use `gen-ai` icon for AI assistants. By default `user-profile` icon is used.
|
|
37
|
+
*
|
|
38
|
+
* If you set both `iconName` and `initials`, `initials` will take precedence.
|
|
39
|
+
*/
|
|
40
|
+
iconName?: IconProps.Name;
|
|
41
|
+
/**
|
|
42
|
+
* Specifies the URL of a custom icon. Use this property if the icon you want isn't available, and your custom icon can't be an SVG.
|
|
43
|
+
* For SVG icons, use the `iconSvg` slot instead.
|
|
44
|
+
*
|
|
45
|
+
* If you set both `iconUrl` and `iconSvg`, `iconSvg` will take precedence.
|
|
46
|
+
*/
|
|
47
|
+
iconUrl?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Specifies the SVG of a custom icon.
|
|
50
|
+
*
|
|
51
|
+
* Use this property if the icon you want isn't available.
|
|
52
|
+
* If you set both `iconUrl` and `iconSvg`, `iconSvg` will take precedence.
|
|
53
|
+
*/
|
|
54
|
+
iconSvg?: React.ReactNode;
|
|
55
|
+
}
|
|
56
|
+
export declare namespace AvatarProps {
|
|
57
|
+
type Color = "default" | "gen-ai";
|
|
58
|
+
}
|
|
59
|
+
declare namespace IconProps {
|
|
60
|
+
type Name = "add-plus" | "anchor-link" | "angle-left-double" | "angle-left" | "angle-right-double" | "angle-right" | "angle-up" | "angle-down" | "arrow-left" | "arrow-right" | "audio-full" | "audio-half" | "audio-off" | "bug" | "call" | "calendar" | "caret-down-filled" | "caret-down" | "caret-left-filled" | "caret-right-filled" | "caret-up-filled" | "caret-up" | "check" | "contact" | "close" | "copy" | "delete-marker" | "download" | "drag-indicator" | "edit" | "ellipsis" | "envelope" | "expand" | "external" | "file-open" | "file" | "filter" | "flag" | "folder-open" | "folder" | "gen-ai" | "group-active" | "group" | "heart" | "heart-filled" | "insert-row" | "key" | "keyboard" | "lock-private" | "menu" | "microphone" | "microphone-off" | "multiscreen" | "notification" | "redo" | "refresh" | "remove" | "resize-area" | "script" | "search" | "security" | "settings" | "send" | "share" | "shrink" | "star-filled" | "star-half" | "star" | "status-in-progress" | "status-info" | "status-negative" | "status-pending" | "status-positive" | "status-stopped" | "status-warning" | "subtract-minus" | "suggestions" | "thumbs-down-filled" | "thumbs-down" | "thumbs-up-filled" | "thumbs-up" | "ticket" | "treeview-collapse" | "treeview-expand" | "undo" | "unlocked" | "upload-download" | "upload" | "user-profile-active" | "user-profile" | "video-off" | "video-on" | "video-unavailable" | "view-full" | "view-horizontal" | "view-vertical" | "zoom-in" | "zoom-out" | "zoom-to-fit";
|
|
61
|
+
}
|
|
62
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/avatar/interfaces.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nexport interface AvatarProps {\n /**\n * Determines the color of the avatar.\n * Use `gen-ai` for AI assistants and `default` otherwise.\n */\n color?: AvatarProps.Color;\n\n /**\n * The text content shown in the avatar's tooltip.\n *\n * When you use this property, make sure to include it in the `ariaLabel`.\n */\n tooltipText?: string;\n\n /**\n * The text content shown directly in the avatar's body.\n * Can be 1 or 2 symbols long, every subsequent symbol is ignored.\n * Use it to define initials that uniquely identify the avatar's owner.\n *\n * When you use this property, make sure to include it in the `ariaLabel`.\n */\n initials?: string;\n\n /**\n * When set to true, a loading indicator is shown in avatar.\n */\n loading?: boolean;\n\n /**\n * Text to describe the avatar for assistive technology.\n * When more than one avatar is used, provide a unique label for each.\n * For example, \"User avatar\" and \"AI assistant avatar\" or \"Your avatar\" and \"User avatar for John Doe\".\n *\n * If `tooltipText` or `initials` are used make sure to include them in the `ariaLabel`.\n */\n ariaLabel: string;\n\n /**\n * Specifies the icon to be displayed as Avatar.\n * Use `gen-ai` icon for AI assistants. By default `user-profile` icon is used.\n *\n * If you set both `iconName` and `initials`, `initials` will take precedence.\n */\n iconName?: IconProps.Name;\n\n /**\n * Specifies the URL of a custom icon. Use this property if the icon you want isn't available, and your custom icon can't be an SVG.\n * For SVG icons, use the `iconSvg` slot instead.\n *\n * If you set both `iconUrl` and `iconSvg`, `iconSvg` will take precedence.\n */\n iconUrl?: string;\n\n /**\n * Specifies the SVG of a custom icon.\n *\n * Use this property if the icon you want isn't available.\n * If you set both `iconUrl` and `iconSvg`, `iconSvg` will take precedence.\n */\n iconSvg?: React.ReactNode;\n}\n\nexport namespace AvatarProps {\n export type Color = \"default\" | \"gen-ai\";\n}\n\n// This is added here because cross package reference doesn't work in documenter and icon names are not populated\n// It'll be replaced by documenter implementation once documenter is updated to handle cross package reference\nnamespace IconProps {\n // Why not enums? Explained there\n // https://stackoverflow.com/questions/52393730/typescript-string-literal-union-type-from-enum\n export type Name =\n | \"add-plus\"\n | \"anchor-link\"\n | \"angle-left-double\"\n | \"angle-left\"\n | \"angle-right-double\"\n | \"angle-right\"\n | \"angle-up\"\n | \"angle-down\"\n | \"arrow-left\"\n | \"arrow-right\"\n | \"audio-full\"\n | \"audio-half\"\n | \"audio-off\"\n | \"bug\"\n | \"call\"\n | \"calendar\"\n | \"caret-down-filled\"\n | \"caret-down\"\n | \"caret-left-filled\"\n | \"caret-right-filled\"\n | \"caret-up-filled\"\n | \"caret-up\"\n | \"check\"\n | \"contact\"\n | \"close\"\n | \"copy\"\n | \"delete-marker\"\n | \"download\"\n | \"drag-indicator\"\n | \"edit\"\n | \"ellipsis\"\n | \"envelope\"\n | \"expand\"\n | \"external\"\n | \"file-open\"\n | \"file\"\n | \"filter\"\n | \"flag\"\n | \"folder-open\"\n | \"folder\"\n | \"gen-ai\"\n | \"group-active\"\n | \"group\"\n | \"heart\"\n | \"heart-filled\"\n | \"insert-row\"\n | \"key\"\n | \"keyboard\"\n | \"lock-private\"\n | \"menu\"\n | \"microphone\"\n | \"microphone-off\"\n | \"multiscreen\"\n | \"notification\"\n | \"redo\"\n | \"refresh\"\n | \"remove\"\n | \"resize-area\"\n | \"script\"\n | \"search\"\n | \"security\"\n | \"settings\"\n | \"send\"\n | \"share\"\n | \"shrink\"\n | \"star-filled\"\n | \"star-half\"\n | \"star\"\n | \"status-in-progress\"\n | \"status-info\"\n | \"status-negative\"\n | \"status-pending\"\n | \"status-positive\"\n | \"status-stopped\"\n | \"status-warning\"\n | \"subtract-minus\"\n | \"suggestions\"\n | \"thumbs-down-filled\"\n | \"thumbs-down\"\n | \"thumbs-up-filled\"\n | \"thumbs-up\"\n | \"ticket\"\n | \"treeview-collapse\"\n | \"treeview-expand\"\n | \"undo\"\n | \"unlocked\"\n | \"upload-download\"\n | \"upload\"\n | \"user-profile-active\"\n | \"user-profile\"\n | \"video-off\"\n | \"video-on\"\n | \"video-unavailable\"\n | \"view-full\"\n | \"view-horizontal\"\n | \"view-vertical\"\n | \"zoom-in\"\n | \"zoom-out\"\n | \"zoom-to-fit\";\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { InternalBaseComponentProps } from "../internal/base-component/use-base-component";
|
|
2
|
+
import { AvatarProps } from "./interfaces.js";
|
|
3
|
+
export interface InternalAvatarProps extends AvatarProps, InternalBaseComponentProps {
|
|
4
|
+
}
|
|
5
|
+
export default function InternalAvatar({ color, tooltipText, initials, loading, ariaLabel, iconName, iconSvg, iconUrl, __internalRootRef, ...rest }: InternalAvatarProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
import { warnOnce } from "@cloudscape-design/component-toolkit/internal";
|
|
5
|
+
import Icon from "@cloudscape-design/components/icon";
|
|
6
|
+
import Tooltip from "@cloudscape-design/components/internal/tooltip-do-not-use";
|
|
7
|
+
import clsx from "clsx";
|
|
8
|
+
import { useRef, useState } from "react";
|
|
9
|
+
import { getDataAttributes } from "../internal/base-component/get-data-attributes";
|
|
10
|
+
import { useMergeRefs } from "../internal/utils/use-merge-refs";
|
|
11
|
+
import LoadingDots from "./loading-dots";
|
|
12
|
+
import styles from "./styles.css.js";
|
|
13
|
+
const AvatarContent = ({ color, loading, initials, iconName, iconSvg, iconUrl, ariaLabel }) => {
|
|
14
|
+
if (loading) {
|
|
15
|
+
return _jsx(LoadingDots, { color: color });
|
|
16
|
+
}
|
|
17
|
+
if (initials) {
|
|
18
|
+
const letters = initials.length > 2 ? initials.slice(0, 2) : initials;
|
|
19
|
+
if (initials.length > 2) {
|
|
20
|
+
warnOnce("Avatar", `"initials" is longer than 2 characters. Only the first two characters are shown.`);
|
|
21
|
+
}
|
|
22
|
+
return _jsx("span", { children: letters });
|
|
23
|
+
}
|
|
24
|
+
return _jsx(Icon, { name: iconName, svg: iconSvg, url: iconUrl, alt: ariaLabel });
|
|
25
|
+
};
|
|
26
|
+
export default function InternalAvatar({ color, tooltipText, initials, loading = false, ariaLabel, iconName, iconSvg, iconUrl, __internalRootRef = null, ...rest }) {
|
|
27
|
+
const handleRef = useRef(null);
|
|
28
|
+
const [showTooltip, setShowTooltip] = useState(false);
|
|
29
|
+
const mergedRef = useMergeRefs(handleRef, __internalRootRef);
|
|
30
|
+
const tooltipAttributes = {
|
|
31
|
+
onFocus: () => {
|
|
32
|
+
setShowTooltip(true);
|
|
33
|
+
},
|
|
34
|
+
onBlur: () => {
|
|
35
|
+
setShowTooltip(false);
|
|
36
|
+
},
|
|
37
|
+
onMouseEnter: () => {
|
|
38
|
+
setShowTooltip(true);
|
|
39
|
+
},
|
|
40
|
+
onMouseLeave: () => {
|
|
41
|
+
setShowTooltip(false);
|
|
42
|
+
},
|
|
43
|
+
onTouchStart: () => {
|
|
44
|
+
setShowTooltip(true);
|
|
45
|
+
},
|
|
46
|
+
onTouchEnd: () => {
|
|
47
|
+
setShowTooltip(false);
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
return (_jsxs("div", { ...getDataAttributes(rest), ref: mergedRef, tabIndex: 0, className: clsx(styles.root, styles[`avatar-color-${color}`], {
|
|
51
|
+
[styles.initials]: initials,
|
|
52
|
+
}), role: "img", "aria-label": ariaLabel, ...tooltipAttributes, children: [showTooltip && tooltipText && (_jsx(Tooltip, { value: tooltipText, trackRef: handleRef,
|
|
53
|
+
// This is added to ensure tooltip is closed when clicked for consistency with other tooltip usages
|
|
54
|
+
contentAttributes: { onPointerDown: () => setShowTooltip(false) } })), _jsx("div", { className: styles.content, children: _jsx(AvatarContent, { color: color, ariaLabel: ariaLabel, initials: initials, loading: loading, iconName: iconName, iconSvg: iconSvg, iconUrl: iconUrl }) })] }));
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=internal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/avatar/internal.tsx"],"names":[],"mappings":"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","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { warnOnce } from \"@cloudscape-design/component-toolkit/internal\";\nimport Icon from \"@cloudscape-design/components/icon\";\nimport Tooltip from \"@cloudscape-design/components/internal/tooltip-do-not-use\";\nimport clsx from \"clsx\";\nimport { useRef, useState } from \"react\";\n\nimport { getDataAttributes } from \"../internal/base-component/get-data-attributes\";\nimport { InternalBaseComponentProps } from \"../internal/base-component/use-base-component\";\nimport { useMergeRefs } from \"../internal/utils/use-merge-refs\";\n\nimport { AvatarProps } from \"./interfaces.js\";\nimport LoadingDots from \"./loading-dots\";\nimport styles from \"./styles.css.js\";\n\nexport interface InternalAvatarProps extends AvatarProps, InternalBaseComponentProps {}\n\nconst AvatarContent = ({ color, loading, initials, iconName, iconSvg, iconUrl, ariaLabel }: AvatarProps) => {\n if (loading) {\n return <LoadingDots color={color} />;\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>{letters}</span>;\n }\n\n return <Icon name={iconName} svg={iconSvg} url={iconUrl} alt={ariaLabel} />;\n};\n\nexport default function InternalAvatar({\n color,\n tooltipText,\n initials,\n loading = false,\n ariaLabel,\n iconName,\n iconSvg,\n iconUrl,\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\n const tooltipAttributes = {\n onFocus: () => {\n setShowTooltip(true);\n },\n onBlur: () => {\n setShowTooltip(false);\n },\n onMouseEnter: () => {\n setShowTooltip(true);\n },\n onMouseLeave: () => {\n setShowTooltip(false);\n },\n onTouchStart: () => {\n setShowTooltip(true);\n },\n onTouchEnd: () => {\n setShowTooltip(false);\n },\n };\n\n return (\n <div\n {...getDataAttributes(rest)}\n ref={mergedRef}\n tabIndex={0}\n className={clsx(styles.root, styles[`avatar-color-${color}`], {\n [styles.initials]: initials,\n })}\n role=\"img\"\n aria-label={ariaLabel}\n {...tooltipAttributes}\n >\n {showTooltip && tooltipText && (\n <Tooltip\n value={tooltipText}\n trackRef={handleRef}\n // This is added to ensure tooltip is closed when clicked for consistency with other tooltip usages\n contentAttributes={{ onPointerDown: () => setShowTooltip(false) }}\n />\n )}\n\n <div className={styles.content}>\n <AvatarContent\n color={color}\n ariaLabel={ariaLabel}\n initials={initials}\n loading={loading}\n iconName={iconName}\n iconSvg={iconSvg}\n iconUrl={iconUrl}\n />\n </div>\n </div>\n );\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
import clsx from "clsx";
|
|
5
|
+
import styles from "./styles.css.js";
|
|
6
|
+
export default function LoadingDots({ color }) {
|
|
7
|
+
return (
|
|
8
|
+
// "gen-ai" class is added so that the gradient background animates.
|
|
9
|
+
_jsx("div", { className: clsx(styles.root, { [styles["gen-ai"]]: color === "gen-ai" }), children: _jsxs("div", { className: styles.typing, children: [_jsx("div", { className: styles.dot }), _jsx("div", { className: styles.dot }), _jsx("div", { className: styles.dot })] }) }));
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/avatar/loading-dots/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAMrC,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAAE,KAAK,EAAoB;IAC7D,OAAO;IACL,oEAAoE;IACpE,cAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,KAAK,KAAK,QAAQ,EAAE,CAAC,YAC3E,eAAK,SAAS,EAAE,MAAM,CAAC,MAAM,aAC3B,cAAK,SAAS,EAAE,MAAM,CAAC,GAAG,GAAQ,EAClC,cAAK,SAAS,EAAE,MAAM,CAAC,GAAG,GAAQ,EAClC,cAAK,SAAS,EAAE,MAAM,CAAC,GAAG,GAAQ,IAC9B,GACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from \"clsx\";\nimport styles from \"./styles.css.js\";\n\ninterface LoadingDotsProps {\n color?: string;\n}\n\nexport default function LoadingDots({ color }: LoadingDotsProps) {\n return (\n // \"gen-ai\" class is added so that the gradient background animates.\n <div className={clsx(styles.root, { [styles[\"gen-ai\"]]: color === \"gen-ai\" })}>\n <div className={styles.typing}>\n <div className={styles.dot}></div>\n <div className={styles.dot}></div>\n <div className={styles.dot}></div>\n </div>\n </div>\n );\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
|
|
2
|
+
import './styles.scoped.css';
|
|
3
|
+
export default {
|
|
4
|
+
"gen-ai": "awsui_gen-ai_12y5i_aux1x_15",
|
|
5
|
+
"gradientMove": "awsui_gradientMove_12y5i_aux1x_1",
|
|
6
|
+
"gradientMoveReverse": "awsui_gradientMoveReverse_12y5i_aux1x_1",
|
|
7
|
+
"dot": "awsui_dot_12y5i_aux1x_77",
|
|
8
|
+
"dotsDancing": "awsui_dotsDancing_12y5i_aux1x_1",
|
|
9
|
+
"root": "awsui_root_12y5i_aux1x_158",
|
|
10
|
+
"typing": "awsui_typing_12y5i_aux1x_172"
|
|
11
|
+
};
|
|
12
|
+
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
/*
|
|
6
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
7
|
+
SPDX-License-Identifier: Apache-2.0
|
|
8
|
+
*/
|
|
9
|
+
/*
|
|
10
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
11
|
+
SPDX-License-Identifier: Apache-2.0
|
|
12
|
+
*/
|
|
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_gen-ai_12y5i_aux1x_15:not(#\9)::before {
|
|
16
|
+
content: "";
|
|
17
|
+
position: absolute;
|
|
18
|
+
inline-size: inherit;
|
|
19
|
+
block-size: inherit;
|
|
20
|
+
inset-block-start: 50%;
|
|
21
|
+
inset-inline-start: 50%;
|
|
22
|
+
transform: translate(-50%, -50%);
|
|
23
|
+
background: var(--color-background-avatar-gen-ai-i9hcw6, radial-gradient(circle farthest-corner at top left, rgb(0, 150, 250) -25%, rgba(0, 150, 250, 0) 55%), radial-gradient(circle farthest-corner at top right, rgb(216, 178, 255) -10%, rgb(115, 0, 229) 50%));
|
|
24
|
+
animation: awsui_gradientMove_12y5i_aux1x_1 var(--motion-duration-avatar-gen-ai-gradient-xetl2o, 3600ms) infinite var(--motion-easing-avatar-gen-ai-gradient-tjyrpp, cubic-bezier(0.7, 0, 0.3, 1));
|
|
25
|
+
}
|
|
26
|
+
@media (prefers-reduced-motion: reduce) {
|
|
27
|
+
.awsui_gen-ai_12y5i_aux1x_15:not(#\9)::before {
|
|
28
|
+
animation: none;
|
|
29
|
+
transition: none;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
.awsui-motion-disabled .awsui_gen-ai_12y5i_aux1x_15:not(#\9)::before, .awsui-mode-entering .awsui_gen-ai_12y5i_aux1x_15:not(#\9)::before {
|
|
33
|
+
animation: none;
|
|
34
|
+
transition: none;
|
|
35
|
+
}
|
|
36
|
+
.awsui_gen-ai_12y5i_aux1x_15:not(#\9):dir(rtl)::before {
|
|
37
|
+
animation: awsui_gradientMoveReverse_12y5i_aux1x_1 var(--motion-duration-avatar-gen-ai-gradient-xetl2o, 3600ms) infinite var(--motion-easing-avatar-gen-ai-gradient-tjyrpp, cubic-bezier(0.7, 0, 0.3, 1));
|
|
38
|
+
}
|
|
39
|
+
@media (prefers-reduced-motion: reduce) {
|
|
40
|
+
.awsui_gen-ai_12y5i_aux1x_15:not(#\9):dir(rtl)::before {
|
|
41
|
+
animation: none;
|
|
42
|
+
transition: none;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
.awsui-motion-disabled .awsui_gen-ai_12y5i_aux1x_15:not(#\9):dir(rtl)::before, .awsui-mode-entering .awsui_gen-ai_12y5i_aux1x_15:not(#\9):dir(rtl)::before {
|
|
46
|
+
animation: none;
|
|
47
|
+
transition: none;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@keyframes awsui_gradientMove_12y5i_aux1x_1 {
|
|
51
|
+
0% {
|
|
52
|
+
transform: translate(-50%, -50%) rotate(0deg);
|
|
53
|
+
}
|
|
54
|
+
50% {
|
|
55
|
+
block-size: 44px;
|
|
56
|
+
inline-size: 44px;
|
|
57
|
+
}
|
|
58
|
+
100% {
|
|
59
|
+
transform: translate(-50%, -50%) rotate(360deg);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
@keyframes awsui_gradientMoveReverse_12y5i_aux1x_1 {
|
|
63
|
+
0% {
|
|
64
|
+
transform: translate(-50%, -50%) rotate(360deg);
|
|
65
|
+
inset-inline-start: -50%;
|
|
66
|
+
}
|
|
67
|
+
50% {
|
|
68
|
+
block-size: 44px;
|
|
69
|
+
inline-size: 44px;
|
|
70
|
+
inset-inline-start: -100%;
|
|
71
|
+
}
|
|
72
|
+
100% {
|
|
73
|
+
transform: translate(-50%, -50%) rotate(0deg);
|
|
74
|
+
inset-inline-start: -50%;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
.awsui_dot_12y5i_aux1x_77:not(#\9) {
|
|
78
|
+
animation: awsui_dotsDancing_12y5i_aux1x_1 var(--motion-duration-avatar-loading-dots-pe8a3q, 1200ms) infinite ease-in-out;
|
|
79
|
+
}
|
|
80
|
+
@media (prefers-reduced-motion: reduce) {
|
|
81
|
+
.awsui_dot_12y5i_aux1x_77:not(#\9) {
|
|
82
|
+
animation: none;
|
|
83
|
+
transition: none;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
.awsui-motion-disabled .awsui_dot_12y5i_aux1x_77:not(#\9), .awsui-mode-entering .awsui_dot_12y5i_aux1x_77:not(#\9) {
|
|
87
|
+
animation: none;
|
|
88
|
+
transition: none;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.awsui_dot_12y5i_aux1x_77:not(#\9):nth-child(1) {
|
|
92
|
+
animation-delay: 100ms;
|
|
93
|
+
}
|
|
94
|
+
@media (prefers-reduced-motion: reduce) {
|
|
95
|
+
.awsui_dot_12y5i_aux1x_77:not(#\9):nth-child(1) {
|
|
96
|
+
animation: none;
|
|
97
|
+
transition: none;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
.awsui-motion-disabled .awsui_dot_12y5i_aux1x_77:not(#\9):nth-child(1), .awsui-mode-entering .awsui_dot_12y5i_aux1x_77:not(#\9):nth-child(1) {
|
|
101
|
+
animation: none;
|
|
102
|
+
transition: none;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.awsui_dot_12y5i_aux1x_77:not(#\9):nth-child(2) {
|
|
106
|
+
animation-delay: 200ms;
|
|
107
|
+
}
|
|
108
|
+
@media (prefers-reduced-motion: reduce) {
|
|
109
|
+
.awsui_dot_12y5i_aux1x_77:not(#\9):nth-child(2) {
|
|
110
|
+
animation: none;
|
|
111
|
+
transition: none;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
.awsui-motion-disabled .awsui_dot_12y5i_aux1x_77:not(#\9):nth-child(2), .awsui-mode-entering .awsui_dot_12y5i_aux1x_77:not(#\9):nth-child(2) {
|
|
115
|
+
animation: none;
|
|
116
|
+
transition: none;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.awsui_dot_12y5i_aux1x_77:not(#\9):nth-child(3) {
|
|
120
|
+
animation-delay: 300ms;
|
|
121
|
+
}
|
|
122
|
+
@media (prefers-reduced-motion: reduce) {
|
|
123
|
+
.awsui_dot_12y5i_aux1x_77:not(#\9):nth-child(3) {
|
|
124
|
+
animation: none;
|
|
125
|
+
transition: none;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
.awsui-motion-disabled .awsui_dot_12y5i_aux1x_77:not(#\9):nth-child(3), .awsui-mode-entering .awsui_dot_12y5i_aux1x_77:not(#\9):nth-child(3) {
|
|
129
|
+
animation: none;
|
|
130
|
+
transition: none;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.awsui_dot_12y5i_aux1x_77:not(#\9):last-child {
|
|
134
|
+
margin-inline-end: 0;
|
|
135
|
+
}
|
|
136
|
+
@media (prefers-reduced-motion: reduce) {
|
|
137
|
+
.awsui_dot_12y5i_aux1x_77:not(#\9):last-child {
|
|
138
|
+
animation: none;
|
|
139
|
+
transition: none;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
.awsui-motion-disabled .awsui_dot_12y5i_aux1x_77:not(#\9):last-child, .awsui-mode-entering .awsui_dot_12y5i_aux1x_77:not(#\9):last-child {
|
|
143
|
+
animation: none;
|
|
144
|
+
transition: none;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
@keyframes awsui_dotsDancing_12y5i_aux1x_1 {
|
|
148
|
+
0% {
|
|
149
|
+
transform: translateY(0px);
|
|
150
|
+
}
|
|
151
|
+
28% {
|
|
152
|
+
transform: translateY(-4px);
|
|
153
|
+
}
|
|
154
|
+
44% {
|
|
155
|
+
transform: translateY(0px);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
.awsui_root_12y5i_aux1x_158:not(#\9) {
|
|
159
|
+
inline-size: inherit;
|
|
160
|
+
block-size: inherit;
|
|
161
|
+
border-start-start-radius: 50%;
|
|
162
|
+
border-start-end-radius: 50%;
|
|
163
|
+
border-end-start-radius: 50%;
|
|
164
|
+
border-end-end-radius: 50%;
|
|
165
|
+
display: flex;
|
|
166
|
+
justify-content: center;
|
|
167
|
+
align-items: center;
|
|
168
|
+
position: relative;
|
|
169
|
+
overflow: hidden;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.awsui_typing_12y5i_aux1x_172:not(#\9) {
|
|
173
|
+
align-items: center;
|
|
174
|
+
justify-content: space-between;
|
|
175
|
+
display: flex;
|
|
176
|
+
inline-size: 18px;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.awsui_dot_12y5i_aux1x_77:not(#\9) {
|
|
180
|
+
background-color: var(--color-text-avatar-jddpvm, #ffffff);
|
|
181
|
+
border-start-start-radius: 50%;
|
|
182
|
+
border-start-end-radius: 50%;
|
|
183
|
+
border-end-start-radius: 50%;
|
|
184
|
+
border-end-end-radius: 50%;
|
|
185
|
+
block-size: 4px;
|
|
186
|
+
inline-size: 4px;
|
|
187
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
|
|
2
|
+
// es-module interop with Babel and Typescript
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
module.exports.default = {
|
|
5
|
+
"gen-ai": "awsui_gen-ai_12y5i_aux1x_15",
|
|
6
|
+
"gradientMove": "awsui_gradientMove_12y5i_aux1x_1",
|
|
7
|
+
"gradientMoveReverse": "awsui_gradientMoveReverse_12y5i_aux1x_1",
|
|
8
|
+
"dot": "awsui_dot_12y5i_aux1x_77",
|
|
9
|
+
"dotsDancing": "awsui_dotsDancing_12y5i_aux1x_1",
|
|
10
|
+
"root": "awsui_root_12y5i_aux1x_158",
|
|
11
|
+
"typing": "awsui_typing_12y5i_aux1x_172"
|
|
12
|
+
};
|
|
13
|
+
|