@edu-tosel/design 1.0.50 → 1.0.52

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 (52) hide show
  1. package/asset/SVG.d.ts +5 -0
  2. package/asset/svg/Operation.d.ts +7 -0
  3. package/asset/svg/Operation.js +8 -0
  4. package/asset/svg/Operation.tsx +38 -0
  5. package/card/design/Card.design.js +4 -2
  6. package/card/design/RollCard.design.d.ts +1 -1
  7. package/card/design/RollCard.design.js +35 -4
  8. package/card/index.d.ts +1 -0
  9. package/card/index.js +1 -0
  10. package/card/template/NavCard.js +2 -2
  11. package/card/template/ProgressCard.d.ts +10 -0
  12. package/card/template/ProgressCard.js +42 -0
  13. package/interface/Action.d.ts +6 -6
  14. package/interface/Card.d.ts +2 -0
  15. package/interface/Modal.d.ts +9 -2
  16. package/interface/Property.d.ts +1 -1
  17. package/interface/Theme.d.ts +2 -0
  18. package/interface/Theme.js +1 -0
  19. package/interface/index.d.ts +1 -0
  20. package/interface/index.js +1 -0
  21. package/layout/widget/dashboard/mypage/Navigate.js +2 -2
  22. package/layout/widget/dashboard/mypage/Profile.js +1 -1
  23. package/modal/design/Modal.design.js +2 -2
  24. package/modal/index.d.ts +2 -1
  25. package/modal/index.js +2 -1
  26. package/modal/template/{ConfirmModal → Confirm}/Tag.d.ts +1 -0
  27. package/modal/template/Confirm/Tag.js +30 -0
  28. package/modal/template/Postcode.d.ts +2 -0
  29. package/modal/template/Postcode.js +22 -0
  30. package/package.json +2 -1
  31. package/tailwind.config.ts +1 -0
  32. package/version.txt +1 -1
  33. package/widget/template/Select/Select.LG.d.ts +2 -0
  34. package/widget/template/Select/Select.LG.js +44 -0
  35. package/widget/template/Select/Select.d.ts +2 -0
  36. package/widget/{design/Select.design.js → template/Select/Select.js} +14 -6
  37. package/widget/template/Select/index.d.ts +6 -0
  38. package/widget/template/Select/index.js +4 -0
  39. package/modal/template/ConfirmModal/Tag.js +0 -19
  40. package/widget/design/Select.design.d.ts +0 -2
  41. package/widget/template/Select.d.ts +0 -3
  42. package/widget/template/Select.js +0 -6
  43. /package/modal/template/{ConfirmModal → Confirm}/Confirm.d.ts +0 -0
  44. /package/modal/template/{ConfirmModal → Confirm}/Confirm.js +0 -0
  45. /package/modal/template/{ConfirmModal → Confirm}/Input.d.ts +0 -0
  46. /package/modal/template/{ConfirmModal → Confirm}/Input.js +0 -0
  47. /package/modal/template/{ConfirmModal → Confirm}/Reimage.d.ts +0 -0
  48. /package/modal/template/{ConfirmModal → Confirm}/Reimage.js +0 -0
  49. /package/modal/template/{ConfirmModal → Confirm}/Switch.d.ts +0 -0
  50. /package/modal/template/{ConfirmModal → Confirm}/Switch.js +0 -0
  51. /package/modal/template/{ConfirmModal → Confirm}/index.d.ts +0 -0
  52. /package/modal/template/{ConfirmModal → Confirm}/index.js +0 -0
package/asset/SVG.d.ts CHANGED
@@ -28,6 +28,11 @@ declare const SVG: {
28
28
  Operation: {
29
29
  Plus: ({ onClick }: Operation) => import("react/jsx-runtime").JSX.Element;
30
30
  Minus: ({ onClick }: Operation) => import("react/jsx-runtime").JSX.Element;
31
+ Checked: ({ flag, size, theme, }: {
32
+ flag: boolean;
33
+ size?: number | undefined;
34
+ theme?: import("../interface/Theme").Theme | undefined;
35
+ }) => import("react/jsx-runtime").JSX.Element;
31
36
  };
32
37
  Phone: typeof Phone;
33
38
  Profile: typeof Profile;
@@ -1,11 +1,18 @@
1
1
  import { OnClick } from "../../interface";
2
+ import { Theme } from "../../interface/Theme";
2
3
  interface Operation {
3
4
  onClick?: OnClick;
4
5
  }
5
6
  declare function Plus({ onClick }: Operation): import("react/jsx-runtime").JSX.Element;
6
7
  declare function Minus({ onClick }: Operation): import("react/jsx-runtime").JSX.Element;
8
+ declare function Checked({ flag, size, theme, }: {
9
+ flag: boolean;
10
+ size?: number;
11
+ theme?: Theme;
12
+ }): import("react/jsx-runtime").JSX.Element;
7
13
  declare const Operation: {
8
14
  Plus: typeof Plus;
9
15
  Minus: typeof Minus;
16
+ Checked: typeof Checked;
10
17
  };
11
18
  export default Operation;
@@ -9,8 +9,16 @@ function Plus({ onClick }) {
9
9
  function Minus({ onClick }) {
10
10
  return (_jsxs("svg", { className: cn(container), onClick: onClick, width: "48", height: "48", viewBox: "0 0 48 48", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { d: "M42 24C42 26.3638 41.5344 28.7044 40.6298 30.8883C39.7253 33.0722 38.3994 35.0565 36.7279 36.7279C35.0565 38.3994 33.0722 39.7253 30.8883 40.6298C28.7044 41.5344 26.3638 42 24 42C21.6362 42 19.2956 41.5344 17.1117 40.6298C14.9278 39.7253 12.9435 38.3994 11.2721 36.7279C9.60062 35.0565 8.27475 33.0722 7.37017 30.8883C6.46558 28.7044 6 26.3638 6 24C6 19.2261 7.89642 14.6477 11.2721 11.2721C14.6477 7.89642 19.2261 6 24 6C28.7739 6 33.3523 7.89642 36.7279 11.2721C40.1036 14.6477 42 19.2261 42 24Z", fill: "#910023" }), _jsx("path", { d: "M30 24H18", stroke: "white", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round" })] }));
11
11
  }
12
+ function Checked({ flag, size, theme, }) {
13
+ const color = {
14
+ green: "#105652",
15
+ blue: "#173A8B",
16
+ };
17
+ return (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size ?? "40", height: size ?? "40", viewBox: "0 0 48 48", fill: "none", children: [_jsx("path", { d: "M42 24C42 26.3638 41.5344 28.7044 40.6298 30.8883C39.7253 33.0722 38.3994 35.0565 36.7279 36.7279C35.0565 38.3994 33.0722 39.7253 30.8883 40.6298C28.7044 41.5344 26.3638 42 24 42C21.6362 42 19.2956 41.5344 17.1117 40.6298C14.9278 39.7253 12.9435 38.3994 11.2721 36.7279C9.60062 35.0565 8.27475 33.0722 7.37017 30.8883C6.46558 28.7044 6 26.3638 6 24C6 19.2261 7.89642 14.6477 11.2721 11.2721C14.6477 7.89642 19.2261 6 24 6C28.7739 6 33.3523 7.89642 36.7279 11.2721C40.1036 14.6477 42 19.2261 42 24Z", fill: flag ? color[theme ?? "green"] : "#F0F0F0" }), _jsx("path", { d: "M30.5 18.5L24 30.5L18 24", stroke: "white", "stroke-width": "3", "stroke-linecap": "round", "stroke-linejoin": "round" })] }));
18
+ }
12
19
  const Operation = {
13
20
  Plus,
14
21
  Minus,
22
+ Checked,
15
23
  };
16
24
  export default Operation;
@@ -1,4 +1,5 @@
1
1
  import { OnClick } from "../../interface";
2
+ import { Theme } from "../../interface/Theme";
2
3
  import { cn } from "../../util";
3
4
 
4
5
  interface Operation {
@@ -59,8 +60,45 @@ function Minus({ onClick }: Operation) {
59
60
  );
60
61
  }
61
62
 
63
+ function Checked({
64
+ flag,
65
+ size,
66
+ theme,
67
+ }: {
68
+ flag: boolean;
69
+ size?: number;
70
+ theme?: Theme;
71
+ }) {
72
+ const color = {
73
+ green: "#105652",
74
+ blue: "#173A8B",
75
+ } as Record<Theme, string>;
76
+ return (
77
+ <svg
78
+ xmlns="http://www.w3.org/2000/svg"
79
+ width={size ?? "40"}
80
+ height={size ?? "40"}
81
+ viewBox="0 0 48 48"
82
+ fill="none"
83
+ >
84
+ <path
85
+ d="M42 24C42 26.3638 41.5344 28.7044 40.6298 30.8883C39.7253 33.0722 38.3994 35.0565 36.7279 36.7279C35.0565 38.3994 33.0722 39.7253 30.8883 40.6298C28.7044 41.5344 26.3638 42 24 42C21.6362 42 19.2956 41.5344 17.1117 40.6298C14.9278 39.7253 12.9435 38.3994 11.2721 36.7279C9.60062 35.0565 8.27475 33.0722 7.37017 30.8883C6.46558 28.7044 6 26.3638 6 24C6 19.2261 7.89642 14.6477 11.2721 11.2721C14.6477 7.89642 19.2261 6 24 6C28.7739 6 33.3523 7.89642 36.7279 11.2721C40.1036 14.6477 42 19.2261 42 24Z"
86
+ fill={flag ? color[theme ?? "green"] : "#F0F0F0"}
87
+ />
88
+ <path
89
+ d="M30.5 18.5L24 30.5L18 24"
90
+ stroke="white"
91
+ stroke-width="3"
92
+ stroke-linecap="round"
93
+ stroke-linejoin="round"
94
+ />
95
+ </svg>
96
+ );
97
+ }
98
+
62
99
  const Operation = {
63
100
  Plus,
64
101
  Minus,
102
+ Checked,
65
103
  };
66
104
  export default Operation;
@@ -2,6 +2,8 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
2
2
  import { cn, isDebug } from "../../util";
3
3
  import { useActionStore } from "../../store";
4
4
  const widthSize = {
5
+ "4xs": "w-15",
6
+ "3xs": "w-40",
5
7
  "2xs": "w-53.75",
6
8
  xs: "w-full md:w-60",
7
9
  sm: "w-full md:w-90",
@@ -13,8 +15,8 @@ const widthSize = {
13
15
  auto: "w-auto",
14
16
  };
15
17
  const heightSize = {
16
- "3xs": "h-28",
17
- "2xs": "h-30",
18
+ "3xs": "h-30",
19
+ "2xs": "h-40",
18
20
  xs: "h-45",
19
21
  sm: "h-52.5",
20
22
  md: "h-67.5",
@@ -1,2 +1,2 @@
1
1
  import { RollCardProps } from "../../interface";
2
- export default function RollCardDesign({ titles, state, children, }: RollCardProps): import("react/jsx-runtime").JSX.Element;
2
+ export default function RollCardDesign({ titles, state, isDisabled, isFixed, children, }: RollCardProps): import("react/jsx-runtime").JSX.Element;
@@ -1,13 +1,44 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import SVG from "../../asset/SVG";
3
3
  import { Label } from "../../widget";
4
- import { Shelf } from "../../layout";
4
+ import { Action, Shelf } from "../../layout";
5
5
  import Card from "./Card.design";
6
- export default function RollCardDesign({ titles, state, children, }) {
6
+ import { useEffect, useState } from "react";
7
+ import { cn } from "../../util";
8
+ export default function RollCardDesign({ titles, state, isDisabled, isFixed, children, }) {
7
9
  const [isOpen, setIsOpen] = state;
10
+ const [flag, setFlag] = useState(false);
11
+ useEffect(() => {
12
+ if (isFixed) {
13
+ setFlag(true);
14
+ const timer = setTimeout(() => {
15
+ setFlag(false);
16
+ }, 800);
17
+ return () => clearTimeout(timer);
18
+ }
19
+ }, [isFixed]);
20
+ const childBox = {
21
+ sizes: "h-full",
22
+ styles: isFixed && "hidden",
23
+ };
8
24
  return (_jsxs(Card, { options: {
9
25
  width: "2xl",
10
- height: isOpen ? "xs" : "3xs",
26
+ height: !isFixed && isOpen ? "xs" : "3xs",
27
+ background: flag ? "bg-green-dark/10" : "bg-white",
11
28
  className: "p-7.5 flex flex-col gap-y-6",
12
- }, children: [_jsxs(Shelf.Row, { className: "justify-between", children: [_jsxs(Shelf.Col, { className: "gap-y-2.5", children: [_jsxs(Shelf.Row, { className: "gap-x-2.5 items-center", children: [titles.icon && _jsx("img", { src: titles.icon, alt: "icon" }), _jsx("div", { className: "text-xl leading-none font-pretendard-bold text-green-dark", children: titles.title })] }), _jsx("div", { className: "leading-none", children: titles.subtitle })] }), _jsxs("div", { className: "flex gap-3.5 items-center", children: [_jsx(Label, { title: "\uC811\uC218\uC911" }), !isOpen ? (_jsx(SVG.Operation.Plus, { onClick: () => setIsOpen(true) })) : (_jsx(SVG.Operation.Minus, { onClick: () => setIsOpen(false) }))] })] }), _jsx("div", { className: "h-full", children: isOpen && children })] }));
29
+ }, children: [_jsxs(Shelf.Row, { className: "justify-between", children: [_jsxs(Shelf.Col, { className: "gap-y-2.5", children: [_jsxs(Shelf.Row, { className: "gap-x-2.5 items-center", children: [titles.icon && _jsx("img", { src: titles.icon, alt: "icon" }), _jsx("div", { className: "text-xl leading-none font-pretendard-bold text-green-dark", children: titles.title })] }), _jsx("div", { className: "leading-none", children: titles.subtitle })] }), _jsxs("div", { className: "flex gap-3.5 items-center", children: [_jsx(Label, { title: isFixed ? (flag ? "추가됨" : "수정하기") : "접수중", options: {
30
+ background: flag ? "bg-green-dark" : "bg-green-dark/10",
31
+ text: flag ? "text-white" : "bg-green-dark",
32
+ } }), _jsx(Action.Replace, { actions: [
33
+ [isDisabled, null],
34
+ [!isDisabled && isFixed, _jsx(SVG.Operation.Checked, { flag: true })],
35
+ [
36
+ !isDisabled && !isFixed && !isOpen,
37
+ _jsx(SVG.Operation.Plus, { onClick: () => setIsOpen(true) }),
38
+ ],
39
+ [
40
+ !isDisabled && !isFixed && isOpen,
41
+ _jsx(SVG.Operation.Minus, { onClick: () => setIsOpen(false) }),
42
+ ],
43
+ ] })] })] }), _jsx("div", { className: cn(childBox), children: isOpen && children })] }));
13
44
  }
package/card/index.d.ts CHANGED
@@ -2,5 +2,6 @@ export { default as AddCard } from "./template/AddCard";
2
2
  export { default as ChartCard } from "./template/ChartCard";
3
3
  export { default as InfoCard } from "./template/InfoCard";
4
4
  export { default as NavCard } from "./template/NavCard";
5
+ export { default as ProgressCard } from "./template/ProgressCard";
5
6
  export { default as RollCard } from "./template/RollCard";
6
7
  export { default as TableCard } from "./template/TableCard";
package/card/index.js CHANGED
@@ -2,5 +2,6 @@ export { default as AddCard } from "./template/AddCard";
2
2
  export { default as ChartCard } from "./template/ChartCard";
3
3
  export { default as InfoCard } from "./template/InfoCard";
4
4
  export { default as NavCard } from "./template/NavCard";
5
+ export { default as ProgressCard } from "./template/ProgressCard";
5
6
  export { default as RollCard } from "./template/RollCard";
6
7
  export { default as TableCard } from "./template/TableCard";
@@ -14,7 +14,7 @@ function _Button({ titles, onClick, options }) {
14
14
  function ButtonInLay({ titles, buttonInLay, options, }) {
15
15
  return (_jsx(NavCardDesign, { titles: titles, options: {
16
16
  ...options,
17
- width: options?.width ?? "2xl",
17
+ width: options?.width ?? "xs",
18
18
  height: options?.height ?? "sm",
19
19
  buttonInLay: {
20
20
  disabled: buttonInLay.disabled,
@@ -33,7 +33,7 @@ function BannerAndButtonInLay({ banner, buttonInLay, }) {
33
33
  ...buttonInLay,
34
34
  options: { ...buttonInLay.options, noShadow: true },
35
35
  };
36
- return (_jsxs("div", { className: "flex w-full", children: [_jsx("div", { className: "box-shadow rounded-xl w-full", children: _jsx(Banner, { ...bannerProps }) }), _jsx("div", { className: "box-shadow rounded-xl w-full", children: _jsx(ButtonInLay, { ...buttonInLayProps }) })] }));
36
+ return (_jsxs("div", { className: "flex w-full", children: [_jsx("div", { className: "box-shadow rounded-xl w-full", children: _jsx(Banner, { ...bannerProps }) }), _jsx("div", { className: "box-shadow rounded-xl", children: _jsx(ButtonInLay, { ...buttonInLayProps }) })] }));
37
37
  }
38
38
  const NavCard = {
39
39
  Banner,
@@ -0,0 +1,10 @@
1
+ import { Titles } from "../../interface";
2
+ import { Theme } from "../../interface";
3
+ type Step = [string, boolean];
4
+ interface ProgressCardProps {
5
+ titles: Titles;
6
+ steps: Step[];
7
+ theme?: Theme;
8
+ }
9
+ export default function ProgressCard({ titles, steps, theme, }: ProgressCardProps): import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1,42 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import SVG from "../../asset/SVG";
3
+ import { cn } from "../../util";
4
+ import CardDesign from "../design/Card.design";
5
+ const bg = {
6
+ green: "bg-green-dark",
7
+ blue: "bg-blue-navy",
8
+ };
9
+ const bgLight = {
10
+ green: "bg-green-dark/10",
11
+ blue: "bg-blue-navy/10",
12
+ };
13
+ const text = {
14
+ green: "text-green-dark",
15
+ blue: "text-blue-navy",
16
+ };
17
+ export default function ProgressCard({ titles, steps, theme, }) {
18
+ const progressBox = {
19
+ positions: "absolute top-7.5 left-7.5",
20
+ displays: "flex",
21
+ sizes: "w-150 h-19",
22
+ };
23
+ const stepBox = (flag) => ({
24
+ displays: "flex-1 flex flex-col justify-between",
25
+ sizes: "h-full",
26
+ backgrounds: flag ? bgLight[theme ?? "green"] : "bg-transparent",
27
+ boundaries: "rounded-md p-2.5",
28
+ texts: flag ? "text-gray-dark" : "text-gray-medium",
29
+ });
30
+ const titleBox = {
31
+ positions: "absolute top-12 right-12",
32
+ displays: "flex flex-col items-end gap-y-3",
33
+ };
34
+ const occupied = [
35
+ steps.filter(([_, value]) => !!value).length,
36
+ steps.length,
37
+ ].join("/");
38
+ return (_jsxs(CardDesign, { options: {
39
+ width: "2xl",
40
+ height: "2xs",
41
+ }, children: [_jsx("div", { className: cn(progressBox), children: steps.map(([key, value]) => (_jsxs("div", { className: cn(stepBox(value)), children: [_jsx("div", { children: key }), _jsx(SVG.Operation.Checked, { flag: value, size: 25, theme: theme })] }, key))) }), _jsxs("div", { className: cn(titleBox), children: [_jsx("div", { className: `text-xl leading-none font-pretendard-bold ${text[theme ?? "green"]}`, children: titles.title }), _jsx("div", { className: "text-base leading-none", children: titles.subtitle })] }), _jsx("div", { className: "absolute bottom-0 left-0 bg-gray-light w-full h-2.5", children: _jsx("div", { className: `h-full w-${occupied} ${bg[theme ?? "green"]}` }) })] }));
42
+ }
@@ -4,12 +4,12 @@ export interface ActionEvent {
4
4
  event: string;
5
5
  type: "view" | "modal";
6
6
  }
7
- type Event<T extends boolean | string | null | undefined> = [
7
+ type Action<T extends boolean | string | null | undefined> = [
8
8
  T,
9
9
  React.ReactNode
10
10
  ];
11
- export type Show = Event<boolean | string>;
12
- export type Replace = Event<boolean | string | null | undefined>;
11
+ export type Show = Action<boolean | string>;
12
+ export type Replace = Action<boolean | string | null | undefined>;
13
13
  export interface ShowAction {
14
14
  event: string;
15
15
  isVisible: boolean;
@@ -20,11 +20,11 @@ export interface ShowProps {
20
20
  }
21
21
  export interface ReplaceProps {
22
22
  actions?: Replace[];
23
- children: React.ReactNode;
23
+ children?: React.ReactNode;
24
24
  }
25
25
  export interface EventsProps {
26
- replaces?: Event<boolean | string | null | undefined>[];
27
- shows?: Event<boolean | string>[];
26
+ replaces?: Action<boolean | string | null | undefined>[];
27
+ shows?: Action<boolean | string>[];
28
28
  }
29
29
  export interface DataFieldProps<T> {
30
30
  id: string;
@@ -126,5 +126,7 @@ export interface RollCardProps extends CardProps {
126
126
  icon?: string;
127
127
  };
128
128
  state: State<boolean>;
129
+ isFixed?: boolean;
130
+ isDisabled?: boolean;
129
131
  }
130
132
  export {};
@@ -1,4 +1,4 @@
1
- import { Button, Scripts, Size, Titles } from "./Property";
1
+ import { Button, Scripts, Size, State, Titles } from "./Property";
2
2
  import { ShowAction } from "./Action";
3
3
  interface Options {
4
4
  width: Size;
@@ -27,4 +27,11 @@ interface AlertModalProps extends Omit<ModalProps, "children"> {
27
27
  buttons?: Button[];
28
28
  };
29
29
  }
30
- export type { ModalProps, ConfirmModalProps, AlertModalProps };
30
+ interface DaumPostcode {
31
+ address: string;
32
+ zipcode: string;
33
+ }
34
+ interface DaumPostcodeModalProps extends Omit<ModalProps, "titles" | "children"> {
35
+ state: State<DaumPostcode>;
36
+ }
37
+ export type { ModalProps, ConfirmModalProps, AlertModalProps, DaumPostcodeModalProps, };
@@ -27,7 +27,7 @@ export type State<T> = [T, StateAction<T>];
27
27
  * @property {"full"} full - Full size
28
28
  */
29
29
  export type ImageSize = "sub" | "full";
30
- export type Size = "3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | "auto";
30
+ export type Size = "4xs" | "3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | "auto";
31
31
  /**
32
32
  * Image size type
33
33
  * @enum {string}
@@ -0,0 +1,2 @@
1
+ type Theme = "green" | "blue";
2
+ export type { Theme };
@@ -0,0 +1 @@
1
+ export {};
@@ -4,5 +4,6 @@ export * from "./HTMLElement";
4
4
  export * from "./Layout";
5
5
  export * from "./Overlay";
6
6
  export * from "./Property";
7
+ export * from "./Theme";
7
8
  export * from "./Shelf";
8
9
  export * from "./widget";
@@ -4,5 +4,6 @@ export * from "./HTMLElement";
4
4
  export * from "./Layout";
5
5
  export * from "./Overlay";
6
6
  export * from "./Property";
7
+ export * from "./Theme";
7
8
  export * from "./Shelf";
8
9
  export * from "./widget";
@@ -9,7 +9,7 @@ function Academy({ onClick }) {
9
9
  boundary: "box-shadow shadow-green-dark",
10
10
  onMouse: [onMouse, _],
11
11
  width: "2xs",
12
- height: "2xs",
12
+ height: "3xs",
13
13
  }, children: [_jsx("div", { className: "text-gray-medium group-hover:text-green-dark duration-300", children: "\uB098\uC758 \uD559\uC6D0" }), _jsx("svg", { className: "absolute bottom-5 right-5 ", xmlns: "http://www.w3.org/2000/svg", width: "60", height: "60", viewBox: "0 0 60 60", fill: "none", children: _jsx("path", { className: "duration-300", d: "M9 53H52M10.9545 6H50.0455M12.9091 6V53M48.0909 6V53M22.6818 15.7917H26.5909M22.6818 23.625H26.5909M22.6818 31.4583H26.5909M34.4091 15.7917H38.3182M34.4091 23.625H38.3182M34.4091 31.4583H38.3182M22.6818 53V44.1875C22.6818 42.566 23.9953 41.25 25.6136 41.25H35.3864C37.0047 41.25 38.3182 42.566 38.3182 44.1875V53", stroke: !onMouse ? "#7F7F7F" : "#105652", strokeWidth: "4", strokeLinecap: "round", strokeLinejoin: "round" }) })] }));
14
14
  }
15
15
  function Payment({ onClick }) {
@@ -18,7 +18,7 @@ function Payment({ onClick }) {
18
18
  className: "pt-5 pl-5",
19
19
  background: "group bg-green-dark/10 hover:bg-green-dark/30 ",
20
20
  width: "2xs",
21
- height: "2xs",
21
+ height: "3xs",
22
22
  boundary: "",
23
23
  }, children: [_jsx("div", { className: "opacity-0 group-hover:opacity-100 duration-300", children: "\uACB0\uC81C \uC815\uBCF4" }), _jsxs("div", { className: "absolute top-5 group-hover:top-11.25 left-5 flex flex-col gap-1.5 duration-300", children: [_jsx("div", { className: "w-24 h-1.5 bg-green-dark/30 group-hover:bg-green-dark/40 duration-300" }), _jsx("div", { className: "w-14.25 h-1.5 bg-green-dark/30 group-hover:bg-green-dark/40 duration-300" })] }), _jsx("div", { className: "absolute top-5 right-5 w-12.25 h-7 rounded-full bg-[#CFDDDC]" }), _jsx("div", { className: "absolute left-0 bottom-5 w-full h-5 bg-green-dark" })] }));
24
24
  }
@@ -22,7 +22,7 @@ function Profile({ name, birthday, image, modify }) {
22
22
  return (_jsxs(Card, { options: {
23
23
  className: "flex gap-x-7.5 items-center pl-5",
24
24
  width: "md",
25
- height: "2xs",
25
+ height: "3xs",
26
26
  boundary: "border-1 border-black",
27
27
  }, children: [_jsxs("button", { onMouseEnter: () => setHover(true), onMouseLeave: () => setHover(false), onClick: modify.image, className: "w-20 h-20 overflow-hidden rounded-md relative", children: [_jsx("img", { src: image, alt: "profile-image", className: "bg-cover" }), 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" })] })))] }), _jsxs("div", { className: "flex flex-col h-20", children: [_jsx("div", { className: "text-xl leading-none font-pretendard-bold text-gray-dark", children: name }), _jsx("div", { className: "leading-none text-gray-medium mt-1.25", children: birthday }), _jsxs("div", { className: "flex gap-3 mt-auto", children: [_jsx(Label.Button, { title: "\uC2E4\uBA85 \uC218\uC815", options: { width: "sm", height: "xs" }, onClick: modify.name }), _jsx(Label.Button, { title: "\uC0DD\uC77C \uC218\uC815", options: { width: "sm", height: "xs" }, onClick: modify.birthday })] })] })] }));
28
28
  }
@@ -11,7 +11,7 @@ const widthSize = {
11
11
  xs: "w-2/3 min-w-76 max-w-176",
12
12
  sm: "w-2/3 min-w-76 max-w-176",
13
13
  md: "w-112.5",
14
- lg: "w-full min-w-76 max-w-360",
14
+ lg: "w-full min-w-76 max-w-240",
15
15
  xl: "w-2/3 min-w-76 max-w-360",
16
16
  "2xl": "w-2/3 min-w-76 max-w-360",
17
17
  full: "w-full",
@@ -21,7 +21,7 @@ const heightSize = {
21
21
  sm: "h-100",
22
22
  md: "h-72 sm:h-48",
23
23
  lg: "h-112.5",
24
- xl: "h-180",
24
+ xl: "h-160",
25
25
  "2xl": "max-w-176",
26
26
  full: "h-full",
27
27
  };
package/modal/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export { default as Modal } from "./template";
2
- export { default as ConfirmModal } from "./template/ConfirmModal";
2
+ export { default as ConfirmModal } from "./template/Confirm";
3
+ export { default as PostcodeModal } from "./template/Postcode";
package/modal/index.js CHANGED
@@ -1,2 +1,3 @@
1
1
  export { default as Modal } from "./template";
2
- export { default as ConfirmModal } from "./template/ConfirmModal";
2
+ export { default as ConfirmModal } from "./template/Confirm";
3
+ export { default as PostcodeModal } from "./template/Postcode";
@@ -4,6 +4,7 @@ interface TagModalProps<T> extends Omit<ConfirmModalProps, "children"> {
4
4
  tag: {
5
5
  state: State<T[]>;
6
6
  tags: [T, string][];
7
+ process?: [boolean, React.ReactNode];
7
8
  options?: {
8
9
  selectHow?: "one" | "plural";
9
10
  };
@@ -0,0 +1,30 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import ConfirmModal from "../../design/ConfirmModal.design";
3
+ import { cn } from "../../../util";
4
+ import { selectOne, selectPlural } from "../../../util/select";
5
+ import { animated, useTransition } from "react-spring";
6
+ export default function Tag(props) {
7
+ const { state, tags, options, process } = props.tag;
8
+ const { selectHow } = options || { selectHow: "plural" };
9
+ const button = (key) => ({
10
+ sizes: "h-10",
11
+ styles: "rounded-full",
12
+ animations: "duration-300",
13
+ boundaries: state[0].includes(key)
14
+ ? "bg-green-dark text-white"
15
+ : "border border-gray-medium",
16
+ });
17
+ const [step, node] = process || [false, null];
18
+ const leaveTransition = useTransition(step, {
19
+ from: { x: 0 },
20
+ leave: { x: -600 },
21
+ });
22
+ const enterTransition = useTransition(step, {
23
+ from: { x: 400 },
24
+ enter: { x: 0 },
25
+ });
26
+ return (_jsx(ConfirmModal, { ...props, children: _jsxs("div", { className: "flex", children: [leaveTransition((styles, item) => !item && (_jsx(animated.div, { style: styles, className: "w-full grid grid-cols-4 gap-2.5 mt-4.75", children: tags.map(([key, value]) => (_jsx("button", { onClick: () => selectHow === "one"
27
+ ? selectOne({ state, key })
28
+ : selectPlural({ state, key }), className: cn(button(key)), children: value }, key))) }))), process &&
29
+ enterTransition((styles, item) => item && (_jsx(animated.div, { style: styles, className: "absolute mt-4.75", children: node })))] }) }));
30
+ }
@@ -0,0 +1,2 @@
1
+ import { DaumPostcodeModalProps } from "../../interface/Modal";
2
+ export default function PostcodeModal({ state, showAction, }: DaumPostcodeModalProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import DaumPostcodeEmbed from "react-daum-postcode";
3
+ import ModalDesign from "../design/Modal.design";
4
+ import { useActionStore } from "../../store";
5
+ export default function PostcodeModal({ state, showAction, }) {
6
+ const { removeModal } = useActionStore();
7
+ const [value, setValue] = state;
8
+ const handler = (data) => {
9
+ setValue({
10
+ address: data.address,
11
+ zipcode: data.zonecode,
12
+ });
13
+ return showAction?.event && removeModal(showAction.event);
14
+ };
15
+ return (_jsx(ModalDesign, { titles: {
16
+ title: "주소를 검색하고 선택해주세요",
17
+ subtitle: "주소를 검색하고 선택해주세요",
18
+ }, showAction: showAction, options: {
19
+ width: "lg",
20
+ height: "xl",
21
+ }, children: _jsx(DaumPostcodeEmbed, { onComplete: handler, className: "mt-16" }) }));
22
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edu-tosel/design",
3
- "version": "1.0.50",
3
+ "version": "1.0.52",
4
4
  "description": "UI components for International TOSEL Committee",
5
5
  "keywords": [
6
6
  "jsx",
@@ -18,6 +18,7 @@
18
18
  "date-fns-tz": "^2.0.1",
19
19
  "react": "^18.2.0",
20
20
  "react-datepicker": "^6.4.0",
21
+ "react-daum-postcode": "^3.1.3",
21
22
  "react-dom": "^18.2.0",
22
23
  "react-icons": "^5.0.1",
23
24
  "react-lottie-player": "^1.5.6",
@@ -250,6 +250,7 @@ export default {
250
250
  146: "36.5rem",
251
251
  147: "36.75rem",
252
252
  148: "37rem",
253
+ 150: "37.5rem",
253
254
  151.5: "37.875rem",
254
255
  151.75: "37.9375rem",
255
256
  152: "38rem",
package/version.txt CHANGED
@@ -1 +1 @@
1
- 1.0.50
1
+ 1.0.52
@@ -0,0 +1,2 @@
1
+ import { HTMLSelectElement } from "../../../interface";
2
+ export default function SelectLG<T>({ state }: HTMLSelectElement<T>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,44 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useId, useState } from "react";
3
+ import { useActionStore } from "../../../store";
4
+ import { useFlag } from "../../../hook";
5
+ 0;
6
+ const widthSize = {
7
+ xs: "w-10",
8
+ sm: "w-22.5",
9
+ md: "w-40",
10
+ lg: "w-50",
11
+ };
12
+ const heightSize = {
13
+ xs: "h-6.5",
14
+ };
15
+ // selectOptions,
16
+ // placeholder,
17
+ // options,
18
+ export default function SelectLG({ state }) {
19
+ const id = useId();
20
+ const { setIsOwn, setIsOwnId } = useActionStore();
21
+ const [value, setValue] = state;
22
+ const [text, setText] = useState("");
23
+ const [search, setSearch] = useState("");
24
+ const [isOpen, setIsOpen] = useState(false);
25
+ const [isHover, setIsHover] = useState(false);
26
+ const [filteredOptions, setFilterdOptions] = useState([]);
27
+ const [index, setIndex] = useState();
28
+ useFlag({ state: [false, setIsOpen], safe: "overlay" });
29
+ const onKeyDown = (e) => {
30
+ if (!filteredOptions)
31
+ return;
32
+ if (typeof index === "undefined")
33
+ return setIndex(0);
34
+ if (e.key === "Enter") {
35
+ setText(filteredOptions[index][1]);
36
+ return setValue(filteredOptions[index][0]);
37
+ }
38
+ if (e.key === "ArrowDown")
39
+ return setIndex((index + 1) % filteredOptions.length);
40
+ if (e.key === "ArrowUp")
41
+ return setIndex((index - 1 + filteredOptions.length) % filteredOptions.length);
42
+ };
43
+ return _jsx("select", { className: "w-64 h-32 border-2" });
44
+ }
@@ -0,0 +1,2 @@
1
+ import { HTMLSelectElement } from "../../../interface";
2
+ export default function Select<T>({ state, selectOptions, placeholder, options, }: HTMLSelectElement<T>): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect, useId, useState } from "react";
3
- import { cn } from "../../util";
2
+ import { useEffect, useId, useRef, useState } from "react";
3
+ import { cn } from "../../../util";
4
4
  import { useTransition, animated } from "react-spring";
5
- import { useActionStore } from "../../store";
6
- import { useFlag } from "../../hook";
5
+ import { useActionStore } from "../../../store";
6
+ import { useFlag } from "../../../hook";
7
7
  const widthSize = {
8
8
  xs: "w-10",
9
9
  sm: "w-22.5",
@@ -13,7 +13,7 @@ const widthSize = {
13
13
  const heightSize = {
14
14
  xs: "h-6.5",
15
15
  };
16
- export default function SelectDesign({ state, selectOptions, placeholder, options, }) {
16
+ export default function Select({ state, selectOptions, placeholder, options, }) {
17
17
  const id = useId();
18
18
  const { setIsOwn, setIsOwnId } = useActionStore();
19
19
  const [value, setValue] = state;
@@ -41,6 +41,14 @@ export default function SelectDesign({ state, selectOptions, placeholder, option
41
41
  useEffect(() => {
42
42
  setFilterdOptions(selectOptions?.filter(([_, text]) => text.includes(search)));
43
43
  }, [search, selectOptions]);
44
+ // scrollIntoView
45
+ const listRef = useRef(null);
46
+ const itemRefs = useRef([]);
47
+ useEffect(() => {
48
+ if (typeof index === "number" && itemRefs.current[index]) {
49
+ itemRefs.current[index]?.scrollIntoView({ block: "nearest" });
50
+ }
51
+ }, [index]);
44
52
  const isLong = selectOptions && selectOptions.length >= 4;
45
53
  const container = {
46
54
  positions: "relative ",
@@ -101,7 +109,7 @@ export default function SelectDesign({ state, selectOptions, placeholder, option
101
109
  });
102
110
  return (_jsxs("div", { className: cn(container), onKeyDown: onKeyDown, onClick: () => setIsOwn(true), children: [_jsx("button", { onClick: () => setIsOpen(!isOpen), className: cn(button), onMouseEnter: () => setIsHover(true), onMouseLeave: () => setIsHover(false), children: value ? (_jsx("div", { className: cn(label), children: selectOptions?.find((option) => value === option[0])?.[1] })) : (_jsx("div", { className: "text-xs pl-1", children: placeholder ?? "선택해주세요" })) }), inputTransition((styles, item) => isLong &&
103
111
  item && (_jsx(animated.input, { style: styles, placeholder: "\uAC80\uC0C9\uC5B4\uB97C \uC785\uB825\uD558\uC138\uC694", className: cn(input), onChange: (e) => setSearch(e.target.value) }))), bodyTransitions((styles, item) => {
104
- return (item && (_jsx(animated.div, { style: styles, className: cn(body), children: filteredOptions?.map(([value, text], order) => (_jsx("section", { children: _jsx("button", { onClick: () => {
112
+ return (item && (_jsx(animated.div, { style: styles, className: cn(body), ref: listRef, children: filteredOptions?.map(([value, text], order) => (_jsx("section", { children: _jsx("button", { ref: (el) => (itemRefs.current[order] = el), onClick: () => {
105
113
  setValue(value);
106
114
  setText(text);
107
115
  return setIsOpen(false);
@@ -0,0 +1,6 @@
1
+ import _Select from "./Select";
2
+ import LG from "./Select.LG";
3
+ declare const Select: typeof _Select & {
4
+ LG: typeof LG;
5
+ };
6
+ export default Select;
@@ -0,0 +1,4 @@
1
+ import _Select from "./Select";
2
+ import LG from "./Select.LG";
3
+ const Select = Object.assign(_Select, { LG });
4
+ export default Select;
@@ -1,19 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import ConfirmModal from "../../design/ConfirmModal.design";
3
- import { cn } from "../../../util";
4
- import { selectOne, selectPlural } from "../../../util/select";
5
- export default function Tag(props) {
6
- const { state, tags, options } = props.tag;
7
- const { selectHow } = options || { selectHow: "plural" };
8
- const button = (key) => ({
9
- sizes: "h-10",
10
- styles: "rounded-full",
11
- animations: "duration-300",
12
- boundaries: state[0].includes(key)
13
- ? "bg-green-dark text-white"
14
- : "border border-gray-medium",
15
- });
16
- return (_jsx(ConfirmModal, { ...props, children: _jsx("div", { className: "grid grid-cols-4 gap-2.5 mt-4.75", children: tags.map(([key, value]) => (_jsx("button", { onClick: () => selectHow === "one"
17
- ? selectOne({ state, key })
18
- : selectPlural({ state, key }), className: cn(button(key)), children: value }, key))) }) }));
19
- }
@@ -1,2 +0,0 @@
1
- import { HTMLSelectElement } from "../../interface";
2
- export default function SelectDesign<T>({ state, selectOptions, placeholder, options, }: HTMLSelectElement<T>): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +0,0 @@
1
- import { HTMLSelectElement } from "../../interface";
2
- declare function Select<T>(props: HTMLSelectElement<T>): import("react/jsx-runtime").JSX.Element;
3
- export default Select;
@@ -1,6 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import SelectDesign from "../design/Select.design";
3
- function Select(props) {
4
- return _jsx(SelectDesign, { ...props });
5
- }
6
- export default Select;