Skip to content

Commit 08da1c8

Browse files
revert: "feat: Native attributes for status indicator (#3843)" (#3866)
1 parent 972aa7c commit 08da1c8

File tree

3 files changed

+2
-57
lines changed

3 files changed

+2
-57
lines changed

src/__tests__/snapshot-tests/__snapshots__/documenter.test.ts.snap

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22584,28 +22584,6 @@ use the \`id\` attribute, consider setting it on a parent element instead.",
2258422584
"optional": true,
2258522585
"type": "string",
2258622586
},
22587-
{
22588-
"description": "Attributes to add to the native element.
22589-
Some attributes will be automatically combined with internal attribute values:
22590-
- \`className\` will be appended.
22591-
- Event handlers will be chained, unless the default is prevented.
22592-
22593-
We do not support using this attribute to apply custom styling.",
22594-
"inlineType": {
22595-
"name": "Omit<React.HTMLAttributes<HTMLElement>, "children"> & Record<\`data-\${string}\`, string>",
22596-
"type": "union",
22597-
"values": [
22598-
"Omit<React.HTMLAttributes<HTMLElement>, "children">",
22599-
"Record<\`data-\${string}\`, string>",
22600-
],
22601-
},
22602-
"name": "nativeAttributes",
22603-
"optional": true,
22604-
"systemTags": [
22605-
"core",
22606-
],
22607-
"type": "Omit<React.HTMLAttributes<HTMLElement>, "children"> & Record<\`data-\${string}\`, string>",
22608-
},
2260922587
{
2261022588
"defaultValue": "'success'",
2261122589
"description": "Specifies the status type.",

src/status-indicator/__tests__/status-indicator.test.tsx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,4 @@ describe('StatusIndicator', () => {
3434
const statusIndicatorWrapper = createWrapper(container.parentElement!).findStatusIndicator()!;
3535
expect(statusIndicatorWrapper.findByClassName(styles.icon)!.getElement()).toHaveAttribute('aria-label', ariaLabel);
3636
});
37-
38-
describe('native attributes', () => {
39-
it('adds native attributes', () => {
40-
const { container } = render(<StatusIndicator type="info" nativeAttributes={{ 'data-testid': 'my-test-id' }} />);
41-
expect(container.querySelectorAll('[data-testid="my-test-id"]')).toHaveLength(1);
42-
});
43-
it('concatenates class names', () => {
44-
const { container } = render(
45-
<StatusIndicator type="info" nativeAttributes={{ className: 'additional-class' }} />
46-
);
47-
expect(container.firstChild).toHaveClass(styles.root);
48-
expect(container.firstChild).toHaveClass('additional-class');
49-
});
50-
});
5137
});

src/status-indicator/internal.tsx

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ import InternalIcon from '../icon/internal';
88
import { BaseComponentProps, getBaseProps } from '../internal/base-component';
99
import { InternalBaseComponentProps } from '../internal/hooks/use-base-component';
1010
import { SomeRequired } from '../internal/types';
11-
/**
12-
* @awsuiSystem core
13-
*/
14-
import WithNativeAttributes, { NativeAttributes } from '../internal/utils/with-native-attributes';
1511
import InternalSpinner from '../spinner/internal';
1612

1713
import styles from './styles.css.js';
@@ -50,17 +46,6 @@ export interface StatusIndicatorProps extends BaseComponentProps {
5046
* and truncates it with an ellipsis.
5147
*/
5248
wrapText?: boolean;
53-
/**
54-
* Attributes to add to the native element.
55-
* Some attributes will be automatically combined with internal attribute values:
56-
* - `className` will be appended.
57-
* - Event handlers will be chained, unless the default is prevented.
58-
*
59-
* We do not support using this attribute to apply custom styling.
60-
*
61-
* @awsuiSystem core
62-
*/
63-
nativeAttributes?: NativeAttributes<React.HTMLAttributes<HTMLElement>>;
6449
}
6550

6651
export interface InternalStatusIndicatorProps
@@ -95,7 +80,6 @@ export default function StatusIndicator({
9580
iconAriaLabel,
9681
colorOverride,
9782
wrapText = true,
98-
nativeAttributes,
9983
__animate = false,
10084
__internalRootRef,
10185
__size = 'normal',
@@ -104,11 +88,8 @@ export default function StatusIndicator({
10488
}: InternalStatusIndicatorProps) {
10589
const baseProps = getBaseProps(rest);
10690
return (
107-
<WithNativeAttributes
91+
<span
10892
{...baseProps}
109-
tag="span"
110-
componentName="StatusIndicator"
111-
nativeAttributes={nativeAttributes}
11293
className={clsx(
11394
styles.root,
11495
styles[`status-${type}`],
@@ -137,6 +118,6 @@ export default function StatusIndicator({
137118
</span>
138119
{children}
139120
</span>
140-
</WithNativeAttributes>
121+
</span>
141122
);
142123
}

0 commit comments

Comments
 (0)