From 4e01e109580db590c15c74047199ff4b0810b6a8 Mon Sep 17 00:00:00 2001 From: Gethin Webster Date: Mon, 15 Sep 2025 17:00:53 +0200 Subject: [PATCH] revert: "feat: Native attributes for status indicator (#3843)" This reverts commit 972aa7cf387e0f902f412622272c8fb712855181. --- .../__snapshots__/documenter.test.ts.snap | 22 ------------------ .../__tests__/status-indicator.test.tsx | 14 ----------- src/status-indicator/internal.tsx | 23 ++----------------- 3 files changed, 2 insertions(+), 57 deletions(-) diff --git a/src/__tests__/snapshot-tests/__snapshots__/documenter.test.ts.snap b/src/__tests__/snapshot-tests/__snapshots__/documenter.test.ts.snap index f15253c3d8..00180c5050 100644 --- a/src/__tests__/snapshot-tests/__snapshots__/documenter.test.ts.snap +++ b/src/__tests__/snapshot-tests/__snapshots__/documenter.test.ts.snap @@ -22584,28 +22584,6 @@ use the \`id\` attribute, consider setting it on a parent element instead.", "optional": true, "type": "string", }, - { - "description": "Attributes to add to the native element. -Some attributes will be automatically combined with internal attribute values: -- \`className\` will be appended. -- Event handlers will be chained, unless the default is prevented. - -We do not support using this attribute to apply custom styling.", - "inlineType": { - "name": "Omit, "children"> & Record<\`data-\${string}\`, string>", - "type": "union", - "values": [ - "Omit, "children">", - "Record<\`data-\${string}\`, string>", - ], - }, - "name": "nativeAttributes", - "optional": true, - "systemTags": [ - "core", - ], - "type": "Omit, "children"> & Record<\`data-\${string}\`, string>", - }, { "defaultValue": "'success'", "description": "Specifies the status type.", diff --git a/src/status-indicator/__tests__/status-indicator.test.tsx b/src/status-indicator/__tests__/status-indicator.test.tsx index c5fd14c2bd..8211af1be0 100644 --- a/src/status-indicator/__tests__/status-indicator.test.tsx +++ b/src/status-indicator/__tests__/status-indicator.test.tsx @@ -34,18 +34,4 @@ describe('StatusIndicator', () => { const statusIndicatorWrapper = createWrapper(container.parentElement!).findStatusIndicator()!; expect(statusIndicatorWrapper.findByClassName(styles.icon)!.getElement()).toHaveAttribute('aria-label', ariaLabel); }); - - describe('native attributes', () => { - it('adds native attributes', () => { - const { container } = render(); - expect(container.querySelectorAll('[data-testid="my-test-id"]')).toHaveLength(1); - }); - it('concatenates class names', () => { - const { container } = render( - - ); - expect(container.firstChild).toHaveClass(styles.root); - expect(container.firstChild).toHaveClass('additional-class'); - }); - }); }); diff --git a/src/status-indicator/internal.tsx b/src/status-indicator/internal.tsx index a0ee492c07..790b49afd8 100644 --- a/src/status-indicator/internal.tsx +++ b/src/status-indicator/internal.tsx @@ -8,10 +8,6 @@ import InternalIcon from '../icon/internal'; import { BaseComponentProps, getBaseProps } from '../internal/base-component'; import { InternalBaseComponentProps } from '../internal/hooks/use-base-component'; import { SomeRequired } from '../internal/types'; -/** - * @awsuiSystem core - */ -import WithNativeAttributes, { NativeAttributes } from '../internal/utils/with-native-attributes'; import InternalSpinner from '../spinner/internal'; import styles from './styles.css.js'; @@ -50,17 +46,6 @@ export interface StatusIndicatorProps extends BaseComponentProps { * and truncates it with an ellipsis. */ wrapText?: boolean; - /** - * Attributes to add to the native element. - * Some attributes will be automatically combined with internal attribute values: - * - `className` will be appended. - * - Event handlers will be chained, unless the default is prevented. - * - * We do not support using this attribute to apply custom styling. - * - * @awsuiSystem core - */ - nativeAttributes?: NativeAttributes>; } export interface InternalStatusIndicatorProps @@ -95,7 +80,6 @@ export default function StatusIndicator({ iconAriaLabel, colorOverride, wrapText = true, - nativeAttributes, __animate = false, __internalRootRef, __size = 'normal', @@ -104,11 +88,8 @@ export default function StatusIndicator({ }: InternalStatusIndicatorProps) { const baseProps = getBaseProps(rest); return ( - {children} - + ); }