@cloudscape-design/components 3.0.1302 → 3.0.1303

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 (227) hide show
  1. package/alert/styles.css.js +27 -27
  2. package/alert/styles.scoped.css +50 -50
  3. package/alert/styles.selectors.js +27 -27
  4. package/annotation-context/annotation/styles.css.js +13 -13
  5. package/annotation-context/annotation/styles.scoped.css +21 -21
  6. package/annotation-context/annotation/styles.selectors.js +13 -13
  7. package/app-layout/notifications/styles.css.js +3 -3
  8. package/app-layout/notifications/styles.scoped.css +7 -7
  9. package/app-layout/notifications/styles.selectors.js +3 -3
  10. package/app-layout/visual-refresh/styles.css.js +86 -86
  11. package/app-layout/visual-refresh/styles.scoped.css +258 -258
  12. package/app-layout/visual-refresh/styles.selectors.js +86 -86
  13. package/app-layout/visual-refresh-toolbar/drawer/styles.css.js +32 -32
  14. package/app-layout/visual-refresh-toolbar/drawer/styles.scoped.css +89 -89
  15. package/app-layout/visual-refresh-toolbar/drawer/styles.selectors.js +32 -32
  16. package/app-layout/visual-refresh-toolbar/navigation/styles.css.js +4 -4
  17. package/app-layout/visual-refresh-toolbar/navigation/styles.scoped.css +7 -7
  18. package/app-layout/visual-refresh-toolbar/navigation/styles.selectors.js +4 -4
  19. package/app-layout/visual-refresh-toolbar/skeleton/styles.css.js +27 -27
  20. package/app-layout/visual-refresh-toolbar/skeleton/styles.scoped.css +54 -54
  21. package/app-layout/visual-refresh-toolbar/skeleton/styles.selectors.js +27 -27
  22. package/attribute-editor/styles.css.js +15 -15
  23. package/attribute-editor/styles.scoped.css +28 -28
  24. package/attribute-editor/styles.selectors.js +15 -15
  25. package/breadcrumb-group/item/styles.css.js +7 -7
  26. package/breadcrumb-group/item/styles.scoped.css +28 -28
  27. package/breadcrumb-group/item/styles.selectors.js +7 -7
  28. package/button/styles.css.js +22 -22
  29. package/button/styles.scoped.css +256 -256
  30. package/button/styles.selectors.js +22 -22
  31. package/button-dropdown/item-element/styles.css.js +21 -21
  32. package/button-dropdown/item-element/styles.scoped.css +37 -37
  33. package/button-dropdown/item-element/styles.selectors.js +21 -21
  34. package/checkbox/styles.css.js +3 -3
  35. package/checkbox/styles.scoped.css +11 -11
  36. package/checkbox/styles.selectors.js +3 -3
  37. package/collection-preferences/content-display/index.d.ts.map +1 -1
  38. package/collection-preferences/content-display/index.js +1 -1
  39. package/collection-preferences/content-display/index.js.map +1 -1
  40. package/container/interfaces.d.ts +1 -0
  41. package/container/interfaces.d.ts.map +1 -1
  42. package/container/interfaces.js.map +1 -1
  43. package/content-layout/styles.css.js +14 -14
  44. package/content-layout/styles.scoped.css +27 -27
  45. package/content-layout/styles.selectors.js +14 -14
  46. package/dropdown/index.d.ts +3 -0
  47. package/dropdown/index.d.ts.map +1 -1
  48. package/dropdown/index.js +3 -0
  49. package/dropdown/index.js.map +1 -1
  50. package/dropdown/styles.css.js +20 -20
  51. package/dropdown/styles.scoped.css +49 -49
  52. package/dropdown/styles.selectors.js +20 -20
  53. package/expandable-section/styles.css.js +35 -35
  54. package/expandable-section/styles.scoped.css +66 -68
  55. package/expandable-section/styles.selectors.js +35 -35
  56. package/file-token-group/styles.css.js +23 -23
  57. package/file-token-group/styles.scoped.css +36 -36
  58. package/file-token-group/styles.selectors.js +23 -23
  59. package/flashbar/styles.css.js +50 -50
  60. package/flashbar/styles.scoped.css +187 -187
  61. package/flashbar/styles.selectors.js +50 -50
  62. package/help-panel/styles.css.js +6 -6
  63. package/help-panel/styles.scoped.css +73 -73
  64. package/help-panel/styles.selectors.js +6 -6
  65. package/i18n/messages/all.all.js +1 -1
  66. package/i18n/messages/all.all.json +1 -1
  67. package/i18n/messages/all.ar.js +1 -1
  68. package/i18n/messages/all.ar.json +1 -1
  69. package/i18n/messages/all.de.js +1 -1
  70. package/i18n/messages/all.de.json +1 -1
  71. package/i18n/messages/all.en-GB.js +1 -1
  72. package/i18n/messages/all.en-GB.json +1 -1
  73. package/i18n/messages/all.en.js +1 -1
  74. package/i18n/messages/all.en.json +1 -1
  75. package/i18n/messages/all.es.js +1 -1
  76. package/i18n/messages/all.es.json +1 -1
  77. package/i18n/messages/all.fr.js +1 -1
  78. package/i18n/messages/all.fr.json +1 -1
  79. package/i18n/messages/all.id.js +1 -1
  80. package/i18n/messages/all.id.json +1 -1
  81. package/i18n/messages/all.it.js +1 -1
  82. package/i18n/messages/all.it.json +1 -1
  83. package/i18n/messages/all.ja.js +1 -1
  84. package/i18n/messages/all.ja.json +1 -1
  85. package/i18n/messages/all.ko.js +1 -1
  86. package/i18n/messages/all.ko.json +1 -1
  87. package/i18n/messages/all.pt-BR.js +1 -1
  88. package/i18n/messages/all.pt-BR.json +1 -1
  89. package/i18n/messages/all.zh-CN.js +1 -1
  90. package/i18n/messages/all.zh-CN.json +1 -1
  91. package/i18n/messages/all.zh-TW.js +1 -1
  92. package/i18n/messages/all.zh-TW.json +1 -1
  93. package/icon/interfaces.d.ts +1 -1
  94. package/icon/interfaces.d.ts.map +1 -1
  95. package/icon/interfaces.js.map +1 -1
  96. package/icon/internal.d.ts.map +1 -1
  97. package/icon/internal.js +4 -86
  98. package/icon/internal.js.map +1 -1
  99. package/icon/styles.css.js +39 -41
  100. package/icon/styles.scoped.css +110 -135
  101. package/icon/styles.selectors.js +39 -41
  102. package/icon-provider/context.d.ts +3 -34
  103. package/icon-provider/context.d.ts.map +1 -1
  104. package/icon-provider/context.js +3 -7
  105. package/icon-provider/context.js.map +1 -1
  106. package/icon-provider/interfaces.d.ts +0 -52
  107. package/icon-provider/interfaces.d.ts.map +1 -1
  108. package/icon-provider/interfaces.js.map +1 -1
  109. package/icon-provider/internal.d.ts +1 -3
  110. package/icon-provider/internal.d.ts.map +1 -1
  111. package/icon-provider/internal.js +4 -13
  112. package/icon-provider/internal.js.map +1 -1
  113. package/index.d.ts +0 -1
  114. package/index.d.ts.map +1 -1
  115. package/index.js +0 -1
  116. package/index.js.map +1 -1
  117. package/input/styles.css.js +18 -18
  118. package/input/styles.scoped.css +82 -82
  119. package/input/styles.selectors.js +18 -18
  120. package/internal/base-component/styles.scoped.css +7 -9
  121. package/internal/components/drag-handle/button.d.ts.map +1 -1
  122. package/internal/components/drag-handle/button.js +1 -1
  123. package/internal/components/drag-handle/button.js.map +1 -1
  124. package/internal/components/drag-handle-wrapper/styles.css.js +30 -30
  125. package/internal/components/drag-handle-wrapper/styles.scoped.css +58 -58
  126. package/internal/components/drag-handle-wrapper/styles.selectors.js +30 -30
  127. package/internal/components/radio-button/styles.css.js +7 -7
  128. package/internal/components/radio-button/styles.scoped.css +18 -18
  129. package/internal/components/radio-button/styles.selectors.js +7 -7
  130. package/internal/components/sortable-area/index.d.ts.map +1 -1
  131. package/internal/components/sortable-area/index.js +0 -1
  132. package/internal/components/sortable-area/index.js.map +1 -1
  133. package/internal/components/token-list/styles.css.js +10 -10
  134. package/internal/components/token-list/styles.scoped.css +25 -25
  135. package/internal/components/token-list/styles.selectors.js +10 -10
  136. package/internal/environment.d.ts +1 -2
  137. package/internal/environment.js +3 -4
  138. package/internal/environment.json +3 -4
  139. package/internal/generated/custom-css-properties/index.d.ts +0 -3
  140. package/internal/generated/custom-css-properties/index.d.ts.map +1 -1
  141. package/internal/generated/custom-css-properties/index.js +159 -162
  142. package/internal/generated/custom-css-properties/index.js.map +1 -1
  143. package/internal/generated/styles/tokens.d.ts +5 -7
  144. package/internal/generated/styles/tokens.js +5 -7
  145. package/internal/generated/theming/index.cjs +25 -39
  146. package/internal/generated/theming/index.cjs.d.ts +45 -63
  147. package/internal/generated/theming/index.d.ts +45 -63
  148. package/internal/generated/theming/index.js +25 -39
  149. package/internal/manifest.json +1 -1
  150. package/item-card/styles.css.js +14 -14
  151. package/item-card/styles.scoped.css +63 -63
  152. package/item-card/styles.selectors.js +14 -14
  153. package/link/styles.css.js +21 -21
  154. package/link/styles.scoped.css +104 -104
  155. package/link/styles.selectors.js +21 -21
  156. package/manifest.json +2 -2
  157. package/modal/styles.css.js +31 -31
  158. package/modal/styles.scoped.css +48 -48
  159. package/modal/styles.selectors.js +31 -31
  160. package/package.json +1 -2
  161. package/progress-bar/styles.css.js +18 -18
  162. package/progress-bar/styles.scoped.css +48 -48
  163. package/progress-bar/styles.selectors.js +18 -18
  164. package/prompt-input/styles.css.js +26 -26
  165. package/prompt-input/styles.scoped.css +105 -105
  166. package/prompt-input/styles.selectors.js +26 -26
  167. package/radio-button/index.d.ts +3 -0
  168. package/radio-button/index.d.ts.map +1 -1
  169. package/radio-button/index.js +3 -0
  170. package/radio-button/index.js.map +1 -1
  171. package/segmented-control/styles.css.js +16 -16
  172. package/segmented-control/styles.scoped.css +46 -46
  173. package/segmented-control/styles.selectors.js +16 -16
  174. package/slider/styles.css.js +26 -26
  175. package/slider/styles.scoped.css +165 -165
  176. package/slider/styles.selectors.js +26 -26
  177. package/spinner/styles.css.js +13 -13
  178. package/spinner/styles.scoped.css +39 -39
  179. package/spinner/styles.selectors.js +13 -13
  180. package/tabs/styles.css.js +30 -30
  181. package/tabs/styles.scoped.css +76 -76
  182. package/tabs/styles.selectors.js +30 -30
  183. package/tag-editor/styles.css.js +3 -3
  184. package/tag-editor/styles.scoped.css +13 -13
  185. package/tag-editor/styles.selectors.js +3 -3
  186. package/test-utils/dom/index.d.ts +0 -28
  187. package/test-utils/dom/index.js +1 -20
  188. package/test-utils/dom/index.js.map +1 -1
  189. package/test-utils/selectors/index.d.ts +0 -18
  190. package/test-utils/selectors/index.js +1 -15
  191. package/test-utils/selectors/index.js.map +1 -1
  192. package/text-content/styles.css.js +1 -1
  193. package/text-content/styles.scoped.css +66 -66
  194. package/text-content/styles.selectors.js +1 -1
  195. package/textarea/styles.css.js +5 -5
  196. package/textarea/styles.scoped.css +45 -45
  197. package/textarea/styles.selectors.js +5 -5
  198. package/toggle/styles.css.js +10 -10
  199. package/toggle/styles.scoped.css +23 -23
  200. package/toggle/styles.selectors.js +10 -10
  201. package/token/styles.css.js +14 -14
  202. package/token/styles.scoped.css +46 -46
  203. package/token/styles.selectors.js +14 -14
  204. package/test-utils/dom/truncated-text/index.d.ts +0 -6
  205. package/test-utils/dom/truncated-text/index.js +0 -17
  206. package/test-utils/dom/truncated-text/index.js.map +0 -1
  207. package/test-utils/selectors/truncated-text/index.d.ts +0 -6
  208. package/test-utils/selectors/truncated-text/index.js +0 -17
  209. package/test-utils/selectors/truncated-text/index.js.map +0 -1
  210. package/truncated-text/index.d.ts +0 -7
  211. package/truncated-text/index.d.ts.map +0 -1
  212. package/truncated-text/index.js +0 -18
  213. package/truncated-text/index.js.map +0 -1
  214. package/truncated-text/interfaces.d.ts +0 -16
  215. package/truncated-text/interfaces.d.ts.map +0 -1
  216. package/truncated-text/interfaces.js +0 -2
  217. package/truncated-text/interfaces.js.map +0 -1
  218. package/truncated-text/internal.d.ts +0 -10
  219. package/truncated-text/internal.d.ts.map +0 -1
  220. package/truncated-text/internal.js +0 -47
  221. package/truncated-text/internal.js.map +0 -1
  222. package/truncated-text/styles.css.js +0 -6
  223. package/truncated-text/styles.scoped.css +0 -177
  224. package/truncated-text/styles.selectors.js +0 -7
  225. package/truncated-text/test-classes/styles.css.js +0 -6
  226. package/truncated-text/test-classes/styles.scoped.css +0 -7
  227. package/truncated-text/test-classes/styles.selectors.js +0 -7
@@ -1,17 +0,0 @@
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 dom_1 = require("@cloudscape-design/test-utils-core/dom");
6
- const tooltip_1 = require("../tooltip");
7
- const styles_selectors_js_1 = require("../../../tooltip/test-classes/styles.selectors.js");
8
- const styles_selectors_js_2 = require("../../../truncated-text/test-classes/styles.selectors.js");
9
- class TruncatedTextWrapper extends dom_1.ComponentWrapper {
10
- findTooltip() {
11
- const tooltipElement = (0, dom_1.createWrapper)().findByClassName(styles_selectors_js_1.default.root);
12
- return tooltipElement && new tooltip_1.default(tooltipElement.getElement());
13
- }
14
- }
15
- TruncatedTextWrapper.rootSelector = styles_selectors_js_2.default.root;
16
- exports.default = TruncatedTextWrapper;
17
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/dom/truncated-text/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,gEAAyF;AAEzF,wCAAwC;AAExC,2FAAuF;AACvF,kGAA8E;AAE9E,MAAqB,oBAAqB,SAAQ,sBAA6B;IAG7E,WAAW;QACT,MAAM,cAAc,GAAG,IAAA,mBAAa,GAAE,CAAC,eAAe,CAAC,6BAAsB,CAAC,IAAI,CAAC,CAAC;QACpF,OAAO,cAAc,IAAI,IAAI,iBAAc,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC,CAAC;IAC3E,CAAC;;AALM,iCAAY,GAAW,6BAAM,CAAC,IAAI,CAAC;kBADvB,oBAAoB"}
@@ -1,6 +0,0 @@
1
- import { ComponentWrapper } from "@cloudscape-design/test-utils-core/selectors";
2
- import TooltipWrapper from '../tooltip';
3
- export default class TruncatedTextWrapper extends ComponentWrapper {
4
- static rootSelector: string;
5
- findTooltip(): TooltipWrapper;
6
- }
@@ -1,17 +0,0 @@
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 tooltip_1 = require("../tooltip");
7
- const styles_selectors_js_1 = require("../../../tooltip/test-classes/styles.selectors.js");
8
- const styles_selectors_js_2 = require("../../../truncated-text/test-classes/styles.selectors.js");
9
- class TruncatedTextWrapper extends selectors_1.ComponentWrapper {
10
- findTooltip() {
11
- const tooltipElement = (0, selectors_1.createWrapper)().findByClassName(styles_selectors_js_1.default.root);
12
- return tooltipElement && new tooltip_1.default(tooltipElement.getElement());
13
- }
14
- }
15
- TruncatedTextWrapper.rootSelector = styles_selectors_js_2.default.root;
16
- exports.default = TruncatedTextWrapper;
17
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/selectors/truncated-text/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,4EAA+F;AAC/F,wCAAwC;AACxC,2FAAuF;AACvF,kGAA8E;AAC9E,MAAqB,oBAAqB,SAAQ,4BAAgB;IAEhE,WAAW;QACT,MAAM,cAAc,GAAG,IAAA,yBAAa,GAAE,CAAC,eAAe,CAAC,6BAAsB,CAAC,IAAI,CAAC,CAAC;QACpF,OAAO,cAAc,IAAI,IAAI,iBAAc,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC,CAAC;IAC3E,CAAC;;AAJM,iCAAY,GAAW,6BAAM,CAAC,IAAI,CAAC;kBADvB,oBAAoB"}
@@ -1,7 +0,0 @@
1
- import { TruncatedTextProps } from './interfaces';
2
- export { TruncatedTextProps };
3
- export default function TruncatedText({
4
- children,
5
- tooltipText,
6
- ...rest
7
- }: TruncatedTextProps): JSX.Element;
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/truncated-text/index.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGlD,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAE9B,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,EAAE,kBAAkB,eAW3F"}
@@ -1,18 +0,0 @@
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 useBaseComponent from '../internal/hooks/use-base-component';
6
- import { applyDisplayName } from '../internal/utils/apply-display-name';
7
- import { getExternalProps } from '../internal/utils/external-props';
8
- import InternalTruncatedText from './internal';
9
- export default function TruncatedText({ children, tooltipText, ...rest }) {
10
- const baseComponentProps = useBaseComponent('TruncatedText', {
11
- props: {},
12
- metadata: { hasTooltipText: !!tooltipText },
13
- });
14
- const externalProps = getExternalProps(rest);
15
- return (React.createElement(InternalTruncatedText, { ...externalProps, ...baseComponentProps, tooltipText: tooltipText }, children));
16
- }
17
- applyDisplayName(TruncatedText, 'TruncatedText');
18
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/truncated-text/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE,OAAO,qBAAqB,MAAM,YAAY,CAAC;AAI/C,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAI,EAAsB;IAC1F,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,eAAe,EAAE;QAC3D,KAAK,EAAE,EAAE;QACT,QAAQ,EAAE,EAAE,cAAc,EAAE,CAAC,CAAC,WAAW,EAAE;KAC5C,CAAC,CAAC;IACH,MAAM,aAAa,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC7C,OAAO,CACL,oBAAC,qBAAqB,OAAK,aAAa,KAAM,kBAAkB,EAAE,WAAW,EAAE,WAAW,IACvF,QAAQ,CACa,CACzB,CAAC;AACJ,CAAC;AAED,gBAAgB,CAAC,aAAa,EAAE,eAAe,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 useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { getExternalProps } from '../internal/utils/external-props';\nimport { TruncatedTextProps } from './interfaces';\nimport InternalTruncatedText from './internal';\n\nexport { TruncatedTextProps };\n\nexport default function TruncatedText({ children, tooltipText, ...rest }: TruncatedTextProps) {\n const baseComponentProps = useBaseComponent('TruncatedText', {\n props: {},\n metadata: { hasTooltipText: !!tooltipText },\n });\n const externalProps = getExternalProps(rest);\n return (\n <InternalTruncatedText {...externalProps} {...baseComponentProps} tooltipText={tooltipText}>\n {children}\n </InternalTruncatedText>\n );\n}\n\napplyDisplayName(TruncatedText, 'TruncatedText');\n"]}
@@ -1,16 +0,0 @@
1
- import React from 'react';
2
- import { BaseComponentProps } from '../internal/base-component';
3
- export interface TruncatedTextProps extends BaseComponentProps {
4
- /**
5
- * The inline text to display. If there isn't enough space to render the text
6
- * in a single line, it is truncated with an ellipsis and the full content is
7
- * shown on pointer hover or keyboard focus.
8
- */
9
- children?: React.ReactNode;
10
- /**
11
- * The content of the tooltip shown when the text is truncated. By default, the
12
- * tooltip content is the same as the `children` slot. Use only if the `children`
13
- * slot may contain interactive elements.
14
- */
15
- tooltipText?: string;
16
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/truncated-text/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,MAAM,WAAW,kBAAmB,SAAQ,kBAAkB;IAC5D;;;;OAIG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=interfaces.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/truncated-text/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';\n\nexport interface TruncatedTextProps extends BaseComponentProps {\n /**\n * The inline text to display. If there isn't enough space to render the text\n * in a single line, it is truncated with an ellipsis and the full content is\n * shown on pointer hover or keyboard focus.\n */\n children?: React.ReactNode;\n\n /**\n * The content of the tooltip shown when the text is truncated. By default, the\n * tooltip content is the same as the `children` slot. Use only if the `children`\n * slot may contain interactive elements.\n */\n tooltipText?: string;\n}\n"]}
@@ -1,10 +0,0 @@
1
- import { InternalBaseComponentProps } from '../internal/hooks/use-base-component';
2
- import { TruncatedTextProps } from './interfaces';
3
- type InternalTruncatedTextProps = TruncatedTextProps & InternalBaseComponentProps;
4
- export default function InternalTruncatedText({
5
- children,
6
- tooltipText,
7
- __internalRootRef,
8
- ...rest
9
- }: InternalTruncatedTextProps): JSX.Element;
10
- export {};
@@ -1 +0,0 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/truncated-text/internal.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAKlD,KAAK,0BAA0B,GAAG,kBAAkB,GAAG,0BAA0B,CAAC;AAElF,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,EAC5C,QAAQ,EACR,WAAW,EACX,iBAAiB,EACjB,GAAG,IAAI,EACR,EAAE,0BAA0B,eAuD5B"}
@@ -1,47 +0,0 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
3
- import React, { useEffect, useRef, useState } from 'react';
4
- import clsx from 'clsx';
5
- import { useMergeRefs, useResizeObserver } from '@cloudscape-design/component-toolkit/internal';
6
- import { getBaseProps } from '../internal/base-component';
7
- import Tooltip from '../tooltip/internal';
8
- import styles from './styles.css.js';
9
- import testUtilStyles from './test-classes/styles.css.js';
10
- export default function InternalTruncatedText({ children, tooltipText, __internalRootRef, ...rest }) {
11
- const baseProps = getBaseProps(rest);
12
- const containerRef = useRef(null);
13
- const [showTooltip, setShowTooltip] = useState(false);
14
- const [isTruncated, setIsTruncated] = useState(false);
15
- useResizeObserver(containerRef, () => {
16
- const element = containerRef.current;
17
- if (element) {
18
- // The element uses CSS ellipsis truncation. When the rendered content overflows the
19
- // visible box, the browser sets scrollWidth > clientWidth.
20
- setIsTruncated(element.scrollWidth > element.clientWidth);
21
- }
22
- });
23
- useEffect(() => {
24
- const element = containerRef.current;
25
- if (element) {
26
- // useResizeObserver fires initially at layoutEffect-time where the initial calculation
27
- // is performed, but the calculation isn't always correct at that stage.
28
- setTimeout(() => setIsTruncated(element.scrollWidth > element.clientWidth), 1);
29
- }
30
- }, []);
31
- const tooltipEnabledProps = isTruncated
32
- ? {
33
- role: 'group',
34
- tabIndex: 0,
35
- onPointerEnter: () => setShowTooltip(true),
36
- onPointerLeave: () => setShowTooltip(false),
37
- // onFocus/onBlur bubble in React, so we only want the wrapper focus to trigger the tooltip.
38
- onFocus: event => event.target === event.currentTarget && setShowTooltip(true),
39
- onBlur: event => event.target === event.currentTarget && setShowTooltip(false),
40
- }
41
- : {};
42
- return (React.createElement(React.Fragment, null,
43
- React.createElement("span", { ...baseProps, ...tooltipEnabledProps, ref: useMergeRefs(__internalRootRef, containerRef), className: clsx(styles.root, testUtilStyles.root, baseProps.className) },
44
- children,
45
- isTruncated && showTooltip && (React.createElement(Tooltip, { content: tooltipText !== null && tooltipText !== void 0 ? tooltipText : children, getTrack: () => containerRef.current, onEscape: () => setShowTooltip(false) })))));
46
- }
47
- //# sourceMappingURL=internal.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/truncated-text/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAkB,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3E,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAEhG,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,OAAO,MAAM,qBAAqB,CAAC;AAG1C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAI1D,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,EAC5C,QAAQ,EACR,WAAW,EACX,iBAAiB,EACjB,GAAG,IAAI,EACoB;IAC3B,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IACrC,MAAM,YAAY,GAAG,MAAM,CAAkB,IAAI,CAAC,CAAC;IACnD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACtD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEtD,iBAAiB,CAAC,YAAY,EAAE,GAAG,EAAE;QACnC,MAAM,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC;QACrC,IAAI,OAAO,EAAE,CAAC;YACZ,oFAAoF;YACpF,2DAA2D;YAC3D,cAAc,CAAC,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC;QACrC,IAAI,OAAO,EAAE,CAAC;YACZ,uFAAuF;YACvF,wEAAwE;YACxE,UAAU,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC;QACjF,CAAC;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,mBAAmB,GAAoC,WAAW;QACtE,CAAC,CAAC;YACE,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,CAAC;YACX,cAAc,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC;YAC1C,cAAc,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC;YAC3C,4FAA4F;YAC5F,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,aAAa,IAAI,cAAc,CAAC,IAAI,CAAC;YAC9E,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,aAAa,IAAI,cAAc,CAAC,KAAK,CAAC;SAC/E;QACH,CAAC,CAAC,EAAE,CAAC;IAEP,OAAO,CACL;QACE,iCACM,SAAS,KACT,mBAAmB,EACvB,GAAG,EAAE,YAAY,CAAC,iBAAiB,EAAE,YAAY,CAAC,EAClD,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,cAAc,CAAC,IAAI,EAAE,SAAS,CAAC,SAAS,CAAC;YAErE,QAAQ;YACR,WAAW,IAAI,WAAW,IAAI,CAC7B,oBAAC,OAAO,IACN,OAAO,EAAE,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,QAAQ,EAChC,QAAQ,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,OAAO,EACpC,QAAQ,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,GACrC,CACH,CACI,CACN,CACJ,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { HTMLAttributes, useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, useResizeObserver } from '@cloudscape-design/component-toolkit/internal';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport Tooltip from '../tooltip/internal';\nimport { TruncatedTextProps } from './interfaces';\n\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\ntype InternalTruncatedTextProps = TruncatedTextProps & InternalBaseComponentProps;\n\nexport default function InternalTruncatedText({\n children,\n tooltipText,\n __internalRootRef,\n ...rest\n}: InternalTruncatedTextProps) {\n const baseProps = getBaseProps(rest);\n const containerRef = useRef<HTMLSpanElement>(null);\n const [showTooltip, setShowTooltip] = useState(false);\n const [isTruncated, setIsTruncated] = useState(false);\n\n useResizeObserver(containerRef, () => {\n const element = containerRef.current;\n if (element) {\n // The element uses CSS ellipsis truncation. When the rendered content overflows the\n // visible box, the browser sets scrollWidth > clientWidth.\n setIsTruncated(element.scrollWidth > element.clientWidth);\n }\n });\n\n useEffect(() => {\n const element = containerRef.current;\n if (element) {\n // useResizeObserver fires initially at layoutEffect-time where the initial calculation\n // is performed, but the calculation isn't always correct at that stage.\n setTimeout(() => setIsTruncated(element.scrollWidth > element.clientWidth), 1);\n }\n }, []);\n\n const tooltipEnabledProps: HTMLAttributes<HTMLSpanElement> = isTruncated\n ? {\n role: 'group',\n tabIndex: 0,\n onPointerEnter: () => setShowTooltip(true),\n onPointerLeave: () => setShowTooltip(false),\n // onFocus/onBlur bubble in React, so we only want the wrapper focus to trigger the tooltip.\n onFocus: event => event.target === event.currentTarget && setShowTooltip(true),\n onBlur: event => event.target === event.currentTarget && setShowTooltip(false),\n }\n : {};\n\n return (\n <>\n <span\n {...baseProps}\n {...tooltipEnabledProps}\n ref={useMergeRefs(__internalRootRef, containerRef)}\n className={clsx(styles.root, testUtilStyles.root, baseProps.className)}\n >\n {children}\n {isTruncated && showTooltip && (\n <Tooltip\n content={tooltipText ?? children}\n getTrack={() => containerRef.current}\n onEscape={() => setShowTooltip(false)}\n />\n )}\n </span>\n </>\n );\n}\n"]}
@@ -1,6 +0,0 @@
1
-
2
- import './styles.scoped.css';
3
- export default {
4
- "root": "awsui_root_1ol5m_szsu3_145"
5
- };
6
-
@@ -1,177 +0,0 @@
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
- /*
14
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
15
- SPDX-License-Identifier: Apache-2.0
16
- */
17
- /*
18
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
19
- SPDX-License-Identifier: Apache-2.0
20
- */
21
- /*
22
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
23
- SPDX-License-Identifier: Apache-2.0
24
- */
25
- /*
26
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
27
- SPDX-License-Identifier: Apache-2.0
28
- */
29
- /*
30
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
31
- SPDX-License-Identifier: Apache-2.0
32
- */
33
- /*
34
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
35
- SPDX-License-Identifier: Apache-2.0
36
- */
37
- /*
38
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
39
- SPDX-License-Identifier: Apache-2.0
40
- */
41
- /*
42
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
43
- SPDX-License-Identifier: Apache-2.0
44
- */
45
- /*
46
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
47
- SPDX-License-Identifier: Apache-2.0
48
- */
49
- /*
50
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
51
- SPDX-License-Identifier: Apache-2.0
52
- */
53
- /*
54
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
55
- SPDX-License-Identifier: Apache-2.0
56
- */
57
- /*
58
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
59
- SPDX-License-Identifier: Apache-2.0
60
- */
61
- /*
62
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
63
- SPDX-License-Identifier: Apache-2.0
64
- */
65
- /*
66
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
67
- SPDX-License-Identifier: Apache-2.0
68
- */
69
- /*
70
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
71
- SPDX-License-Identifier: Apache-2.0
72
- */
73
- /*
74
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
75
- SPDX-License-Identifier: Apache-2.0
76
- */
77
- /*
78
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
79
- SPDX-License-Identifier: Apache-2.0
80
- */
81
- /*
82
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
83
- SPDX-License-Identifier: Apache-2.0
84
- */
85
- /*
86
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
87
- SPDX-License-Identifier: Apache-2.0
88
- */
89
- /*
90
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
91
- SPDX-License-Identifier: Apache-2.0
92
- */
93
- /*
94
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
95
- SPDX-License-Identifier: Apache-2.0
96
- */
97
- /*
98
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
99
- SPDX-License-Identifier: Apache-2.0
100
- */
101
- /*
102
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
103
- SPDX-License-Identifier: Apache-2.0
104
- */
105
- /*
106
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
107
- SPDX-License-Identifier: Apache-2.0
108
- */
109
- /*
110
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
111
- SPDX-License-Identifier: Apache-2.0
112
- */
113
- /* stylelint-disable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
114
- /* stylelint-enable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
115
- /*
116
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
117
- SPDX-License-Identifier: Apache-2.0
118
- */
119
- /*
120
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
121
- SPDX-License-Identifier: Apache-2.0
122
- */
123
- /*
124
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
125
- SPDX-License-Identifier: Apache-2.0
126
- */
127
- /*
128
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
129
- SPDX-License-Identifier: Apache-2.0
130
- */
131
- /*
132
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
133
- SPDX-License-Identifier: Apache-2.0
134
- */
135
- /*
136
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
137
- SPDX-License-Identifier: Apache-2.0
138
- */
139
- /*
140
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
141
- SPDX-License-Identifier: Apache-2.0
142
- */
143
- /* Style used for links in slots/components that are text heavy, to help links stand out among
144
- surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
145
- .awsui_root_1ol5m_szsu3_145:not(#\9) {
146
- white-space: nowrap;
147
- overflow: hidden;
148
- text-overflow: ellipsis;
149
- display: block;
150
- inline-size: 100%;
151
- max-inline-size: 100%;
152
- min-inline-size: 0;
153
- }
154
- .awsui_root_1ol5m_szsu3_145:not(#\9):focus {
155
- outline: none;
156
- }
157
- body[data-awsui-focus-visible=true] .awsui_root_1ol5m_szsu3_145:not(#\9):focus {
158
- position: relative;
159
- }
160
- body[data-awsui-focus-visible=true] .awsui_root_1ol5m_szsu3_145:not(#\9):focus {
161
- outline: 2px dotted transparent;
162
- outline-offset: calc(calc(-1 * 2px) - 1px);
163
- }
164
- body[data-awsui-focus-visible=true] .awsui_root_1ol5m_szsu3_145:not(#\9):focus::before {
165
- content: " ";
166
- display: block;
167
- position: absolute;
168
- inset-inline-start: calc(-1 * calc(-1 * 2px));
169
- inset-block-start: calc(-1 * calc(-1 * 2px));
170
- inline-size: calc(100% + calc(-1 * 2px) + calc(-1 * 2px));
171
- block-size: calc(100% + calc(-1 * 2px) + calc(-1 * 2px));
172
- border-start-start-radius: var(--border-radius-control-default-focus-ring-1uabki, 4px);
173
- border-start-end-radius: var(--border-radius-control-default-focus-ring-1uabki, 4px);
174
- border-end-start-radius: var(--border-radius-control-default-focus-ring-1uabki, 4px);
175
- border-end-end-radius: var(--border-radius-control-default-focus-ring-1uabki, 4px);
176
- box-shadow: 0 0 0 2px var(--color-border-item-focused-uk47pl, #006ce0);
177
- }
@@ -1,7 +0,0 @@
1
-
2
- // es-module interop with Babel and Typescript
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- module.exports.default = {
5
- "root": "awsui_root_1ol5m_szsu3_145"
6
- };
7
-
@@ -1,6 +0,0 @@
1
-
2
- import './styles.scoped.css';
3
- export default {
4
- "root": "awsui_root_lwmqr_im8v7_5"
5
- };
6
-
@@ -1,7 +0,0 @@
1
- /*
2
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- SPDX-License-Identifier: Apache-2.0
4
- */
5
- .awsui_root_lwmqr_im8v7_5:not(#\9) {
6
- /* used in test-utils */
7
- }
@@ -1,7 +0,0 @@
1
-
2
- // es-module interop with Babel and Typescript
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- module.exports.default = {
5
- "root": "awsui_root_lwmqr_im8v7_5"
6
- };
7
-