Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
5 changes: 5 additions & 0 deletions .changeset/eleven-cars-obey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@leafygreen-ui/text-input': patch
---

Fixes props such that component now accepts a properly typed `ref`
2 changes: 1 addition & 1 deletion packages/emotion/src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '5.0.2';
export const VERSION = '5.0.3';
11 changes: 8 additions & 3 deletions packages/text-area/src/TextArea/TextArea.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,14 @@ describe('packages/text-area', () => {
});
});

/* eslint-disable jest/no-disabled-tests */
describe.skip('types behave as expected', () => {
test('TextArea throws error when neither aria-labelledby or label is supplied', () => {
describe('types behave as expected', () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious why the skip was moved here and removed entirely from packages/text-input/src/TextInput/TextInput.spec.tsx. Seems inconsistent and perhaps a mistake?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically should still be skipped, since there's no expect statement

test('TextArea takes a ref for a HTMLTextAreaElement', () => {
const ref = React.createRef<HTMLTextAreaElement>();
render(<TextArea label="Some label" ref={ref} />);
});

/* eslint-disable jest/no-disabled-tests */
test.skip('TextArea throws error when neither aria-labelledby or label is supplied', () => {
// @ts-expect-error
<TextArea />;
<TextArea label="Some label" />;
Expand Down
9 changes: 6 additions & 3 deletions packages/text-input/src/TextInput/TextInput.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,12 @@ describe('packages/text-input', () => {
});
});

/* eslint-disable jest/no-disabled-tests */
describe.skip('types behave as expected', () => {
describe('types behave as expected', () => {
test('TextInput takes a ref for a HTMLInputElement', () => {
const ref = React.createRef<HTMLInputElement>();
render(<TextInput label="some label" ref={ref} />);
});

test('TextInput throws error when no label is supplied', () => {
// @ts-expect-error
<TextInput />;
Expand All @@ -246,5 +250,4 @@ describe('packages/text-input', () => {
<TextInput type="search" aria-labelledby="some label" />;
});
});
/* eslint-enable jest/no-disabled-tests */
});
2 changes: 1 addition & 1 deletion packages/text-input/src/TextInput/TextInput.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ interface TextInputTypeProp {
type?: TextInputType;
}
export interface BaseTextInputProps
extends Omit<React.ComponentPropsWithoutRef<'input'>, AriaLabels>,
extends Omit<React.ComponentPropsWithRef<'input'>, AriaLabels>,
DarkModeProps,
LgIdProps {
/**
Expand Down
3 changes: 3 additions & 0 deletions tools/install/src/ALL_PACKAGES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const ALL_PACKAGES = [
'@leafygreen-ui/avatar',
'@leafygreen-ui/badge',
'@leafygreen-ui/banner',
'@leafygreen-ui/box',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to rm the /box dir from your file system in order to prevent this

'@leafygreen-ui/button',
'@leafygreen-ui/callout',
'@leafygreen-ui/card',
Expand Down Expand Up @@ -83,12 +84,14 @@ export const ALL_PACKAGES = [
'@lg-charts/legend',
'@lg-charts/series-provider',
'@lg-chat/avatar',
'@lg-chat/chat-disclaimer',
'@lg-chat/chat-window',
'@lg-chat/fixed-chat-window',
'@lg-chat/input-bar',
'@lg-chat/leafygreen-chat-provider',
'@lg-chat/lg-markdown',
'@lg-chat/message',
'@lg-chat/message-actions',
'@lg-chat/message-feed',
'@lg-chat/message-feedback',
'@lg-chat/message-prompts',
Expand Down
Loading