@edu-tosel/design 1.0.111 → 1.0.112

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.
@@ -5,6 +5,7 @@ import { Action, Shelf } from "../../layout";
5
5
  import Card from "./Card.design";
6
6
  import { useEffect, useState } from "react";
7
7
  import { cn } from "../../util";
8
+ import useMobile from "../../hook/useMobile";
8
9
  export default function RollCardDesign({ titles, state, disabled, isFixed, children, }) {
9
10
  const [isOpen, setIsOpen] = state;
10
11
  const [isDisabled, disabledFn] = disabled || [false, () => { }];
@@ -22,12 +23,13 @@ export default function RollCardDesign({ titles, state, disabled, isFixed, child
22
23
  sizes: "h-full",
23
24
  styles: isFixed && "hidden",
24
25
  };
26
+ const isMobile = useMobile();
25
27
  return (_jsxs(Card, { option: {
26
28
  width: "2xl",
27
- height: !isFixed && isOpen ? "2xs" : "4xs",
29
+ height: !isMobile ? (!isFixed && isOpen ? "2xs" : "4xs") : "2xs",
28
30
  background: isDisabled || flag ? "bg-green-dark/10" : "bg-white",
29
31
  className: "p-7.5 flex flex-col gap-y-6",
30
- }, 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: !isDisabled
32
+ }, children: [_jsxs("div", { className: "flex flex-col gap-y-3.5 sm:flex-row justify-between", children: [_jsxs(Shelf.Col, { className: "gap-y-2.5", children: [_jsxs("div", { className: "flex 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 justify-between sm:justify-start gap-3.5 items-center", children: [_jsx(Label, { title: !isDisabled
31
33
  ? isFixed
32
34
  ? flag
33
35
  ? "추가됨"
@@ -0,0 +1,2 @@
1
+ declare const useMobile: () => boolean;
2
+ export default useMobile;
@@ -0,0 +1,17 @@
1
+ import { useEffect, useState } from "react";
2
+ const useMobile = () => {
3
+ const [isMobile, setIsMobile] = useState(false);
4
+ useEffect(() => {
5
+ const mediaQuery = window.matchMedia("(max-width: 768px)");
6
+ setIsMobile(mediaQuery.matches);
7
+ const handleResize = () => {
8
+ setIsMobile(mediaQuery.matches);
9
+ };
10
+ mediaQuery.addEventListener("change", handleResize);
11
+ return () => {
12
+ mediaQuery.removeEventListener("change", handleResize);
13
+ };
14
+ }, []);
15
+ return isMobile;
16
+ };
17
+ export default useMobile;
@@ -17,8 +17,8 @@ export default function Tab({ tabs, option, state, }) {
17
17
  const container = {
18
18
  className,
19
19
  positions: "absolute",
20
- displays: "hidden xl:flex xl:items-center xl:gap-2.5",
21
- sizes: "w-auto",
20
+ displays: "hidden sm:flex xl:items-center xl:gap-2.5",
21
+ sizes: "w-auto ",
22
22
  paddings: "p-2.5",
23
23
  backgrounds: boundary ?? "bg-gray-light",
24
24
  styles: "rounded-xl ",
@@ -13,11 +13,11 @@ export default function Header({ logo, rightButton, contents, }) {
13
13
  boundaries: "md:px-12",
14
14
  };
15
15
  const buttonBox = {
16
- fonts: "text-[11px] md:text-[16px] leading-tight",
16
+ fonts: "text-[9px] xs:text-[10px] sm:text-[11px] md:text-[16px] leading-tight",
17
17
  texts: "text-gray-dark",
18
- boundaries: "px-2.5",
18
+ boundaries: "px-0.5 md:px-2.5",
19
19
  };
20
- return (_jsx("div", { className: cn(container), children: _jsxs("div", { className: cn(body), children: [_jsx("div", { className: "hidden md:block", onClick: logo.onClick, children: logo.node }), _jsxs("div", { className: "flex items-center gap-x-12", children: [_jsx("div", { className: "flex items-center gap-2.5", children: contents.map((button, index) => (_jsx("button", { onClick: button.onClick, className: cn(buttonBox), children: button.title }, index))) }), rightButton && (_jsx(Label.Button, { title: rightButton.title, onClick: rightButton?.onClick, option: {
20
+ return (_jsx("div", { className: cn(container), children: _jsxs("div", { className: cn(body), children: [_jsx("div", { className: "hidden md:block", onClick: logo.onClick, children: logo.node }), _jsxs("div", { className: "flex items-center gap-x-7.5 md:gap-x-12", children: [_jsx("div", { className: "flex items-center gap-2.5", children: contents.map((button, index) => (_jsx("button", { onClick: button.onClick, className: cn(buttonBox), children: button.title }, index))) }), rightButton && (_jsx(Label.Button, { title: rightButton.title, onClick: rightButton?.onClick, option: {
21
21
  width: "2xs",
22
22
  height: "4xs",
23
23
  background: gradient.bg.greenToRed,
@@ -7,8 +7,8 @@ export default function ConfirmModalDesign({ titles, showAction, buttons, childr
7
7
  displays: "flex flex-col",
8
8
  };
9
9
  const buttonBox = {
10
- positions: "absolute bottom-5 left-5",
11
- displays: "flex gap-2.5",
10
+ positions: "absolute bottom-4 md:bottom-5 left-2 md:left-5",
11
+ displays: "flex gap-1 md:gap-2.5",
12
12
  };
13
13
  return (_jsx(ModalDesign, { titles: titles, showAction: showAction, option: option, children: _jsxs("div", { className: cn(container), children: [children, _jsx("div", { className: cn(buttonBox), children: buttons.map(({ title, onClick, option }) => (_jsx(Label.Button, { title: title, onClick: onClick, option: {
14
14
  ...option,
@@ -10,7 +10,7 @@ import { LineBreaks } from "./../../text/LineBreaks";
10
10
  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
- md: "w-112.5",
13
+ md: "w-104.5 sm:w-112.5",
14
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",
@@ -59,7 +59,7 @@ function ModalDesign({ titles, showAction, children, option, debug, }) {
59
59
  const { width, height, noClose, boundary, position } = option ?? {};
60
60
  const { event } = showAction ?? {};
61
61
  const container = {
62
- paddings: "p-5",
62
+ paddings: "p-5 md:p-5",
63
63
  sizes: `${heightSize[height ?? "lg"]} ${widthSize[width ?? "md"]}`,
64
64
  styles: "rounded-xl bg-white relative overflow-hidden",
65
65
  shadows: !!position && (boundary ?? "box-shadow"),
@@ -69,5 +69,5 @@ function ModalDesign({ titles, showAction, children, option, debug, }) {
69
69
  displays: "flex flex-col items-end",
70
70
  sizes: "w-full min-h-[83px]",
71
71
  };
72
- return (_jsxs("div", { className: cn(container), children: [_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" })] }), children, !noClose && event && (_jsx(SVG.Close, { onClick: () => removeModal(event), className: "absolute top-5 left-5" }))] }));
72
+ return (_jsxs("div", { className: cn(container), children: [_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" })] }), children, !noClose && event && (_jsx(SVG.Close, { onClick: () => removeModal(event), className: "absolute top-1 left-1" }))] }));
73
73
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edu-tosel/design",
3
- "version": "1.0.111",
3
+ "version": "1.0.112",
4
4
  "description": "UI components for International TOSEL Committee",
5
5
  "keywords": [
6
6
  "jsx",
@@ -229,6 +229,7 @@ export default {
229
229
  100: "25rem",
230
230
  102.5: "25.625rem",
231
231
  104: "26rem",
232
+ 104.5: "26.125rem",
232
233
  106: "26.5rem",
233
234
  108: "27rem",
234
235
  110: "27.5rem",
package/version.txt CHANGED
@@ -1 +1 @@
1
- 1.0.111
1
+ 1.0.112
package/widget/index.d.ts CHANGED
@@ -9,3 +9,4 @@ export { default as Label } from "./template/Label";
9
9
  export { default as Switch } from "./template/Switch";
10
10
  export { default as Toggle } from "./template/Toggle";
11
11
  export { default as Obstacle } from "./template/Obstacle";
12
+ export { default as Pagination } from "./template/Pagination";
package/widget/index.js CHANGED
@@ -9,3 +9,4 @@ export { default as Label } from "./template/Label";
9
9
  export { default as Switch } from "./template/Switch";
10
10
  export { default as Toggle } from "./template/Toggle";
11
11
  export { default as Obstacle } from "./template/Obstacle";
12
+ export { default as Pagination } from "./template/Pagination";
@@ -4,18 +4,16 @@ import SVG from "../../asset/SVG";
4
4
  export default function Pagination({ state, selectOptions, }) {
5
5
  const [value, setValue] = state;
6
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",
7
+ displays: "flex justify-between items-center",
8
+ sizes: "w-23.25 h-6.25 bg-gray-dark rounded-full",
9
+ paddings: "px-1.5 ml-7.5",
12
10
  };
13
11
  const index = selectOptions.indexOf(value);
14
- return (_jsxs("div", { className: cn(container), children: [_jsx(SVG.Symbol.LessThan, { onClick: () => {
12
+ return (_jsxs("div", { className: cn(container), children: [_jsx("button", { onClick: () => {
15
13
  if (index > 0)
16
14
  setValue(selectOptions[index - 1]);
17
- } }), _jsxs("div", { className: "flex items-center gap-x-[3px] text-white", children: [index + 1, _jsx("div", { className: "text-gray-medium text-base font-pretendard-bold", children: "/" }), selectOptions.length] }), _jsx(SVG.Symbol.GreaterThan, { onClick: () => {
15
+ }, className: "w-7.5 h-7.5 flex justify-center items-center ", children: _jsx(SVG.Symbol.LessThan, {}) }), _jsxs("div", { className: "flex items-center gap-x-[3px] text-white", children: [index + 1, _jsx("div", { className: "text-gray-medium text-base font-pretendard-bold", children: "/" }), selectOptions.length] }), _jsx("button", { onClick: () => {
18
16
  if (index < selectOptions.length - 1)
19
17
  setValue(selectOptions[index + 1]);
20
- } })] }));
18
+ }, className: "w-7.5 h-7.5 flex justify-center items-center", children: _jsx(SVG.Symbol.GreaterThan, {}) })] }));
21
19
  }