@san-siva/blogkit 1.1.9 → 1.1.10
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 +32 -9
- package/dist/cjs/components/Table.js +2 -2
- package/dist/cjs/components/Table.js.map +1 -1
- package/dist/cjs/index.css +1 -1
- package/dist/cjs/index.css.map +1 -1
- package/dist/cjs/staticComponents/TableStatic.js +3 -3
- package/dist/cjs/staticComponents/TableStatic.js.map +1 -1
- package/dist/esm/components/Table.js +2 -2
- package/dist/esm/components/Table.js.map +1 -1
- package/dist/esm/index.css +1 -1
- package/dist/esm/index.css.map +1 -1
- package/dist/esm/staticComponents/TableStatic.js +3 -3
- package/dist/esm/staticComponents/TableStatic.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Table.tsx +3 -0
- package/src/staticComponents/TableStatic.tsx +5 -1
- package/src/styles/Table.module.scss +5 -4
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import styles from '../styles/Table.module.scss.js';
|
|
3
3
|
|
|
4
|
-
const Table = ({ rows = [], headers = [], hasMarginUp = false, hasMarginDown = false, }) => {
|
|
4
|
+
const Table = ({ rows = [], headers = [], hasMarginUp = false, hasMarginDown = false, fontSize, }) => {
|
|
5
5
|
const columnCount = headers.length;
|
|
6
6
|
return (jsxs("div", { className: `${styles.table}
|
|
7
7
|
${hasMarginUp ? styles['margin-top--1'] : ''}
|
|
8
8
|
${hasMarginDown ? styles['margin-bottom--2'] : ''}`, style: {
|
|
9
|
-
gridTemplateColumns: `repeat(${columnCount},
|
|
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)))] }));
|
|
9
|
+
gridTemplateColumns: `repeat(${columnCount}, auto)`,
|
|
10
|
+
}, children: [jsx("div", { className: `${styles['table__header']}`, children: headers.map((header, index) => (jsx("div", { className: `${styles['table__header__cell']}`, style: fontSize ? { fontSize } : undefined, 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']}`, style: fontSize ? { fontSize } : undefined, children: cell }, typeof cell === 'string' ? cell : cellIndex))) }, index)))] }));
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
export { Table as default };
|
|
@@ -1 +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},
|
|
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\tfontSize?: string;\n}\n\nconst Table = ({\n\trows = [],\n\theaders = [],\n\thasMarginUp = false,\n\thasMarginDown = false,\n\tfontSize,\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}, auto)`,\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\tstyle={fontSize ? { fontSize } : undefined}\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\tstyle={fontSize ? { fontSize } : undefined}\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":";;;AAWA,MAAM,KAAK,GAAG,CAAC,EACd,IAAI,GAAG,EAAE,EACT,OAAO,GAAG,EAAE,EACZ,WAAW,GAAG,KAAK,EACnB,aAAa,GAAG,KAAK,EACrB,QAAQ,GACS,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,WA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
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@san-siva/blogkit",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.10",
|
|
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",
|
package/src/components/Table.tsx
CHANGED
|
@@ -6,6 +6,7 @@ interface TableProperties {
|
|
|
6
6
|
headers?: ReactNode[];
|
|
7
7
|
hasMarginUp?: boolean;
|
|
8
8
|
hasMarginDown?: boolean;
|
|
9
|
+
fontSize?: string;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
const Table = ({
|
|
@@ -13,6 +14,7 @@ const Table = ({
|
|
|
13
14
|
headers = [],
|
|
14
15
|
hasMarginUp = false,
|
|
15
16
|
hasMarginDown = false,
|
|
17
|
+
fontSize,
|
|
16
18
|
}: TableProperties) => {
|
|
17
19
|
return (
|
|
18
20
|
<TableStatic
|
|
@@ -20,6 +22,7 @@ const Table = ({
|
|
|
20
22
|
headers={headers}
|
|
21
23
|
hasMarginUp={hasMarginUp}
|
|
22
24
|
hasMarginDown={hasMarginDown}
|
|
25
|
+
fontSize={fontSize}
|
|
23
26
|
/>
|
|
24
27
|
);
|
|
25
28
|
};
|
|
@@ -6,6 +6,7 @@ interface TableProperties {
|
|
|
6
6
|
headers?: ReactNode[];
|
|
7
7
|
hasMarginUp?: boolean;
|
|
8
8
|
hasMarginDown?: boolean;
|
|
9
|
+
fontSize?: string;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
const Table = ({
|
|
@@ -13,6 +14,7 @@ const Table = ({
|
|
|
13
14
|
headers = [],
|
|
14
15
|
hasMarginUp = false,
|
|
15
16
|
hasMarginDown = false,
|
|
17
|
+
fontSize,
|
|
16
18
|
}: TableProperties) => {
|
|
17
19
|
const columnCount = headers.length;
|
|
18
20
|
|
|
@@ -22,7 +24,7 @@ const Table = ({
|
|
|
22
24
|
${hasMarginUp ? styles['margin-top--1'] : ''}
|
|
23
25
|
${hasMarginDown ? styles['margin-bottom--2'] : ''}`}
|
|
24
26
|
style={{
|
|
25
|
-
gridTemplateColumns: `repeat(${columnCount},
|
|
27
|
+
gridTemplateColumns: `repeat(${columnCount}, auto)`,
|
|
26
28
|
}}
|
|
27
29
|
>
|
|
28
30
|
<div className={`${styles['table__header']}`}>
|
|
@@ -30,6 +32,7 @@ const Table = ({
|
|
|
30
32
|
<div
|
|
31
33
|
key={typeof header === 'string' ? header : index}
|
|
32
34
|
className={`${styles['table__header__cell']}`}
|
|
35
|
+
style={fontSize ? { fontSize } : undefined}
|
|
33
36
|
>
|
|
34
37
|
{header}
|
|
35
38
|
</div>
|
|
@@ -41,6 +44,7 @@ const Table = ({
|
|
|
41
44
|
<div
|
|
42
45
|
key={typeof cell === 'string' ? cell : cellIndex}
|
|
43
46
|
className={`${styles['table__row__cell']}`}
|
|
47
|
+
style={fontSize ? { fontSize } : undefined}
|
|
44
48
|
>
|
|
45
49
|
{cell}
|
|
46
50
|
</div>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
@mixin cell-base {
|
|
4
4
|
padding: styles.rem(12) styles.rem(16);
|
|
5
|
-
font-size: styles.$font-size--small;
|
|
5
|
+
font-size: styles.$font-size--p-small;
|
|
6
6
|
font-family: styles.$font-family--code;
|
|
7
7
|
word-wrap: break-word;
|
|
8
8
|
overflow-wrap: break-word;
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
.table {
|
|
16
|
-
width:
|
|
16
|
+
width: max-content;
|
|
17
|
+
margin-right: auto;
|
|
17
18
|
overflow: hidden;
|
|
18
19
|
overflow-x: auto;
|
|
19
20
|
display: grid;
|
|
@@ -32,7 +33,7 @@
|
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
&__cell * {
|
|
35
|
-
font-size:
|
|
36
|
+
font-size: inherit;
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
39
|
|
|
@@ -45,7 +46,7 @@
|
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
&__cell * {
|
|
48
|
-
font-size:
|
|
49
|
+
font-size: inherit;
|
|
49
50
|
}
|
|
50
51
|
}
|
|
51
52
|
}
|