@readme/markdown 8.2.0 → 8.4.0

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.
Files changed (71) hide show
  1. package/components/Accordion/index.tsx +5 -2
  2. package/components/Anchor.jsx +1 -1
  3. package/components/Callout/index.tsx +5 -4
  4. package/components/Cards/index.tsx +17 -5
  5. package/components/Code/index.tsx +11 -2
  6. package/components/CodeTabs/index.tsx +5 -1
  7. package/components/Columns/index.tsx +7 -6
  8. package/components/Embed/index.tsx +10 -7
  9. package/components/Glossary/index.tsx +8 -4
  10. package/components/HTMLBlock/index.tsx +10 -2
  11. package/components/Heading/index.tsx +6 -2
  12. package/components/Image/index.tsx +15 -13
  13. package/components/Table/index.tsx +2 -2
  14. package/components/Tabs/index.tsx +21 -14
  15. package/components/TailwindRoot/index.tsx +6 -2
  16. package/dist/components/Accordion/index.d.ts +7 -6
  17. package/dist/components/Callout/index.d.ts +2 -2
  18. package/dist/components/Cards/index.d.ts +13 -11
  19. package/dist/components/CodeTabs/index.d.ts +5 -1
  20. package/dist/components/Columns/index.d.ts +6 -7
  21. package/dist/components/Embed/index.d.ts +6 -6
  22. package/dist/components/Glossary/index.d.ts +4 -3
  23. package/dist/components/HTMLBlock/index.d.ts +5 -4
  24. package/dist/components/Heading/index.d.ts +1 -1
  25. package/dist/components/Image/index.d.ts +2 -2
  26. package/dist/components/Table/index.d.ts +2 -2
  27. package/dist/components/Tabs/index.d.ts +5 -6
  28. package/dist/components/TailwindRoot/index.d.ts +5 -4
  29. package/dist/contexts/GlossaryTerms.d.ts +4 -4
  30. package/dist/contexts/index.d.ts +2 -2
  31. package/dist/errors/mdx-syntax-error.d.ts +1 -1
  32. package/dist/example/RenderError.d.ts +5 -4
  33. package/dist/lib/ast-processor.d.ts +5 -5
  34. package/dist/lib/compile.d.ts +3 -4
  35. package/dist/lib/hast.d.ts +1 -1
  36. package/dist/lib/mdast.d.ts +3 -1
  37. package/dist/lib/mdastV6.d.ts +4 -1
  38. package/dist/lib/mdx.d.ts +3 -1
  39. package/dist/lib/plain.d.ts +1 -1
  40. package/dist/lib/run.d.ts +6 -12
  41. package/dist/main.js +24553 -24400
  42. package/dist/main.node.js +22070 -21917
  43. package/dist/main.node.js.map +1 -1
  44. package/dist/processor/compile/callout.d.ts +1 -1
  45. package/dist/processor/compile/code-tabs.d.ts +1 -1
  46. package/dist/processor/compile/compatibility.d.ts +20 -31
  47. package/dist/processor/compile/embed.d.ts +1 -1
  48. package/dist/processor/compile/gemoji.d.ts +1 -1
  49. package/dist/processor/compile/html-block.d.ts +1 -1
  50. package/dist/processor/compile/variable.d.ts +1 -1
  51. package/dist/processor/plugin/toc.d.ts +4 -4
  52. package/dist/processor/transform/callouts.d.ts +2 -1
  53. package/dist/processor/transform/code-tabs.d.ts +1 -1
  54. package/dist/processor/transform/compatability.d.ts +1 -1
  55. package/dist/processor/transform/div.d.ts +1 -1
  56. package/dist/processor/transform/embeds.d.ts +1 -1
  57. package/dist/processor/transform/gemoji+.d.ts +1 -1
  58. package/dist/processor/transform/images.d.ts +1 -1
  59. package/dist/processor/transform/index.d.ts +4 -4
  60. package/dist/processor/transform/inject-components.d.ts +2 -2
  61. package/dist/processor/transform/mdx-to-hast.d.ts +1 -1
  62. package/dist/processor/transform/mermaid.d.ts +1 -1
  63. package/dist/processor/transform/readme-components.d.ts +1 -1
  64. package/dist/processor/transform/readme-to-mdx.d.ts +1 -1
  65. package/dist/processor/transform/tables-to-jsx.d.ts +1 -1
  66. package/dist/processor/transform/tailwind.d.ts +2 -1
  67. package/dist/processor/transform/variables.d.ts +1 -1
  68. package/dist/processor/utils.d.ts +8 -8
  69. package/dist/utils/consts.d.ts +1 -0
  70. package/dist/utils/user.d.ts +2 -2
  71. package/package.json +4 -1
@@ -2,7 +2,9 @@ import React, { useState } from 'react';
2
2
 
3
3
  import './style.scss';
4
4
 
5
- const Accordion = ({ children, icon, iconColor, title }) => {
5
+ interface Props extends React.PropsWithChildren<{ icon?: string; iconColor?: string; title: string }> {}
6
+
7
+ const Accordion = ({ children, icon, iconColor, title }: Props) => {
6
8
  const [isOpen, setIsOpen] = useState(false);
7
9
 
8
10
  return (
@@ -17,4 +19,5 @@ const Accordion = ({ children, icon, iconColor, title }) => {
17
19
  );
18
20
  };
19
21
 
20
- export default Accordion;
22
+ export default Accordion;
23
+
@@ -1,5 +1,5 @@
1
1
  import { string, node } from 'prop-types';
2
- import React from 'react';
2
+ import React, { useContext } from 'react';
3
3
 
4
4
  import BaseUrlContext from '../contexts/BaseUrl';
5
5
 
@@ -1,10 +1,10 @@
1
1
  import * as React from 'react';
2
2
 
3
3
  interface Props extends React.PropsWithChildren<React.HTMLAttributes<HTMLQuoteElement>> {
4
- attributes?: {};
4
+ attributes?: Record<string, unknown>;
5
+ empty?: boolean;
5
6
  icon: string;
6
7
  theme?: string;
7
- empty?: boolean;
8
8
  }
9
9
 
10
10
  const themes: Record<string, string> = {
@@ -24,10 +24,11 @@ const themes: Record<string, string> = {
24
24
 
25
25
  const Callout = (props: Props) => {
26
26
  const { attributes, children, icon, empty } = props;
27
- let theme = props.theme || themes[icon] || 'default';
27
+ const theme = props.theme || themes[icon] || 'default';
28
28
 
29
29
  return (
30
- // @ts-ignore
30
+ // @ts-expect-error -- theme is not a valid attribute
31
+ // eslint-disable-next-line react/jsx-props-no-spreading, react/no-unknown-property
31
32
  <blockquote {...attributes} className={`callout callout_${theme}`} theme={icon}>
32
33
  <h3 className={`callout-heading${empty ? ' empty' : ''}`}>
33
34
  <span className="callout-icon">{icon}</span>
@@ -2,18 +2,30 @@ import React from 'react';
2
2
 
3
3
  import './style.scss';
4
4
 
5
- export const Card = ({ children, href, icon, iconColor, target, title }) => {
5
+ interface CardProps
6
+ extends React.PropsWithChildren<{
7
+ href?: string;
8
+ icon?: string;
9
+ iconColor?: string;
10
+ target?: string;
11
+ title?: string;
12
+ }> {}
13
+
14
+ export const Card = ({ children, href, icon, iconColor, target, title }: CardProps) => {
6
15
  const Tag = href ? 'a' : 'div';
7
16
  return (
8
17
  <Tag className="Card" href={href} target={target}>
9
18
  {icon && <i className={`Card-icon fa-duotone fa-solid ${icon}`} style={{ color: `${iconColor}` }}></i>}
10
- {title && <p className='Card-title'>{title}</p>}
19
+ {title && <p className="Card-title">{title}</p>}
11
20
  <div className="Card-content">{children}</div>
12
21
  </Tag>
13
- )
14
- }
22
+ );
23
+ };
24
+
25
+ interface CardsGripProps extends React.PropsWithChildren<{ columns?: number }> {}
15
26
 
16
- const CardsGrid = ({ columns = 2, children }) => {
27
+ const CardsGrid = ({ columns = 2, children }: CardsGripProps) => {
28
+ // eslint-disable-next-line no-param-reassign
17
29
  columns = columns >= 2 ? columns : 2;
18
30
  return (
19
31
  <div className="CardsGrid" style={{ gridTemplateColumns: `repeat(${columns}, 1fr)` }}>
@@ -5,7 +5,8 @@ import React, { createRef } from 'react';
5
5
  // apps. Necessary because of people like this:
6
6
  // https://github.com/codemirror/CodeMirror/issues/3701#issuecomment-164904534
7
7
  let syntaxHighlighter;
8
- let canonicalLanguage = _ => '';
8
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
9
+ let canonicalLanguage = lang => '';
9
10
 
10
11
  if (typeof window !== 'undefined') {
11
12
  import('@readme/syntax-highlighter').then(module => {
@@ -14,7 +15,15 @@ if (typeof window !== 'undefined') {
14
15
  });
15
16
  }
16
17
 
17
- function CopyCode({ codeRef, rootClass = 'rdmd-code-copy', className = '' }) {
18
+ function CopyCode({
19
+ codeRef,
20
+ rootClass = 'rdmd-code-copy',
21
+ className = '',
22
+ }: {
23
+ className?: string;
24
+ codeRef: React.RefObject<HTMLElement>;
25
+ rootClass?: string;
26
+ }) {
18
27
  const copyClass = `${rootClass}_copied`;
19
28
  const buttonRef = createRef<HTMLButtonElement>();
20
29
 
@@ -5,8 +5,12 @@ import React, { useEffect } from 'react';
5
5
 
6
6
  let mermaid: Mermaid;
7
7
 
8
+ interface Props {
9
+ children: JSX.Element | JSX.Element[];
10
+ theme: 'dark' | 'default' | 'light';
11
+ }
8
12
 
9
- const CodeTabs = props => {
13
+ const CodeTabs = (props: Props) => {
10
14
  const { children, theme } = props;
11
15
 
12
16
  // render Mermaid diagram
@@ -2,13 +2,14 @@ import React from 'react';
2
2
 
3
3
  import './style.scss';
4
4
 
5
- export const Column = ({ children }) => {
6
- return (
7
- <div className="Column">{children}</div>
8
- )
9
- }
5
+ export const Column = ({ children }: React.PropsWithChildren) => {
6
+ return <div className="Column">{children}</div>;
7
+ };
8
+
9
+ interface Props extends React.PropsWithChildren<{ layout?: '1fr' | 'auto' | 'fixed' }> {}
10
10
 
11
- const Columns = ({ children, layout = 'auto'}) => {
11
+ const Columns = ({ children, layout = 'auto' }: Props) => {
12
+ // eslint-disable-next-line no-param-reassign
12
13
  layout = layout === 'fixed' ? '1fr' : 'auto';
13
14
  const columnsCount = React.Children.count(children);
14
15
 
@@ -1,8 +1,10 @@
1
+ /* eslint-disable no-param-reassign */
2
+ /* eslint-disable react/jsx-props-no-spreading */
1
3
  import React from 'react';
2
4
 
3
5
  interface FaviconProps {
4
- src: string;
5
6
  alt?: string;
7
+ src: string;
6
8
  }
7
9
 
8
10
  const Favicon = ({ src, alt = 'favicon', ...attr }: FaviconProps) => (
@@ -10,16 +12,16 @@ const Favicon = ({ src, alt = 'favicon', ...attr }: FaviconProps) => (
10
12
  );
11
13
 
12
14
  interface EmbedProps {
13
- lazy?: boolean;
14
- url: string;
15
- title: string;
16
- providerName?: string;
17
- providerUrl?: string;
15
+ favicon?: string;
18
16
  html?: string;
19
17
  iframe?: boolean;
20
18
  image?: string;
21
- favicon?: string;
19
+ lazy?: boolean;
20
+ providerName?: string;
21
+ providerUrl?: string;
22
+ title: string;
22
23
  typeOfEmbed?: string;
24
+ url: string;
23
25
  }
24
26
 
25
27
  const Embed = ({
@@ -50,6 +52,7 @@ const Embed = ({
50
52
  }
51
53
 
52
54
  if (iframe) {
55
+ // eslint-disable-next-line jsx-a11y/iframe-has-title
53
56
  return <iframe {...attrs} src={url} style={{ border: 'none', display: 'flex', margin: 'auto' }} />;
54
57
  }
55
58
 
@@ -1,7 +1,9 @@
1
- import React, { useContext } from 'react';
1
+ import type { GlossaryTerm } from '../../contexts/GlossaryTerms';
2
+
2
3
  import Tooltip from '@tippyjs/react';
4
+ import React, { useContext } from 'react';
5
+
3
6
  import GlossaryContext from '../../contexts/GlossaryTerms';
4
- import type { GlossaryTerm } from '../../contexts/GlossaryTerms';
5
7
 
6
8
  interface Props extends React.PropsWithChildren {
7
9
  term?: string;
@@ -29,9 +31,11 @@ const Glossary = ({ children, term: termProp, terms }: Props) => {
29
31
  );
30
32
  };
31
33
 
32
- const GlossaryWithContext = props => {
34
+ const GlossaryWithContext = (props: Omit<Props, 'terms'>) => {
33
35
  const terms = useContext(GlossaryContext);
34
36
  return terms ? <Glossary {...props} terms={terms} /> : <span>{props.term}</span>;
35
37
  };
36
38
 
37
- export { Glossary, GlossaryWithContext as default, GlossaryContext };
39
+ export { Glossary, GlossaryContext };
40
+
41
+ export default GlossaryWithContext;
@@ -10,12 +10,20 @@ const extractScripts = (html: string = ''): [string, () => void] => {
10
10
  scripts.push(match[1]);
11
11
  }
12
12
  const cleaned = html.replace(MATCH_SCRIPT_TAGS, '');
13
+ // eslint-disable-next-line no-eval
13
14
  return [cleaned, () => scripts.map(js => window.eval(js))];
14
15
  };
15
16
 
16
- const HTMLBlock = ({ children = '', runScripts, safeMode = false }) => {
17
+ interface Props {
18
+ children: React.ReactElement | string;
19
+ runScripts?: boolean | string;
20
+ safeMode?: boolean;
21
+ }
22
+
23
+ const HTMLBlock = ({ children = '', runScripts, safeMode = false }: Props) => {
17
24
  let html = children;
18
- runScripts = typeof runScripts !== 'boolean' ? (runScripts === 'true' ? true : false) : runScripts;
25
+ // eslint-disable-next-line no-param-reassign
26
+ runScripts = typeof runScripts !== 'boolean' ? runScripts === 'true' : runScripts;
19
27
 
20
28
  if (typeof html !== 'string') html = renderToStaticMarkup(html);
21
29
  const [cleanedHtml, exec] = extractScripts(html);
@@ -3,8 +3,8 @@ import React from 'react';
3
3
  export type Depth = 1 | 2 | 3 | 4 | 5 | 6;
4
4
 
5
5
  interface Props extends React.PropsWithChildren<React.HTMLAttributes<HTMLHeadingElement>> {
6
- tag: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
7
6
  depth: Depth;
7
+ tag: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
8
8
  }
9
9
 
10
10
  const Heading = ({ tag: Tag = 'h3', depth = 3, id, children, ...attrs }: Props) => {
@@ -26,6 +26,10 @@ const Heading = ({ tag: Tag = 'h3', depth = 3, id, children, ...attrs }: Props)
26
26
  );
27
27
  };
28
28
 
29
- const CreateHeading = (depth: Depth) => (props: Props) => <Heading {...props} depth={depth} tag={`h${depth}`} />;
29
+ const CreateHeading = (depth: Depth) => {
30
+ const HeadingWithDepth = (props: Props) => <Heading {...props} depth={depth} tag={`h${depth}`} />;
31
+
32
+ return HeadingWithDepth;
33
+ };
30
34
 
31
35
  export default CreateHeading;
@@ -5,13 +5,13 @@ interface ImageProps {
5
5
  alt?: string;
6
6
  border?: boolean;
7
7
  caption?: string;
8
+ children?: [React.ReactElement];
8
9
  className?: string;
9
10
  height?: string;
11
+ lazy?: boolean;
10
12
  src: string;
11
13
  title?: string;
12
14
  width?: string;
13
- lazy?: boolean;
14
- children?: [React.ReactElement];
15
15
  }
16
16
 
17
17
  const Image = (Props: ImageProps) => {
@@ -32,11 +32,12 @@ const Image = (Props: ImageProps) => {
32
32
  const [lightbox, setLightbox] = React.useState(false);
33
33
 
34
34
  if (className === 'emoji') {
35
- return <img src={src} width={width} height={height} title={title} alt={alt} loading={lazy ? 'lazy' : 'eager'} />;
35
+ return <img alt={alt} height={height} loading={lazy ? 'lazy' : 'eager'} src={src} title={title} width={width} />;
36
36
  }
37
37
 
38
38
  const handleKeyDown = ({ key, metaKey: cmd }: React.KeyboardEvent<HTMLImageElement>) => {
39
39
  const cmdKey = cmd ? 'cmd+' : '';
40
+ // eslint-disable-next-line no-param-reassign
40
41
  key = `${cmdKey}${key.toLowerCase()}`;
41
42
 
42
43
  switch (key) {
@@ -49,6 +50,7 @@ const Image = (Props: ImageProps) => {
49
50
  case 'enter':
50
51
  // OPEN
51
52
  if (!lightbox) setLightbox(true);
53
+ break;
52
54
  default:
53
55
  }
54
56
  };
@@ -71,13 +73,13 @@ const Image = (Props: ImageProps) => {
71
73
  >
72
74
  <span className="lightbox-inner">
73
75
  <img
74
- src={src}
75
- width={width}
76
- height={height}
77
- title={title}
78
- className={`img img-align-center ${border ? 'border' : ''}`}
79
76
  alt={alt}
77
+ className={`img img-align-center ${border ? 'border' : ''}`}
78
+ height={height}
80
79
  loading={lazy ? 'lazy' : 'eager'}
80
+ src={src}
81
+ title={title}
82
+ width={width}
81
83
  />
82
84
  <figcaption>{children || caption}</figcaption>
83
85
  </span>
@@ -97,13 +99,13 @@ const Image = (Props: ImageProps) => {
97
99
  >
98
100
  <span className="lightbox-inner">
99
101
  <img
100
- src={src}
101
- width={width}
102
- height={height}
103
- title={title}
104
- className={`img ${align ? `img-align-${align}` : ''} ${border ? 'border' : ''}`}
105
102
  alt={alt}
103
+ className={`img ${align ? `img-align-${align}` : ''} ${border ? 'border' : ''}`}
104
+ height={height}
106
105
  loading={lazy ? 'lazy' : 'eager'}
106
+ src={src}
107
+ title={title}
108
+ width={width}
107
109
  />
108
110
  </span>
109
111
  </span>
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
 
3
3
  interface Props extends JSX.IntrinsicAttributes {
4
- align: ('left' | 'center' | 'right')[];
5
- children: [React.ReactElement<HTMLTableCaptionElement | HTMLTableSectionElement | HTMLTableRowElement>];
4
+ align: ('center' | 'left' | 'right')[];
5
+ children: [React.ReactElement<HTMLTableCaptionElement | HTMLTableRowElement | HTMLTableSectionElement>];
6
6
  }
7
7
 
8
8
  const Table = (props: Props) => {
@@ -2,32 +2,39 @@ import React, { useState } from 'react';
2
2
 
3
3
  import './style.scss';
4
4
 
5
- export const Tab = ({ children }) => {
6
- return (
7
- <div className="TabContent">
8
- {children}
9
- </div>
10
- )
5
+ export const Tab = ({ children }: React.PropsWithChildren) => {
6
+ return <div className="TabContent">{children}</div>;
7
+ };
8
+
9
+ interface TabsProps {
10
+ children?: React.ReactElement[];
11
11
  }
12
12
 
13
- const Tabs = ({ children }) => {
13
+ const Tabs = ({ children }: TabsProps) => {
14
14
  const [activeTab, setActiveTab] = useState(0);
15
15
 
16
16
  return (
17
17
  <div className="TabGroup">
18
18
  <header>
19
19
  <nav className="TabGroup-nav">
20
- {children?.map((tab, index: number) =>
21
- <button className={`TabGroup-tab${activeTab === index ? '_active' : ''}`} key={tab.props.title} onClick={() => setActiveTab(index)}>
22
- {tab.props.icon && <i className={`TabGroup-icon fa-duotone fa-solid ${tab.props.icon}`} style={{ color: `${tab.props.iconColor}` }}></i>}
20
+ {children?.map((tab, index: number) => (
21
+ <button
22
+ key={tab.props.title}
23
+ className={`TabGroup-tab${activeTab === index ? '_active' : ''}`}
24
+ onClick={() => setActiveTab(index)}
25
+ >
26
+ {tab.props.icon && (
27
+ <i
28
+ className={`TabGroup-icon fa-duotone fa-solid ${tab.props.icon}`}
29
+ style={{ color: `${tab.props.iconColor}` }}
30
+ ></i>
31
+ )}
23
32
  {tab.props.title}
24
33
  </button>
25
- )}
34
+ ))}
26
35
  </nav>
27
36
  </header>
28
- <section>
29
- {children && children[activeTab]}
30
- </section>
37
+ <section>{children && children[activeTab]}</section>
31
38
  </div>
32
39
  );
33
40
  };
@@ -1,9 +1,13 @@
1
1
  import React from 'react';
2
2
 
3
- const TailwindRoot = ({ children, flow }) => {
3
+ import { tailwindPrefix } from '../../utils/consts';
4
+
5
+ interface Props extends React.PropsWithChildren<{ flow: boolean }> {}
6
+
7
+ const TailwindRoot = ({ children, flow }: Props) => {
4
8
  const Tag = flow ? 'div' : 'span';
5
9
 
6
- return <Tag className="readme-tailwind">{children}</Tag>;
10
+ return <Tag className={tailwindPrefix}>{children}</Tag>;
7
11
  };
8
12
 
9
13
  export default TailwindRoot;
@@ -1,9 +1,10 @@
1
1
  import React from 'react';
2
2
  import './style.scss';
3
- declare const Accordion: ({ children, icon, iconColor, title }: {
4
- children: any;
5
- icon: any;
6
- iconColor: any;
7
- title: any;
8
- }) => React.JSX.Element;
3
+ interface Props extends React.PropsWithChildren<{
4
+ icon?: string;
5
+ iconColor?: string;
6
+ title: string;
7
+ }> {
8
+ }
9
+ declare const Accordion: ({ children, icon, iconColor, title }: Props) => React.JSX.Element;
9
10
  export default Accordion;
@@ -1,9 +1,9 @@
1
1
  import * as React from 'react';
2
2
  interface Props extends React.PropsWithChildren<React.HTMLAttributes<HTMLQuoteElement>> {
3
- attributes?: {};
3
+ attributes?: Record<string, unknown>;
4
+ empty?: boolean;
4
5
  icon: string;
5
6
  theme?: string;
6
- empty?: boolean;
7
7
  }
8
8
  declare const Callout: (props: Props) => React.JSX.Element;
9
9
  export default Callout;
@@ -1,15 +1,17 @@
1
1
  import React from 'react';
2
2
  import './style.scss';
3
- export declare const Card: ({ children, href, icon, iconColor, target, title }: {
4
- children: any;
5
- href: any;
6
- icon: any;
7
- iconColor: any;
8
- target: any;
9
- title: any;
10
- }) => React.JSX.Element;
11
- declare const CardsGrid: ({ columns, children }: {
3
+ interface CardProps extends React.PropsWithChildren<{
4
+ href?: string;
5
+ icon?: string;
6
+ iconColor?: string;
7
+ target?: string;
8
+ title?: string;
9
+ }> {
10
+ }
11
+ export declare const Card: ({ children, href, icon, iconColor, target, title }: CardProps) => React.JSX.Element;
12
+ interface CardsGripProps extends React.PropsWithChildren<{
12
13
  columns?: number;
13
- children: any;
14
- }) => React.JSX.Element;
14
+ }> {
15
+ }
16
+ declare const CardsGrid: ({ columns, children }: CardsGripProps) => React.JSX.Element;
15
17
  export default CardsGrid;
@@ -1,3 +1,7 @@
1
1
  import React from 'react';
2
- declare const CodeTabs: (props: any) => React.JSX.Element;
2
+ interface Props {
3
+ children: JSX.Element | JSX.Element[];
4
+ theme: 'dark' | 'default' | 'light';
5
+ }
6
+ declare const CodeTabs: (props: Props) => React.JSX.Element;
3
7
  export default CodeTabs;
@@ -1,10 +1,9 @@
1
1
  import React from 'react';
2
2
  import './style.scss';
3
- export declare const Column: ({ children }: {
4
- children: any;
5
- }) => React.JSX.Element;
6
- declare const Columns: ({ children, layout }: {
7
- children: any;
8
- layout?: string;
9
- }) => React.JSX.Element;
3
+ export declare const Column: ({ children }: React.PropsWithChildren) => React.JSX.Element;
4
+ interface Props extends React.PropsWithChildren<{
5
+ layout?: '1fr' | 'auto' | 'fixed';
6
+ }> {
7
+ }
8
+ declare const Columns: ({ children, layout }: Props) => React.JSX.Element;
10
9
  export default Columns;
@@ -1,15 +1,15 @@
1
1
  import React from 'react';
2
2
  interface EmbedProps {
3
- lazy?: boolean;
4
- url: string;
5
- title: string;
6
- providerName?: string;
7
- providerUrl?: string;
3
+ favicon?: string;
8
4
  html?: string;
9
5
  iframe?: boolean;
10
6
  image?: string;
11
- favicon?: string;
7
+ lazy?: boolean;
8
+ providerName?: string;
9
+ providerUrl?: string;
10
+ title: string;
12
11
  typeOfEmbed?: string;
12
+ url: string;
13
13
  }
14
14
  declare const Embed: ({ lazy, url, html, providerName, providerUrl, title, iframe, image, favicon, ...attrs }: EmbedProps) => React.JSX.Element;
15
15
  export default Embed;
@@ -1,10 +1,11 @@
1
+ import type { GlossaryTerm } from '../../contexts/GlossaryTerms';
1
2
  import React from 'react';
2
3
  import GlossaryContext from '../../contexts/GlossaryTerms';
3
- import type { GlossaryTerm } from '../../contexts/GlossaryTerms';
4
4
  interface Props extends React.PropsWithChildren {
5
5
  term?: string;
6
6
  terms: GlossaryTerm[];
7
7
  }
8
8
  declare const Glossary: ({ children, term: termProp, terms }: Props) => React.JSX.Element;
9
- declare const GlossaryWithContext: (props: any) => React.JSX.Element;
10
- export { Glossary, GlossaryWithContext as default, GlossaryContext };
9
+ declare const GlossaryWithContext: (props: Omit<Props, "terms">) => React.JSX.Element;
10
+ export { Glossary, GlossaryContext };
11
+ export default GlossaryWithContext;
@@ -1,7 +1,8 @@
1
1
  import React from 'react';
2
- declare const HTMLBlock: ({ children, runScripts, safeMode }: {
3
- children?: string;
4
- runScripts: any;
2
+ interface Props {
3
+ children: React.ReactElement | string;
4
+ runScripts?: boolean | string;
5
5
  safeMode?: boolean;
6
- }) => React.JSX.Element;
6
+ }
7
+ declare const HTMLBlock: ({ children, runScripts, safeMode }: Props) => React.JSX.Element;
7
8
  export default HTMLBlock;
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  export type Depth = 1 | 2 | 3 | 4 | 5 | 6;
3
3
  interface Props extends React.PropsWithChildren<React.HTMLAttributes<HTMLHeadingElement>> {
4
- tag: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
5
4
  depth: Depth;
5
+ tag: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
6
6
  }
7
7
  declare const CreateHeading: (depth: Depth) => (props: Props) => React.JSX.Element;
8
8
  export default CreateHeading;
@@ -4,13 +4,13 @@ interface ImageProps {
4
4
  alt?: string;
5
5
  border?: boolean;
6
6
  caption?: string;
7
+ children?: [React.ReactElement];
7
8
  className?: string;
8
9
  height?: string;
10
+ lazy?: boolean;
9
11
  src: string;
10
12
  title?: string;
11
13
  width?: string;
12
- lazy?: boolean;
13
- children?: [React.ReactElement];
14
14
  }
15
15
  declare const Image: (Props: ImageProps) => React.JSX.Element;
16
16
  export default Image;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  interface Props extends JSX.IntrinsicAttributes {
3
- align: ('left' | 'center' | 'right')[];
4
- children: [React.ReactElement<HTMLTableCaptionElement | HTMLTableSectionElement | HTMLTableRowElement>];
3
+ align: ('center' | 'left' | 'right')[];
4
+ children: [React.ReactElement<HTMLTableCaptionElement | HTMLTableRowElement | HTMLTableSectionElement>];
5
5
  }
6
6
  declare const Table: (props: Props) => React.JSX.Element;
7
7
  export default Table;
@@ -1,9 +1,8 @@
1
1
  import React from 'react';
2
2
  import './style.scss';
3
- export declare const Tab: ({ children }: {
4
- children: any;
5
- }) => React.JSX.Element;
6
- declare const Tabs: ({ children }: {
7
- children: any;
8
- }) => React.JSX.Element;
3
+ export declare const Tab: ({ children }: React.PropsWithChildren) => React.JSX.Element;
4
+ interface TabsProps {
5
+ children?: React.ReactElement[];
6
+ }
7
+ declare const Tabs: ({ children }: TabsProps) => React.JSX.Element;
9
8
  export default Tabs;
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
- declare const TailwindRoot: ({ children, flow }: {
3
- children: any;
4
- flow: any;
5
- }) => React.JSX.Element;
2
+ interface Props extends React.PropsWithChildren<{
3
+ flow: boolean;
4
+ }> {
5
+ }
6
+ declare const TailwindRoot: ({ children, flow }: Props) => React.JSX.Element;
6
7
  export default TailwindRoot;
@@ -1,7 +1,7 @@
1
- export type GlossaryTerm = {
2
- term: string;
3
- definition: string;
1
+ export interface GlossaryTerm {
4
2
  _id?: string;
5
- };
3
+ definition: string;
4
+ term: string;
5
+ }
6
6
  declare const GlossaryContext: import("react").Context<GlossaryTerm[]>;
7
7
  export default GlossaryContext;