@toptal/picasso 42.7.1 → 42.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +76 -2
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -9,9 +9,83 @@ Picasso is Toptal's component library, based on Toptal's design system - BASE. U
|
|
|
9
9
|
## Installation instructions
|
|
10
10
|
|
|
11
11
|
```js
|
|
12
|
-
yarn add @toptal/picasso @toptal/picasso-provider
|
|
12
|
+
yarn add @toptal/picasso @toptal/picasso-provider @toptal/picasso-tailwind
|
|
13
|
+
tailwindcss postcss autoprefixer
|
|
13
14
|
```
|
|
14
15
|
|
|
16
|
+
## Create `tailwind.config.js` in the root of the project
|
|
17
|
+
|
|
18
|
+
```js
|
|
19
|
+
const path = require('path')
|
|
20
|
+
|
|
21
|
+
const projectRoot = __dirname
|
|
22
|
+
|
|
23
|
+
/** @type {import('tailwindcss').Config} */
|
|
24
|
+
module.exports = {
|
|
25
|
+
content: [
|
|
26
|
+
path.join(projectRoot, 'node_modules/@toptal/picasso/**/*.js'),
|
|
27
|
+
path.join(projectRoot, 'node_modules/@toptal/picasso-*/**/*.js'),
|
|
28
|
+
// adjust for your project infrastructure
|
|
29
|
+
path.join(projectRoot, '{hosts,libs,namespaces}/**/src/**/*.{ts,tsx}'),
|
|
30
|
+
],
|
|
31
|
+
presets: [require('@toptal/picasso-tailwind')],
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Add Tailwind CSS directives to your CSS source files
|
|
36
|
+
|
|
37
|
+
```css
|
|
38
|
+
/* index.css */
|
|
39
|
+
@tailwind components;
|
|
40
|
+
@tailwind utilities;
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Setup webpack to use PostCSS loader with tailwindcss plugin
|
|
44
|
+
|
|
45
|
+
> If you are reusing webpack configuration from `@toptal/davinci-engine` you can skip this step as it is setup automatically if `tailwind.config.js` is in the repository.
|
|
46
|
+
>
|
|
47
|
+
> Make sure to check all webpack configuration, Application (start/build), Storybook, Cypress
|
|
48
|
+
|
|
49
|
+
```js
|
|
50
|
+
// webpack.config.js
|
|
51
|
+
|
|
52
|
+
...
|
|
53
|
+
{
|
|
54
|
+
test: /\.css$/i,
|
|
55
|
+
use: [
|
|
56
|
+
'style-loader',
|
|
57
|
+
'css-loader',
|
|
58
|
+
{
|
|
59
|
+
loader: 'postcss-loader',
|
|
60
|
+
options: {
|
|
61
|
+
postcssOptions: {
|
|
62
|
+
config: false,
|
|
63
|
+
plugins: {
|
|
64
|
+
tailwindcss: {
|
|
65
|
+
config: require.resolve(
|
|
66
|
+
// update with actual path to tailwind config
|
|
67
|
+
'./tailwind.config.js'
|
|
68
|
+
),
|
|
69
|
+
},
|
|
70
|
+
autoprefixer: {},
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
...
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
When using **Vite** or **NextJS**, adding tailwind config with correct `content` should be sufficient in most cases, depending on your configuration.
|
|
82
|
+
|
|
83
|
+
For more info, you can check out the official Tailwind docs:
|
|
84
|
+
|
|
85
|
+
[Install Tailwind CSS with Vite](https://tailwindcss.com/docs/guides/vite)
|
|
86
|
+
|
|
87
|
+
[Install Tailwind CSS with Next.js](https://tailwindcss.com/docs/guides/nextjs)
|
|
88
|
+
|
|
15
89
|
## Start using the library
|
|
16
90
|
|
|
17
91
|
```jsx
|
|
@@ -21,7 +95,7 @@ import { Button } from '@toptal/picasso'
|
|
|
21
95
|
|
|
22
96
|
render () {
|
|
23
97
|
return (
|
|
24
|
-
<Picasso>
|
|
98
|
+
<Picasso injectFirst>
|
|
25
99
|
<Button>Hello world!</Button>
|
|
26
100
|
</Picasso>
|
|
27
101
|
)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toptal/picasso",
|
|
3
|
-
"version": "42.7.
|
|
3
|
+
"version": "42.7.2",
|
|
4
4
|
"description": "Toptal UI components library",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"typescript": "~4.7.0"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@toptal/picasso-shared": "13.1.
|
|
34
|
+
"@toptal/picasso-shared": "13.1.4",
|
|
35
35
|
"ap-style-title-case": "^1.1.2",
|
|
36
|
-
"classnames": "^2.
|
|
36
|
+
"classnames": "^2.5.1",
|
|
37
37
|
"d3": "^7.8.2",
|
|
38
38
|
"d3-hierarchy": "^3.1.2",
|
|
39
39
|
"d3-zoom": "^3",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@testing-library/jest-dom": "^6.2.0",
|
|
54
54
|
"@testing-library/react": "^14.1.2",
|
|
55
55
|
"@testing-library/react-hooks": "^8.0.1",
|
|
56
|
-
"@toptal/picasso-provider": "3.5.
|
|
56
|
+
"@toptal/picasso-provider": "3.5.1",
|
|
57
57
|
"@types/classnames": "^2.3.1",
|
|
58
58
|
"@types/d3": "^7.4.0",
|
|
59
59
|
"@types/glider-js": "^1.7.8",
|