@cloudscape-design/components 3.0.1111 → 3.0.1113

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 (208) hide show
  1. package/app-layout/visual-refresh-toolbar/drawer/global-ai-drawer.d.ts +1 -1
  2. package/app-layout/visual-refresh-toolbar/drawer/global-ai-drawer.d.ts.map +1 -1
  3. package/app-layout/visual-refresh-toolbar/drawer/global-ai-drawer.js.map +1 -1
  4. package/app-layout/visual-refresh-toolbar/state/use-ai-drawer.d.ts +34 -0
  5. package/app-layout/visual-refresh-toolbar/state/use-ai-drawer.d.ts.map +1 -0
  6. package/app-layout/visual-refresh-toolbar/state/use-ai-drawer.js +87 -0
  7. package/app-layout/visual-refresh-toolbar/state/use-ai-drawer.js.map +1 -0
  8. package/app-layout/visual-refresh-toolbar/state/use-app-layout.d.ts.map +1 -1
  9. package/app-layout/visual-refresh-toolbar/state/use-app-layout.js +4 -3
  10. package/app-layout/visual-refresh-toolbar/state/use-app-layout.js.map +1 -1
  11. package/app-layout/visual-refresh-toolbar/state/use-widget-messages.d.ts +2 -0
  12. package/app-layout/visual-refresh-toolbar/state/use-widget-messages.d.ts.map +1 -0
  13. package/app-layout/visual-refresh-toolbar/state/use-widget-messages.js +18 -0
  14. package/app-layout/visual-refresh-toolbar/state/use-widget-messages.js.map +1 -0
  15. package/box/interfaces.d.ts +3 -1
  16. package/box/interfaces.d.ts.map +1 -1
  17. package/box/interfaces.js.map +1 -1
  18. package/box/internal.js +3 -0
  19. package/box/internal.js.map +1 -1
  20. package/box/styles.css.js +192 -191
  21. package/box/styles.scoped.css +250 -236
  22. package/box/styles.selectors.js +192 -191
  23. package/cards/analytics-metadata/interfaces.d.ts +31 -0
  24. package/cards/analytics-metadata/interfaces.d.ts.map +1 -0
  25. package/cards/analytics-metadata/interfaces.js +4 -0
  26. package/cards/analytics-metadata/interfaces.js.map +1 -0
  27. package/cards/analytics-metadata/styles.css.js +8 -0
  28. package/cards/analytics-metadata/styles.scoped.css +15 -0
  29. package/cards/analytics-metadata/styles.selectors.js +9 -0
  30. package/cards/index.d.ts.map +1 -1
  31. package/cards/index.js +59 -21
  32. package/cards/index.js.map +1 -1
  33. package/file-token-group/file-token.js +1 -1
  34. package/file-token-group/file-token.js.map +1 -1
  35. package/index.d.ts +1 -0
  36. package/index.d.ts.map +1 -1
  37. package/index.js +1 -0
  38. package/index.js.map +1 -1
  39. package/internal/base-component/styles.scoped.css +9 -1
  40. package/internal/components/drag-handle-wrapper/direction-button.js +1 -1
  41. package/internal/components/drag-handle-wrapper/direction-button.js.map +1 -1
  42. package/internal/components/drag-handle-wrapper/index.d.ts +1 -0
  43. package/internal/components/drag-handle-wrapper/index.d.ts.map +1 -1
  44. package/internal/components/drag-handle-wrapper/index.js +26 -32
  45. package/internal/components/drag-handle-wrapper/index.js.map +1 -1
  46. package/internal/components/drag-handle-wrapper/interfaces.d.ts +1 -0
  47. package/internal/components/drag-handle-wrapper/interfaces.d.ts.map +1 -1
  48. package/internal/components/drag-handle-wrapper/interfaces.js.map +1 -1
  49. package/internal/components/drag-handle-wrapper/styles.css.js +20 -21
  50. package/internal/components/drag-handle-wrapper/styles.scoped.css +50 -39
  51. package/internal/components/drag-handle-wrapper/styles.selectors.js +20 -21
  52. package/internal/components/option/highlight-match.d.ts +4 -2
  53. package/internal/components/option/highlight-match.d.ts.map +1 -1
  54. package/internal/components/option/highlight-match.js +6 -6
  55. package/internal/components/option/highlight-match.js.map +1 -1
  56. package/internal/components/option/index.d.ts +4 -0
  57. package/internal/components/option/index.d.ts.map +1 -1
  58. package/internal/components/option/index.js +8 -6
  59. package/internal/components/option/index.js.map +1 -1
  60. package/internal/components/option/interfaces.d.ts +5 -0
  61. package/internal/components/option/interfaces.d.ts.map +1 -1
  62. package/internal/components/option/interfaces.js.map +1 -1
  63. package/internal/components/option/option-parts.d.ts +7 -1
  64. package/internal/components/option/option-parts.d.ts.map +1 -1
  65. package/internal/components/option/option-parts.js +7 -5
  66. package/internal/components/option/option-parts.js.map +1 -1
  67. package/internal/environment.js +2 -2
  68. package/internal/environment.json +2 -2
  69. package/internal/generated/styles/tokens.d.ts +1 -0
  70. package/internal/generated/styles/tokens.js +1 -0
  71. package/internal/generated/theming/index.cjs +31 -0
  72. package/internal/generated/theming/index.js +31 -0
  73. package/internal/manifest.json +1 -1
  74. package/internal/plugins/widget/core.d.ts +16 -0
  75. package/internal/plugins/widget/core.d.ts.map +1 -0
  76. package/internal/plugins/widget/{internal.js → core.js} +14 -24
  77. package/internal/plugins/widget/core.js.map +1 -0
  78. package/internal/plugins/widget/index.d.ts +11 -0
  79. package/internal/plugins/widget/index.d.ts.map +1 -0
  80. package/internal/plugins/widget/index.js +22 -0
  81. package/internal/plugins/widget/index.js.map +1 -0
  82. package/internal/plugins/widget/interfaces.d.ts +2 -1
  83. package/internal/plugins/widget/interfaces.d.ts.map +1 -1
  84. package/internal/plugins/widget/interfaces.js.map +1 -1
  85. package/internal/plugins/widget.d.ts +2 -1
  86. package/internal/plugins/widget.d.ts.map +1 -1
  87. package/internal/plugins/widget.js +2 -1
  88. package/internal/plugins/widget.js.map +1 -1
  89. package/package.json +2 -1
  90. package/select/parts/styles.css.js +19 -22
  91. package/select/parts/styles.scoped.css +21 -49
  92. package/select/parts/styles.selectors.js +19 -22
  93. package/select/parts/trigger.d.ts.map +1 -1
  94. package/select/parts/trigger.js +2 -1
  95. package/select/parts/trigger.js.map +1 -1
  96. package/table/header-cell/index.d.ts +2 -0
  97. package/table/header-cell/index.d.ts.map +1 -1
  98. package/table/header-cell/index.js +5 -2
  99. package/table/header-cell/index.js.map +1 -1
  100. package/table/interfaces.d.ts +2 -0
  101. package/table/interfaces.d.ts.map +1 -1
  102. package/table/interfaces.js.map +1 -1
  103. package/table/internal.d.ts.map +1 -1
  104. package/table/internal.js +1 -0
  105. package/table/internal.js.map +1 -1
  106. package/table/resizer/index.d.ts +3 -1
  107. package/table/resizer/index.d.ts.map +1 -1
  108. package/table/resizer/index.js +211 -78
  109. package/table/resizer/index.js.map +1 -1
  110. package/table/resizer/resizer-lookup.d.ts +2 -1
  111. package/table/resizer/resizer-lookup.d.ts.map +1 -1
  112. package/table/resizer/resizer-lookup.js +3 -2
  113. package/table/resizer/resizer-lookup.js.map +1 -1
  114. package/table/resizer/styles.css.js +12 -12
  115. package/table/resizer/styles.scoped.css +37 -26
  116. package/table/resizer/styles.selectors.js +12 -12
  117. package/table/thead.d.ts +1 -0
  118. package/table/thead.d.ts.map +1 -1
  119. package/table/thead.js +2 -2
  120. package/table/thead.js.map +1 -1
  121. package/test-utils/dom/file-token-group/index.js +1 -1
  122. package/test-utils/dom/file-token-group/index.js.map +1 -1
  123. package/test-utils/dom/index.d.ts +20 -0
  124. package/test-utils/dom/index.js +15 -1
  125. package/test-utils/dom/index.js.map +1 -1
  126. package/test-utils/dom/internal/drag-handle.js +5 -5
  127. package/test-utils/dom/internal/drag-handle.js.map +1 -1
  128. package/test-utils/dom/internal/option.d.ts +1 -0
  129. package/test-utils/dom/internal/option.js +13 -1
  130. package/test-utils/dom/internal/option.js.map +1 -1
  131. package/test-utils/dom/multiselect/index.d.ts +3 -3
  132. package/test-utils/dom/token/index.d.ts +26 -0
  133. package/test-utils/dom/token/index.js +45 -0
  134. package/test-utils/dom/token/index.js.map +1 -0
  135. package/test-utils/dom/token-group/index.d.ts +3 -3
  136. package/test-utils/dom/token-group/index.js +6 -4
  137. package/test-utils/dom/token-group/index.js.map +1 -1
  138. package/test-utils/dom/token-group/token.d.ts +1 -2
  139. package/test-utils/dom/token-group/token.js +8 -5
  140. package/test-utils/dom/token-group/token.js.map +1 -1
  141. package/test-utils/selectors/file-token-group/index.js +1 -1
  142. package/test-utils/selectors/file-token-group/index.js.map +1 -1
  143. package/test-utils/selectors/index.d.ts +18 -0
  144. package/test-utils/selectors/index.js +15 -1
  145. package/test-utils/selectors/index.js.map +1 -1
  146. package/test-utils/selectors/internal/drag-handle.js +5 -5
  147. package/test-utils/selectors/internal/drag-handle.js.map +1 -1
  148. package/test-utils/selectors/multiselect/index.d.ts +3 -3
  149. package/test-utils/selectors/token/index.d.ts +26 -0
  150. package/test-utils/selectors/token/index.js +45 -0
  151. package/test-utils/selectors/token/index.js.map +1 -0
  152. package/test-utils/selectors/token-group/index.d.ts +3 -3
  153. package/test-utils/selectors/token-group/index.js +6 -4
  154. package/test-utils/selectors/token-group/index.js.map +1 -1
  155. package/test-utils/selectors/token-group/token.d.ts +1 -2
  156. package/test-utils/selectors/token-group/token.js +8 -5
  157. package/test-utils/selectors/token-group/token.js.map +1 -1
  158. package/token/analytics-metadata/interfaces.d.ts +12 -0
  159. package/token/analytics-metadata/interfaces.d.ts.map +1 -0
  160. package/token/analytics-metadata/interfaces.js +2 -0
  161. package/token/analytics-metadata/interfaces.js.map +1 -0
  162. package/token/analytics-metadata/styles.css.js +6 -0
  163. package/token/analytics-metadata/styles.scoped.css +7 -0
  164. package/token/analytics-metadata/styles.selectors.js +7 -0
  165. package/{token-group → token}/dismiss-button.d.ts +3 -1
  166. package/token/dismiss-button.d.ts.map +1 -0
  167. package/{token-group → token}/dismiss-button.js +6 -3
  168. package/token/dismiss-button.js.map +1 -0
  169. package/token/index.d.ts +4 -0
  170. package/token/index.d.ts.map +1 -0
  171. package/token/index.js +19 -0
  172. package/token/index.js.map +1 -0
  173. package/token/interfaces.d.ts +60 -0
  174. package/token/interfaces.d.ts.map +1 -0
  175. package/token/interfaces.js +2 -0
  176. package/token/interfaces.js.map +1 -0
  177. package/token/internal.d.ts +26 -0
  178. package/token/internal.d.ts.map +1 -0
  179. package/token/internal.js +77 -0
  180. package/token/internal.js.map +1 -0
  181. package/token/styles.css.js +19 -0
  182. package/token/styles.scoped.css +357 -0
  183. package/token/styles.selectors.js +20 -0
  184. package/token/test-classes/styles.css.js +7 -0
  185. package/token/test-classes/styles.scoped.css +8 -0
  186. package/token/test-classes/styles.selectors.js +8 -0
  187. package/token-group/analytics-metadata/interfaces.d.ts +0 -8
  188. package/token-group/analytics-metadata/interfaces.d.ts.map +1 -1
  189. package/token-group/analytics-metadata/interfaces.js.map +1 -1
  190. package/token-group/internal.d.ts.map +1 -1
  191. package/token-group/internal.js +5 -6
  192. package/token-group/internal.js.map +1 -1
  193. package/token-group/styles.css.js +5 -8
  194. package/token-group/styles.scoped.css +7 -115
  195. package/token-group/styles.selectors.js +5 -8
  196. package/app-layout/utils/use-ai-drawer.d.ts +0 -34
  197. package/app-layout/utils/use-ai-drawer.d.ts.map +0 -1
  198. package/app-layout/utils/use-ai-drawer.js +0 -111
  199. package/app-layout/utils/use-ai-drawer.js.map +0 -1
  200. package/internal/plugins/widget/internal.d.ts +0 -24
  201. package/internal/plugins/widget/internal.d.ts.map +0 -1
  202. package/internal/plugins/widget/internal.js.map +0 -1
  203. package/token-group/dismiss-button.d.ts.map +0 -1
  204. package/token-group/dismiss-button.js.map +0 -1
  205. package/token-group/token.d.ts +0 -20
  206. package/token-group/token.d.ts.map +0 -1
  207. package/token-group/token.js +0 -17
  208. package/token-group/token.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import { ElementWrapper } from "@cloudscape-design/test-utils-core/selectors";
2
2
  import InputWrapper from '../input';
3
3
  import DropdownHostComponentWrapper from '../internal/dropdown-host';
4
- import TokenWrapper from '../token-group/token';
4
+ import { TokenGroupItemWrapper } from '../token-group/token';
5
5
  export default class MultiselectWrapper extends DropdownHostComponentWrapper {
6
6
  static rootSelector: string;
7
7
  /**
@@ -33,11 +33,11 @@ export default class MultiselectWrapper extends DropdownHostComponentWrapper {
33
33
  *
34
34
  * @param tokenIndex 1-based index of the token to return
35
35
  */
36
- findToken(tokenIndex: number): TokenWrapper;
36
+ findToken(tokenIndex: number): TokenGroupItemWrapper;
37
37
  /**
38
38
  * Returns a token toggle button.
39
39
  */
40
40
  findTokenToggle(): ElementWrapper;
41
- findTokens(): import("@cloudscape-design/test-utils-core/selectors").MultiElementWrapper<TokenWrapper>;
41
+ findTokens(): import("@cloudscape-design/test-utils-core/selectors").MultiElementWrapper<TokenGroupItemWrapper>;
42
42
  findTrigger(): ElementWrapper;
43
43
  }
@@ -0,0 +1,26 @@
1
+ import { ComponentWrapper, ElementWrapper } from "@cloudscape-design/test-utils-core/selectors";
2
+ import OptionWrapper from '../internal/option';
3
+ export default class TokenWrapper extends ComponentWrapper {
4
+ static rootSelector: string;
5
+ protected findOption(): OptionWrapper;
6
+ /**
7
+ * Returns the token label.
8
+ */
9
+ findLabel(): ElementWrapper;
10
+ /**
11
+ * Returns the token label tag.
12
+ */
13
+ findLabelTag(): ElementWrapper;
14
+ /**
15
+ * Returns the token description.
16
+ */
17
+ findDescription(): ElementWrapper;
18
+ /**
19
+ * Returns the token tags.
20
+ */
21
+ findTags(): import("@cloudscape-design/test-utils-core/selectors").MultiElementWrapper<ElementWrapper>;
22
+ /**
23
+ * Returns the token dismiss button.
24
+ */
25
+ findDismiss(): ElementWrapper;
26
+ }
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+ // SPDX-License-Identifier: Apache-2.0
5
+ const selectors_1 = require("@cloudscape-design/test-utils-core/selectors");
6
+ const option_1 = require("../internal/option");
7
+ const styles_selectors_js_1 = require("../../../token/test-classes/styles.selectors.js");
8
+ class TokenWrapper extends selectors_1.ComponentWrapper {
9
+ findOption() {
10
+ return this.findComponent(`.${option_1.default.rootSelector}`, option_1.default);
11
+ }
12
+ /**
13
+ * Returns the token label.
14
+ */
15
+ findLabel() {
16
+ return this.findOption().findLabel();
17
+ }
18
+ /**
19
+ * Returns the token label tag.
20
+ */
21
+ findLabelTag() {
22
+ return this.findOption().findLabelTag();
23
+ }
24
+ /**
25
+ * Returns the token description.
26
+ */
27
+ findDescription() {
28
+ return this.findOption().findDescription();
29
+ }
30
+ /**
31
+ * Returns the token tags.
32
+ */
33
+ findTags() {
34
+ return this.findOption().findTags();
35
+ }
36
+ /**
37
+ * Returns the token dismiss button.
38
+ */
39
+ findDismiss() {
40
+ return this.findByClassName(styles_selectors_js_1.default['dismiss-button']);
41
+ }
42
+ }
43
+ exports.default = TokenWrapper;
44
+ TokenWrapper.rootSelector = styles_selectors_js_1.default.root;
45
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/selectors/token/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,4EAAgG;AAChG,+CAA+C;AAC/C,yFAAwE;AACxE,MAAqB,YAAa,SAAQ,4BAAgB;IAE9C,UAAU;QAClB,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,gBAAa,CAAC,YAAY,EAAE,EAAE,gBAAa,CAAE,CAAC;IAC9E,CAAC;IAED;;OAEG;IACH,SAAS;QACP,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,SAAS,EAAE,CAAC;IACvC,CAAC;IAED;;OAEG;IACH,YAAY;QACV,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,YAAY,EAAE,CAAC;IAC1C,CAAC;IAED;;OAEG;IACH,eAAe;QACb,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,eAAe,EAAE,CAAC;IAC7C,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,QAAQ,EAAE,CAAC;IACtC,CAAC;IAED;;OAEG;IACH,WAAW;QACT,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAS,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAC3D,CAAC;;AAvCH,+BAwCC;AAvCQ,yBAAY,GAAW,6BAAS,CAAC,IAAI,CAAC"}
@@ -1,14 +1,14 @@
1
1
  import { ComponentWrapper, ElementWrapper } from "@cloudscape-design/test-utils-core/selectors";
2
- import TokenWrapper from './token';
2
+ import { TokenGroupItemWrapper } from './token';
3
3
  export default class TokenGroupWrapper extends ComponentWrapper {
4
4
  static rootSelector: string;
5
- findTokens(): import("@cloudscape-design/test-utils-core/selectors").MultiElementWrapper<TokenWrapper>;
5
+ findTokens(): import("@cloudscape-design/test-utils-core/selectors").MultiElementWrapper<TokenGroupItemWrapper>;
6
6
  /**
7
7
  * Returns a token from the group for a given index.
8
8
  *
9
9
  * @param tokenIndex 1-based index of the token to return.
10
10
  */
11
- findToken(tokenIndex: number): TokenWrapper;
11
+ findToken(tokenIndex: number): TokenGroupItemWrapper;
12
12
  /**
13
13
  * Returns the token toggle button.
14
14
  */
@@ -5,10 +5,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
5
5
  const selectors_1 = require("@cloudscape-design/test-utils-core/selectors");
6
6
  const token_1 = require("./token");
7
7
  const styles_selectors_js_1 = require("../../../internal/components/token-list/styles.selectors.js");
8
- const styles_selectors_js_2 = require("../../../token-group/styles.selectors.js");
8
+ const styles_selectors_js_2 = require("../../../token/test-classes/styles.selectors.js");
9
+ const styles_selectors_js_3 = require("../../../token-group/styles.selectors.js");
9
10
  class TokenGroupWrapper extends selectors_1.ComponentWrapper {
10
11
  findTokens() {
11
- return this.findAllByClassName(token_1.default.rootSelector).map(tokenElement => new token_1.default(tokenElement.getElement()));
12
+ const tokens = this.findAll(`:is(.${styles_selectors_js_3.default.token}, .${styles_selectors_js_2.default.root})`);
13
+ return tokens.map(tokenElement => new token_1.TokenGroupItemWrapper(tokenElement.getElement()));
12
14
  }
13
15
  /**
14
16
  * Returns a token from the group for a given index.
@@ -16,7 +18,7 @@ class TokenGroupWrapper extends selectors_1.ComponentWrapper {
16
18
  * @param tokenIndex 1-based index of the token to return.
17
19
  */
18
20
  findToken(tokenIndex) {
19
- return this.findComponent(`.${styles_selectors_js_1.default['list-item']}:nth-child(${tokenIndex}) > .${token_1.default.rootSelector}`, token_1.default);
21
+ return this.findComponent(`.${styles_selectors_js_1.default['list-item']}:nth-child(${tokenIndex}) > :is(.${styles_selectors_js_3.default.token}, .${styles_selectors_js_2.default.root})`, token_1.TokenGroupItemWrapper);
20
22
  }
21
23
  /**
22
24
  * Returns the token toggle button.
@@ -26,5 +28,5 @@ class TokenGroupWrapper extends selectors_1.ComponentWrapper {
26
28
  }
27
29
  }
28
30
  exports.default = TokenGroupWrapper;
29
- TokenGroupWrapper.rootSelector = styles_selectors_js_2.default.root;
31
+ TokenGroupWrapper.rootSelector = styles_selectors_js_3.default.root;
30
32
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/selectors/token-group/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,4EAAgG;AAChG,mCAAmC;AACnC,qGAA6F;AAC7F,kFAAiE;AACjE,MAAqB,iBAAkB,SAAQ,4BAAgB;IAE7D,UAAU;QACR,OAAO,IAAI,CAAC,kBAAkB,CAAC,eAAY,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC,IAAI,eAAY,CAAC,YAAY,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAC7H,CAAC;IAED;;;;OAIG;IACH,SAAS,CAAC,UAAkB;QAC1B,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,6BAAkB,CAAC,WAAW,CAAC,cAAc,UAAU,QAAQ,eAAY,CAAC,YAAY,EAAE,EAAE,eAAY,CAAC,CAAC;IAC1I,CAAC;IAED;;OAEG;IACH,eAAe;QACb,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAkB,CAAC,MAAM,CAAC,CAAC;IACzD,CAAC;;AApBH,oCAqBC;AApBQ,8BAAY,GAAW,6BAAS,CAAC,IAAI,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/selectors/token-group/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,4EAAgG;AAChG,mCAAgD;AAChD,qGAA6F;AAC7F,yFAAgF;AAChF,kFAAiE;AACjE,MAAqB,iBAAkB,SAAQ,4BAAgB;IAE7D,UAAU;QACR,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,6BAAS,CAAC,KAAK,MAAM,6BAAiB,CAAC,IAAI,GAAG,CAAC,CAAC;QACpF,OAAO,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC,IAAI,6BAAqB,CAAC,YAAY,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAC1F,CAAC;IAED;;;;OAIG;IACH,SAAS,CAAC,UAAkB;QAC1B,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,6BAAkB,CAAC,WAAW,CAAC,cAAc,UAAU,YAAY,6BAAS,CAAC,KAAK,MAAM,6BAAiB,CAAC,IAAI,GAAG,EAAE,6BAAqB,CAAC,CAAC;IAC1K,CAAC;IAED;;OAEG;IACH,eAAe;QACb,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAkB,CAAC,MAAM,CAAC,CAAC;IACzD,CAAC;;AArBH,oCAsBC;AArBQ,8BAAY,GAAW,6BAAS,CAAC,IAAI,CAAC"}
@@ -1,7 +1,6 @@
1
1
  import { ComponentWrapper, ElementWrapper } from "@cloudscape-design/test-utils-core/selectors";
2
2
  import OptionWrapper from '../internal/option';
3
- export default class TokenWrapper extends ComponentWrapper {
4
- static rootSelector: string;
3
+ export declare class TokenGroupItemWrapper extends ComponentWrapper {
5
4
  findOption(): OptionWrapper;
6
5
  findLabel(): ElementWrapper;
7
6
  findDismiss(): ElementWrapper;
@@ -1,11 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TokenGroupItemWrapper = void 0;
3
4
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
5
  // SPDX-License-Identifier: Apache-2.0
5
6
  const selectors_1 = require("@cloudscape-design/test-utils-core/selectors");
6
7
  const option_1 = require("../internal/option");
7
- const styles_selectors_js_1 = require("../../../token-group/styles.selectors.js");
8
- class TokenWrapper extends selectors_1.ComponentWrapper {
8
+ const styles_selectors_js_1 = require("../../../token/test-classes/styles.selectors.js");
9
+ const styles_selectors_js_2 = require("../../../token-group/styles.selectors.js");
10
+ class TokenGroupItemWrapper extends selectors_1.ComponentWrapper {
9
11
  findOption() {
10
12
  return this.findComponent(`.${option_1.default.rootSelector}`, option_1.default);
11
13
  }
@@ -13,9 +15,10 @@ class TokenWrapper extends selectors_1.ComponentWrapper {
13
15
  return this.findOption().findLabel();
14
16
  }
15
17
  findDismiss() {
16
- return this.findByClassName(styles_selectors_js_1.default['dismiss-button']);
18
+ const selector = styles_selectors_js_1.default['dismiss-button'];
19
+ const legacySelector = styles_selectors_js_2.default['dismiss-button'];
20
+ return this.find(`:is(.${legacySelector}, .${selector})`);
17
21
  }
18
22
  }
19
- exports.default = TokenWrapper;
20
- TokenWrapper.rootSelector = styles_selectors_js_1.default.token;
23
+ exports.TokenGroupItemWrapper = TokenGroupItemWrapper;
21
24
  //# sourceMappingURL=token.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"token.js","sourceRoot":"","sources":["../../../../../src/test-utils/selectors/token-group/token.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,4EAAgG;AAChG,+CAA+C;AAC/C,kFAAiE;AACjE,MAAqB,YAAa,SAAQ,4BAAgB;IAExD,UAAU;QACR,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,gBAAa,CAAC,YAAY,EAAE,EAAE,gBAAa,CAAE,CAAC;IAC9E,CAAC;IACD,SAAS;QACP,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,SAAS,EAAE,CAAC;IACvC,CAAC;IACD,WAAW;QACT,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAS,CAAC,gBAAgB,CAAC,CAAE,CAAC;IAC5D,CAAC;;AAVH,+BAWC;AAVQ,yBAAY,GAAW,6BAAS,CAAC,KAAK,CAAC"}
1
+ {"version":3,"file":"token.js","sourceRoot":"","sources":["../../../../../src/test-utils/selectors/token-group/token.ts"],"names":[],"mappings":";;;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,4EAAgG;AAChG,+CAA+C;AAC/C,yFAAwE;AACxE,kFAAuE;AACvE,MAAa,qBAAsB,SAAQ,4BAAgB;IACzD,UAAU;QACR,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,gBAAa,CAAC,YAAY,EAAE,EAAE,gBAAa,CAAE,CAAC;IAC9E,CAAC;IACD,SAAS;QACP,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,SAAS,EAAE,CAAC;IACvC,CAAC;IACD,WAAW;QACT,MAAM,QAAQ,GAAG,6BAAS,CAAC,gBAAgB,CAAC,CAAC;QAC7C,MAAM,cAAc,GAAG,6BAAe,CAAC,gBAAgB,CAAC,CAAC;QACzD,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,cAAc,MAAM,QAAQ,GAAG,CAAE,CAAC;IAC7D,CAAC;CACF;AAZD,sDAYC"}
@@ -0,0 +1,12 @@
1
+ import { LabelIdentifier } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';
2
+ export interface GeneratedAnalyticsMetadataTokenDismiss {
3
+ action: 'dismiss';
4
+ detail: {
5
+ label: LabelIdentifier;
6
+ position?: string;
7
+ };
8
+ }
9
+ export interface GeneratedAnalyticsMetadataTokenComponent {
10
+ name: 'awsui.Token';
11
+ label: string;
12
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../src/token/analytics-metadata/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,kEAAkE,CAAC;AAEnG,MAAM,WAAW,sCAAsC;IACrD,MAAM,EAAE,SAAS,CAAC;IAClB,MAAM,EAAE;QACN,KAAK,EAAE,eAAe,CAAC;QACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;CACH;AAED,MAAM,WAAW,wCAAwC;IACvD,IAAI,EAAE,aAAa,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/token/analytics-metadata/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { LabelIdentifier } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nexport interface GeneratedAnalyticsMetadataTokenDismiss {\n action: 'dismiss';\n detail: {\n label: LabelIdentifier;\n position?: string;\n };\n}\n\nexport interface GeneratedAnalyticsMetadataTokenComponent {\n name: 'awsui.Token';\n label: string;\n}\n"]}
@@ -0,0 +1,6 @@
1
+
2
+ import './styles.scoped.css';
3
+ export default {
4
+ "token": "awsui_token_v05f6_c8hk2_5"
5
+ };
6
+
@@ -0,0 +1,7 @@
1
+ /*
2
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ .awsui_token_v05f6_c8hk2_5:not(#\9) {
6
+ /* used in analytics metadata */
7
+ }
@@ -0,0 +1,7 @@
1
+
2
+ // es-module interop with Babel and Typescript
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ module.exports.default = {
5
+ "token": "awsui_token_v05f6_c8hk2_5"
6
+ };
7
+
@@ -1,9 +1,11 @@
1
1
  import React from 'react';
2
+ import { NonCancelableEventHandler } from '../internal/events';
2
3
  interface DismissButtonProps {
3
4
  disabled?: boolean;
4
5
  readOnly?: boolean;
5
- onDismiss?: () => void;
6
+ onDismiss?: NonCancelableEventHandler;
6
7
  dismissLabel?: string;
8
+ inline?: boolean;
7
9
  }
8
10
  declare const _default: React.ForwardRefExoticComponent<DismissButtonProps & React.RefAttributes<HTMLButtonElement>>;
9
11
  export default _default;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dismiss-button.d.ts","sourceRoot":"","sources":["../../../src/token/dismiss-button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA0B,MAAM,OAAO,CAAC;AAM/C,OAAO,EAA0B,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAMvF,UAAU,kBAAkB;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,yBAAyB,CAAC;IACtC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;;AAED,wBAAyC"}
@@ -1,22 +1,25 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import React, { forwardRef } from 'react';
4
+ import clsx from 'clsx';
4
5
  import { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';
5
6
  import InternalIcon from '../icon/internal';
7
+ import { fireNonCancelableEvent } from '../internal/events';
6
8
  import styles from './styles.css.js';
9
+ import testUtilStyles from './test-classes/styles.css.js';
7
10
  export default forwardRef(DismissButton);
8
- function DismissButton({ disabled, dismissLabel, onDismiss, readOnly }, ref) {
11
+ function DismissButton({ disabled, dismissLabel, onDismiss, readOnly, inline }, ref) {
9
12
  const analyticsMetadata = {
10
13
  action: 'dismiss',
11
14
  detail: {
12
15
  label: { root: 'self' },
13
16
  },
14
17
  };
15
- return (React.createElement("button", Object.assign({ ref: ref, type: "button", className: styles['dismiss-button'], "aria-disabled": disabled || readOnly ? true : undefined, onClick: () => {
18
+ return (React.createElement("button", Object.assign({ ref: ref, type: "button", className: clsx(styles['dismiss-button'], testUtilStyles['dismiss-button'], inline && styles['dismiss-button-inline']), "aria-disabled": disabled || readOnly ? true : undefined, onClick: () => {
16
19
  if (disabled || readOnly || !onDismiss) {
17
20
  return;
18
21
  }
19
- onDismiss();
22
+ fireNonCancelableEvent(onDismiss);
20
23
  }, "aria-label": dismissLabel }, (disabled || readOnly ? {} : getAnalyticsMetadataAttribute(analyticsMetadata))),
21
24
  React.createElement(InternalIcon, { name: "close" })));
22
25
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dismiss-button.js","sourceRoot":"","sources":["../../../src/token/dismiss-button.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAO,MAAM,OAAO,CAAC;AAC/C,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAA6B,MAAM,oBAAoB,CAAC;AAGvF,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAU1D,eAAe,UAAU,CAAC,aAAa,CAAC,CAAC;AAEzC,SAAS,aAAa,CACpB,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAsB,EAC3E,GAA2B;IAE3B,MAAM,iBAAiB,GAA2C;QAChE,MAAM,EAAE,SAAS;QACjB,MAAM,EAAE;YACN,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;SACxB;KACF,CAAC;IACF,OAAO,CACL,8CACE,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,gBAAgB,CAAC,EACxB,cAAc,CAAC,gBAAgB,CAAC,EAChC,MAAM,IAAI,MAAM,CAAC,uBAAuB,CAAC,CAC1C,mBACc,QAAQ,IAAI,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,EACtD,OAAO,EAAE,GAAG,EAAE;YACZ,IAAI,QAAQ,IAAI,QAAQ,IAAI,CAAC,SAAS,EAAE;gBACtC,OAAO;aACR;YAED,sBAAsB,CAAC,SAAS,CAAC,CAAC;QACpC,CAAC,gBACW,YAAY,IACpB,CAAC,QAAQ,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,6BAA6B,CAAC,iBAAiB,CAAC,CAAC;QAElF,oBAAC,YAAY,IAAC,IAAI,EAAC,OAAO,GAAG,CACtB,CACV,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { forwardRef, Ref } from 'react';\nimport clsx from 'clsx';\n\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport InternalIcon from '../icon/internal';\nimport { fireNonCancelableEvent, NonCancelableEventHandler } from '../internal/events';\nimport { GeneratedAnalyticsMetadataTokenDismiss } from './analytics-metadata/interfaces';\n\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\ninterface DismissButtonProps {\n disabled?: boolean;\n readOnly?: boolean;\n onDismiss?: NonCancelableEventHandler;\n dismissLabel?: string;\n inline?: boolean;\n}\n\nexport default forwardRef(DismissButton);\n\nfunction DismissButton(\n { disabled, dismissLabel, onDismiss, readOnly, inline }: DismissButtonProps,\n ref: Ref<HTMLButtonElement>\n) {\n const analyticsMetadata: GeneratedAnalyticsMetadataTokenDismiss = {\n action: 'dismiss',\n detail: {\n label: { root: 'self' },\n },\n };\n return (\n <button\n ref={ref}\n type=\"button\"\n className={clsx(\n styles['dismiss-button'],\n testUtilStyles['dismiss-button'],\n inline && styles['dismiss-button-inline']\n )}\n aria-disabled={disabled || readOnly ? true : undefined}\n onClick={() => {\n if (disabled || readOnly || !onDismiss) {\n return;\n }\n\n fireNonCancelableEvent(onDismiss);\n }}\n aria-label={dismissLabel}\n {...(disabled || readOnly ? {} : getAnalyticsMetadataAttribute(analyticsMetadata))}\n >\n <InternalIcon name=\"close\" />\n </button>\n );\n}\n"]}
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { TokenProps } from './interfaces';
3
+ export { TokenProps };
4
+ export default function Token(props: TokenProps): JSX.Element;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/token/index.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK1C,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,KAAK,EAAE,UAAU,eAe9C"}
package/token/index.js ADDED
@@ -0,0 +1,19 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ 'use client';
4
+ import React from 'react';
5
+ import { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';
6
+ import useBaseComponent from '../internal/hooks/use-base-component';
7
+ import { applyDisplayName } from '../internal/utils/apply-display-name';
8
+ import InternalToken from './internal';
9
+ import analyticsSelectors from './analytics-metadata/styles.css.js';
10
+ export default function Token(props) {
11
+ const baseComponentProps = useBaseComponent('Token');
12
+ const componentAnalyticsMetadata = {
13
+ name: 'awsui.Token',
14
+ label: `.${analyticsSelectors.token}`,
15
+ };
16
+ return (React.createElement(InternalToken, Object.assign({}, props, baseComponentProps, getAnalyticsMetadataAttribute({ component: componentAnalyticsMetadata }))));
17
+ }
18
+ applyDisplayName(Token, 'Token');
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/token/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAGxE,OAAO,aAAa,MAAM,YAAY,CAAC;AAEvC,OAAO,kBAAkB,MAAM,oCAAoC,CAAC;AAIpE,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,KAAiB;IAC7C,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAErD,MAAM,0BAA0B,GAA6C;QAC3E,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,IAAI,kBAAkB,CAAC,KAAK,EAAE;KACtC,CAAC;IAEF,OAAO,CACL,oBAAC,aAAa,oBACR,KAAK,EACL,kBAAkB,EAClB,6BAA6B,CAAC,EAAE,SAAS,EAAE,0BAA0B,EAAE,CAAC,EAC5E,CACH,CAAC;AACJ,CAAC;AAED,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n'use client';\nimport React from 'react';\n\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { GeneratedAnalyticsMetadataTokenComponent } from './analytics-metadata/interfaces';\nimport { TokenProps } from './interfaces';\nimport InternalToken from './internal';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\n\nexport { TokenProps };\n\nexport default function Token(props: TokenProps) {\n const baseComponentProps = useBaseComponent('Token');\n\n const componentAnalyticsMetadata: GeneratedAnalyticsMetadataTokenComponent = {\n name: 'awsui.Token',\n label: `.${analyticsSelectors.token}`,\n };\n\n return (\n <InternalToken\n {...props}\n {...baseComponentProps}\n {...getAnalyticsMetadataAttribute({ component: componentAnalyticsMetadata })}\n />\n );\n}\n\napplyDisplayName(Token, 'Token');\n"]}
@@ -0,0 +1,60 @@
1
+ import React from 'react';
2
+ import { BaseComponentProps } from '../internal/base-component';
3
+ import { NonCancelableEventHandler } from '../internal/events';
4
+ export interface TokenProps extends BaseComponentProps {
5
+ /** Slot for the label of the token as text or an element.
6
+ *
7
+ * For `variant="inline"`, only plain text is supported, for example, strings or numbers.
8
+ */
9
+ label: React.ReactNode;
10
+ /**
11
+ * Adds an `aria-label` to the token.
12
+ *
13
+ * Use this if the label is not plain text.
14
+ */
15
+ ariaLabel?: string;
16
+ /** A label tag that provides additional guidance, shown next to the label. */
17
+ labelTag?: string;
18
+ /** Further information about the token that appears below the label. */
19
+ description?: string;
20
+ /** A list of tags giving further guidance about the token. */
21
+ tags?: ReadonlyArray<string>;
22
+ /** An icon at the start of the token.
23
+ *
24
+ * When `variant="normal"`, if a description or tags are set, icon size should be `normal`.
25
+ *
26
+ * When `variant="inline"`, icon size should be `small`.
27
+ */
28
+ icon?: React.ReactNode;
29
+ /**
30
+ * Specifies the token's visual style and functionality.
31
+ *
32
+ * For `inline` only label, icon and dismiss button are displayed.
33
+ *
34
+ * Defaults to `normal` if not specified.
35
+ */
36
+ variant?: TokenProps.Variant;
37
+ /** Determines whether the token is disabled. */
38
+ disabled?: boolean;
39
+ /**
40
+ * Specifies if the control is read-only. A read-only control is still focusable.
41
+ */
42
+ readOnly?: boolean;
43
+ /** Adds an `aria-label` to the dismiss button. */
44
+ dismissLabel?: string;
45
+ /**
46
+ * Called when the user clicks on the dismiss button.
47
+ *
48
+ * Make sure that you add a listener to this event to update your application state.
49
+ */
50
+ onDismiss?: NonCancelableEventHandler;
51
+ /**
52
+ * Content to display in the tooltip when `variant="inline"`. The tooltip appears when the token label is truncated due to insufficient space.
53
+ *
54
+ * Only applies to plain text labels.
55
+ */
56
+ tooltipContent?: string;
57
+ }
58
+ export declare namespace TokenProps {
59
+ type Variant = 'normal' | 'inline';
60
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/token/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,MAAM,WAAW,UAAW,SAAQ,kBAAkB;IACpD;;;OAGG;IACH,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IAEvB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,wEAAwE;IACxE,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,8DAA8D;IAC9D,IAAI,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAE7B;;;;;OAKG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEvB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC;IAE7B,gDAAgD;IAChD,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,kDAAkD;IAClD,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,SAAS,CAAC,EAAE,yBAAyB,CAAC;IAEtC;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,yBAAiB,UAAU,CAAC;IAC1B,KAAY,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;CAC3C"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/token/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface TokenProps extends BaseComponentProps {\n /** Slot for the label of the token as text or an element.\n *\n * For `variant=\"inline\"`, only plain text is supported, for example, strings or numbers.\n */\n label: React.ReactNode;\n\n /**\n * Adds an `aria-label` to the token.\n *\n * Use this if the label is not plain text.\n */\n ariaLabel?: string;\n\n /** A label tag that provides additional guidance, shown next to the label. */\n labelTag?: string;\n\n /** Further information about the token that appears below the label. */\n description?: string;\n\n /** A list of tags giving further guidance about the token. */\n tags?: ReadonlyArray<string>;\n\n /** An icon at the start of the token.\n *\n * When `variant=\"normal\"`, if a description or tags are set, icon size should be `normal`.\n *\n * When `variant=\"inline\"`, icon size should be `small`.\n */\n icon?: React.ReactNode;\n\n /**\n * Specifies the token's visual style and functionality.\n *\n * For `inline` only label, icon and dismiss button are displayed.\n *\n * Defaults to `normal` if not specified.\n */\n variant?: TokenProps.Variant;\n\n /** Determines whether the token is disabled. */\n disabled?: boolean;\n\n /**\n * Specifies if the control is read-only. A read-only control is still focusable.\n */\n readOnly?: boolean;\n\n /** Adds an `aria-label` to the dismiss button. */\n dismissLabel?: string;\n\n /**\n * Called when the user clicks on the dismiss button.\n *\n * Make sure that you add a listener to this event to update your application state.\n */\n onDismiss?: NonCancelableEventHandler;\n\n /**\n * Content to display in the tooltip when `variant=\"inline\"`. The tooltip appears when the token label is truncated due to insufficient space.\n *\n * Only applies to plain text labels.\n */\n tooltipContent?: string;\n}\n\nexport namespace TokenProps {\n export type Variant = 'normal' | 'inline';\n}\n"]}
@@ -0,0 +1,26 @@
1
+ /// <reference types="react" />
2
+ import { InternalBaseComponentProps } from '../internal/hooks/use-base-component';
3
+ import { TokenProps } from './interfaces';
4
+ type InternalTokenProps = TokenProps & InternalBaseComponentProps & {
5
+ role?: string;
6
+ disableInnerPadding?: boolean;
7
+ };
8
+ declare function InternalToken({
9
+ label,
10
+ ariaLabel,
11
+ labelTag,
12
+ description,
13
+ variant,
14
+ disabled,
15
+ readOnly,
16
+ icon,
17
+ tags,
18
+ dismissLabel,
19
+ onDismiss,
20
+ tooltipContent,
21
+ role,
22
+ disableInnerPadding,
23
+ __internalRootRef,
24
+ ...restProps
25
+ }: InternalTokenProps): JSX.Element;
26
+ export default InternalToken;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/token/internal.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAGlF,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAM1C,KAAK,kBAAkB,GAAG,UAAU,GAClC,0BAA0B,GAAG;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B,CAAC;AAEJ,iBAAS,aAAa,CAAC,EAErB,KAAK,EACL,SAAS,EACT,QAAQ,EACR,WAAW,EACX,OAAkB,EAClB,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,SAAS,EACT,cAAc,EAGd,IAAI,EACJ,mBAAmB,EAGnB,iBAAiB,EACjB,GAAG,SAAS,EACb,EAAE,kBAAkB,eA4HpB;AAED,eAAe,aAAa,CAAC"}
@@ -0,0 +1,77 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { __rest } from "tslib";
4
+ import React, { useRef, useState } from 'react';
5
+ import clsx from 'clsx';
6
+ import { useResizeObserver, useUniqueId, warnOnce } from '@cloudscape-design/component-toolkit/internal';
7
+ import { getBaseProps } from '../internal/base-component';
8
+ import Option from '../internal/components/option';
9
+ import Tooltip from '../internal/components/tooltip';
10
+ import LiveRegion from '../live-region/internal';
11
+ import DismissButton from './dismiss-button';
12
+ import analyticsSelectors from './analytics-metadata/styles.css.js';
13
+ import styles from './styles.css.js';
14
+ import testUtilStyles from './test-classes/styles.css.js';
15
+ function InternalToken(_a) {
16
+ var {
17
+ // External
18
+ label, ariaLabel, labelTag, description, variant = 'normal', disabled, readOnly, icon, tags, dismissLabel, onDismiss, tooltipContent,
19
+ // Internal
20
+ role, disableInnerPadding,
21
+ // Base
22
+ __internalRootRef } = _a, restProps = __rest(_a, ["label", "ariaLabel", "labelTag", "description", "variant", "disabled", "readOnly", "icon", "tags", "dismissLabel", "onDismiss", "tooltipContent", "role", "disableInnerPadding", "__internalRootRef"]);
23
+ const baseProps = getBaseProps(restProps);
24
+ const labelContainerRef = useRef(null);
25
+ const labelRef = useRef(null);
26
+ const [showTooltip, setShowTooltip] = useState(false);
27
+ const [isEllipsisActive, setIsEllipsisActive] = useState(false);
28
+ const isInline = variant === 'inline';
29
+ const ariaLabelledbyId = useUniqueId();
30
+ const isLabelOverflowing = () => {
31
+ const labelContent = labelRef.current;
32
+ const labelContainer = labelContainerRef.current;
33
+ if (labelContent && labelContainer) {
34
+ return labelContent.offsetWidth > labelContainer.offsetWidth;
35
+ }
36
+ };
37
+ useResizeObserver(labelContainerRef, () => {
38
+ var _a;
39
+ if (isInline) {
40
+ setIsEllipsisActive((_a = isLabelOverflowing()) !== null && _a !== void 0 ? _a : false);
41
+ }
42
+ });
43
+ const buildOptionDefinition = () => {
44
+ const isLabelStringOrNumber = typeof label === 'string' || typeof label === 'number';
45
+ const labelObject = isLabelStringOrNumber ? { label: String(label) } : { labelContent: label };
46
+ if (isInline) {
47
+ if (!isLabelStringOrNumber) {
48
+ warnOnce('Label', `Only plain text (strings or numbers) are supported when variant="inline".`);
49
+ }
50
+ return Object.assign(Object.assign({}, labelObject), { disabled, __customIcon: icon && React.createElement("span", { className: clsx(styles.icon, styles['icon-inline']) }, icon) });
51
+ }
52
+ else {
53
+ return Object.assign(Object.assign({}, labelObject), { disabled,
54
+ labelTag,
55
+ description,
56
+ tags, __customIcon: icon && React.createElement("span", { className: styles.icon }, icon) });
57
+ }
58
+ };
59
+ return (React.createElement("div", Object.assign({}, baseProps, { ref: __internalRootRef, className: clsx(styles.root, testUtilStyles.root, !isInline ? styles['token-normal'] : styles['token-inline'], analyticsSelectors.token, baseProps.className), "aria-label": ariaLabel, "aria-labelledby": !ariaLabel ? ariaLabelledbyId : undefined, "aria-disabled": !!disabled, role: role !== null && role !== void 0 ? role : 'group', onFocus: () => {
60
+ setShowTooltip(true);
61
+ }, onBlur: () => {
62
+ setShowTooltip(false);
63
+ }, onMouseEnter: () => {
64
+ setShowTooltip(true);
65
+ }, onMouseLeave: () => {
66
+ setShowTooltip(false);
67
+ }, tabIndex: !!tooltipContent && isInline && isEllipsisActive ? 0 : undefined }),
68
+ React.createElement("div", { className: clsx(!isInline ? styles['token-box'] : styles['token-box-inline'], disabled && styles['token-box-disabled'], readOnly && styles['token-box-readonly'], !isInline && !onDismiss && styles['token-box-without-dismiss'], disableInnerPadding && styles['disable-padding']) },
69
+ React.createElement(Option, { className: clsx(isInline && styles['token-option-inline']), triggerVariant: isInline, option: buildOptionDefinition(), disableTitleTooltip: !!tooltipContent, labelContainerRef: labelContainerRef, labelRef: labelRef, labelId: ariaLabelledbyId }),
70
+ onDismiss && (React.createElement(DismissButton, { disabled: disabled, dismissLabel: dismissLabel, onDismiss: onDismiss, readOnly: readOnly, inline: isInline }))),
71
+ !!tooltipContent && isInline && isEllipsisActive && showTooltip && (React.createElement(Tooltip, { "data-testid": "token-tooltip", trackRef: labelContainerRef, value: React.createElement(LiveRegion, null,
72
+ React.createElement("span", { "data-testid": "tooltip-live-region-content" }, tooltipContent)), size: "medium", onDismiss: () => {
73
+ setShowTooltip(false);
74
+ } }))));
75
+ }
76
+ export default InternalToken;
77
+ //# sourceMappingURL=internal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/token/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\n\nimport React, { useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useResizeObserver, useUniqueId, warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { getBaseProps } from '../internal/base-component';\nimport Option from '../internal/components/option';\nimport Tooltip from '../internal/components/tooltip';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport LiveRegion from '../live-region/internal';\nimport DismissButton from './dismiss-button';\nimport { TokenProps } from './interfaces';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\ntype InternalTokenProps = TokenProps &\n InternalBaseComponentProps & {\n role?: string;\n disableInnerPadding?: boolean;\n };\n\nfunction InternalToken({\n // External\n label,\n ariaLabel,\n labelTag,\n description,\n variant = 'normal',\n disabled,\n readOnly,\n icon,\n tags,\n dismissLabel,\n onDismiss,\n tooltipContent,\n\n // Internal\n role,\n disableInnerPadding,\n\n // Base\n __internalRootRef,\n ...restProps\n}: InternalTokenProps) {\n const baseProps = getBaseProps(restProps);\n const labelContainerRef = useRef<HTMLSpanElement>(null);\n const labelRef = useRef<HTMLSpanElement>(null);\n const [showTooltip, setShowTooltip] = useState(false);\n const [isEllipsisActive, setIsEllipsisActive] = useState(false);\n const isInline = variant === 'inline';\n const ariaLabelledbyId = useUniqueId();\n\n const isLabelOverflowing = () => {\n const labelContent = labelRef.current;\n const labelContainer = labelContainerRef.current;\n\n if (labelContent && labelContainer) {\n return labelContent.offsetWidth > labelContainer.offsetWidth;\n }\n };\n\n useResizeObserver(labelContainerRef, () => {\n if (isInline) {\n setIsEllipsisActive(isLabelOverflowing() ?? false);\n }\n });\n\n const buildOptionDefinition = () => {\n const isLabelStringOrNumber = typeof label === 'string' || typeof label === 'number';\n const labelObject = isLabelStringOrNumber ? { label: String(label) } : { labelContent: label };\n\n if (isInline) {\n if (!isLabelStringOrNumber) {\n warnOnce('Label', `Only plain text (strings or numbers) are supported when variant=\"inline\".`);\n }\n\n return {\n ...labelObject,\n disabled,\n __customIcon: icon && <span className={clsx(styles.icon, styles['icon-inline'])}>{icon}</span>,\n };\n } else {\n return {\n ...labelObject,\n disabled,\n labelTag,\n description,\n tags,\n __customIcon: icon && <span className={styles.icon}>{icon}</span>,\n };\n }\n };\n\n return (\n <div\n {...baseProps}\n ref={__internalRootRef}\n className={clsx(\n styles.root,\n testUtilStyles.root,\n !isInline ? styles['token-normal'] : styles['token-inline'],\n analyticsSelectors.token,\n baseProps.className\n )}\n aria-label={ariaLabel}\n aria-labelledby={!ariaLabel ? ariaLabelledbyId : undefined}\n aria-disabled={!!disabled}\n role={role ?? 'group'}\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 tabIndex={!!tooltipContent && isInline && isEllipsisActive ? 0 : undefined}\n >\n <div\n className={clsx(\n !isInline ? styles['token-box'] : styles['token-box-inline'],\n disabled && styles['token-box-disabled'],\n readOnly && styles['token-box-readonly'],\n !isInline && !onDismiss && styles['token-box-without-dismiss'],\n disableInnerPadding && styles['disable-padding']\n )}\n >\n <Option\n className={clsx(isInline && styles['token-option-inline'])}\n triggerVariant={isInline}\n option={buildOptionDefinition()}\n disableTitleTooltip={!!tooltipContent}\n labelContainerRef={labelContainerRef}\n labelRef={labelRef}\n labelId={ariaLabelledbyId}\n />\n {onDismiss && (\n <DismissButton\n disabled={disabled}\n dismissLabel={dismissLabel}\n onDismiss={onDismiss}\n readOnly={readOnly}\n inline={isInline}\n />\n )}\n </div>\n {!!tooltipContent && isInline && isEllipsisActive && showTooltip && (\n <Tooltip\n data-testid=\"token-tooltip\"\n trackRef={labelContainerRef}\n value={\n <LiveRegion>\n <span data-testid=\"tooltip-live-region-content\">{tooltipContent}</span>\n </LiveRegion>\n }\n size=\"medium\"\n onDismiss={() => {\n setShowTooltip(false);\n }}\n />\n )}\n </div>\n );\n}\n\nexport default InternalToken;\n"]}
@@ -0,0 +1,19 @@
1
+
2
+ import './styles.scoped.css';
3
+ export default {
4
+ "root": "awsui_root_1i2wg_16pp7_161",
5
+ "dismiss-button": "awsui_dismiss-button_1i2wg_16pp7_193",
6
+ "dismiss-button-inline": "awsui_dismiss-button-inline_1i2wg_16pp7_233",
7
+ "icon": "awsui_icon_1i2wg_16pp7_240",
8
+ "icon-inline": "awsui_icon-inline_1i2wg_16pp7_246",
9
+ "token-normal": "awsui_token-normal_1i2wg_16pp7_251",
10
+ "token-inline": "awsui_token-inline_1i2wg_16pp7_258",
11
+ "token-option-inline": "awsui_token-option-inline_1i2wg_16pp7_284",
12
+ "token-box": "awsui_token-box_1i2wg_16pp7_288",
13
+ "token-box-without-dismiss": "awsui_token-box-without-dismiss_1i2wg_16pp7_307",
14
+ "token-box-inline": "awsui_token-box-inline_1i2wg_16pp7_311",
15
+ "disable-padding": "awsui_disable-padding_1i2wg_16pp7_331",
16
+ "token-box-readonly": "awsui_token-box-readonly_1i2wg_16pp7_338",
17
+ "token-box-disabled": "awsui_token-box-disabled_1i2wg_16pp7_339"
18
+ };
19
+