@latte-macchiat-io/latte-vanilla-components 0.0.292 → 0.0.293

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.292",
3
+ "version": "0.0.293",
4
4
  "description": "Beautiful components for amazing projects, with a touch of Vanilla 🥤",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -66,7 +66,8 @@
66
66
  ]
67
67
  },
68
68
  "dependencies": {
69
- "@vanilla-extract/css-utils": "^0.1.6"
69
+ "@vanilla-extract/css-utils": "^0.1.6",
70
+ "html-react-parser": "^5.2.6"
70
71
  },
71
72
  "scripts": {
72
73
  "build": "echo \"Source-only distribution - no build needed\"",
@@ -1,4 +1,5 @@
1
1
  import { clsx } from 'clsx';
2
+ import parse from 'html-react-parser';
2
3
 
3
4
  import { headingRecipe, HeadingVariants } from './styles.css';
4
5
  import { AllowedHeading } from './types';
@@ -22,5 +23,9 @@ export const Heading = ({ as, size, align, className, children }: HeadingProps)
22
23
  const Component = as;
23
24
  const resolvedSize = size ?? levelToSize[as];
24
25
 
25
- return <Component className={clsx(headingRecipe({ size: resolvedSize, align, as }), className)}>{children}</Component>;
26
+ return (
27
+ <Component className={clsx(headingRecipe({ size: resolvedSize, align, as }), className)}>
28
+ {parse(typeof children === 'string' ? children : '')}
29
+ </Component>
30
+ );
26
31
  };
@@ -1,4 +1,5 @@
1
1
  import { clsx } from 'clsx';
2
+ import parse from 'html-react-parser';
2
3
 
3
4
  import { paragraphRecipe, type ParagraphVariants } from './styles.css';
4
5
 
@@ -8,5 +9,5 @@ export type ParagraphProps = React.HTMLAttributes<HTMLDivElement> &
8
9
  };
9
10
 
10
11
  export const Paragraph = ({ align, className, children }: ParagraphProps) => (
11
- <p className={clsx(paragraphRecipe({ align }), className)}>{children}</p>
12
+ <p className={clsx(paragraphRecipe({ align }), className)}>{parse(typeof children === 'string' ? children : '')}</p>
12
13
  );