@edu-tosel/design 1.0.200 → 1.0.201

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.
Files changed (28) hide show
  1. package/layout/index.d.ts +1 -0
  2. package/layout/index.js +1 -0
  3. package/layout/template/Error/Error404.d.ts +1 -0
  4. package/layout/template/Error/Error404.js +4 -0
  5. package/layout/template/Error/index.d.ts +5 -0
  6. package/layout/template/Error/index.js +5 -0
  7. package/layout/template/Ticket/Ticket.design.js +1 -1
  8. package/layout/template/Transcript/design/Transcript.d.ts +1 -1
  9. package/layout/template/Transcript/design/Transcript.design.js +14 -1
  10. package/layout/template/Transcript/design/Transcript.js +37 -13
  11. package/layout/template/Transcript/design/TranscriptAdvanced.design.d.ts +2 -2
  12. package/layout/template/Transcript/design/TranscriptAdvanced.design.js +31 -2
  13. package/layout/template/Transcript/design/atom/CardTitle.d.ts +1 -1
  14. package/layout/template/Transcript/design/molecule/BarGraph.d.ts +1 -1
  15. package/layout/template/Transcript/design/molecule/CircularGauge.d.ts +1 -1
  16. package/layout/template/Transcript/design/organism/BarCardCol.d.ts +7 -5
  17. package/layout/template/Transcript/design/organism/BarCardCol.js +9 -3
  18. package/layout/template/Transcript/design/organism/BarCardRow.d.ts +7 -5
  19. package/layout/template/Transcript/design/organism/BarCardRow.js +9 -3
  20. package/layout/template/Transcript/design/organism/IdCard.js +1 -1
  21. package/layout/template/Transcript/design/organism/ResultGaugeCard.d.ts +1 -1
  22. package/layout/template/Transcript/index.d.ts +1 -1
  23. package/layout/template/Transcript/interface.d.ts +10 -0
  24. package/package.json +1 -1
  25. package/tailwind.config.ts +5 -0
  26. package/version.txt +1 -1
  27. package/layout/template/Transcript/Theme.d.ts +0 -1
  28. /package/layout/template/Transcript/{Theme.js → interface.js} +0 -0
package/layout/index.d.ts CHANGED
@@ -24,3 +24,4 @@ export { default as LegacyLayout } from "./template/Legacy/Legacy.layout";
24
24
  export { default as MonthlyProgressReport } from "./template/MonthlyProgressReport";
25
25
  export { default as Transcript } from "./template/Transcript";
26
26
  export { default as Ticket } from "./template/Ticket";
27
+ export { default as Error } from "./template/Error";
package/layout/index.js CHANGED
@@ -24,3 +24,4 @@ export { default as LegacyLayout } from "./template/Legacy/Legacy.layout";
24
24
  export { default as MonthlyProgressReport } from "./template/MonthlyProgressReport";
25
25
  export { default as Transcript } from "./template/Transcript";
26
26
  export { default as Ticket } from "./template/Ticket";
27
+ export { default as Error } from "./template/Error";
@@ -0,0 +1 @@
1
+ export default function Error404(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export default function Error404() {
3
+ return (_jsx("div", { className: "flex justify-center items-center w-full h-screen", children: _jsxs("div", { className: "flex flex-col justify-center items-center", children: [_jsx("div", { className: "w-full h-fit flex justify-center items-center mb-5 text-green-dark", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor", className: "md:size-10 size-6", children: _jsx("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z" }) }) }), _jsxs("div", { className: "w-full text-center text-sm md:text-base font-medium text-gray-dark", children: ["\uC694\uCCAD\uD558\uC2E0 \uD398\uC774\uC9C0\uB97C \uCC3E\uC744 \uC218\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. ", _jsx("br", {}), "\uC8FC\uC18C\uB97C \uB2E4\uC2DC \uD655\uC778\uD574\uC8FC\uC138\uC694."] }), _jsxs("div", { className: "relative flex justify-center items-center md:size-80 size-40", children: [_jsx("div", { className: "absolute flex justify-center items-center left-0 top-0 w-full h-full overflow-visible", children: _jsx("div", { className: "font-medium md:text-[200px] text-[100px] text-green-dark", children: "404" }) }), _jsx("div", { className: "absolute flex justify-center items-center left-0 top-0 w-full h-full overflow-visible", children: _jsx("img", { src: "https://resource.tosel.co.kr/images/img-character-cocoon-main-new.png", alt: "", className: "size-40 md:size-80 z-10 hover:scale-105 duration-300" }) })] }), _jsx("div", { className: "w-full text-center text-base font-medium text-gray-dark", children: _jsx("button", { className: "font-medium text-green-dark w-fit h-fit bg-green-light px-4 py-3 rounded-lg hover:shadow-green duration-300 text-sm hover:bg-white", children: "\uC774\uC804 \uD398\uC774\uC9C0\uB85C \uB3CC\uC544\uAC00\uAE30" }) })] }) }));
4
+ }
@@ -0,0 +1,5 @@
1
+ import Error404 from "./Error404";
2
+ declare const Error: {
3
+ Error404: typeof Error404;
4
+ };
5
+ export default Error;
@@ -0,0 +1,5 @@
1
+ import Error404 from "./Error404";
2
+ const Error = {
3
+ Error404,
4
+ };
5
+ export default Error;
@@ -73,6 +73,6 @@ function TicketDesign({ props }, ref) {
73
73
  ? "w-2.5 shrink-0 bg-gray-light"
74
74
  : "w-full bg-white"}`, children: num !== null ? num : "" }, index))) })] }), _jsxs("div", { className: "font-medium text-2xs", children: ["*OMR (1)\uBC88 \uD56D\uBAA9\uC5D0 \uD574\uB2F9\uBC88\uD638\uB97C \uB530\uB77C\uC11C \uC368\uC8FC\uC138\uC694.", " "] })] }), _jsxs("div", { className: cn(cellWrapper), children: [_jsx("div", { className: cn(cellTitleLarge), children: "\uB808\uBCA8" }), _jsx("div", { className: cn(cellText), children: props.level })] }), _jsxs("div", { className: "flex flex-row gap-2", children: [_jsxs("div", { className: "flex flex-col gap-0 h-full w-21 border-1 border-gray-medium shrink-0", children: [typeof props.profile !== "function" ? (_jsx("div", { className: "h-full w-full bg-cover", style: {
75
75
  backgroundImage: `url(${props.profile ?? ""})`,
76
- } })) : (typeof props.profile === "function" && (_jsxs("button", { onMouseEnter: () => setHover(true), onMouseLeave: () => setHover(false), onClick: props.profile, className: "w-full h-full overflow-hidden relative bg-gray-light", children: [_jsx("img", { className: "bg-cover", src: "https://tosel.cdn.ntruss.com/images/picture.png" }), transitions((styles, item) => item && (_jsxs(animated.div, { style: styles, className: cn(hoverBox), children: [_jsx(SVG.Image, {}), _jsx("div", { className: "text-white text-xs leading-none", children: "\uC0AC\uC9C4 \uBC14\uAFB8\uAE30" })] })))] }))), _jsx("div", { className: cn(cellTitleLarge, "w-full"), children: "\uC0AC\uC9C4" })] }), _jsxs("div", { className: "flex flex-col gap-2 w-full", children: [_jsxs("div", { className: "flex flex-col gap-0", children: [_jsxs("div", { className: cn(cellWrapper), children: [_jsx("div", { className: cn(cellTitleSmall), children: "\uC774\uB984" }), _jsx("div", { className: cn(cellText), children: props.name })] }), _jsxs("div", { className: cn(cellWrapper, "border-t-0"), children: [_jsx("div", { className: cn(cellTitleSmall), children: "\uC0DD\uB144\uC6D4\uC77C" }), _jsx("div", { className: cn(cellText), children: props.birthday })] })] }), _jsxs("div", { className: "flex flex-col gap-0", children: [_jsxs("div", { className: cn(cellWrapper), children: [_jsx("div", { className: cn(cellTitleSmall), children: "\uACE0\uC0AC\uC7A5" }), _jsx("div", { className: cn(cellText), children: hall })] }), _jsxs("div", { className: cn(cellWrapper, "border-t-0"), children: [_jsx("div", { className: cn(cellTitleSmall), children: "\uACE0\uC0AC\uC2E4" }), _jsx("div", { className: cn(cellText), children: room })] })] })] })] }), _jsxs("div", { className: "flex flex-col gap-0", children: [_jsxs("div", { className: cn(cellWrapper), children: [_jsx("div", { className: cn(cellTitleLarge, "bg-green-dark/10"), children: "\uC2DC\uD5D8\uC77C\uC790" }), _jsx("div", { className: cn(cellText), children: props.exam.date })] }), _jsxs("div", { className: cn(cellWrapper, "border-t-0"), children: [_jsx("div", { className: cn(cellTitleLarge, "bg-green-dark/10"), children: "\uC785\uC2E4 \uC644\uB8CC\uC2DC\uAC04" }), _jsx("div", { className: cn(cellText), children: formmatedStartedAt })] }), _jsxs("div", { className: cn(cellWrapper, "border-t-0"), children: [_jsx("div", { className: cn(cellTitleLarge, "bg-green-dark/10"), children: "\uC885\uB8CC\uC2DC\uAC04" }), _jsx("div", { className: cn(cellText), children: formmatedEndedAt(startedAt, props.level) })] }), _jsxs("div", { className: "flex flex-col mt-1", children: [_jsx("div", { className: "font-medium text-2xs leading-tight", children: "*\uC785\uC2E4\uC2DC\uAC04 \uC774\uD6C4\uC5D0\uB294 \uC785\uC2E4\uC774 \uC81C\uD55C\uB429\uB2C8\uB2E4." }), _jsx("div", { className: "font-medium text-2xs leading-tight", children: "*\uACE0\uC0AC\uC7A5 \uC5EC\uAC74\uC5D0 \uB530\uB77C \uD1F4\uC2E4\uC2DC\uAC04\uC740 \uC870\uAE08\uC529 \uC0C1\uC774\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4." })] })] }), _jsx("div", { className: "w-full border-b-1 border-dashed border-gray-medium" }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx("div", { className: "font-bold text-sm leading-tight", children: "\uC751\uC2DC\uC790 \uC720\uC758\uC0AC\uD56D" }), _jsxs("ul", { className: "list-outside list-decimal ml-4 font-medium text-2xs", children: [_jsxs("li", { className: "mb-1", children: ["\uB2E4\uC74C\uC758 \uBB3C\uD488\uC744 \uAF2D \uC900\uBE44\uD574\uC8FC\uC138\uC694:", _jsx("br", {}), " \uCEF4\uD4E8\uD130\uC6A9 \uC0AC\uC778\uD39C / \uC218\uC815 \uD14C\uC774\uD504 / \uC218\uD5D8\uD45C / \uAC80\uC815 \uBCFC\uD39C"] }), _jsxs("li", { className: "mb-1", children: ["\uACE0\uC0AC\uC7A5 \uC704\uCE58\uB97C \uBBF8\uB9AC \uD655\uC778\uD574\uC8FC\uC138\uC694:", _jsx("br", {}), " \uC218\uD5D8\uD45C\uC5D0 \uAE30\uC7AC\uB41C \uACE0\uC0AC\uC7A5, \uACE0\uC0AC\uC2E4 \uC815\uBCF4\uB97C \uD655\uC778\uD574\uC8FC\uC138\uC694."] }), _jsxs("li", { children: ["\uD559\uBD80\uBAA8 \uCD9C\uC785 \uD1B5\uC81C:", _jsx("br", {}), "\uACE0\uC0AC\uC2E4 \uB0B4\uBD80\uC5D0\uB294 \uD559\uBD80\uBAA8\uC758 \uCD9C\uC785\uC774 \uC5C4\uACA9\uD788 \uD1B5\uC81C\uB429\uB2C8\uB2E4."] })] })] })] })] }));
76
+ } })) : (typeof props.profile === "function" && (_jsxs("button", { onMouseEnter: () => setHover(true), onMouseLeave: () => setHover(false), onClick: props.profile, className: "w-full h-full overflow-hidden relative bg-gray-light", children: [_jsx("img", { className: "bg-cover", src: "https://tosel.cdn.ntruss.com/images/picture.png" }), transitions((styles, item) => item && (_jsxs(animated.div, { style: styles, className: cn(hoverBox), children: [_jsx(SVG.Image, {}), _jsx("div", { className: "text-white text-xs leading-none", children: "\uC0AC\uC9C4 \uBC14\uAFB8\uAE30" })] })))] }))), _jsx("div", { className: cn(cellTitleLarge, "w-full"), children: "\uBCF8\uC778 \uC0AC\uC9C4" })] }), _jsxs("div", { className: "flex flex-col gap-2 w-full", children: [_jsxs("div", { className: "flex flex-col gap-0", children: [_jsxs("div", { className: cn(cellWrapper), children: [_jsx("div", { className: cn(cellTitleSmall), children: "\uC774\uB984" }), _jsx("div", { className: cn(cellText), children: props.name })] }), _jsxs("div", { className: cn(cellWrapper, "border-t-0"), children: [_jsx("div", { className: cn(cellTitleSmall), children: "\uC0DD\uB144\uC6D4\uC77C" }), _jsx("div", { className: cn(cellText), children: props.birthday })] })] }), _jsxs("div", { className: "flex flex-col gap-0", children: [_jsxs("div", { className: cn(cellWrapper), children: [_jsx("div", { className: cn(cellTitleSmall), children: "\uACE0\uC0AC\uC7A5" }), _jsx("div", { className: cn(cellText), children: hall })] }), _jsxs("div", { className: cn(cellWrapper, "border-t-0"), children: [_jsx("div", { className: cn(cellTitleSmall), children: "\uACE0\uC0AC\uC2E4" }), _jsx("div", { className: cn(cellText), children: room })] })] })] })] }), _jsxs("div", { className: "flex flex-col gap-0", children: [_jsxs("div", { className: cn(cellWrapper), children: [_jsx("div", { className: cn(cellTitleLarge, "bg-green-dark/10"), children: "\uC2DC\uD5D8\uC77C\uC790" }), _jsx("div", { className: cn(cellText), children: props.exam.date })] }), _jsxs("div", { className: cn(cellWrapper, "border-t-0"), children: [_jsx("div", { className: cn(cellTitleLarge, "bg-green-dark/10"), children: "\uC785\uC2E4 \uC644\uB8CC\uC2DC\uAC04" }), _jsx("div", { className: cn(cellText), children: formmatedStartedAt })] }), _jsxs("div", { className: cn(cellWrapper, "border-t-0"), children: [_jsx("div", { className: cn(cellTitleLarge, "bg-green-dark/10"), children: "\uC885\uB8CC\uC2DC\uAC04" }), _jsx("div", { className: cn(cellText), children: formmatedEndedAt(startedAt, props.level) })] }), _jsxs("div", { className: "flex flex-col mt-1", children: [_jsx("div", { className: "font-medium text-2xs leading-tight", children: "*\uC785\uC2E4\uC2DC\uAC04 \uC774\uD6C4\uC5D0\uB294 \uC785\uC2E4\uC774 \uC81C\uD55C\uB429\uB2C8\uB2E4." }), _jsx("div", { className: "font-medium text-2xs leading-tight", children: "*\uACE0\uC0AC\uC7A5 \uC5EC\uAC74\uC5D0 \uB530\uB77C \uD1F4\uC2E4\uC2DC\uAC04\uC740 \uC870\uAE08\uC529 \uC0C1\uC774\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4." })] })] }), _jsx("div", { className: "w-full border-b-1 border-dashed border-gray-medium" }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx("div", { className: "font-bold text-sm leading-tight", children: "\uC751\uC2DC\uC790 \uC720\uC758\uC0AC\uD56D" }), _jsxs("ul", { className: "list-outside list-decimal ml-4 font-medium text-2xs", children: [_jsxs("li", { className: "mb-1", children: ["\uB2E4\uC74C\uC758 \uBB3C\uD488\uC744 \uAF2D \uC900\uBE44\uD574\uC8FC\uC138\uC694:", _jsx("br", {}), " \uCEF4\uD4E8\uD130\uC6A9 \uC0AC\uC778\uD39C / \uC218\uC815 \uD14C\uC774\uD504 / \uC218\uD5D8\uD45C / \uAC80\uC815 \uBCFC\uD39C"] }), _jsxs("li", { className: "mb-1", children: ["\uACE0\uC0AC\uC7A5 \uC704\uCE58\uB97C \uBBF8\uB9AC \uD655\uC778\uD574\uC8FC\uC138\uC694:", _jsx("br", {}), " \uC218\uD5D8\uD45C\uC5D0 \uAE30\uC7AC\uB41C \uACE0\uC0AC\uC7A5, \uACE0\uC0AC\uC2E4 \uC815\uBCF4\uB97C \uD655\uC778\uD574\uC8FC\uC138\uC694."] }), _jsxs("li", { children: ["\uD559\uBD80\uBAA8 \uCD9C\uC785 \uD1B5\uC81C:", _jsx("br", {}), "\uACE0\uC0AC\uC2E4 \uB0B4\uBD80\uC5D0\uB294 \uD559\uBD80\uBAA8\uC758 \uCD9C\uC785\uC774 \uC5C4\uACA9\uD788 \uD1B5\uC81C\uB429\uB2C8\uB2E4."] })] })] })] })] }));
77
77
  }
78
78
  export default forwardRef(TicketDesign);
@@ -119,7 +119,7 @@ export interface TranscriptAdvancedProps {
119
119
  part6: string;
120
120
  };
121
121
  };
122
- occupationalCompetencies: OccupationalCompetency[];
122
+ oci: OccupationalCompetency[];
123
123
  }
124
124
  export declare const example: TranscriptAdvancedProps;
125
125
  export {};
@@ -24,6 +24,8 @@ export function getStringfromType(ExamType) {
24
24
  }
25
25
  function TranscriptDesign({ props }, ref) {
26
26
  const { info, result, data } = props;
27
+ const section1Data = SectionBarGraphProps("section1", data.analysis.user.section1, 50, data.script.section1, undefined, 10, data.analysis.nationalAverage.section1);
28
+ const section2Data = SectionBarGraphProps("section2", data.analysis.user.section2, 50, data.script.section2, undefined, 10, data.analysis.nationalAverage.section2);
27
29
  const container = {
28
30
  printSize: paperSize.a4,
29
31
  backgrounds: "print:bg-white",
@@ -36,6 +38,17 @@ function TranscriptDesign({ props }, ref) {
36
38
  spacings: "px-5 py-2",
37
39
  backgrounds: "bg-gradient-to-r from-crimson-burgundy to-green-dark",
38
40
  };
39
- return (_jsxs("div", { ref: ref, className: cn(container), children: [_jsxs("div", { className: cn(headerBox), children: [_jsx("img", { src: "images/logos/logo-tosel-white.svg", alt: "", className: "h-10" }), _jsxs("div", { className: "text-white font-bold text-base", children: [getStringfromType(info.examType), " \uC131\uC801\uD45C"] })] }), _jsx(IdCard, { info: info }), _jsxs("div", { className: "flex flex-col gap-5 xs:flex-row mt-5 items-stretch", children: [_jsx(ResultGaugeCard, { result: result, theme: "green" }), _jsx(HonorCard, { result: result })] }), _jsx(PerformanceCard, { data: data, info: info }), _jsx(ScoreCard, { data: data }), _jsx(BarCardRow, { data: data, theme: "green" })] }));
41
+ return (_jsxs("div", { ref: ref, className: cn(container), children: [_jsxs("div", { className: cn(headerBox), children: [_jsx("img", { src: "images/logos/logo-tosel-white.svg", alt: "", className: "h-10" }), _jsxs("div", { className: "text-white font-bold text-base", children: [getStringfromType(info.examType), " \uC131\uC801\uD45C"] })] }), _jsx(IdCard, { info: info }), _jsxs("div", { className: "flex flex-col gap-5 xs:flex-row mt-5 items-stretch", children: [_jsx(ResultGaugeCard, { result: result, theme: "green" }), _jsx(HonorCard, { result: result })] }), _jsx(PerformanceCard, { data: data, info: info }), _jsx(ScoreCard, { data: data }), _jsx(BarCardRow, { section1: section1Data, section2: section2Data, theme: "green" })] }));
40
42
  }
41
43
  export default forwardRef(TranscriptDesign);
44
+ function SectionBarGraphProps(title, score, total, script, subScripts, scale, subScore) {
45
+ return {
46
+ title: title,
47
+ score: score,
48
+ subScore: subScore,
49
+ total: total,
50
+ scale: scale,
51
+ script: script,
52
+ subScripts: subScripts,
53
+ };
54
+ }
@@ -1,24 +1,44 @@
1
1
  export const example = {
2
2
  info: {
3
3
  name: "조철봉",
4
- birthday: '1999-11-11',
4
+ birthday: "1999-11-11",
5
5
  code: "123456789012",
6
6
  gender: "MAIL",
7
- examDate: '2024-11-06',
7
+ examDate: "2024-11-06",
8
8
  examName: "AD 정기시험",
9
9
  examType: "REG",
10
10
  examValidAt: "2024-11-07",
11
- level: "AD"
11
+ level: "AD",
12
12
  },
13
13
  score: {
14
- average: { part1: 100, part2: 100, part3: 10, part4: 1, part5: 200, part6: 200, part7: 20, part8: 2 },
15
- result: { part1: 50, part2: 120, part3: 40, part4: 0, part5: 100, part6: 220, part7: 70, part8: 2 },
16
- section1: { script: "Your scaled score is between...",
17
- details: ["asd", 'qwe', 'zxc']
14
+ average: {
15
+ part1: 100,
16
+ part2: 100,
17
+ part3: 10,
18
+ part4: 1,
19
+ part5: 200,
20
+ part6: 200,
21
+ part7: 20,
22
+ part8: 2,
23
+ },
24
+ result: {
25
+ part1: 50,
26
+ part2: 120,
27
+ part3: 40,
28
+ part4: 0,
29
+ part5: 100,
30
+ part6: 220,
31
+ part7: 70,
32
+ part8: 2,
33
+ },
34
+ section1: {
35
+ script: "Your scaled score is between...",
36
+ details: ["asd", "qwe", "zxc"],
37
+ },
38
+ section2: {
39
+ script: "Your scaled score is between...",
40
+ details: ["123", "456", "789"],
18
41
  },
19
- section2: { script: "Your scaled score is between...",
20
- details: ["123", '456', '789']
21
- }
22
42
  },
23
43
  lswr: {
24
44
  average: { listening: 55, speaking: 59, reading: 51, writing: 53 },
@@ -28,10 +48,14 @@ export const example = {
28
48
  readingScript: { part7: "asd", part8: "qwe" },
29
49
  writingScript: { part5: "asd", part6: "qwe" },
30
50
  },
31
- occupationalCompetencies: [
51
+ oci: [
32
52
  { category: "Communicative Competency (CC)", average: 0.25, result: 0.75 },
33
- { category: "Problem-Solving Competency (PS)", average: 0.35, result: 0.90 },
34
- { category: "Interpersonal/Social Competency (IS)", average: 0.45, result: 0.68 },
53
+ { category: "Problem-Solving Competency (PS)", average: 0.35, result: 0.9 },
54
+ {
55
+ category: "Interpersonal/Social Competency (IS)",
56
+ average: 0.45,
57
+ result: 0.68,
58
+ },
35
59
  ],
36
60
  };
37
61
  example.lswr.result.listening;
@@ -1,5 +1,5 @@
1
- import { TranscriptProps } from "./Transcript";
1
+ import { TranscriptAdvancedProps } from "./Transcript";
2
2
  declare const _default: import("react").ForwardRefExoticComponent<{
3
- props: TranscriptProps;
3
+ props: TranscriptAdvancedProps;
4
4
  } & import("react").RefAttributes<HTMLDivElement>>;
5
5
  export default _default;
@@ -5,7 +5,25 @@ import { cn } from "../../../../util";
5
5
  import IdCard from "./organism/IdCard";
6
6
  import { BarCardCol } from "./organism/BarCardCol";
7
7
  function TranscriptDesign({ props }, ref) {
8
- const { info, result, data } = props;
8
+ const { info, score, lswr, oci } = props;
9
+ const section1Score = score.result.part1 +
10
+ score.result.part2 +
11
+ score.result.part3 +
12
+ score.result.part4;
13
+ const section2Score = score.result.part5 +
14
+ score.result.part6 +
15
+ score.result.part7 +
16
+ score.result.part8;
17
+ const section1Average = score.average.part1 +
18
+ score.average.part2 +
19
+ score.average.part3 +
20
+ score.average.part4;
21
+ const section2Average = score.average.part5 +
22
+ score.average.part6 +
23
+ score.average.part7 +
24
+ score.average.part8;
25
+ const section1Data = SectionBarGraphProps("Listening & Speaking", section1Score, 495, score.section1.script, score.section1.details, 100, section1Average);
26
+ const section2Data = SectionBarGraphProps("Reading & Writing", section2Score, 495, score.section2.script, score.section2.details, 100, section2Average);
9
27
  const container = {
10
28
  printSize: paperSize.a4,
11
29
  backgrounds: "print:bg-white",
@@ -18,6 +36,17 @@ function TranscriptDesign({ props }, ref) {
18
36
  spacings: "px-5 py-2",
19
37
  backgrounds: "bg-gradient-to-r from-crimson-burgundy to-green-dark",
20
38
  };
21
- return (_jsxs("div", { ref: ref, className: cn(container), children: [_jsxs("div", { className: cn(headerBox), children: [_jsx("img", { src: "https://resource.tosel.co.kr/images/header-logo2.png", alt: "\uD1A0\uC140 \uB85C\uACE0", className: "h-10 py-1" }), _jsx("div", { className: "text-white font-bold text-base", children: "Official Score Report" })] }), _jsx(IdCard, { info: info }), _jsx(BarCardCol, { data: data, theme: "red" })] }));
39
+ return (_jsxs("div", { ref: ref, className: cn(container), children: [_jsxs("div", { className: cn(headerBox), children: [_jsx("img", { src: "https://resource.tosel.co.kr/images/header-logo2.png", alt: "\uD1A0\uC140 \uB85C\uACE0", className: "h-10 py-1" }), _jsx("div", { className: "text-white font-bold text-base", children: "Official Score Report" })] }), _jsx(IdCard, { info: info }), _jsx(BarCardCol, { section1: section1Data, section2: section2Data, theme: "red" })] }));
40
+ }
41
+ function SectionBarGraphProps(title, score, total, script, subScripts, scale, subScore) {
42
+ return {
43
+ title: title,
44
+ score: score,
45
+ subScore: subScore,
46
+ total: total,
47
+ scale: scale,
48
+ script: script,
49
+ subScripts: subScripts,
50
+ };
22
51
  }
23
52
  export default forwardRef(TranscriptDesign);
@@ -1,4 +1,4 @@
1
- import { Theme } from "../../Theme";
1
+ import { Theme } from "../../interface";
2
2
  export default function CardTitle({ title, theme, }: {
3
3
  title: string;
4
4
  theme: Theme;
@@ -1,4 +1,4 @@
1
- import { Theme } from "../../Theme";
1
+ import { Theme } from "../../interface";
2
2
  interface SectionBarProps {
3
3
  title: string;
4
4
  score: number;
@@ -1,4 +1,4 @@
1
- import { Theme } from "../../Theme";
1
+ import { Theme } from "../../interface";
2
2
  interface GaugeProps {
3
3
  score: number;
4
4
  maxScore: number;
@@ -1,6 +1,8 @@
1
- import { Theme } from "../../Theme";
2
- import { TranscriptProps } from "../Transcript";
3
- export declare function BarCardCol({ data, theme, }: {
4
- data: TranscriptProps["data"];
1
+ import { SectionBarProps, Theme } from "../../interface";
2
+ interface BarCardColProps {
3
+ section1: SectionBarProps;
4
+ section2: SectionBarProps;
5
5
  theme: Theme;
6
- }): import("react/jsx-runtime").JSX.Element;
6
+ }
7
+ export declare function BarCardCol({ section1, section2, theme }: BarCardColProps): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -3,7 +3,7 @@ import { cn } from "../../../../../util";
3
3
  import CardTitle from "../atom/CardTitle";
4
4
  import { printBoxStyles } from "../atom/PrintBoxStyles";
5
5
  import { BarGraph } from "../molecule/BarGraph";
6
- export function BarCardCol({ data, theme, }) {
6
+ export function BarCardCol({ section1, section2, theme }) {
7
7
  const cardWrapper = {
8
8
  displays: "flex flex-col relative",
9
9
  sizes: "w-full rounded-lg overflow-hidden",
@@ -16,9 +16,15 @@ export function BarCardCol({ data, theme, }) {
16
16
  };
17
17
  const ScriptStyles = {
18
18
  displays: "flex justify-center items-center align-center",
19
- spacings: "p-5",
19
+ spacings: "px-5",
20
20
  sizes: "w-full h-full",
21
21
  textStyles: "text-sm break-keep",
22
22
  };
23
- return (_jsxs("div", { className: cn(cardWrapper, printBoxStyles), children: [_jsx(CardTitle, { title: "Grade and Average Score", theme: theme }), _jsxs("div", { className: "flex sm:flex-row flex-col sm:mt-0 mt-5", children: [_jsxs("div", { className: cn(SectionWrapper), children: [_jsx(BarGraph, { title: "section1", score: data.analysis.user.section1, total: 50, subScore: data.analysis.nationalAverage.section1, scale: 10, theme: theme }), _jsx("div", { className: cn(ScriptStyles), children: data.script.section1 })] }), _jsxs("div", { className: cn(SectionWrapper), children: [_jsx(BarGraph, { title: "section2", score: data.analysis.user.section2, total: 50, subScore: data.analysis.nationalAverage.section2, scale: 10, theme: theme }), _jsx("div", { className: cn(ScriptStyles), children: data.script.section2 })] })] })] }));
23
+ const subScriptStyles = {
24
+ listStyles: "list-disc list-inside",
25
+ sizes: "w-full",
26
+ spacings: "p-5",
27
+ textStyles: "leading-tight text-xs",
28
+ };
29
+ return (_jsxs("div", { className: cn(cardWrapper, printBoxStyles), children: [_jsx(CardTitle, { title: "Grade and Average Score", theme: theme }), _jsxs("div", { className: "flex sm:flex-row flex-col sm:mt-0 mt-5", children: [_jsxs("div", { className: cn(SectionWrapper), children: [_jsx(BarGraph, { title: section1.title ? section1.title : "section1", score: section1.score, total: section1.total, subScore: section1.subScore, scale: section1.scale ? section1.scale : 10, theme: theme }), _jsx("div", { className: cn(ScriptStyles), children: section1.script }), _jsx("div", { className: cn(subScriptStyles), children: section1.subScripts?.map((text, index) => (_jsx("li", { children: text }, index))) })] }), _jsxs("div", { className: cn(SectionWrapper), children: [_jsx(BarGraph, { title: section2.title ? section2.title : "section2", score: section2.score, total: section2.total, subScore: section2.subScore, scale: section2.scale ? section2.scale : 10, theme: theme }), _jsx("div", { className: cn(ScriptStyles), children: section2.script }), _jsx("div", { className: cn(subScriptStyles), children: section2.subScripts?.map((text, index) => (_jsx("li", { children: text }, index))) })] })] })] }));
24
30
  }
@@ -1,6 +1,8 @@
1
- import { Theme } from "../../Theme";
2
- import { TranscriptProps } from "../Transcript";
3
- export declare function BarCardRow({ data, theme, }: {
4
- data: TranscriptProps["data"];
1
+ import { SectionBarProps, Theme } from "../../interface";
2
+ interface BarCardColProps {
3
+ section1: SectionBarProps;
4
+ section2: SectionBarProps;
5
5
  theme: Theme;
6
- }): import("react/jsx-runtime").JSX.Element;
6
+ }
7
+ export declare function BarCardRow({ section1, section2, theme }: BarCardColProps): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -3,7 +3,7 @@ import { cn } from "../../../../../util";
3
3
  import CardTitle from "../atom/CardTitle";
4
4
  import { printBoxStyles } from "../atom/PrintBoxStyles";
5
5
  import { BarGraph } from "../molecule/BarGraph";
6
- export function BarCardRow({ data, theme, }) {
6
+ export function BarCardRow({ section1, section2, theme }) {
7
7
  const cardWrapper = {
8
8
  displays: "flex flex-col relative",
9
9
  sizes: "w-full rounded-lg overflow-hidden",
@@ -16,9 +16,15 @@ export function BarCardRow({ data, theme, }) {
16
16
  };
17
17
  const ScriptStyles = {
18
18
  displays: "flex justify-center items-center align-center",
19
- spacings: "p-5",
19
+ spacings: "px-5",
20
20
  sizes: "w-full h-full",
21
21
  textStyles: "text-sm break-keep",
22
22
  };
23
- return (_jsxs("div", { className: cn(cardWrapper, printBoxStyles), children: [_jsx(CardTitle, { title: "Grade and Average Score", theme: theme }), _jsxs("div", { className: "flex flex-col sm:mt-0 mt-5", children: [_jsxs("div", { className: cn(SectionWrapper), children: [_jsx(BarGraph, { title: "section1", score: data.analysis.user.section1, total: 50, subScore: data.analysis.nationalAverage.section1, scale: 10, theme: theme }), _jsx("div", { className: cn(ScriptStyles), children: data.script.section1 })] }), _jsxs("div", { className: cn(SectionWrapper), children: [_jsx(BarGraph, { title: "section2", score: data.analysis.user.section2, total: 50, subScore: data.analysis.nationalAverage.section2, scale: 10, theme: theme }), _jsx("div", { className: cn(ScriptStyles), children: data.script.section2 })] })] })] }));
23
+ const subScriptStyles = {
24
+ listStyles: "list-disc list-inside",
25
+ sizes: "w-full",
26
+ spacings: "p-5",
27
+ textStyles: "leading-tight text-xs",
28
+ };
29
+ return (_jsxs("div", { className: cn(cardWrapper, printBoxStyles), children: [_jsx(CardTitle, { title: "Grade and Average Score", theme: theme }), _jsxs("div", { className: "flex flex-col sm:mt-0 mt-5", children: [_jsxs("div", { className: cn(SectionWrapper), children: [_jsx(BarGraph, { title: section1.title ? section1.title : "section1", score: section1.score, total: section1.total, subScore: section1.subScore, scale: section1.scale ? section1.scale : 10, theme: theme }), _jsx("div", { className: cn(ScriptStyles), children: section1.script })] }), _jsxs("div", { className: cn(SectionWrapper), children: [_jsx(BarGraph, { title: section2.title ? section2.title : "section2", score: section2.score, total: section2.total, subScore: section2.subScore, scale: section2.scale ? section2.scale : 10, theme: theme }), _jsx("div", { className: cn(ScriptStyles), children: section2.script })] })] })] }));
24
30
  }
@@ -26,7 +26,7 @@ export default function IdCard({ info }) {
26
26
  displays: "shrink-0 hidden sm:block relative overflow-hidden",
27
27
  sizes: "h-30 p-2 aspect-square rounded-lg",
28
28
  textStyles: "text-jr-blue",
29
- backgrounds: "print:border-2 print:border-green-dark",
29
+ backgrounds: info.qrSrc && "print:border-2 print:border-green-dark",
30
30
  groupAction: info.qrSrc && "group duration-300 hover:scale-110 bg-white",
31
31
  };
32
32
  const copyButtonWrapper = {
@@ -1,4 +1,4 @@
1
- import { Theme } from "../../Theme";
1
+ import { Theme } from "../../interface";
2
2
  import { TranscriptProps } from "../Transcript";
3
3
  export default function ResultGaugeCard({ result, theme, }: {
4
4
  result: TranscriptProps["result"];
@@ -5,7 +5,7 @@ declare const Transcript: {
5
5
  props: import("./design/Transcript").TranscriptProps;
6
6
  } & import("react").RefAttributes<HTMLDivElement>>;
7
7
  AdvancePaper: import("react").ForwardRefExoticComponent<{
8
- props: import("./design/Transcript").TranscriptProps;
8
+ props: import("./design/Transcript").TranscriptAdvancedProps;
9
9
  } & import("react").RefAttributes<HTMLDivElement>>;
10
10
  };
11
11
  export default Transcript;
@@ -0,0 +1,10 @@
1
+ export type Theme = "green" | "red";
2
+ export interface SectionBarProps {
3
+ title: string;
4
+ score: number;
5
+ subScore?: number;
6
+ total: number;
7
+ scale?: number;
8
+ script: string | string[];
9
+ subScripts?: string[];
10
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edu-tosel/design",
3
- "version": "1.0.200",
3
+ "version": "1.0.201",
4
4
  "description": "UI components for International TOSEL Committee",
5
5
  "keywords": [
6
6
  "jsx",
@@ -37,6 +37,10 @@ export default {
37
37
  green: "0 0px 10px 0px rgba(16, 86, 82, 0.38)",
38
38
  },
39
39
  keyframes: {
40
+ smallBounce: {
41
+ "0%, 100%": { transform: "translateY(-5%)" },
42
+ "50%": { transform: "translateY(0)" },
43
+ },
40
44
  grow: {
41
45
  "0%": { height: "60px" },
42
46
  "100%": { height: "120px" },
@@ -71,6 +75,7 @@ export default {
71
75
  animation: {
72
76
  grow: "grow 0.2s ease-in-out forwards",
73
77
  shrink: "shrink 0.2s ease-in-out forwards",
78
+ smallBounce: "smallBounce 1s infinite",
74
79
  },
75
80
 
76
81
  colors: {
package/version.txt CHANGED
@@ -1 +1 @@
1
- 1.0.200
1
+ 1.0.201
@@ -1 +0,0 @@
1
- export type Theme = "green" | "red";