Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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<React.HTMLAttributes<HTMLElement>, "children"> & Record<\`data-\${string}\`, string>",
"type": "union",
"values": [
"Omit<React.HTMLAttributes<HTMLElement>, "children">",
"Record<\`data-\${string}\`, string>",
],
},
"name": "nativeAttributes",
"optional": true,
"systemTags": [
"core",
],
"type": "Omit<React.HTMLAttributes<HTMLElement>, "children"> & Record<\`data-\${string}\`, string>",
},
{
"defaultValue": "'success'",
"description": "Specifies the status type.",
Expand Down
14 changes: 0 additions & 14 deletions src/status-indicator/__tests__/status-indicator.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(<StatusIndicator type="info" nativeAttributes={{ 'data-testid': 'my-test-id' }} />);
expect(container.querySelectorAll('[data-testid="my-test-id"]')).toHaveLength(1);
});
it('concatenates class names', () => {
const { container } = render(
<StatusIndicator type="info" nativeAttributes={{ className: 'additional-class' }} />
);
expect(container.firstChild).toHaveClass(styles.root);
expect(container.firstChild).toHaveClass('additional-class');
});
});
});
23 changes: 2 additions & 21 deletions src/status-indicator/internal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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<React.HTMLAttributes<HTMLElement>>;
}

export interface InternalStatusIndicatorProps
Expand Down Expand Up @@ -95,7 +80,6 @@ export default function StatusIndicator({
iconAriaLabel,
colorOverride,
wrapText = true,
nativeAttributes,
__animate = false,
__internalRootRef,
__size = 'normal',
Expand All @@ -104,11 +88,8 @@ export default function StatusIndicator({
}: InternalStatusIndicatorProps) {
const baseProps = getBaseProps(rest);
return (
<WithNativeAttributes
<span
{...baseProps}
tag="span"
componentName="StatusIndicator"
nativeAttributes={nativeAttributes}
className={clsx(
styles.root,
styles[`status-${type}`],
Expand Down Expand Up @@ -137,6 +118,6 @@ export default function StatusIndicator({
</span>
{children}
</span>
</WithNativeAttributes>
</span>
);
}
Loading