@beam-ui/design-tokens 1.0.0 → 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/CHANGELOG.md +6 -0
- package/LICENSE +21 -0
- package/README.md +207 -321
- package/package.json +2 -2
- package/USAGE.md +0 -286
package/CHANGELOG.md
CHANGED
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Tatari
|
|
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
CHANGED
|
@@ -1,394 +1,280 @@
|
|
|
1
1
|
# Beam UI Design Tokens
|
|
2
2
|
|
|
3
|
-
A centralized collection of design decisions and other artifacts for the Beam UI Design System.
|
|
4
|
-
|
|
5
|
-
> **For usage and consumption documentation**, see [USAGE.md](./USAGE.md) (included in the npm package).
|
|
3
|
+
A centralized collection of design decisions and other artifacts for the Beam UI Design System.
|
|
6
4
|
|
|
7
5
|
## Overview
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
Design tokens are the visual design atoms — specifically, they are named entities that store various design decisions. This package provides these tokens in multiple formats for consistent use across applications.
|
|
10
8
|
|
|
11
9
|
## Installation
|
|
12
10
|
|
|
13
11
|
```bash
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
## Building Tokens
|
|
19
|
-
|
|
20
|
-
To build the design tokens into all output formats:
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
yarn build
|
|
12
|
+
npm install @beam-ui/design-tokens
|
|
13
|
+
# or
|
|
14
|
+
yarn add @beam-ui/design-tokens
|
|
24
15
|
```
|
|
25
16
|
|
|
26
|
-
|
|
27
|
-
- **CSS Variables** (`variables.css`)
|
|
28
|
-
- **JavaScript ES6** (`tokens.es6.js`)
|
|
29
|
-
- **JSON** (`tokens.json`)
|
|
30
|
-
|
|
31
|
-
All generated files are located in the `build/` directory, organized by layer:
|
|
32
|
-
- `build/globals/` - Global tokens (breakpoints, accessibility, etc.)
|
|
33
|
-
- `build/base/` - Default base tokens (colors, fonts, spacing, etc.)
|
|
34
|
-
- `build/semantic/` - Default semantic tokens (buttons, typography, etc.)
|
|
35
|
-
- `build/{brand}/base/` - Brand-specific base tokens (if custom brands exist)
|
|
36
|
-
- `build/{brand}/semantic/` - Brand-specific semantic tokens (if custom brands exist)
|
|
17
|
+
## Available Output Formats
|
|
37
18
|
|
|
38
|
-
|
|
19
|
+
All tokens are available in three formats:
|
|
20
|
+
- **CSS Variables** (`variables.css`) - CSS custom properties
|
|
21
|
+
- **JavaScript ES6** (`tokens.es6.js`) - ES6 module exports
|
|
22
|
+
- **JSON** (`tokens.json`) - Nested JSON structure
|
|
39
23
|
|
|
40
|
-
|
|
24
|
+
## Token Layers
|
|
41
25
|
|
|
42
26
|
Tokens are organized in three layers:
|
|
43
27
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
-
|
|
47
|
-
- `a11y.js` - Accessibility-related tokens (touch target sizes, etc.)
|
|
28
|
+
- **`build/globals/`** - Global tokens (breakpoints, accessibility, etc.)
|
|
29
|
+
- **`build/base/`** - Default base tokens (colors, fonts, spacing, etc.)
|
|
30
|
+
- **`build/semantic/`** - Default semantic tokens (buttons, typography, etc.)
|
|
48
31
|
|
|
49
|
-
|
|
50
|
-
Default foundation design values:
|
|
51
|
-
- `color.js` - Color palette including brand colors, color scales, and utility colors
|
|
52
|
-
- `font.js` - Font families, sizes, line heights, letter spacing
|
|
53
|
-
- `spacing.js` - Spacing scale
|
|
54
|
-
- `border.js` - Border radius and width values
|
|
32
|
+
Brand-specific tokens can be found at `build/{brand}/base/` and `build/{brand}/semantic/` if custom brands exist.
|
|
55
33
|
|
|
56
|
-
|
|
57
|
-
Default component-specific tokens that reference base tokens:
|
|
58
|
-
- `color.js` - Semantic color assignments (text, background, border, icon, status, etc.)
|
|
59
|
-
- `typography.js` - Typography styles (headings, body text, captions, etc.)
|
|
60
|
-
- `button.js` - Button component tokens (variants, states, sizes, etc.)
|
|
34
|
+
## Usage
|
|
61
35
|
|
|
62
|
-
|
|
63
|
-
Optional brand overrides following the same base/semantic structure
|
|
36
|
+
### Using CSS Variables
|
|
64
37
|
|
|
65
|
-
|
|
38
|
+
#### Important: Semantic Tokens Require Base and Global Tokens
|
|
66
39
|
|
|
67
|
-
|
|
68
|
-
- `value` - The token value (can be a literal value or reference to another token)
|
|
69
|
-
- `type` - The token type (color, dimension, fontSize, fontFamily, etc.)
|
|
40
|
+
**Semantic CSS tokens reference base and global tokens using CSS custom properties (`var()`)**, which means you must import all token files in the correct order for semantic tokens to work correctly.
|
|
70
41
|
|
|
71
|
-
|
|
72
|
-
```javascript
|
|
73
|
-
export default {
|
|
74
|
-
color: {
|
|
75
|
-
'tatari-red': {
|
|
76
|
-
value: 'hsl(2, 72%, 46%)',
|
|
77
|
-
type: 'color'
|
|
78
|
-
},
|
|
79
|
-
gray: {
|
|
80
|
-
black: {
|
|
81
|
-
value: 'hsl(0, 0%, 0%)',
|
|
82
|
-
type: 'color'
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
```
|
|
42
|
+
#### Recommended Import Order
|
|
88
43
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
background: {
|
|
95
|
-
value: '{color.gray.black}', // References base token
|
|
96
|
-
type: 'color'
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
};
|
|
44
|
+
```css
|
|
45
|
+
/* Import in this order: */
|
|
46
|
+
@import '@beam-ui/design-tokens/build/globals/variables.css';
|
|
47
|
+
@import '@beam-ui/design-tokens/build/base/variables.css';
|
|
48
|
+
@import '@beam-ui/design-tokens/build/semantic/variables.css';
|
|
101
49
|
```
|
|
102
50
|
|
|
103
|
-
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
// ❌ Incorrect (CSS Color Level 4 slash syntax not supported)
|
|
109
|
-
value: 'hsl(0 0% 0% / 0.3)'
|
|
51
|
+
Or in your HTML:
|
|
52
|
+
```html
|
|
53
|
+
<link rel="stylesheet" href="node_modules/@beam-ui/design-tokens/build/globals/variables.css">
|
|
54
|
+
<link rel="stylesheet" href="node_modules/@beam-ui/design-tokens/build/base/variables.css">
|
|
55
|
+
<link rel="stylesheet" href="node_modules/@beam-ui/design-tokens/build/semantic/variables.css">
|
|
110
56
|
```
|
|
111
57
|
|
|
112
|
-
|
|
58
|
+
#### Why All Three Files Are Required
|
|
113
59
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
Add tokens to the appropriate file in `src/tokens/base/`, `src/tokens/semantic/`, or `src/tokens/globals/`:
|
|
117
|
-
|
|
118
|
-
```javascript
|
|
119
|
-
// Example: Adding a new spacing value to src/tokens/base/spacing.js
|
|
120
|
-
export default {
|
|
121
|
-
spacing: {
|
|
122
|
-
'xxxx-large': {
|
|
123
|
-
value: '6.4rem',
|
|
124
|
-
type: 'dimension'
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
```
|
|
60
|
+
Tokens use `var()` references to maintain relationships across all layers:
|
|
129
61
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
62
|
+
```css
|
|
63
|
+
/* 1. Global tokens define shared values */
|
|
64
|
+
:root {
|
|
65
|
+
--breakpoint-medium: 768px;
|
|
66
|
+
--a11y-min-touch-target: 40px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* 2. Base tokens define the actual brand values */
|
|
70
|
+
:root {
|
|
71
|
+
--color-gray-black: hsl(0, 0%, 0%);
|
|
72
|
+
--color-gray-white: hsl(0, 0%, 100%);
|
|
73
|
+
--color-transparent: hsla(0, 0%, 0%, 0);
|
|
74
|
+
--font-size-medium: 1.6rem;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* 3. Semantic tokens reference base and global tokens */
|
|
78
|
+
:root {
|
|
79
|
+
--button-primary-background: var(--color-gray-black);
|
|
80
|
+
--button-primary-text: var(--color-gray-white);
|
|
81
|
+
--button-tertiary-border: var(--color-transparent);
|
|
82
|
+
--button-primary-font-size: var(--font-size-medium);
|
|
83
|
+
--button-size-sm-min-width: var(--a11y-min-touch-target);
|
|
84
|
+
}
|
|
134
85
|
```
|
|
135
86
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
Check the generated files in `build/base/` and `build/semantic/` to ensure your tokens are correctly transformed.
|
|
139
|
-
|
|
140
|
-
## Build Architecture
|
|
87
|
+
#### Benefits of This Approach
|
|
141
88
|
|
|
142
|
-
|
|
89
|
+
- **Single source of truth** - Update base token values and all semantic tokens automatically reflect the change
|
|
90
|
+
- **Smaller file sizes** - References are more efficient than duplicated values
|
|
91
|
+
- **Runtime flexibility** - Override base tokens to theme entire components
|
|
92
|
+
- **Maintainability** - Clear relationships between foundation and application layers
|
|
143
93
|
|
|
144
|
-
|
|
145
|
-
- Shared across all brands
|
|
146
|
-
- Responsive breakpoints, accessibility values
|
|
147
|
-
- Output: `build/globals/`
|
|
148
|
-
- Available for reference by brand tokens
|
|
149
|
-
|
|
150
|
-
### Base Tokens
|
|
151
|
-
- Default foundation values (colors, spacing, fonts, borders)
|
|
152
|
-
- No component-specific tokens
|
|
153
|
-
- Output: `build/base/`
|
|
154
|
-
- Used as references by semantic tokens
|
|
155
|
-
|
|
156
|
-
### Semantic Tokens
|
|
157
|
-
- Component and context-specific tokens
|
|
158
|
-
- Reference base and global tokens for values
|
|
159
|
-
- Output: `build/semantic/`
|
|
160
|
-
- **CSS format uses `var()` references** - maintains relationships with base tokens
|
|
161
|
-
- **JS/JSON formats use resolved values** - self-contained for programmatic use
|
|
94
|
+
#### Using Only Base Tokens
|
|
162
95
|
|
|
163
|
-
|
|
164
|
-
- Custom brand overrides can be added to `src/tokens/brands/{brand}/`
|
|
165
|
-
- Automatically detected and built to `build/{brand}/base/` and `build/{brand}/semantic/`
|
|
166
|
-
- Follow the same structure as default tokens
|
|
96
|
+
If you only need base tokens (colors, spacing, fonts) without semantic tokens, you can import just the base and global files:
|
|
167
97
|
|
|
168
|
-
### Reference Behavior
|
|
169
|
-
|
|
170
|
-
**CSS Output:**
|
|
171
98
|
```css
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
99
|
+
@import '@beam-ui/design-tokens/build/globals/variables.css';
|
|
100
|
+
@import '@beam-ui/design-tokens/build/base/variables.css';
|
|
101
|
+
|
|
102
|
+
.custom-button {
|
|
103
|
+
background-color: var(--color-gray-black);
|
|
104
|
+
padding: var(--spacing-medium);
|
|
105
|
+
font-size: var(--font-size-medium);
|
|
106
|
+
min-height: var(--a11y-min-touch-target);
|
|
107
|
+
}
|
|
180
108
|
```
|
|
181
109
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
The build system uses transforms that:
|
|
185
|
-
- **Remove the 'brand' keyword** from token paths for cleaner names
|
|
186
|
-
- **Convert colors** - Uses `color/hsl` for CSS and JS/JSON
|
|
187
|
-
- **Maintain sizes in rem units** - Using the `size/rem` transform
|
|
188
|
-
- **Apply naming conventions** per platform:
|
|
189
|
-
- **CSS:** kebab-case (`--color-tatari-red`)
|
|
190
|
-
- **JavaScript:** camelCase (`colorTatariRed`)
|
|
191
|
-
- **JSON:** kebab-case nested structure
|
|
192
|
-
|
|
193
|
-
### Custom Transforms
|
|
194
|
-
|
|
195
|
-
Located in `src/transforms/`:
|
|
196
|
-
- `name-kebab-no-brand.js` - Converts names to kebab-case and removes 'brand' from path
|
|
197
|
-
- `name-camel-no-brand.js` - Converts names to camelCase and removes 'brand' from path
|
|
198
|
-
|
|
199
|
-
## Available Filters
|
|
110
|
+
**Note:** Base tokens may reference global tokens (like accessibility values), so it's recommended to include globals even when not using semantic tokens.
|
|
200
111
|
|
|
201
|
-
|
|
112
|
+
### Using JavaScript/TypeScript Tokens
|
|
202
113
|
|
|
203
|
-
|
|
204
|
-
Filters tokens to exclude global tokens from brand builds. This ensures:
|
|
205
|
-
- Global tokens are available for references in brand tokens
|
|
206
|
-
- Brand builds contain only brand-specific tokens
|
|
207
|
-
- Clean separation between global and brand-specific layers
|
|
114
|
+
JavaScript and JSON formats output resolved values, so semantic tokens can be used independently:
|
|
208
115
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
- Semantic build contains only component-specific tokens
|
|
213
|
-
- Clean separation between foundation and application layers
|
|
214
|
-
|
|
215
|
-
Located in `src/filters/`:
|
|
216
|
-
- `brand-only.js`
|
|
217
|
-
- `semantic-only.js`
|
|
218
|
-
|
|
219
|
-
## Adding a New Brand
|
|
220
|
-
|
|
221
|
-
1. Create a new brand directory:
|
|
222
|
-
```bash
|
|
223
|
-
mkdir -p src/tokens/brands/{brand-name}
|
|
224
|
-
mkdir -p src/tokens/brands/{brand-name}/semantic
|
|
225
|
-
```
|
|
226
|
-
|
|
227
|
-
2. Add base token files (color.js, font.js, spacing.js, etc.) in the brand directory
|
|
228
|
-
|
|
229
|
-
3. Add semantic token files in the semantic subdirectory
|
|
116
|
+
```javascript
|
|
117
|
+
// Semantic tokens contain resolved values
|
|
118
|
+
import { buttonPrimaryBackground, buttonPrimaryText } from '@beam-ui/design-tokens/build/semantic/tokens.es6.js';
|
|
230
119
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
120
|
+
const button = {
|
|
121
|
+
backgroundColor: buttonPrimaryBackground, // "hsl(0, 0%, 0%)"
|
|
122
|
+
color: buttonPrimaryText // "hsl(0, 0%, 100%)"
|
|
123
|
+
};
|
|
234
124
|
```
|
|
235
125
|
|
|
236
|
-
|
|
126
|
+
#### Importing Base Tokens
|
|
237
127
|
|
|
238
|
-
|
|
128
|
+
```javascript
|
|
129
|
+
import { colorGrayBlack, fontSizeMedium, spacingLarge } from '@beam-ui/design-tokens/build/base/tokens.es6.js';
|
|
239
130
|
|
|
131
|
+
const styles = {
|
|
132
|
+
color: colorGrayBlack, // "hsl(0, 0%, 0%)"
|
|
133
|
+
fontSize: fontSizeMedium, // "1.6rem"
|
|
134
|
+
padding: spacingLarge // "2.4rem"
|
|
135
|
+
};
|
|
240
136
|
```
|
|
241
|
-
design-tokens/
|
|
242
|
-
├── .changeset/ # Changeset files for version management
|
|
243
|
-
├── build/ # Generated output files (git-ignored)
|
|
244
|
-
│ ├── globals/ # Global tokens output
|
|
245
|
-
│ │ ├── variables.css
|
|
246
|
-
│ │ ├── tokens.es6.js
|
|
247
|
-
│ │ └── tokens.json
|
|
248
|
-
│ ├── base/ # Default base tokens output
|
|
249
|
-
│ │ ├── variables.css
|
|
250
|
-
│ │ ├── tokens.es6.js
|
|
251
|
-
│ │ └── tokens.json
|
|
252
|
-
│ └── semantic/ # Default semantic tokens output
|
|
253
|
-
│ ├── variables.css
|
|
254
|
-
│ ├── tokens.es6.js
|
|
255
|
-
│ └── tokens.json
|
|
256
|
-
├── src/ # Source files
|
|
257
|
-
│ ├── tokens/ # Token definitions
|
|
258
|
-
│ │ ├── base/ # Default base tokens
|
|
259
|
-
│ │ │ ├── color.js
|
|
260
|
-
│ │ │ ├── font.js
|
|
261
|
-
│ │ │ ├── spacing.js
|
|
262
|
-
│ │ │ └── border.js
|
|
263
|
-
│ │ ├── semantic/ # Default semantic tokens
|
|
264
|
-
│ │ │ ├── color.js
|
|
265
|
-
│ │ │ ├── typography.js
|
|
266
|
-
│ │ │ └── button.js
|
|
267
|
-
│ │ ├── brands/ # Optional brand overrides (empty by default)
|
|
268
|
-
│ │ └── globals/ # Global tokens
|
|
269
|
-
│ │ ├── breakpoints.js
|
|
270
|
-
│ │ └── a11y.js
|
|
271
|
-
│ ├── transforms/ # Custom transforms
|
|
272
|
-
│ │ ├── name-kebab-no-brand.js
|
|
273
|
-
│ │ ├── name-camel-no-brand.js
|
|
274
|
-
│ │ └── index.js
|
|
275
|
-
│ └── filters/ # Custom filters
|
|
276
|
-
│ ├── brand-only.js
|
|
277
|
-
│ ├── semantic-only.js
|
|
278
|
-
│ └── index.js
|
|
279
|
-
├── build.js # Style Dictionary configuration
|
|
280
|
-
├── package.json
|
|
281
|
-
├── CHANGELOG.md # Auto-generated changelog
|
|
282
|
-
├── USAGE.md # Usage documentation (included in npm package)
|
|
283
|
-
└── README.md # This file (development documentation)
|
|
284
|
-
```
|
|
285
|
-
|
|
286
|
-
## Scripts
|
|
287
|
-
|
|
288
|
-
- `yarn build` - Build all design tokens
|
|
289
|
-
- `yarn clean` - Remove all generated files
|
|
290
|
-
- `yarn prepublishOnly` - Clean and rebuild before publishing to npm
|
|
291
|
-
- `yarn changeset` - Create a new changeset to document your changes
|
|
292
|
-
- `yarn version` - Apply changesets and update version/changelog
|
|
293
|
-
- `yarn release` - Publish updated packages to npm
|
|
294
|
-
|
|
295
|
-
## Configuration
|
|
296
|
-
|
|
297
|
-
### build.js
|
|
298
|
-
|
|
299
|
-
The build configuration defines:
|
|
300
|
-
- **Transform groups** - Collections of transforms for each output format (CSS, JS, JSON)
|
|
301
|
-
- **Platform configs** - Output format specifications and file destinations
|
|
302
|
-
- **Filter application** - Which tokens to include in each build
|
|
303
|
-
- **Reference handling** - CSS uses `outputReferences: true` to preserve token relationships
|
|
304
137
|
|
|
305
|
-
|
|
306
|
-
- `getGlobalsTokensConfig()` - Builds global tokens
|
|
307
|
-
- `getDefaultBaseTokensConfig()` - Builds default base tokens
|
|
308
|
-
- `getDefaultSemanticTokensConfig()` - Builds default semantic tokens
|
|
309
|
-
- `getBaseTokensConfig(brand)` - Builds brand-specific base tokens
|
|
310
|
-
- `getSemanticTokensConfig(brand)` - Builds brand-specific semantic tokens
|
|
311
|
-
- `getBrands()` - Automatically detects brands in `src/tokens/brands/`
|
|
138
|
+
#### Importing Global Tokens
|
|
312
139
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
- **style-dictionary** (^5.1.1) - Token transformation engine
|
|
316
|
-
- **@changesets/cli** (^2.29.7) - Version management and changelog generation
|
|
317
|
-
|
|
318
|
-
## Release Management
|
|
319
|
-
|
|
320
|
-
This package uses [Changesets](https://github.com/changesets/changesets) to manage versions and changelogs.
|
|
321
|
-
|
|
322
|
-
### Creating a Changeset
|
|
323
|
-
|
|
324
|
-
When making changes, create a changeset to document them:
|
|
140
|
+
```javascript
|
|
141
|
+
import { breakpointMedium, a11yMinTouchTarget } from '@beam-ui/design-tokens/build/globals/tokens.es6.js';
|
|
325
142
|
|
|
326
|
-
|
|
327
|
-
|
|
143
|
+
const config = {
|
|
144
|
+
breakpoint: breakpointMedium, // "768px"
|
|
145
|
+
minTouchSize: a11yMinTouchTarget // "40px"
|
|
146
|
+
};
|
|
328
147
|
```
|
|
329
148
|
|
|
330
|
-
|
|
149
|
+
### Using JSON Tokens
|
|
331
150
|
|
|
332
|
-
|
|
151
|
+
JSON format provides a nested structure:
|
|
333
152
|
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
```bash
|
|
337
|
-
# Update version and changelog
|
|
338
|
-
yarn version
|
|
153
|
+
```javascript
|
|
154
|
+
import tokens from '@beam-ui/design-tokens/build/semantic/tokens.json';
|
|
339
155
|
|
|
340
|
-
|
|
341
|
-
|
|
156
|
+
console.log(tokens.button.primary.background); // "hsl(0, 0%, 0%)"
|
|
157
|
+
console.log(tokens.color.background.primary); // "hsl(0, 0%, 100%)"
|
|
342
158
|
```
|
|
343
159
|
|
|
344
|
-
##
|
|
160
|
+
## Token Reference
|
|
345
161
|
|
|
346
|
-
|
|
162
|
+
### Global Tokens
|
|
347
163
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
- ❌ `button-black-bg`
|
|
164
|
+
**Breakpoints**
|
|
165
|
+
- `breakpoint-small`, `breakpoint-medium`, `breakpoint-large`, `breakpoint-x-large`
|
|
351
166
|
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
- Use single quotes for consistency
|
|
167
|
+
**Accessibility**
|
|
168
|
+
- `a11y-min-touch-target` - Minimum touch target size for interactive elements
|
|
355
169
|
|
|
356
|
-
|
|
357
|
-
- Reference base tokens: `value: '{color.gray.black}'`
|
|
358
|
-
- Don't duplicate values in semantic tokens
|
|
170
|
+
### Base Tokens
|
|
359
171
|
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
172
|
+
**Colors**
|
|
173
|
+
- Brand colors: `color-tatari-red`, `color-tatari-blue`, etc.
|
|
174
|
+
- Gray scale: `color-gray-black`, `color-gray-800` through `color-gray-50`, `color-gray-white`
|
|
175
|
+
- Color palettes: `color-red-*`, `color-blue-*`, `color-green-*`, etc. (100-700 scales)
|
|
176
|
+
- Special: `color-transparent`, `color-overlay-dark`, `color-overlay-light`
|
|
364
177
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
178
|
+
**Typography**
|
|
179
|
+
- Font sizes: `font-size-xx-small` through `font-size-xxx-large`
|
|
180
|
+
- Line heights: `line-height-xx-small` through `line-height-xxx-large`
|
|
181
|
+
- Letter spacing: `letter-spacing-xx-small` through `letter-spacing-xxx-large`
|
|
368
182
|
|
|
369
|
-
|
|
183
|
+
**Spacing**
|
|
184
|
+
- `spacing-xx-small` through `spacing-xxx-large`
|
|
370
185
|
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
186
|
+
**Borders**
|
|
187
|
+
- Border radius: `border-radius-xx-small` through `border-radius-xxx-large`, `border-radius-circle`
|
|
188
|
+
- Border width: `border-width-thin`, `border-width-regular`, `border-width-thick`
|
|
374
189
|
|
|
375
|
-
|
|
190
|
+
### Semantic Tokens
|
|
376
191
|
|
|
377
|
-
|
|
378
|
-
|
|
192
|
+
**Button Tokens**
|
|
193
|
+
- Variants: `button-primary-*`, `button-secondary-*`, `button-tertiary-*`
|
|
194
|
+
- Danger states: `button-danger-primary-*`, `button-danger-secondary-*`
|
|
195
|
+
- States: `-background`, `-background-hover`, `-background-active`, `-background-disabled`
|
|
196
|
+
- Text: `-text`, `-text-hover`, `-text-active`, `-text-disabled`
|
|
197
|
+
- Border: `-border`, `-border-hover`, `-border-active`, `-border-disabled`
|
|
198
|
+
- Sizes: `button-size-sm-*`, `button-size-md-*`, `button-size-lg-*`
|
|
199
|
+
|
|
200
|
+
**Color Tokens**
|
|
201
|
+
- Background: `color-background-primary`, `color-background-secondary`, etc.
|
|
202
|
+
- Surface: `color-surface-primary`, `color-surface-hover`, etc.
|
|
203
|
+
- Border: `color-border-primary`, `color-border-focus`, etc.
|
|
204
|
+
- Text: `color-text-primary`, `color-text-link`, etc.
|
|
205
|
+
- Icon: `color-icon-primary`, `color-icon-interactive`, etc.
|
|
206
|
+
- Interactive states: `color-interactive-primary-default`, etc.
|
|
207
|
+
- Status colors: `color-status-success-base`, `color-status-error-base`, etc.
|
|
208
|
+
- Brand colors: `color-brand-primary-base`, `color-brand-secondary-base`, etc.
|
|
209
|
+
|
|
210
|
+
**Typography Tokens**
|
|
211
|
+
- Headings: `typography-heading-100-*` through `typography-heading-600-*`
|
|
212
|
+
- Body text: `typography-body-100-*`, `typography-body-200-*`
|
|
213
|
+
- Captions: `typography-caption-100-*`, `typography-caption-200-*`
|
|
214
|
+
- Properties: `-font-size`, `-line-height`, `-letter-spacing`
|
|
215
|
+
|
|
216
|
+
## Examples
|
|
217
|
+
|
|
218
|
+
### Complete Button Component (CSS)
|
|
379
219
|
|
|
380
|
-
|
|
381
|
-
|
|
220
|
+
```css
|
|
221
|
+
/* Import all required token files */
|
|
222
|
+
@import '@beam-ui/design-tokens/build/globals/variables.css';
|
|
223
|
+
@import '@beam-ui/design-tokens/build/base/variables.css';
|
|
224
|
+
@import '@beam-ui/design-tokens/build/semantic/variables.css';
|
|
225
|
+
|
|
226
|
+
.button-primary {
|
|
227
|
+
background-color: var(--button-primary-background);
|
|
228
|
+
color: var(--button-primary-text);
|
|
229
|
+
border: var(--button-primary-border-width) solid var(--button-primary-border);
|
|
230
|
+
border-radius: var(--button-primary-border-radius);
|
|
231
|
+
font-size: var(--button-primary-font-size);
|
|
232
|
+
line-height: var(--button-primary-line-height);
|
|
233
|
+
padding-inline: var(--button-size-md-padding-inline);
|
|
234
|
+
padding-block: var(--button-size-md-padding-block);
|
|
235
|
+
min-width: var(--button-size-md-min-width);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.button-primary:hover {
|
|
239
|
+
background-color: var(--button-primary-background-hover);
|
|
240
|
+
color: var(--button-primary-text-hover);
|
|
241
|
+
border-color: var(--button-primary-border-hover);
|
|
242
|
+
}
|
|
243
|
+
```
|
|
382
244
|
|
|
383
|
-
###
|
|
384
|
-
|
|
245
|
+
### React Component with TypeScript
|
|
246
|
+
|
|
247
|
+
```typescript
|
|
248
|
+
import {
|
|
249
|
+
buttonPrimaryBackground,
|
|
250
|
+
buttonPrimaryText,
|
|
251
|
+
buttonPrimaryBorderRadius,
|
|
252
|
+
buttonSizeMdPaddingInline,
|
|
253
|
+
buttonSizeMdPaddingBlock
|
|
254
|
+
} from '@beam-ui/design-tokens/build/semantic/tokens.es6.js';
|
|
255
|
+
|
|
256
|
+
interface ButtonProps {
|
|
257
|
+
children: React.ReactNode;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
export const Button: React.FC<ButtonProps> = ({ children }) => {
|
|
261
|
+
return (
|
|
262
|
+
<button
|
|
263
|
+
style={{
|
|
264
|
+
backgroundColor: buttonPrimaryBackground,
|
|
265
|
+
color: buttonPrimaryText,
|
|
266
|
+
borderRadius: buttonPrimaryBorderRadius,
|
|
267
|
+
paddingInline: buttonSizeMdPaddingInline,
|
|
268
|
+
paddingBlock: buttonSizeMdPaddingBlock
|
|
269
|
+
}}
|
|
270
|
+
>
|
|
271
|
+
{children}
|
|
272
|
+
</button>
|
|
273
|
+
);
|
|
274
|
+
};
|
|
275
|
+
```
|
|
385
276
|
|
|
386
277
|
## License
|
|
387
278
|
|
|
388
|
-
MIT
|
|
389
|
-
|
|
390
|
-
## Related Documentation
|
|
279
|
+
MIT License - see [LICENSE](./LICENSE) file for details
|
|
391
280
|
|
|
392
|
-
- [USAGE.md](./USAGE.md) - Package usage and consumption guide
|
|
393
|
-
- [Style Dictionary Documentation](https://styledictionary.com/)
|
|
394
|
-
- [Design Tokens W3C Community Group](https://www.w3.org/community/design-tokens/)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@beam-ui/design-tokens",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "A collection of design decisions and other artifacts for the Beam UI Design System",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./build/base/tokens.es6.js",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
|
12
12
|
"build",
|
|
13
|
-
"
|
|
13
|
+
"README.md",
|
|
14
14
|
"LICENSE",
|
|
15
15
|
"CHANGELOG.md"
|
|
16
16
|
],
|
package/USAGE.md
DELETED
|
@@ -1,286 +0,0 @@
|
|
|
1
|
-
# Beam UI Design Tokens - Usage Guide
|
|
2
|
-
|
|
3
|
-
A centralized collection of design decisions and other artifacts for the Beam UI Design System.
|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
|
|
7
|
-
Design tokens are the visual design atoms — specifically, they are named entities that store various design decisions. This package provides these tokens in multiple formats for consistent use across applications.
|
|
8
|
-
|
|
9
|
-
## Installation
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
npm install @beam-ui/design-tokens
|
|
13
|
-
# or
|
|
14
|
-
yarn add @beam-ui/design-tokens
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Available Output Formats
|
|
18
|
-
|
|
19
|
-
All tokens are available in three formats:
|
|
20
|
-
- **CSS Variables** (`variables.css`) - CSS custom properties
|
|
21
|
-
- **JavaScript ES6** (`tokens.es6.js`) - ES6 module exports
|
|
22
|
-
- **JSON** (`tokens.json`) - Nested JSON structure
|
|
23
|
-
|
|
24
|
-
## Token Layers
|
|
25
|
-
|
|
26
|
-
Tokens are organized in three layers:
|
|
27
|
-
|
|
28
|
-
- **`build/globals/`** - Global tokens (breakpoints, accessibility, etc.)
|
|
29
|
-
- **`build/base/`** - Default base tokens (colors, fonts, spacing, etc.)
|
|
30
|
-
- **`build/semantic/`** - Default semantic tokens (buttons, typography, etc.)
|
|
31
|
-
|
|
32
|
-
Brand-specific tokens can be found at `build/{brand}/base/` and `build/{brand}/semantic/` if custom brands exist.
|
|
33
|
-
|
|
34
|
-
## Usage
|
|
35
|
-
|
|
36
|
-
### Using CSS Variables
|
|
37
|
-
|
|
38
|
-
#### Important: Semantic Tokens Require Base and Global Tokens
|
|
39
|
-
|
|
40
|
-
**Semantic CSS tokens reference base and global tokens using CSS custom properties (`var()`)**, which means you must import all token files in the correct order for semantic tokens to work correctly.
|
|
41
|
-
|
|
42
|
-
#### Recommended Import Order
|
|
43
|
-
|
|
44
|
-
```css
|
|
45
|
-
/* Import in this order: */
|
|
46
|
-
@import '@beam-ui/design-tokens/build/globals/variables.css';
|
|
47
|
-
@import '@beam-ui/design-tokens/build/base/variables.css';
|
|
48
|
-
@import '@beam-ui/design-tokens/build/semantic/variables.css';
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
Or in your HTML:
|
|
52
|
-
```html
|
|
53
|
-
<link rel="stylesheet" href="node_modules/@beam-ui/design-tokens/build/globals/variables.css">
|
|
54
|
-
<link rel="stylesheet" href="node_modules/@beam-ui/design-tokens/build/base/variables.css">
|
|
55
|
-
<link rel="stylesheet" href="node_modules/@beam-ui/design-tokens/build/semantic/variables.css">
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
#### Why All Three Files Are Required
|
|
59
|
-
|
|
60
|
-
Tokens use `var()` references to maintain relationships across all layers:
|
|
61
|
-
|
|
62
|
-
```css
|
|
63
|
-
/* 1. Global tokens define shared values */
|
|
64
|
-
:root {
|
|
65
|
-
--breakpoint-medium: 768px;
|
|
66
|
-
--a11y-min-touch-target: 40px;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/* 2. Base tokens define the actual brand values */
|
|
70
|
-
:root {
|
|
71
|
-
--color-gray-black: hsl(0, 0%, 0%);
|
|
72
|
-
--color-gray-white: hsl(0, 0%, 100%);
|
|
73
|
-
--color-transparent: hsla(0, 0%, 0%, 0);
|
|
74
|
-
--font-size-medium: 1.6rem;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/* 3. Semantic tokens reference base and global tokens */
|
|
78
|
-
:root {
|
|
79
|
-
--button-primary-background: var(--color-gray-black);
|
|
80
|
-
--button-primary-text: var(--color-gray-white);
|
|
81
|
-
--button-tertiary-border: var(--color-transparent);
|
|
82
|
-
--button-primary-font-size: var(--font-size-medium);
|
|
83
|
-
--button-size-sm-min-width: var(--a11y-min-touch-target);
|
|
84
|
-
}
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
#### Benefits of This Approach
|
|
88
|
-
|
|
89
|
-
- **Single source of truth** - Update base token values and all semantic tokens automatically reflect the change
|
|
90
|
-
- **Smaller file sizes** - References are more efficient than duplicated values
|
|
91
|
-
- **Runtime flexibility** - Override base tokens to theme entire components
|
|
92
|
-
- **Maintainability** - Clear relationships between foundation and application layers
|
|
93
|
-
|
|
94
|
-
#### Using Only Base Tokens
|
|
95
|
-
|
|
96
|
-
If you only need base tokens (colors, spacing, fonts) without semantic tokens, you can import just the base and global files:
|
|
97
|
-
|
|
98
|
-
```css
|
|
99
|
-
@import '@beam-ui/design-tokens/build/globals/variables.css';
|
|
100
|
-
@import '@beam-ui/design-tokens/build/base/variables.css';
|
|
101
|
-
|
|
102
|
-
.custom-button {
|
|
103
|
-
background-color: var(--color-gray-black);
|
|
104
|
-
padding: var(--spacing-medium);
|
|
105
|
-
font-size: var(--font-size-medium);
|
|
106
|
-
min-height: var(--a11y-min-touch-target);
|
|
107
|
-
}
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
**Note:** Base tokens may reference global tokens (like accessibility values), so it's recommended to include globals even when not using semantic tokens.
|
|
111
|
-
|
|
112
|
-
### Using JavaScript/TypeScript Tokens
|
|
113
|
-
|
|
114
|
-
JavaScript and JSON formats output resolved values, so semantic tokens can be used independently:
|
|
115
|
-
|
|
116
|
-
```javascript
|
|
117
|
-
// Semantic tokens contain resolved values
|
|
118
|
-
import { buttonPrimaryBackground, buttonPrimaryText } from '@beam-ui/design-tokens/build/semantic/tokens.es6.js';
|
|
119
|
-
|
|
120
|
-
const button = {
|
|
121
|
-
backgroundColor: buttonPrimaryBackground, // "hsl(0, 0%, 0%)"
|
|
122
|
-
color: buttonPrimaryText // "hsl(0, 0%, 100%)"
|
|
123
|
-
};
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
#### Importing Base Tokens
|
|
127
|
-
|
|
128
|
-
```javascript
|
|
129
|
-
import { colorGrayBlack, fontSizeMedium, spacingLarge } from '@beam-ui/design-tokens/build/base/tokens.es6.js';
|
|
130
|
-
|
|
131
|
-
const styles = {
|
|
132
|
-
color: colorGrayBlack, // "hsl(0, 0%, 0%)"
|
|
133
|
-
fontSize: fontSizeMedium, // "1.6rem"
|
|
134
|
-
padding: spacingLarge // "2.4rem"
|
|
135
|
-
};
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
#### Importing Global Tokens
|
|
139
|
-
|
|
140
|
-
```javascript
|
|
141
|
-
import { breakpointMedium, a11yMinTouchTarget } from '@beam-ui/design-tokens/build/globals/tokens.es6.js';
|
|
142
|
-
|
|
143
|
-
const config = {
|
|
144
|
-
breakpoint: breakpointMedium, // "768px"
|
|
145
|
-
minTouchSize: a11yMinTouchTarget // "40px"
|
|
146
|
-
};
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
### Using JSON Tokens
|
|
150
|
-
|
|
151
|
-
JSON format provides a nested structure:
|
|
152
|
-
|
|
153
|
-
```javascript
|
|
154
|
-
import tokens from '@beam-ui/design-tokens/build/semantic/tokens.json';
|
|
155
|
-
|
|
156
|
-
console.log(tokens.button.primary.background); // "hsl(0, 0%, 0%)"
|
|
157
|
-
console.log(tokens.color.background.primary); // "hsl(0, 0%, 100%)"
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
## Token Reference
|
|
161
|
-
|
|
162
|
-
### Global Tokens
|
|
163
|
-
|
|
164
|
-
**Breakpoints**
|
|
165
|
-
- `breakpoint-small`, `breakpoint-medium`, `breakpoint-large`, `breakpoint-x-large`
|
|
166
|
-
|
|
167
|
-
**Accessibility**
|
|
168
|
-
- `a11y-min-touch-target` - Minimum touch target size for interactive elements
|
|
169
|
-
|
|
170
|
-
### Base Tokens
|
|
171
|
-
|
|
172
|
-
**Colors**
|
|
173
|
-
- Brand colors: `color-tatari-red`, `color-tatari-blue`, etc.
|
|
174
|
-
- Gray scale: `color-gray-black`, `color-gray-800` through `color-gray-50`, `color-gray-white`
|
|
175
|
-
- Color palettes: `color-red-*`, `color-blue-*`, `color-green-*`, etc. (100-700 scales)
|
|
176
|
-
- Special: `color-transparent`, `color-overlay-dark`, `color-overlay-light`
|
|
177
|
-
|
|
178
|
-
**Typography**
|
|
179
|
-
- Font sizes: `font-size-xx-small` through `font-size-xxx-large`
|
|
180
|
-
- Line heights: `line-height-xx-small` through `line-height-xxx-large`
|
|
181
|
-
- Letter spacing: `letter-spacing-xx-small` through `letter-spacing-xxx-large`
|
|
182
|
-
|
|
183
|
-
**Spacing**
|
|
184
|
-
- `spacing-xx-small` through `spacing-xxx-large`
|
|
185
|
-
|
|
186
|
-
**Borders**
|
|
187
|
-
- Border radius: `border-radius-xx-small` through `border-radius-xxx-large`, `border-radius-circle`
|
|
188
|
-
- Border width: `border-width-thin`, `border-width-regular`, `border-width-thick`
|
|
189
|
-
|
|
190
|
-
### Semantic Tokens
|
|
191
|
-
|
|
192
|
-
**Button Tokens**
|
|
193
|
-
- Variants: `button-primary-*`, `button-secondary-*`, `button-tertiary-*`
|
|
194
|
-
- Danger states: `button-danger-primary-*`, `button-danger-secondary-*`
|
|
195
|
-
- States: `-background`, `-background-hover`, `-background-active`, `-background-disabled`
|
|
196
|
-
- Text: `-text`, `-text-hover`, `-text-active`, `-text-disabled`
|
|
197
|
-
- Border: `-border`, `-border-hover`, `-border-active`, `-border-disabled`
|
|
198
|
-
- Sizes: `button-size-sm-*`, `button-size-md-*`, `button-size-lg-*`
|
|
199
|
-
|
|
200
|
-
**Color Tokens**
|
|
201
|
-
- Background: `color-background-primary`, `color-background-secondary`, etc.
|
|
202
|
-
- Surface: `color-surface-primary`, `color-surface-hover`, etc.
|
|
203
|
-
- Border: `color-border-primary`, `color-border-focus`, etc.
|
|
204
|
-
- Text: `color-text-primary`, `color-text-link`, etc.
|
|
205
|
-
- Icon: `color-icon-primary`, `color-icon-interactive`, etc.
|
|
206
|
-
- Interactive states: `color-interactive-primary-default`, etc.
|
|
207
|
-
- Status colors: `color-status-success-base`, `color-status-error-base`, etc.
|
|
208
|
-
- Brand colors: `color-brand-primary-base`, `color-brand-secondary-base`, etc.
|
|
209
|
-
|
|
210
|
-
**Typography Tokens**
|
|
211
|
-
- Headings: `typography-heading-100-*` through `typography-heading-600-*`
|
|
212
|
-
- Body text: `typography-body-100-*`, `typography-body-200-*`
|
|
213
|
-
- Captions: `typography-caption-100-*`, `typography-caption-200-*`
|
|
214
|
-
- Properties: `-font-size`, `-line-height`, `-letter-spacing`
|
|
215
|
-
|
|
216
|
-
## Examples
|
|
217
|
-
|
|
218
|
-
### Complete Button Component (CSS)
|
|
219
|
-
|
|
220
|
-
```css
|
|
221
|
-
/* Import all required token files */
|
|
222
|
-
@import '@beam-ui/design-tokens/build/globals/variables.css';
|
|
223
|
-
@import '@beam-ui/design-tokens/build/base/variables.css';
|
|
224
|
-
@import '@beam-ui/design-tokens/build/semantic/variables.css';
|
|
225
|
-
|
|
226
|
-
.button-primary {
|
|
227
|
-
background-color: var(--button-primary-background);
|
|
228
|
-
color: var(--button-primary-text);
|
|
229
|
-
border: var(--button-primary-border-width) solid var(--button-primary-border);
|
|
230
|
-
border-radius: var(--button-primary-border-radius);
|
|
231
|
-
font-size: var(--button-primary-font-size);
|
|
232
|
-
line-height: var(--button-primary-line-height);
|
|
233
|
-
padding-inline: var(--button-size-md-padding-inline);
|
|
234
|
-
padding-block: var(--button-size-md-padding-block);
|
|
235
|
-
min-width: var(--button-size-md-min-width);
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
.button-primary:hover {
|
|
239
|
-
background-color: var(--button-primary-background-hover);
|
|
240
|
-
color: var(--button-primary-text-hover);
|
|
241
|
-
border-color: var(--button-primary-border-hover);
|
|
242
|
-
}
|
|
243
|
-
```
|
|
244
|
-
|
|
245
|
-
### React Component with TypeScript
|
|
246
|
-
|
|
247
|
-
```typescript
|
|
248
|
-
import {
|
|
249
|
-
buttonPrimaryBackground,
|
|
250
|
-
buttonPrimaryText,
|
|
251
|
-
buttonPrimaryBorderRadius,
|
|
252
|
-
buttonSizeMdPaddingInline,
|
|
253
|
-
buttonSizeMdPaddingBlock
|
|
254
|
-
} from '@beam-ui/design-tokens/build/semantic/tokens.es6.js';
|
|
255
|
-
|
|
256
|
-
interface ButtonProps {
|
|
257
|
-
children: React.ReactNode;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
export const Button: React.FC<ButtonProps> = ({ children }) => {
|
|
261
|
-
return (
|
|
262
|
-
<button
|
|
263
|
-
style={{
|
|
264
|
-
backgroundColor: buttonPrimaryBackground,
|
|
265
|
-
color: buttonPrimaryText,
|
|
266
|
-
borderRadius: buttonPrimaryBorderRadius,
|
|
267
|
-
paddingInline: buttonSizeMdPaddingInline,
|
|
268
|
-
paddingBlock: buttonSizeMdPaddingBlock
|
|
269
|
-
}}
|
|
270
|
-
>
|
|
271
|
-
{children}
|
|
272
|
-
</button>
|
|
273
|
-
);
|
|
274
|
-
};
|
|
275
|
-
```
|
|
276
|
-
|
|
277
|
-
## Support
|
|
278
|
-
|
|
279
|
-
For issues, questions, or contributions, please visit:
|
|
280
|
-
- [GitHub Repository](https://github.com/tatari-tv/beam-ui)
|
|
281
|
-
- [Issue Tracker](https://github.com/tatari-tv/beam-ui/issues)
|
|
282
|
-
|
|
283
|
-
## License
|
|
284
|
-
|
|
285
|
-
MIT
|
|
286
|
-
|