@ttoss/theme 1.7.22 → 1.7.23

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.
@@ -1,568 +0,0 @@
1
- import { Theme } from 'theme-ui';
2
- import { fontSizes } from '../../tokens/fontSizes';
3
- import { fontWeights } from '../../tokens/fontWeights';
4
- import { letterSpacings } from '../../tokens/letterSpacings';
5
- import { lineHeights } from '../../tokens/lineHeights';
6
- import { space } from '../../tokens/space';
7
- import { zIndices } from '../../tokens/zIndices';
8
-
9
- const coreFonts = {
10
- main: '"Atkinson Hyperlegible", sans-serif',
11
- contrast: '"Work Sans", sans-serif',
12
- monospace: '"Inconsolata", sans-serif',
13
- };
14
-
15
- const brandColors = {
16
- complimentary: '#f4f3f3',
17
- main: '#292C2a',
18
- darkNeutral: '#325C82',
19
- accent: '#0469E3',
20
- lightNeutral: '#F8F8F8',
21
- };
22
-
23
- const coreColors = {
24
- ...brandColors,
25
- gray100: '#f9f9f9',
26
- gray200: '#dedede',
27
- gray300: '#c4c4c4',
28
- gray400: '#ababab',
29
- gray500: '#929292',
30
- gray600: '#7a7a7a',
31
- gray700: '#626262',
32
- gray800: '#4c4c4c',
33
- gray900: '#323232',
34
- black: '#000000',
35
- red100: '#ffebeb',
36
- red200: '#fdbfbf',
37
- red300: '#f99595',
38
- red400: '#f56c6c',
39
- red500: '#ef4444',
40
- red600: '#e42828',
41
- red700: '#c62121',
42
- white: '#ffffff',
43
- amber600: '#d97706',
44
- teal600: '#0d9488',
45
- };
46
-
47
- const coreBorders = {
48
- none: '0px solid',
49
- thin: '1px solid',
50
- medium: '2px solid',
51
- thick: '4px solid',
52
- };
53
-
54
- const coreRadii = {
55
- sharp: '0px',
56
- xs: '2px',
57
- sm: '4px',
58
- md: '6px',
59
- lg: '8px',
60
- xl: '12px',
61
- '2xl': '16px',
62
- '3xl': '24px',
63
- circle: '9999px',
64
- };
65
-
66
- export const BruttalTheme: Theme = {
67
- /**
68
- * Tokens
69
- */
70
- fontSizes,
71
- fontWeights,
72
- letterSpacings,
73
- space,
74
- lineHeights,
75
- zIndices,
76
- colors: {
77
- background: coreColors.complimentary,
78
- text: coreColors.black,
79
- muted: coreColors.gray200,
80
- onMuted: coreColors.gray600,
81
- mutedOutline: coreColors.gray300,
82
- danger: coreColors.red700,
83
- onDanger: coreColors.white,
84
- notice: coreColors.amber600,
85
- onNotice: coreColors.white,
86
- positive: coreColors.teal600,
87
- onPositive: coreColors.white,
88
- surface: coreColors.white,
89
- contentHeader: coreColors.gray200,
90
- onContentHeader: coreColors.black,
91
- outline: coreColors.gray500,
92
- primary: coreColors.main,
93
- onPrimary: coreColors.white,
94
- secondary: coreColors.gray100,
95
- onSecondary: coreColors.black,
96
- highlight: coreColors.darkNeutral,
97
- onHighlight: coreColors.complimentary,
98
- accent: coreColors.accent,
99
- onAccent: coreColors.white,
100
- neutral: coreColors.darkNeutral,
101
- onNeutral: coreColors.lightNeutral,
102
- underemphasize: coreColors.gray300,
103
- },
104
- fonts: {
105
- main: coreColors.main,
106
- contrast: coreFonts.contrast,
107
- body: coreFonts.main,
108
- highlight: coreFonts.main,
109
- caption: coreFonts.main,
110
- },
111
- borders: {
112
- default: coreBorders.thin,
113
- secondary: coreBorders.medium,
114
- muted: coreBorders.thin,
115
- interaction: coreBorders.medium,
116
- danger: coreBorders.medium,
117
- highlight: coreBorders.medium,
118
- },
119
- radii: {
120
- informative: coreRadii.xs,
121
- default: coreRadii.sm,
122
- action: coreRadii.sm,
123
- },
124
- /**
125
- * Global styles
126
- */
127
- styles: {
128
- root: {
129
- fontFamily: 'body',
130
- fontWeight: 'normal',
131
- fontSize: 'base',
132
- zIndex: 'base',
133
- margin: 0,
134
- padding: 0,
135
- backgroundColor: 'background',
136
- /**
137
- * HTML elements
138
- */
139
- table: {
140
- borderCollapse: 'collapse',
141
- },
142
- th: {
143
- paddingX: 'md',
144
- paddingY: 'md',
145
- },
146
- tr: {
147
- borderBottom: 'default',
148
- },
149
- td: {
150
- paddingX: 'xl',
151
- paddingY: 'md',
152
- },
153
- },
154
- a: {
155
- color: 'text',
156
- fontFamily: 'body',
157
- textDecorationLine: 'underline',
158
- lineHeight: 'base',
159
- '&.quiet:not(:hover)': {
160
- textDecorationLine: 'none',
161
- },
162
- ':visited': {
163
- color: 'highlight',
164
- },
165
- },
166
- },
167
- /**
168
- * Components
169
- */
170
- badges: {
171
- positive: {
172
- color: 'onPositive',
173
- bg: 'positive',
174
- },
175
- negative: {
176
- color: 'onDanger',
177
- bg: 'danger',
178
- },
179
- neutral: {
180
- color: 'onSecondary',
181
- bg: 'secondary',
182
- border: 'muted',
183
- borderColor: 'onMuted',
184
- },
185
- informative: {
186
- color: 'onNotice',
187
- bg: 'notice',
188
- },
189
- muted: {
190
- color: 'onMuted',
191
- bg: 'muted',
192
- },
193
- },
194
- buttons: {
195
- accent: {
196
- backgroundColor: 'accent',
197
- color: 'onAccent',
198
- borderRadius: 'action',
199
- borderColor: 'accent',
200
- ':hover:not(:active,[disabled])': {
201
- filter: 'brightness(90%)',
202
- },
203
- ':disabled': {
204
- cursor: 'default',
205
- backgroundColor: 'muted',
206
- borderColor: 'muted',
207
- color: 'onMuted',
208
- },
209
- },
210
- primary: {
211
- backgroundColor: 'primary',
212
- color: 'onPrimary',
213
- borderRadius: 'action',
214
- borderColor: 'primary',
215
- ':hover:not(:active,[disabled])': {
216
- filter: 'brightness(90%)',
217
- },
218
- ':active': {
219
- backgroundColor: 'primary',
220
- color: 'onPrimary',
221
- borderColor: 'outline',
222
- },
223
- ':disabled': {
224
- cursor: 'default',
225
- backgroundColor: 'muted',
226
- borderColor: 'muted',
227
- color: 'onMuted',
228
- },
229
- },
230
- secondary: {
231
- backgroundColor: 'secondary',
232
- color: 'onSecondary',
233
- borderRadius: 'action',
234
- border: 'secondary',
235
- borderColor: 'onSecondary',
236
- ':hover:not(:active,[disabled])': {
237
- filter: 'brightness(90%)',
238
- },
239
- ':disabled': {
240
- cursor: 'default',
241
- backgroundColor: 'muted',
242
- borderColor: 'muted',
243
- color: 'onMuted',
244
- },
245
- },
246
- destructive: {
247
- color: 'onDanger',
248
- backgroundColor: 'danger',
249
- ':hover:not(:active,[disabled])': {
250
- filter: 'brightness(90%)',
251
- },
252
- ':disabled': {
253
- cursor: 'default',
254
- backgroundColor: 'muted',
255
- borderColor: 'muted',
256
- color: 'onMuted',
257
- },
258
- },
259
- closeButton: {
260
- backgroundColor: 'background',
261
- color: 'primary',
262
- border: 'default',
263
- borderColor: 'primary',
264
- borderRadius: 'action',
265
- ':disabled': {
266
- border: 'muted',
267
- borderColor: 'onMuted',
268
- backgroundColor: 'muted',
269
- color: 'onMuted',
270
- cursor: 'not-allowed',
271
- },
272
- ':is(:focus-within, :hover):not(:disabled)': {
273
- color: 'onHighlight',
274
- backgroundColor: 'highlight',
275
- borderColor: 'highlight',
276
- },
277
- },
278
- actionButton: {
279
- default: {
280
- backgroundColor: 'secondary',
281
- color: 'onSecondary',
282
- border: 'default',
283
- borderColor: 'onSecondary',
284
- transition: 'all 0.2s',
285
- ':is(:focus-within, :hover)': {
286
- backgroundColor: 'highlight',
287
- borderColor: 'highlight',
288
- color: 'onHighlight',
289
- },
290
- },
291
- accent: {
292
- backgroundColor: 'accent',
293
- color: 'onAccent',
294
- border: 'none',
295
- },
296
- quiet: {
297
- backgroundColor: 'transparent',
298
- color: 'text',
299
- border: 'none',
300
- borderColor: 'transparent',
301
- },
302
- },
303
- },
304
- cards: {
305
- primary: {
306
- backgroundColor: 'primary',
307
- border: '1px solid black',
308
- padding: [4, 5],
309
- display: 'flex',
310
- flexDirection: 'column',
311
- alignItems: 'center',
312
- width: 'fit-content',
313
- },
314
- },
315
- forms: {
316
- label: {
317
- color: 'text',
318
- '&:is([aria-disabled="true"])': {
319
- color: 'onMuted',
320
- },
321
- '& > span[aria-label="tooltip"]': {
322
- fontSize: 'sm',
323
- marginLeft: '2xs',
324
- },
325
- '&:has(input[type="checkbox"])': {
326
- fontSize: 'base',
327
- gap: 'md',
328
- },
329
- '& > div:has(input[type="checkbox"]) > svg': {
330
- marginRight: 0,
331
- },
332
- '&:has(input[type="checkbox"]:disabled)': {
333
- color: 'onMuted',
334
- },
335
- '&:has(div > input[type="radio"])': {
336
- alignItems: 'center',
337
- },
338
- '&:has(div > input[type="radio"]:disabled)': {
339
- color: 'muted',
340
- },
341
- },
342
- radio: {
343
- color: 'text',
344
- fontFamily: 'body',
345
- fontSize: 'lg',
346
- 'input:disabled ~ &': {
347
- color: 'muted',
348
- },
349
- 'input[aria-invalid="true"] ~ &': {
350
- color: 'danger',
351
- },
352
- 'input:focus ~ &': {
353
- bg: 'transparent',
354
- },
355
- '&:is(svg, svg + svg)': {
356
- width: fontSizes.base,
357
- height: fontSizes.base,
358
- },
359
- },
360
- checkbox: {
361
- 'input:focus ~ &': {
362
- bg: 'transparent',
363
- },
364
- 'input:not(:checked) ~ &': {
365
- color: 'primary',
366
- },
367
- 'input:disabled ~ &': {
368
- color: 'muted',
369
- },
370
- 'input:disabled ~ & path': {
371
- backgroundColor: 'onMuted',
372
- },
373
- 'input[aria-invalid="true"] ~ &': {
374
- color: 'danger',
375
- },
376
- '&:is(svg, svg + svg)': {
377
- width: fontSizes.base,
378
- height: fontSizes.base,
379
- },
380
- },
381
- input: {
382
- color: 'text',
383
- border: 'interaction',
384
- borderColor: 'onMuted',
385
- borderRadius: 'action',
386
- backgroundColor: 'surface',
387
- fontSize: 'base',
388
- lineHeight: 'base',
389
- '::placeholder': {
390
- color: 'onMuted',
391
- },
392
- ':focus-within': {
393
- outlineColor: 'neutral',
394
- },
395
- ':disabled': {
396
- backgroundColor: 'muted',
397
- color: 'onMuted',
398
- border: 'muted',
399
- borderColor: 'onMuted',
400
- },
401
- '&[aria-invalid="true"]': {
402
- borderColor: 'danger',
403
- },
404
- '&[aria-invalid="true"] ~ span:has(iconify-icon)': {
405
- color: 'danger',
406
- },
407
- },
408
- inputNumber: {
409
- color: 'text',
410
- border: 'interaction',
411
- borderColor: 'onMuted',
412
- borderRadius: 'action',
413
- ':disabled': {
414
- border: 'muted',
415
- borderColor: 'onMuted',
416
- color: 'muted',
417
- },
418
- ':disabled ~ span > iconify-icon': {
419
- color: 'muted',
420
- cursor: 'default',
421
- },
422
- ':focus-within': {
423
- outlineColor: 'highlight',
424
- },
425
- ':not(:disabled, [aria-invalid="true"]):hover': {
426
- borderColor: 'highlight',
427
- },
428
- ':not(:disabled, [aria-invalid="true"]) ~ span:has(iconify-icon):hover': {
429
- color: 'highlight',
430
- },
431
- '& ~ span:has(iconify-icon)': {
432
- fontSize: 'base',
433
- },
434
- '&[aria-invalid="true"]': {
435
- border: 'danger',
436
- borderColor: 'danger',
437
- color: 'danger',
438
- outlineColor: 'danger',
439
- },
440
- '&[aria-invalid="true"] ~ span>iconify-icon': {
441
- color: 'danger',
442
- },
443
- },
444
- select: {
445
- color: 'text',
446
- backgroundColor: 'surface',
447
- border: 'interaction',
448
- borderColor: 'onMuted',
449
- borderRadius: 'action',
450
- ':disabled': {
451
- border: 'muted',
452
- borderColor: 'onMuted',
453
- backgroundColor: 'muted',
454
- color: 'onMuted',
455
- },
456
- ':disabled ~ * > span:has(iconify-icon)': {
457
- color: 'onMuted',
458
- },
459
- '&[aria-invalid="true"]': {
460
- border: 'danger',
461
- borderColor: 'danger',
462
- outlineColor: 'danger',
463
- },
464
- '&[aria-invalid="true"] ~ * > span.error-icon': {
465
- color: 'danger',
466
- },
467
- },
468
- textarea: {
469
- color: 'text',
470
- border: 'interaction',
471
- borderColor: 'onMuted',
472
- backgroundColor: 'surface',
473
- borderRadius: 'action',
474
- ':focus-within': {
475
- outlineColor: 'primary',
476
- },
477
- ':disabled::placeholder': {
478
- color: 'onMuted',
479
- },
480
- ':disabled': {
481
- borderColor: 'onMuted',
482
- backgroundColor: 'muted',
483
- border: 'muted',
484
- color: 'onMuted',
485
- },
486
- '&[aria-invalid="true"]': {
487
- borderColor: 'danger',
488
- outlineColor: 'danger',
489
- },
490
- '&[aria-invalid="true"]+span>iconify-icon': {
491
- color: 'danger',
492
- fontSize: 'base',
493
- },
494
- },
495
- },
496
- text: {
497
- default: {
498
- color: 'text',
499
- fontFamily: 'body',
500
- },
501
- title: {
502
- fontFamily: 'heading',
503
- fontSize: 4,
504
- lineSpace: '3.5',
505
- },
506
- help: {
507
- color: 'text',
508
- '&[aria-disabled="true"]': {
509
- color: 'onMuted',
510
- },
511
- negative: {
512
- color: 'danger',
513
- '&[aria-disabled="true"]': {
514
- color: 'onMuted',
515
- },
516
- },
517
- },
518
- headline: {
519
- fontFamily: 'contrast',
520
- fontWeight: 'bold',
521
- lineHeight: 'flat',
522
- fontSize: '5xl',
523
- letterSpacing: 'regular',
524
- },
525
- subheadline: {
526
- fontFamily: 'main',
527
- fontWeight: 'bold',
528
- lineHeight: 'base',
529
- fontSize: 'xl',
530
- letterSpacing: 'regular',
531
- },
532
- h1: {
533
- fontFamily: 'contrast',
534
- fontWeight: 'extrabold',
535
- lineHeight: 'base',
536
- fontSize: '3xl',
537
- letterSpacing: 'regular',
538
- },
539
- h2: {
540
- fontFamily: 'contrast',
541
- fontWeight: 'bold',
542
- lineHeight: 'base',
543
- fontSize: '2xl',
544
- letterSpacing: 'regular',
545
- },
546
- h3: {
547
- fontFamily: 'contrast',
548
- fontWeight: 'bold',
549
- lineHeight: 'base',
550
- fontSize: 'xl',
551
- letterSpacing: 'regular',
552
- },
553
- h4: {
554
- fontFamily: 'contrast',
555
- fontWeight: 'semibold',
556
- lineHeight: 'base',
557
- fontSize: 'lg',
558
- letterSpacing: 'regular',
559
- },
560
- h5: {
561
- fontFamily: 'contrast',
562
- fontWeight: 'semibold',
563
- lineHeight: 'base',
564
- fontSize: 'base',
565
- letterSpacing: 'regular',
566
- },
567
- },
568
- };
@@ -1,21 +0,0 @@
1
- import { calcMultiplyingValues } from '../helpers/geometricCalc';
2
-
3
- const SIZE_TYPE = 'rem';
4
-
5
- const BASE = 1;
6
-
7
- const MULTIPLIER_FACTOR = 1.333;
8
-
9
- export const fontSizes = {
10
- '2xs': calcMultiplyingValues(BASE, MULTIPLIER_FACTOR, -3),
11
- xs: calcMultiplyingValues(BASE, MULTIPLIER_FACTOR, -2),
12
- sm: calcMultiplyingValues(BASE, MULTIPLIER_FACTOR, -1),
13
- base: `${BASE}${SIZE_TYPE}`,
14
- lg: calcMultiplyingValues(BASE, MULTIPLIER_FACTOR, 1),
15
- xl: calcMultiplyingValues(BASE, MULTIPLIER_FACTOR, 2),
16
- '2xl': calcMultiplyingValues(BASE, MULTIPLIER_FACTOR, 3),
17
- '3xl': calcMultiplyingValues(BASE, MULTIPLIER_FACTOR, 4),
18
- '4xl': calcMultiplyingValues(BASE, MULTIPLIER_FACTOR, 5),
19
- '5xl': calcMultiplyingValues(BASE, MULTIPLIER_FACTOR, 6),
20
- '6xl': calcMultiplyingValues(BASE, MULTIPLIER_FACTOR, 7),
21
- };
@@ -1,10 +0,0 @@
1
- export const fontWeights = {
2
- thin: 100,
3
- extralight: 200,
4
- light: 300,
5
- normal: 400,
6
- medium: 500,
7
- semibold: 600,
8
- bold: 700,
9
- extrabold: 800,
10
- };
@@ -1,8 +0,0 @@
1
- export const letterSpacings = {
2
- tighter: '-0.05em',
3
- tight: '-0.025em',
4
- regular: '0em',
5
- wide: '0.05em',
6
- wider: '0.1em',
7
- widest: '0.5em',
8
- };
@@ -1,21 +0,0 @@
1
- import {
2
- calcDividingValues,
3
- calcMultiplyingValues,
4
- } from '../helpers/geometricCalc';
5
-
6
- const BASE = 100;
7
-
8
- const MULTIPLIER_FACTOR = 1.333;
9
-
10
- const SIZE_TYPE = '%';
11
-
12
- export const lineHeights = {
13
- '2xs': calcMultiplyingValues(BASE, MULTIPLIER_FACTOR, -3, SIZE_TYPE),
14
- xs: calcMultiplyingValues(BASE, MULTIPLIER_FACTOR, -2, SIZE_TYPE),
15
- sm: calcDividingValues(BASE, MULTIPLIER_FACTOR, 1, SIZE_TYPE),
16
- base: 'normal',
17
- lg: calcMultiplyingValues(BASE, MULTIPLIER_FACTOR, 1, SIZE_TYPE),
18
- xl: calcMultiplyingValues(BASE, MULTIPLIER_FACTOR, 2, SIZE_TYPE),
19
- '2xl': calcMultiplyingValues(BASE, MULTIPLIER_FACTOR, 3, SIZE_TYPE),
20
- flat: '100%',
21
- };
@@ -1,26 +0,0 @@
1
- import {
2
- calcDividingValues,
3
- calcMultiplyingValues,
4
- } from '../helpers/geometricCalc';
5
-
6
- const SIZE_TYPE = 'rem';
7
-
8
- const MD = 0.5;
9
-
10
- const MULTIPLIER_FACTOR = 1.618;
11
-
12
- export const space = {
13
- none: 0,
14
- '2xs': calcDividingValues(MD, MULTIPLIER_FACTOR, 3),
15
- xs: calcDividingValues(MD, MULTIPLIER_FACTOR, 2),
16
- sm: calcDividingValues(MD, MULTIPLIER_FACTOR, 1),
17
- md: `${MD}${SIZE_TYPE}`,
18
- lg: calcMultiplyingValues(MD, MULTIPLIER_FACTOR, 1),
19
- xl: calcMultiplyingValues(MD, MULTIPLIER_FACTOR, 2),
20
- '2xl': calcMultiplyingValues(MD, MULTIPLIER_FACTOR, 3),
21
- '3xl': calcMultiplyingValues(MD, MULTIPLIER_FACTOR, 4),
22
- '4xl': calcMultiplyingValues(MD, MULTIPLIER_FACTOR, 5),
23
- '5xl': calcMultiplyingValues(MD, MULTIPLIER_FACTOR, 6),
24
- '6xl': calcMultiplyingValues(MD, MULTIPLIER_FACTOR, 7),
25
- '7xl': calcMultiplyingValues(MD, MULTIPLIER_FACTOR, 8),
26
- };