Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(textfield): add experimental react wrapper #5468

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
19 changes: 19 additions & 0 deletions textfield/tsx/filled-text-field.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* @license
* Copyright 2024 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/

import * as React from 'react';
import {createComponent} from '@lit/react';
import {MdFilledTextField} from '../filled-text-field.js';
import {events} from './internal/events.js';
export type {MdFilledTextField} from '../filled-text-field.js';

// tslint:disable-next-line
export const FilledTextField = createComponent({
tagName: 'md-filled-text-field',
elementClass: MdFilledTextField,
events,
react: React,
});
13 changes: 13 additions & 0 deletions textfield/tsx/internal/events.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* @license
* Copyright 2024 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/

import {EventName} from '@lit/react';

// tslint:disable-next-line
export const events = {
onChange: 'change',
onInput: 'input' as EventName<InputEvent>,
} as const;
19 changes: 19 additions & 0 deletions textfield/tsx/outlined-text-field.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* @license
* Copyright 2024 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/

import * as React from 'react';
import {createComponent} from '@lit/react';
import {MdOutlinedTextField} from '../outlined-text-field.js';
import {events} from './internal/events.js';
export type {MdOutlinedTextField} from '../outlined-text-field.js';

// tslint:disable-next-line
export const OutlinedTextField = createComponent({
tagName: 'md-outlined-text-field',
elementClass: MdOutlinedTextField,
events,
react: React,
});
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"exclude": [
"catalog",
"**/demo",
"**/tsx",
"scripts/"
]
}
Loading