@cloudscape-design/components 3.0.682 → 3.0.683
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/internal/components/tooltip/index.d.ts +3 -2
- package/internal/components/tooltip/index.d.ts.map +1 -1
- package/internal/components/tooltip/index.js +6 -3
- package/internal/components/tooltip/index.js.map +1 -1
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/manifest.json +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export interface TooltipProps {
|
|
3
|
-
value:
|
|
3
|
+
value: React.ReactNode;
|
|
4
4
|
trackRef: React.RefObject<HTMLElement | SVGElement>;
|
|
5
|
+
trackKey?: string | number;
|
|
5
6
|
position?: 'top' | 'right' | 'bottom' | 'left';
|
|
6
7
|
className?: string;
|
|
7
8
|
contentAttributes?: React.HTMLAttributes<HTMLDivElement>;
|
|
8
9
|
}
|
|
9
|
-
export default function Tooltip({ value, trackRef, className, contentAttributes, position, }: TooltipProps): JSX.Element;
|
|
10
|
+
export default function Tooltip({ value, trackRef, trackKey, className, contentAttributes, position, }: TooltipProps): JSX.Element;
|
|
10
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/tooltip/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/tooltip/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,UAAU,CAAC,CAAC;IACpD,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;CAC1D;AAED,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAC9B,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,iBAAsB,EACtB,QAAgB,GACjB,EAAE,YAAY,eAgCd"}
|
|
@@ -8,10 +8,13 @@ import PopoverBody from '../../../popover/body';
|
|
|
8
8
|
import Portal from '../portal';
|
|
9
9
|
import popoverStyles from '../../../popover/styles.css.js';
|
|
10
10
|
import styles from './styles.css.js';
|
|
11
|
-
export default function Tooltip({ value, trackRef, className, contentAttributes = {}, position = 'top', }) {
|
|
11
|
+
export default function Tooltip({ value, trackRef, trackKey, className, contentAttributes = {}, position = 'top', }) {
|
|
12
|
+
if (!trackKey && (typeof value === 'string' || typeof value === 'number')) {
|
|
13
|
+
trackKey = value;
|
|
14
|
+
}
|
|
12
15
|
return (React.createElement(Portal, null,
|
|
13
|
-
React.createElement("div", Object.assign({ className: clsx(styles.root, className) }, contentAttributes),
|
|
14
|
-
React.createElement(Transition, { in: true }, () => (React.createElement(PopoverContainer, { trackRef: trackRef, trackKey:
|
|
16
|
+
React.createElement("div", Object.assign({ className: clsx(styles.root, className) }, contentAttributes, { "data-testid": trackKey }),
|
|
17
|
+
React.createElement(Transition, { in: true }, () => (React.createElement(PopoverContainer, { trackRef: trackRef, trackKey: trackKey, size: "small", fixedWidth: false, position: position, arrow: position => (React.createElement("div", { className: clsx(popoverStyles.arrow, popoverStyles[`arrow-position-${position}`]) },
|
|
15
18
|
React.createElement("div", { className: popoverStyles['arrow-outer'] }),
|
|
16
19
|
React.createElement("div", { className: popoverStyles['arrow-inner'] }))) },
|
|
17
20
|
React.createElement(PopoverBody, { dismissButton: false, dismissAriaLabel: undefined, onDismiss: undefined, header: undefined }, value)))))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/tooltip/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,gBAAgB,MAAM,4BAA4B,CAAC;AAC1D,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAChD,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,aAAa,MAAM,gCAAgC,CAAC;AAC3D,OAAO,MAAM,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/tooltip/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,gBAAgB,MAAM,4BAA4B,CAAC;AAC1D,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAChD,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,aAAa,MAAM,gCAAgC,CAAC;AAC3D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAWrC,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAC9B,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,iBAAiB,GAAG,EAAE,EACtB,QAAQ,GAAG,KAAK,GACH;IACb,IAAI,CAAC,QAAQ,IAAI,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC,EAAE;QACzE,QAAQ,GAAG,KAAK,CAAC;KAClB;IAED,OAAO,CACL,oBAAC,MAAM;QACL,2CAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,IAAM,iBAAiB,mBAAe,QAAQ;YACxF,oBAAC,UAAU,IAAC,EAAE,EAAE,IAAI,IACjB,GAAG,EAAE,CAAC,CACL,oBAAC,gBAAgB,IACf,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,OAAO,EACZ,UAAU,EAAE,KAAK,EACjB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,QAAQ,CAAC,EAAE,CAAC,CACjB,6BAAK,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,aAAa,CAAC,kBAAkB,QAAQ,EAAE,CAAC,CAAC;oBACpF,6BAAK,SAAS,EAAE,aAAa,CAAC,aAAa,CAAC,GAAI;oBAChD,6BAAK,SAAS,EAAE,aAAa,CAAC,aAAa,CAAC,GAAI,CAC5C,CACP;gBAED,oBAAC,WAAW,IAAC,aAAa,EAAE,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,IACpG,KAAK,CACM,CACG,CACpB,CACU,CACT,CACC,CACV,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { Transition } from '../transition';\nimport PopoverContainer from '../../../popover/container';\nimport PopoverBody from '../../../popover/body';\nimport Portal from '../portal';\nimport popoverStyles from '../../../popover/styles.css.js';\nimport styles from './styles.css.js';\n\nexport interface TooltipProps {\n value: React.ReactNode;\n trackRef: React.RefObject<HTMLElement | SVGElement>;\n trackKey?: string | number;\n position?: 'top' | 'right' | 'bottom' | 'left';\n className?: string;\n contentAttributes?: React.HTMLAttributes<HTMLDivElement>;\n}\n\nexport default function Tooltip({\n value,\n trackRef,\n trackKey,\n className,\n contentAttributes = {},\n position = 'top',\n}: TooltipProps) {\n if (!trackKey && (typeof value === 'string' || typeof value === 'number')) {\n trackKey = value;\n }\n\n return (\n <Portal>\n <div className={clsx(styles.root, className)} {...contentAttributes} data-testid={trackKey}>\n <Transition in={true}>\n {() => (\n <PopoverContainer\n trackRef={trackRef}\n trackKey={trackKey}\n size=\"small\"\n fixedWidth={false}\n position={position}\n arrow={position => (\n <div className={clsx(popoverStyles.arrow, popoverStyles[`arrow-position-${position}`])}>\n <div className={popoverStyles['arrow-outer']} />\n <div className={popoverStyles['arrow-inner']} />\n </div>\n )}\n >\n <PopoverBody dismissButton={false} dismissAriaLabel={undefined} onDismiss={undefined} header={undefined}>\n {value}\n </PopoverBody>\n </PopoverContainer>\n )}\n </Transition>\n </div>\n </Portal>\n );\n}\n"]}
|
package/internal/environment.js
CHANGED
package/internal/manifest.json
CHANGED
package/package.json
CHANGED