@repobit/dex-system-design 0.21.2 → 0.22.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/CHANGELOG.md +11 -0
- package/package.json +4 -2
- package/src/components/Button/Button.js +7 -2
- package/src/components/Button/button.css.js +30 -0
- package/src/components/accordion/accordion-bg.stories.js +341 -171
- package/src/components/accordion/accordion.stories.js +345 -0
- package/src/components/anchor/anchor.stories.js +134 -76
- package/src/components/back/back.css.js +1 -1
- package/src/components/back/back.stories.js +301 -63
- package/src/components/badge/badge.js +4 -7
- package/src/components/badge/badge.stories.js +89 -96
- package/src/components/breadcrumb/breadcrumb.stories.js +167 -3
- package/src/components/cards/card.stories.js +153 -3
- package/src/components/display/display.css.js +7 -10
- package/src/components/display/display.js +14 -2
- package/src/components/display/display.stories.js +213 -219
- package/src/components/divider/divider.stories.js +337 -30
- package/src/components/footer/footer-lp.stories.js +346 -3
- package/src/components/footer/footer.js +0 -3
- package/src/components/footer/footer.stories.js +267 -4
- package/src/components/header/header.css.js +1 -1
- package/src/components/header/header.js +77 -56
- package/src/components/header/header.stories.js +298 -22
- package/src/components/heading/heading.css.js +1 -1
- package/src/components/heading/heading.stories.js +355 -113
- package/src/components/image/image.css.js +146 -98
- package/src/components/image/image.js +13 -2
- package/src/components/image/image.stories.js +546 -160
- package/src/components/input/custom-form.stories.js +209 -12
- package/src/components/link/link.css.js +2 -2
- package/src/components/link/link.stories.js +383 -53
- package/src/components/paragraph/paragraph.css.js +1 -1
- package/src/components/paragraph/paragraph.stories.js +365 -157
- package/src/components/picture/picture.css.js +209 -0
- package/src/components/picture/picture.js +16 -2
- package/src/components/picture/picture.stories.js +525 -180
- package/src/components/pricing-cards/new-pricing-card.js +19 -4
- package/src/components/pricing-cards/new-pricing-card.stories.js +422 -0
- package/src/components/pricing-cards/new-pricing.css.js +8 -0
- package/src/components/pricing-cards/pricing-card-actions.js +49 -9
- package/src/components/pricing-cards/pricing-card-container.css.js +1 -1
- package/src/components/pricing-cards/pricing-card-header.css.js +73 -63
- package/src/components/pricing-cards/pricing-card-header.js +44 -10
- package/src/components/pricing-cards/pricing-card-pricing.js +63 -64
- package/src/components/pricing-cards/pricing-card.css.js +7 -15
- package/src/components/pricing-cards/pricing-card.js +353 -270
- package/src/components/pricing-cards/pricing-card.stories.js +3 -3
- package/src/tokens/fonts.stories.js +335 -8
- package/src/tokens/spacing.stories.js +701 -34
- package/src/tokens/tokens-grid.stories.js +897 -48
- package/src/tokens/typography.stories.js +980 -38
- package/src/components/accordion/accordion-light.stories.js +0 -241
|
@@ -2,55 +2,722 @@ import { html } from 'lit';
|
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
title: 'Design Tokens/Spacing',
|
|
5
|
+
tags : ['autodocs'],
|
|
6
|
+
|
|
5
7
|
args: {
|
|
6
8
|
spaceNone: 'var(--space-none, 0)',
|
|
7
|
-
space4xs: 'var(--space-4xs, 0.125rem)',
|
|
8
|
-
space3xs: 'var(--space-3xs, 0.25rem)',
|
|
9
|
-
space2xs: 'var(--space-2xs, 0.5rem)',
|
|
10
|
-
spaceXs: 'var(--space-xs, 0.75rem)',
|
|
11
|
-
spaceSm: 'var(--space-sm, 1rem)',
|
|
12
|
-
spaceMd: 'var(--space-md, 1.5rem)',
|
|
13
|
-
spaceLg: 'var(--space-lg, 2rem)',
|
|
14
|
-
spaceXl: 'var(--space-xl, 2.5rem)',
|
|
15
|
-
space2xl: 'var(--space-2xl, 3rem)',
|
|
16
|
-
space3xl: 'var(--space-3xl, 4rem)',
|
|
17
|
-
space4xl: 'var(--space-4xl, 6rem)',
|
|
18
|
-
space5xl: 'var(--space-5xl, 8rem)'
|
|
9
|
+
space4xs : 'var(--space-4xs, 0.125rem)',
|
|
10
|
+
space3xs : 'var(--space-3xs, 0.25rem)',
|
|
11
|
+
space2xs : 'var(--space-2xs, 0.5rem)',
|
|
12
|
+
spaceXs : 'var(--space-xs, 0.75rem)',
|
|
13
|
+
spaceSm : 'var(--space-sm, 1rem)',
|
|
14
|
+
spaceMd : 'var(--space-md, 1.5rem)',
|
|
15
|
+
spaceLg : 'var(--space-lg, 2rem)',
|
|
16
|
+
spaceXl : 'var(--space-xl, 2.5rem)',
|
|
17
|
+
space2xl : 'var(--space-2xl, 3rem)',
|
|
18
|
+
space3xl : 'var(--space-3xl, 4rem)',
|
|
19
|
+
space4xl : 'var(--space-4xl, 6rem)',
|
|
20
|
+
space5xl : 'var(--space-5xl, 8rem)'
|
|
19
21
|
},
|
|
22
|
+
|
|
20
23
|
argTypes: {
|
|
21
|
-
spaceNone: {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
spaceNone: {
|
|
25
|
+
control : 'text',
|
|
26
|
+
name : '--space-none',
|
|
27
|
+
description: 'No spacing (0)',
|
|
28
|
+
table : {
|
|
29
|
+
type : { summary: 'string' },
|
|
30
|
+
defaultValue: { summary: '0' }
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
space4xs: {
|
|
34
|
+
control : 'text',
|
|
35
|
+
name : '--space-4xs',
|
|
36
|
+
description: 'Extra extra extra small spacing',
|
|
37
|
+
table : {
|
|
38
|
+
type : { summary: 'string' },
|
|
39
|
+
defaultValue: { summary: '0.125rem (2px)' }
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
space3xs: {
|
|
43
|
+
control : 'text',
|
|
44
|
+
name : '--space-3xs',
|
|
45
|
+
description: 'Extra extra small spacing',
|
|
46
|
+
table : {
|
|
47
|
+
type : { summary: 'string' },
|
|
48
|
+
defaultValue: { summary: '0.25rem (4px)' }
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
space2xs: {
|
|
52
|
+
control : 'text',
|
|
53
|
+
name : '--space-2xs',
|
|
54
|
+
description: 'Extra small spacing',
|
|
55
|
+
table : {
|
|
56
|
+
type : { summary: 'string' },
|
|
57
|
+
defaultValue: { summary: '0.5rem (8px)' }
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
spaceXs: {
|
|
61
|
+
control : 'text',
|
|
62
|
+
name : '--space-xs',
|
|
63
|
+
description: 'Extra small spacing',
|
|
64
|
+
table : {
|
|
65
|
+
type : { summary: 'string' },
|
|
66
|
+
defaultValue: { summary: '0.75rem (12px)' }
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
spaceSm: {
|
|
70
|
+
control : 'text',
|
|
71
|
+
name : '--space-sm',
|
|
72
|
+
description: 'Small spacing',
|
|
73
|
+
table : {
|
|
74
|
+
type : { summary: 'string' },
|
|
75
|
+
defaultValue: { summary: '1rem (16px)' }
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
spaceMd: {
|
|
79
|
+
control : 'text',
|
|
80
|
+
name : '--space-md',
|
|
81
|
+
description: 'Medium spacing',
|
|
82
|
+
table : {
|
|
83
|
+
type : { summary: 'string' },
|
|
84
|
+
defaultValue: { summary: '1.5rem (24px)' }
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
spaceLg: {
|
|
88
|
+
control : 'text',
|
|
89
|
+
name : '--space-lg',
|
|
90
|
+
description: 'Large spacing',
|
|
91
|
+
table : {
|
|
92
|
+
type : { summary: 'string' },
|
|
93
|
+
defaultValue: { summary: '2rem (32px)' }
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
spaceXl: {
|
|
97
|
+
control : 'text',
|
|
98
|
+
name : '--space-xl',
|
|
99
|
+
description: 'Extra large spacing',
|
|
100
|
+
table : {
|
|
101
|
+
type : { summary: 'string' },
|
|
102
|
+
defaultValue: { summary: '2.5rem (40px)' }
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
space2xl: {
|
|
106
|
+
control : 'text',
|
|
107
|
+
name : '--space-2xl',
|
|
108
|
+
description: 'Extra extra large spacing',
|
|
109
|
+
table : {
|
|
110
|
+
type : { summary: 'string' },
|
|
111
|
+
defaultValue: { summary: '3rem (48px)' }
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
space3xl: {
|
|
115
|
+
control : 'text',
|
|
116
|
+
name : '--space-3xl',
|
|
117
|
+
description: 'Extra extra extra large spacing',
|
|
118
|
+
table : {
|
|
119
|
+
type : { summary: 'string' },
|
|
120
|
+
defaultValue: { summary: '4rem (64px)' }
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
space4xl: {
|
|
124
|
+
control : 'text',
|
|
125
|
+
name : '--space-4xl',
|
|
126
|
+
description: 'Huge spacing',
|
|
127
|
+
table : {
|
|
128
|
+
type : { summary: 'string' },
|
|
129
|
+
defaultValue: { summary: '6rem (96px)' }
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
space5xl: {
|
|
133
|
+
control : 'text',
|
|
134
|
+
name : '--space-5xl',
|
|
135
|
+
description: 'Extra huge spacing',
|
|
136
|
+
table : {
|
|
137
|
+
type : { summary: 'string' },
|
|
138
|
+
defaultValue: { summary: '8rem (128px)' }
|
|
139
|
+
}
|
|
140
|
+
}
|
|
34
141
|
},
|
|
142
|
+
|
|
143
|
+
parameters: {
|
|
144
|
+
docs: {
|
|
145
|
+
description: {
|
|
146
|
+
component: `
|
|
147
|
+
# Spacing Design Tokens
|
|
148
|
+
|
|
149
|
+
Consistent spacing system using CSS custom properties for margin, padding, and gaps.
|
|
150
|
+
|
|
151
|
+
## Overview
|
|
152
|
+
|
|
153
|
+
The spacing system provides a consistent scale of spacing values based on rem units. Using CSS custom properties ensures consistency across the entire application and makes responsive design easier.
|
|
154
|
+
|
|
155
|
+
## Spacing Scale
|
|
156
|
+
|
|
157
|
+
The system follows a t-shirt size naming convention (xs, sm, md, lg, xl) with additional granularity for smaller increments.
|
|
158
|
+
|
|
159
|
+
## Usage
|
|
160
|
+
|
|
161
|
+
### Direct CSS Custom Properties
|
|
162
|
+
\`\`\`css
|
|
163
|
+
/* Using spacing tokens */
|
|
164
|
+
.element {
|
|
165
|
+
margin: var(--space-md);
|
|
166
|
+
padding: var(--space-sm) var(--space-lg);
|
|
167
|
+
gap: var(--space-xs);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/* Multiple values */
|
|
171
|
+
.container {
|
|
172
|
+
padding: var(--space-sm) var(--space-md) var(--space-lg) var(--space-xl);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/* Specific properties */
|
|
176
|
+
.card {
|
|
177
|
+
margin-top: var(--space-2xl);
|
|
178
|
+
margin-bottom: var(--space-lg);
|
|
179
|
+
}
|
|
180
|
+
\`\`\`
|
|
181
|
+
|
|
182
|
+
### In Component Properties
|
|
183
|
+
\`\`\`html
|
|
184
|
+
<style>
|
|
185
|
+
.custom-component {
|
|
186
|
+
--component-padding: var(--space-md);
|
|
187
|
+
--component-gap: var(--space-sm);
|
|
188
|
+
}
|
|
189
|
+
</style>
|
|
190
|
+
\`\`\`
|
|
191
|
+
|
|
192
|
+
## Spacing Tokens Reference
|
|
193
|
+
|
|
194
|
+
| Token | Value (rem) | Value (px) | Use Case |
|
|
195
|
+
|-------|-------------|------------|----------|
|
|
196
|
+
| \`--space-none\` | 0 | 0px | No spacing, reset margins/padding |
|
|
197
|
+
| \`--space-4xs\` | 0.125rem | 2px | Minimal spacing, tight layouts |
|
|
198
|
+
| \`--space-3xs\` | 0.25rem | 4px | Small spacing, icon padding |
|
|
199
|
+
| \`--space-2xs\` | 0.5rem | 8px | Compact spacing, dense UI |
|
|
200
|
+
| \`--space-xs\` | 0.75rem | 12px | Standard small spacing |
|
|
201
|
+
| \`--space-sm\` | 1rem | 16px | Small spacing, component padding |
|
|
202
|
+
| \`--space-md\` | 1.5rem | 24px | Medium spacing, default gap |
|
|
203
|
+
| \`--space-lg\` | 2rem | 32px | Large spacing, section margins |
|
|
204
|
+
| \`--space-xl\` | 2.5rem | 40px | Extra large spacing |
|
|
205
|
+
| \`--space-2xl\` | 3rem | 48px | Page section spacing |
|
|
206
|
+
| \`--space-3xl\` | 4rem | 64px | Large section spacing |
|
|
207
|
+
| \`--space-4xl\` | 6rem | 96px | Hero section spacing |
|
|
208
|
+
| \`--space-5xl\` | 8rem | 128px | Maximum spacing, full page |
|
|
209
|
+
|
|
210
|
+
## Base Unit
|
|
211
|
+
|
|
212
|
+
The system uses **rem** units based on the root font size (typically 16px). This ensures:
|
|
213
|
+
|
|
214
|
+
1. **Accessibility**: Respects user's browser font size settings
|
|
215
|
+
2. **Consistency**: Maintains proportional relationships
|
|
216
|
+
3. **Responsive**: Scales appropriately across breakpoints
|
|
217
|
+
|
|
218
|
+
## Best Practices
|
|
219
|
+
|
|
220
|
+
### 1. Use Tokens Consistently
|
|
221
|
+
\`\`\`css
|
|
222
|
+
/* Good ✅ */
|
|
223
|
+
margin: var(--space-md);
|
|
224
|
+
padding: var(--space-sm);
|
|
225
|
+
|
|
226
|
+
/* Bad ❌ */
|
|
227
|
+
margin: 16px;
|
|
228
|
+
padding: 1rem;
|
|
229
|
+
\`\`\`
|
|
230
|
+
|
|
231
|
+
### 2. Combine Tokens for Complex Spacing
|
|
232
|
+
\`\`\`css
|
|
233
|
+
/* Multi-direction spacing */
|
|
234
|
+
.element {
|
|
235
|
+
margin: var(--space-sm) var(--space-md);
|
|
236
|
+
padding: var(--space-xs) var(--space-lg);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/* Stacking with gap */
|
|
240
|
+
.grid {
|
|
241
|
+
display: grid;
|
|
242
|
+
gap: var(--space-md);
|
|
243
|
+
}
|
|
244
|
+
\`\`\`
|
|
245
|
+
|
|
246
|
+
### 3. Responsive Spacing
|
|
247
|
+
\`\`\`css
|
|
248
|
+
.container {
|
|
249
|
+
padding: var(--space-sm);
|
|
250
|
+
|
|
251
|
+
@media (min-width: 768px) {
|
|
252
|
+
padding: var(--space-md);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
@media (min-width: 1024px) {
|
|
256
|
+
padding: var(--space-lg);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
\`\`\`
|
|
260
|
+
|
|
261
|
+
### 4. Semantic Spacing
|
|
262
|
+
\`\`\`css
|
|
263
|
+
:root {
|
|
264
|
+
/* Define semantic spacing for components */
|
|
265
|
+
--button-padding: var(--space-xs) var(--space-sm);
|
|
266
|
+
--card-padding: var(--space-md);
|
|
267
|
+
--section-margin: var(--space-xl);
|
|
268
|
+
--form-gap: var(--space-sm);
|
|
269
|
+
}
|
|
270
|
+
\`\`\`
|
|
271
|
+
|
|
272
|
+
## Examples
|
|
273
|
+
|
|
274
|
+
### Button Spacing
|
|
275
|
+
\`\`\`css
|
|
276
|
+
.button {
|
|
277
|
+
padding: var(--space-xs) var(--space-sm);
|
|
278
|
+
margin-right: var(--space-xs);
|
|
279
|
+
}
|
|
280
|
+
\`\`\`
|
|
281
|
+
|
|
282
|
+
### Card Layout
|
|
283
|
+
\`\`\`css
|
|
284
|
+
.card {
|
|
285
|
+
padding: var(--space-md);
|
|
286
|
+
margin-bottom: var(--space-lg);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.card-content {
|
|
290
|
+
margin-top: var(--space-sm);
|
|
291
|
+
}
|
|
292
|
+
\`\`\`
|
|
293
|
+
|
|
294
|
+
### Grid System
|
|
295
|
+
\`\`\`css
|
|
296
|
+
.grid-container {
|
|
297
|
+
display: grid;
|
|
298
|
+
gap: var(--space-md);
|
|
299
|
+
padding: var(--space-lg);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.grid-item {
|
|
303
|
+
margin-bottom: var(--space-sm);
|
|
304
|
+
}
|
|
305
|
+
\`\`\`
|
|
306
|
+
|
|
307
|
+
### Form Layout
|
|
308
|
+
\`\`\`css
|
|
309
|
+
.form-group {
|
|
310
|
+
margin-bottom: var(--space-md);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.form-label {
|
|
314
|
+
margin-bottom: var(--space-xs);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.form-input {
|
|
318
|
+
padding: var(--space-xs) var(--space-sm);
|
|
319
|
+
}
|
|
320
|
+
\`\`\`
|
|
321
|
+
|
|
322
|
+
## Browser Support
|
|
323
|
+
|
|
324
|
+
CSS Custom Properties are supported in:
|
|
325
|
+
- Chrome 49+
|
|
326
|
+
- Firefox 31+
|
|
327
|
+
- Safari 9.1+
|
|
328
|
+
- Edge 16+
|
|
329
|
+
|
|
330
|
+
For older browsers, provide fallbacks:
|
|
331
|
+
\`\`\`css
|
|
332
|
+
.element {
|
|
333
|
+
margin: 1rem; /* Fallback */
|
|
334
|
+
margin: var(--space-sm);
|
|
335
|
+
}
|
|
336
|
+
\`\`\`
|
|
337
|
+
|
|
338
|
+
## Testing Visual Balance
|
|
339
|
+
|
|
340
|
+
Use the visualizer in this story to ensure spacing creates proper visual hierarchy and breathing room between elements. Each token is demonstrated with its actual spacing applied as padding.
|
|
341
|
+
`
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
35
345
|
};
|
|
36
346
|
|
|
37
347
|
export const AllSpacings = (args) => html`
|
|
38
348
|
<style>
|
|
349
|
+
:root {
|
|
350
|
+
--color-neutral-100: #f8f9fa;
|
|
351
|
+
--color-neutral-200: #e9ecef;
|
|
352
|
+
--color-neutral-300: #dee2e6;
|
|
353
|
+
--color-primary: #007bff;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
.spacing-container {
|
|
357
|
+
max-width: 800px;
|
|
358
|
+
margin: 0 auto;
|
|
359
|
+
padding: var(--space-lg);
|
|
360
|
+
background: white;
|
|
361
|
+
border-radius: 8px;
|
|
362
|
+
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.spacing-header {
|
|
366
|
+
margin-bottom: var(--space-xl);
|
|
367
|
+
padding-bottom: var(--space-sm);
|
|
368
|
+
border-bottom: 2px solid var(--color-neutral-300);
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
.spacing-title {
|
|
372
|
+
font-family: var(--font-family-sans, sans-serif);
|
|
373
|
+
font-size: 1.5rem;
|
|
374
|
+
font-weight: 600;
|
|
375
|
+
color: #212529;
|
|
376
|
+
margin: 0 0 var(--space-xs) 0;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.spacing-subtitle {
|
|
380
|
+
font-family: var(--font-family-sans, sans-serif);
|
|
381
|
+
font-size: 0.9rem;
|
|
382
|
+
color: #6c757d;
|
|
383
|
+
margin: 0;
|
|
384
|
+
}
|
|
385
|
+
|
|
39
386
|
.spacing-box {
|
|
40
|
-
background-color: var(--color-neutral-200
|
|
41
|
-
margin-bottom:
|
|
387
|
+
background-color: var(--color-neutral-200);
|
|
388
|
+
margin-bottom: var(--space-md);
|
|
389
|
+
border-radius: 4px;
|
|
390
|
+
border: 1px dashed var(--color-neutral-300);
|
|
391
|
+
transition: all 0.2s ease;
|
|
392
|
+
position: relative;
|
|
393
|
+
overflow: hidden;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
.spacing-box:hover {
|
|
397
|
+
background-color: var(--color-neutral-300);
|
|
398
|
+
transform: translateY(-2px);
|
|
399
|
+
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
.spacing-content {
|
|
403
|
+
font-family: var(--font-family-mono, monospace);
|
|
404
|
+
font-size: 0.9rem;
|
|
405
|
+
color: #495057;
|
|
406
|
+
line-height: 1.4;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
.spacing-token {
|
|
410
|
+
font-weight: 600;
|
|
411
|
+
color: var(--color-primary);
|
|
412
|
+
display: inline-block;
|
|
413
|
+
background: white;
|
|
414
|
+
padding: 2px 6px;
|
|
415
|
+
border-radius: 3px;
|
|
416
|
+
border: 1px solid var(--color-neutral-300);
|
|
417
|
+
margin-right: var(--space-xs);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
.spacing-value {
|
|
421
|
+
color: #6c757d;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
.spacing-visual {
|
|
425
|
+
position: absolute;
|
|
426
|
+
top: 0;
|
|
427
|
+
right: 0;
|
|
428
|
+
bottom: 0;
|
|
429
|
+
width: 60px;
|
|
430
|
+
background: repeating-linear-gradient(
|
|
431
|
+
45deg,
|
|
432
|
+
var(--color-neutral-300),
|
|
433
|
+
var(--color-neutral-300) 1px,
|
|
434
|
+
transparent 1px,
|
|
435
|
+
transparent 8px
|
|
436
|
+
);
|
|
437
|
+
opacity: 0.3;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
.legend {
|
|
441
|
+
display: flex;
|
|
442
|
+
align-items: center;
|
|
443
|
+
gap: var(--space-sm);
|
|
444
|
+
margin-top: var(--space-2xl);
|
|
445
|
+
padding: var(--space-md);
|
|
446
|
+
background: var(--color-neutral-100);
|
|
447
|
+
border-radius: 4px;
|
|
448
|
+
border-left: 4px solid var(--color-primary);
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
.legend-item {
|
|
452
|
+
display: flex;
|
|
453
|
+
align-items: center;
|
|
454
|
+
gap: var(--space-xs);
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
.legend-color {
|
|
458
|
+
width: 12px;
|
|
459
|
+
height: 12px;
|
|
460
|
+
border-radius: 2px;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
.legend-text {
|
|
464
|
+
font-family: var(--font-family-sans, sans-serif);
|
|
465
|
+
font-size: 0.85rem;
|
|
466
|
+
color: #495057;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
.usage-example {
|
|
470
|
+
margin-top: var(--space-xl);
|
|
471
|
+
padding: var(--space-md);
|
|
472
|
+
background: var(--color-neutral-100);
|
|
42
473
|
border-radius: 4px;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
.usage-title {
|
|
43
477
|
font-family: var(--font-family-sans, sans-serif);
|
|
44
478
|
font-weight: 600;
|
|
45
|
-
|
|
479
|
+
color: #212529;
|
|
480
|
+
margin: 0 0 var(--space-sm) 0;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
.code-block {
|
|
484
|
+
background: #1a1a1a;
|
|
485
|
+
color: #f8f8f2;
|
|
486
|
+
padding: var(--space-md);
|
|
487
|
+
border-radius: 4px;
|
|
488
|
+
font-family: var(--font-family-mono, monospace);
|
|
489
|
+
font-size: 0.85rem;
|
|
490
|
+
line-height: 1.5;
|
|
491
|
+
overflow-x: auto;
|
|
46
492
|
}
|
|
493
|
+
|
|
494
|
+
.code-comment { color: #6272a4; }
|
|
495
|
+
.code-property { color: #50fa7b; }
|
|
496
|
+
.code-value { color: #f1fa8c; }
|
|
497
|
+
.code-punctuation { color: #f8f8f2; }
|
|
47
498
|
</style>
|
|
48
499
|
|
|
49
|
-
<
|
|
50
|
-
|
|
51
|
-
<
|
|
52
|
-
|
|
500
|
+
<div class="spacing-container">
|
|
501
|
+
<div class="spacing-header">
|
|
502
|
+
<h1 class="spacing-title">Spacing Tokens</h1>
|
|
503
|
+
<p class="spacing-subtitle">Visual reference for all spacing design tokens</p>
|
|
504
|
+
</div>
|
|
505
|
+
|
|
506
|
+
<section>
|
|
507
|
+
${Object.entries(args).map(([key, value]) => html`
|
|
508
|
+
<div class="spacing-box" style="padding: ${value}">
|
|
509
|
+
<div class="spacing-visual"></div>
|
|
510
|
+
<div class="spacing-content">
|
|
511
|
+
<span class="spacing-token">${key.replace('space', '--space-').toLowerCase()}</span>
|
|
512
|
+
<span class="spacing-value">${value}</span>
|
|
513
|
+
</div>
|
|
514
|
+
</div>
|
|
515
|
+
`)}
|
|
516
|
+
</section>
|
|
517
|
+
|
|
518
|
+
<div class="legend">
|
|
519
|
+
<div class="legend-item">
|
|
520
|
+
<div class="legend-color" style="background: var(--color-neutral-200);"></div>
|
|
521
|
+
<span class="legend-text">Box background shows applied padding</span>
|
|
522
|
+
</div>
|
|
523
|
+
<div class="legend-item">
|
|
524
|
+
<div class="legend-color" style="background: repeating-linear-gradient(45deg, #dee2e6, #dee2e6 1px, transparent 1px, transparent 8px);"></div>
|
|
525
|
+
<span class="legend-text">Diagonal pattern indicates spacing area</span>
|
|
526
|
+
</div>
|
|
527
|
+
</div>
|
|
528
|
+
|
|
529
|
+
<div class="usage-example">
|
|
530
|
+
<h3 class="usage-title">Usage Example</h3>
|
|
531
|
+
<div class="code-block">
|
|
532
|
+
<span class="code-comment">/* Using spacing tokens in CSS */</span><br>
|
|
533
|
+
<span class="code-property">.card</span> {<br>
|
|
534
|
+
<span class="code-property">padding</span>: <span class="code-value">var(--space-md)</span><span class="code-punctuation">;</span><br>
|
|
535
|
+
<span class="code-property">margin-bottom</span>: <span class="code-value">var(--space-lg)</span><span class="code-punctuation">;</span><br>
|
|
536
|
+
}<br><br>
|
|
537
|
+
<span class="code-comment">/* Responsive spacing */</span><br>
|
|
538
|
+
<span class="code-property">.container</span> {<br>
|
|
539
|
+
<span class="code-property">padding</span>: <span class="code-value">var(--space-sm)</span><span class="code-punctuation">;</span><br>
|
|
540
|
+
}<br>
|
|
541
|
+
<span class="code-property">@media</span> (<span class="code-property">min-width</span>: <span class="code-value">768px</span>) {<br>
|
|
542
|
+
<span class="code-property">.container</span> {<br>
|
|
543
|
+
<span class="code-property">padding</span>: <span class="code-value">var(--space-lg)</span><span class="code-punctuation">;</span><br>
|
|
544
|
+
}<br>
|
|
545
|
+
}
|
|
53
546
|
</div>
|
|
54
|
-
|
|
55
|
-
</
|
|
547
|
+
</div>
|
|
548
|
+
</div>
|
|
56
549
|
`;
|
|
550
|
+
|
|
551
|
+
export const SpacingExamples = () => html`
|
|
552
|
+
<style>
|
|
553
|
+
.examples-container {
|
|
554
|
+
max-width: 800px;
|
|
555
|
+
margin: 0 auto;
|
|
556
|
+
padding: var(--space-lg);
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
.example-section {
|
|
560
|
+
margin-bottom: var(--space-xl);
|
|
561
|
+
padding: var(--space-lg);
|
|
562
|
+
background: white;
|
|
563
|
+
border-radius: 8px;
|
|
564
|
+
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
.example-title {
|
|
568
|
+
font-family: var(--font-family-sans, sans-serif);
|
|
569
|
+
font-size: 1.25rem;
|
|
570
|
+
font-weight: 600;
|
|
571
|
+
color: #212529;
|
|
572
|
+
margin: 0 0 var(--space-md) 0;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
.button-group {
|
|
576
|
+
display: flex;
|
|
577
|
+
gap: var(--space-sm);
|
|
578
|
+
flex-wrap: wrap;
|
|
579
|
+
margin-bottom: var(--space-md);
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
.button {
|
|
583
|
+
padding: var(--space-xs) var(--space-sm);
|
|
584
|
+
background: #007bff;
|
|
585
|
+
color: white;
|
|
586
|
+
border: none;
|
|
587
|
+
border-radius: 4px;
|
|
588
|
+
font-family: var(--font-family-sans, sans-serif);
|
|
589
|
+
font-size: 0.9rem;
|
|
590
|
+
cursor: pointer;
|
|
591
|
+
transition: background 0.2s;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
.button:hover {
|
|
595
|
+
background: #0056b3;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
.card-grid {
|
|
599
|
+
display: grid;
|
|
600
|
+
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
|
|
601
|
+
gap: var(--space-md);
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
.card {
|
|
605
|
+
padding: var(--space-md);
|
|
606
|
+
background: var(--color-neutral-100, #f8f9fa);
|
|
607
|
+
border-radius: 6px;
|
|
608
|
+
border: 1px solid var(--color-neutral-300, #dee2e6);
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
.card-title {
|
|
612
|
+
font-family: var(--font-family-sans, sans-serif);
|
|
613
|
+
font-weight: 600;
|
|
614
|
+
margin: 0 0 var(--space-xs) 0;
|
|
615
|
+
color: #212529;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
.card-content {
|
|
619
|
+
font-family: var(--font-family-sans, sans-serif);
|
|
620
|
+
font-size: 0.9rem;
|
|
621
|
+
color: #6c757d;
|
|
622
|
+
margin: 0;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
.form-group {
|
|
626
|
+
margin-bottom: var(--space-md);
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
.form-label {
|
|
630
|
+
display: block;
|
|
631
|
+
font-family: var(--font-family-sans, sans-serif);
|
|
632
|
+
font-weight: 600;
|
|
633
|
+
margin-bottom: var(--space-xs);
|
|
634
|
+
color: #495057;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
.form-input {
|
|
638
|
+
width: 100%;
|
|
639
|
+
padding: var(--space-xs) var(--space-sm);
|
|
640
|
+
border: 1px solid var(--color-neutral-300, #dee2e6);
|
|
641
|
+
border-radius: 4px;
|
|
642
|
+
font-family: var(--font-family-sans, sans-serif);
|
|
643
|
+
font-size: 0.9rem;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
.spacing-visual {
|
|
647
|
+
display: flex;
|
|
648
|
+
align-items: center;
|
|
649
|
+
gap: var(--space-md);
|
|
650
|
+
padding: var(--space-lg);
|
|
651
|
+
background: linear-gradient(45deg, #f8f9fa, #e9ecef);
|
|
652
|
+
border-radius: 6px;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
.spacing-dot {
|
|
656
|
+
width: var(--space-sm);
|
|
657
|
+
height: var(--space-sm);
|
|
658
|
+
background: #007bff;
|
|
659
|
+
border-radius: 50%;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
.spacing-label {
|
|
663
|
+
font-family: var(--font-family-mono, monospace);
|
|
664
|
+
font-size: 0.85rem;
|
|
665
|
+
color: #495057;
|
|
666
|
+
background: white;
|
|
667
|
+
padding: 2px 6px;
|
|
668
|
+
border-radius: 3px;
|
|
669
|
+
border: 1px solid #dee2e6;
|
|
670
|
+
}
|
|
671
|
+
</style>
|
|
672
|
+
|
|
673
|
+
<div class="examples-container">
|
|
674
|
+
<div class="example-section">
|
|
675
|
+
<h3 class="example-title">Button Spacing</h3>
|
|
676
|
+
<div class="button-group">
|
|
677
|
+
<button class="button" style="padding: var(--space-xs) var(--space-sm);">Small Button</button>
|
|
678
|
+
<button class="button" style="padding: var(--space-sm) var(--space-md);">Medium Button</button>
|
|
679
|
+
<button class="button" style="padding: var(--space-md) var(--space-lg);">Large Button</button>
|
|
680
|
+
</div>
|
|
681
|
+
<p style="font-family: var(--font-family-sans, sans-serif); color: #6c757d; font-size: 0.9rem;">
|
|
682
|
+
Buttons use consistent padding tokens: --space-xs/--space-sm, --space-sm/--space-md, --space-md/--space-lg
|
|
683
|
+
</p>
|
|
684
|
+
</div>
|
|
685
|
+
|
|
686
|
+
<div class="example-section">
|
|
687
|
+
<h3 class="example-title">Card Grid</h3>
|
|
688
|
+
<div class="card-grid">
|
|
689
|
+
${[1, 2, 3].map(i => html`
|
|
690
|
+
<div class="card">
|
|
691
|
+
<h4 class="card-title">Card ${i}</h4>
|
|
692
|
+
<p class="card-content">This card uses --space-md for padding and the grid uses --space-md for gaps.</p>
|
|
693
|
+
</div>
|
|
694
|
+
`)}
|
|
695
|
+
</div>
|
|
696
|
+
</div>
|
|
697
|
+
|
|
698
|
+
<div class="example-section">
|
|
699
|
+
<h3 class="example-title">Form Layout</h3>
|
|
700
|
+
<div class="form-group">
|
|
701
|
+
<label class="form-label">Email Address</label>
|
|
702
|
+
<input type="email" class="form-input" placeholder="Enter your email">
|
|
703
|
+
</div>
|
|
704
|
+
<div class="form-group">
|
|
705
|
+
<label class="form-label">Password</label>
|
|
706
|
+
<input type="password" class="form-input" placeholder="Enter your password">
|
|
707
|
+
</div>
|
|
708
|
+
<button class="button" style="margin-top: var(--space-md);">Submit</button>
|
|
709
|
+
</div>
|
|
710
|
+
|
|
711
|
+
<div class="example-section">
|
|
712
|
+
<h3 class="example-title">Spacing Visualization</h3>
|
|
713
|
+
<div class="spacing-visual">
|
|
714
|
+
<div class="spacing-dot"></div>
|
|
715
|
+
<span class="spacing-label">--space-sm (1rem)</span>
|
|
716
|
+
<div class="spacing-dot" style="width: var(--space-md); height: var(--space-md);"></div>
|
|
717
|
+
<span class="spacing-label">--space-md (1.5rem)</span>
|
|
718
|
+
<div class="spacing-dot" style="width: var(--space-lg); height: var(--space-lg);"></div>
|
|
719
|
+
<span class="spacing-label">--space-lg (2rem)</span>
|
|
720
|
+
</div>
|
|
721
|
+
</div>
|
|
722
|
+
</div>
|
|
723
|
+
`;
|