@edu-tosel/design 1.0.115 → 1.0.117

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.
@@ -25,6 +25,6 @@ declare namespace Profile {
25
25
  interface Info {
26
26
  title: string | "email" | "phone";
27
27
  content: string;
28
- button: ButtonProp;
28
+ button?: ButtonProp;
29
29
  }
30
30
  export default Profile;
@@ -39,13 +39,13 @@ function Detail({ titles, infos, toggle, }) {
39
39
  height: "xs",
40
40
  background: gradient.bg.greenToRedSoft,
41
41
  boundary: "",
42
- }, children: [_jsxs("div", { className: "h-13.25 flex flex-col text-gray-dark border-b-1 border-crimson-burgundy", children: [_jsx("div", { className: "text-xl font-pretendard-bold h-6 leading-none", children: titles.title }), _jsx("div", { className: "h-4.75 leading-none", children: titles.subtitle })] }), _jsx("div", { className: "mt-4.25 flex flex-col gap-2.5 ", children: infos?.map(({ title, content, button }, index) => (_jsxs("div", { className: cn(infoBox), children: [title === "phone" ? (_jsx(SVG.Phone, {})) : title === "email" ? (_jsx(SVG.Email, {})) : (_jsx("div", { className: "font-pretendard-bold mr-5 w-7", children: title })), _jsx("div", { className: "leading-none flex items-center w-60", children: content }), _jsx(Label.Button, { title: button.title, onClick: button.onClick, option: {
42
+ }, children: [_jsxs("div", { className: "h-13.25 flex flex-col text-gray-dark border-b-1 border-crimson-burgundy", children: [_jsx("div", { className: "text-xl font-pretendard-bold h-6 leading-none", children: titles.title }), _jsx("div", { className: "h-4.75 leading-none", children: titles.subtitle })] }), _jsx("div", { className: "mt-4.25 flex flex-col gap-2.5 ", children: infos?.map(({ title, content, button }, index) => (_jsxs("div", { className: cn(infoBox), children: [title === "phone" ? (_jsx(SVG.Phone, {})) : title === "email" ? (_jsx(SVG.Email, {})) : (_jsx("div", { className: "font-pretendard-bold mr-5 w-7", children: title })), _jsx("div", { className: "leading-none flex items-center w-60", children: content }), button && (_jsx(Label.Button, { title: button.title, onClick: button.onClick, option: {
43
43
  className: "ml-auto",
44
44
  background: gradient.bg.greenToRed,
45
45
  text: "text-white",
46
46
  width: "sm",
47
47
  height: "xs",
48
- } })] }, id + index))) }), toggle && (_jsxs("div", { className: "flex gap-2.5 items-center absolute bottom-5 right-5", children: [_jsx("div", { className: "text-xs leading-none text-green-dark", children: "\uD559\uC6D0\uC73C\uB85C \uBC1B\uAE30" }), _jsx(Toggle, { state: toggle })] }))] }));
48
+ } }))] }, id + index))) }), toggle && (_jsxs("div", { className: "flex gap-2.5 items-center absolute bottom-5 right-5", children: [_jsx("div", { className: "text-xs leading-none text-green-dark", children: "\uD559\uC6D0\uC73C\uB85C \uBC1B\uAE30" }), _jsx(Toggle, { state: toggle })] }))] }));
49
49
  }
50
50
  function Preview({ image, username, email, }) {
51
51
  const container = {
@@ -1,6 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState, useEffect } from "react";
3
- import { useTransition } from "react-spring";
2
+ import { useState } from "react";
4
3
  import { cn } from "../../../../util";
5
4
  import { useEase } from "../../../../hook";
6
5
  import { LineBreaks } from "../../../../text";
@@ -9,44 +8,34 @@ import { tagString } from "../../../../interface/domain";
9
8
  export default function Carousel({ contents, }) {
10
9
  const [index, setIndex] = useState(0);
11
10
  const [flag, inTime] = useEase(10000, 1000);
12
- useEffect(() => {
13
- // Automatically change index every 5 seconds
14
- const interval = setInterval(() => {
15
- setIndex((prevIndex) => (prevIndex + 1) % contents.length);
16
- }, 5000);
17
- return () => clearInterval(interval);
18
- }, [contents.length]);
11
+ // useEffect(() => {
12
+ // if (flag) {
13
+ // setIndex((index + 1) % contents.length);
14
+ // }
15
+ // }, [flag]);
19
16
  const { tag, titles, image, option } = contents[index];
20
17
  const { text, background } = option ?? {};
21
18
  const container = {
22
19
  displays: "flex justify-center items-center",
23
- sizes: "w-full h-100",
20
+ sizes: "w-full h-fit sm:h-80 ml:h-100",
24
21
  background,
25
22
  };
26
23
  const body = {
27
- positions: "relative",
28
- displays: "flex items-center",
24
+ displays: "flex flex-none items-center justify-center",
29
25
  sizes: "w-full max-w-256 h-full",
30
26
  text: text ?? "text-gray-dark",
31
27
  };
32
28
  const tagBox = {
33
29
  displays: "flex justify-center items-center",
34
- sizes: "w-20 h-8",
30
+ sizes: "w-fit h-fit px-2 py-1 md:px-2.5 md:py-1.5",
35
31
  background: tag.background,
36
- fonts: "text-white font-pretendard-bold text-lg leading-none",
32
+ fonts: "text-white font-pretendard-medium text-sm md:text-base leading-none",
37
33
  styles: "rounded-md",
38
34
  };
39
35
  const buttonBox = {
40
- positions: "absolute bottom-0 left-0",
41
36
  displays: "flex justify-center items-center gap-1",
42
37
  sizes: "w-23.25 h-6.25 bg-gray-dark rounded-full",
43
- paddings: "px-1.5 ml-7.5",
38
+ paddings: "px-1.5 mt-12",
44
39
  };
45
- const transitions = useTransition(!!image, {
46
- from: { opacity: 0 },
47
- enter: { opacity: 1 },
48
- leave: { opacity: 0 },
49
- config: { duration: 200 },
50
- });
51
- return (_jsx("div", { className: cn(container), children: _jsxs("div", { className: cn(body), children: [_jsxs("div", { className: "relative w-72 h-50 flex flex-col pl-7.5", children: [_jsx("div", { className: `${cn(tagBox)} duration-1000 transition-all`, children: tagString[tag.type] }), _jsx("div", { className: "font-pretendard-bold text-2xl mt-2 duration-200 transition-all", children: titles.title }), _jsx(LineBreaks, { className: "mt-7.5 duration-1000 transition-all", texts: titles.subtitle }), _jsxs("div", { className: cn(buttonBox), children: [_jsx("button", { onClick: () => setIndex((index - 1 + contents.length) % contents.length), className: "w-5 h-5 flex justify-center items-center", children: _jsx(SVG.Symbol.LessThan, {}) }), _jsxs("div", { className: "flex flex-row gap-2 justify-center items-center", children: [_jsx("div", { className: "text-white w-2 text-sm", children: index + 1 }), _jsx("div", { className: "w-0.5 h-3 bg-gray-medium" }), _jsx("div", { className: "text-white w-2 text-sm", children: contents.length })] }), _jsx("button", { onClick: () => setIndex((index + 1) % contents.length), className: "w-5 h-5 flex justify-center items-center", children: _jsx(SVG.Symbol.GreaterThan, {}) })] })] }), image && (_jsx("img", { src: image, alt: "carousel-image", className: "absolute bottom-0 right-0 object-cover sm:h-full duration-2000 transition-all" }))] }) }));
40
+ return (_jsx("div", { className: cn(container), children: _jsxs("div", { className: cn(body), children: [_jsxs("div", { className: "w-72 h-50 flex flex-col flex-none pl-7.5", children: [_jsx("div", { className: cn(tagBox), children: tagString[tag.type] }), _jsx("div", { className: "font-pretendard-bold text-xl mt-2 md:text-2xl", children: titles.title }), _jsx(LineBreaks, { className: "mt-6 text-sm md:text-base", texts: titles.subtitle }), _jsxs("div", { className: cn(buttonBox), children: [_jsx("button", { onClick: () => setIndex((index - 1 + contents.length) % contents.length), className: "w-5 h-5 flex justify-center items-center", children: _jsx(SVG.Symbol.LessThan, {}) }), _jsxs("div", { className: "flex flex-row gap-2 justify-center items-center", children: [_jsx("div", { className: "text-white w-2 text-sm", children: index + 1 }), _jsx("div", { className: "w-0.5 h-3 bg-gray-medium" }), _jsx("div", { className: "text-white w-2 text-sm", children: contents.length })] }), _jsx("button", { onClick: () => setIndex((index + 1) % contents.length), className: "w-5 h-5 flex justify-center items-center", children: _jsx(SVG.Symbol.GreaterThan, {}) })] })] }), _jsx("div", { className: "h-full overflow-hidden w-fit", children: image && (_jsx("img", { src: image, alt: "carousel-image", className: "object-cover h-full" })) })] }) }));
52
41
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edu-tosel/design",
3
- "version": "1.0.115",
3
+ "version": "1.0.117",
4
4
  "description": "UI components for International TOSEL Committee",
5
5
  "keywords": [
6
6
  "jsx",
package/version.txt CHANGED
@@ -1 +1 @@
1
- 1.0.115
1
+ 1.0.117