@ttoss/theme 1.4.30 → 1.4.32
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 +674 -0
- package/dist/esm/{chunk-NBEPUG6F.js → chunk-NGT4BFCW.js} +79 -63
- package/dist/esm/index.js +1 -1
- package/dist/esm/themes/Bruttal/Bruttal.js +1 -1
- package/dist/index.js +79 -63
- package/dist/themes/Bruttal/Bruttal.js +79 -63
- package/package.json +9 -10
- package/src/helpers/geometricCalc.ts +23 -0
- package/src/themes/Bruttal/BruttalTheme.ts +37 -27
- package/src/tokens/fontSizes.ts +16 -12
- package/src/tokens/letterSpacings.ts +4 -4
- package/src/tokens/space.ts +20 -21
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/theme",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.32",
|
|
4
4
|
"description": "Theme for packages.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "ttoss",
|
|
@@ -24,10 +24,6 @@
|
|
|
24
24
|
"src",
|
|
25
25
|
"tsconfig.json"
|
|
26
26
|
],
|
|
27
|
-
"scripts": {
|
|
28
|
-
"build": "tsup",
|
|
29
|
-
"test": "jest"
|
|
30
|
-
},
|
|
31
27
|
"sideEffects": true,
|
|
32
28
|
"typings": "dist/index.d.ts",
|
|
33
29
|
"dependencies": {
|
|
@@ -39,11 +35,11 @@
|
|
|
39
35
|
"@iconify/icons-eos-icons": "^1.2.6",
|
|
40
36
|
"@iconify/icons-mdi": "^1.2.44",
|
|
41
37
|
"@iconify/types": "^2.0.0",
|
|
42
|
-
"@ttoss/config": "^1.30.0",
|
|
43
|
-
"@ttoss/test-utils": "^1.23.0",
|
|
44
38
|
"jest": "^29.5.0",
|
|
45
39
|
"theme-ui": "^0.15.7",
|
|
46
|
-
"tsup": "^6.7.0"
|
|
40
|
+
"tsup": "^6.7.0",
|
|
41
|
+
"@ttoss/config": "^1.30.0",
|
|
42
|
+
"@ttoss/test-utils": "^1.23.0"
|
|
47
43
|
},
|
|
48
44
|
"keywords": [],
|
|
49
45
|
"publishConfig": {
|
|
@@ -59,5 +55,8 @@
|
|
|
59
55
|
]
|
|
60
56
|
}
|
|
61
57
|
},
|
|
62
|
-
"
|
|
63
|
-
|
|
58
|
+
"scripts": {
|
|
59
|
+
"build": "tsup",
|
|
60
|
+
"test": "jest"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const SIZE_TYPE = 'rem';
|
|
2
|
+
|
|
3
|
+
export const calcMultiplyingValues = (
|
|
4
|
+
initialValue: number,
|
|
5
|
+
base: number,
|
|
6
|
+
ratio: number,
|
|
7
|
+
sizeType = SIZE_TYPE
|
|
8
|
+
) => {
|
|
9
|
+
const result = initialValue * Math.pow(base, ratio);
|
|
10
|
+
|
|
11
|
+
return `${result.toFixed(2)}${sizeType}`;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const calcDividingValues = (
|
|
15
|
+
initialValue: number,
|
|
16
|
+
base: number,
|
|
17
|
+
ratio: number,
|
|
18
|
+
sizeType = SIZE_TYPE
|
|
19
|
+
) => {
|
|
20
|
+
const result = initialValue / Math.pow(base, ratio);
|
|
21
|
+
|
|
22
|
+
return `${result.toFixed(2)}${sizeType}`;
|
|
23
|
+
};
|
|
@@ -100,12 +100,13 @@ export const BruttalTheme: Theme = {
|
|
|
100
100
|
underemphasize: coreColors.gray300,
|
|
101
101
|
},
|
|
102
102
|
fonts: {
|
|
103
|
-
h1: coreFonts.contrast,
|
|
104
|
-
h2: coreFonts.contrast,
|
|
105
|
-
h3: coreFonts.contrast,
|
|
106
|
-
h4: coreFonts.contrast,
|
|
107
|
-
h5: coreFonts.contrast,
|
|
108
|
-
h6: coreFonts.contrast,
|
|
103
|
+
// h1: coreFonts.contrast,
|
|
104
|
+
// h2: coreFonts.contrast,
|
|
105
|
+
// h3: coreFonts.contrast,
|
|
106
|
+
// h4: coreFonts.contrast,
|
|
107
|
+
// h5: coreFonts.contrast,
|
|
108
|
+
// h6: coreFonts.contrast,
|
|
109
|
+
contrast: coreFonts.contrast,
|
|
109
110
|
body: coreFonts.main,
|
|
110
111
|
highlight: coreFonts.main,
|
|
111
112
|
caption: coreFonts.main,
|
|
@@ -155,6 +156,7 @@ export const BruttalTheme: Theme = {
|
|
|
155
156
|
a: {
|
|
156
157
|
color: 'text',
|
|
157
158
|
fontFamily: 'body',
|
|
159
|
+
textDecorationLine: 'underline',
|
|
158
160
|
'&.quiet:not(:hover)': {
|
|
159
161
|
textDecorationLine: 'none',
|
|
160
162
|
},
|
|
@@ -331,19 +333,22 @@ export const BruttalTheme: Theme = {
|
|
|
331
333
|
forms: {
|
|
332
334
|
label: {
|
|
333
335
|
color: 'text',
|
|
334
|
-
fontFamily: '
|
|
336
|
+
fontFamily: 'caption',
|
|
335
337
|
alignItems: 'center',
|
|
336
|
-
fontSize: '
|
|
338
|
+
fontSize: 'sm',
|
|
337
339
|
'&:is([aria-disabled="true"])': {
|
|
338
340
|
color: 'onMuted',
|
|
339
341
|
},
|
|
340
342
|
'& > span[aria-label="tooltip"]': {
|
|
341
|
-
fontSize: '
|
|
343
|
+
fontSize: 'sm',
|
|
342
344
|
marginLeft: '2xs',
|
|
343
345
|
},
|
|
344
346
|
'&:has(input[type="checkbox"]:disabled)': {
|
|
345
347
|
color: 'onMuted',
|
|
346
348
|
},
|
|
349
|
+
'&:has(+div>:is(input, select, textarea))': {
|
|
350
|
+
marginBottom: 'md',
|
|
351
|
+
},
|
|
347
352
|
'&:has(div > input[type="radio"])': {
|
|
348
353
|
alignItems: 'center',
|
|
349
354
|
},
|
|
@@ -543,34 +548,39 @@ export const BruttalTheme: Theme = {
|
|
|
543
548
|
},
|
|
544
549
|
},
|
|
545
550
|
h1: {
|
|
546
|
-
fontFamily: '
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
551
|
+
fontFamily: 'contrast',
|
|
552
|
+
fontWeight: 'extraBold',
|
|
553
|
+
lineHeight: 'base',
|
|
554
|
+
fontSize: '3xl',
|
|
555
|
+
letterSpacing: 'regular',
|
|
550
556
|
},
|
|
551
557
|
h2: {
|
|
552
|
-
fontFamily: '
|
|
553
|
-
fontSize: '5xl',
|
|
558
|
+
fontFamily: 'contrast',
|
|
554
559
|
fontWeight: 'bold',
|
|
555
|
-
|
|
560
|
+
lineHeight: 'base',
|
|
561
|
+
fontSize: '2xl',
|
|
562
|
+
letterSpacing: 'regular',
|
|
556
563
|
},
|
|
557
564
|
h3: {
|
|
558
|
-
fontFamily: '
|
|
559
|
-
fontSize: '4xl',
|
|
565
|
+
fontFamily: 'contrast',
|
|
560
566
|
fontWeight: 'bold',
|
|
561
|
-
|
|
567
|
+
lineHeight: 'base',
|
|
568
|
+
fontSize: 'xl',
|
|
569
|
+
letterSpacing: 'regular',
|
|
562
570
|
},
|
|
563
571
|
h4: {
|
|
564
|
-
fontFamily: '
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
572
|
+
fontFamily: 'contrast',
|
|
573
|
+
fontWeight: 'semiBold',
|
|
574
|
+
lineHeight: 'base',
|
|
575
|
+
fontSize: 'lg',
|
|
576
|
+
letterSpacing: 'regular',
|
|
568
577
|
},
|
|
569
578
|
h5: {
|
|
570
|
-
fontFamily: '
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
579
|
+
fontFamily: 'contrast',
|
|
580
|
+
fontWeight: 'semiBold',
|
|
581
|
+
lineHeight: 'base',
|
|
582
|
+
fontSize: 'base',
|
|
583
|
+
letterSpacing: 'regular',
|
|
574
584
|
},
|
|
575
585
|
},
|
|
576
586
|
};
|
package/src/tokens/fontSizes.ts
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
import { calcMultiplyingValues } from '../helpers/geometricCalc';
|
|
2
|
+
|
|
3
|
+
const SIZE_TYPE = 'rem';
|
|
4
|
+
|
|
5
|
+
const BASE = 1;
|
|
2
6
|
|
|
3
7
|
const MULTIPLIER_FACTOR = 1.333;
|
|
4
8
|
|
|
5
9
|
export const fontSizes = {
|
|
6
|
-
'2xs':
|
|
7
|
-
xs:
|
|
8
|
-
sm:
|
|
9
|
-
base: BASE
|
|
10
|
-
lg:
|
|
11
|
-
xl:
|
|
12
|
-
'2xl':
|
|
13
|
-
'3xl':
|
|
14
|
-
'4xl':
|
|
15
|
-
'5xl':
|
|
16
|
-
'6xl':
|
|
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),
|
|
17
21
|
};
|
package/src/tokens/space.ts
CHANGED
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
import {
|
|
2
|
+
calcDividingValues,
|
|
3
|
+
calcMultiplyingValues,
|
|
4
|
+
} from '../helpers/geometricCalc';
|
|
2
5
|
|
|
3
|
-
const
|
|
6
|
+
const SIZE_TYPE = 'rem';
|
|
4
7
|
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return MULTIPLIER_FACTOR;
|
|
9
|
-
})
|
|
10
|
-
.join(' * ');
|
|
11
|
-
};
|
|
8
|
+
const MD = 0.5;
|
|
9
|
+
|
|
10
|
+
const MULTIPLIER_FACTOR = 1.618;
|
|
12
11
|
|
|
13
12
|
export const space = {
|
|
14
13
|
none: 0,
|
|
15
|
-
'2xs':
|
|
16
|
-
xs:
|
|
17
|
-
sm:
|
|
18
|
-
md: MD
|
|
19
|
-
lg:
|
|
20
|
-
xl:
|
|
21
|
-
'2xl':
|
|
22
|
-
'3xl':
|
|
23
|
-
'4xl':
|
|
24
|
-
'5xl':
|
|
25
|
-
'6xl':
|
|
26
|
-
'7xl':
|
|
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),
|
|
27
26
|
};
|