react-ink-scripter 0.0.11 → 0.0.12
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/index.js +6 -6
- package/dist/esm/InkScripter.d.ts +3 -4
- package/dist/esm/index.js +4 -4
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -71,13 +71,13 @@ var Container = function Container(_ref) {
|
|
|
71
71
|
children: content.map(function (item, idx) {
|
|
72
72
|
switch (item.type) {
|
|
73
73
|
case "pair":
|
|
74
|
-
return jsxRuntime.jsx(Pair, _extends({
|
|
75
|
-
className: "inks-grid-item"
|
|
76
|
-
}
|
|
74
|
+
return jsxRuntime.jsx(Pair, _extends({}, item, {
|
|
75
|
+
className: clsx("inks-grid-item", item.className)
|
|
76
|
+
}), idx);
|
|
77
77
|
case "text":
|
|
78
|
-
return jsxRuntime.jsx(Text, _extends({
|
|
79
|
-
className: "inks-grid-item"
|
|
80
|
-
}
|
|
78
|
+
return jsxRuntime.jsx(Text, _extends({}, item, {
|
|
79
|
+
className: clsx("inks-grid-item", item.className)
|
|
80
|
+
}), idx);
|
|
81
81
|
}
|
|
82
82
|
})
|
|
83
83
|
});
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ClassValue } from "clsx";
|
|
3
2
|
export type ContentTextItem = {
|
|
4
3
|
id?: string;
|
|
4
|
+
className?: string;
|
|
5
5
|
type: "text";
|
|
6
6
|
value: string;
|
|
7
7
|
span?: number;
|
|
8
8
|
};
|
|
9
9
|
export type ContentPairItem = {
|
|
10
10
|
id?: string;
|
|
11
|
+
className?: string;
|
|
11
12
|
type: "pair";
|
|
12
13
|
label: string;
|
|
13
14
|
value: string;
|
|
@@ -20,6 +21,7 @@ export type ContentGridItem = {
|
|
|
20
21
|
};
|
|
21
22
|
export type ContentTableCellItem = {
|
|
22
23
|
id?: string;
|
|
24
|
+
className?: string;
|
|
23
25
|
header?: boolean;
|
|
24
26
|
rowSpan?: number;
|
|
25
27
|
colSpan?: number;
|
|
@@ -38,8 +40,5 @@ export type ReactInkScripterProps = {
|
|
|
38
40
|
value?: ContentType;
|
|
39
41
|
className?: string;
|
|
40
42
|
};
|
|
41
|
-
export type TypeWithClassName<T> = T & {
|
|
42
|
-
className?: ClassValue;
|
|
43
|
-
};
|
|
44
43
|
export declare const InkScripter: (props: ReactInkScripterProps) => JSX.Element;
|
|
45
44
|
export default InkScripter;
|
package/dist/esm/index.js
CHANGED
|
@@ -46,9 +46,9 @@ const Container = ({ id, content = [], className, }) => {
|
|
|
46
46
|
return (jsx("div", { id: id, className: clsx("inks-grid", className), children: content.map((item, idx) => {
|
|
47
47
|
switch (item.type) {
|
|
48
48
|
case "pair":
|
|
49
|
-
return jsx(Pair, { className: "inks-grid-item",
|
|
49
|
+
return (jsx(Pair, { ...item, className: clsx("inks-grid-item", item.className) }, idx));
|
|
50
50
|
case "text":
|
|
51
|
-
return jsx(Text, { className: "inks-grid-item",
|
|
51
|
+
return (jsx(Text, { ...item, className: clsx("inks-grid-item", item.className) }, idx));
|
|
52
52
|
}
|
|
53
53
|
}) }));
|
|
54
54
|
};
|
|
@@ -99,10 +99,10 @@ const Table = (props) => {
|
|
|
99
99
|
}
|
|
100
100
|
return (jsxs("table", { id: id, className: "inks-table", children: [jsx(TableHead, { rows: head }), jsx(TableBody, { rows: body }), jsx(TableFoot, { rows: foot })] }));
|
|
101
101
|
};
|
|
102
|
-
const Text = ({ id, value, span, className
|
|
102
|
+
const Text = ({ id, value, span, className }) => {
|
|
103
103
|
return (jsx("div", { id: id, className: clsx("inks-text", span && "inks-grid", span && `inks-span-${span}`, className), children: value }));
|
|
104
104
|
};
|
|
105
|
-
const Pair = ({ id, value, label, span, className
|
|
105
|
+
const Pair = ({ id, value, label, span, className }) => {
|
|
106
106
|
return (jsxs("div", { id: id, className: clsx("inks-pair", span && "inks-grid", span && `inks-span-${span}`, className), children: [jsxs("label", { className: "inks-pair-label", children: [label, ":"] }), jsx("div", { className: "inks-pair-value", children: value })] }));
|
|
107
107
|
};
|
|
108
108
|
const InkScripter = (props) => {
|