@@ -76,13 +75,12 @@
:max="max"
:pattern="pattern"
:class="[
- 'px-3 py-2',
`w-full text-gray-800 type-small-400 caret-gray-300 placeholder-gray-200 placeholder:type-small-400 outline-none ${inputClass}`,
{ nonErrorAutofill: !disabled && !readonly },
{ truncate: withCopyButton },
- { 'bg-green-50 !placeholder-success-dark': success },
+ { 'bg-green-50 !placeholder-green-700': success },
{
- 'bg-red-50 !placeholder-error-dark !autofill:bg-red-50 errorAutofill':
+ 'bg-red-50 !placeholder-red-600 !autofill:bg-red-50 errorAutofill':
error
},
{
@@ -94,19 +92,18 @@
:required="required"
:placeholder="placeholder"
:readonly="readonly"
- @input="handleInput"
- @focus="handleFocus"
- @blur="$emit('blur', $event)"
- @change="$emit('change', $event)"
- @invalid="$emit('invalid', $event.target)"
+ @input="onInput"
+ @focus="onFocus"
+ @blur="onBlur"
+ @change="onChange"
+ @invalid="onInvalid"
/>
@@ -135,7 +131,7 @@
-
diff --git a/src/components/TextInput/__tests__/TextInput.spec.ts b/src/components/TextInput/__tests__/TextInput.spec.js
similarity index 94%
rename from src/components/TextInput/__tests__/TextInput.spec.ts
rename to src/components/TextInput/__tests__/TextInput.spec.js
index 0ac1d2998..8e54faecf 100644
--- a/src/components/TextInput/__tests__/TextInput.spec.ts
+++ b/src/components/TextInput/__tests__/TextInput.spec.js
@@ -1,5 +1,5 @@
import '@testing-library/jest-dom';
-import { render, fireEvent, RenderResult } from '@testing-library/vue';
+import { render, fireEvent } from '@testing-library/vue';
import TextInput from '../TextInput.vue';
import userEvent from '@testing-library/user-event';
@@ -60,7 +60,7 @@ describe('Text input', () => {
});
const textInput = getByTestId('input-container');
- expect(textInput).toHaveClass('!border-error-dark');
+ expect(textInput).toHaveClass('!border-red-600');
});
it('updates the v-model on text input', async () => {
@@ -68,7 +68,7 @@ describe('Text input', () => {
const { getByLabelText } = render(TextInput, {
props
});
- const textInput = getByLabelText(props.label) as HTMLInputElement;
+ const textInput = getByLabelText(props.label);
await fireEvent.update(textInput, 'hello!');
expect(textInput.value).toEqual('hello!');
@@ -99,7 +99,7 @@ describe('Text input', () => {
props
});
- const textInput = getByLabelText(props.label) as HTMLInputElement;
+ const textInput = getByLabelText(props.label);
const updatedValue = 'hello!';
await fireEvent.update(textInput, updatedValue);
@@ -140,7 +140,7 @@ describe('Text input', () => {
};
const { getByRole, getByLabelText } = render(TextInput, { props });
- const textInput = getByLabelText(props.label) as HTMLInputElement;
+ const textInput = getByLabelText(props.label);
const updatedValue = 'hello!';
await fireEvent.update(textInput, updatedValue);
@@ -186,7 +186,7 @@ describe('Text input', () => {
});
describe('with Copy Button', () => {
- let component: RenderResult;
+ let component;
beforeEach(async () => {
const props = {
...initialProps,
diff --git a/tsconfig.json b/tsconfig.json
index eed6ac681..d30c67cb0 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -12,7 +12,7 @@
"experimentalDecorators": true,
"skipLibCheck": true,
"lib": ["esnext", "dom"],
- "types": ["vitest/globals", "vite/client", "jest"],
+ "types": ["vite/client", "jest"],
"resolveJsonModule": true,
"baseUrl": ".",
"paths": {