@pacer-ui/tokens 1.0.1

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 PT Pertamina (Persero)
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
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,106 @@
1
+ # @pacer-ui/tokens
2
+
3
+ Framework-agnostic design tokens untuk PACER (Pertamina Patra Niaga Components & Experience Resources).
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @pacer-ui/tokens
9
+ # or
10
+ pnpm add @pacer-ui/tokens
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ### TypeScript/JavaScript
16
+
17
+ ```typescript
18
+ import { tokens, colors, spacing, typography } from '@pacer-ui/tokens';
19
+
20
+ // Use individual tokens
21
+ const primaryColor = colors.brand.primary[500]; // #0073e6
22
+ const baseSpacing = spacing[4]; // 16px
23
+
24
+ // Use all tokens
25
+ console.log(tokens);
26
+ ```
27
+
28
+ ### JSON
29
+
30
+ ```javascript
31
+ import tokens from '@pacer-ui/tokens/json';
32
+
33
+ // Raw token data as JSON
34
+ ```
35
+
36
+ ### CSS Custom Properties
37
+
38
+ ```css
39
+ @import '@pacer-ui/tokens/css';
40
+
41
+ .my-component {
42
+ color: var(--color-brand-primary-500);
43
+ padding: var(--spacing-4);
44
+ font-size: var(--font-size-base);
45
+ }
46
+ ```
47
+
48
+ ## Token Categories
49
+
50
+ ### Colors
51
+ - `colors.brand.primary` - Primary brand colors
52
+ - `colors.brand.secondary` - Secondary brand colors
53
+ - `colors.success` - Success states
54
+ - `colors.warning` - Warning states
55
+ - `colors.error` - Error states
56
+ - `colors.info` - Info states
57
+ - `colors.neutral` - Neutral/grayscale colors
58
+
59
+ ### Spacing
60
+ 4px-based spacing scale: `0, 1, 2, 3, 4, 5, 6, 8, 10, 12, 16, 20, 24...`
61
+
62
+ ### Typography
63
+ - `typography.fontFamily` - Font families
64
+ - `typography.fontSize` - Font sizes (xs - 7xl)
65
+ - `typography.fontWeight` - Font weights
66
+ - `typography.lineHeight` - Line heights
67
+ - `typography.letterSpacing` - Letter spacing
68
+
69
+ ### Border Radius
70
+ From `sm` (2px) to `3xl` (24px), plus `full` (9999px)
71
+
72
+ ### Shadows
73
+ Elevation system from `sm` to `2xl`
74
+
75
+ ### Motion
76
+ - `motion.duration` - Animation durations
77
+ - `motion.easing` - Easing functions
78
+
79
+ ### Breakpoints
80
+ Responsive breakpoints: `sm, md, lg, xl, 2xl`
81
+
82
+ ### Z-Index
83
+ Layering system for UI elements
84
+
85
+ ## Philosophy
86
+
87
+ Design tokens mengikuti prinsip:
88
+
89
+ 1. **Semantic naming** - Nama berdasarkan tujuan, bukan nilai
90
+ 2. **Hierarchical organization** - Struktur bertingkat yang konsisten
91
+ 3. **Theme-able** - Mendukung light/dark mode
92
+ 4. **Framework-agnostic** - Dapat digunakan di React, Vue, Blazor
93
+ 5. **Single source of truth** - Satu sumber untuk semua nilai design
94
+
95
+ ## Updating Tokens
96
+
97
+ Token dikelola di `src/index.ts`. Setelah update:
98
+
99
+ ```bash
100
+ pnpm build
101
+ ```
102
+
103
+ Akan men-generate:
104
+ - `dist/index.js` - ESM/CJS modules
105
+ - `dist/tokens.json` - Raw JSON
106
+ - `dist/tokens.css` - CSS Custom Properties