renders without tokens 1`] = `
diff --git a/packages/react/src/TooltipV2/Tooltip.tsx b/packages/react/src/TooltipV2/Tooltip.tsx
index a8cfaae6928..ad347d927b4 100644
--- a/packages/react/src/TooltipV2/Tooltip.tsx
+++ b/packages/react/src/TooltipV2/Tooltip.tsx
@@ -348,6 +348,7 @@ export const Tooltip: ForwardRefExoticComponent<
className={clsx(className, classes.Tooltip)}
ref={tooltipElRef}
data-direction={calculatedDirection}
+ data-component="Tooltip"
{...rest}
// Only need tooltip role if the tooltip is a description for supplementary information
role={type === 'description' ? 'tooltip' : undefined}
@@ -379,6 +380,7 @@ export const Tooltip: ForwardRefExoticComponent<
keybindingHints.length > 1 && classes.HasMultipleHints,
)}
aria-hidden
+ data-component="Tooltip.KeybindingHintContainer"
>
{keybindingHints.map((hint, i) => (
diff --git a/packages/react/src/TooltipV2/__tests__/Tooltip.test.tsx b/packages/react/src/TooltipV2/__tests__/Tooltip.test.tsx
index 9d914c6b007..a2755af56f0 100644
--- a/packages/react/src/TooltipV2/__tests__/Tooltip.test.tsx
+++ b/packages/react/src/TooltipV2/__tests__/Tooltip.test.tsx
@@ -202,3 +202,17 @@ describe('Tooltip', () => {
expect(describedBy).toContain(tooltipEl.id)
})
})
+
+describe('Tooltip data-component attributes', () => {
+ it('renders Tooltip with data-component attribute', () => {
+ const {getByText} = HTMLRender()
+ const tooltip = getByText('Tooltip text')
+ expect(tooltip).toHaveAttribute('data-component', 'Tooltip')
+ })
+
+ it('renders Tooltip.KeybindingHintContainer with data-component attribute when keybindingHint is provided', () => {
+ const {container} = HTMLRender()
+ const keybindingHintContainer = container.querySelector('[data-component="Tooltip.KeybindingHintContainer"]')
+ expect(keybindingHintContainer).toBeInTheDocument()
+ })
+})
diff --git a/packages/react/src/internal/components/TextInputInnerAction.tsx b/packages/react/src/internal/components/TextInputInnerAction.tsx
index 22d45d0b6d0..e6d67cc63c9 100644
--- a/packages/react/src/internal/components/TextInputInnerAction.tsx
+++ b/packages/react/src/internal/components/TextInputInnerAction.tsx
@@ -75,7 +75,7 @@ const TextInputAction = forwardRef(
}
return (
-
+
{icon && !children && ariaLabel ? (
-> = ({children, hasLoadingIndicator, showLoadingIndicator, visualPosition, id}) => {
+> = ({children, hasLoadingIndicator, showLoadingIndicator, visualPosition, id, componentPrefix = 'TextInput'}) => {
const isLeading = visualPosition === 'leading'
if ((!children && !hasLoadingIndicator) || (isLeading && !children && !showLoadingIndicator)) {
return null
@@ -24,14 +28,22 @@ const TextInputInnerVisualSlot: React.FC<
if (!hasLoadingIndicator) {
return (
-
+
{children}
)
}
return (
-
+
{children && (
{children}
diff --git a/packages/react/src/internal/components/TextInputWrapper.tsx b/packages/react/src/internal/components/TextInputWrapper.tsx
index a88bb698e3d..c66313bb74a 100644
--- a/packages/react/src/internal/components/TextInputWrapper.tsx
+++ b/packages/react/src/internal/components/TextInputWrapper.tsx
@@ -78,6 +78,7 @@ export const TextInputBaseWrapper = React.forwardRef
)