|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- # Tesseract Web - React Common
-
- Common front-end components for Web using the [Tesseract design system](https://make.modal.sh/tesseract/design), written for [React](https://reactjs.org).
-
- Package:
-
- [![@tesseract-design/react-common](https://code.modal.sh/badge?repo=tesseract-design/react-common&type=package&color=C78AB3&kind=name)](https://pack.modal.sh/js/-/web/detail/@tesseract-design/react-common)
- [![@tesseract-design/react-common](https://code.modal.sh/badge?repo=tesseract-design/react-common&type=package&color=C78AB3&kind=version)](https://pack.modal.sh/js/-/web/detail/@tesseract-design/react-common#versions)
-
- Dependencies:
-
- [![React](https://code.modal.sh/badge?repo=tesseract-design/react-common&type=dependency&dependency=react&kind=dependencies)](https://github.com/facebook/react)
- [![Styled Components](https://code.modal.sh/badge?repo=tesseract-design/react-common&type=dependency&dependency=styled-components&kind=dependencies)](https://github.com/styled-components/styled-components)
- [![TypeScript](https://code.modal.sh/badge?repo=tesseract-design/react-common&type=dependency&dependency=typescript&kind=devDependencies)](https://github.com/microsoft/typescript)
- [![Jest](https://code.modal.sh/badge?repo=tesseract-design/react-common&type=dependency&dependency=jest&kind=devDependencies)](https://github.com/facebook/jest)
- [![Rollup](https://code.modal.sh/badge?repo=tesseract-design/react-common&type=dependency&dependency=rollup&kind=devDependencies)](https://github.com/rollup/rollup)
-
- ## Installation
-
- Since this package resides in the [Modal.sh JavaScript Package Registry](https://pack.modal.sh/js/), you may need to
- adjust configuration in your chosen package manager.
-
- With [Yarn](https://yarnpkg.com), add this to your `.yarnrc` file:
-
- ```
- "@tesseract-design:registry" "https://pack.modal.sh/js/"
- ```
-
- Then, install the package by running the following command:
-
- ```shell script
- yarn add @tesseract-design/react-common
- ```
-
- ## Usage
-
- The package includes components as named exports. Simply import the components you need individually or use a namespace
- import, like so:
-
- ```jsx harmony
- import * as React from 'react'
- import ReactDOM from 'react-dom'
- import * as T from '@tesseract-design/react-common'
-
- const LoginForm = etcProps => (
- <form
- {...etcProps}
- >
- <fieldset>
- <legend>
- Log In
- </legend>
- <div>
- <T.TextInput
- block
- label="Username"
- />
- </div>
- <div>
- <T.TextInput
- block
- type="password"
- label="Password"
- />
- </div>
- <div>
- <T.Button>
- Log In
- </T.Button>
- </div>
- </fieldset>
- </form>
- )
-
- const mountNode = window.document.createElement('div')
-
- ReactDOM.render(
- <LoginForm />,
- mountNode,
- )
-
- window.document.body.appendChild(mountNode)
- ```
|