@readme/markdown 6.75.0-beta.76 → 6.75.0-beta.78

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,23 @@
1
+ import React, { useState } from 'react';
2
+
3
+ import './style.scss';
4
+
5
+ const Accordion = ({ children, title }) => {
6
+ const [isActive, setIsActive] = useState(false);
7
+
8
+ const handleToggle = () => {
9
+ setIsActive(!isActive);
10
+ }
11
+
12
+ return (
13
+ <div className="Accordion">
14
+ <button className="title" onClick={handleToggle}>
15
+ {title}
16
+ <i className={`icon${isActive ? '_active' : ''} fa fa-chevron-right`}></i>
17
+ </button>
18
+ <div className={`content content${isActive ? '_active' : ''}`}>{children}</div>
19
+ </div>
20
+ );
21
+ };
22
+
23
+ export default Accordion;
@@ -0,0 +1,43 @@
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: 14px;
15
+ justify-content: space-between;
16
+ padding: 10px;
17
+ position: relative;
18
+ text-align: left;
19
+ width: 100%;
20
+ }
21
+
22
+ .icon {
23
+ color: var(--color-text-default, #384248);
24
+ font-size: 12px;
25
+ transition: transform 0.3s;
26
+
27
+ &_active {
28
+ font-size: 12px;
29
+ transform: rotate(90deg);
30
+ transition: transform 0.3s;
31
+ }
32
+ }
33
+
34
+ .content {
35
+ color: var(--color-text-default, #384248);
36
+ display: none;
37
+ padding: 10px;
38
+
39
+ &_active {
40
+ display: block;
41
+ }
42
+ }
43
+ }
@@ -5,8 +5,10 @@
5
5
  .Card {
6
6
  padding: 10px;
7
7
  backdrop-filter: blur(20px);
8
- border: 1px solid rgba(black, 0.1);
8
+ background: rgba(var(--color-bg-page-rgb, white), 1);
9
+ border: 1px solid var(--color-border-default, rgba(black, 0.1));
9
10
  border-radius: 5px;
10
11
  box-shadow: 0 1px 2px #{rgba(black, 0.05)}, 0 2px 5px #{rgba(black, 0.02)};
12
+ color: var(--color-text-default, #384248);
11
13
  }
12
14
  }
@@ -1,3 +1,4 @@
1
+ export { default as Accordion } from './Accordion';
1
2
  export { default as Anchor } from './Anchor';
2
3
  export { default as Callout } from './Callout';
3
4
  export { default as Cards } from './CardsGrid';
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import './style.scss';
3
+ declare const Accordion: ({ children, title }: {
4
+ children: any;
5
+ title: any;
6
+ }) => React.JSX.Element;
7
+ export default Accordion;
@@ -1,3 +1,4 @@
1
+ export { default as Accordion } from './Accordion';
1
2
  export { default as Anchor } from './Anchor';
2
3
  export { default as Callout } from './Callout';
3
4
  export { default as Cards } from './CardsGrid';
@@ -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/main.css CHANGED
@@ -1,4 +1,5 @@
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:14px;justify-content:space-between;padding:10px;position:relative;text-align:left;width:100%}.Accordion .icon{color:var(--color-text-default, #384248);font-size:12px;transition:transform .3s}.Accordion .icon_active{font-size:12px;transform:rotate(90deg);transition:transform .3s}.Accordion .content{color:var(--color-text-default, #384248);display:none;padding:10px}.Accordion .content_active{display:block}
2
+ .CardsGrid{display:grid;gap:20px}.CardsGrid .Card{padding:10px;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);color:var(--color-text-default, #384248)}
2
3
  /* BASICS */
3
4
 
4
5
  .CodeMirror {
package/dist/main.js CHANGED
@@ -13253,6 +13253,7 @@ __webpack_require__.d(__webpack_exports__, {
13253
13253
  var components_namespaceObject = {};
13254
13254
  __webpack_require__.r(components_namespaceObject);
13255
13255
  __webpack_require__.d(components_namespaceObject, {
13256
+ Accordion: () => (components_Accordion),
13256
13257
  Anchor: () => (components_Anchor),
13257
13258
  Callout: () => (components_Callout),
13258
13259
  Cards: () => (components_CardsGrid),
@@ -13295,6 +13296,25 @@ __webpack_require__.d(util_types_namespaceObject, {
13295
13296
  spaceSeparated: () => (spaceSeparated)
13296
13297
  });
13297
13298
 
13299
+ // EXTERNAL MODULE: external {"amd":"react","commonjs":"react","commonjs2":"react","root":"React","umd":"react"}
13300
+ var external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_ = __webpack_require__(1307);
13301
+ 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_);
13302
+ ;// CONCATENATED MODULE: ./components/Accordion/index.tsx
13303
+
13304
+
13305
+ const Accordion = ({ children, title }) => {
13306
+ const [isActive, setIsActive] = (0,external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.useState)(false);
13307
+ const handleToggle = () => {
13308
+ setIsActive(!isActive);
13309
+ };
13310
+ return (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { className: "Accordion" },
13311
+ external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("button", { className: "title", onClick: handleToggle },
13312
+ title,
13313
+ external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("i", { className: `icon${isActive ? '_active' : ''} fa fa-chevron-right` })),
13314
+ external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { className: `content content${isActive ? '_active' : ''}` }, 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('/');
@@ -13789,6 +13806,7 @@ function TableOfContents({ children }) {
13789
13806
 
13790
13807
 
13791
13808
 
13809
+
13792
13810
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.to-primitive.js
13793
13811
  var es_symbol_to_primitive = __webpack_require__(6611);
13794
13812
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.filter.js
@@ -65262,6 +65280,7 @@ const alignToStyle = (align) => {
65262
65280
  },
65263
65281
  };
65264
65282
  };
65283
+ const tables_to_jsx_isTableCell = (node) => ['tableHead', 'tableCell'].includes(node.type);
65265
65284
  const visitor = (table, index, parent) => {
65266
65285
  let hasFlowContent = false;
65267
65286
  const tableCellVisitor = (cell) => {
@@ -65279,7 +65298,7 @@ const visitor = (table, index, parent) => {
65279
65298
  }
65280
65299
  });
65281
65300
  };
65282
- visit(table, 'tableCell', tableCellVisitor);
65301
+ visit(table, tables_to_jsx_isTableCell, tableCellVisitor);
65283
65302
  if (!hasFlowContent) {
65284
65303
  table.type = 'table';
65285
65304
  return;
package/dist/main.node.js CHANGED
@@ -7800,6 +7800,7 @@ __webpack_require__.d(__webpack_exports__, {
7800
7800
  var components_namespaceObject = {};
7801
7801
  __webpack_require__.r(components_namespaceObject);
7802
7802
  __webpack_require__.d(components_namespaceObject, {
7803
+ Accordion: () => (components_Accordion),
7803
7804
  Anchor: () => (components_Anchor),
7804
7805
  Callout: () => (components_Callout),
7805
7806
  Cards: () => (components_CardsGrid),
@@ -7842,11 +7843,27 @@ __webpack_require__.d(util_types_namespaceObject, {
7842
7843
  spaceSeparated: () => (spaceSeparated)
7843
7844
  });
7844
7845
 
7845
- // EXTERNAL MODULE: ./node_modules/prop-types/index.js
7846
- var prop_types = __webpack_require__(556);
7847
7846
  // EXTERNAL MODULE: external {"amd":"react","commonjs":"react","commonjs2":"react","root":"React","umd":"react"}
7848
7847
  var external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_ = __webpack_require__(137);
7849
7848
  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_);
7849
+ ;// CONCATENATED MODULE: ./components/Accordion/index.tsx
7850
+
7851
+
7852
+ const Accordion = ({ children, title }) => {
7853
+ const [isActive, setIsActive] = (0,external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.useState)(false);
7854
+ const handleToggle = () => {
7855
+ setIsActive(!isActive);
7856
+ };
7857
+ return (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { className: "Accordion" },
7858
+ external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("button", { className: "title", onClick: handleToggle },
7859
+ title,
7860
+ external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("i", { className: `icon${isActive ? '_active' : ''} fa fa-chevron-right` })),
7861
+ external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { className: `content content${isActive ? '_active' : ''}` }, 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('/');
@@ -13213,6 +13230,7 @@ function TableOfContents({ children }) {
13213
13230
 
13214
13231
 
13215
13232
 
13233
+
13216
13234
  ;// CONCATENATED MODULE: ./options.js
13217
13235
  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
13236
  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; }
@@ -66249,6 +66267,7 @@ const alignToStyle = (align) => {
66249
66267
  },
66250
66268
  };
66251
66269
  };
66270
+ const tables_to_jsx_isTableCell = (node) => ['tableHead', 'tableCell'].includes(node.type);
66252
66271
  const visitor = (table, index, parent) => {
66253
66272
  let hasFlowContent = false;
66254
66273
  const tableCellVisitor = (cell) => {
@@ -66266,7 +66285,7 @@ const visitor = (table, index, parent) => {
66266
66285
  }
66267
66286
  });
66268
66287
  };
66269
- visit(table, 'tableCell', tableCellVisitor);
66288
+ visit(table, tables_to_jsx_isTableCell, tableCellVisitor);
66270
66289
  if (!hasFlowContent) {
66271
66290
  table.type = 'table';
66272
66291
  return;
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": "6.75.0-beta.76",
5
+ "version": "6.75.0-beta.78",
6
6
  "main": "dist/main.node.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "browser": "dist/main.js",