{"_rev":"9-c7c17c48ff8832ab857cf30009b56e98","time":{"created":"2024-07-24T13:06:19.428Z","modified":"2024-07-24T13:06:20.029Z","1.2.0":"2023-09-04T10:30:44.591Z","1.2.1":"2023-09-04T10:56:25.027Z","1.2.2":"2023-09-06T11:16:55.253Z","1.2.3":"2023-09-13T12:51:03.077Z","1.2.4":"2023-10-09T12:38:59.821Z","1.2.5":"2023-10-09T13:04:53.703Z","1.3.0":"2023-10-10T11:16:38.453Z","1.3.1":"2024-07-24T13:06:19.734Z"},"_id":"@autosys/react-mui-keyboard","name":"@autosys/react-mui-keyboard","dist-tags":{"latest":"1.3.1"},"versions":{"1.3.1":{"name":"@autosys/react-mui-keyboard","version":"1.3.1","repository":{"type":"git","url":"git+https://github.com/autonomous-systems/react-mui-keyboard.git"},"license":"MIT","author":{"name":"KirillRamzaev","email":"k.ramzaev@auto-sys.su","url":"https://github.com/autonomous-systems"},"dependencies":{"@emotion/react":"11.11.1","@emotion/styled":"11.11.0","@mui/base":"^5.0.0-beta.14","@mui/icons-material":"5.14.8","@mui/material":"5.14.8"},"scripts":{"clean":"rm -rf dist/","build":"yarn clean && yarn build:esm && yarn build:cjs","build:esm":"tsc","build:cjs":"tsc --module commonjs --outDir dist/cjs","test":"jest","prepare":"yarn build"},"peerDependencies":{"@types/react":"^17.0.0 || ^18.0.0","@types/react-dom":"^17.0.0 || ^18.0.0","react":"^17.0.0 || ^18.0.0","react-dom":"^17.0.0 || ^18.0.0"},"keywords":["react","typescript","material-ui","material-ui-keyboard","mui-keyboard","mui"],"browserslist":{"production":[">0.2%","not dead","not op_mini all"],"development":["last 1 chrome version","last 1 firefox version","last 1 safari version"]},"devDependencies":{"@testing-library/jest-dom":"5.11.9","@testing-library/react":"14.0.0","@types/jest":"^29.5.3","@types/react":"18.2.21","@types/react-dom":"18.2.7","functions-have-names":"^1.2.3","jest":"29.7.0","jest-canvas-mock":"^2.5.2","jest-environment-jsdom":"29.7.0","prettier":"^3.0.3","react":"18.2.0","react-dom":"18.2.0","ts-jest":"^29.1.1","tslib":"^2.6.2","typescript":"5.2.2","web-vitals":"3.4.0"},"main":"./dist/cjs/index.js","module":"./dist/esm/index.js","types":"./dist/esm/index.d.ts","description":"This is an example application featuring a virtual on-screen keyboard, developed using React and Material-UI (MUI).","licenseText":"The MIT License (MIT)\n\nCopyright (c) 2024 Kirill Ramzaev\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@autosys/react-mui-keyboard@1.3.1","dist":{"shasum":"2f211f4ed744a31cccac787d5aadb4bea7be1d80","integrity":"sha512-WkL9zEhVgZ9wTQWaUwdYEPbkxHaiAZ/O4ifWeJVfnCGvTzEy2w2xzktDr7RdTL/p1Rl+1AnVDTt8aWs5ZyriNw==","tarball":"https://registry.npmjs.org/@autosys/react-mui-keyboard/-/react-mui-keyboard-1.3.1.tgz","fileCount":117,"unpackedSize":101472,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHepW+TZqMM9TRi2BWBHoOv7l37Tqcdyq2glL3TbltKBAiBUiOqJOPFgald+QPL1nCplmT628pn6UPeaK8RvOQOY5w=="}]},"_npmUser":{"name":"ramziij","email":"k.ramzaev@auto-sys.su"},"directories":{},"maintainers":[{"name":"ramziij","email":"k.ramzaev@auto-sys.su"},{"name":"auto-sys","email":"a.gotovcev@auto-sys.su"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-mui-keyboard_1.3.1_1721826379545_0.2890579850329136"},"_hasShrinkwrap":false}},"maintainers":[{"name":"ramziij","email":"k.ramzaev@auto-sys.su"},{"name":"auto-sys","email":"a.gotovcev@auto-sys.su"}],"description":"This is an example application featuring a virtual on-screen keyboard, developed using React and Material-UI (MUI).","keywords":["react","typescript","material-ui","material-ui-keyboard","mui-keyboard","mui"],"repository":{"type":"git","url":"git+https://github.com/autonomous-systems/react-mui-keyboard.git"},"author":{"name":"KirillRamzaev","email":"k.ramzaev@auto-sys.su","url":"https://github.com/autonomous-systems"},"license":"MIT","readme":"# On-Screen Keyboard App\n\nThis is an example application featuring a virtual on-screen keyboard, developed using React and Material-UI (MUI).\n\n![TypeScript](https://img.shields.io/badge/typescript-%23007ACC.svg?style=for-the-badge&logo=typescript&logoColor=white)\n![React](https://img.shields.io/badge/react-%2320232a.svg?style=for-the-badge&logo=react&logoColor=%2361DAFB)\n![MUI](https://img.shields.io/badge/MUI-%230081CB.svg?style=for-the-badge&logo=mui&logoColor=white)\n\n![Yarn](https://img.shields.io/badge/yarn-%232C8EBB.svg?style=for-the-badge&logo=yarn&logoColor=white)\n[![Licence](https://img.shields.io/github/license/Ileriayo/markdown-badges?style=for-the-badge)](./LICENSE)\n\nRead this in other languages: [Русский](README.ru.md)\n\n![Screenshot](./screenshots/en_screen.png)\n\n<!-- <hr> -->\n\nWith this application, users can input text using the virtual keyboard, select the keyboard layout language (Russian or English), use Caps Lock, Backspace, Space, and Enter keys.\n\n## Installation:\n\n[![NPM](https://nodei.co/npm/@autosys/react-mui-keyboard.png?downloads=true&stars=true)](https://www.npmjs.com/package/@autosys/react-mui-keyboard)\n\nInstall with npm:\n\n`npm install @autosys/react-mui-keyboard`\n\nInstall with yarn:\n\n`yarn add @autosys/react-mui-keyboard`\n\n## Usage\n\n1. To input text, click on the virtual keyboard buttons or use the Caps Lock, Backspace, Space, and Enter keys.\n\n2. To change the keyboard layout language, click on the \"RU\" button (Russian layout) or \"EN\" button (English layout).\n\n## Technologies\n\n- React: JavaScript library for building user interfaces.\n- Material-UI (MUI): Component library for creating stylish user interfaces.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Example Usage:\n\n```tsx\nimport React, { useState } from 'react';\nimport { TextField } from '@mui/material';\nimport { MuiKeyboard } from '@autosys/react-mui-keyboard';\nimport { russianButtons, englishButtons, numbers } from 'path_to_your_button_data';\n\nconst App = () => {\n  const [checked, setChecked] = useState(false);\n  const [inputValue, setInputValue] = useState<string>('');\n\n  const handleUrlChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n    setInputValue(event.target.value);\n  };\n\n  const handleChange = () => {\n    setChecked((prev) => !prev);\n  };\n\n  return (\n    <MuiKeyboard\n      textField={\n        <TextField\n          onChange={handleUrlChange}\n          onClick={handleChange}\n          value={inputValue}\n          fullWidth\n          multiline\n        />\n      }\n      slide\n      direction=\"up\"\n      checked={checked}\n      setInputValue={setInputValue}\n      numbers={numbers}\n      firstLanguage={russianButtons}\n      secondLanguage={englishButtons}\n      secondLangLabel=\"EN\"\n      firstLangLabel=\"RU\"\n      keyboardWidth={'900px'}\n      buttonSize=\"medium\"\n      labelLangButton\n      reverseButton\n      sx={{ display: 'flex' }}\n    />\n  );\n};\n\nexport default App;\n```\n\n### Usage without TextField and with Context\n\nIf you want to use the MuiKeyboard component without a built-in TextField and manage the input value using context, follow these steps:\n\n1. Wrap your application with the `MuiKeyboardProvider`:\n\n```tsx\n// index.tsx\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './App';\nimport { MuiKeyboardProvider } from '@autosys/react-mui-keyboard';\nimport { russianButtons } from '@autosys/react-mui-keyboard';\n\nReactDOM.render(\n  <MuiKeyboardProvider\n    firstLanguage={russianButtons}\n    sx={{ display: 'flex', justifyContent: 'center', mt: 50 }}\n    keyboardWidth={'900px'}\n  >\n    <App />\n  </MuiKeyboardProvider>,\n  document.getElementById('root'),\n);\n```\n\n2. Then yo may use the `useMuiKeyboard` hook in any another component to access the input value and setter from the context.\n\n```tsx\n// App.tsx\nimport React from 'react';\nimport { TextField } from '@mui/material';\nimport { useMuiKeyboard } from '@autosys/react-mui-keyboard';\n\nconst App = () => {\n  const { inputValue, keyboardFeature } = useMuiKeyboard();\n  return (\n    <TextField\n      value={inputValue}\n      onClick={() => keyboardFeature({ slideEffect: true })}\n      label=\"Click!\"\n    >\n      Hello\n    </TextField>\n  );\n};\n\nexport default App;\n```\n\nIf you want your component (for example, a button) to only be able to close the keyboard, use `onClick={() => keyboardFeature({ slideEffect: false })}`\n\n![Example_context](./screenshots/keyboard_context.png)\n\nIf you want to reset the inputValue, but don't want to do it with a button on the keyboard, you can use any other button with `onClick={() => keyboardFeature({ resetText: true })}`\n\n## Examples:\n\n### singlyBack and betweenButtons\n\nIf you want the backspace key to be separate, use the `singlyBack` prop. You can also use the `betweenButtons` prop to increase the distance between the keys.\n\n![Example_singlyBack](./screenshots/singlyBack_betweenButtons.png)\n\n### labelLetterButton\n\nIf you want to use numbers separately from letters, then use the `labelLetterButton` prop. You can also use the `numberColumns` and `numbersRows` props to change columns and rows in a numeric block.\n\n![Example_labelLetter](./screenshots/labelLetter_letter.png)\n![Example_labelLetter_numbers](./screenshots/labelLetter_numbers.png)\n\n\n## Properties\n\n| Name                | Type                                                                        | Description                                                                                                                                                                       |\n| ------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `textField`         | `JSX.Element`                                                               | Text input field component.                                                                                                                                                       |\n| `slide`             | `boolean`                                                                   | A flag indicating whether the keyboard should appear with a Slide animation. By default, `true`.                                                                                  |\n| `direction`         | `SlideProps <\"left\" \\| \"right\" \\| \"up\" \\| \"down\">`                          | Slide animation direction (used if `slide` is set to `true`). By default, `up`.                                                                                                   |\n| `checked`           | `boolean`                                                                   | Keyboard visibility state flag.                                                                                                                                                   |\n| `setInputValue`     | `React.Dispatch<React.SetStateAction<string>>`                              | Callback to set the input field's value.                                                                                                                                          |\n| `numbers`           | `string[]`                                                                  | Array of characters for keyboard number buttons.                                                                                                                                  |\n| `firstLanguage*`    | `string[]`                                                                  | Array of characters for keyboard buttons in the first language.                                                                                                                   |\n| `secondLanguage`    | `string[]`                                                                  | Array of characters for keyboard buttons in the second language.                                                                                                                  |\n| `secondLangLabel`   | `string`                                                                    | Label for the second language.                                                                                                                                                    |\n| `firstLangLabel`    | `string`                                                                    | Label for the first language.                                                                                                                                                     |\n| `keyboardWidth`     | `string \\| number`                                                          | Keyboard width.                                                                                                                                                                   |\n| `buttonSize`        | `ButtonProps <\"small\" \\| \"medium\" \\| \"large\">`                              | Button size.                                                                                                                                                                      |\n| `labelLangButton`   | `boolean`                                                                   | Language switch button.                                                                                                                                                           |\n| `reverseButton`     | `boolean`                                                                   | Text reset button.                                                                                                                                                                |\n| `singlyBack`        | `boolean`                                                                   | If `true`, the backspace button is separate from the block with numbers.                                                                                                          |\n| `labelLetterButton` | `boolean`                                                                   | If `true`, a button is added to switch between the layout with letters and numbers.                                                                                               |\n| `betweenButtons`    | `string \\| number`                                                          | Distance between buttons.                                                                                                                                                         |\n| `numbersColumns`    | `string`                                                                    | The number of columns for numeric keypad when it is separate from letters. By default, `5`.                                                                                       |\n| `numbersRows`       | `string`                                                                    | The number of rows for numeric keypad when it is separate from letters. By default, `3`.                                                                                          |\n| `allKeyboardStyle`  | `SxProps`                                                                   | [The sx prop is a shortcut for defining custom styles that has access to the theme.](https://mui.com/system/getting-started/the-sx-prop/)                                         |\n| `timeout`           | `SlideProps <number \\| { appear?: number, enter?: number, exit?: number }>` | [The duration for the transition, in milliseconds. You may specify a single timeout for all transitions, or individually with an object.](https://mui.com/material-ui/api/slide/) |\n\nProps marked with \\* are required.\n\n","readmeFilename":"README.md"}