@edu-tosel/design 1.0.266 → 1.0.267
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/asset/SVG.d.ts +4 -0
- package/asset/SVG.js +4 -0
- package/asset/SVG.tsx +4 -0
- package/asset/svg/MiniClose.d.ts +4 -0
- package/asset/svg/MiniClose.js +4 -0
- package/asset/svg/MiniClose.tsx +19 -0
- package/asset/svg/Search.d.ts +1 -0
- package/asset/svg/Search.js +4 -0
- package/asset/svg/Search.tsx +24 -0
- package/board/design/Header.design.d.ts +1 -1
- package/board/design/Header.design.js +12 -3
- package/globals.css +7 -2
- package/interface/Board.d.ts +11 -1
- package/layout/design/Shelf.design.js +2 -2
- package/layout/index.d.ts +0 -9
- package/layout/index.js +0 -9
- package/layout/template/home/Promotion.js +1 -0
- package/layout/template/home/Service.js +1 -0
- package/layout/template/home/layout/Carousel.js +27 -8
- package/layout/template/home/layout/Navigation.js +86 -12
- package/package.json +2 -2
- package/util/createSearch.d.ts +4 -7
- package/util/createSearch.js +208 -24
- package/util/index.d.ts +1 -1
- package/util/index.js +1 -1
- package/version.txt +1 -1
- package/widget/template/Input/index.js +8 -0
- package/layout/template/About/SectionA.d.ts +0 -1
- package/layout/template/About/SectionA.js +0 -51
- package/layout/template/About/SectionB.d.ts +0 -2
- package/layout/template/About/SectionB.js +0 -55
- package/layout/template/About/SectionC.d.ts +0 -1
- package/layout/template/About/SectionC.js +0 -35
- package/layout/template/About/SectionCCards.d.ts +0 -13
- package/layout/template/About/SectionCCards.js +0 -13
- package/layout/template/About/SectionCD.d.ts +0 -1
- package/layout/template/About/SectionCD.js +0 -15
- package/layout/template/About/SectionCLeaf.d.ts +0 -15
- package/layout/template/About/SectionCLeaf.js +0 -104
- package/layout/template/About/SectionD.d.ts +0 -1
- package/layout/template/About/SectionD.js +0 -131
- package/layout/template/About/SectionE.d.ts +0 -1
- package/layout/template/About/SectionE.js +0 -7
- package/layout/template/About/SectionECards.d.ts +0 -1
- package/layout/template/About/SectionECards.js +0 -79
- package/layout/template/About/SectionF.d.ts +0 -1
- package/layout/template/About/SectionF.js +0 -4
- package/layout/template/About/SectionG.d.ts +0 -10
- package/layout/template/About/SectionG.js +0 -27
- package/layout/template/About/index.d.ts +0 -19
- package/layout/template/About/index.js +0 -19
- package/layout/template/Books/Books.layout.d.ts +0 -1
- package/layout/template/Books/Books.layout.js +0 -13
- package/layout/template/Books/SectionA.d.ts +0 -2
- package/layout/template/Books/SectionA.js +0 -430
- package/layout/template/Books/index.d.ts +0 -5
- package/layout/template/Books/index.js +0 -5
- package/layout/template/MonthlyProgressReport/Layout.d.ts +0 -4
- package/layout/template/MonthlyProgressReport/Layout.js +0 -52
- package/layout/template/MonthlyProgressReport/Report.d.ts +0 -46
- package/layout/template/MonthlyProgressReport/Report.js +0 -124
- package/layout/template/MonthlyProgressReport/index.d.ts +0 -8
- package/layout/template/MonthlyProgressReport/index.js +0 -7
- package/layout/template/Olympiad/Banner.d.ts +0 -1
- package/layout/template/Olympiad/Banner.js +0 -31
- package/layout/template/Olympiad/Conditions.d.ts +0 -1
- package/layout/template/Olympiad/Conditions.js +0 -168
- package/layout/template/Olympiad/Features.d.ts +0 -1
- package/layout/template/Olympiad/Features.js +0 -44
- package/layout/template/Olympiad/Olympiad.layout.d.ts +0 -1
- package/layout/template/Olympiad/Olympiad.layout.js +0 -19
- package/layout/template/Olympiad/Prizes.d.ts +0 -1
- package/layout/template/Olympiad/Prizes.js +0 -49
- package/layout/template/Olympiad/Sponsors.d.ts +0 -1
- package/layout/template/Olympiad/Sponsors.js +0 -31
- package/layout/template/Olympiad/Videoset.d.ts +0 -1
- package/layout/template/Olympiad/Videoset.js +0 -71
- package/layout/template/Olympiad/index.d.ts +0 -15
- package/layout/template/Olympiad/index.js +0 -15
- package/layout/template/Regexam/Banner.d.ts +0 -1
- package/layout/template/Regexam/Banner.js +0 -183
- package/layout/template/Regexam/Evaluation.d.ts +0 -3
- package/layout/template/Regexam/Evaluation.js +0 -132
- package/layout/template/Regexam/OfflineExam.d.ts +0 -4
- package/layout/template/Regexam/OfflineExam.js +0 -204
- package/layout/template/Regexam/Regexam.layout.d.ts +0 -1
- package/layout/template/Regexam/Regexam.layout.js +0 -13
- package/layout/template/Regexam/Types.d.ts +0 -1
- package/layout/template/Regexam/Types.js +0 -294
- package/layout/template/Regexam/index.d.ts +0 -11
- package/layout/template/Regexam/index.js +0 -11
- package/layout/template/Transcript/Layout.d.ts +0 -6
- package/layout/template/Transcript/Layout.js +0 -52
- package/layout/template/Transcript/design/Transcript.d.ts +0 -228
- package/layout/template/Transcript/design/Transcript.design.d.ts +0 -13
- package/layout/template/Transcript/design/Transcript.design.js +0 -58
- package/layout/template/Transcript/design/Transcript.js +0 -181
- package/layout/template/Transcript/design/TranscriptAdvanced.design.d.ts +0 -5
- package/layout/template/Transcript/design/TranscriptAdvanced.design.js +0 -55
- package/layout/template/Transcript/design/atom/CardTitle.d.ts +0 -5
- package/layout/template/Transcript/design/atom/CardTitle.js +0 -13
- package/layout/template/Transcript/design/atom/CardTitleDivided.d.ts +0 -0
- package/layout/template/Transcript/design/atom/CardTitleDivided.js +0 -1
- package/layout/template/Transcript/design/atom/GetPartDescriptionFromLevel.d.ts +0 -3
- package/layout/template/Transcript/design/atom/GetPartDescriptionFromLevel.js +0 -4
- package/layout/template/Transcript/design/atom/GetPartTitleFromLevel.d.ts +0 -3
- package/layout/template/Transcript/design/atom/GetPartTitleFromLevel.js +0 -4
- package/layout/template/Transcript/design/atom/GetStyleFromLevel.d.ts +0 -2
- package/layout/template/Transcript/design/atom/GetStyleFromLevel.js +0 -4
- package/layout/template/Transcript/design/atom/LevelToPartDescriptionMap.d.ts +0 -6
- package/layout/template/Transcript/design/atom/LevelToPartDescriptionMap.js +0 -95
- package/layout/template/Transcript/design/atom/LevelToPartTitleMap.d.ts +0 -6
- package/layout/template/Transcript/design/atom/LevelToPartTitleMap.js +0 -95
- package/layout/template/Transcript/design/atom/LevelToStyleMap.d.ts +0 -6
- package/layout/template/Transcript/design/atom/LevelToStyleMap.js +0 -42
- package/layout/template/Transcript/design/atom/PrintBoxStyles.d.ts +0 -4
- package/layout/template/Transcript/design/atom/PrintBoxStyles.js +0 -4
- package/layout/template/Transcript/design/molecule/BarGraph.d.ts +0 -11
- package/layout/template/Transcript/design/molecule/BarGraph.js +0 -81
- package/layout/template/Transcript/design/molecule/BarGraphDuo.d.ts +0 -10
- package/layout/template/Transcript/design/molecule/BarGraphDuo.js +0 -6
- package/layout/template/Transcript/design/molecule/BarGraphMulti.d.ts +0 -11
- package/layout/template/Transcript/design/molecule/BarGraphMulti.js +0 -9
- package/layout/template/Transcript/design/molecule/CircularGauge.d.ts +0 -10
- package/layout/template/Transcript/design/molecule/CircularGauge.js +0 -68
- package/layout/template/Transcript/design/molecule/LSWRChart.d.ts +0 -11
- package/layout/template/Transcript/design/molecule/LSWRChart.js +0 -44
- package/layout/template/Transcript/design/molecule/LevelIndex.d.ts +0 -3
- package/layout/template/Transcript/design/molecule/LevelIndex.js +0 -14
- package/layout/template/Transcript/design/molecule/MIChart.d.ts +0 -1
- package/layout/template/Transcript/design/molecule/MIChart.js +0 -51
- package/layout/template/Transcript/design/molecule/OCIChart.d.ts +0 -1
- package/layout/template/Transcript/design/molecule/OCIChart.js +0 -60
- package/layout/template/Transcript/design/molecule/RadarGraph.d.ts +0 -10
- package/layout/template/Transcript/design/molecule/RadarGraph.js +0 -5
- package/layout/template/Transcript/design/organism/BarCardCol.d.ts +0 -8
- package/layout/template/Transcript/design/organism/BarCardCol.js +0 -30
- package/layout/template/Transcript/design/organism/BarCardRow.d.ts +0 -8
- package/layout/template/Transcript/design/organism/BarCardRow.js +0 -30
- package/layout/template/Transcript/design/organism/HonorCard.d.ts +0 -4
- package/layout/template/Transcript/design/organism/HonorCard.js +0 -16
- package/layout/template/Transcript/design/organism/IdCard.d.ts +0 -8
- package/layout/template/Transcript/design/organism/IdCard.js +0 -64
- package/layout/template/Transcript/design/organism/IntelligenceCard.d.ts +0 -12
- package/layout/template/Transcript/design/organism/IntelligenceCard.js +0 -39
- package/layout/template/Transcript/design/organism/NationalPositionCard.d.ts +0 -4
- package/layout/template/Transcript/design/organism/NationalPositionCard.js +0 -14
- package/layout/template/Transcript/design/organism/OCICard.d.ts +0 -4
- package/layout/template/Transcript/design/organism/OCICard.js +0 -17
- package/layout/template/Transcript/design/organism/PerformanceCard.d.ts +0 -5
- package/layout/template/Transcript/design/organism/PerformanceCard.js +0 -25
- package/layout/template/Transcript/design/organism/RadarCard.d.ts +0 -7
- package/layout/template/Transcript/design/organism/RadarCard.js +0 -54
- package/layout/template/Transcript/design/organism/ResultGaugeCard.d.ts +0 -7
- package/layout/template/Transcript/design/organism/ResultGaugeCard.js +0 -19
- package/layout/template/Transcript/design/organism/ScoreCard.d.ts +0 -4
- package/layout/template/Transcript/design/organism/ScoreCard.js +0 -11
- package/layout/template/Transcript/design/organism/SectionRadarCard.d.ts +0 -8
- package/layout/template/Transcript/design/organism/SectionRadarCard.js +0 -42
- package/layout/template/Transcript/index.d.ts +0 -11
- package/layout/template/Transcript/index.js +0 -9
- package/layout/template/Transcript/interface.d.ts +0 -50
- package/layout/template/Transcript/interface.js +0 -1
package/asset/SVG.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ import TOSEL from "./svg/TOSEL";
|
|
|
10
10
|
import HallofFame from "./svg/HallofFame";
|
|
11
11
|
import Print from "./svg/Print";
|
|
12
12
|
import User from "./svg/User";
|
|
13
|
+
import Search from "./svg/Search";
|
|
14
|
+
import MiniClose from "./svg/MiniClose";
|
|
13
15
|
declare const SVG: {
|
|
14
16
|
TOSEL: typeof TOSEL;
|
|
15
17
|
Close: typeof Close;
|
|
@@ -63,5 +65,7 @@ declare const SVG: {
|
|
|
63
65
|
};
|
|
64
66
|
HallofFame: typeof HallofFame;
|
|
65
67
|
User: typeof User;
|
|
68
|
+
Search: typeof Search;
|
|
69
|
+
MiniClose: typeof MiniClose;
|
|
66
70
|
};
|
|
67
71
|
export default SVG;
|
package/asset/SVG.js
CHANGED
|
@@ -15,6 +15,8 @@ import Collab from "./svg/Collab";
|
|
|
15
15
|
import HallofFame from "./svg/HallofFame";
|
|
16
16
|
import Print from "./svg/Print";
|
|
17
17
|
import User from "./svg/User";
|
|
18
|
+
import Search from "./svg/Search";
|
|
19
|
+
import MiniClose from "./svg/MiniClose";
|
|
18
20
|
const SVG = {
|
|
19
21
|
TOSEL,
|
|
20
22
|
Close,
|
|
@@ -33,5 +35,7 @@ const SVG = {
|
|
|
33
35
|
Collab,
|
|
34
36
|
HallofFame,
|
|
35
37
|
User,
|
|
38
|
+
Search,
|
|
39
|
+
MiniClose,
|
|
36
40
|
};
|
|
37
41
|
export default SVG;
|
package/asset/SVG.tsx
CHANGED
|
@@ -15,6 +15,8 @@ import Collab from "./svg/Collab";
|
|
|
15
15
|
import HallofFame from "./svg/HallofFame";
|
|
16
16
|
import Print from "./svg/Print";
|
|
17
17
|
import User from "./svg/User";
|
|
18
|
+
import Search from "./svg/Search";
|
|
19
|
+
import MiniClose from "./svg/MiniClose";
|
|
18
20
|
|
|
19
21
|
const SVG = {
|
|
20
22
|
TOSEL,
|
|
@@ -34,6 +36,8 @@ const SVG = {
|
|
|
34
36
|
Collab,
|
|
35
37
|
HallofFame,
|
|
36
38
|
User,
|
|
39
|
+
Search,
|
|
40
|
+
MiniClose,
|
|
37
41
|
};
|
|
38
42
|
|
|
39
43
|
export default SVG;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export default function MiniClose({ onClick }) {
|
|
3
|
+
return (_jsx("svg", { onClick: onClick, xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", fill: "currentColor", className: "size-5", children: _jsx("path", { "fill-rule": "evenodd", d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM8.28 7.22a.75.75 0 0 0-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 1 0 1.06 1.06L10 11.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L11.06 10l1.72-1.72a.75.75 0 0 0-1.06-1.06L10 8.94 8.28 7.22Z", "clip-rule": "evenodd" }) }));
|
|
4
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { OnClick } from "../../interface";
|
|
2
|
+
|
|
3
|
+
export default function MiniClose({ onClick }: { onClick?: OnClick }) {
|
|
4
|
+
return (
|
|
5
|
+
<svg
|
|
6
|
+
onClick={onClick}
|
|
7
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
8
|
+
viewBox="0 0 20 20"
|
|
9
|
+
fill="currentColor"
|
|
10
|
+
className="size-5"
|
|
11
|
+
>
|
|
12
|
+
<path
|
|
13
|
+
fill-rule="evenodd"
|
|
14
|
+
d="M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM8.28 7.22a.75.75 0 0 0-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 1 0 1.06 1.06L10 11.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L11.06 10l1.72-1.72a.75.75 0 0 0-1.06-1.06L10 8.94 8.28 7.22Z"
|
|
15
|
+
clip-rule="evenodd"
|
|
16
|
+
/>
|
|
17
|
+
</svg>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function Search(): 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 Search() {
|
|
3
|
+
return (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", fill: "none", children: [_jsx("path", { "vector-effect": "non-scaling-stroke", d: "m19 19-3.5-3.5", stroke: "#475569", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }), _jsx("circle", { "vector-effect": "non-scaling-stroke", cx: "11", cy: "11", r: "6", stroke: "#475569", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" })] }));
|
|
4
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export default function Search() {
|
|
2
|
+
return (
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none">
|
|
4
|
+
<path
|
|
5
|
+
vector-effect="non-scaling-stroke"
|
|
6
|
+
d="m19 19-3.5-3.5"
|
|
7
|
+
stroke="#475569"
|
|
8
|
+
stroke-width="2"
|
|
9
|
+
stroke-linecap="round"
|
|
10
|
+
stroke-linejoin="round"
|
|
11
|
+
/>
|
|
12
|
+
<circle
|
|
13
|
+
vector-effect="non-scaling-stroke"
|
|
14
|
+
cx="11"
|
|
15
|
+
cy="11"
|
|
16
|
+
r="6"
|
|
17
|
+
stroke="#475569"
|
|
18
|
+
stroke-width="2"
|
|
19
|
+
stroke-linecap="round"
|
|
20
|
+
stroke-linejoin="round"
|
|
21
|
+
/>
|
|
22
|
+
</svg>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { BoardHeaderProps } from "../../interface/Board";
|
|
2
|
-
export default function BoardHeader<B>({ titles, tag, option, }: BoardHeaderProps<B>): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function BoardHeader<B>({ titles, tag, widgets, option, }: BoardHeaderProps<B>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,18 +1,27 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "../../util";
|
|
3
3
|
import { Input, Select } from "../../widget";
|
|
4
|
-
export default function BoardHeader({ titles, tag, option, }) {
|
|
4
|
+
export default function BoardHeader({ titles, tag, widgets, option, }) {
|
|
5
5
|
const { title, icon, titleColor } = titles ?? {};
|
|
6
6
|
const { selects, inputs } = tag ?? {};
|
|
7
7
|
const { background, text, boundary } = option ?? {};
|
|
8
8
|
const container = {
|
|
9
9
|
positions: "top-0 left-0 z-30 relative flex items-center",
|
|
10
|
-
paddings: "px-7.5",
|
|
10
|
+
paddings: "px-3.5 md:px-7.5",
|
|
11
11
|
backgrounds: background ?? "bg-white",
|
|
12
12
|
texts: text ?? "text-black",
|
|
13
13
|
sizes: "w-full h-15",
|
|
14
14
|
boundary: boundary ?? "border-b-2 border-green-dark ",
|
|
15
15
|
rounded: "xl:rounded-t-xl",
|
|
16
16
|
};
|
|
17
|
-
return (_jsx(_Fragment, { children: _jsxs("div", { className: cn(container), children: [_jsxs("div", { className: "flex items-center gap-2.5", children: [icon && _jsx("img", { src: icon, className: "fill-blue-500" }), _jsx("div", { className: `text-2xl font-pretendard-bold ${titleColor}`, children: title })] }), _jsxs("div", { className: "relative flex items-center ml-auto gap-4", children: [selects?.map(({ selectOptions, option, state }) => (_jsx(Select, { option: option, selectOptions: selectOptions, state: state }, title))), inputs?.map((prop, index) => (_jsx(Input, { ...prop }, index)))] })] }) }));
|
|
17
|
+
return (_jsx(_Fragment, { children: _jsxs("div", { className: cn(container), children: [_jsxs("div", { className: "flex items-center gap-2.5", children: [icon && _jsx("img", { src: icon, className: "fill-blue-500" }), _jsx("div", { className: `text-2xl font-pretendard-bold ${titleColor}`, children: title })] }), _jsxs("div", { className: "relative flex items-center ml-auto gap-4", children: [widgets?.map((Widget, index) => (_jsx(HeaderWidgetRender, { ...Widget }, index))), selects?.map(({ selectOptions, option, state }) => (_jsx(Select, { option: option, selectOptions: selectOptions, state: state }, title))), inputs?.map((prop, index) => (_jsx(Input, { ...prop }, index)))] })] }) }));
|
|
18
|
+
}
|
|
19
|
+
function HeaderWidgetRender(props) {
|
|
20
|
+
if (props.type === "input") {
|
|
21
|
+
return _jsx(Input, { ...props.data });
|
|
22
|
+
}
|
|
23
|
+
if (props.type === "select") {
|
|
24
|
+
return _jsx(Select, { ...props.data });
|
|
25
|
+
}
|
|
26
|
+
return null;
|
|
18
27
|
}
|
package/globals.css
CHANGED
|
@@ -82,8 +82,6 @@ input[type="date"]::-webkit-calendar-picker-indicator {
|
|
|
82
82
|
.box-shadow-sm {
|
|
83
83
|
box-shadow: 0px 0px 15px 0px rgba(0, 0, 0, 0.1);
|
|
84
84
|
}
|
|
85
|
-
.border-gradient-green-to-red {
|
|
86
|
-
}
|
|
87
85
|
|
|
88
86
|
.x-shape {
|
|
89
87
|
position: relative;
|
|
@@ -274,3 +272,10 @@ input[type="date"]::-webkit-calendar-picker-indicator {
|
|
|
274
272
|
-webkit-font-smoothing: antialiased;
|
|
275
273
|
-moz-osx-font-smoothing: grayscale;
|
|
276
274
|
}
|
|
275
|
+
|
|
276
|
+
.stacking-context {
|
|
277
|
+
-webkit-mask-image: -webkit-radial-gradient(white, black);
|
|
278
|
+
mask-image: radial-gradient(white, black);
|
|
279
|
+
-webkit-mask-composite: destination-in;
|
|
280
|
+
mask-composite: intersect;
|
|
281
|
+
}
|
package/interface/Board.d.ts
CHANGED
|
@@ -21,8 +21,17 @@ export interface BoardProps<B> {
|
|
|
21
21
|
option?: BoardOption;
|
|
22
22
|
debug?: string;
|
|
23
23
|
buttons?: LabelWidget[];
|
|
24
|
-
isUnderGallery?:
|
|
24
|
+
isUnderGallery?: boolean;
|
|
25
25
|
}
|
|
26
|
+
interface HeaderInputWidget {
|
|
27
|
+
type: "input";
|
|
28
|
+
data: InputWidget;
|
|
29
|
+
}
|
|
30
|
+
interface HeaderSelectWidget<B> {
|
|
31
|
+
type: "select";
|
|
32
|
+
data: SelectWidget<B>;
|
|
33
|
+
}
|
|
34
|
+
export type HeaderWidgetType<B> = HeaderInputWidget | HeaderSelectWidget<B>;
|
|
26
35
|
export interface BoardHeaderProps<B> {
|
|
27
36
|
titles?: Omit<Titles, "subtitle"> & {
|
|
28
37
|
icon?: string;
|
|
@@ -31,6 +40,7 @@ export interface BoardHeaderProps<B> {
|
|
|
31
40
|
selects?: SelectWidget<B>[];
|
|
32
41
|
inputs?: InputWidget[];
|
|
33
42
|
};
|
|
43
|
+
widgets?: HeaderWidgetType<B>[];
|
|
34
44
|
option?: {
|
|
35
45
|
background?: string;
|
|
36
46
|
text?: string;
|
|
@@ -6,8 +6,8 @@ export default function Shelf({ children, className, option, titles, debug, }) {
|
|
|
6
6
|
const { titleSize, subtitleSize, isSize, width, height } = option ?? {};
|
|
7
7
|
const container = {
|
|
8
8
|
displays: "flex flex-col gap-6",
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
optionWidth: width ?? "w-full xl:w-auto",
|
|
10
|
+
optionHeight: height ?? "h-fit",
|
|
11
11
|
sizes: isSize && "w-full h-fit",
|
|
12
12
|
debug: debug && isDebug(`border-2 ${debug}`),
|
|
13
13
|
};
|
package/layout/index.d.ts
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
export { default as Action } from "./template/Action";
|
|
2
|
-
export { default as About } from "./template/About";
|
|
3
2
|
export { default as Announcement } from "./template/Announcement";
|
|
4
3
|
export { default as Archive } from "./template/Archive";
|
|
5
|
-
export { default as Books } from "./template/Books";
|
|
6
4
|
export { default as Home } from "./template/home";
|
|
7
5
|
export * from "./template/dashboard";
|
|
8
6
|
export { default as Event } from "./template/Event";
|
|
9
|
-
export { default as Olympiad } from "./template/Olympiad";
|
|
10
|
-
export { default as Regexam } from "./template/Regexam";
|
|
11
7
|
export { default as Legacy } from "./template/Legacy";
|
|
12
8
|
export { default as Sign } from "./template/Sign";
|
|
13
9
|
export { default as DataField } from "./template/DataField";
|
|
@@ -16,10 +12,5 @@ export { default as Row } from "./template/Row";
|
|
|
16
12
|
export { default as Shelf } from "./template/Shelf";
|
|
17
13
|
export { default as Tab } from "./template/Tab";
|
|
18
14
|
export { default as TextBox } from "./template/TextBox";
|
|
19
|
-
export { default as OlympiadLayout } from "./template/Olympiad/Olympiad.layout";
|
|
20
|
-
export { default as RegexamLayout } from "./template/Regexam/Regexam.layout";
|
|
21
|
-
export { default as BooksLayout } from "./template/Books/Books.layout";
|
|
22
15
|
export { default as LegacyLayout } from "./template/Legacy/Legacy.layout";
|
|
23
|
-
export { default as MonthlyProgressReport } from "./template/MonthlyProgressReport";
|
|
24
|
-
export { default as Transcript } from "./template/Transcript";
|
|
25
16
|
export { default as Ticket } from "./template/Ticket";
|
package/layout/index.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
export { default as Action } from "./template/Action";
|
|
2
|
-
export { default as About } from "./template/About";
|
|
3
2
|
export { default as Announcement } from "./template/Announcement";
|
|
4
3
|
export { default as Archive } from "./template/Archive";
|
|
5
|
-
export { default as Books } from "./template/Books";
|
|
6
4
|
export { default as Home } from "./template/home";
|
|
7
5
|
export * from "./template/dashboard";
|
|
8
6
|
export { default as Event } from "./template/Event";
|
|
9
|
-
export { default as Olympiad } from "./template/Olympiad";
|
|
10
|
-
export { default as Regexam } from "./template/Regexam";
|
|
11
7
|
export { default as Legacy } from "./template/Legacy";
|
|
12
8
|
export { default as Sign } from "./template/Sign";
|
|
13
9
|
export { default as DataField } from "./template/DataField";
|
|
@@ -16,10 +12,5 @@ export { default as Row } from "./template/Row";
|
|
|
16
12
|
export { default as Shelf } from "./template/Shelf";
|
|
17
13
|
export { default as Tab } from "./template/Tab";
|
|
18
14
|
export { default as TextBox } from "./template/TextBox";
|
|
19
|
-
export { default as OlympiadLayout } from "./template/Olympiad/Olympiad.layout";
|
|
20
|
-
export { default as RegexamLayout } from "./template/Regexam/Regexam.layout";
|
|
21
|
-
export { default as BooksLayout } from "./template/Books/Books.layout";
|
|
22
15
|
export { default as LegacyLayout } from "./template/Legacy/Legacy.layout";
|
|
23
|
-
export { default as MonthlyProgressReport } from "./template/MonthlyProgressReport";
|
|
24
|
-
export { default as Transcript } from "./template/Transcript";
|
|
25
16
|
export { default as Ticket } from "./template/Ticket";
|
|
@@ -87,6 +87,7 @@ function Banner({ onClick, image, option }) {
|
|
|
87
87
|
displays: "absolute",
|
|
88
88
|
positions: "bottom-0 left-0",
|
|
89
89
|
background: `bg-cover bg-center`,
|
|
90
|
+
boundaries: "rounded-xl md:rounded-2xl",
|
|
90
91
|
};
|
|
91
92
|
return (_jsx("div", { className: cn(ghostCard), children: _jsx("div", { className: cn(card), onClick: onClick, children: _jsx("div", { className: cn(imageWrapper), style: { backgroundImage: `url(${image?.src})` } }) }) }));
|
|
92
93
|
}
|
|
@@ -101,6 +101,7 @@ function Banner({ titles, onClick, image, option }) {
|
|
|
101
101
|
displays: "absolute",
|
|
102
102
|
positions: "bottom-0 left-0",
|
|
103
103
|
background: `bg-cover bg-center`,
|
|
104
|
+
boundaries: "rounded-xl md:rounded-2xl",
|
|
104
105
|
};
|
|
105
106
|
return (_jsx("div", { className: cn(ghostCard), children: _jsxs("div", { className: cn(card), onClick: onClick, children: [_jsx("div", { className: cn(imageWrapper), style: { backgroundImage: `url(${image?.src})` } }), _jsxs("div", { className: cn(titleBox.container), children: [_jsx("div", { className: cn(titleBox.subtitle), children: titles.subtitle }), _jsx("div", { className: cn(titleBox.title), children: titles.title })] })] }) }));
|
|
106
107
|
}
|
|
@@ -62,9 +62,23 @@ export default function Carousel({ contents, }) {
|
|
|
62
62
|
background,
|
|
63
63
|
animations: "duration-300",
|
|
64
64
|
};
|
|
65
|
+
const titleWrapper = {
|
|
66
|
+
displays: "flex flex-col xxs:flex-row xxs:items-center md:items-start md:flex-col",
|
|
67
|
+
sizes: "w-full h-fit xxs:w-fit md:w-72",
|
|
68
|
+
spacings: "mt-4 px-5 xxs:mt-8 xxs:gap-8 md:p-0 md:mt-0 md:gap-6 md:pl-7.5",
|
|
69
|
+
animations: "duration-500",
|
|
70
|
+
//debug: "border-red-500 border-2",
|
|
71
|
+
};
|
|
65
72
|
const titleSet = {
|
|
66
|
-
displays: "flex
|
|
73
|
+
displays: "flex flex gap-4 flex-row justify-start xxs:justify-center xxs:gap-4 xxs:items-start xxs:flex-col xxs:shrink-0 md:gap-2",
|
|
67
74
|
sizes: "w-fit md:w-full h-fit",
|
|
75
|
+
//debug: "border-2 border-green-500",
|
|
76
|
+
};
|
|
77
|
+
const subtitleStyles = {
|
|
78
|
+
displays: "flex flex-col justify-center",
|
|
79
|
+
sizes: "w-full h-10 xxs:w-fit xxs:h-fit",
|
|
80
|
+
spacings: "my-2 xxs:mt-0",
|
|
81
|
+
textStyles: "text-sm md:text-base break-keep",
|
|
68
82
|
};
|
|
69
83
|
const body = {
|
|
70
84
|
displays: "flex flex-none flex-col items-center justify-center md:flex-row",
|
|
@@ -73,21 +87,26 @@ export default function Carousel({ contents, }) {
|
|
|
73
87
|
animations: "duration-500",
|
|
74
88
|
};
|
|
75
89
|
const tagBox = {
|
|
76
|
-
displays: "flex justify-center items-center",
|
|
90
|
+
displays: "flex justify-center items-center shrink-0",
|
|
77
91
|
sizes: "w-fit h-fit px-2 py-1 md:px-2.5 md:py-1.5",
|
|
78
92
|
background: tag.background,
|
|
79
93
|
fonts: "text-white font-pretendard-medium text-sm md:text-base leading-none",
|
|
80
94
|
styles: "rounded-md",
|
|
81
95
|
};
|
|
96
|
+
const buttonBoxPosition = {
|
|
97
|
+
display: "absolute flex justify-center items-center md:static md:justify-start",
|
|
98
|
+
sizes: "w-full h-fit left-0 bottom-0 z-10",
|
|
99
|
+
spacings: "ml-0 md:ml-10 xm:ml-0",
|
|
100
|
+
};
|
|
82
101
|
const buttonBox = {
|
|
102
|
+
displays: "relative justify-center items-center gap-1 flex z-10",
|
|
83
103
|
animations: "duration-500",
|
|
84
|
-
|
|
85
|
-
sizes: "w-30 h-10 md:h-6.25 md:w-23.25 bg-gray-dark rounded-full",
|
|
104
|
+
sizes: "w-34 h-10 md:h-6.25 md:w-26 bg-gray-dark rounded-full",
|
|
86
105
|
paddings: "px-1.5 mt-0 mb-5 md:mt-12 ",
|
|
87
106
|
};
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
sizes: "w-full h-
|
|
107
|
+
const handlePosition = {
|
|
108
|
+
displays: "absolute flex justify-between items-center",
|
|
109
|
+
sizes: "w-full h-full",
|
|
91
110
|
};
|
|
92
|
-
return (_jsx("div", { onClick: contents[index].onClick, className: cn(container), children: _jsxs("div", { className: cn(body), children: [_jsxs("div", { className:
|
|
111
|
+
return (_jsx("div", { onClick: contents[index].onClick, className: cn(container), children: _jsxs("div", { className: cn(body), children: [_jsxs("div", { className: cn(titleWrapper), children: [_jsxs("div", { className: cn(titleSet), children: [_jsx("div", { className: cn(tagBox), children: tagString[tag.type] }), _jsx("div", { className: "font-pretendard-bold text-xl md:text-2xl", children: titles.title })] }), _jsx(LineBreaks, { className: cn(subtitleStyles), texts: titles.subtitle }), _jsx("div", { className: cn(buttonBoxPosition), onClick: (e) => e.stopPropagation(), children: _jsxs("div", { className: cn(buttonBox), children: [_jsxs("div", { className: cn(handlePosition), children: [_jsx("button", { onClick: handlePrev, className: "w-10 md:w-6 h-full flex justify-center items-center", children: _jsx(SVG.Symbol.LessThan, {}) }), _jsx("button", { onClick: handleNext, className: "w-10 md:w-6 h-full flex justify-center items-center", children: _jsx(SVG.Symbol.GreaterThan, {}) })] }), _jsxs("div", { className: "flex flex-row md:gap-2 gap-4 justify-center items-center", children: [_jsx("div", { className: "text-white w-4 text-sm text-center", children: index + 1 }), _jsx("div", { className: "w-0.5 h-3 bg-gray-medium" }), _jsx("div", { className: "text-white w-4 text-sm text-center", children: contents.length })] })] }) })] }), _jsx("div", { className: "h-full overflow-hidden w-fit image-container", children: image && (_jsx(animated.img, { src: image, alt: "carousel-image", onLoad: () => setLoaded(true), className: "object-cover h-full z-0", style: transitionStyles })) })] }) }));
|
|
93
112
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
2
|
+
import { useEffect, useRef, useState } from "react";
|
|
3
3
|
import { animated, useTransition } from "react-spring";
|
|
4
4
|
import SVG from "../../../../asset/SVG";
|
|
5
|
-
import { cn, compareDates, convertDateToString } from "../../../../util";
|
|
5
|
+
import { cn, compareDates, convertDateToString, search, } from "../../../../util";
|
|
6
6
|
import { useActionStore } from "../../../../store";
|
|
7
7
|
import { useResponsive } from "../../../../hook";
|
|
8
8
|
export default function Navigation({ browser, calendar, notice, event, }) {
|
|
@@ -57,7 +57,7 @@ export default function Navigation({ browser, calendar, notice, event, }) {
|
|
|
57
57
|
setIsHidden(true);
|
|
58
58
|
return setIsOpen(true);
|
|
59
59
|
};
|
|
60
|
-
const
|
|
60
|
+
const blurContainer = {
|
|
61
61
|
positions: "fixed inset-0 z-40",
|
|
62
62
|
sizes: "h-screen w-full",
|
|
63
63
|
boundaries: "md:pl-[56px]",
|
|
@@ -69,15 +69,19 @@ export default function Navigation({ browser, calendar, notice, event, }) {
|
|
|
69
69
|
};
|
|
70
70
|
const itemBody = {
|
|
71
71
|
positions: "absolute bottom-16 md:static md:bottom-auto md:flex md:flex-col",
|
|
72
|
-
sizes: "w-full md:w-[400px] h-fit md:h-screen min-h-50",
|
|
72
|
+
sizes: "w-full md:w-[400px] h-fit md:h-screen min-h-50 ",
|
|
73
73
|
styles: "bg-white",
|
|
74
74
|
animation: "duration-300",
|
|
75
|
+
boundaries: "rounded-t-lg rounded-b-none md:rounded-r-lg md:rounded-l-none",
|
|
75
76
|
};
|
|
76
77
|
const iconWrapper = {
|
|
77
78
|
displays: "flex justify-center items-center",
|
|
78
79
|
sizes: "w-8 h-8 rounded-md",
|
|
79
80
|
animations: "hover:bg-white/20",
|
|
80
81
|
};
|
|
82
|
+
const itemsContainer = {
|
|
83
|
+
displays: "relative h-fit md:h-full overflow-hidden duration-300",
|
|
84
|
+
};
|
|
81
85
|
const isMobile = useResponsive("md");
|
|
82
86
|
const overlayPopTransition = useTransition(!isHidden && isOpen, {
|
|
83
87
|
from: { width: "100%", opacity: 0, pointerEvent: "none" },
|
|
@@ -87,25 +91,30 @@ export default function Navigation({ browser, calendar, notice, event, }) {
|
|
|
87
91
|
delay: 100,
|
|
88
92
|
});
|
|
89
93
|
const scrollTitleWrapper = {
|
|
90
|
-
displays: "
|
|
94
|
+
displays: "relative",
|
|
95
|
+
sizes: "w-full h-fit",
|
|
91
96
|
spacings: "p-5 pb-0",
|
|
92
97
|
};
|
|
93
98
|
const scrollTitle = {
|
|
94
99
|
textStyles: "text-lg font-bold text-green-dark",
|
|
95
100
|
};
|
|
101
|
+
const itemBodyTransition = useTransition(isOpen && !isMobile, {
|
|
102
|
+
from: { transform: "translateY(100%)", opacity: 0 },
|
|
103
|
+
enter: { transform: "translateY(0%)", opacity: 1 },
|
|
104
|
+
leave: { transform: "translateY(100%)", opacity: 0 },
|
|
105
|
+
config: { duration: 300 },
|
|
106
|
+
});
|
|
96
107
|
return (_jsxs(_Fragment, { children: [overlayCoverTransition((styles, item) => item && (_jsx(animated.div, { style: styles, className: "bg-white h-screen fixed top-0 left-0 z-40 flex flex-col justify-center items-center overflow-hidden gap-y-14 ", children: _jsxs("div", { className: "flex flex-col justify-center items-center overflow-hidden gap-y-14 transition-none", children: [_jsx("img", { src: "/images/logos/tosel.png", alt: "tosel", width: 368.56, height: 80.07 }), _jsx("div", { children: "dashboard loading..." })] }) }))), overlayPopTransition((styles, item) => type &&
|
|
97
|
-
item && (_jsx(animated.div, { style: styles, className: cn(
|
|
108
|
+
item && (_jsx(animated.div, { style: styles, className: cn(blurContainer), children: _jsxs("div", { className: cn(itemBody), onClick: (e) => e.stopPropagation(), children: [_jsxs("div", { className: cn(scrollTitleWrapper), children: [_jsx("div", { className: cn(scrollTitle), children: navigationTypeString[type] }), _jsx("div", { className: "" })] }), _jsx("div", { className: cn(itemsContainer), children: _jsx(NavigationItem, { type: type, calendar: calendar, notice: notice, event: event }) })] }) }))), _jsx("div", { className: "fixed bottom-0 md:top-1/2 md:-translate-y-1/2 flex justify-center items-center z-45", children: _jsxs("div", { onClick: (e) => e.stopPropagation(), className: cn(container), children: [_jsx("div", { className: cn(iconWrapper), onClick: () => handleOpen("calendar"), children: _jsx(SVG.Icon.Calendar, { size: isMobile ? "md" : "lg" }) }), _jsx("div", { className: cn(iconWrapper), onClick: () => handleOpen("notification"), children: _jsx(SVG.Icon.Notification, { size: isMobile ? "md" : "lg" }) }), _jsx("div", { className: cn(iconWrapper), onClick: () => handleOpen("search"), children: _jsx(SVG.Icon.Search, { size: isMobile ? "md" : "lg" }) }), _jsx("div", { className: cn(iconWrapper), onClick: () => handleOpen("browser"), children: _jsx(SVG.Icon.Browser, { size: isMobile ? "md" : "lg" }) }), _jsx("div", { className: cn(iconWrapper), onClick: () => handleOpen("event"), children: _jsx(SVG.Icon.Event, { size: isMobile ? "md" : "lg" }) })] }) })] }));
|
|
98
109
|
}
|
|
99
110
|
const navigationTypeString = {
|
|
100
111
|
calendar: "시험 접수 일정",
|
|
101
112
|
notification: "공지사항",
|
|
102
113
|
event: "이벤트",
|
|
114
|
+
search: "검색하기",
|
|
103
115
|
};
|
|
104
116
|
function NavigationItem({ type, calendar, notice, event, }) {
|
|
105
117
|
//scroll action
|
|
106
|
-
const container = {
|
|
107
|
-
displays: "relative h-fit overflow-hidden duration-300",
|
|
108
|
-
};
|
|
109
118
|
const scrollWrapper = {
|
|
110
119
|
displays: "flex flex-row md:flex-col",
|
|
111
120
|
sizss: "h-fit md:h-full",
|
|
@@ -175,13 +184,78 @@ function NavigationItem({ type, calendar, notice, event, }) {
|
|
|
175
184
|
setScheduleState(updatedScheduleState);
|
|
176
185
|
}, [currentTime, calendar.schedules]);
|
|
177
186
|
if (type === "calendar")
|
|
178
|
-
return (_jsxs(
|
|
187
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: cn(scrollWrapper), children: calendar.schedules.map(({ applyEnd, testStart, gradeOpen, title, onClick }, index) => {
|
|
179
188
|
const { isBeforeStart, dDayStart, isBeforeEnd, dDayEnd } = scheduleState[index];
|
|
180
189
|
return (_jsxs("div", { onClick: onClick, className: cn(item, "rounded-[8px] p-5 bg-gray-light/30 border-1 border-gray-light"), children: [_jsxs("div", { className: "flex flex-col gap-2", children: [_jsxs("div", { className: cn(titleWrapper), children: [_jsx("div", { className: cn(titleText), children: title }), _jsx("div", { children: isBeforeStart ? (_jsxs("div", { className: cn(tag, "bg-red-burgundy"), children: ["\uC811\uC218\uAE4C\uC9C0 ", dDayStart] })) : isBeforeEnd ? (_jsx("div", { className: cn(tag, "bg-green-dark"), children: "\uC811\uC218 \uC911" })) : (_jsx("div", { className: cn(tag, "bg-gray-medium/30"), children: "\uB9C8\uAC10" })) })] }), !isBeforeStart && isBeforeEnd ? (_jsxs("div", { className: "text-xs", children: ["\uC811\uC218 \uB9C8\uAC10\uAE4C\uC9C0 ", dDayEnd] })) : (""), _jsx("div", { className: "w-full h-0.5 bg-gray-medium" })] }), _jsxs("div", { className: "flex flex-col gap-1 w-full h-fit mt-4", children: [_jsxs("div", { className: cn(dateWrapper), children: [_jsxs("svg", { ...svgAttributes, children: [_jsx("path", { "fill-rule": "evenodd", d: "M11.986 3H12a2 2 0 0 1 2 2v6a2 2 0 0 1-1.5 1.937V7A2.5 2.5 0 0 0 10 4.5H4.063A2 2 0 0 1 6 3h.014A2.25 2.25 0 0 1 8.25 1h1.5a2.25 2.25 0 0 1 2.236 2ZM10.5 4v-.75a.75.75 0 0 0-.75-.75h-1.5a.75.75 0 0 0-.75.75V4h3Z", "clip-rule": "evenodd" }), _jsx("path", { "fill-rule": "evenodd", d: "M2 7a1 1 0 0 1 1-1h7a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V7Zm6.585 1.08a.75.75 0 0 1 .336 1.005l-1.75 3.5a.75.75 0 0 1-1.16.234l-1.75-1.5a.75.75 0 0 1 .977-1.139l1.02.875 1.321-2.64a.75.75 0 0 1 1.006-.336Z", "clip-rule": "evenodd" })] }), _jsx("div", { className: cn(paragraphText), children: "\uC811\uC218\uB9C8\uAC10" }), _jsx("div", { className: cn(paragraphText), children: convertDateToString(applyEnd) })] }), _jsxs("div", { className: cn(dateWrapper), children: [_jsx("svg", { ...svgAttributes, children: _jsx("path", { "fill-rule": "evenodd", d: "M4 1.75a.75.75 0 0 1 1.5 0V3h5V1.75a.75.75 0 0 1 1.5 0V3a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2V1.75ZM4.5 6a1 1 0 0 0-1 1v4.5a1 1 0 0 0 1 1h7a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1h-7Z", "clip-rule": "evenodd" }) }), _jsx("div", { className: cn(paragraphText), children: "\uC2DC\uD5D8\uC77C\uC790" }), _jsx("div", { className: cn(paragraphText), children: convertDateToString(testStart) })] }), _jsxs("div", { className: cn(dateWrapper), children: [_jsxs("svg", { ...svgAttributes, children: [_jsx("path", { "fill-rule": "evenodd", d: "M10 3a1 1 0 0 0-1-1H3a1 1 0 0 0-1 1v9a2 2 0 0 0 2 2h8a2 2 0 0 1-2-2V3ZM4 4h4v2H4V4Zm4 3.5H4V9h4V7.5Zm-4 3h4V12H4v-1.5Z", "clip-rule": "evenodd" }), _jsx("path", { d: "M13 5h-1.5v6.25a1.25 1.25 0 1 0 2.5 0V6a1 1 0 0 0-1-1Z" })] }), _jsx("div", { className: cn(paragraphText), children: "\uC131\uC801\uBC1C\uD45C" }), _jsx("div", { className: cn(paragraphText), children: convertDateToString(gradeOpen) })] })] })] }));
|
|
181
190
|
}) }), _jsx("div", { className: cn(softBox) })] }));
|
|
182
191
|
if (type === "notification")
|
|
183
|
-
return (_jsxs(
|
|
192
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: cn(scrollWrapper), children: notice.announcements.map(({ title, date, description, onClick }) => (_jsxs("div", { onClick: onClick, className: cn(item, "h-fit shadow-main p-5 "), children: [_jsxs("div", { children: [_jsx("div", { className: "text-[15px] text-gray-medium", children: date }), _jsx("div", { className: cn(titleText, "mb-2"), children: title })] }), _jsx("p", { className: cn(paragraphText, "truncate h-fit"), children: description })] }))) }), _jsx("div", { className: cn(softBox) })] }));
|
|
184
193
|
if (type === "event")
|
|
185
|
-
return (_jsxs(
|
|
194
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: cn(scrollWrapper), children: event.events.map(({ title, thumbnail, onClick }) => (_jsx("div", { onClick: onClick, className: cn(item, " shadow-main rounded-[10px] overflow-hidden"), children: _jsx("div", { className: "image-container", children: _jsx("img", { src: thumbnail, alt: title, className: "w-full bg-cover" }) }) }))) }), _jsx("div", { className: cn(softBox) })] }));
|
|
195
|
+
if (type === "search")
|
|
196
|
+
return _jsx(SearchComponent, {});
|
|
186
197
|
return null;
|
|
187
198
|
}
|
|
199
|
+
function SearchComponent() {
|
|
200
|
+
const inputRef = useRef(null);
|
|
201
|
+
useEffect(() => {
|
|
202
|
+
if (inputRef.current) {
|
|
203
|
+
inputRef.current.focus();
|
|
204
|
+
}
|
|
205
|
+
}, []);
|
|
206
|
+
const handleClear = () => {
|
|
207
|
+
setSearchText("");
|
|
208
|
+
if (inputRef.current)
|
|
209
|
+
inputRef.current.focus();
|
|
210
|
+
};
|
|
211
|
+
const [searchText, setSearchText] = useState("");
|
|
212
|
+
const isEmpty = "" === searchText;
|
|
213
|
+
const { choseongMatch, entireMatch } = search(searchText);
|
|
214
|
+
const handleItemClick = (url) => {
|
|
215
|
+
window.location.href = url;
|
|
216
|
+
};
|
|
217
|
+
const scrollWrapper = {
|
|
218
|
+
displays: "flex flex-col",
|
|
219
|
+
sizss: "h-full",
|
|
220
|
+
scrollActions: "scrollbar-hidden overflow-y-scroll snap-none",
|
|
221
|
+
spacings: "py-5 gap-5 scroll-pl-5",
|
|
222
|
+
};
|
|
223
|
+
const softBox = {
|
|
224
|
+
displays: "absolute top-[61px] left-0",
|
|
225
|
+
sizes: "w-full h-5",
|
|
226
|
+
backgrounds: "bg-gradient-to-b from-white to-white/0",
|
|
227
|
+
};
|
|
228
|
+
const searchBarHeader = {
|
|
229
|
+
displays: "relative flex items-center",
|
|
230
|
+
sizes: "w-full h-fit",
|
|
231
|
+
spacings: "gap-4 px-5 py-4",
|
|
232
|
+
boundaries: "border-b-1",
|
|
233
|
+
//debug: "border-red-500 border-2",
|
|
234
|
+
};
|
|
235
|
+
const inputBox = {
|
|
236
|
+
displays: "flex items-center",
|
|
237
|
+
sizes: "w-full h-7 rounded-sm",
|
|
238
|
+
boundaries: "outline-none",
|
|
239
|
+
textStyles: "font-regular",
|
|
240
|
+
placeHolderStyles: "placeholder-slate-300 caret-slate-300",
|
|
241
|
+
//debug: "border-red-500 border-2",
|
|
242
|
+
};
|
|
243
|
+
const linkBox = {
|
|
244
|
+
displays: "flex items-center justify-between",
|
|
245
|
+
sizes: "w-full h-fit",
|
|
246
|
+
spacings: "px-5 py-3",
|
|
247
|
+
backgrounds: "hover:bg-slate-50 active:bg-slate-50",
|
|
248
|
+
};
|
|
249
|
+
//결과없음 이미지
|
|
250
|
+
const noResultWrapper = {
|
|
251
|
+
displays: "flex flex-col justify-center items-center",
|
|
252
|
+
sizes: "w-full h-fit",
|
|
253
|
+
};
|
|
254
|
+
const noResultImg = {
|
|
255
|
+
spacings: "px-10",
|
|
256
|
+
sizes: "w-full max-w-80",
|
|
257
|
+
};
|
|
258
|
+
return (_jsxs("div", { className: "h-[calc(100vh-300px)] md:h-full w-full", children: [_jsxs("header", { className: cn(searchBarHeader), children: [!isEmpty && (_jsx("div", { className: "absolute w-[calc(100%-40px)] flex justify-end text-gray-medium pointer-events-none", children: _jsx("div", { className: "h-fit w-fit p-1 pointer-events-auto cursor-pointer", onClick: handleClear, children: _jsx(SVG.MiniClose, {}) }) })), _jsxs("form", { className: "flex flex-auto gap-4 min-w-0 w-full", children: [_jsx("label", { className: "h-6 w-6 mt-0.5 text-green-dark", children: _jsx(SVG.Search, {}) }), _jsx("input", { type: "text", className: cn(inputBox), placeholder: "\uBB34\uC5C7\uC774\uB4E0 \uCC3E\uC544\uBCF4\uC138\uC694", value: searchText, ref: inputRef, onChange: (e) => {
|
|
259
|
+
setSearchText(e.target.value);
|
|
260
|
+
} })] })] }), _jsx("div", { className: cn(scrollWrapper), children: !isEmpty ? (choseongMatch.length === 0 && entireMatch.length === 0 ? (_jsxs("div", { className: cn(noResultWrapper), children: [_jsx("div", { className: cn(noResultImg), children: _jsx("img", { src: "https://resource.tosel.co.kr/images/images/no-result.png", alt: "\uACB0\uACFC \uC5C6\uC74C" }) }), _jsx("div", { className: "text-sm text-center w-full font-medium text-green-dark", children: "\uC774\uB7F0, \uAC80\uC0C9\uACB0\uACFC\uAC00 \uC5C6\uC5B4\uC694" }), _jsxs("div", { className: "text-sm text-center w-full font-medium text-green-dark", children: ["'", searchText, "'\uC5D0 \uB300\uD55C \uACB0\uACFC\uAC00 \uD544\uC694\uD55C\uAC00\uC694?"] })] })) : (_jsxs("div", { className: "flex flex-col w-full", children: [entireMatch.map((e) => (_jsxs("div", { className: cn(linkBox), onClick: () => handleItemClick(e[0]), children: [_jsxs("div", { className: "w-full flex justify-start items-center gap-2", children: [_jsx("div", { className: "text-base text-gray-dark font-medium", children: e[1] }), _jsxs("div", { className: "text-sm text-green-dark", children: ["\"", e[2], "\""] })] }), _jsx("div", { className: "w-fit rounded-md shrink-0 text-xs bg-green-dark text-white py-1 px-2", children: "\uC815\uD655\uD788 \uC77C\uCE58!" })] }))), choseongMatch.map((e) => (_jsx("div", { className: cn(linkBox), onClick: () => handleItemClick(e[0]), children: _jsxs("div", { className: "w-full flex justify-start items-center gap-2", children: [_jsx("div", { className: "text-base text-gray-dark font-medium", children: e[1] }), _jsx("div", { className: "text-sm text-gray-medium", children: e[2] })] }) })))] }))) : (_jsxs("div", { className: "flex flex-col w-full justify-center items-start px-5", children: [_jsx("div", { className: "w-full text-green-dark text-base", children: "\uAC80\uC0C9\uC5B4\uB97C \uC785\uB825\uD574\uC8FC\uC138\uC694" }), _jsx("div", { className: "text-green-dark/50 text-sm", children: "\uCD08\uC131\uC73C\uB85C\uB3C4 \uAC80\uC0C9\uD560 \uC218 \uC788\uC5B4\uC694!" })] })) }), _jsx("div", { className: cn(softBox) })] }));
|
|
261
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edu-tosel/design",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.267",
|
|
4
4
|
"description": "UI components for International TOSEL Committee",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jsx",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"react-qr-code": "^2.0.15",
|
|
33
33
|
"react-router-dom": "^6.21.3",
|
|
34
34
|
"react-spring": "^9.7.3",
|
|
35
|
-
"react-to-print": "^
|
|
35
|
+
"react-to-print": "^3.0.4",
|
|
36
36
|
"react-transition-group": "^4.4.5",
|
|
37
37
|
"react-youtube": "^10.1.0",
|
|
38
38
|
"recharts": "^2.11.0",
|
package/util/createSearch.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
search: (query: string) => {
|
|
5
|
-
entireMatch: [string, string][];
|
|
6
|
-
choseongMatch: [string, string][];
|
|
7
|
-
};
|
|
1
|
+
declare const search: (query: string) => {
|
|
2
|
+
entireMatch: [string, string, string][];
|
|
3
|
+
choseongMatch: [string, string, string][];
|
|
8
4
|
};
|
|
5
|
+
export default search;
|