@teranga-ds/tokens 0.1.0
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 +21 -0
- package/README.md +86 -0
- package/dist/index.d.ts +244 -0
- package/dist/teranga-tokens.cjs +3282 -0
- package/dist/teranga-tokens.css +189 -0
- package/dist/teranga-tokens.js +193 -0
- package/dist/teranga-tokens.json +185 -0
- package/dist/teranga-tokens.scss +186 -0
- package/package.json +53 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Government of Senegal / République du Sénégal
|
|
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,86 @@
|
|
|
1
|
+
# @teranga-ds/tokens
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<strong>Design tokens for the Teranga Design System 🇸🇳</strong>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://www.npmjs.com/package/@teranga-ds/tokens"><img src="https://img.shields.io/npm/v/@teranga-ds/tokens?color=%23FDEF42" alt="npm" /></a>
|
|
9
|
+
<a href="https://github.com/mahykane/teranga-design-systems/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green" alt="MIT" /></a>
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+
Design tokens (colors, typography, spacing, shapes) for the Teranga Design System, available in CSS, SCSS, JSON, and JavaScript formats.
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install @teranga-ds/tokens
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
### CSS
|
|
23
|
+
|
|
24
|
+
```css
|
|
25
|
+
@import '@teranga-ds/tokens/css';
|
|
26
|
+
|
|
27
|
+
.my-element {
|
|
28
|
+
color: var(--tg-color-green-600);
|
|
29
|
+
font-family: var(--tg-font-family-sans);
|
|
30
|
+
padding: var(--tg-spacing-md);
|
|
31
|
+
border-radius: var(--tg-radius-md);
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### SCSS
|
|
36
|
+
|
|
37
|
+
```scss
|
|
38
|
+
@import '@teranga-ds/tokens/scss';
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### JavaScript / TypeScript
|
|
42
|
+
|
|
43
|
+
```js
|
|
44
|
+
import tokens from '@teranga-ds/tokens/json';
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### JSON
|
|
48
|
+
|
|
49
|
+
```js
|
|
50
|
+
const tokens = require('@teranga-ds/tokens/json');
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Token Categories
|
|
54
|
+
|
|
55
|
+
### Colors
|
|
56
|
+
|
|
57
|
+
Inspired by the Senegalese flag 🇸🇳:
|
|
58
|
+
|
|
59
|
+
| Palette | Example Token | Hex |
|
|
60
|
+
|---------|--------------|-----|
|
|
61
|
+
| Green | `--tg-color-green-600` | `#2D6A4F` |
|
|
62
|
+
| Gold | `--tg-color-gold-500` | `#D4A373` |
|
|
63
|
+
| Red | `--tg-color-red-600` | `#C1121F` |
|
|
64
|
+
| Terracotta | `--tg-color-terracotta-500` | `#C17817` |
|
|
65
|
+
| Baobab | `--tg-color-baobab-500` | `#8B6914` |
|
|
66
|
+
| Neutral | `--tg-color-neutral-50` → `--tg-color-neutral-900` | Grayscale |
|
|
67
|
+
|
|
68
|
+
### Typography
|
|
69
|
+
|
|
70
|
+
| Token | Value |
|
|
71
|
+
|-------|-------|
|
|
72
|
+
| `--tg-font-family-sans` | Plus Jakarta Sans |
|
|
73
|
+
| `--tg-font-family-display` | DM Serif Display |
|
|
74
|
+
| `--tg-font-family-serif` | Lora |
|
|
75
|
+
|
|
76
|
+
### Spacing
|
|
77
|
+
|
|
78
|
+
`--tg-spacing-xs` (4px) → `--tg-spacing-3xl` (64px)
|
|
79
|
+
|
|
80
|
+
### Shape
|
|
81
|
+
|
|
82
|
+
`--tg-radius-sm` → `--tg-radius-full`
|
|
83
|
+
|
|
84
|
+
## License
|
|
85
|
+
|
|
86
|
+
MIT © [Teranga DS Contributors](https://github.com/mahykane/teranga-design-systems)
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not edit directly, this file was auto-generated.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export const colorGreen50: string;
|
|
6
|
+
export const colorGreen100: string;
|
|
7
|
+
export const colorGreen200: string;
|
|
8
|
+
export const colorGreen300: string;
|
|
9
|
+
export const colorGreen400: string;
|
|
10
|
+
/** Senegalese flag green — primary brand color */
|
|
11
|
+
export const colorGreen500: string;
|
|
12
|
+
export const colorGreen600: string;
|
|
13
|
+
export const colorGreen700: string;
|
|
14
|
+
export const colorGreen800: string;
|
|
15
|
+
export const colorGreen900: string;
|
|
16
|
+
export const colorGold50: string;
|
|
17
|
+
export const colorGold100: string;
|
|
18
|
+
export const colorGold200: string;
|
|
19
|
+
export const colorGold300: string;
|
|
20
|
+
export const colorGold400: string;
|
|
21
|
+
/** Senegalese flag gold/yellow */
|
|
22
|
+
export const colorGold500: string;
|
|
23
|
+
export const colorGold600: string;
|
|
24
|
+
export const colorGold700: string;
|
|
25
|
+
export const colorGold800: string;
|
|
26
|
+
export const colorGold900: string;
|
|
27
|
+
export const colorRed50: string;
|
|
28
|
+
export const colorRed100: string;
|
|
29
|
+
export const colorRed200: string;
|
|
30
|
+
export const colorRed300: string;
|
|
31
|
+
export const colorRed400: string;
|
|
32
|
+
/** Senegalese flag red — danger/error color */
|
|
33
|
+
export const colorRed500: string;
|
|
34
|
+
export const colorRed600: string;
|
|
35
|
+
export const colorRed700: string;
|
|
36
|
+
export const colorRed800: string;
|
|
37
|
+
export const colorRed900: string;
|
|
38
|
+
export const colorNeutral0: string;
|
|
39
|
+
export const colorNeutral50: string;
|
|
40
|
+
export const colorNeutral100: string;
|
|
41
|
+
export const colorNeutral200: string;
|
|
42
|
+
export const colorNeutral300: string;
|
|
43
|
+
export const colorNeutral400: string;
|
|
44
|
+
export const colorNeutral500: string;
|
|
45
|
+
export const colorNeutral600: string;
|
|
46
|
+
export const colorNeutral700: string;
|
|
47
|
+
export const colorNeutral800: string;
|
|
48
|
+
export const colorNeutral900: string;
|
|
49
|
+
export const colorNeutral1000: string;
|
|
50
|
+
export const colorSemanticPrimaryDefault: string;
|
|
51
|
+
export const colorSemanticPrimaryHover: string;
|
|
52
|
+
export const colorSemanticPrimaryActive: string;
|
|
53
|
+
export const colorSemanticPrimarySubtle: string;
|
|
54
|
+
export const colorSemanticPrimaryMuted: string;
|
|
55
|
+
/** Text/icon color on primary background */
|
|
56
|
+
export const colorSemanticPrimaryOn: string;
|
|
57
|
+
export const colorSemanticSecondaryDefault: string;
|
|
58
|
+
export const colorSemanticSecondaryHover: string;
|
|
59
|
+
export const colorSemanticSecondaryActive: string;
|
|
60
|
+
export const colorSemanticSecondarySubtle: string;
|
|
61
|
+
export const colorSemanticSecondaryMuted: string;
|
|
62
|
+
export const colorSemanticSecondaryOn: string;
|
|
63
|
+
export const colorSemanticDangerDefault: string;
|
|
64
|
+
export const colorSemanticDangerHover: string;
|
|
65
|
+
export const colorSemanticDangerActive: string;
|
|
66
|
+
export const colorSemanticDangerSubtle: string;
|
|
67
|
+
export const colorSemanticDangerMuted: string;
|
|
68
|
+
export const colorSemanticDangerOn: string;
|
|
69
|
+
export const colorSemanticSuccessDefault: string;
|
|
70
|
+
export const colorSemanticSuccessSubtle: string;
|
|
71
|
+
export const colorSemanticSuccessOn: string;
|
|
72
|
+
export const colorSemanticWarningDefault: string;
|
|
73
|
+
export const colorSemanticWarningSubtle: string;
|
|
74
|
+
export const colorSemanticWarningOn: string;
|
|
75
|
+
export const colorSemanticInfoDefault: string;
|
|
76
|
+
export const colorSemanticInfoSubtle: string;
|
|
77
|
+
export const colorSemanticInfoOn: string;
|
|
78
|
+
export const colorSemanticSurfacePage: string;
|
|
79
|
+
export const colorSemanticSurfaceRaised: string;
|
|
80
|
+
export const colorSemanticSurfaceOverlay: string;
|
|
81
|
+
export const colorSemanticSurfaceSunken: string;
|
|
82
|
+
export const colorSemanticTextPrimary: string;
|
|
83
|
+
export const colorSemanticTextSecondary: string;
|
|
84
|
+
export const colorSemanticTextDisabled: string;
|
|
85
|
+
export const colorSemanticTextInverse: string;
|
|
86
|
+
export const colorSemanticBorderDefault: string;
|
|
87
|
+
export const colorSemanticBorderStrong: string;
|
|
88
|
+
export const colorSemanticBorderFocus: string;
|
|
89
|
+
/** Instant micro-feedback */
|
|
90
|
+
export const motionDurationInstant: string;
|
|
91
|
+
/** Button press, toggle */
|
|
92
|
+
export const motionDurationFast: string;
|
|
93
|
+
/** Default transitions */
|
|
94
|
+
export const motionDurationNormal: string;
|
|
95
|
+
/** Modals, drawers */
|
|
96
|
+
export const motionDurationSlow: string;
|
|
97
|
+
/** Page transitions */
|
|
98
|
+
export const motionDurationSlower: string;
|
|
99
|
+
/** General purpose */
|
|
100
|
+
export const motionEasingDefault: string;
|
|
101
|
+
/** Entering viewport */
|
|
102
|
+
export const motionEasingIn: string;
|
|
103
|
+
/** Leaving viewport */
|
|
104
|
+
export const motionEasingOut: string;
|
|
105
|
+
/** Playful overshoot */
|
|
106
|
+
export const motionEasingBounce: string;
|
|
107
|
+
/** Elastic snap */
|
|
108
|
+
export const motionEasingSpring: string;
|
|
109
|
+
export const borderRadiusNone: string;
|
|
110
|
+
/** 2px */
|
|
111
|
+
export const borderRadiusSm: string;
|
|
112
|
+
/** 6px */
|
|
113
|
+
export const borderRadiusMd: string;
|
|
114
|
+
/** 8px */
|
|
115
|
+
export const borderRadiusLg: string;
|
|
116
|
+
/** 12px */
|
|
117
|
+
export const borderRadiusXl: string;
|
|
118
|
+
/** 16px */
|
|
119
|
+
export const borderRadius2xl: string;
|
|
120
|
+
/** 24px */
|
|
121
|
+
export const borderRadius3xl: string;
|
|
122
|
+
export const borderRadiusFull: string;
|
|
123
|
+
export const borderWidth0: string;
|
|
124
|
+
export const borderWidth1: string;
|
|
125
|
+
export const borderWidth2: string;
|
|
126
|
+
export const borderWidth4: string;
|
|
127
|
+
export const shadowXs: string;
|
|
128
|
+
export const shadowSm: string;
|
|
129
|
+
export const shadowMd: string;
|
|
130
|
+
export const shadowLg: string;
|
|
131
|
+
export const shadowXl: string;
|
|
132
|
+
export const shadow2xl: string;
|
|
133
|
+
export const shadowNone: string;
|
|
134
|
+
export const zIndexHide: string;
|
|
135
|
+
export const zIndexAuto: string;
|
|
136
|
+
export const zIndexBase: string;
|
|
137
|
+
export const zIndexDocked: string;
|
|
138
|
+
export const zIndexDropdown: string;
|
|
139
|
+
export const zIndexSticky: string;
|
|
140
|
+
export const zIndexOverlay: string;
|
|
141
|
+
export const zIndexModal: string;
|
|
142
|
+
export const zIndexPopover: string;
|
|
143
|
+
export const zIndexToast: string;
|
|
144
|
+
export const zIndexTooltip: string;
|
|
145
|
+
export const spacing0: string;
|
|
146
|
+
/** 4px */
|
|
147
|
+
export const spacing1: string;
|
|
148
|
+
/** 8px */
|
|
149
|
+
export const spacing2: string;
|
|
150
|
+
/** 12px */
|
|
151
|
+
export const spacing3: string;
|
|
152
|
+
/** 16px */
|
|
153
|
+
export const spacing4: string;
|
|
154
|
+
/** 20px */
|
|
155
|
+
export const spacing5: string;
|
|
156
|
+
/** 24px */
|
|
157
|
+
export const spacing6: string;
|
|
158
|
+
/** 28px */
|
|
159
|
+
export const spacing7: string;
|
|
160
|
+
/** 32px */
|
|
161
|
+
export const spacing8: string;
|
|
162
|
+
/** 36px */
|
|
163
|
+
export const spacing9: string;
|
|
164
|
+
/** 40px */
|
|
165
|
+
export const spacing10: string;
|
|
166
|
+
/** 48px */
|
|
167
|
+
export const spacing12: string;
|
|
168
|
+
/** 56px */
|
|
169
|
+
export const spacing14: string;
|
|
170
|
+
/** 64px */
|
|
171
|
+
export const spacing16: string;
|
|
172
|
+
/** 80px */
|
|
173
|
+
export const spacing20: string;
|
|
174
|
+
/** 96px */
|
|
175
|
+
export const spacing24: string;
|
|
176
|
+
/** 112px */
|
|
177
|
+
export const spacing28: string;
|
|
178
|
+
/** 128px */
|
|
179
|
+
export const spacing32: string;
|
|
180
|
+
/** 144px */
|
|
181
|
+
export const spacing36: string;
|
|
182
|
+
/** 160px */
|
|
183
|
+
export const spacing40: string;
|
|
184
|
+
/** 192px */
|
|
185
|
+
export const spacing48: string;
|
|
186
|
+
/** 224px */
|
|
187
|
+
export const spacing56: string;
|
|
188
|
+
/** 256px */
|
|
189
|
+
export const spacing64: string;
|
|
190
|
+
export const spacingPx: string;
|
|
191
|
+
/** 2px */
|
|
192
|
+
export const spacing05: string;
|
|
193
|
+
/** 6px */
|
|
194
|
+
export const spacing15: string;
|
|
195
|
+
/** 10px */
|
|
196
|
+
export const spacing25: string;
|
|
197
|
+
/** 14px */
|
|
198
|
+
export const spacing35: string;
|
|
199
|
+
export const breakpointSm: string;
|
|
200
|
+
export const breakpointMd: string;
|
|
201
|
+
export const breakpointLg: string;
|
|
202
|
+
export const breakpointXl: string;
|
|
203
|
+
export const breakpoint2xl: string;
|
|
204
|
+
export const fontFamilySans: string;
|
|
205
|
+
export const fontFamilySerif: string;
|
|
206
|
+
export const fontFamilyMono: string;
|
|
207
|
+
/** 10px */
|
|
208
|
+
export const fontSize2xs: string;
|
|
209
|
+
/** 12px */
|
|
210
|
+
export const fontSizeXs: string;
|
|
211
|
+
/** 14px */
|
|
212
|
+
export const fontSizeSm: string;
|
|
213
|
+
/** 16px — base */
|
|
214
|
+
export const fontSizeMd: string;
|
|
215
|
+
/** 18px */
|
|
216
|
+
export const fontSizeLg: string;
|
|
217
|
+
/** 20px */
|
|
218
|
+
export const fontSizeXl: string;
|
|
219
|
+
/** 24px */
|
|
220
|
+
export const fontSize2xl: string;
|
|
221
|
+
/** 30px */
|
|
222
|
+
export const fontSize3xl: string;
|
|
223
|
+
/** 36px */
|
|
224
|
+
export const fontSize4xl: string;
|
|
225
|
+
/** 48px */
|
|
226
|
+
export const fontSize5xl: string;
|
|
227
|
+
/** 60px */
|
|
228
|
+
export const fontSize6xl: string;
|
|
229
|
+
export const fontWeightRegular: string;
|
|
230
|
+
export const fontWeightMedium: string;
|
|
231
|
+
export const fontWeightSemibold: string;
|
|
232
|
+
export const fontWeightBold: string;
|
|
233
|
+
export const fontWeightExtrabold: string;
|
|
234
|
+
export const fontLineHeightTight: string;
|
|
235
|
+
export const fontLineHeightSnug: string;
|
|
236
|
+
export const fontLineHeightNormal: string;
|
|
237
|
+
export const fontLineHeightRelaxed: string;
|
|
238
|
+
export const fontLineHeightLoose: string;
|
|
239
|
+
export const fontLetterSpacingTighter: string;
|
|
240
|
+
export const fontLetterSpacingTight: string;
|
|
241
|
+
export const fontLetterSpacingNormal: string;
|
|
242
|
+
export const fontLetterSpacingWide: string;
|
|
243
|
+
export const fontLetterSpacingWider: string;
|
|
244
|
+
export const fontLetterSpacingWidest: string;
|