Skip to content

Commit 159d2e3

Browse files
docs: added missing installation steps NO-JIRA (#88)
1 parent 6557317 commit 159d2e3

File tree

5 files changed

+119
-17
lines changed

5 files changed

+119
-17
lines changed

README.md

Lines changed: 115 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<img src="./public/header.svg" width="100%" alt="css-in-readme">
1+
<img src="https://storybook.tetrisly.com/header.svg" width="100%" alt="css-in-readme">
22

33
# Tetrisly React
44

@@ -15,52 +15,138 @@ We've desided to use `xstyled` for styling our components. If you are interested
1515

1616
## Installation
1717

18-
Install tetrisly-react with npm (you can do the same with yarn, pnpm or any other package manager)
18+
Install `tetrisly-react`` with npm (you can do the same with yarn, pnpm or any other package manager)
1919

2020
```bash
2121
npm install @virtuslab/tetrisly-react
2222
```
2323

24+
and dependencies:
25+
26+
```bash
27+
npm install styled-components @xstyled/styled-components
28+
```
29+
2430
## Setup
2531

32+
### TetrislyProvider
33+
2634
After installing the package, you need to wrap your application in the `TetrislyProvider` component. This will provide the theme and other context to your application.
2735

28-
```typescript
36+
```jsx
2937
import { TetrislyProvider } from '@virtuslab/tetrisly-react';
3038

3139
function App() {
3240
return (
3341
<TetrislyProvider>
3442
<YourApp />
3543
</TetrislyProvider>
36-
)
44+
);
3745
}
3846
```
3947

4048
TetrislyProvider accepts optional prop `theme` which can be used to override default theme.
4149

42-
You can check out how this object looks like here: [Tetrisly Theme](src/theme/theme.ts)
43-
44-
```typescript
50+
```jsx
4551
import { TetrislyProvider } from '@virtuslab/tetrisly-react';
4652

4753
function App() {
4854
return (
49-
<TetrislyProvider theme={{ colors: { primary: 'red' } }}>
55+
<TetrislyProvider
56+
theme={{
57+
colors: {
58+
'$color-semantic-brand--4': th.color('$color-raspberry--4'),
59+
'$color-semantic-brand--3': th.color('$color-raspberry--3'),
60+
'$color-semantic-brand--2': th.color('$color-raspberry--2'),
61+
'$color-semantic-brand--1': th.color('$color-raspberry--1'),
62+
'$color-semantic-brand-0': th.color('$color-raspberry-0'),
63+
'$color-semantic-brand-+1': th.color('$color-raspberry-+1'),
64+
'$color-semantic-brand-+2': th.color('$color-raspberry-+2'),
65+
'$color-semantic-brand-+3': th.color('$color-raspberry-+3'),
66+
'$color-semantic-brand-+4': th.color('$color-raspberry-+4'),
67+
'$color-semantic-brand-+5': th.color('$color-raspberry-+5'),
68+
'$color-semantic-brand-+6': th.color('$color-raspberry-+6'),
69+
'$color-semantic-brand-+7': th.color('$color-raspberry-+7'),
70+
'$color-semantic-brand-+8': th.color('$color-raspberry-+8'),
71+
},
72+
}}
73+
>
5074
<YourApp />
5175
</TetrislyProvider>
52-
)
76+
);
5377
}
5478
```
5579

56-
## Usage/Examples
80+
### Default theme
5781

58-
```typescript
59-
import { Button } from '@virtuslab/tetrisly-react';
82+
Our default theme contains all of fundamental Tetrisly Design Tokens, you can use it with `xstyled` props to easy set up
83+
your design. See `tet.*` utility [example of use](#tet-utility).
6084

61-
function App() {
62-
return <Button label="Hello Tetrisly" />
63-
}
85+
Here you can see the
86+
[default theme](https://github.com/VirtusLab/@tetrisly/react/blob/development/src/theme/defaultTheme.ts) or a complete
87+
list of theme options.
88+
89+
### Default font
90+
91+
Tetrisly uses [Inter](https://fonts.google.com/specimen/Inter) font as default. To add it to your app you should link it
92+
in your root `.html` file:
93+
94+
```html
95+
<link rel="preconnect" href="https://fonts.googleapis.com" />
96+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
97+
<link
98+
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;450;600&display=swap"
99+
rel="stylesheet"
100+
/>
101+
```
102+
103+
## `tet.*` utility
104+
105+
`tet` function is our extension of xstyled `x.*` utility. Both has the same API, but we will add some extra features in
106+
near future. You can read more [here](https://xstyled.dev/docs/utility-props/).
107+
108+
### Example of use
109+
110+
```jsx
111+
import {
112+
TetrislyProvider,
113+
Button,
114+
theme,
115+
tet,
116+
} from '@virtuslab/tetrisly-react';
117+
118+
const App = () => (
119+
<TetrislyProvider>
120+
<tet.div
121+
display="flex"
122+
justifyContent="center"
123+
alignItems="center"
124+
h="100vh"
125+
>
126+
<tet.div>
127+
<tet.h1
128+
textAlign="center"
129+
mb="$dimension-200"
130+
text="$typo-header-4xLarge"
131+
color="$color-content-primary"
132+
>
133+
Hello world!
134+
</tet.h1>
135+
<tet.div display="flex" justifyContent="center" alignItems="center">
136+
<a
137+
href="https://storybook.tetrisly.com"
138+
target="_blank"
139+
rel="noreferrer"
140+
>
141+
<Button label="Go to Storybook" appearance="primary" />
142+
</a>
143+
</tet.div>
144+
</tet.div>
145+
</tet.div>
146+
</TetrislyProvider>
147+
);
148+
149+
export default App;
64150
```
65151

66152
## Run Locally
@@ -99,12 +185,19 @@ To run tests, run the following command
99185

100186
## Documentation
101187

102-
<img src="./public/logo_docs.svg" />
188+
<img src="https://storybook.tetrisly.com/logo-docs.svg" />
103189

104190
If you want to dive deeper into the components Tetrisly offers, check out our official documentation: [Tetrisly Docs](https://docs.tetrisly.com/)
105191

106192
You can also check out our Storybook, which is our Documentation for React components (now in progress): [Tetrisly Storybook](https://virtuslab.github.io/tetrisly-react/?path=/docs/alertbanner--docs)
107193

194+
### Useful links
195+
196+
- [Tetrisly Storybook](https://storybook.tetrisly.com/)
197+
- [Tetrisly Figma Docs](https://docs.tetrisly.com/)
198+
- [Tetrisly Figma Preview](https://tetrisly.com/preview)
199+
- [xstyled Docs](https://xstyled.dev/)
200+
108201
## Getting Help
109202

110203
If at any point you need help, feel lost, or have some feedback for us, you can create issues on our GitHub repository, or reach out to us on out Discord Server: [Tetrisly Discord](https://discord.gg/MPefZwUZUu)
@@ -116,3 +209,9 @@ If you want to share with us your thoughts on Tetrisly, or showcase what you hav
116209
## License
117210

118211
We are using the [Apache License 2.0](https://choosealicense.com/licenses/apache-2.0/) for our library of components
212+
213+
## VirtusLab
214+
215+
<img src="https://storybook.tetrisly.com/logo-virtuslab.svg" />
216+
217+
Meet [VirtusLab](https://virtuslab.com/), the visionary team behind Tetrisly for React and the Tetrisly design system. Trusted by clients, they excel in product design, design systems and front-end engineering, creating mission-critical solutions across the product lifecycle.

public/VLLogo.png

-17.8 KB
Binary file not shown.
File renamed without changes.

public/logo-virtuslab.svg

Lines changed: 3 additions & 0 deletions
Loading

src/docs-pages/ReadMe.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ import { Meta, Markdown } from '@storybook/addon-docs';
22
import readme from '@/../README.md?raw';
33

44
<Meta title="Docs/ReadMe" />
5-
<Markdown>{readme.replaceAll('./public', '')}</Markdown>
5+
<Markdown>{readme}</Markdown>

0 commit comments

Comments
 (0)