@readme/markdown 7.0.0 → 7.2.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.
package/README.md CHANGED
@@ -64,8 +64,17 @@ Parses mdx to an hast.
64
64
 
65
65
  #### `plain`
66
66
 
67
- > [!NOTE]
68
- > unimplemented
67
+ Parses mdx to a plain string.
68
+
69
+ > [!WARNING]
70
+ > This **does** not `eval` the doc.
71
+
72
+ #### `tags`
73
+
74
+ Returns a list of tag names from the doc.
75
+
76
+ > [!WARNING]
77
+ > This **does** not `eval` the doc.
69
78
 
70
79
  #### `utils`
71
80
 
@@ -0,0 +1,17 @@
1
+ import React, { useState } from 'react';
2
+
3
+ import './style.scss';
4
+
5
+ const Accordion = ({ children, icon, iconColor, title }) => {
6
+ return (
7
+ <details className="Accordion">
8
+ <summary className="Accordion-title">
9
+ {icon && <i className={`Accordion-icon fa ${icon}`} style={{ color: `${iconColor}` }}></i>}
10
+ {title}
11
+ </summary>
12
+ <div className="Accordion-content">{children}</div>
13
+ </details>
14
+ );
15
+ };
16
+
17
+ export default Accordion;
@@ -0,0 +1,40 @@
1
+ .Accordion {
2
+ background: rgba(var(--color-bg-page-rgb, white), 1);
3
+ border: 1px solid var(--color-border-default, rgba(black, 0.1));
4
+ border-radius: 5px;
5
+
6
+ &-title {
7
+ align-items: center;
8
+ background: white;
9
+ border: 0;
10
+ border-radius: 5px;
11
+ color: var(--color-text-default, #384248);
12
+ cursor: pointer;
13
+ display: flex;
14
+ font-size: 16px;
15
+ padding: 15px;
16
+ position: relative;
17
+ text-align: left;
18
+ width: 100%;
19
+
20
+ &:hover {
21
+ background: var(--color-bg-hover, #{rgba(black, 0.05)});
22
+ }
23
+
24
+ .Accordion[open] & {
25
+ border-bottom-left-radius: 0;
26
+ border-bottom-right-radius: 0;
27
+ }
28
+ }
29
+
30
+ &-icon {
31
+ color: var(--project-color-primary, inherit);
32
+ margin-left: 5px;
33
+ margin-right: 5px;
34
+ }
35
+
36
+ &-content {
37
+ color: var(--color-text-muted, #4f5a66);
38
+ padding: 10px 15px 0 15px;
39
+ }
40
+ }
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+
3
+ import './style.scss';
4
+
5
+ export const Card = ({ children, href, icon, iconColor, target, title }) => {
6
+ const Tag = href ? 'a' : 'div';
7
+ return (
8
+ <Tag className="Card" href={href} target={target}>
9
+ {icon && <i className={`Card-icon fa ${icon}`} style={{ color: `${iconColor}` }}></i>}
10
+ {title && <h3 className='Card-title'>{title}</h3>}
11
+ <div className="Card-content">{children}</div>
12
+ </Tag>
13
+ )
14
+ }
15
+
16
+ const CardsGrid = ({ columns = 2, children }) => {
17
+ columns = columns >= 2 ? columns : 2;
18
+ return (
19
+ <div className="CardsGrid" style={{ gridTemplateColumns: `repeat(${columns}, 1fr)` }}>
20
+ {children}
21
+ </div>
22
+ );
23
+ };
24
+
25
+ export default CardsGrid;
@@ -0,0 +1,47 @@
1
+ .CardsGrid {
2
+ display: grid;
3
+ gap: 20px;
4
+
5
+ .Card {
6
+ padding: 15px;
7
+ padding-bottom: 0;
8
+ backdrop-filter: blur(20px);
9
+ background: rgba(var(--color-bg-page-rgb, white), 1);
10
+ border: 1px solid var(--color-border-default, rgba(black, 0.1));
11
+ border-radius: 5px;
12
+ box-shadow: 0 1px 2px #{rgba(black, 0.05)}, 0 2px 5px #{rgba(black, 0.02)};
13
+
14
+ &-top {
15
+ display: inline-flex;
16
+ flex-direction: row;
17
+ }
18
+
19
+ &-icon {
20
+ color: var(--project-color-primary, inherit);
21
+ font-size: 20px;
22
+ }
23
+
24
+ &-title {
25
+ color: var(--color-text-default, #384248);
26
+
27
+ &:first-child {
28
+ margin-top: 0;
29
+ }
30
+ }
31
+
32
+ &-content {
33
+ color: var(--color-text-muted, #4f5a66);
34
+ }
35
+ }
36
+
37
+ a.Card:not([href=""]) {
38
+ text-decoration: none;
39
+ color: inherit;
40
+
41
+ &:hover {
42
+ background: var(--color-bg-hover, #{rgba(black, 0.05)});
43
+ }
44
+ }
45
+
46
+
47
+ }
@@ -0,0 +1,34 @@
1
+ import React, { useState } from 'react';
2
+
3
+ import './style.scss';
4
+
5
+ export const Tab = ({ children }) => {
6
+ return (
7
+ <div className="TabContent">
8
+ {children}
9
+ </div>
10
+ )
11
+ }
12
+
13
+ const Tabs = ({ children }) => {
14
+ const [activeTab, setActiveTab] = useState(0);
15
+
16
+ return (
17
+ <div className="TabGroup">
18
+ <header>
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.title}
23
+ </button>
24
+ )}
25
+ </nav>
26
+ </header>
27
+ <section>
28
+ {children && children[activeTab]}
29
+ </section>
30
+ </div>
31
+ );
32
+ };
33
+
34
+ export default Tabs;
@@ -0,0 +1,29 @@
1
+ .TabGroup {
2
+ &-nav {
3
+ border-bottom: solid var(--color-border-default, #{rgba(black, 0.1)});
4
+ margin-bottom: 15px;
5
+ }
6
+
7
+ &-tab {
8
+ background: none;
9
+ border: 0;
10
+ color: var(--color-text-minimum, #637288);
11
+ cursor: pointer;
12
+ font-weight: 600;
13
+ padding: 10px;
14
+
15
+ &_active {
16
+ background: none;
17
+ border: 0;
18
+ border-bottom: solid var(--blue, #118cfd);
19
+ color: var(--blue, #118cfd);
20
+ font-weight: 600;
21
+ padding: 10px;
22
+ margin-bottom: -2px;
23
+ }
24
+
25
+ &:hover {
26
+ color: var(--color-text-muted, #4f5a66);
27
+ }
28
+ }
29
+ }
@@ -1,6 +1,7 @@
1
+ export { default as Accordion } from './Accordion';
1
2
  export { default as Anchor } from './Anchor';
2
3
  export { default as Callout } from './Callout';
3
- export { default as Cards } from './CardsGrid';
4
+ export { default as Cards, Card } from './Cards';
4
5
  export { default as Code } from './Code';
5
6
  export { default as CodeTabs } from './CodeTabs';
6
7
  export { default as Embed } from './Embed';
@@ -9,4 +10,5 @@ export { default as HTMLBlock } from './HTMLBlock';
9
10
  export { default as Heading } from './Heading';
10
11
  export { default as Image } from './Image';
11
12
  export { default as Table } from './Table';
13
+ export { default as Tabs, Tab } from './Tabs';
12
14
  export { default as TableOfContents } from './TableOfContents';
@@ -0,0 +1,9 @@
1
+ import React from 'react';
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;
9
+ export default Accordion;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
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 }: {
12
+ columns?: number;
13
+ children: any;
14
+ }) => React.JSX.Element;
15
+ export default CardsGrid;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
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;
9
+ export default Tabs;
@@ -1,6 +1,7 @@
1
+ export { default as Accordion } from './Accordion';
1
2
  export { default as Anchor } from './Anchor';
2
3
  export { default as Callout } from './Callout';
3
- export { default as Cards } from './CardsGrid';
4
+ export { default as Cards, Card } from './Cards';
4
5
  export { default as Code } from './Code';
5
6
  export { default as CodeTabs } from './CodeTabs';
6
7
  export { default as Embed } from './Embed';
@@ -9,4 +10,5 @@ export { default as HTMLBlock } from './HTMLBlock';
9
10
  export { default as Heading } from './Heading';
10
11
  export { default as Image } from './Image';
11
12
  export { default as Table } from './Table';
13
+ export { default as Tabs, Tab } from './Tabs';
12
14
  export { default as TableOfContents } from './TableOfContents';
@@ -18,6 +18,6 @@ declare class RenderError extends React.Component<PropsWithChildren<Props>, Stat
18
18
  componentDidCatch(error: any, info: {
19
19
  componentStack: any;
20
20
  }): void;
21
- render(): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element;
21
+ render(): string | number | boolean | React.JSX.Element | Iterable<React.ReactNode>;
22
22
  }
23
23
  export default RenderError;
package/dist/index.d.ts CHANGED
@@ -5,5 +5,5 @@ declare const utils: {
5
5
  getHref: any;
6
6
  calloutIcons: {};
7
7
  };
8
- export { compile, hast, run, mdast, mdx, plain, remarkPlugins } from './lib';
8
+ export { compile, hast, run, mdast, mdx, plain, remarkPlugins, tags } from './lib';
9
9
  export { Components, utils };
@@ -5,5 +5,6 @@ import mdast from './mdast';
5
5
  import mdx from './mdx';
6
6
  import plain from './plain';
7
7
  import run from './run';
8
+ import tags from './tags';
8
9
  export type { MdastOpts };
9
- export { astProcessor, compile, hast, mdast, mdx, plain, run, remarkPlugins };
10
+ export { astProcessor, compile, hast, mdast, mdx, plain, run, remarkPlugins, tags };
@@ -0,0 +1,2 @@
1
+ declare const tags: (doc: string) => string[];
2
+ export default tags;
package/dist/main.css CHANGED
@@ -1,4 +1,6 @@
1
- .CardsGrid{display:grid;gap:20px}.CardsGrid .Card{padding:10px;backdrop-filter:blur(20px);border:1px solid rgba(0,0,0,.1);border-radius:5px;box-shadow:0 1px 2px rgba(0, 0, 0, 0.05),0 2px 5px rgba(0, 0, 0, 0.02)}
1
+ .Accordion{background:rgba(var(--color-bg-page-rgb, white), 1);border:1px solid var(--color-border-default, rgba(0, 0, 0, 0.1));border-radius:5px}.Accordion-title{align-items:center;background:#fff;border:0;border-radius:5px;color:var(--color-text-default, #384248);cursor:pointer;display:flex;font-size:16px;padding:15px;position:relative;text-align:left;width:100%}.Accordion-title:hover{background:var(--color-bg-hover, rgba(0, 0, 0, 0.05))}.Accordion[open] .Accordion-title{border-bottom-left-radius:0;border-bottom-right-radius:0}.Accordion-icon{color:var(--project-color-primary, inherit);margin-left:5px;margin-right:5px}.Accordion-content{color:var(--color-text-muted, #4f5a66);padding:10px 15px 0 15px}
2
+ .CardsGrid{display:grid;gap:20px}.CardsGrid .Card{padding:15px;padding-bottom:0;backdrop-filter:blur(20px);background:rgba(var(--color-bg-page-rgb, white), 1);border:1px solid var(--color-border-default, rgba(0, 0, 0, 0.1));border-radius:5px;box-shadow:0 1px 2px rgba(0, 0, 0, 0.05),0 2px 5px rgba(0, 0, 0, 0.02)}.CardsGrid .Card-top{display:inline-flex;flex-direction:row}.CardsGrid .Card-icon{color:var(--project-color-primary, inherit);font-size:20px}.CardsGrid .Card-title{color:var(--color-text-default, #384248)}.CardsGrid .Card-title:first-child{margin-top:0}.CardsGrid .Card-content{color:var(--color-text-muted, #4f5a66)}.CardsGrid a.Card:not([href=""]){text-decoration:none;color:inherit}.CardsGrid a.Card:not([href=""]):hover{background:var(--color-bg-hover, rgba(0, 0, 0, 0.05))}
3
+ .TabGroup-nav{border-bottom:solid var(--color-border-default, rgba(0, 0, 0, 0.1));margin-bottom:15px}.TabGroup-tab{background:none;border:0;color:var(--color-text-minimum, #637288);cursor:pointer;font-weight:600;padding:10px}.TabGroup-tab_active{background:none;border:0;border-bottom:solid var(--blue, #118cfd);color:var(--blue, #118cfd);font-weight:600;padding:10px;margin-bottom:-2px}.TabGroup-tab:hover{color:var(--color-text-muted, #4f5a66)}
2
4
  /* BASICS */
3
5
 
4
6
  .CodeMirror {
package/dist/main.js CHANGED
@@ -13246,6 +13246,7 @@ __webpack_require__.d(__webpack_exports__, {
13246
13246
  plain: () => (/* reexport */ lib_plain),
13247
13247
  remarkPlugins: () => (/* reexport */ remarkPlugins),
13248
13248
  run: () => (/* reexport */ lib_run),
13249
+ tags: () => (/* reexport */ lib_tags),
13249
13250
  utils: () => (/* binding */ utils)
13250
13251
  });
13251
13252
 
@@ -13253,9 +13254,11 @@ __webpack_require__.d(__webpack_exports__, {
13253
13254
  var components_namespaceObject = {};
13254
13255
  __webpack_require__.r(components_namespaceObject);
13255
13256
  __webpack_require__.d(components_namespaceObject, {
13257
+ Accordion: () => (components_Accordion),
13256
13258
  Anchor: () => (components_Anchor),
13257
13259
  Callout: () => (components_Callout),
13258
- Cards: () => (components_CardsGrid),
13260
+ Card: () => (Card),
13261
+ Cards: () => (Cards),
13259
13262
  Code: () => (components_Code),
13260
13263
  CodeTabs: () => (components_CodeTabs),
13261
13264
  Embed: () => (components_Embed),
@@ -13263,8 +13266,10 @@ __webpack_require__.d(components_namespaceObject, {
13263
13266
  HTMLBlock: () => (components_HTMLBlock),
13264
13267
  Heading: () => (components_Heading),
13265
13268
  Image: () => (components_Image),
13269
+ Tab: () => (Tab),
13266
13270
  Table: () => (components_Table),
13267
- TableOfContents: () => (components_TableOfContents)
13271
+ TableOfContents: () => (components_TableOfContents),
13272
+ Tabs: () => (components_Tabs)
13268
13273
  });
13269
13274
 
13270
13275
  // NAMESPACE OBJECT: ./node_modules/micromark/lib/constructs.js
@@ -13295,6 +13300,21 @@ __webpack_require__.d(util_types_namespaceObject, {
13295
13300
  spaceSeparated: () => (spaceSeparated)
13296
13301
  });
13297
13302
 
13303
+ // EXTERNAL MODULE: external {"amd":"react","commonjs":"react","commonjs2":"react","root":"React","umd":"react"}
13304
+ var external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_ = __webpack_require__(1307);
13305
+ var external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default = /*#__PURE__*/__webpack_require__.n(external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_);
13306
+ ;// CONCATENATED MODULE: ./components/Accordion/index.tsx
13307
+
13308
+
13309
+ const Accordion = ({ children, icon, iconColor, title }) => {
13310
+ return (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("details", { className: "Accordion" },
13311
+ external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("summary", { className: "Accordion-title" },
13312
+ icon && external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("i", { className: `Accordion-icon fa ${icon}`, style: { color: `${iconColor}` } }),
13313
+ title),
13314
+ external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { className: "Accordion-content" }, children)));
13315
+ };
13316
+ /* harmony default export */ const components_Accordion = (Accordion);
13317
+
13298
13318
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.js
13299
13319
  var es_symbol = __webpack_require__(3534);
13300
13320
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.description.js
@@ -13337,9 +13357,6 @@ var es_regexp_exec = __webpack_require__(7136);
13337
13357
  var es_string_match = __webpack_require__(8636);
13338
13358
  // EXTERNAL MODULE: ./node_modules/prop-types/index.js
13339
13359
  var prop_types = __webpack_require__(5556);
13340
- // EXTERNAL MODULE: external {"amd":"react","commonjs":"react","commonjs2":"react","root":"React","umd":"react"}
13341
- var external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_ = __webpack_require__(1307);
13342
- var external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default = /*#__PURE__*/__webpack_require__.n(external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_);
13343
13360
  ;// CONCATENATED MODULE: ./contexts/BaseUrl.js
13344
13361
 
13345
13362
  var BaseUrlContext = /*#__PURE__*/external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createContext('/');
@@ -13480,15 +13497,21 @@ const Callout = (props) => {
13480
13497
  };
13481
13498
  /* harmony default export */ const components_Callout = (Callout);
13482
13499
 
13483
- ;// CONCATENATED MODULE: ./components/CardsGrid/index.tsx
13500
+ ;// CONCATENATED MODULE: ./components/Cards/index.tsx
13484
13501
 
13485
13502
 
13486
- const Card = ({ children }) => external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { className: "Card" }, children);
13503
+ const Card = ({ children, href, icon, iconColor, target, title }) => {
13504
+ const Tag = href ? 'a' : 'div';
13505
+ return (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement(Tag, { className: "Card", href: href, target: target },
13506
+ icon && external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("i", { className: `Card-icon fa ${icon}`, style: { color: `${iconColor}` } }),
13507
+ title && external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("h3", { className: 'Card-title' }, title),
13508
+ external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { className: "Card-content" }, children)));
13509
+ };
13487
13510
  const CardsGrid = ({ columns = 2, children }) => {
13488
13511
  columns = columns >= 2 ? columns : 2;
13489
- return (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { className: "CardsGrid", style: { gridTemplateColumns: `repeat(${columns}, 1fr)` } }, external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().Children.map(children, e => (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement(Card, null, e)))));
13512
+ return (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { className: "CardsGrid", style: { gridTemplateColumns: `repeat(${columns}, 1fr)` } }, children));
13490
13513
  };
13491
- /* harmony default export */ const components_CardsGrid = (CardsGrid);
13514
+ /* harmony default export */ const Cards = (CardsGrid);
13492
13515
 
13493
13516
  // EXTERNAL MODULE: ./node_modules/copy-to-clipboard/index.js
13494
13517
  var copy_to_clipboard = __webpack_require__(7965);
@@ -13762,6 +13785,21 @@ const Table = (props) => {
13762
13785
  };
13763
13786
  /* harmony default export */ const components_Table = (Table);
13764
13787
 
13788
+ ;// CONCATENATED MODULE: ./components/Tabs/index.tsx
13789
+
13790
+
13791
+ const Tab = ({ children }) => {
13792
+ return (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { className: "TabContent" }, children));
13793
+ };
13794
+ const Tabs = ({ children }) => {
13795
+ const [activeTab, setActiveTab] = (0,external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.useState)(0);
13796
+ return (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { className: "TabGroup" },
13797
+ external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("header", null,
13798
+ external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("nav", { className: "TabGroup-nav" }, children === null || children === void 0 ? void 0 : children.map((tab, index) => external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("button", { className: `TabGroup-tab${activeTab === index ? '_active' : ''}`, key: tab.props.title, onClick: () => setActiveTab(index) }, tab.props.title)))),
13799
+ external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("section", null, children && children[activeTab])));
13800
+ };
13801
+ /* harmony default export */ const components_Tabs = (Tabs);
13802
+
13765
13803
  ;// CONCATENATED MODULE: ./components/TableOfContents/index.tsx
13766
13804
 
13767
13805
  function TableOfContents({ children }) {
@@ -13789,6 +13827,8 @@ function TableOfContents({ children }) {
13789
13827
 
13790
13828
 
13791
13829
 
13830
+
13831
+
13792
13832
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.to-primitive.js
13793
13833
  var es_symbol_to_primitive = __webpack_require__(6611);
13794
13834
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.filter.js
@@ -94062,6 +94102,21 @@ const run_run = async (string, _opts = {}) => {
94062
94102
  };
94063
94103
  /* harmony default export */ const lib_run = (run_run);
94064
94104
 
94105
+ ;// CONCATENATED MODULE: ./lib/tags.ts
94106
+
94107
+
94108
+
94109
+ const tags = (doc) => {
94110
+ const set = new Set();
94111
+ visit(lib_mdast(doc), isMDXElement, (node) => {
94112
+ if (node.name.match(/^[A-Z]/)) {
94113
+ set.add(node.name);
94114
+ }
94115
+ });
94116
+ return Array.from(set);
94117
+ };
94118
+ /* harmony default export */ const lib_tags = (tags);
94119
+
94065
94120
  ;// CONCATENATED MODULE: ./lib/index.ts
94066
94121
 
94067
94122
 
@@ -94072,6 +94127,7 @@ const run_run = async (string, _opts = {}) => {
94072
94127
 
94073
94128
 
94074
94129
 
94130
+
94075
94131
  ;// CONCATENATED MODULE: ./index.tsx
94076
94132
 
94077
94133
 
package/dist/main.node.js CHANGED
@@ -7793,6 +7793,7 @@ __webpack_require__.d(__webpack_exports__, {
7793
7793
  plain: () => (/* reexport */ lib_plain),
7794
7794
  remarkPlugins: () => (/* reexport */ remarkPlugins),
7795
7795
  run: () => (/* reexport */ lib_run),
7796
+ tags: () => (/* reexport */ lib_tags),
7796
7797
  utils: () => (/* binding */ utils)
7797
7798
  });
7798
7799
 
@@ -7800,9 +7801,11 @@ __webpack_require__.d(__webpack_exports__, {
7800
7801
  var components_namespaceObject = {};
7801
7802
  __webpack_require__.r(components_namespaceObject);
7802
7803
  __webpack_require__.d(components_namespaceObject, {
7804
+ Accordion: () => (components_Accordion),
7803
7805
  Anchor: () => (components_Anchor),
7804
7806
  Callout: () => (components_Callout),
7805
- Cards: () => (components_CardsGrid),
7807
+ Card: () => (Card),
7808
+ Cards: () => (Cards),
7806
7809
  Code: () => (components_Code),
7807
7810
  CodeTabs: () => (components_CodeTabs),
7808
7811
  Embed: () => (components_Embed),
@@ -7810,8 +7813,10 @@ __webpack_require__.d(components_namespaceObject, {
7810
7813
  HTMLBlock: () => (components_HTMLBlock),
7811
7814
  Heading: () => (components_Heading),
7812
7815
  Image: () => (components_Image),
7816
+ Tab: () => (Tab),
7813
7817
  Table: () => (components_Table),
7814
- TableOfContents: () => (components_TableOfContents)
7818
+ TableOfContents: () => (components_TableOfContents),
7819
+ Tabs: () => (components_Tabs)
7815
7820
  });
7816
7821
 
7817
7822
  // NAMESPACE OBJECT: ./node_modules/micromark/lib/constructs.js
@@ -7842,11 +7847,23 @@ __webpack_require__.d(util_types_namespaceObject, {
7842
7847
  spaceSeparated: () => (spaceSeparated)
7843
7848
  });
7844
7849
 
7845
- // EXTERNAL MODULE: ./node_modules/prop-types/index.js
7846
- var prop_types = __webpack_require__(556);
7847
7850
  // EXTERNAL MODULE: external {"amd":"react","commonjs":"react","commonjs2":"react","root":"React","umd":"react"}
7848
7851
  var external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_ = __webpack_require__(137);
7849
7852
  var external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default = /*#__PURE__*/__webpack_require__.n(external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_);
7853
+ ;// CONCATENATED MODULE: ./components/Accordion/index.tsx
7854
+
7855
+
7856
+ const Accordion = ({ children, icon, iconColor, title }) => {
7857
+ return (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("details", { className: "Accordion" },
7858
+ external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("summary", { className: "Accordion-title" },
7859
+ icon && external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("i", { className: `Accordion-icon fa ${icon}`, style: { color: `${iconColor}` } }),
7860
+ title),
7861
+ external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { className: "Accordion-content" }, children)));
7862
+ };
7863
+ /* harmony default export */ const components_Accordion = (Accordion);
7864
+
7865
+ // EXTERNAL MODULE: ./node_modules/prop-types/index.js
7866
+ var prop_types = __webpack_require__(556);
7850
7867
  ;// CONCATENATED MODULE: ./contexts/BaseUrl.js
7851
7868
 
7852
7869
  const BaseUrlContext = /*#__PURE__*/external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createContext('/');
@@ -7960,15 +7977,21 @@ const Callout = (props) => {
7960
7977
  };
7961
7978
  /* harmony default export */ const components_Callout = (Callout);
7962
7979
 
7963
- ;// CONCATENATED MODULE: ./components/CardsGrid/index.tsx
7980
+ ;// CONCATENATED MODULE: ./components/Cards/index.tsx
7964
7981
 
7965
7982
 
7966
- const Card = ({ children }) => external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { className: "Card" }, children);
7983
+ const Card = ({ children, href, icon, iconColor, target, title }) => {
7984
+ const Tag = href ? 'a' : 'div';
7985
+ return (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement(Tag, { className: "Card", href: href, target: target },
7986
+ icon && external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("i", { className: `Card-icon fa ${icon}`, style: { color: `${iconColor}` } }),
7987
+ title && external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("h3", { className: 'Card-title' }, title),
7988
+ external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { className: "Card-content" }, children)));
7989
+ };
7967
7990
  const CardsGrid = ({ columns = 2, children }) => {
7968
7991
  columns = columns >= 2 ? columns : 2;
7969
- return (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { className: "CardsGrid", style: { gridTemplateColumns: `repeat(${columns}, 1fr)` } }, external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().Children.map(children, e => (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement(Card, null, e)))));
7992
+ return (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { className: "CardsGrid", style: { gridTemplateColumns: `repeat(${columns}, 1fr)` } }, children));
7970
7993
  };
7971
- /* harmony default export */ const components_CardsGrid = (CardsGrid);
7994
+ /* harmony default export */ const Cards = (CardsGrid);
7972
7995
 
7973
7996
  // EXTERNAL MODULE: ./node_modules/copy-to-clipboard/index.js
7974
7997
  var copy_to_clipboard = __webpack_require__(965);
@@ -13186,6 +13209,21 @@ const Table = (props) => {
13186
13209
  };
13187
13210
  /* harmony default export */ const components_Table = (Table);
13188
13211
 
13212
+ ;// CONCATENATED MODULE: ./components/Tabs/index.tsx
13213
+
13214
+
13215
+ const Tab = ({ children }) => {
13216
+ return (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { className: "TabContent" }, children));
13217
+ };
13218
+ const Tabs = ({ children }) => {
13219
+ const [activeTab, setActiveTab] = (0,external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.useState)(0);
13220
+ return (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { className: "TabGroup" },
13221
+ external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("header", null,
13222
+ external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("nav", { className: "TabGroup-nav" }, children === null || children === void 0 ? void 0 : children.map((tab, index) => external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("button", { className: `TabGroup-tab${activeTab === index ? '_active' : ''}`, key: tab.props.title, onClick: () => setActiveTab(index) }, tab.props.title)))),
13223
+ external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("section", null, children && children[activeTab])));
13224
+ };
13225
+ /* harmony default export */ const components_Tabs = (Tabs);
13226
+
13189
13227
  ;// CONCATENATED MODULE: ./components/TableOfContents/index.tsx
13190
13228
 
13191
13229
  function TableOfContents({ children }) {
@@ -13213,6 +13251,8 @@ function TableOfContents({ children }) {
13213
13251
 
13214
13252
 
13215
13253
 
13254
+
13255
+
13216
13256
  ;// CONCATENATED MODULE: ./options.js
13217
13257
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
13218
13258
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -95049,6 +95089,21 @@ const run_run = async (string, _opts = {}) => {
95049
95089
  };
95050
95090
  /* harmony default export */ const lib_run = (run_run);
95051
95091
 
95092
+ ;// CONCATENATED MODULE: ./lib/tags.ts
95093
+
95094
+
95095
+
95096
+ const tags = (doc) => {
95097
+ const set = new Set();
95098
+ visit(lib_mdast(doc), isMDXElement, (node) => {
95099
+ if (node.name.match(/^[A-Z]/)) {
95100
+ set.add(node.name);
95101
+ }
95102
+ });
95103
+ return Array.from(set);
95104
+ };
95105
+ /* harmony default export */ const lib_tags = (tags);
95106
+
95052
95107
  ;// CONCATENATED MODULE: ./lib/index.ts
95053
95108
 
95054
95109
 
@@ -95059,6 +95114,7 @@ const run_run = async (string, _opts = {}) => {
95059
95114
 
95060
95115
 
95061
95116
 
95117
+
95062
95118
  ;// CONCATENATED MODULE: ./index.tsx
95063
95119
 
95064
95120
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@readme/markdown",
3
3
  "description": "ReadMe's React-based Markdown parser",
4
4
  "author": "Rafe Goldberg <rafe@readme.io>",
5
- "version": "7.0.0",
5
+ "version": "7.2.0",
6
6
  "main": "dist/main.node.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "browser": "dist/main.js",
@@ -1,18 +0,0 @@
1
- import React from 'react';
2
-
3
- import './style.scss';
4
-
5
- const Card = ({ children }) => <div className="Card">{children}</div>;
6
-
7
- const CardsGrid = ({ columns = 2, children }) => {
8
- columns = columns >= 2 ? columns : 2;
9
- return (
10
- <div className="CardsGrid" style={{ gridTemplateColumns: `repeat(${columns}, 1fr)` }}>
11
- {React.Children.map(children, e => (
12
- <Card>{e}</Card>
13
- ))}
14
- </div>
15
- );
16
- };
17
-
18
- export default CardsGrid;
@@ -1,12 +0,0 @@
1
- .CardsGrid {
2
- display: grid;
3
- gap: 20px;
4
-
5
- .Card {
6
- padding: 10px;
7
- backdrop-filter: blur(20px);
8
- border: 1px solid rgba(black, 0.1);
9
- border-radius: 5px;
10
- box-shadow: 0 1px 2px #{rgba(black, 0.05)}, 0 2px 5px #{rgba(black, 0.02)};
11
- }
12
- }
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import './style.scss';
3
- declare const CardsGrid: ({ columns, children }: {
4
- columns?: number;
5
- children: any;
6
- }) => React.JSX.Element;
7
- export default CardsGrid;