@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttoss/theme",
3
- "version": "1.4.30",
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
- "gitHead": "2b412ebe0b92fbccb102636f843f84bd7616b43b"
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: 'body',
336
+ fontFamily: 'caption',
335
337
  alignItems: 'center',
336
- fontSize: 'base',
338
+ fontSize: 'sm',
337
339
  '&:is([aria-disabled="true"])': {
338
340
  color: 'onMuted',
339
341
  },
340
342
  '& > span[aria-label="tooltip"]': {
341
- fontSize: 'xs',
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: 'heading',
547
- fontSize: '6xl',
548
- fontWeight: 'bold',
549
- letterSpacing: 'normal',
551
+ fontFamily: 'contrast',
552
+ fontWeight: 'extraBold',
553
+ lineHeight: 'base',
554
+ fontSize: '3xl',
555
+ letterSpacing: 'regular',
550
556
  },
551
557
  h2: {
552
- fontFamily: 'heading',
553
- fontSize: '5xl',
558
+ fontFamily: 'contrast',
554
559
  fontWeight: 'bold',
555
- letterSpacing: 'normal',
560
+ lineHeight: 'base',
561
+ fontSize: '2xl',
562
+ letterSpacing: 'regular',
556
563
  },
557
564
  h3: {
558
- fontFamily: 'heading',
559
- fontSize: '4xl',
565
+ fontFamily: 'contrast',
560
566
  fontWeight: 'bold',
561
- letterSpacing: 'normal',
567
+ lineHeight: 'base',
568
+ fontSize: 'xl',
569
+ letterSpacing: 'regular',
562
570
  },
563
571
  h4: {
564
- fontFamily: 'heading',
565
- fontSize: '2xl',
566
- fontWeight: 'bold',
567
- letterSpacing: 'normal',
572
+ fontFamily: 'contrast',
573
+ fontWeight: 'semiBold',
574
+ lineHeight: 'base',
575
+ fontSize: 'lg',
576
+ letterSpacing: 'regular',
568
577
  },
569
578
  h5: {
570
- fontFamily: 'heading',
571
- fontSize: 'xl',
572
- fontWeight: 'bold',
573
- letterSpacing: 'normal',
579
+ fontFamily: 'contrast',
580
+ fontWeight: 'semiBold',
581
+ lineHeight: 'base',
582
+ fontSize: 'base',
583
+ letterSpacing: 'regular',
574
584
  },
575
585
  },
576
586
  };
@@ -1,17 +1,21 @@
1
- const BASE = '1rem';
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': `calc(${BASE} * (${Math.pow(MULTIPLIER_FACTOR, -3)})`,
7
- xs: `calc(${BASE} * ${Math.pow(MULTIPLIER_FACTOR, -2)})`,
8
- sm: `calc(${BASE} * ${Math.pow(MULTIPLIER_FACTOR, -1)})`,
9
- base: BASE,
10
- lg: `calc(${BASE} * (${MULTIPLIER_FACTOR}^1))`,
11
- xl: `calc(${BASE} * (${MULTIPLIER_FACTOR}^2))`,
12
- '2xl': `calc(${BASE} * (${MULTIPLIER_FACTOR}^3))`,
13
- '3xl': `calc(${BASE} * (${MULTIPLIER_FACTOR}^4))`,
14
- '4xl': `calc(${BASE} * (${MULTIPLIER_FACTOR}^5))`,
15
- '5xl': `calc(${BASE} * (${MULTIPLIER_FACTOR}^6))`,
16
- '6xl': `calc(${BASE} * (${MULTIPLIER_FACTOR}^7))`,
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
  };
@@ -1,8 +1,8 @@
1
1
  export const letterSpacings = {
2
2
  tighter: '-0.05em',
3
3
  tight: '-0.025em',
4
- normal: '0em',
5
- wide: '0.025em',
6
- wider: '0.05em',
7
- widest: '0.1em',
4
+ regular: '0em',
5
+ wide: '0.05em',
6
+ wider: '0.1em',
7
+ widest: '0.5em',
8
8
  };
@@ -1,27 +1,26 @@
1
- const MD = '0.5rem';
1
+ import {
2
+ calcDividingValues,
3
+ calcMultiplyingValues,
4
+ } from '../helpers/geometricCalc';
2
5
 
3
- const MULTIPLIER_FACTOR = 1.618;
6
+ const SIZE_TYPE = 'rem';
4
7
 
5
- const multiValues = (length: number) => {
6
- return Array.from({ length })
7
- .map(() => {
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': `calc(${MD} / (${multiValues(3)}))`,
16
- xs: `calc(${MD} / (${multiValues(2)}))`,
17
- sm: `calc(${MD} / (${MULTIPLIER_FACTOR}))`,
18
- md: MD,
19
- lg: `calc(${MD} * ${MULTIPLIER_FACTOR})`,
20
- xl: `calc(${MD} * ${multiValues(2)})`,
21
- '2xl': `calc(${MD} * ${multiValues(3)})`,
22
- '3xl': `calc(${MD} * ${multiValues(4)})`,
23
- '4xl': `calc(${MD} * ${multiValues(5)})`,
24
- '5xl': `calc(${MD} * ${multiValues(6)})`,
25
- '6xl': `calc(${MD} * ${multiValues(7)})`,
26
- '7xl': `calc(${MD} * ${multiValues(8)})`,
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
  };