@san-siva/blogkit 1.1.1 → 1.1.3
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/dist/cjs/components/BlogHeader.js +2 -2
- package/dist/cjs/components/BlogHeader.js.map +1 -1
- package/dist/cjs/components/Callout.js +2 -2
- package/dist/cjs/components/Callout.js.map +1 -1
- package/dist/cjs/components/Table.js +2 -2
- package/dist/cjs/components/Table.js.map +1 -1
- package/dist/cjs/dynamicComponents/BlogDynamic.js +4 -13
- package/dist/cjs/dynamicComponents/BlogDynamic.js.map +1 -1
- package/dist/cjs/dynamicComponents/BlogSectionDynamic.js +1 -0
- package/dist/cjs/dynamicComponents/BlogSectionDynamic.js.map +1 -1
- package/dist/cjs/index.css +1 -1
- package/dist/cjs/index.css.map +1 -1
- package/dist/cjs/staticComponents/BlogHeaderStatic.js +13 -0
- package/dist/cjs/staticComponents/BlogHeaderStatic.js.map +1 -0
- package/dist/cjs/staticComponents/CalloutStatic.js +14 -0
- package/dist/cjs/staticComponents/CalloutStatic.js.map +1 -0
- package/dist/cjs/staticComponents/TableStatic.js +18 -0
- package/dist/cjs/staticComponents/TableStatic.js.map +1 -0
- package/dist/esm/components/BlogHeader.js +1 -1
- package/dist/esm/components/BlogHeader.js.map +1 -1
- package/dist/esm/components/Callout.js +1 -1
- package/dist/esm/components/Callout.js.map +1 -1
- package/dist/esm/components/Table.js +1 -1
- package/dist/esm/components/Table.js.map +1 -1
- package/dist/esm/dynamicComponents/BlogDynamic.js +4 -13
- package/dist/esm/dynamicComponents/BlogDynamic.js.map +1 -1
- package/dist/esm/dynamicComponents/BlogSectionDynamic.js +1 -0
- package/dist/esm/dynamicComponents/BlogSectionDynamic.js.map +1 -1
- package/dist/esm/index.css +1 -1
- package/dist/esm/index.css.map +1 -1
- package/dist/esm/staticComponents/BlogHeaderStatic.js +9 -0
- package/dist/esm/staticComponents/BlogHeaderStatic.js.map +1 -0
- package/dist/esm/staticComponents/CalloutStatic.js +10 -0
- package/dist/esm/staticComponents/CalloutStatic.js.map +1 -0
- package/dist/esm/staticComponents/TableStatic.js +14 -0
- package/dist/esm/staticComponents/TableStatic.js.map +1 -0
- package/dist/types/dynamicComponents/BlogDynamic.d.ts.map +1 -1
- package/dist/types/dynamicComponents/BlogSectionDynamic.d.ts.map +1 -1
- package/dist/types/staticComponents/BlogHeaderStatic.d.ts +8 -0
- package/dist/types/staticComponents/BlogHeaderStatic.d.ts.map +1 -0
- package/dist/types/staticComponents/CalloutStatic.d.ts +10 -0
- package/dist/types/staticComponents/CalloutStatic.d.ts.map +1 -0
- package/dist/types/staticComponents/TableStatic.d.ts +10 -0
- package/dist/types/staticComponents/TableStatic.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/components/BlogHeader.tsx +2 -2
- package/src/components/Callout.tsx +3 -3
- package/src/components/Table.tsx +2 -2
- package/src/dynamicComponents/BlogDynamic.tsx +3 -13
- package/src/dynamicComponents/BlogSectionDynamic.tsx +2 -0
- package/src/styles/Blog.module.scss +10 -8
- package/src/styles/CodeBlock.module.scss +21 -2
- /package/src/{dynamicComponents/BlogHeaderDynamic.tsx → staticComponents/BlogHeaderStatic.tsx} +0 -0
- /package/src/{dynamicComponents/CalloutDynamic.tsx → staticComponents/CalloutStatic.tsx} +0 -0
- /package/src/{dynamicComponents/TableDynamic.tsx → staticComponents/TableStatic.tsx} +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Fragment as Fragment$1 } from 'react';
|
|
3
|
+
import styles from '../styles/BlogHeader.module.scss.js';
|
|
4
|
+
|
|
5
|
+
const renderLineBreaks = (array) => array.map((element, index, array) => (jsxs(Fragment$1, { children: [element, index === array.length - 1 ? null : jsx("br", {})] }, element)));
|
|
6
|
+
const BlogHeader = ({ title, desc, isDescCite = true }) => (jsxs(Fragment, { children: [jsx("h1", { className: `${styles['blog-header']}`, children: renderLineBreaks(title) }), isDescCite ? (jsx("cite", { className: `${styles['blog-date']}`, children: renderLineBreaks(desc) })) : (jsx("p", { className: `${styles['blog-date']}`, children: renderLineBreaks(desc) }))] }));
|
|
7
|
+
|
|
8
|
+
export { BlogHeader as default };
|
|
9
|
+
//# sourceMappingURL=BlogHeaderStatic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlogHeaderStatic.js","sources":["../../../src/staticComponents/BlogHeaderStatic.tsx"],"sourcesContent":["import { Fragment } from 'react';\n\nimport styles from '../styles/BlogHeader.module.scss';\n\ninterface BlogProperties {\n\ttitle: string[];\n\tdesc: string[];\n\tisDescCite?: boolean;\n}\n\nconst renderLineBreaks = (array: string[]) =>\n\tarray.map((element, index, array) => (\n\t\t<Fragment key={element}>\n\t\t\t{element}\n\t\t\t{index === array.length - 1 ? null : <br />}\n\t\t</Fragment>\n\t));\n\nconst BlogHeader = ({ title, desc, isDescCite = true }: BlogProperties) => (\n\t\t<>\n\t\t\t<h1 className={`${styles['blog-header']}`}>{renderLineBreaks(title)}</h1>\n\t\t\t{isDescCite ? (\n\t\t\t\t<cite className={`${styles['blog-date']}`}>\n\t\t\t\t\t{renderLineBreaks(desc)}\n\t\t\t\t</cite>\n\t\t\t) : (\n\t\t\t\t<p className={`${styles['blog-date']}`}>{renderLineBreaks(desc)}</p>\n\t\t\t)}\n\t\t</>\n\t);\n\nexport default BlogHeader;\n"],"names":["_jsxs","Fragment","_jsx","_Fragment"],"mappings":";;;;AAUA,MAAM,gBAAgB,GAAG,CAAC,KAAe,KACxC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,MAC/BA,IAAA,CAACC,UAAQ,eACP,OAAO,EACP,KAAK,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC,GAAG,IAAI,GAAGC,GAAA,CAAA,IAAA,EAAA,EAAA,CAAM,KAF7B,OAAO,CAGX,CACX,CAAC;AAEH,MAAM,UAAU,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI,EAAkB,MACpEF,IAAA,CAAAG,QAAA,EAAA,EAAA,QAAA,EAAA,CACCD,GAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAE,GAAG,MAAM,CAAC,aAAa,CAAC,EAAE,EAAA,QAAA,EAAG,gBAAgB,CAAC,KAAK,CAAC,EAAA,CAAM,EACxE,UAAU,IACVA,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAE,CAAA,EAAG,MAAM,CAAC,WAAW,CAAC,CAAA,CAAE,EAAA,QAAA,EACvC,gBAAgB,CAAC,IAAI,CAAC,EAAA,CACjB,KAEPA,GAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAE,CAAA,EAAG,MAAM,CAAC,WAAW,CAAC,CAAA,CAAE,EAAA,QAAA,EAAG,gBAAgB,CAAC,IAAI,CAAC,EAAA,CAAK,CACpE,CAAA,EAAA,CACC;;;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import styles from '../styles/Callout.module.scss.js';
|
|
3
|
+
|
|
4
|
+
const Callout = ({ children, type = 'info', hasMarginUp = false, hasMarginDown = false }) => {
|
|
5
|
+
const className = `${styles.callout} ${styles[`callout--${type}`]} ${hasMarginUp ? styles['margin-top--1'] : ''} ${hasMarginDown ? styles['margin-bottom--2'] : ''}`;
|
|
6
|
+
return (jsxs("div", { className: className, children: [jsx("div", { className: styles.callout__icon }), jsx("div", { className: styles.callout__wrapper, children: children })] }));
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export { Callout as default };
|
|
10
|
+
//# sourceMappingURL=CalloutStatic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalloutStatic.js","sources":["../../../src/staticComponents/CalloutStatic.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport styles from '../styles/Callout.module.scss';\n\ninterface CalloutProperties {\n\tchildren?: ReactNode;\n\ttype: 'info' | 'warning' | 'error' | 'success';\n\thasMarginUp?: boolean;\n\thasMarginDown?: boolean;\n}\n\nconst Callout = ({ children, type = 'info',\n\thasMarginUp = false,\n\thasMarginDown = false\n}: CalloutProperties) => {\n\tconst className = `${styles.callout} ${styles[`callout--${type}`]} ${\n\t\thasMarginUp ? styles['margin-top--1'] : ''\n\t} ${hasMarginDown ? styles['margin-bottom--2'] : ''}`;\n\treturn (\n\t\t<div className={className}>\n\t\t\t<div className={styles.callout__icon}/>\n\t\t\t<div className={styles.callout__wrapper}>{children}</div>\n\t\t</div>\n\t);\n};\n\nexport default Callout;\n"],"names":["_jsxs","_jsx"],"mappings":";;;AAWA,MAAM,OAAO,GAAG,CAAC,EAAE,QAAQ,EAAE,IAAI,GAAG,MAAM,EACzC,WAAW,GAAG,KAAK,EACnB,aAAa,GAAG,KAAK,EACF,KAAI;AACvB,IAAA,MAAM,SAAS,GAAG,CAAA,EAAG,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,CAAA,SAAA,EAAY,IAAI,EAAE,CAAC,CAAA,CAAA,EAChE,WAAW,GAAG,MAAM,CAAC,eAAe,CAAC,GAAG,EACzC,CAAA,CAAA,EAAI,aAAa,GAAG,MAAM,CAAC,kBAAkB,CAAC,GAAG,EAAE,EAAE;IACrD,QACCA,IAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,SAAS,aACxBC,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,MAAM,CAAC,aAAa,GAAG,EACvCA,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,MAAM,CAAC,gBAAgB,EAAA,QAAA,EAAG,QAAQ,EAAA,CAAO,CAAA,EAAA,CACpD;AAER;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import styles from '../styles/Table.module.scss.js';
|
|
3
|
+
|
|
4
|
+
const Table = ({ rows = [], headers = [], hasMarginUp = false, hasMarginDown = false, }) => {
|
|
5
|
+
const columnCount = headers.length;
|
|
6
|
+
return (jsxs("div", { className: `${styles.table}
|
|
7
|
+
${hasMarginUp ? styles['margin-top--1'] : ''}
|
|
8
|
+
${hasMarginDown ? styles['margin-bottom--2'] : ''}`, style: {
|
|
9
|
+
gridTemplateColumns: `repeat(${columnCount}, 1fr)`,
|
|
10
|
+
}, children: [jsx("div", { className: `${styles['table__header']}`, children: headers.map((header, index) => (jsx("div", { className: `${styles['table__header__cell']}`, children: header }, typeof header === 'string' ? header : index))) }), rows.map((row, index) => (jsx("div", { className: `${styles['table__row']}`, children: row.map((cell, cellIndex) => (jsx("div", { className: `${styles['table__row__cell']}`, children: cell }, typeof cell === 'string' ? cell : cellIndex))) }, index)))] }));
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { Table as default };
|
|
14
|
+
//# sourceMappingURL=TableStatic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableStatic.js","sources":["../../../src/staticComponents/TableStatic.tsx"],"sourcesContent":["import { ReactNode } from 'react';\nimport styles from '../styles/Table.module.scss';\n\ninterface TableProperties {\n\trows?: ReactNode[][];\n\theaders?: ReactNode[];\n\thasMarginUp?: boolean;\n\thasMarginDown?: boolean;\n}\n\nconst Table = ({\n\trows = [],\n\theaders = [],\n\thasMarginUp = false,\n\thasMarginDown = false,\n}: TableProperties) => {\n\tconst columnCount = headers.length;\n\n\treturn (\n\t\t<div\n\t\t\tclassName={`${styles.table}\n\t\t\t\t${hasMarginUp ? styles['margin-top--1'] : ''}\n\t\t\t\t${hasMarginDown ? styles['margin-bottom--2'] : ''}`}\n\t\t\tstyle={{\n\t\t\t\tgridTemplateColumns: `repeat(${columnCount}, 1fr)`,\n\t\t\t}}\n\t\t>\n\t\t\t<div className={`${styles['table__header']}`}>\n\t\t\t\t{headers.map((header, index) => (\n\t\t\t\t\t<div\n\t\t\t\t\t\tkey={typeof header === 'string' ? header : index}\n\t\t\t\t\t\tclassName={`${styles['table__header__cell']}`}\n\t\t\t\t\t>\n\t\t\t\t\t\t{header}\n\t\t\t\t\t</div>\n\t\t\t\t))}\n\t\t\t</div>\n\t\t\t{rows.map((row, index) => (\n\t\t\t\t<div key={index} className={`${styles['table__row']}`}>\n\t\t\t\t\t{row.map((cell, cellIndex) => (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tkey={typeof cell === 'string' ? cell : cellIndex}\n\t\t\t\t\t\t\tclassName={`${styles['table__row__cell']}`}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{cell}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t))}\n\t\t\t\t</div>\n\t\t\t))}\n\t\t</div>\n\t);\n};\n\nexport default Table;\n"],"names":["_jsxs","_jsx"],"mappings":";;;AAUA,MAAM,KAAK,GAAG,CAAC,EACd,IAAI,GAAG,EAAE,EACT,OAAO,GAAG,EAAE,EACZ,WAAW,GAAG,KAAK,EACnB,aAAa,GAAG,KAAK,GACJ,KAAI;AACrB,IAAA,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM;AAElC,IAAA,QACCA,IAAA,CAAA,KAAA,EAAA,EACC,SAAS,EAAE,CAAA,EAAG,MAAM,CAAC,KAAK;MACvB,WAAW,GAAG,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE;AAC1C,IAAA,EAAA,aAAa,GAAG,MAAM,CAAC,kBAAkB,CAAC,GAAG,EAAE,CAAA,CAAE,EACpD,KAAK,EAAE;YACN,mBAAmB,EAAE,CAAA,OAAA,EAAU,WAAW,CAAA,MAAA,CAAQ;SAClD,EAAA,QAAA,EAAA,CAEDC,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,CAAA,EAAG,MAAM,CAAC,eAAe,CAAC,CAAA,CAAE,EAAA,QAAA,EAC1C,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,MAC1BA,GAAA,CAAA,KAAA,EAAA,EAEC,SAAS,EAAE,CAAA,EAAG,MAAM,CAAC,qBAAqB,CAAC,CAAA,CAAE,EAAA,QAAA,EAE5C,MAAM,EAAA,EAHF,OAAO,MAAM,KAAK,QAAQ,GAAG,MAAM,GAAG,KAAK,CAI3C,CACN,CAAC,EAAA,CACG,EACL,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,MACpBA,GAAA,CAAA,KAAA,EAAA,EAAiB,SAAS,EAAE,CAAA,EAAG,MAAM,CAAC,YAAY,CAAC,CAAA,CAAE,EAAA,QAAA,EACnD,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,SAAS,MACxBA,GAAA,CAAA,KAAA,EAAA,EAEC,SAAS,EAAE,CAAA,EAAG,MAAM,CAAC,kBAAkB,CAAC,CAAA,CAAE,EAAA,QAAA,EAEzC,IAAI,EAAA,EAHA,OAAO,IAAI,KAAK,QAAQ,GAAG,IAAI,GAAG,SAAS,CAI3C,CACN,CAAC,EAAA,EARO,KAAK,CAST,CACN,CAAC,CAAA,EAAA,CACG;AAER;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlogDynamic.d.ts","sourceRoot":"","sources":["../../../src/dynamicComponents/BlogDynamic.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAc,SAAS,EAAiB,MAAM,OAAO,CAAC;AAIlE,UAAU,cAAc;IACvB,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,kBAAkB;IAClC,SAAS,EAAE,cAAc,CAAC;IAC1B,SAAS,EAAE,cAAc,EAAE,CAAC;CAC5B;AAgBD,QAAA,MAAM,IAAI,GAAI,qBAAyC,cAAc,
|
|
1
|
+
{"version":3,"file":"BlogDynamic.d.ts","sourceRoot":"","sources":["../../../src/dynamicComponents/BlogDynamic.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAc,SAAS,EAAiB,MAAM,OAAO,CAAC;AAIlE,UAAU,cAAc;IACvB,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,kBAAkB;IAClC,SAAS,EAAE,cAAc,CAAC;IAC1B,SAAS,EAAE,cAAc,EAAE,CAAC;CAC5B;AAgBD,QAAA,MAAM,IAAI,GAAI,qBAAyC,cAAc,4CAkNpE,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlogSectionDynamic.d.ts","sourceRoot":"","sources":["../../../src/dynamicComponents/BlogSectionDynamic.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BlogSectionDynamic.d.ts","sourceRoot":"","sources":["../../../src/dynamicComponents/BlogSectionDynamic.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAItD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAGxD,UAAU,cAAc;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,QAAA,MAAM,WAAW,+FA8DhB,CAAC;AAIF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface BlogProperties {
|
|
2
|
+
title: string[];
|
|
3
|
+
desc: string[];
|
|
4
|
+
isDescCite?: boolean;
|
|
5
|
+
}
|
|
6
|
+
declare const BlogHeader: ({ title, desc, isDescCite }: BlogProperties) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default BlogHeader;
|
|
8
|
+
//# sourceMappingURL=BlogHeaderStatic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlogHeaderStatic.d.ts","sourceRoot":"","sources":["../../../src/staticComponents/BlogHeaderStatic.tsx"],"names":[],"mappings":"AAIA,UAAU,cAAc;IACvB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;CACrB;AAUD,QAAA,MAAM,UAAU,GAAI,6BAAoC,cAAc,4CAWpE,CAAC;AAEH,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
interface CalloutProperties {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
type: 'info' | 'warning' | 'error' | 'success';
|
|
5
|
+
hasMarginUp?: boolean;
|
|
6
|
+
hasMarginDown?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const Callout: ({ children, type, hasMarginUp, hasMarginDown }: CalloutProperties) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default Callout;
|
|
10
|
+
//# sourceMappingURL=CalloutStatic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalloutStatic.d.ts","sourceRoot":"","sources":["../../../src/staticComponents/CalloutStatic.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,UAAU,iBAAiB;IAC1B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;IAC/C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,QAAA,MAAM,OAAO,GAAI,gDAGd,iBAAiB,4CAUnB,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface TableProperties {
|
|
3
|
+
rows?: ReactNode[][];
|
|
4
|
+
headers?: ReactNode[];
|
|
5
|
+
hasMarginUp?: boolean;
|
|
6
|
+
hasMarginDown?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const Table: ({ rows, headers, hasMarginUp, hasMarginDown, }: TableProperties) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default Table;
|
|
10
|
+
//# sourceMappingURL=TableStatic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableStatic.d.ts","sourceRoot":"","sources":["../../../src/staticComponents/TableStatic.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGlC,UAAU,eAAe;IACxB,IAAI,CAAC,EAAE,SAAS,EAAE,EAAE,CAAC;IACrB,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,QAAA,MAAM,KAAK,GAAI,gDAKZ,eAAe,4CAoCjB,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@san-siva/blogkit",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "A reusable blog component library for React/Next.js applications with code highlighting, diagrams, and rich content features",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import BlogHeaderStatic from '../staticComponents/BlogHeaderStatic';
|
|
2
2
|
|
|
3
3
|
interface BlogHeaderProperties {
|
|
4
4
|
title: string[];
|
|
@@ -12,7 +12,7 @@ const BlogHeader = ({
|
|
|
12
12
|
isDescCite = true,
|
|
13
13
|
}: BlogHeaderProperties) => {
|
|
14
14
|
return (
|
|
15
|
-
<
|
|
15
|
+
<BlogHeaderStatic title={title} desc={desc} isDescCite={isDescCite} />
|
|
16
16
|
);
|
|
17
17
|
};
|
|
18
18
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import
|
|
2
|
+
import CalloutStatic from '../staticComponents/CalloutStatic';
|
|
3
3
|
|
|
4
4
|
interface CalloutProperties {
|
|
5
5
|
children?: ReactNode;
|
|
@@ -15,13 +15,13 @@ const Callout = ({
|
|
|
15
15
|
hasMarginDown = false,
|
|
16
16
|
}: CalloutProperties) => {
|
|
17
17
|
return (
|
|
18
|
-
<
|
|
18
|
+
<CalloutStatic
|
|
19
19
|
type={type}
|
|
20
20
|
hasMarginUp={hasMarginUp}
|
|
21
21
|
hasMarginDown={hasMarginDown}
|
|
22
22
|
>
|
|
23
23
|
{children}
|
|
24
|
-
</
|
|
24
|
+
</CalloutStatic>
|
|
25
25
|
);
|
|
26
26
|
};
|
|
27
27
|
|
package/src/components/Table.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import
|
|
2
|
+
import TableStatic from '../staticComponents/TableStatic';
|
|
3
3
|
|
|
4
4
|
interface TableProperties {
|
|
5
5
|
rows?: ReactNode[][];
|
|
@@ -15,7 +15,7 @@ const Table = ({
|
|
|
15
15
|
hasMarginDown = false,
|
|
16
16
|
}: TableProperties) => {
|
|
17
17
|
return (
|
|
18
|
-
<
|
|
18
|
+
<TableStatic
|
|
19
19
|
rows={rows}
|
|
20
20
|
headers={headers}
|
|
21
21
|
hasMarginUp={hasMarginUp}
|
|
@@ -66,16 +66,6 @@ const Blog = ({ children, title = 'In this article' }: BlogProperties) => {
|
|
|
66
66
|
[]
|
|
67
67
|
);
|
|
68
68
|
|
|
69
|
-
const debounceShowTOC = useCallback(() => {
|
|
70
|
-
if (showTOC) return;
|
|
71
|
-
if (showTOCTimerRef.current) {
|
|
72
|
-
clearTimeout(showTOCTimerRef.current);
|
|
73
|
-
}
|
|
74
|
-
showTOCTimerRef.current = setTimeout(() => {
|
|
75
|
-
setShowTOC(true);
|
|
76
|
-
}, 200);
|
|
77
|
-
}, [showTOC]);
|
|
78
|
-
|
|
79
69
|
const updateCategoryTitles = useCallback(() => {
|
|
80
70
|
const now = Date.now();
|
|
81
71
|
const newCategoryTitles = new Map<string, CategoryTitleValue>();
|
|
@@ -100,11 +90,11 @@ const Blog = ({ children, title = 'In this article' }: BlogProperties) => {
|
|
|
100
90
|
if (newCategoryTitles.size === 0) return;
|
|
101
91
|
|
|
102
92
|
setCategoryTitles(newCategoryTitles);
|
|
103
|
-
|
|
93
|
+
if (!showTOC) setShowTOC(true);
|
|
104
94
|
|
|
105
95
|
if (visibleTitle) return;
|
|
106
96
|
setVisibleTitle(firstSectionId);
|
|
107
|
-
}, [visibleTitle, sortByDomPosition]);
|
|
97
|
+
}, [visibleTitle, sortByDomPosition, showTOC, setShowTOC]);
|
|
108
98
|
|
|
109
99
|
const debounceUpdateCategoryTitles = useCallback(() => {
|
|
110
100
|
// Clear existing timer and set a new one to batch updates
|
|
@@ -113,7 +103,7 @@ const Blog = ({ children, title = 'In this article' }: BlogProperties) => {
|
|
|
113
103
|
}
|
|
114
104
|
updateTimerRef.current = setTimeout(() => {
|
|
115
105
|
updateCategoryTitles();
|
|
116
|
-
},
|
|
106
|
+
}, 200);
|
|
117
107
|
}, [updateCategoryTitles]);
|
|
118
108
|
|
|
119
109
|
useEffect(() => {
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
@use '@san-siva/stylekit/index.module.scss' as styles;
|
|
2
2
|
|
|
3
3
|
.blog {
|
|
4
|
-
display: flex;
|
|
5
|
-
flex-direction: row;
|
|
6
|
-
align-items: flex-start;
|
|
7
|
-
justify-content: flex-start;
|
|
8
|
-
max-width: unset;
|
|
9
4
|
width: 100%;
|
|
5
|
+
display: grid;
|
|
6
|
+
grid-template-columns: max-content #{styles.rem(320)};
|
|
7
|
+
grid-gap: styles.space(8);
|
|
10
8
|
|
|
11
9
|
> * {
|
|
12
10
|
max-width: unset;
|
|
@@ -18,6 +16,7 @@
|
|
|
18
16
|
|
|
19
17
|
&__sidebar {
|
|
20
18
|
position: sticky;
|
|
19
|
+
height: fit-content;
|
|
21
20
|
top: calc(var(--topbar-height) + #{styles.space(6)});
|
|
22
21
|
padding: styles.space(6);
|
|
23
22
|
min-width: calc(
|
|
@@ -29,8 +28,6 @@
|
|
|
29
28
|
0 0 0 1px styles.$color--border,
|
|
30
29
|
0 styles.space(1) styles.space(2) 0 styles.$color--border;
|
|
31
30
|
|
|
32
|
-
margin-left: styles.space(9);
|
|
33
|
-
|
|
34
31
|
> .category__title {
|
|
35
32
|
display: block;
|
|
36
33
|
margin-bottom: styles.space(1);
|
|
@@ -63,7 +60,12 @@
|
|
|
63
60
|
}
|
|
64
61
|
}
|
|
65
62
|
|
|
66
|
-
|
|
63
|
+
$breakpoint: calc(
|
|
64
|
+
#{styles.rem(120)} + #{styles.rem(780)} + #{styles.space(8)} +
|
|
65
|
+
#{styles.rem(320)} + #{styles.rem(120)}
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
@media (max-width: $breakpoint) {
|
|
67
69
|
.blog {
|
|
68
70
|
display: block;
|
|
69
71
|
&__sidebar {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
@use '@san-siva/stylekit/index.module.scss' as stylekit;
|
|
2
2
|
|
|
3
|
+
$code-block-background-color: #282a36;
|
|
4
|
+
|
|
3
5
|
.code-block {
|
|
4
6
|
code {
|
|
5
7
|
font-size: unset;
|
|
@@ -8,7 +10,7 @@
|
|
|
8
10
|
padding: unset;
|
|
9
11
|
}
|
|
10
12
|
|
|
11
|
-
background-color:
|
|
13
|
+
background-color: $code-block-background-color !important;
|
|
12
14
|
filter: stylekit.$color--shadow-dark;
|
|
13
15
|
border-radius: stylekit.$border-radius;
|
|
14
16
|
|
|
@@ -26,6 +28,23 @@
|
|
|
26
28
|
|
|
27
29
|
overflow-x: auto;
|
|
28
30
|
|
|
31
|
+
// Custom scrollbar styling
|
|
32
|
+
scrollbar-width: thin;
|
|
33
|
+
scrollbar-color: stylekit.$color--grey-dark $code-block-background-color;
|
|
34
|
+
|
|
35
|
+
&::-webkit-scrollbar {
|
|
36
|
+
height: 8px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&::-webkit-scrollbar-track {
|
|
40
|
+
background: $code-block-background-color;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&::-webkit-scrollbar-thumb {
|
|
44
|
+
background-color: stylekit.$color--grey-dark;
|
|
45
|
+
border-radius: 4px;
|
|
46
|
+
}
|
|
47
|
+
|
|
29
48
|
padding-top: 0px;
|
|
30
49
|
padding-right: stylekit.rem(18);
|
|
31
50
|
padding-bottom: stylekit.rem(18);
|
|
@@ -101,5 +120,5 @@
|
|
|
101
120
|
.code-block--static code {
|
|
102
121
|
color: stylekit.$color--base !important;
|
|
103
122
|
font-family: stylekit.$font-family--code !important;
|
|
104
|
-
font-size: stylekit.$font-size--small !important;
|
|
123
|
+
font-size: stylekit.$font-size--p-small !important;
|
|
105
124
|
}
|
/package/src/{dynamicComponents/BlogHeaderDynamic.tsx → staticComponents/BlogHeaderStatic.tsx}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|