@autonomys/design-tokens 1.4.18 → 1.4.22
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/LICENSE +18 -0
- package/README.md +59 -53
- package/dist/generate-token.d.ts +6 -0
- package/dist/index.css +57 -2041
- package/dist/index.d.ts +12 -446
- package/dist/index.esm.js +254 -443
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +253 -448
- package/dist/index.js.map +1 -1
- package/dist/tokens/colors.d.ts +4 -180
- package/dist/tokens/colors.js +61 -165
- package/package.json +3 -2
- package/dist/css/utilities.css +0 -1919
- package/dist/css/variables.css +0 -244
package/LICENSE
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Autonomys Network (autonomys.xyz)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
1. **Attribution**: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
2. **No Warranty**: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
15
|
+
|
|
16
|
+
3. **Limitation of Liability**: IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
17
|
+
|
|
18
|
+
---
|
package/README.md
CHANGED
|
@@ -4,11 +4,10 @@ A comprehensive design token system for Auto, providing consistent styling acros
|
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
- Utility classes with an `auto-` prefix for easy styling
|
|
7
|
+
- Design tokens prefixed with `auto-` for consistent naming
|
|
9
8
|
- Tailwind CSS integration
|
|
10
9
|
- Dark theme support
|
|
11
|
-
- Explorer
|
|
10
|
+
- Drive and Explorer specific styles
|
|
12
11
|
|
|
13
12
|
## Installation
|
|
14
13
|
|
|
@@ -18,80 +17,87 @@ npm install @autonomys/design-tokens
|
|
|
18
17
|
yarn add @autonomys/design-tokens
|
|
19
18
|
```
|
|
20
19
|
|
|
21
|
-
## Usage
|
|
22
|
-
|
|
23
|
-
### Import All Styles
|
|
20
|
+
## Usage with CSS
|
|
24
21
|
|
|
25
22
|
```js
|
|
26
|
-
//
|
|
23
|
+
// global.css
|
|
24
|
+
|
|
27
25
|
import '@autonomys/design-tokens/dist/index.css'
|
|
28
26
|
```
|
|
29
27
|
|
|
30
|
-
|
|
28
|
+
## Usage with Tailwind CSS
|
|
31
29
|
|
|
32
|
-
|
|
33
|
-
// Import only CSS variables without utility classes
|
|
34
|
-
import '@autonomys/design-tokens/dist/css/variables.css'
|
|
30
|
+
In your `tailwind.config.js` or `tailwind.config.ts` file:
|
|
35
31
|
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
```js
|
|
33
|
+
// JavaScript (CommonJS)
|
|
34
|
+
/** @type {import('tailwindcss').Config} */
|
|
35
|
+
module.exports = {
|
|
36
|
+
theme: {
|
|
37
|
+
extend: require('@autonomys/design-tokens').autoTokens,
|
|
38
|
+
},
|
|
39
|
+
}
|
|
38
40
|
```
|
|
39
41
|
|
|
40
|
-
|
|
42
|
+
```ts
|
|
43
|
+
// TypeScript (ESM)
|
|
44
|
+
import type { Config } from 'tailwindcss'
|
|
45
|
+
import { autoTokens } from '@autonomys/design-tokens'
|
|
41
46
|
|
|
42
|
-
|
|
47
|
+
const config: Config = {
|
|
48
|
+
theme: {
|
|
49
|
+
extend: autoTokens,
|
|
50
|
+
},
|
|
51
|
+
}
|
|
43
52
|
|
|
44
|
-
|
|
45
|
-
npm run build
|
|
53
|
+
export default config
|
|
46
54
|
```
|
|
47
55
|
|
|
48
|
-
|
|
56
|
+
## Available Tokens
|
|
49
57
|
|
|
50
|
-
|
|
51
|
-
2. Generate CSS files:
|
|
52
|
-
- `index.css`: Complete bundle with all variables and utility classes
|
|
53
|
-
- `css/variables.css`: Only CSS custom properties
|
|
54
|
-
- `css/utilities.css`: Only utility classes
|
|
55
|
-
3. Output everything to the `dist` folder
|
|
58
|
+
### Color Tokens
|
|
56
59
|
|
|
57
|
-
|
|
60
|
+
- Drive colors: `auto-drive-primary`, `auto-drive-accent`, etc.
|
|
61
|
+
- Explorer colors: `auto-explorer-grayDark`, `auto-explorer-blueAccent`, etc.
|
|
58
62
|
|
|
59
|
-
###
|
|
63
|
+
### Typography Tokens
|
|
60
64
|
|
|
61
|
-
-
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
+
- Font families: `auto-sans`, `auto-mono`, `auto-display`, etc.
|
|
66
|
+
- Font sizes: `auto-xs`, `auto-sm`, `auto-base`, etc.
|
|
67
|
+
- Font weights: `auto-light`, `auto-normal`, `auto-bold`, etc.
|
|
68
|
+
- Line heights: `auto-tight`, `auto-normal`, `auto-relaxed`, etc.
|
|
69
|
+
- Letter spacings: `auto-tight`, `auto-normal`, `auto-wide`, etc.
|
|
65
70
|
|
|
66
|
-
###
|
|
71
|
+
### Shadow Tokens
|
|
67
72
|
|
|
68
|
-
-
|
|
69
|
-
-
|
|
70
|
-
- Font sizes: `auto-text-xs`, `auto-text-sm`, etc.
|
|
71
|
-
- Font weights: `auto-font-light`, `auto-font-bold`, etc.
|
|
73
|
+
- Box shadows: `auto-sm`, `auto-md`, `auto-lg`, etc.
|
|
74
|
+
- Component shadows: `auto-button`, `auto-card`, `auto-modal`, etc.
|
|
72
75
|
|
|
73
|
-
### Spacing
|
|
76
|
+
### Spacing Tokens
|
|
74
77
|
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
-
|
|
78
|
+
- Spacing scale: `auto-1`, `auto-2`, `auto-4`, etc.
|
|
79
|
+
- Border radius: `auto-none`, `auto-sm`, `auto-md`, etc.
|
|
80
|
+
- Breakpoints: `auto-sm`, `auto-md`, `auto-lg`, etc.
|
|
78
81
|
|
|
79
|
-
|
|
82
|
+
## Using Tokens in Components
|
|
80
83
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
-
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
```jsx
|
|
85
|
+
// Example React component using Tailwind with Auto tokens
|
|
86
|
+
function Button({ children }) {
|
|
87
|
+
return (
|
|
88
|
+
<button className='bg-auto-drive-primary text-white hover:bg-auto-drive-primaryHover font-auto-semibold py-2 px-4 rounded-auto-lg shadow-auto-button'>
|
|
89
|
+
{children}
|
|
90
|
+
</button>
|
|
91
|
+
)
|
|
92
|
+
}
|
|
93
|
+
```
|
|
88
94
|
|
|
89
|
-
##
|
|
95
|
+
## Building the Tokens
|
|
90
96
|
|
|
91
|
-
|
|
97
|
+
To build the design tokens:
|
|
92
98
|
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
<!-- Content will use dark theme styles -->
|
|
96
|
-
</div>
|
|
99
|
+
```bash
|
|
100
|
+
npm run build
|
|
97
101
|
```
|
|
102
|
+
|
|
103
|
+
This will compile the TypeScript tokens and generate a distribution bundle that can be used in your project.
|