jb-input
Version:
input web component with built in validation
30 lines (29 loc) • 1.25 kB
TypeScript
import React, { DetailedHTMLProps, HTMLAttributes } from 'react';
import 'jb-input';
import { JBInputWebComponent, JBInputEventType } from 'jb-input';
import { type JBInputEvents, useJBInputEvents } from './events-hook.js';
import { type JBInputAttributes, useJBInputAttribute } from './attributes-hook.js';
export { JBInputEvents, useJBInputEvents, JBInputAttributes, useJBInputAttribute, JBInputEventType };
interface JBInputType extends DetailedHTMLProps<HTMLAttributes<JBInputWebComponent>, JBInputWebComponent> {
class?: string;
label?: string;
name?: string;
message?: string;
placeholder?: string;
}
declare global {
namespace JSX {
interface IntrinsicElements {
'jb-input': JBInputType;
}
}
}
export declare const JBInput: React.ForwardRefExoticComponent<JBInputEvents<JBInputWebComponent> & JBInputAttributes & {
className?: string;
children?: React.ReactNode | React.ReactNode[];
} & React.RefAttributes<unknown>>;
export type BaseProps<T extends JBInputWebComponent> = JBInputEvents<T> & JBInputAttributes & {
className?: string;
children?: React.ReactNode | React.ReactNode[];
};
export type Props = BaseProps<JBInputWebComponent>;