# @kolloqe/input

> react-kbi-si-en React component

Latest version **1.0.0** (published 2022-07-27) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @kolloqe/input
pnpm add @kolloqe/input
yarn add @kolloqe/input
bun add @kolloqe/input
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2022-07-27 |
| First published | 2022-07-27 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 2.8 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Dinushi Jayasinghe |
| Maintainers | dinushitj, thisisishara |
| Keywords | kolloqe, rasa, input, mui, sinhala, code-switching |

## Links

- npm: https://www.npmjs.com/package/@kolloqe/input
- Repository: https://github.com/kolloqe/react-kbi-si-en
- Homepage: https://github.com/kolloqe/react-kbi-si-en#readme
- Issues: https://github.com/kolloqe/react-kbi-si-en/issues
- npm.io page: https://npm.io/package/@kolloqe/input

## Dependencies (3)

- [@mui/material](https://npm.io/package/@mui/material.md) ^5.9.2
- [@emotion/react](https://npm.io/package/@emotion/react.md) ^11.9.3
- [@emotion/styled](https://npm.io/package/@emotion/styled.md) ^11.9.3

## Recent versions

- 1.0.0 (latest) — 2022-07-27

## README

# react-kbi-si-en

Kolloqe Input Component with code-switching support between Sinhala and English

## Setting up the Dev Environmet

The original package was created using [`nwb`](https://github.com/insin/nwb/blob/master/docs/guides/ReactComponents.md). So, to set up a dev environment, the `node_modules` dir initialized using `nwb new react-component` is required to begin with.

- Clone this repo
- Simply run `nwb new react-component cache` to create a cache project
- Copy-paste the `node_modules` dir to the root of the project
- Get rid of the cached project `cache`
- Run `npm i` to install additional packages
- Run `npm start` to run the dev server
- This project adhears to all the commands executable inside a `nwb new react-component` project
    1. `npm start` - runs the demo
    2. `npm run build` - builds modules
    3. `npm publish` - builds and publishes to npm (set up the package.json accordingly)

## Releasing

- When the version is bumped, first do the versioning in the package.json
- run `npm run build` to build the latest build. (This is optional. `npm publish` can take care of this internally)
- run `npm publish` to get the transpiled js modules and push to npmjs

## Usage in a React Project

The component can be easily consumed within a React project as given below.  

### Installation

The package can be pulled from NPM as follows.

```bash
npm i @kolloqe/input
```

Then can be attached to any React component as specified below.

```jsx
import KeyboardInput from '@kolloqe/input';

<KeyboardInput
  interface={"input"}
  value={""}
  placeholder="Type a message here..."
  className={"w-100 kolloqe-widget-message"}
  disableUnderline={true}
  defaultLanguage={localStorage.getItem(`${localStorageKeys.kolloqeSelectedLang}`) || this.props.defaultLang}
  ref={messageRef => this.messageRef = messageRef}
  handleChange={(e) => { this.handleMessageChange(e) }}
  handleTextChange={this.handleMessageChangeText}
  handleShortcut={this.handleLanguage}
  handleEnter={this.handleMessageSend}
  enableShortcuts={this.props.enableShortcuts}
  shortcutKey={this.props.shortcutKey} />
```

## List of Props

{To be updated}
Refer the [Official Docs](https://kolloqe.github.io) for more details on passing props to kolloqe input component.

- All props are similar to the MUI Input/ Textfield API. Refer the MUI docs: [Input API](https://mui.com/material-ui/api/input/) / [TextField API](https://mui.com/material-ui/api/text-field/)

## Limitations

- Styling is not supported via props. It should be done manually through overriding relevent CSS classes for now.

---
_Source: https://npm.io/package/@kolloqe/input · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
