open-index/open-npm huggingface dataset:
npm package: @stormlmd/form-builder
Description: This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Latest version: 0.3.5

# React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

## React Compiler

The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).

## Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:

```js
export default defineConfig([
  globalIgnores(['dist']),
  {
    files: ['**/*.{ts,tsx}'],
    extends: [
      // Other configs...

      // Remove tseslint.configs.recommended and replace with this
      tseslint.configs.recommendedTypeChecked,
      // Alternatively, use this for stricter rules
      tseslint.configs.strictTypeChecked,
      // Optionally, add this for stylistic rules
      tseslint.configs.stylisticTypeChecked,

      // Other configs...
    ],
    languageOptions: {
      parserOptions: {
        project: ['./tsconfig.node.json', './tsconfig.app.json'],
        tsconfigRootDir: import.meta.dirname,
      },
      // other options...
    },
  },
])
```

You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:

```js
// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'

export default defineConfig([
  globalIgnores(['dist']),
  {
    files: ['**/*.{ts,tsx}'],
    extends: [
      // Other configs...
      // Enable lint rules for React
      reactX.configs['recommended-typescript'],
      // Enable lint rules for React DOM
      reactDom.configs.recommended,
    ],
    languageOptions: {
      parserOptions: {
        project: ['./tsconfig.node.json', './tsconfig.app.json'],
        tsconfigRootDir: import.meta.dirname,
      },
      // other options...
    },
  },
])
```
npm package: @stormotion/graphcms-localized-textfields
Description: A GraphCMS UI Extension for adding localized text fields to models
Author: Cyril Troitsky
Latest version: 0.2.2

# graphcms-localized-textfields

A GraphCMS UI Extension component for adding localized text fields to models.
Looks like this:

![Extension screenshot](https://i.ibb.co/SVYVnFk/Screenshot-2021-12-12-at-19-23-29.png)

Under the hood, the field will be of the JSON format, mapping the language code to the string in the input.

# Usage

A basic example of usage can be like this:

```js
import { LocalizedTextPage } from "@stormotion/graphcms-localized-textfields";

const locales = ["en", "de", "ch", "ru", "uk"];

const mapper = {
  ch: "Chinese",
  en: "English",
  de: "German",
  ru: "Russian",
  uk: "Ukrainian",
};

function App() {
  return (
    <LocalizedTextPage
      locales={locales}
      mapLocaleCodeToString={mapper}
      isMultiline
    />
  );
}

export default App;
```

Then, all you have to do is to host the website, and then provide GraphCMS with the link to it.
In case you wish to have a both the single-line & the multi-like text fields, you can use a router library such as [Wouter](https://github.com/molefrog/wouter), and place each each version of the component on separate uris.

Note that the GraphCMS SDK's **Wrapper** context is already built into the **LocalizedTextPage** component. In case you wish to customize the declaration or replace the context, feel free to import the **LocalizationsList** component, which is not Wrapped.

# API

**LocalizedTextPage** receives the following options:

- **locales** - an array of language codes ([preferably in the ISO 639-1 format](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes))

- **mapLocaleCodeToString** - an object that maps from the language code, such as "en" to a natural language string, such as "English".
  By default, the following language codes already have mappings: en, de, it, es, fr, ru, uk.

- **isMultiline** - indicates whether the text inputs should be multiline. By default, is set to **false**.