@edu-tosel/design 1.0.95 → 1.0.96

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.
@@ -0,0 +1,7 @@
1
+ import { ReactNode } from "react";
2
+ import { LabelWidget } from "../../interface";
3
+ export interface SubmitCardProps {
4
+ children?: ReactNode;
5
+ button?: LabelWidget;
6
+ }
7
+ export default function SubmitCardDesign({ children, button, }: SubmitCardProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import CardDesign from "./Card.design";
3
+ import { Label } from "../../widget";
4
+ export default function SubmitCardDesign({ children, button, }) {
5
+ return (_jsxs(CardDesign, { option: {
6
+ width: "lg",
7
+ height: "lg",
8
+ className: "p-5",
9
+ }, children: [children, button && (_jsx(Label.Button, { ...button, option: {
10
+ className: "absolute bottom-5 right-5",
11
+ } }))] }));
12
+ }
package/card/index.d.ts CHANGED
@@ -7,3 +7,4 @@ export { default as NavCard } from "./template/NavCard";
7
7
  export { default as ProgressCard } from "./template/ProgressCard";
8
8
  export { default as RollCard } from "./template/RollCard";
9
9
  export { default as TableCard } from "./template/TableCard";
10
+ export { default as SubmitCard } from "./template/SubmitCard";
package/card/index.js CHANGED
@@ -7,3 +7,4 @@ export { default as NavCard } from "./template/NavCard";
7
7
  export { default as ProgressCard } from "./template/ProgressCard";
8
8
  export { default as RollCard } from "./template/RollCard";
9
9
  export { default as TableCard } from "./template/TableCard";
10
+ export { default as SubmitCard } from "./template/SubmitCard";
@@ -1,2 +1,2 @@
1
1
  import { ProgressCardProps } from "../../../interface";
2
- export default function ProgressCardSmall({ titles, displays, checks, nowFocus, theme, }: ProgressCardProps): import("react/jsx-runtime").JSX.Element;
2
+ export default function ProgressCardSmall({ titles, displays, checks, nowFocus, theme, option, }: ProgressCardProps): import("react/jsx-runtime").JSX.Element;
@@ -10,7 +10,8 @@ const text = {
10
10
  green: "text-green-dark",
11
11
  blue: "text-blue-navy",
12
12
  };
13
- export default function ProgressCardSmall({ titles, displays, checks, nowFocus, theme = "green", }) {
13
+ export default function ProgressCardSmall({ titles, displays, checks, nowFocus, theme = "green", option, }) {
14
+ const { size = "md" } = option ?? {};
14
15
  const progressBox = {
15
16
  positions: "absolute top-2.5 left-2.5",
16
17
  displays: "flex",
@@ -25,13 +26,21 @@ export default function ProgressCardSmall({ titles, displays, checks, nowFocus,
25
26
  });
26
27
  const titleBox = {
27
28
  positions: "absolute top-2.5 right-2.5",
28
- sizes: "max-w-32.5 w-full h-16",
29
- displays: "flex flex-col items-end gap-y-3",
29
+ sizes: "max-w-40 w-full h-16",
30
+ displays: "flex flex-col items-end",
30
31
  backgrounds: nowFocus === true ? bgLight[theme ?? "green"] : "bg-transparent",
31
- boundaries: "rounded-[10px] pt-2 pr-3.5",
32
+ boundaries: "rounded-[10px]",
33
+ styles: titles.size === "md"
34
+ ? "pt-2 pr-3.5 gap-y-3"
35
+ : "justify-center gap-y-1.5 pr-2",
36
+ };
37
+ const titleStyle = {
38
+ texts: "leading-none",
39
+ sizes: titles.size === "sm" ? "text-[12px]" : "text-[20px] font-pretendard-bold",
40
+ styles: text[theme],
32
41
  };
33
42
  return (_jsxs(CardDesign, { option: {
34
- width: "md",
43
+ width: size ?? "md",
35
44
  height: "5xs",
36
- }, children: [_jsx("div", { className: cn(progressBox), children: displays.map(({ title, subtitle }, index) => (_jsxs("div", { className: cn(stepBox(index === nowFocus)), children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("div", { className: "leading-none text-[12px] font-pretendard-bold", children: title }), _jsx(SVG.Operation.Checked, { flag: checks[index], size: 25, theme: "green" })] }), _jsx("div", { className: `text-[12px] ${text[theme]}`, children: subtitle })] }, title))) }), _jsxs("div", { className: cn(titleBox), children: [_jsx("div", { className: `text-[20px] leading-none font-pretendard-bold ${text[theme]}`, children: titles.title }), _jsx("div", { className: `text-[12px] leading-none ${text[theme]}`, children: titles.subtitle })] })] }));
45
+ }, children: [_jsx("div", { className: cn(progressBox), children: displays.map(({ title, subtitle }, index) => (_jsxs("div", { className: cn(stepBox(index === nowFocus)), children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("div", { className: "leading-none text-[12px] font-pretendard-bold", children: title }), _jsx(SVG.Operation.Checked, { flag: checks[index], size: 25, theme: "green" })] }), _jsx("div", { className: `text-[12px] ${text[theme]}`, children: subtitle })] }, title))) }), _jsxs("div", { className: cn(titleBox), children: [_jsx("div", { className: cn(titleStyle), children: titles.title }), _jsx("div", { className: `text-[12px] leading-none ${text[theme]}`, children: titles.subtitle })] })] }));
37
46
  }
@@ -0,0 +1,2 @@
1
+ import { SubmitCardProps } from "../../design/SubmitCard.design";
2
+ export default function SubmitCard(props: SubmitCardProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import SubmitCardDesign from "../../design/SubmitCard.design";
3
+ export default function SubmitCard(props) {
4
+ return _jsx(SubmitCardDesign, { ...props });
5
+ }
@@ -144,5 +144,8 @@ export interface ProgressCardProps {
144
144
  nowFocus?: number | boolean;
145
145
  displays: Titles[];
146
146
  theme?: Theme;
147
+ option?: {
148
+ size?: Size;
149
+ };
147
150
  }
148
151
  export {};
@@ -58,6 +58,7 @@ export type Titles = {
58
58
  color?: string;
59
59
  titleColor?: string;
60
60
  subtitleColor?: string;
61
+ size?: Size;
61
62
  };
62
63
  export interface Log<K extends string, T extends string | number> {
63
64
  prints: K[];
@@ -0,0 +1,20 @@
1
+ import { Size, Titles } from "./Property";
2
+ export interface TextBoxDesignProps {
3
+ titles: Titles;
4
+ option?: {
5
+ isCenter?: boolean;
6
+ size?: Size;
7
+ className?: string;
8
+ };
9
+ children?: React.ReactNode;
10
+ }
11
+ export interface TextBoxProps extends Omit<TextBoxDesignProps, "children"> {
12
+ }
13
+ export interface TextBoxWithImageProps extends TextBoxProps {
14
+ image: {
15
+ src: string;
16
+ width?: string;
17
+ height?: string;
18
+ className?: string;
19
+ };
20
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -9,3 +9,4 @@ export * from "./Overlay";
9
9
  export * from "./Property";
10
10
  export * from "./Theme";
11
11
  export * from "./Shelf";
12
+ export * from "./TextBox";
@@ -9,3 +9,4 @@ export * from "./Overlay";
9
9
  export * from "./Property";
10
10
  export * from "./Theme";
11
11
  export * from "./Shelf";
12
+ export * from "./TextBox";
@@ -0,0 +1,2 @@
1
+ import { TextBoxDesignProps } from "../../interface";
2
+ export default function TextBoxDesign({ titles, children, option, }: TextBoxDesignProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,34 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { LineBreaks } from "../../text";
3
+ import { cn } from "../../util";
4
+ const titleSize = {
5
+ md: "text-[16px]",
6
+ lg: "text-[20px]",
7
+ };
8
+ const subtitleSize = {
9
+ md: "text-[12px]",
10
+ lg: "text-[16px]",
11
+ };
12
+ export default function TextBoxDesign({ titles, children, option, }) {
13
+ const { title, subtitle, titleColor, color, subtitleColor } = titles;
14
+ const { size, isCenter, className } = option ?? {};
15
+ console.log(isCenter);
16
+ const container = {
17
+ displays: "flex flex-col",
18
+ center: isCenter && "items-center",
19
+ styles: color,
20
+ className: className ?? "gap-y-2",
21
+ };
22
+ const titleBox = {
23
+ colors: titleColor ?? color ?? "text-gray-dark",
24
+ sizes: titleSize[size ?? "md"],
25
+ fonts: "font-pretendard-bold",
26
+ styles: "leading-tight",
27
+ };
28
+ const subtitleBox = {
29
+ colors: subtitleColor ?? color ?? "text-gray-medium",
30
+ sizes: subtitleSize[size ?? "md"],
31
+ center: isCenter && "text-center",
32
+ };
33
+ return (_jsxs("div", { className: cn(container), children: [_jsx("div", { className: cn(titleBox), children: title }), children, _jsx(LineBreaks, { texts: subtitle, className: cn(subtitleBox) })] }));
34
+ }
package/layout/index.d.ts CHANGED
@@ -8,3 +8,4 @@ export { default as Gallery } from "./template/Gallery";
8
8
  export { default as Row } from "./template/Row";
9
9
  export { default as Shelf } from "./template/Shelf";
10
10
  export { default as Tab } from "./template/Tab";
11
+ export { default as TextBox } from "./template/TextBox";
package/layout/index.js CHANGED
@@ -8,3 +8,4 @@ export { default as Gallery } from "./template/Gallery";
8
8
  export { default as Row } from "./template/Row";
9
9
  export { default as Shelf } from "./template/Shelf";
10
10
  export { default as Tab } from "./template/Tab";
11
+ export { default as TextBox } from "./template/TextBox";
@@ -0,0 +1,7 @@
1
+ import { TextBoxProps, TextBoxWithImageProps } from "../../interface";
2
+ declare function TitleBox(props: TextBoxProps): import("react/jsx-runtime").JSX.Element;
3
+ declare namespace TitleBox {
4
+ var Image: typeof TitleBoxWithImage;
5
+ }
6
+ declare function TitleBoxWithImage({ titles, image, option }: TextBoxWithImageProps): import("react/jsx-runtime").JSX.Element;
7
+ export default TitleBox;
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import TextBoxDesign from "../design/TextBox.design";
3
+ function TitleBox(props) {
4
+ return _jsx(TextBoxDesign, { ...props });
5
+ }
6
+ function TitleBoxWithImage({ titles, image, option }) {
7
+ return (_jsx(TextBoxDesign, { titles: titles, option: { isCenter: true, size: "lg", className: "gap-y-8", ...option }, children: _jsx("img", { src: image.src, width: image.width, height: image.height, className: image.className }) }));
8
+ }
9
+ TitleBox.Image = TitleBoxWithImage;
10
+ export default TitleBox;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edu-tosel/design",
3
- "version": "1.0.95",
3
+ "version": "1.0.96",
4
4
  "description": "UI components for International TOSEL Committee",
5
5
  "keywords": [
6
6
  "jsx",
package/version.txt CHANGED
@@ -1 +1 @@
1
- 1.0.95
1
+ 1.0.96