@readme/markdown 6.75.0-beta.1 → 6.75.0-beta.11

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.
@@ -0,0 +1,33 @@
1
+ import * as React from 'react';
2
+
3
+ interface Props extends React.PropsWithChildren<React.HTMLAttributes<HTMLQuoteElement>> {
4
+ attributes: {};
5
+ icon: string;
6
+ theme: string;
7
+ heading?: React.ReactElement;
8
+ }
9
+
10
+ const Callout = (props: Props) => {
11
+ const { attributes, theme, icon, heading } = props;
12
+
13
+ return (
14
+ // @ts-ignore
15
+ <blockquote {...attributes} className={`callout callout_${theme}`} theme={icon}>
16
+ {heading && (
17
+ <h3 className={`callout-heading${heading ? '' : ' empty'}`}>
18
+ <span className="callout-icon">{icon}</span>
19
+ {heading}
20
+ </h3>
21
+ )}
22
+ {props.children}
23
+ </blockquote>
24
+ );
25
+ };
26
+
27
+ Callout.sanitize = sanitizeSchema => {
28
+ sanitizeSchema.attributes['rdme-callout'] = ['icon', 'theme', 'heading'];
29
+
30
+ return sanitizeSchema;
31
+ };
32
+
33
+ export default Callout;