@latte-macchiat-io/latte-vanilla-components 0.0.206 → 0.0.208

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": "@latte-macchiat-io/latte-vanilla-components",
3
- "version": "0.0.206",
3
+ "version": "0.0.208",
4
4
  "description": "Beautiful components for amazing projects, with a touch of Vanilla 🥤",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -9,8 +9,18 @@ export type HeadingProps = React.HTMLAttributes<HTMLHeadingElement> &
9
9
  children: React.ReactNode;
10
10
  };
11
11
 
12
+ const levelToSize: Record<AllowedHeading, NonNullable<HeadingProps['size']>> = {
13
+ h1: 'xxl',
14
+ h2: 'xl',
15
+ h3: 'lg',
16
+ h4: 'md',
17
+ h5: 'sm',
18
+ h6: 'xs',
19
+ };
20
+
12
21
  export const Heading = ({ as, size, align, className, children }: HeadingProps) => {
13
- const Component = as as AllowedHeading;
22
+ const Component = as;
23
+ const resolvedSize = size ?? levelToSize[as];
14
24
 
15
- return <Component className={clsx(headingRecipe({ size, align }), className)}>{children}</Component>;
25
+ return <Component className={clsx(headingRecipe({ size: resolvedSize, align, as }), className)}>{children}</Component>;
16
26
  };
@@ -12,7 +12,7 @@ export const headingRecipe = recipe({
12
12
  }),
13
13
 
14
14
  variants: {
15
- level: {
15
+ as: {
16
16
  h1: {
17
17
  fontWeight: themeContract.heading.h1.fontWeight,
18
18
  fontFamily: themeContract.heading.h1.fontFamily,
@@ -109,8 +109,8 @@ export const headingRecipe = recipe({
109
109
  },
110
110
 
111
111
  defaultVariants: {
112
+ as: 'h2',
112
113
  size: 'xl',
113
- level: 'h2',
114
114
  align: 'left',
115
115
  },
116
116
  });
@@ -1,41 +1,39 @@
1
- import { themeContract } from '../../theme/contract.css';
2
-
3
1
  const themeHeadingBase = {
4
2
  heading: {
5
3
  h1: {
6
4
  color: '',
7
5
  fontWeight: '800',
8
- fontFamily: themeContract.fonts.heading,
6
+ fontFamily: `var(--font-outfit)`,
9
7
  },
10
8
 
11
9
  h2: {
12
10
  color: '',
13
11
  fontWeight: '800',
14
- fontFamily: themeContract.fonts.heading,
12
+ fontFamily: `var(--font-outfit)`,
15
13
  },
16
14
 
17
15
  h3: {
18
16
  color: '',
19
17
  fontWeight: '800',
20
- fontFamily: themeContract.fonts.heading,
18
+ fontFamily: `var(--font-outfit)`,
21
19
  },
22
20
 
23
21
  h4: {
24
22
  color: '',
25
23
  fontWeight: '800',
26
- fontFamily: themeContract.fonts.heading,
24
+ fontFamily: `var(--font-outfit)`,
27
25
  },
28
26
 
29
27
  h5: {
30
28
  color: '',
31
29
  fontWeight: '800',
32
- fontFamily: themeContract.fonts.body,
30
+ fontFamily: `var(--font-outfit)`,
33
31
  },
34
32
 
35
33
  h6: {
36
34
  color: '',
37
35
  fontWeight: '800',
38
- fontFamily: themeContract.fonts.body,
36
+ fontFamily: `var(--font-outfit)`,
39
37
  },
40
38
 
41
39
  size: {