@edu-tosel/design 1.0.65 → 1.0.67

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 (81) hide show
  1. package/asset/SVG.d.ts +2 -0
  2. package/asset/svg/Direction.d.ts +4 -0
  3. package/asset/svg/Direction.js +11 -0
  4. package/asset/svg/Direction.tsx +40 -0
  5. package/card/design/Card.design.js +13 -12
  6. package/card/design/CustomCard.design.d.ts +2 -0
  7. package/card/design/CustomCard.design.js +23 -0
  8. package/card/design/TableCard.design.js +7 -4
  9. package/card/index.d.ts +1 -0
  10. package/card/index.js +1 -0
  11. package/card/template/ConfirmCard/index.d.ts +3 -0
  12. package/card/template/ConfirmCard/index.js +3 -3
  13. package/card/template/CustomCard.d.ts +3 -0
  14. package/card/template/CustomCard.js +6 -0
  15. package/card/template/InfoCard/Academy.d.ts +1 -1
  16. package/card/template/InfoCard/Academy.js +4 -4
  17. package/card/template/NavCard.js +5 -1
  18. package/card/template/ProgressCard/Large.d.ts +1 -1
  19. package/card/template/ProgressCard/Large.js +4 -4
  20. package/card/template/ProgressCard/Small.d.ts +1 -1
  21. package/card/template/ProgressCard/Small.js +3 -3
  22. package/interaction/index.d.ts +1 -0
  23. package/interaction/index.js +1 -0
  24. package/interaction/template/Lock.d.ts +3 -0
  25. package/interaction/template/Lock.js +4 -0
  26. package/interface/Action.d.ts +6 -1
  27. package/interface/Board.d.ts +2 -1
  28. package/interface/Card.d.ts +9 -2
  29. package/interface/Data.d.ts +41 -0
  30. package/interface/Data.js +4 -0
  31. package/interface/Property.d.ts +8 -24
  32. package/interface/index.d.ts +2 -1
  33. package/interface/index.js +2 -1
  34. package/interface/widget/Obstacle.d.ts +10 -0
  35. package/interface/widget/Obstacle.js +1 -0
  36. package/interface/widget/Select.d.ts +23 -0
  37. package/interface/widget/Select.js +1 -0
  38. package/interface/widget/index.d.ts +1 -0
  39. package/layout/design/DataField.design.js +7 -5
  40. package/layout/design/Row.design/SelectRoll.d.ts +7 -0
  41. package/layout/design/Row.design/SelectRoll.js +39 -0
  42. package/layout/design/{Row.design.d.ts → Row.design/index.d.ts} +1 -1
  43. package/layout/design/{Row.design.js → Row.design/index.js} +13 -6
  44. package/layout/template/DataField.js +1 -1
  45. package/layout/template/Gallery.d.ts +3 -1
  46. package/layout/template/Gallery.js +4 -2
  47. package/layout/template/Row.js +1 -1
  48. package/layout/template/Tab.d.ts +1 -0
  49. package/layout/template/Tab.js +5 -3
  50. package/modal/template/Confirm/Switch.d.ts +2 -6
  51. package/modal/template/Confirm/Switch.js +2 -6
  52. package/package.json +1 -1
  53. package/tailwind.config.ts +2 -0
  54. package/version.txt +1 -1
  55. package/widget/design/Label.design.js +2 -1
  56. package/widget/design/Obstacle.design.d.ts +2 -0
  57. package/widget/design/Obstacle.design.js +13 -0
  58. package/widget/index.d.ts +2 -0
  59. package/widget/index.js +2 -0
  60. package/widget/template/Counter.d.ts +19 -0
  61. package/widget/template/Counter.js +48 -0
  62. package/widget/template/Input/Form.d.ts +1 -1
  63. package/widget/template/Input/Form.js +3 -2
  64. package/widget/template/Obstacle/index.d.ts +6 -0
  65. package/widget/template/Obstacle/index.js +13 -0
  66. package/widget/template/Pagination.d.ts +7 -0
  67. package/widget/template/Pagination.js +20 -0
  68. package/widget/template/Select/Handle.d.ts +2 -0
  69. package/widget/template/Select/Handle.js +30 -0
  70. package/widget/template/Select/Swipe.d.ts +10 -0
  71. package/widget/template/Select/Swipe.js +11 -0
  72. package/widget/template/Select/Switch.d.ts +3 -0
  73. package/widget/template/Select/Switch.js +43 -0
  74. package/widget/template/Select/Tag.d.ts +16 -0
  75. package/widget/template/Select/Tag.js +29 -0
  76. package/widget/template/Select/index.d.ts +8 -0
  77. package/widget/template/Select/index.js +5 -1
  78. package/widget/template/Switch/Switch.d.ts +17 -3
  79. package/widget/template/Switch/Switch.js +9 -10
  80. package/widget/template/Obstacle.d.ts +0 -4
  81. package/widget/template/Obstacle.js +0 -10
@@ -1,6 +1,8 @@
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 { useActionStore } from "../../store";
4
+ import { widthSizes } from "../../asset/sizes";
5
+ import SVG from "../../asset/SVG";
4
6
  const heightSize = {
5
7
  sm: "h-10",
6
8
  md: "h-13.75",
@@ -14,21 +16,21 @@ export default function DataFieldDesign({ id, dataField, option, }) {
14
16
  displays: "flex items-center",
15
17
  sizes: `w-full ${heightSize[height ?? "md"]}`,
16
18
  paddings: padding && padding,
17
- styles: "bg-white box-shadow-sm font-pretendard-bold",
19
+ styles: "bg-white box-shadow-sm font-pretendard-medium",
18
20
  };
19
21
  const block = {
20
22
  displays: "xl:hidden block ",
21
23
  sizes: container.sizes,
22
24
  };
23
25
  return (_jsxs(_Fragment, { children: [_jsx("div", { className: cn(container), children: dataField &&
24
- Object.keys(dataField).map((key) => (_jsx("div", { className: `w-${dataField[key]?.size}/100`, children: _jsxs("button", { onClick: () => setOrder(id, key), className: "flex items-center", children: [_jsx("div", { children: dataField[key]?.title }), _jsx("div", { className: "text-xs", children: orders?.map(({ orderBy, orderHow }) => {
26
+ Object.keys(dataField).map((key) => (_jsx("div", { className: widthSizes[dataField[key]?.size], children: _jsxs("button", { onClick: () => setOrder(id, key), className: "flex items-center", children: [_jsx("div", { children: dataField[key]?.title }), _jsx("div", { className: "text-xs", children: orders?.map(({ orderBy, orderHow }) => {
25
27
  if (orderBy === key) {
26
28
  if (orderHow === "asc")
27
- return (_jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M7.15859 15.0437C6.7079 15.9134 7.27152 17 8.17239 17H15.8279C16.7282 17 17.2919 15.9134 16.8417 15.0437L13.0145 7.65229C12.5638 6.78257 11.4365 6.78257 10.9858 7.65229L7.15859 15.0437Z", fill: "#105652" }) }, id + key + "asc"));
29
+ return _jsx(SVG.Direction.Asc, {});
28
30
  else if (orderHow === "desc")
29
- return (_jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M16.8414 8.95628C17.2921 8.08657 16.7285 7 15.8276 7L8.1721 7C7.27176 7 6.70813 8.08657 7.15831 8.95628L10.9855 16.3477C11.4362 17.2174 12.5635 17.2174 13.0142 16.3477L16.8414 8.95628Z", fill: "#105652" }) }, id + key + "asc"));
31
+ return _jsx(SVG.Direction.Desc, {});
30
32
  else
31
- return "";
33
+ return null;
32
34
  }
33
35
  }) })] }) }, id + key))) }), position && _jsx("div", { className: cn(block) })] }));
34
36
  }
@@ -0,0 +1,7 @@
1
+ import { DataSelectRoll } from "../../../interface";
2
+ interface SelectRollProps {
3
+ item: string | number;
4
+ data: DataSelectRoll;
5
+ }
6
+ export default function SelectRoll({ item, data }: SelectRollProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,39 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import { cn } from "../../../util";
4
+ export default function SelectRoll({ item, data }) {
5
+ const { options } = data ?? {};
6
+ const [isHover, setIsHover] = useState(false);
7
+ const keys = options?.map((option) => option.key);
8
+ const values = options?.map((option) => option.value);
9
+ const [index, setIndex] = useState(keys?.indexOf(String(item)) ?? 0);
10
+ const container = {
11
+ styles: "group cursor-default",
12
+ displays: "flex justify-center",
13
+ sizes: "w-[120px] ",
14
+ };
15
+ const body = {
16
+ positions: "relative",
17
+ displays: "flex justify-center items-center",
18
+ backgrounds: options[index].option?.background,
19
+ texts: options[index].option?.text,
20
+ sizes: "w-[120px] h-[30px]",
21
+ transitions: "duration-300",
22
+ hoverAct: isHover ? "w-[120px]" : "w-[100px]",
23
+ fonts: "text-[12px]",
24
+ styles: "rounded-[6px] leading-none overflow-hidden",
25
+ };
26
+ const toggle = {
27
+ positions: "absolute ",
28
+ displays: "flex justify-center items-center",
29
+ sizes: "w-[20px] h-full",
30
+ styles: "duration-300 text-gray-dark",
31
+ };
32
+ return (_jsx("div", { className: cn(container), children: _jsxs("div", { className: cn(body), onMouseLeave: () => setIsHover(false), onMouseEnter: () => setIsHover(true), children: [values[index], _jsx("button", { onClick: () => {
33
+ if (index > 0)
34
+ setIndex(index - 1);
35
+ }, className: cn(toggle, "-left-4 group-hover:left-1"), children: "-" }), _jsx("button", { onClick: () => {
36
+ if (index < keys.length - 1)
37
+ setIndex(index + 1);
38
+ }, className: cn(toggle, "-right-4 group-hover:right-1"), children: "+" })] }) }));
39
+ }
@@ -1,2 +1,2 @@
1
- import { RowProps } from "../../interface";
1
+ import { RowProps } from "../../../interface";
2
2
  export default function RowDesign<T>({ item, dataField, option, onClick, buttons, dot, }: RowProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,10 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useId } from "react";
3
- import { ColorSet } from "../../interface";
4
- import { cn } from "../../util";
5
- import { Label } from "../../widget";
6
- import { widthSizes } from "../../asset/sizes";
3
+ import { ColorSet, isDataSelectRoll, } from "../../../interface";
4
+ import { cn } from "../../../util";
5
+ import { Label } from "../../../widget";
6
+ import { widthSizes } from "../../../asset/sizes";
7
+ import SelectRoll from "./SelectRoll";
7
8
  export default function RowDesign({ item, dataField, option, onClick, buttons, dot, }) {
8
9
  const { size, padding, text, noHover, className, isPointer } = option ?? {};
9
10
  const id = useId();
@@ -27,10 +28,16 @@ export default function RowDesign({ item, dataField, option, onClick, buttons, d
27
28
  styles: "rounded-full",
28
29
  };
29
30
  return (_jsxs("div", { className: cn(container), onClick: () => onClick?.(), children: [typeof dot !== "undefined" && _jsx("div", { className: cn(flagBox) }), dataField &&
30
- Object.keys(dataField).map((key) => (_jsx("div", { className: cn(widthSizes[dataField[key]?.size], itemBox), children: String(item[key]) }, id + key))), _jsx("div", { className: "absolute right-4 xl:right-8 flex gap-4", children: buttons?.map(({ title, onClick, option }) => (_jsx(Label.Button, { title: title, onClick: onClick, option: {
31
+ Object.keys(dataField).map((key) => (_jsx("div", { className: cn(widthSizes[dataField[key]?.size], itemBox), children: _jsx(RowElement, { data: dataField[key]?.data, item: item[key] }) }, id + key))), _jsx("div", { className: "absolute right-4 xl:right-8 flex gap-4", children: buttons?.map(({ title, onClick, option }) => (_jsx(Label.Button, { title: title, onClick: onClick, option: {
31
32
  background: option?.background ?? "bg-crimson-dark",
32
33
  text: option?.text ?? "text-white",
33
34
  width: "xs",
34
35
  height: "xs",
35
36
  } }, id + title))) })] }));
36
37
  }
38
+ function RowElement(props) {
39
+ const { data } = props;
40
+ if (isDataSelectRoll(data))
41
+ return _jsx(SelectRoll, { item: props.item, data: data });
42
+ return _jsx(_Fragment, { children: props.item });
43
+ }
@@ -9,7 +9,7 @@ function Board({ id, dataField }) {
9
9
  function Card({ id, dataField }) {
10
10
  return (_jsx(DataFieldDesign, { id: id, dataField: dataField, option: {
11
11
  height: "sm",
12
- padding: "px-2 xs:px-4 xl:px-7.5",
12
+ padding: "px-2 xs:px-4 xl:px-5",
13
13
  } }));
14
14
  }
15
15
  const DataField = {
@@ -5,6 +5,8 @@ export default function Gallery({ action, children, option, }: {
5
5
  };
6
6
  children: React.ReactNode;
7
7
  option?: {
8
- tabTextColor?: string;
8
+ text?: string;
9
+ background?: string;
10
+ boundary?: string;
9
11
  };
10
12
  }): import("react/jsx-runtime").JSX.Element;
@@ -3,12 +3,14 @@ import Action from "./Action";
3
3
  import Tab from "./Tab";
4
4
  import { cn } from "../../util";
5
5
  export default function Gallery({ action, children, option, }) {
6
- const { tabTextColor } = option ?? {};
6
+ const { text, background, boundary } = option ?? {};
7
7
  const tabBox = {
8
8
  positions: "xl:absolute xl:-bottom-18 xl:left-0 z-5",
9
9
  };
10
10
  return (_jsxs("div", { className: "relative w-full flex", children: [_jsx(Action.Replace, { actions: action?.replaces, children: _jsx(Action.Show, { actions: action?.shows, children: children }) }), action?.tabs && (_jsx(Tab, { tabs: action?.tabs, option: {
11
11
  className: cn(tabBox),
12
- text: tabTextColor,
12
+ text,
13
+ background,
14
+ boundary,
13
15
  } }))] }));
14
16
  }
@@ -22,7 +22,7 @@ function Card({ item, dataField, onClick, buttons, height, noPadding, noHover, d
22
22
  const id = useId();
23
23
  return (_jsx(RowDesign, { onClick: onClick, item: item, dataField: dataField, buttons: buttons, dot: dot, option: {
24
24
  size: `w-full ${height ?? "h-15"}`,
25
- padding: !noPadding ? "px-2 xs:px-4 xl:px-7.5" : "",
25
+ padding: !noPadding ? "px-2 xs:px-4 xl:px-5" : "",
26
26
  text: "text-base",
27
27
  noHover,
28
28
  } }, id));
@@ -5,6 +5,7 @@ interface Options {
5
5
  className?: string;
6
6
  width?: Size;
7
7
  height?: Size;
8
+ boundary?: string;
8
9
  }
9
10
  export default function Tab({ tabs, option, state, }: {
10
11
  tabs: (Button & {
@@ -10,7 +10,7 @@ const heightSize = {
10
10
  lg: "h-9",
11
11
  };
12
12
  export default function Tab({ tabs, option, state, }) {
13
- const { className, background, text, width, height } = option ?? {};
13
+ const { className, background, boundary, text, width, height } = option ?? {};
14
14
  const [tabsSelection, setTabsSelection] = state
15
15
  ? state
16
16
  : useState(tabs.map((_, i) => i === 0));
@@ -20,7 +20,7 @@ export default function Tab({ tabs, option, state, }) {
20
20
  displays: "hidden xl:flex xl:items-center xl:gap-2.5",
21
21
  sizes: "w-auto",
22
22
  paddings: "p-2.5",
23
- backgrounds: background ?? "bg-white/30",
23
+ backgrounds: boundary ?? "bg-white/30",
24
24
  styles: "rounded-xl ",
25
25
  };
26
26
  const button = {
@@ -32,6 +32,8 @@ export default function Tab({ tabs, option, state, }) {
32
32
  !isStatic &&
33
33
  setTabsSelection(tabsSelection.map((_, i) => i === index));
34
34
  return onClick && onClick();
35
- }, className: cn(button, `${!isStatic && tabsSelection[index] && "bg-white rounded-2xl"}`, `${isStatic &&
35
+ }, className: cn(button, `${!isStatic &&
36
+ tabsSelection[index] &&
37
+ `${background ?? "bg-white"} rounded-2xl`}`, `${isStatic &&
36
38
  `${option?.background ?? "bg-green-dark"} ${option?.text ?? "text-white"} `}`), children: title }, title))) }));
37
39
  }
@@ -1,11 +1,7 @@
1
- import { SwitchProps } from "../../../interface";
2
1
  import { ConfirmModalProps } from "../../../interface/Modal";
2
+ import { SelectSwitchProps } from "../../../interface/widget/Select";
3
3
  interface SwitchModalProps<T> extends ConfirmModalProps {
4
- switch: SwitchProps<T>;
4
+ switch: SelectSwitchProps<T>;
5
5
  }
6
6
  declare function SwitchModal<T>(props: SwitchModalProps<T>): import("react/jsx-runtime").JSX.Element;
7
- declare namespace SwitchModal {
8
- var Handle: typeof SwitchModalHandle;
9
- }
10
- declare function SwitchModalHandle<T>(props: Omit<SwitchModalProps<T>, "display">): import("react/jsx-runtime").JSX.Element;
11
7
  export default SwitchModal;
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Switch } from "../../../widget";
2
+ import { Select } from "../../../widget";
3
3
  import ConfirmModalDesign from "../../design/ConfirmModal.design";
4
4
  import { cn } from "../../../util";
5
5
  function SwitchModalDesign(props) {
@@ -10,10 +10,6 @@ function SwitchModalDesign(props) {
10
10
  return (_jsx(ConfirmModalDesign, { ...props, children: _jsx("div", { className: cn(container), children: props.children }) }));
11
11
  }
12
12
  function SwitchModal(props) {
13
- return (_jsx(SwitchModalDesign, { ...props, children: _jsxs(_Fragment, { children: [_jsx(Switch, { ...props.switch }), props.children] }) }));
13
+ return (_jsx(SwitchModalDesign, { ...props, children: _jsxs(_Fragment, { children: [_jsx(Select.Switch, { ...props.switch }), props.children] }) }));
14
14
  }
15
- function SwitchModalHandle(props) {
16
- return (_jsx(SwitchModalDesign, { ...props, children: _jsxs(_Fragment, { children: [_jsx(Switch.Handle, { ...props.switch }), props.children] }) }));
17
- }
18
- SwitchModal.Handle = SwitchModalHandle;
19
15
  export default SwitchModal;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edu-tosel/design",
3
- "version": "1.0.65",
3
+ "version": "1.0.67",
4
4
  "description": "UI components for International TOSEL Committee",
5
5
  "keywords": [
6
6
  "jsx",
@@ -163,6 +163,7 @@ export default {
163
163
  22.5: "5.625rem",
164
164
  23: "5.75rem",
165
165
  23.25: "5.8125rem",
166
+ 23.5: "5.875rem",
166
167
  23.75: "5.9375rem",
167
168
  25: "6.25rem",
168
169
  25.75: "6.4375rem",
@@ -209,6 +210,7 @@ export default {
209
210
  75: "18.75rem",
210
211
  76: "19rem",
211
212
  78: "20rem",
213
+ 81: "20.25rem",
212
214
  82: "20.5rem",
213
215
  84: "21rem",
214
216
  85: "21.25rem",
package/version.txt CHANGED
@@ -1 +1 @@
1
- 1.0.65
1
+ 1.0.67
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { cn } from "../../util";
3
- import Obstacle from "../template/Obstacle";
3
+ import { Obstacle } from "../..";
4
4
  const widthSize = {
5
5
  xs: "w-10",
6
6
  sm: "w-22.5",
@@ -10,6 +10,7 @@ const widthSize = {
10
10
  const heightSize = {
11
11
  xs: "h-6.25",
12
12
  sm: "h-11.25",
13
+ md: "h-12.25",
13
14
  };
14
15
  export default function LabelDesign({ title, onClick, option, hoverState, }) {
15
16
  const [hover, setHover] = hoverState ?? [false, () => { }];
@@ -0,0 +1,2 @@
1
+ import { ObstacleProps } from "../../interface/widget/Obstacle";
2
+ export default function ObstacleDesign({ disabled, children, option, }: ObstacleProps): false | import("react/jsx-runtime").JSX.Element | undefined;
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from "../../util";
3
+ export default function ObstacleDesign({ disabled, children, option, }) {
4
+ const { position, background, size } = option ?? {};
5
+ const obstacle = {
6
+ default: "absolute",
7
+ displays: "flex justify-center items-center",
8
+ positions: position ?? "top-0 left-0",
9
+ sizes: "w-full h-full",
10
+ background: background ?? "bg-white/30",
11
+ };
12
+ return (disabled && (_jsx("div", { onClick: typeof disabled === "function" ? disabled : undefined, className: cn(obstacle), children: children })));
13
+ }
package/widget/index.d.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  export { default as Input } from "./template/Input";
2
+ export { default as Counter } from "./template/Counter";
2
3
  export { default as Select } from "./template/Select";
3
4
  export { default as DatePicker } from "./template/DatePicker";
4
5
  export { default as CheckBox } from "./template/CheckBox";
5
6
  export { default as Label } from "./template/Label";
6
7
  export { default as Switch } from "./template/Switch";
7
8
  export { default as Toggle } from "./template/Toggle";
9
+ export { default as Obstacle } from "./template/Obstacle";
package/widget/index.js CHANGED
@@ -1,7 +1,9 @@
1
1
  export { default as Input } from "./template/Input";
2
+ export { default as Counter } from "./template/Counter";
2
3
  export { default as Select } from "./template/Select";
3
4
  export { default as DatePicker } from "./template/DatePicker";
4
5
  export { default as CheckBox } from "./template/CheckBox";
5
6
  export { default as Label } from "./template/Label";
6
7
  export { default as Switch } from "./template/Switch";
7
8
  export { default as Toggle } from "./template/Toggle";
9
+ export { default as Obstacle } from "./template/Obstacle";
@@ -0,0 +1,19 @@
1
+ import { Titles } from "../../interface";
2
+ interface Count {
3
+ title: string;
4
+ count: number;
5
+ option?: {
6
+ background?: string;
7
+ text?: string;
8
+ };
9
+ }
10
+ interface CounterProps {
11
+ titles: Titles;
12
+ counts: Count[];
13
+ option?: {
14
+ position?: string;
15
+ boundary?: string;
16
+ };
17
+ }
18
+ export default function Counter({ titles, counts, option }: CounterProps): import("react/jsx-runtime").JSX.Element;
19
+ export {};
@@ -0,0 +1,48 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from "../../util";
3
+ export default function Counter({ titles, counts, option }) {
4
+ const { position, boundary } = option ?? {};
5
+ const container = {
6
+ default: "absolute",
7
+ displays: "flex justify-between items-end",
8
+ sizes: "w-full h-15",
9
+ positions: position ?? "top-5 right-0",
10
+ boundaries: boundary ?? "px-5",
11
+ };
12
+ const titleBox = {};
13
+ const countBox = {
14
+ displays: "flex gap-x-5",
15
+ sizes: "h-full",
16
+ };
17
+ const total = {
18
+ sizes: "w-12 h-full",
19
+ displays: "flex flex-col items-center justify-between",
20
+ backgrounds: "bg-gray-light",
21
+ styles: "rounded-[4px] p-1",
22
+ };
23
+ return (_jsxs("div", { className: cn(container), children: [_jsx("div", { className: cn(titleBox), children: titles.title }), _jsxs("div", { className: cn(countBox), children: [_jsx("div", { className: "flex gap-x-2.5 h-full", children: counts?.map((count) => (_jsx(CountBox, { ...count }, count.title))) }), _jsxs("div", { className: cn(total), children: [_jsx("div", { className: "text-xs text-gray-medium leading-tight", children: "\uC804\uCCB4" }), _jsx("div", { className: "font-pretendard-bold w-full leading-none text-end ", children: Object.values(counts)
24
+ .map((count) => count.count)
25
+ .reduce((acc, cur) => acc + cur, 0) })] })] })] }));
26
+ }
27
+ function CountBox({ title, count, option }) {
28
+ const { background, text } = option ?? {};
29
+ const container = {
30
+ displays: "flex flex-col items-center justify-between",
31
+ sizes: "w-12 h-full",
32
+ boundaries: "pb-1 pr-1",
33
+ };
34
+ const titleBox = {
35
+ displays: "flex justify-center items-center",
36
+ fonts: "text-xs leading-none",
37
+ sizes: "w-12 h-5.5",
38
+ backgrounds: background ?? "bg-gray-light",
39
+ texts: text ?? "text-gray-medium",
40
+ styles: "rounded-[4px]",
41
+ };
42
+ const countBox = {
43
+ fonts: "font-pretendard-bold text-end leading-none",
44
+ sizes: "w-full",
45
+ boundaries: "pr-1",
46
+ };
47
+ return (_jsxs("div", { className: cn(container), children: [_jsx("div", { className: cn(titleBox), children: title }), _jsx("div", { className: cn(countBox), children: count })] }));
48
+ }
@@ -1,2 +1,2 @@
1
1
  import { InputWidget } from "../../../interface";
2
- export default function LG({ state, placeholder, isValid, type, label, maxLength, }: InputWidget): import("react/jsx-runtime").JSX.Element;
2
+ export default function LG({ state, placeholder, isValid, type, label, maxLength, disabled, }: InputWidget): import("react/jsx-runtime").JSX.Element;
@@ -2,7 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useRef, useState } from "react";
3
3
  import { cn, gradient } from "../../../util";
4
4
  import Label from "../Label";
5
- export default function LG({ state, placeholder, isValid, type, label, maxLength, }) {
5
+ import Obstacle from "../Obstacle";
6
+ export default function LG({ state, placeholder, isValid, type, label, maxLength, disabled, }) {
6
7
  const [value, setValue] = state;
7
8
  const [onFocus, setOnFocus] = useState(false);
8
9
  const ref = useRef(null);
@@ -44,5 +45,5 @@ export default function LG({ state, placeholder, isValid, type, label, maxLength
44
45
  background: label.option?.background ?? gradient.bg.greenToRed,
45
46
  text: label.option?.text ?? "text-white",
46
47
  ...label.option,
47
- } }))] }));
48
+ } })), _jsx(Obstacle, { disabled: disabled })] }));
48
49
  }
@@ -0,0 +1,6 @@
1
+ import { ObstacleProps } from "../../../interface/widget/Obstacle";
2
+ declare function Obstacle(props: ObstacleProps): import("react/jsx-runtime").JSX.Element;
3
+ declare namespace Obstacle {
4
+ var Blur: (props: ObstacleProps) => import("react/jsx-runtime").JSX.Element;
5
+ }
6
+ export default Obstacle;
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import ObstacleDesign from "../../design/Obstacle.design";
3
+ function Obstacle(props) {
4
+ return _jsx(ObstacleDesign, { ...props });
5
+ }
6
+ function Blur(props) {
7
+ return (_jsx(ObstacleDesign, { ...props, option: {
8
+ background: "bg-white/30 backdrop-blur-sm",
9
+ position: props.option?.position ?? "top-0 left-0",
10
+ } }));
11
+ }
12
+ Obstacle.Blur = Blur;
13
+ export default Obstacle;
@@ -0,0 +1,7 @@
1
+ import { State } from "../../interface";
2
+ interface PaginationProps<T> {
3
+ state: State<number>;
4
+ items?: T[];
5
+ }
6
+ export default function Pagination<T>({ state, items }: PaginationProps<T>): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from "../../util";
3
+ import SVG from "../../asset/SVG";
4
+ export default function Pagination({ state, items }) {
5
+ const [page, setPage] = state;
6
+ const container = {
7
+ displays: "flex items-center justify-between",
8
+ sizes: "w-23.5 h-6.25",
9
+ backgrounds: "bg-gray-dark",
10
+ boundaries: "rounded-full px-2.5",
11
+ fonts: "text-xs",
12
+ };
13
+ return (_jsxs("div", { className: cn(container), children: [_jsx(SVG.Symbol.LessThan, { onClick: () => {
14
+ if (page > 1)
15
+ setPage(page - 1);
16
+ } }), _jsxs("div", { className: "flex items-center gap-x-[3px] text-white", children: [page, _jsx("div", { className: "text-gray-medium text-base font-pretendard-bold", children: "/" }), items ? items.length : 1] }), _jsx(SVG.Symbol.GreaterThan, { onClick: () => {
17
+ if (items && items.length > page)
18
+ setPage(page + 1);
19
+ } })] }));
20
+ }
@@ -0,0 +1,2 @@
1
+ import { SelectHandleProps } from "../../../interface/widget/Select";
2
+ export default function SelectHandle<T>({ state, options, option, }: SelectHandleProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,30 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { widthSizes } from "../../../asset/sizes";
3
+ import { cn, gradient } from "../../../util";
4
+ export default function SelectHandle({ state, options, option, }) {
5
+ const { className } = option ?? {};
6
+ const length = options?.length;
7
+ const valueIndex = Object.values(options)
8
+ .map(({ value }) => value)
9
+ ?.indexOf(state?.[0]);
10
+ const container = {
11
+ positions: "relative",
12
+ sizes: "w-102.5 h-10",
13
+ styles: "rounded-full bg-gray-light p-1.25",
14
+ className,
15
+ };
16
+ const area = {
17
+ sizes: `${widthSizes[Math.round(((valueIndex + 1) / length) * 100)]} h-7.5`,
18
+ displays: "flex justify-end",
19
+ background: gradient.bg.greenToRed,
20
+ styles: "rounded-full p-1.25",
21
+ animations: "duration-200",
22
+ };
23
+ const handle = {
24
+ sizes: "w-5 h-5",
25
+ styles: "rounded-full bg-white",
26
+ };
27
+ return (_jsxs("div", { className: cn(container), children: [_jsx("div", { className: cn(area), children: _jsx("div", { className: cn(handle) }) }), _jsx("div", { className: "absolute flex w-full h-full top-0 left-0", children: options?.map(({ value }) => (_jsx("button", { onClick: () => {
28
+ return state?.[1](value);
29
+ }, className: "flex flex-1 h-10 " }, value))) })] }));
30
+ }
@@ -0,0 +1,10 @@
1
+ interface SwipeProps<T> {
2
+ title: string;
3
+ children: React.ReactNode;
4
+ selectOptions: {
5
+ title: string;
6
+ value: T;
7
+ }[];
8
+ }
9
+ export default function Swipe<T>({ title, children, selectOptions, }: SwipeProps<T>): import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import Pagination from "../Pagination";
4
+ import { cn } from "../../../util";
5
+ export default function Swipe({ title, children, selectOptions, }) {
6
+ const page = useState(1);
7
+ const container = {
8
+ displays: "flex flex-col gap-y-3",
9
+ };
10
+ return (_jsxs("div", { className: cn(container), children: [_jsxs("div", { className: "flex justify-between", children: [_jsx("div", { children: title }), _jsx(Pagination, { state: page, items: selectOptions })] }), children] }));
11
+ }
@@ -0,0 +1,3 @@
1
+ import { SelectSwitchProps } from "../../../interface/widget/Select";
2
+ declare function SelectSwitch<T>({ state, selectOptions, option, }: SelectSwitchProps<T>): import("react/jsx-runtime").JSX.Element;
3
+ export default SelectSwitch;
@@ -0,0 +1,43 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from "../../../util";
3
+ const paddingSize = {
4
+ md: "p-1.5",
5
+ lg: "p-2.5",
6
+ };
7
+ const widthSize = {
8
+ md: "w-81",
9
+ lg: "w-100",
10
+ };
11
+ const heightSize = {
12
+ md: "h-10.5",
13
+ lg: "h-20",
14
+ };
15
+ const gapSize = {
16
+ md: "gap-x-1.5",
17
+ lg: "gap-x-2.5",
18
+ };
19
+ const textSize = {
20
+ md: "text-sm",
21
+ lg: "text-base",
22
+ };
23
+ function SelectSwitch({ state, selectOptions, option, }) {
24
+ const { text, size, className } = option ?? {};
25
+ const container = {
26
+ sizes: `${widthSize[size ?? "md"]} ${heightSize[size ?? "md"]}`,
27
+ displays: `flex ${gapSize[size ?? "md"]}`,
28
+ paddings: paddingSize[size ?? "md"],
29
+ styles: "rounded-full bg-gray-light",
30
+ className,
31
+ };
32
+ const button = (flag) => ({
33
+ displays: "flex flex-1 gap-x-3 justify-center items-center",
34
+ backgrounds: flag ? "bg-white" : "bg-transparent",
35
+ text,
36
+ textSizes: textSize[size ?? "md"],
37
+ styles: "rounded-full ",
38
+ });
39
+ return (_jsx("div", { className: cn(container), children: selectOptions?.map(({ value, icon, title }) => {
40
+ return (_jsxs("button", { onClick: () => state[1](value), className: cn(button(value === state[0])), children: [icon && _jsx("img", { src: icon }), _jsx("div", { children: title })] }));
41
+ }) }));
42
+ }
43
+ export default SelectSwitch;
@@ -0,0 +1,16 @@
1
+ import { State } from "../../../interface";
2
+ interface SelectTagProps<T> {
3
+ state: State<T[]>;
4
+ selectOptions: {
5
+ title: string;
6
+ value: T;
7
+ }[];
8
+ selectHow?: "one" | "plural";
9
+ option?: {
10
+ className?: string;
11
+ background?: string;
12
+ text?: string;
13
+ };
14
+ }
15
+ export default function SelectTag<T>(props: SelectTagProps<T>): import("react/jsx-runtime").JSX.Element;
16
+ export {};