Skip to content

Commit 12c6275

Browse files
Remove support for inset text optional visually hidden text
1 parent dcbdba0 commit 12c6275

File tree

3 files changed

+3
-36
lines changed

3 files changed

+3
-36
lines changed

src/components/content-presentation/inset-text/InsetText.tsx

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,9 @@
11
import React, { FC, HTMLProps } from 'react';
22
import classNames from 'classnames';
33

4-
interface InsetTextProps extends HTMLProps<HTMLDivElement> {
5-
visuallyHiddenText?: string | false;
6-
}
7-
8-
const InsetTextComponent: FC<InsetTextProps> = ({
9-
className,
10-
children,
11-
visuallyHiddenText = 'Information: ',
12-
...rest
13-
}) => (
4+
const InsetTextComponent: FC<HTMLProps<HTMLDivElement>> = ({ className, children, ...rest }) => (
145
<div className={classNames('nhsuk-inset-text', className)} {...rest}>
15-
{visuallyHiddenText ? (
16-
<span className="nhsuk-u-visually-hidden">{visuallyHiddenText}</span>
17-
) : null}
6+
<span className="nhsuk-u-visually-hidden">Information: </span>
187
{children}
198
</div>
209
);

src/components/content-presentation/inset-text/__tests__/InsetText.test.tsx

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,6 @@ describe('InsetText', () => {
1515
expect(container.querySelector('.nhsuk-u-visually-hidden')?.textContent).toBe('Information: ');
1616
});
1717

18-
it('has disabled visually hidden text', () => {
19-
const { container } = render(<InsetText visuallyHiddenText={false} />);
20-
21-
expect(container.querySelector('.nhsuk-u-visually-hidden')).toBeFalsy();
22-
});
23-
24-
it('has custom visually hidden text', () => {
25-
const { container } = render(<InsetText visuallyHiddenText="Custom" />);
26-
27-
expect(container.querySelector('.nhsuk-u-visually-hidden')?.textContent).toBe('Custom');
28-
});
29-
3018
it('renders children', () => {
3119
const { container } = render(<InsetText>Child</InsetText>);
3220

stories/Content Presentation/InsetText.stories.tsx

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,4 @@ const meta: Meta<typeof InsetText> = {
2020
export default meta;
2121
type Story = StoryObj<typeof InsetText>;
2222

23-
export const Standard: Story = { argTypes: { visuallyHiddenText: { table: { disable: true } } } };
24-
export const WithCustomHiddenText: Story = {
25-
args: {
26-
visuallyHiddenText: 'Hidden Text: ',
27-
},
28-
};
29-
export const WithDisabledHiddenText: Story = {
30-
args: {
31-
visuallyHiddenText: false,
32-
},
33-
};
23+
export const Standard: Story = {};

0 commit comments

Comments
 (0)