@org-design-system/styles 0.1.4
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 +19 -0
- package/README.md +51 -0
- package/dist/index.cjs +723 -0
- package/dist/index.css +295 -0
- package/dist/index.d.cts +692 -0
- package/dist/index.d.ts +692 -0
- package/dist/index.js +695 -0
- package/package.json +41 -0
- package/src/component.css +20 -0
- package/src/index.css +295 -0
- package/src/index.ts +2 -0
- package/src/tailwind.tokens.ts +299 -0
- package/src/tokens.generated.ts +391 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright (c) 2026 koushikmondal
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
in the Software without restriction, including without limitation the rights
|
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
|
11
|
+
copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# @org-design-system/tokens
|
|
2
|
+
|
|
3
|
+
The source of truth for all design tokens in the system. This package manages the lifecycle of branding variables from Figma to code.
|
|
4
|
+
|
|
5
|
+
## 🧱 What's Inside?
|
|
6
|
+
- **Raw Variables**: Semantic colors, spacing, typography, and effects.
|
|
7
|
+
- **Consolidated CSS**: A single entry point for all CSS variables.
|
|
8
|
+
- **Type-Safe Constants**: JavaScript/TypeScript exports for use in logic or CSS-in-JS.
|
|
9
|
+
|
|
10
|
+
## 🛠️ How it Works
|
|
11
|
+
|
|
12
|
+
### 1. Token Architecture
|
|
13
|
+
We use a **two-layer** token system:
|
|
14
|
+
- **Base Tokens**: Primitive values (e.g., `blue-500`).
|
|
15
|
+
- **Semantic Tokens**: Contextual values (e.g., `text-primary`, `bg-surface`).
|
|
16
|
+
|
|
17
|
+
### 2. Synchronization (Figma)
|
|
18
|
+
Tokens can be synced directly from Figma Variables using the `sync.js` script.
|
|
19
|
+
```bash
|
|
20
|
+
# Requires environment variables:
|
|
21
|
+
# FIGMA_ACCESS_TOKEN
|
|
22
|
+
# FIGMA_FILE_KEY
|
|
23
|
+
npm run sync
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### 3. Build Process
|
|
27
|
+
The `build.js` script transforms raw JSON/token data into:
|
|
28
|
+
- `dist/index.css`: Ready-to-use CSS variables.
|
|
29
|
+
- `dist/index.js/mjs`: TypeScript-compatible constants.
|
|
30
|
+
|
|
31
|
+
## 📦 Usage
|
|
32
|
+
|
|
33
|
+
### In CSS
|
|
34
|
+
```css
|
|
35
|
+
@import "@org-design-system/tokens/index.css";
|
|
36
|
+
|
|
37
|
+
.my-box {
|
|
38
|
+
background-color: var(--color-surface-bg);
|
|
39
|
+
border-radius: var(--radius-md);
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### In TypeScript
|
|
44
|
+
```tsx
|
|
45
|
+
import { tokens } from "@org-design-system/tokens";
|
|
46
|
+
|
|
47
|
+
console.log(tokens.colors.primary);
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
*Generated using OKLCH color space for superior visual consistency.*
|