@edu-tosel/design 1.0.58 → 1.0.60
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/card/design/NavCard.design.js +5 -6
- package/interface/Card.d.ts +7 -5
- package/package.json +1 -1
- package/text/LineBreaks.js +4 -3
- package/version.txt +1 -1
|
@@ -6,7 +6,6 @@ import Card from "./Card.design";
|
|
|
6
6
|
export default function NavCardDesign({ titles, options }) {
|
|
7
7
|
const { title, subtitle, color, titleColor, subtitleColor } = titles;
|
|
8
8
|
const { width, image, buttonInLay } = options ?? {};
|
|
9
|
-
const { path, size } = image ?? { size: "sub" };
|
|
10
9
|
const flag = !buttonInLay && width === "xl";
|
|
11
10
|
const textBox = {
|
|
12
11
|
container: {
|
|
@@ -24,15 +23,15 @@ export default function NavCardDesign({ titles, options }) {
|
|
|
24
23
|
styles: (!color && subtitleColor) ?? "text-gray-dim",
|
|
25
24
|
},
|
|
26
25
|
};
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
const imageBox = {
|
|
27
|
+
default: "absolute",
|
|
28
|
+
positions: image?.position ?? "bottom-0 right-0",
|
|
29
|
+
sizes: image?.size,
|
|
31
30
|
};
|
|
32
31
|
return (_jsxs(Card, { options: options, children: [_jsxs("div", { className: cn(textBox.container), children: [_jsx("div", { className: cn(textBox.title), children: title }), _jsx(LineBreaks, { className: cn(textBox.subtitle), texts: subtitle ?? "" })] }), buttonInLay && (_jsx(Label.Button, { title: buttonInLay.title, onClick: buttonInLay.onClick, options: {
|
|
33
32
|
disabled: buttonInLay.disabled,
|
|
34
33
|
className: "absolute bottom-7.5 left-7.5",
|
|
35
34
|
background: buttonInLay?.background,
|
|
36
35
|
text: buttonInLay?.text,
|
|
37
|
-
} })),
|
|
36
|
+
} })), image && (_jsx("img", { src: image.path, alt: "trump-image", loading: "lazy", className: cn(imageBox) }))] }));
|
|
38
37
|
}
|
package/interface/Card.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Button, DataField, DataSet, Disabled,
|
|
1
|
+
import { Button, DataField, DataSet, Disabled, OnClick, Size, State, Titles } from "./Property";
|
|
2
2
|
import { Flexify } from "./UtilityType";
|
|
3
3
|
interface CardOptions {
|
|
4
4
|
className?: string;
|
|
@@ -52,14 +52,16 @@ export interface ButtonInLay {
|
|
|
52
52
|
background?: string;
|
|
53
53
|
text?: string;
|
|
54
54
|
}
|
|
55
|
+
interface NavCardImage {
|
|
56
|
+
path: string;
|
|
57
|
+
size?: string;
|
|
58
|
+
position?: string;
|
|
59
|
+
}
|
|
55
60
|
export interface NavCardProps extends Omit<CardProps, "children"> {
|
|
56
61
|
titles: Titles;
|
|
57
62
|
options?: CardOptions & {
|
|
58
63
|
buttonInLay?: ButtonInLay;
|
|
59
|
-
image?:
|
|
60
|
-
path: string;
|
|
61
|
-
size?: ImageSize;
|
|
62
|
-
};
|
|
64
|
+
image?: NavCardImage;
|
|
63
65
|
};
|
|
64
66
|
}
|
|
65
67
|
export interface NavCardBannerProps extends NavCardProps {
|
package/package.json
CHANGED
package/text/LineBreaks.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
export function LineBreaks({ texts, className, }) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
const strings = typeof texts === "string"
|
|
4
|
+
? texts.split("\n")
|
|
5
|
+
: texts?.map((text) => text.split("\n")).flat();
|
|
6
|
+
return (_jsx("div", { className: className, children: strings?.map((text, index) => (_jsx("div", { className: "leading-tight", children: text.length > 0 ? text : "\u00a0" }, index))) }));
|
|
6
7
|
}
|
package/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0.
|
|
1
|
+
1.0.60
|