TheoryOfNekomata 1166e17118 | 3 år sedan | |
---|---|---|
packages | 3 år sedan | |
plop/templates | 4 år sedan | |
utilities | 4 år sedan | |
.editorconfig | 4 år sedan | |
.env.example | 4 år sedan | |
.gitignore | 3 år sedan | |
.npmignore | 4 år sedan | |
.prettierrc | 4 år sedan | |
LICENSE | 4 år sedan | |
README.md | 3 år sedan | |
global.d.ts | 4 år sedan | |
jest.config.js | 4 år sedan | |
jest.setup.ts | 4 år sedan | |
package.json | 3 år sedan | |
plopfile.js | 4 år sedan | |
rollup.config.js | 4 år sedan | |
tsconfig.json | 4 år sedan | |
yarn.lock | 3 år sedan |
Common front-end components for Web using the Tesseract design system, written for React.
Package:
Dependencies:
Since this package resides in the Modal.sh JavaScript Package Registry, you may need to adjust configuration in your chosen package manager.
With Yarn, add this to your .yarnrc
file:
"@tesseract-design:registry" "https://js.pack.modal.sh/"
Then, install the package by running the following command:
yarn add @tesseract-design/react-common
The package includes components as named exports. Simply import the components you need individually or use a namespace import, like so:
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)
Detailed usage guides can be found in the Tesseract Design - React Common documentation.
The package is written and tested using TypeScript. Thus, typings for consumption in TypeScript are bundled with the compiled source.