@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.
@@ -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 imageClassNames = () => {
28
- if (size === "full")
29
- return "w-full h-full object-cover";
30
- return "absolute bottom-0 right-0 w-full xs:w-auto max-w-120 z-0 max-h-44 object-contain";
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
- } })), path ? (_jsx("img", { src: path, alt: "trump-image", loading: "lazy", className: imageClassNames() })) : null] }));
36
+ } })), image && (_jsx("img", { src: image.path, alt: "trump-image", loading: "lazy", className: cn(imageBox) }))] }));
38
37
  }
@@ -1,4 +1,4 @@
1
- import { Button, DataField, DataSet, Disabled, ImageSize, OnClick, Size, State, Titles } from "./Property";
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edu-tosel/design",
3
- "version": "1.0.58",
3
+ "version": "1.0.60",
4
4
  "description": "UI components for International TOSEL Committee",
5
5
  "keywords": [
6
6
  "jsx",
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  export function LineBreaks({ texts, className, }) {
3
- return (_jsx("div", { className: className, children: typeof texts === "string"
4
- ? texts
5
- : texts?.map((text, index) => (_jsx("div", { className: "leading-tight", children: text }, index))) }));
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.58
1
+ 1.0.60