@cloudscape-design/components-themeable 3.0.1192 → 3.0.1193
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/lib/internal/manifest.json +1 -1
- package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
- package/lib/internal/scss/tooltip/test-classes/styles.scss +8 -0
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/trigger-button/index.js +2 -2
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/trigger-button/index.js.map +1 -1
- package/lib/internal/template/breadcrumb-group/item/item.js +2 -2
- package/lib/internal/template/breadcrumb-group/item/item.js.map +1 -1
- package/lib/internal/template/button/internal.d.ts.map +1 -1
- package/lib/internal/template/button/internal.js +2 -2
- package/lib/internal/template/button/internal.js.map +1 -1
- package/lib/internal/template/button-group/file-input-item.d.ts.map +1 -1
- package/lib/internal/template/button-group/file-input-item.js +3 -4
- package/lib/internal/template/button-group/file-input-item.js.map +1 -1
- package/lib/internal/template/button-group/icon-button-item.d.ts.map +1 -1
- package/lib/internal/template/button-group/icon-button-item.js +3 -3
- package/lib/internal/template/button-group/icon-button-item.js.map +1 -1
- package/lib/internal/template/button-group/icon-toggle-button-item.d.ts.map +1 -1
- package/lib/internal/template/button-group/icon-toggle-button-item.js +2 -2
- package/lib/internal/template/button-group/icon-toggle-button-item.js.map +1 -1
- package/lib/internal/template/button-group/menu-dropdown-item.d.ts.map +1 -1
- package/lib/internal/template/button-group/menu-dropdown-item.js +2 -2
- package/lib/internal/template/button-group/menu-dropdown-item.js.map +1 -1
- package/lib/internal/template/calendar/grid/index.js +2 -2
- package/lib/internal/template/calendar/grid/index.js.map +1 -1
- package/lib/internal/template/date-range-picker/calendar/grids/grid-cell.js +2 -2
- package/lib/internal/template/date-range-picker/calendar/grids/grid-cell.js.map +1 -1
- package/lib/internal/template/file-token-group/file-token.d.ts.map +1 -1
- package/lib/internal/template/file-token-group/file-token.js +2 -2
- package/lib/internal/template/file-token-group/file-token.js.map +1 -1
- package/lib/internal/template/index.d.ts +1 -0
- package/lib/internal/template/index.d.ts.map +1 -1
- package/lib/internal/template/index.js +1 -0
- package/lib/internal/template/index.js.map +1 -1
- package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
- package/lib/internal/template/internal/components/tooltip/index.d.ts +5 -0
- package/lib/internal/template/internal/components/tooltip/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/tooltip/index.js +2 -1
- package/lib/internal/template/internal/components/tooltip/index.js.map +1 -1
- package/lib/internal/template/internal/environment.js +2 -2
- package/lib/internal/template/internal/environment.json +2 -2
- package/lib/internal/template/package.json +1 -0
- package/lib/internal/template/segmented-control/segment.js +2 -2
- package/lib/internal/template/segmented-control/segment.js.map +1 -1
- package/lib/internal/template/select/parts/item.d.ts +1 -1
- package/lib/internal/template/select/parts/item.d.ts.map +1 -1
- package/lib/internal/template/select/parts/item.js +2 -2
- package/lib/internal/template/select/parts/item.js.map +1 -1
- package/lib/internal/template/select/parts/multiselect-item.d.ts.map +1 -1
- package/lib/internal/template/select/parts/multiselect-item.js +2 -2
- package/lib/internal/template/select/parts/multiselect-item.js.map +1 -1
- package/lib/internal/template/slider/internal.d.ts.map +1 -1
- package/lib/internal/template/slider/internal.js +2 -2
- package/lib/internal/template/slider/internal.js.map +1 -1
- package/lib/internal/template/tabs/tab-header-bar.js +2 -2
- package/lib/internal/template/tabs/tab-header-bar.js.map +1 -1
- package/lib/internal/template/test-utils/dom/index.d.ts +20 -0
- package/lib/internal/template/test-utils/dom/index.js +15 -1
- package/lib/internal/template/test-utils/dom/index.js.map +1 -1
- package/lib/internal/template/test-utils/dom/tooltip/index.d.ts +9 -0
- package/lib/internal/template/test-utils/dom/tooltip/index.js +19 -0
- package/lib/internal/template/test-utils/dom/tooltip/index.js.map +1 -0
- package/lib/internal/template/test-utils/selectors/index.d.ts +18 -0
- package/lib/internal/template/test-utils/selectors/index.js +15 -1
- package/lib/internal/template/test-utils/selectors/index.js.map +1 -1
- package/lib/internal/template/test-utils/selectors/tooltip/index.d.ts +9 -0
- package/lib/internal/template/test-utils/selectors/tooltip/index.js +19 -0
- package/lib/internal/template/test-utils/selectors/tooltip/index.js.map +1 -0
- package/lib/internal/template/token/internal.d.ts.map +1 -1
- package/lib/internal/template/token/internal.js +3 -3
- package/lib/internal/template/token/internal.js.map +1 -1
- package/lib/internal/template/tooltip/index.d.ts +7 -0
- package/lib/internal/template/tooltip/index.d.ts.map +1 -0
- package/lib/internal/template/tooltip/index.js +20 -0
- package/lib/internal/template/tooltip/index.js.map +1 -0
- package/lib/internal/template/tooltip/interfaces.d.ts +38 -0
- package/lib/internal/template/tooltip/interfaces.d.ts.map +1 -0
- package/lib/internal/template/tooltip/interfaces.js +2 -0
- package/lib/internal/template/tooltip/interfaces.js.map +1 -0
- package/lib/internal/template/tooltip/internal.d.ts +6 -0
- package/lib/internal/template/tooltip/internal.d.ts.map +1 -0
- package/lib/internal/template/tooltip/internal.js +45 -0
- package/lib/internal/template/tooltip/internal.js.map +1 -0
- package/lib/internal/template/tooltip/test-classes/styles.css.js +6 -0
- package/lib/internal/template/tooltip/test-classes/styles.scoped.css +7 -0
- package/lib/internal/template/tooltip/test-classes/styles.selectors.js +7 -0
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ComponentWrapper, ElementWrapper } from "@cloudscape-design/test-utils-core/selectors";
|
|
2
|
+
export default class TooltipWrapper extends ComponentWrapper {
|
|
3
|
+
static rootSelector: string;
|
|
4
|
+
/**
|
|
5
|
+
* Returns the tooltip content element.
|
|
6
|
+
* Searches within this tooltip's scope to avoid conflicts with popovers.
|
|
7
|
+
*/
|
|
8
|
+
findContent(): ElementWrapper;
|
|
9
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
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 styles_selectors_js_1 = require("../../../popover/styles.selectors.js");
|
|
7
|
+
const styles_selectors_js_2 = require("../../../tooltip/test-classes/styles.selectors.js");
|
|
8
|
+
class TooltipWrapper extends selectors_1.ComponentWrapper {
|
|
9
|
+
/**
|
|
10
|
+
* Returns the tooltip content element.
|
|
11
|
+
* Searches within this tooltip's scope to avoid conflicts with popovers.
|
|
12
|
+
*/
|
|
13
|
+
findContent() {
|
|
14
|
+
return this.findByClassName(styles_selectors_js_1.default.content);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
TooltipWrapper.rootSelector = styles_selectors_js_2.default.root;
|
|
18
|
+
exports.default = TooltipWrapper;
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/selectors/tooltip/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,4EAAgG;AAChG,8EAAiE;AACjE,2FAAuE;AACvE,MAAqB,cAAe,SAAQ,4BAAgB;IAG1D;;;OAGG;IACH,WAAW;QACT,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAa,CAAC,OAAO,CAAC,CAAC;IACrD,CAAC;;AARM,2BAAY,GAAW,6BAAM,CAAC,IAAI,CAAC;kBADvB,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/token/internal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/token/internal.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAIlF,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAO1C,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"}
|
|
@@ -5,8 +5,8 @@ import clsx from 'clsx';
|
|
|
5
5
|
import { useResizeObserver, useUniqueId, warnOnce } from '@cloudscape-design/component-toolkit/internal';
|
|
6
6
|
import { getBaseProps } from '../internal/base-component';
|
|
7
7
|
import Option from '../internal/components/option';
|
|
8
|
-
import Tooltip from '../internal/components/tooltip';
|
|
9
8
|
import LiveRegion from '../live-region/internal';
|
|
9
|
+
import Tooltip from '../tooltip/internal.js';
|
|
10
10
|
import DismissButton from './dismiss-button';
|
|
11
11
|
import legacyTestingStyles from '../token-group/styles.css.js';
|
|
12
12
|
import analyticsSelectors from './analytics-metadata/styles.css.js';
|
|
@@ -75,8 +75,8 @@ __internalRootRef, ...restProps }) {
|
|
|
75
75
|
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']) },
|
|
76
76
|
React.createElement(Option, { className: clsx(isInline && styles['token-option-inline']), triggerVariant: isInline, option: buildOptionDefinition(), disableTitleTooltip: !!tooltipContent, labelContainerRef: labelContainerRef, labelRef: labelRef, labelId: ariaLabelledbyId }),
|
|
77
77
|
onDismiss && (React.createElement(DismissButton, { disabled: disabled, dismissLabel: dismissLabel, onDismiss: onDismiss, readOnly: readOnly, inline: isInline }))),
|
|
78
|
-
!!tooltipContent && isInline && isEllipsisActive && showTooltip && (React.createElement(Tooltip, { "data-testid": "token-tooltip",
|
|
79
|
-
React.createElement("span", { "data-testid": "tooltip-live-region-content" }, tooltipContent)),
|
|
78
|
+
!!tooltipContent && isInline && isEllipsisActive && showTooltip && (React.createElement(Tooltip, { "data-testid": "token-tooltip", getTrack: () => labelContainerRef.current, content: React.createElement(LiveRegion, null,
|
|
79
|
+
React.createElement("span", { "data-testid": "tooltip-live-region-content" }, tooltipContent)), onEscape: () => {
|
|
80
80
|
setShowTooltip(false);
|
|
81
81
|
} }))));
|
|
82
82
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/token/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAEzG,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,MAAM,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/token/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAEzG,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,MAAM,MAAM,+BAA+B,CAAC;AAEnD,OAAO,UAAU,MAAM,yBAAyB,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,iBAAiB,EAAE,iBAAiB,EACpC,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,gBAAgB,GACzB;YACD,SAAS,IAAI,CACZ,oBAAC,aAAa,IACZ,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,QAAQ,GAChB,CACH,CACG;QACL,CAAC,CAAC,cAAc,IAAI,QAAQ,IAAI,gBAAgB,IAAI,WAAW,IAAI,CAClE,oBAAC,OAAO,mBACM,eAAe,EAC3B,QAAQ,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,OAAO,EACzC,OAAO,EACL,oBAAC,UAAU;gBACT,6CAAkB,6BAA6B,IAAE,cAAc,CAAQ,CAC5D,EAEf,QAAQ,EAAE,GAAG,EAAE;gBACb,cAAc,CAAC,KAAK,CAAC,CAAC;YACxB,CAAC,GACD,CACH,CACG,CACP,CAAC;AACJ,CAAC;AAED,eAAe,aAAa,CAAC","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 { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport LiveRegion from '../live-region/internal';\nimport Tooltip from '../tooltip/internal.js';\nimport DismissButton from './dismiss-button';\nimport { TokenProps } from './interfaces';\n\nimport legacyTestingStyles from '../token-group/styles.css.js';\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 legacyTestingStyles.token,\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 getTrack={() => labelContainerRef.current}\n content={\n <LiveRegion>\n <span data-testid=\"tooltip-live-region-content\">{tooltipContent}</span>\n </LiveRegion>\n }\n onEscape={() => {\n setShowTooltip(false);\n }}\n />\n )}\n </div>\n );\n}\n\nexport default InternalToken;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tooltip/index.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C,OAAO,EAAE,YAAY,EAAE,CAAC;AAExB;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAAE,QAAgB,EAAE,GAAG,IAAI,EAAE,EAAE,YAAY,eAO1E"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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 InternalTooltip from './internal';
|
|
9
|
+
/**
|
|
10
|
+
* @awsuiSystem core
|
|
11
|
+
*/
|
|
12
|
+
export default function Tooltip({ position = 'top', ...rest }) {
|
|
13
|
+
const baseComponentProps = useBaseComponent('Tooltip', {
|
|
14
|
+
props: { position },
|
|
15
|
+
});
|
|
16
|
+
const externalProps = getExternalProps(rest);
|
|
17
|
+
return React.createElement(InternalTooltip, { position: position, ...externalProps, ...baseComponentProps });
|
|
18
|
+
}
|
|
19
|
+
applyDisplayName(Tooltip, 'Tooltip');
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tooltip/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,eAAe,MAAM,YAAY,CAAC;AAIzC;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAAE,QAAQ,GAAG,KAAK,EAAE,GAAG,IAAI,EAAgB;IACzE,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,SAAS,EAAE;QACrD,KAAK,EAAE,EAAE,QAAQ,EAAE;KACpB,CAAC,CAAC;IACH,MAAM,aAAa,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAE7C,OAAO,oBAAC,eAAe,IAAC,QAAQ,EAAE,QAAQ,KAAM,aAAa,KAAM,kBAAkB,GAAI,CAAC;AAC5F,CAAC;AACD,gBAAgB,CAAC,OAAO,EAAE,SAAS,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 { TooltipProps } from './interfaces';\nimport InternalTooltip from './internal';\n\nexport { TooltipProps };\n\n/**\n * @awsuiSystem core\n */\nexport default function Tooltip({ position = 'top', ...rest }: TooltipProps) {\n const baseComponentProps = useBaseComponent('Tooltip', {\n props: { position },\n });\n const externalProps = getExternalProps(rest);\n\n return <InternalTooltip position={position} {...externalProps} {...baseComponentProps} />;\n}\napplyDisplayName(Tooltip, 'Tooltip');\n"]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { NonCancelableEventHandler } from '../internal/events';
|
|
2
|
+
import { PopoverProps } from '../popover/interfaces';
|
|
3
|
+
export interface TooltipProps {
|
|
4
|
+
/**
|
|
5
|
+
* Content to display in the tooltip.
|
|
6
|
+
*/
|
|
7
|
+
content: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Function that returns the element the tooltip points to.
|
|
10
|
+
* Can return null if the element is not yet mounted or available.
|
|
11
|
+
*/
|
|
12
|
+
getTrack: () => null | HTMLElement | SVGElement;
|
|
13
|
+
/**
|
|
14
|
+
* Determines where the tooltip is displayed when opened, relative to the trigger. If the tooltip doesn't have enough space to open in this direction, it automatically chooses a better direction based on available space.
|
|
15
|
+
*/
|
|
16
|
+
position?: TooltipProps.Position;
|
|
17
|
+
/**
|
|
18
|
+
* Callback fired when the user presses the Escape key while the tooltip is visible.
|
|
19
|
+
*/
|
|
20
|
+
onEscape?: NonCancelableEventHandler;
|
|
21
|
+
}
|
|
22
|
+
export declare namespace TooltipProps {
|
|
23
|
+
/**
|
|
24
|
+
* Position of the tooltip relative to the tracked element.
|
|
25
|
+
*/
|
|
26
|
+
type Position = PopoverProps.Position;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Internal tooltip props - includes props not exposed in public API.
|
|
30
|
+
* Note: position defaults to 'top' in both index.tsx and internal.tsx
|
|
31
|
+
*/
|
|
32
|
+
export interface InternalTooltipProps extends TooltipProps {
|
|
33
|
+
/**
|
|
34
|
+
* Additional CSS class for the tooltip container.
|
|
35
|
+
*/
|
|
36
|
+
className?: string;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/tooltip/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IAEzB;;;OAGG;IACH,QAAQ,EAAE,MAAM,IAAI,GAAG,WAAW,GAAG,UAAU,CAAC;IAEhD;;OAEG;IACH,QAAQ,CAAC,EAAE,YAAY,CAAC,QAAQ,CAAC;IACjC;;OAEG;IACH,QAAQ,CAAC,EAAE,yBAAyB,CAAC;CACtC;AACD,yBAAiB,YAAY,CAAC;IAC5B;;OAEG;IACH,KAAY,QAAQ,GAAG,YAAY,CAAC,QAAQ,CAAC;CAC9C;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACxD;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/tooltip/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { NonCancelableEventHandler } from '../internal/events';\nimport { PopoverProps } from '../popover/interfaces';\n\nexport interface TooltipProps {\n /**\n * Content to display in the tooltip.\n */\n content: React.ReactNode;\n\n /**\n * Function that returns the element the tooltip points to.\n * Can return null if the element is not yet mounted or available.\n */\n getTrack: () => null | HTMLElement | SVGElement;\n\n /**\n * Determines where the tooltip is displayed when opened, relative to the trigger. If the tooltip doesn't have enough space to open in this direction, it automatically chooses a better direction based on available space.\n */\n position?: TooltipProps.Position;\n /**\n * Callback fired when the user presses the Escape key while the tooltip is visible.\n */\n onEscape?: NonCancelableEventHandler;\n}\nexport namespace TooltipProps {\n /**\n * Position of the tooltip relative to the tracked element.\n */\n export type Position = PopoverProps.Position;\n}\n\n/**\n * Internal tooltip props - includes props not exposed in public API.\n * Note: position defaults to 'top' in both index.tsx and internal.tsx\n */\nexport interface InternalTooltipProps extends TooltipProps {\n /**\n * Additional CSS class for the tooltip container.\n */\n className?: string;\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { InternalBaseComponentProps } from '../internal/hooks/use-base-component';
|
|
2
|
+
import { InternalTooltipProps } from './interfaces';
|
|
3
|
+
type InternalTooltipComponentProps = InternalTooltipProps & InternalBaseComponentProps;
|
|
4
|
+
export default function InternalTooltip({ content, getTrack, className, position, onEscape, __internalRootRef, ...restProps }: InternalTooltipComponentProps): JSX.Element;
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=internal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/tooltip/internal.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAIlF,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAIpD,KAAK,6BAA6B,GAAG,oBAAoB,GAAG,0BAA0B,CAAC;AAEvF,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EACtC,OAAO,EACP,QAAQ,EACR,SAAS,EACT,QAAgB,EAChB,QAAQ,EACR,iBAAiB,EACjB,GAAG,SAAS,EACb,EAAE,6BAA6B,eA+D/B"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import React, { useEffect } from 'react';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import { Portal } from '@cloudscape-design/component-toolkit/internal';
|
|
6
|
+
import { getBaseProps } from '../internal/base-component';
|
|
7
|
+
import { Transition } from '../internal/components/transition';
|
|
8
|
+
import { fireNonCancelableEvent } from '../internal/events';
|
|
9
|
+
import PopoverArrow from '../popover/arrow';
|
|
10
|
+
import PopoverBody from '../popover/body';
|
|
11
|
+
import PopoverContainer from '../popover/container';
|
|
12
|
+
import testUtilStyles from './test-classes/styles.css.js';
|
|
13
|
+
export default function InternalTooltip({ content, getTrack, className, position = 'top', onEscape, __internalRootRef, ...restProps }) {
|
|
14
|
+
const baseProps = getBaseProps(restProps);
|
|
15
|
+
const trackRef = React.useRef(null);
|
|
16
|
+
// Update the ref with the current tracked element
|
|
17
|
+
React.useEffect(() => {
|
|
18
|
+
const element = getTrack();
|
|
19
|
+
trackRef.current = element;
|
|
20
|
+
}, [getTrack]);
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
const controller = new AbortController();
|
|
23
|
+
window.addEventListener('keydown', (event) => {
|
|
24
|
+
if (event.key === 'Escape') {
|
|
25
|
+
// Prevent any surrounding modals or dialogs from acting on this Esc.
|
|
26
|
+
event.stopPropagation();
|
|
27
|
+
fireNonCancelableEvent(onEscape);
|
|
28
|
+
}
|
|
29
|
+
}, {
|
|
30
|
+
// The tooltip is often activated on mouseover, which means the focus can
|
|
31
|
+
// be anywhere else on the page. Capture also means that this gets called
|
|
32
|
+
// before any wrapper modals or dialogs can detect it and act on it.
|
|
33
|
+
capture: true,
|
|
34
|
+
signal: controller.signal,
|
|
35
|
+
});
|
|
36
|
+
return () => {
|
|
37
|
+
controller.abort();
|
|
38
|
+
};
|
|
39
|
+
}, [onEscape]);
|
|
40
|
+
return (React.createElement(Portal, null,
|
|
41
|
+
React.createElement("div", { ...baseProps, className: clsx(testUtilStyles.root, baseProps.className), ref: __internalRootRef, role: "tooltip" },
|
|
42
|
+
React.createElement(Transition, { in: true }, () => (React.createElement(PopoverContainer, { getTrack: getTrack, size: "medium", fixedWidth: false, position: position, zIndex: 7000, arrow: position => React.createElement(PopoverArrow, { position: position }), hideOnOverscroll: true, className: className },
|
|
43
|
+
React.createElement(PopoverBody, { dismissButton: false, dismissAriaLabel: undefined, onDismiss: undefined, header: undefined }, content)))))));
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=internal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/tooltip/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,MAAM,EAAE,MAAM,+CAA+C,CAAC;AAEvE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAC1C,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AAGpD,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAI1D,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EACtC,OAAO,EACP,QAAQ,EACR,SAAS,EACT,QAAQ,GAAG,KAAK,EAChB,QAAQ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QAAQ,EACb,UAAU,EAAE,KAAK,EACjB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,IAAI,EACZ,KAAK,EAAE,QAAQ,CAAC,EAAE,CAAC,oBAAC,YAAY,IAAC,QAAQ,EAAE,QAAQ,GAAI,EACvD,gBAAgB,EAAE,IAAI,EACtB,SAAS,EAAE,SAAS;gBAEpB,oBAAC,WAAW,IAAC,aAAa,EAAE,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,IACpG,OAAO,CACI,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, { useEffect } from 'react';\nimport clsx from 'clsx';\n\nimport { Portal } from '@cloudscape-design/component-toolkit/internal';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { Transition } from '../internal/components/transition';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport PopoverArrow from '../popover/arrow';\nimport PopoverBody from '../popover/body';\nimport PopoverContainer from '../popover/container';\nimport { InternalTooltipProps } from './interfaces';\n\nimport testUtilStyles from './test-classes/styles.css.js';\n\ntype InternalTooltipComponentProps = InternalTooltipProps & InternalBaseComponentProps;\n\nexport default function InternalTooltip({\n content,\n getTrack,\n className,\n position = 'top',\n onEscape,\n __internalRootRef,\n ...restProps\n}: InternalTooltipComponentProps) {\n const baseProps = getBaseProps(restProps);\n const trackRef = React.useRef<HTMLElement | SVGElement | null>(null);\n\n // Update the ref with the current tracked element\n React.useEffect(() => {\n const element = getTrack();\n trackRef.current = element;\n }, [getTrack]);\n\n useEffect(() => {\n const controller = new AbortController();\n window.addEventListener(\n 'keydown',\n (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n // Prevent any surrounding modals or dialogs from acting on this Esc.\n event.stopPropagation();\n fireNonCancelableEvent(onEscape);\n }\n },\n {\n // The tooltip is often activated on mouseover, which means the focus can\n // be anywhere else on the page. Capture also means that this gets called\n // before any wrapper modals or dialogs can detect it and act on it.\n capture: true,\n signal: controller.signal,\n }\n );\n return () => {\n controller.abort();\n };\n }, [onEscape]);\n\n return (\n <Portal>\n <div\n {...baseProps}\n className={clsx(testUtilStyles.root, baseProps.className)}\n ref={__internalRootRef}\n role=\"tooltip\"\n >\n <Transition in={true}>\n {() => (\n <PopoverContainer\n getTrack={getTrack}\n size=\"medium\"\n fixedWidth={false}\n position={position}\n zIndex={7000}\n arrow={position => <PopoverArrow position={position} />}\n hideOnOverscroll={true}\n className={className}\n >\n <PopoverBody dismissButton={false} dismissAriaLabel={undefined} onDismiss={undefined} header={undefined}>\n {content}\n </PopoverBody>\n </PopoverContainer>\n )}\n </Transition>\n </div>\n </Portal>\n );\n}\n"]}
|