@edu-tosel/design 1.0.66 → 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 (47) hide show
  1. package/card/design/TableCard.design.js +7 -4
  2. package/card/template/ConfirmCard/index.d.ts +3 -0
  3. package/card/template/ConfirmCard/index.js +3 -3
  4. package/card/template/ProgressCard/Large.d.ts +1 -1
  5. package/card/template/ProgressCard/Large.js +4 -4
  6. package/card/template/ProgressCard/Small.d.ts +1 -1
  7. package/card/template/ProgressCard/Small.js +2 -2
  8. package/interaction/index.d.ts +1 -0
  9. package/interaction/index.js +1 -0
  10. package/interaction/template/Lock.d.ts +3 -0
  11. package/interaction/template/Lock.js +4 -0
  12. package/interface/Card.d.ts +5 -2
  13. package/interface/widget/Obstacle.d.ts +10 -0
  14. package/interface/widget/Obstacle.js +1 -0
  15. package/interface/widget/Select.d.ts +23 -0
  16. package/interface/widget/Select.js +1 -0
  17. package/layout/design/DataField.design.js +1 -1
  18. package/modal/template/Confirm/Switch.d.ts +2 -6
  19. package/modal/template/Confirm/Switch.js +2 -6
  20. package/package.json +1 -1
  21. package/tailwind.config.ts +2 -0
  22. package/version.txt +1 -1
  23. package/widget/design/Label.design.js +1 -1
  24. package/widget/design/Obstacle.design.d.ts +2 -0
  25. package/widget/design/Obstacle.design.js +13 -0
  26. package/widget/index.d.ts +2 -0
  27. package/widget/index.js +2 -0
  28. package/widget/template/Counter.d.ts +19 -0
  29. package/widget/template/Counter.js +48 -0
  30. package/widget/template/Obstacle/index.d.ts +6 -0
  31. package/widget/template/Obstacle/index.js +13 -0
  32. package/widget/template/Pagination.d.ts +7 -0
  33. package/widget/template/Pagination.js +20 -0
  34. package/widget/template/Select/Handle.d.ts +2 -0
  35. package/widget/template/Select/Handle.js +30 -0
  36. package/widget/template/Select/Swipe.d.ts +10 -0
  37. package/widget/template/Select/Swipe.js +11 -0
  38. package/widget/template/Select/Switch.d.ts +3 -0
  39. package/widget/template/Select/Switch.js +43 -0
  40. package/widget/template/Select/Tag.d.ts +16 -0
  41. package/widget/template/Select/Tag.js +29 -0
  42. package/widget/template/Select/index.d.ts +8 -0
  43. package/widget/template/Select/index.js +5 -1
  44. package/widget/template/Switch/Switch.d.ts +17 -3
  45. package/widget/template/Switch/Switch.js +9 -10
  46. package/widget/template/Obstacle.d.ts +0 -4
  47. package/widget/template/Obstacle.js +0 -10
@@ -1,11 +1,12 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useId } from "react";
3
3
  import { useActionStore } from "../../store";
4
4
  import { cn, sortByOrder } from "../../util";
5
5
  import Card from "./Card.design";
6
- import { DataField, Action, Row } from "../..";
6
+ import { DataField, Action, Row, Lock } from "../..";
7
+ import { Obstacle } from "../..";
7
8
  export default function TableCardDesign({ dataSet, dataField, option, }) {
8
- const { width, height, padding, boundary } = option ?? {};
9
+ const { width, height, padding, boundary, isDisabled, disabledScript } = option ?? {};
9
10
  const { order } = useActionStore();
10
11
  const id = useId();
11
12
  const orders = order[id] ?? [];
@@ -20,5 +21,7 @@ export default function TableCardDesign({ dataSet, dataField, option, }) {
20
21
  height: height ?? "3xl",
21
22
  overflow: "overflow-y-scroll overflow-x-hidden",
22
23
  noPadding: true,
23
- }, children: _jsx(Action.Replace, { actions: dataSet?.replaces, children: sortByOrder({ items: dataSet?.items, orders }).map((item, index) => dataSet.renderItem ? (dataSet.renderItem(item)) : (_jsx(Row.Card, { item: item, onClick: () => dataSet.onClick?.(item), dataField: dataField, height: option?.rowHeight, noHover: option?.noHover, noPadding: option?.noRowPadding }, id + index))) }) }));
24
+ }, children: _jsxs(Action.Replace, { actions: dataSet?.replaces, children: [sortByOrder({ items: dataSet?.items, orders }).map((item, index) => dataSet.renderItem ? (dataSet.renderItem(item)) : (_jsx(Row.Card, { item: item, onClick: () => dataSet.onClick?.(item), dataField: dataField, height: option?.rowHeight, noHover: option?.noHover, noPadding: option?.noRowPadding }, id + index))), _jsx(Obstacle, { disabled: isDisabled }), _jsx(Obstacle.Blur, { disabled: isDisabled, option: {
25
+ position: "top-10",
26
+ }, children: _jsx(Lock, { script: disabledScript }) })] }) }));
24
27
  }
@@ -4,6 +4,9 @@ interface ConfirmCardProps {
4
4
  action?: Omit<ActionProps, "shows">;
5
5
  children?: React.ReactNode;
6
6
  buttons: [LabelWidget, LabelWidget];
7
+ option?: {
8
+ className?: string;
9
+ };
7
10
  }
8
11
  export default function ConfirmCard(props: ConfirmCardProps): import("react/jsx-runtime").JSX.Element;
9
12
  export {};
@@ -3,17 +3,17 @@ import { cn } from "../../../util";
3
3
  import { LineBreaks, Action, Label } from "../../..";
4
4
  import CardDesign from "../../design/Card.design";
5
5
  export default function ConfirmCard(props) {
6
- const { action } = props ?? {};
6
+ const { action, option } = props ?? {};
7
7
  return (_jsxs(CardDesign, { option: {
8
8
  width: "md",
9
9
  height: "lg",
10
10
  className: "p-5",
11
- }, children: [_jsx(Header, { titles: props.titles }), _jsx(Action.Replace, { actions: action?.replaces, children: props.children }), _jsx("div", { className: "absolute bottom-5 left-5 flex justify-between gap-2.5", children: props.buttons.map(({ title, onClick, option }) => (_jsx(Label.Button, { title: title, onClick: onClick, option: { ...option, width: "lg", height: "sm" } }, title))) })] }));
11
+ }, children: [_jsx(Header, { titles: props.titles }), _jsx("div", { className: option?.className, children: _jsx(Action.Replace, { actions: action?.replaces, children: props.children }) }), _jsx("div", { className: "absolute bottom-5 left-5 flex justify-between gap-2.5", children: props.buttons.map(({ title, onClick, option }) => (_jsx(Label.Button, { title: title, onClick: onClick, option: { ...option, width: "lg", height: "sm" } }, title))) })] }));
12
12
  }
13
13
  function Header({ titles }) {
14
14
  const titleBox = {
15
15
  displays: "flex flex-col items-end",
16
16
  sizes: "w-full",
17
17
  };
18
- return (_jsxs("div", { className: cn(titleBox), children: [_jsx("div", { className: "text-xl leading-none font-pretendard-bold", children: titles.title }), _jsx("div", { className: "bg-gray-light w-13.75 h-2 mt-3" }), _jsx(LineBreaks, { texts: titles.subtitle, className: "mt-5 text-base leading-none text-end font-pretendard-bold" })] }));
18
+ return (_jsxs("div", { className: cn(titleBox), children: [_jsx("div", { className: "text-xl leading-none font-pretendard-bold", children: titles.title }), _jsx("div", { className: "bg-gray-light w-13.75 h-2 mt-3" }), _jsx(LineBreaks, { texts: titles.subtitle, className: "mt-5 text-base leading-none text-end font-pretendard-medium" })] }));
19
19
  }
@@ -1,2 +1,2 @@
1
1
  import { ProgressCardProps } from "../../../interface";
2
- export default function ProgressCardLG({ titles, steps, theme, }: ProgressCardProps): import("react/jsx-runtime").JSX.Element;
2
+ export default function ProgressCardLG({ titles, checks, displays, theme, }: ProgressCardProps): import("react/jsx-runtime").JSX.Element;
@@ -14,7 +14,7 @@ const text = {
14
14
  green: "text-green-dark",
15
15
  blue: "text-blue-navy",
16
16
  };
17
- export default function ProgressCardLG({ titles, steps, theme, }) {
17
+ export default function ProgressCardLG({ titles, checks, displays, theme, }) {
18
18
  const progressBox = {
19
19
  positions: "absolute top-7.5 left-7.5",
20
20
  displays: "flex",
@@ -32,11 +32,11 @@ export default function ProgressCardLG({ titles, steps, theme, }) {
32
32
  displays: "flex flex-col items-end gap-y-3",
33
33
  };
34
34
  const occupied = [
35
- steps.filter(([_, value]) => !!value).length,
36
- steps.length,
35
+ checks.map((value) => !!value).length,
36
+ displays.length,
37
37
  ].join("/");
38
38
  return (_jsxs(CardDesign, { option: {
39
39
  width: "2xl",
40
40
  height: "2xs",
41
- }, children: [_jsx("div", { className: cn(progressBox), children: steps.map(([{ title }, value]) => (_jsxs("div", { className: cn(stepBox(value)), children: [_jsx("div", { children: title }), _jsx(SVG.Operation.Checked, { flag: value, size: 25, theme: theme })] }, title))) }), _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"]}` }) })] }));
41
+ }, children: [_jsx("div", { className: cn(progressBox), children: displays.map(({ title }, index) => (_jsxs("div", { className: cn(stepBox(checks[index])), children: [_jsx("div", { children: title }), _jsx(SVG.Operation.Checked, { flag: checks[index], size: 25, theme: theme })] }, title))) }), _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
42
  }
@@ -1,2 +1,2 @@
1
1
  import { ProgressCardProps } from "../../../interface";
2
- export default function ProgressCardSmall({ titles, steps, theme, }: ProgressCardProps): import("react/jsx-runtime").JSX.Element;
2
+ export default function ProgressCardSmall({ titles, displays, checks, theme, }: ProgressCardProps): import("react/jsx-runtime").JSX.Element;
@@ -10,7 +10,7 @@ const text = {
10
10
  green: "text-green-dark",
11
11
  blue: "text-blue-navy",
12
12
  };
13
- export default function ProgressCardSmall({ titles, steps, theme = "green", }) {
13
+ export default function ProgressCardSmall({ titles, displays, checks, theme = "green", }) {
14
14
  const progressBox = {
15
15
  positions: "absolute top-2.5 left-2.5",
16
16
  displays: "flex",
@@ -30,5 +30,5 @@ export default function ProgressCardSmall({ titles, steps, theme = "green", }) {
30
30
  return (_jsxs(CardDesign, { option: {
31
31
  width: "md",
32
32
  height: "5xs",
33
- }, children: [_jsx("div", { className: cn(progressBox), children: steps.map(([{ title, subtitle }, value]) => (_jsxs("div", { className: cn(stepBox(value)), children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("div", { className: "leading-none text-[12px] font-pretendard-bold", children: title }), _jsx(SVG.Operation.Checked, { flag: value, size: 25, theme: theme })] }), _jsx("div", { className: `text-[12px] ${text[theme]}`, children: subtitle })] }, title))) }), _jsxs("div", { className: cn(titleBox), children: [_jsx("div", { className: `text-[20px] leading-none font-pretendard-bold ${text[theme]}`, children: titles.title }), _jsx("div", { className: `text-[12px] leading-none ${text[theme]}`, children: titles.subtitle })] })] }));
33
+ }, children: [_jsx("div", { className: cn(progressBox), children: displays.map(({ title, subtitle }, index) => (_jsxs("div", { className: cn(stepBox(checks[index])), children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("div", { className: "leading-none text-[12px] font-pretendard-bold", children: title }), _jsx(SVG.Operation.Checked, { flag: checks[index], size: 25, theme: theme })] }), _jsx("div", { className: `text-[12px] ${text[theme]}`, children: subtitle })] }, title))) }), _jsxs("div", { className: cn(titleBox), children: [_jsx("div", { className: `text-[20px] leading-none font-pretendard-bold ${text[theme]}`, children: titles.title }), _jsx("div", { className: `text-[12px] leading-none ${text[theme]}`, children: titles.subtitle })] })] }));
34
34
  }
@@ -1,2 +1,3 @@
1
1
  export { default as Loading } from "./template/Loading";
2
2
  export { default as NoData } from "./template/NoData";
3
+ export { default as Lock } from "./template/Lock";
@@ -1,2 +1,3 @@
1
1
  export { default as Loading } from "./template/Loading";
2
2
  export { default as NoData } from "./template/NoData";
3
+ export { default as Lock } from "./template/Lock";
@@ -0,0 +1,3 @@
1
+ export default function Lock({ script }: {
2
+ script?: string;
3
+ }): 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 Lock({ script }) {
3
+ return (_jsxs("div", { className: "flex flex-col gap-y-3 items-center", children: [_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", children: _jsx("path", { d: "M16.5 10.5V6.75C16.5 5.55653 16.0259 4.41193 15.182 3.56802C14.3381 2.72411 13.1935 2.25 12 2.25C10.8065 2.25 9.66193 2.72411 8.81802 3.56802C7.97411 4.41193 7.5 5.55653 7.5 6.75V10.5M6.75 21.75H17.25C17.8467 21.75 18.419 21.5129 18.841 21.091C19.2629 20.669 19.5 20.0967 19.5 19.5V12.75C19.5 12.1533 19.2629 11.581 18.841 11.159C18.419 10.7371 17.8467 10.5 17.25 10.5H6.75C6.15326 10.5 5.58097 10.7371 5.15901 11.159C4.73705 11.581 4.5 12.1533 4.5 12.75V19.5C4.5 20.0967 4.73705 20.669 5.15901 21.091C5.58097 21.5129 6.15326 21.75 6.75 21.75Z", stroke: "#173A8B", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }), _jsx("div", { className: "text-xs text-blue-navy", children: script })] }));
4
+ }
@@ -1,4 +1,4 @@
1
- import { Button, Disabled, OnClick, Size, State, Step, Titles } from "./Property";
1
+ import { Button, Disabled, OnClick, Size, State, Titles } from "./Property";
2
2
  import { DataSet, DataField } from "./Data";
3
3
  import { Theme } from "./Theme";
4
4
  import { Flexify } from "./UtilityType";
@@ -126,6 +126,8 @@ export interface TableCardProps<T> extends Omit<CardProps, "children"> {
126
126
  noHover?: boolean;
127
127
  noRowPadding?: boolean;
128
128
  noHeader?: boolean;
129
+ isDisabled?: boolean;
130
+ disabledScript?: string;
129
131
  };
130
132
  }
131
133
  export interface RollCardProps extends CardProps {
@@ -138,7 +140,8 @@ export interface RollCardProps extends CardProps {
138
140
  }
139
141
  export interface ProgressCardProps {
140
142
  titles: Titles;
141
- steps: Step[];
143
+ checks: boolean[];
144
+ displays: Titles[];
142
145
  theme?: Theme;
143
146
  }
144
147
  export {};
@@ -0,0 +1,10 @@
1
+ import { Disabled } from "../Property";
2
+ export interface ObstacleProps {
3
+ disabled?: Disabled;
4
+ children?: React.ReactNode;
5
+ option?: {
6
+ position?: string;
7
+ size?: string;
8
+ background?: string;
9
+ };
10
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,23 @@
1
+ import { Size, State } from "../Property";
2
+ interface SelectOption<T> {
3
+ title: string;
4
+ value: T;
5
+ icon?: string;
6
+ }
7
+ export interface SelectSwitchProps<T> {
8
+ state: State<T>;
9
+ selectOptions: SelectOption<T>[];
10
+ option?: {
11
+ size?: Size;
12
+ text?: string;
13
+ className?: string;
14
+ };
15
+ }
16
+ export interface SelectHandleProps<T> {
17
+ state: State<T>;
18
+ options: SelectOption<T>[];
19
+ option?: {
20
+ className?: string;
21
+ };
22
+ }
23
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -16,7 +16,7 @@ export default function DataFieldDesign({ id, dataField, option, }) {
16
16
  displays: "flex items-center",
17
17
  sizes: `w-full ${heightSize[height ?? "md"]}`,
18
18
  paddings: padding && padding,
19
- styles: "bg-white box-shadow-sm font-pretendard-bold",
19
+ styles: "bg-white box-shadow-sm font-pretendard-medium",
20
20
  };
21
21
  const block = {
22
22
  displays: "xl:hidden block ",
@@ -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.66",
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.66
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",
@@ -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
+ }
@@ -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 {};
@@ -0,0 +1,29 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from "../../../util";
3
+ import { selectOne, selectPlural } from "../../../util/select";
4
+ export default function SelectTag(props) {
5
+ const { state, selectOptions, selectHow, option } = props;
6
+ const { className, background, text } = option || {
7
+ selectHow: "plural",
8
+ };
9
+ const container = {
10
+ sizes: "w-full",
11
+ displays: "grid grid-cols-4 gap-2.5",
12
+ className,
13
+ };
14
+ const isSelectedStyle = [
15
+ background ?? "bg-green-dark",
16
+ text ?? "text-white",
17
+ ].join(" ");
18
+ const button = (key) => ({
19
+ sizes: "h-10",
20
+ styles: "rounded-full",
21
+ animations: "duration-300",
22
+ boundaries: state[0].includes(key)
23
+ ? isSelectedStyle
24
+ : "border border-gray-medium",
25
+ });
26
+ return (_jsx("div", { className: cn(container), children: selectOptions.map(({ title, value }) => (_jsx("button", { onClick: () => selectHow === "one"
27
+ ? selectOne({ state, key: value })
28
+ : selectPlural({ state, key: value }), className: cn(button(value)), children: title }, value))) }));
29
+ }
@@ -1,6 +1,14 @@
1
1
  import _Select from "./Select";
2
2
  import LG from "./Select.LG";
3
+ import Tag from "./Tag";
4
+ import Handle from "./Handle";
5
+ import Switch from "./Switch";
6
+ import Swipe from "./Swipe";
3
7
  declare const Select: typeof _Select & {
4
8
  LG: typeof LG;
9
+ Tag: typeof Tag;
10
+ Handle: typeof Handle;
11
+ Switch: typeof Switch;
12
+ Swipe: typeof Swipe;
5
13
  };
6
14
  export default Select;
@@ -1,4 +1,8 @@
1
1
  import _Select from "./Select";
2
2
  import LG from "./Select.LG";
3
- const Select = Object.assign(_Select, { LG });
3
+ import Tag from "./Tag";
4
+ import Handle from "./Handle";
5
+ import Switch from "./Switch";
6
+ import Swipe from "./Swipe";
7
+ const Select = Object.assign(_Select, { LG, Tag, Handle, Switch, Swipe });
4
8
  export default Select;
@@ -1,3 +1,17 @@
1
- import { SwitchProps } from "../../../interface";
2
- declare function Switch<T>({ state, values, display, option }: SwitchProps<T>): import("react/jsx-runtime").JSX.Element;
3
- export default Switch;
1
+ import { Size, State } from "../../../interface";
2
+ interface Option<T> {
3
+ title: string;
4
+ value: T;
5
+ icon?: string;
6
+ }
7
+ interface SelectSwitchProps<T> {
8
+ state: State<T>;
9
+ selectOptions: Option<T>[];
10
+ option?: {
11
+ size?: Size;
12
+ text?: string;
13
+ className?: string;
14
+ };
15
+ }
16
+ declare function SelectSwitch<T>({ state, selectOptions, option, }: SelectSwitchProps<T>): import("react/jsx-runtime").JSX.Element;
17
+ export default SelectSwitch;
@@ -5,12 +5,12 @@ const paddingSize = {
5
5
  lg: "p-2.5",
6
6
  };
7
7
  const widthSize = {
8
- md: "w-25",
9
- lg: "w-47.5",
8
+ md: "w-81",
9
+ lg: "w-100",
10
10
  };
11
11
  const heightSize = {
12
- md: "h-7.5",
13
- lg: "h-15",
12
+ md: "h-10.5",
13
+ lg: "h-20",
14
14
  };
15
15
  const gapSize = {
16
16
  md: "gap-x-1.5",
@@ -20,25 +20,24 @@ const textSize = {
20
20
  md: "text-sm",
21
21
  lg: "text-base",
22
22
  };
23
- function Switch({ state, values, display, option }) {
23
+ function SelectSwitch({ state, selectOptions, option, }) {
24
24
  const { text, size, className } = option ?? {};
25
25
  const container = {
26
+ sizes: `${widthSize[size ?? "md"]} ${heightSize[size ?? "md"]}`,
26
27
  displays: `flex ${gapSize[size ?? "md"]}`,
27
28
  paddings: paddingSize[size ?? "md"],
28
- styles: "rounded-full bg-gray-light p-2.5",
29
+ styles: "rounded-full bg-gray-light",
29
30
  className,
30
31
  };
31
32
  const button = (flag) => ({
32
- sizes: `${widthSize[size ?? "md"]} ${heightSize[size ?? "md"]}`,
33
33
  displays: "flex flex-1 gap-x-3 justify-center items-center",
34
34
  backgrounds: flag ? "bg-white" : "bg-transparent",
35
35
  text,
36
36
  textSizes: textSize[size ?? "md"],
37
37
  styles: "rounded-full ",
38
38
  });
39
- return (_jsx("div", { className: cn(container), children: values?.map((value) => {
40
- const { title, icon } = (display && display[value]) ?? {};
39
+ return (_jsx("div", { className: cn(container), children: selectOptions?.map(({ value, icon, title }) => {
41
40
  return (_jsxs("button", { onClick: () => state[1](value), className: cn(button(value === state[0])), children: [icon && _jsx("img", { src: icon }), _jsx("div", { children: title })] }));
42
41
  }) }));
43
42
  }
44
- export default Switch;
43
+ export default SelectSwitch;
@@ -1,4 +0,0 @@
1
- import { Disabled } from "../../interface";
2
- export default function Obstacle({ disabled }: {
3
- disabled?: Disabled;
4
- }): false | import("react/jsx-runtime").JSX.Element | undefined;
@@ -1,10 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { cn } from "../../util";
3
- export default function Obstacle({ disabled }) {
4
- const obstacle = {
5
- positions: "absolute top-0 left-0",
6
- sizes: "w-full h-full",
7
- background: "bg-white/30",
8
- };
9
- return (disabled && (_jsx("div", { onClick: typeof disabled === "function" ? disabled : undefined, className: cn(obstacle) })));
10
- }