@edu-tosel/design 1.0.51 → 1.0.53

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 (65) hide show
  1. package/README.md +42 -42
  2. package/asset/SVG.d.ts +5 -0
  3. package/asset/SVG.tsx +27 -27
  4. package/asset/svg/Close.tsx +32 -32
  5. package/asset/svg/Direction.tsx +36 -36
  6. package/asset/svg/Email.tsx +20 -20
  7. package/asset/svg/Icon.tsx +186 -186
  8. package/asset/svg/Image.tsx +24 -24
  9. package/asset/svg/Notification.tsx +34 -34
  10. package/asset/svg/Operation.d.ts +7 -0
  11. package/asset/svg/Operation.js +8 -0
  12. package/asset/svg/Operation.tsx +104 -66
  13. package/asset/svg/Phone.tsx +20 -20
  14. package/asset/svg/Profile.tsx +27 -27
  15. package/asset/svg/Symbol.tsx +60 -60
  16. package/asset/svg/TOSEL.tsx +63 -63
  17. package/card/design/Card.design.js +4 -2
  18. package/card/design/RollCard.design.d.ts +1 -1
  19. package/card/design/RollCard.design.js +35 -4
  20. package/card/index.d.ts +1 -0
  21. package/card/index.js +1 -0
  22. package/card/template/NavCard.js +2 -2
  23. package/card/template/ProgressCard.d.ts +10 -0
  24. package/card/template/ProgressCard.js +42 -0
  25. package/globals.css +226 -226
  26. package/interface/Action.d.ts +6 -6
  27. package/interface/Card.d.ts +2 -0
  28. package/interface/Modal.d.ts +9 -2
  29. package/interface/Property.d.ts +1 -1
  30. package/interface/Theme.d.ts +2 -0
  31. package/interface/Theme.js +1 -0
  32. package/interface/index.d.ts +1 -0
  33. package/interface/index.js +1 -0
  34. package/layout/widget/dashboard/mypage/Navigate.js +2 -2
  35. package/layout/widget/dashboard/mypage/Profile.js +1 -1
  36. package/modal/design/Modal.design.js +2 -2
  37. package/modal/index.d.ts +2 -1
  38. package/modal/index.js +2 -1
  39. package/modal/template/{ConfirmModal → Confirm}/Tag.d.ts +1 -0
  40. package/modal/template/Confirm/Tag.js +30 -0
  41. package/modal/template/Postcode.d.ts +2 -0
  42. package/modal/template/Postcode.js +27 -0
  43. package/package.json +2 -1
  44. package/tailwind.config.ts +619 -618
  45. package/version.txt +1 -1
  46. package/widget/template/Select/Select.LG.d.ts +2 -0
  47. package/widget/template/Select/Select.LG.js +45 -0
  48. package/widget/template/Select/Select.d.ts +2 -0
  49. package/widget/{design/Select.design.js → template/Select/Select.js} +14 -6
  50. package/widget/template/Select/index.d.ts +6 -0
  51. package/widget/template/Select/index.js +4 -0
  52. package/modal/template/ConfirmModal/Tag.js +0 -19
  53. package/widget/design/Select.design.d.ts +0 -2
  54. package/widget/template/Select.d.ts +0 -3
  55. package/widget/template/Select.js +0 -6
  56. /package/modal/template/{ConfirmModal → Confirm}/Confirm.d.ts +0 -0
  57. /package/modal/template/{ConfirmModal → Confirm}/Confirm.js +0 -0
  58. /package/modal/template/{ConfirmModal → Confirm}/Input.d.ts +0 -0
  59. /package/modal/template/{ConfirmModal → Confirm}/Input.js +0 -0
  60. /package/modal/template/{ConfirmModal → Confirm}/Reimage.d.ts +0 -0
  61. /package/modal/template/{ConfirmModal → Confirm}/Reimage.js +0 -0
  62. /package/modal/template/{ConfirmModal → Confirm}/Switch.d.ts +0 -0
  63. /package/modal/template/{ConfirmModal → Confirm}/Switch.js +0 -0
  64. /package/modal/template/{ConfirmModal → Confirm}/index.d.ts +0 -0
  65. /package/modal/template/{ConfirmModal → Confirm}/index.js +0 -0
package/version.txt CHANGED
@@ -1 +1 @@
1
- 1.0.51
1
+ 1.0.53
@@ -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,45 @@
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
+ export default function SelectLG({ state,
16
+ // selectOptions,
17
+ // placeholder,
18
+ // options,
19
+ }) {
20
+ const id = useId();
21
+ const { setIsOwn, setIsOwnId } = useActionStore();
22
+ const [value, setValue] = state;
23
+ const [text, setText] = useState("");
24
+ const [search, setSearch] = useState("");
25
+ const [isOpen, setIsOpen] = useState(false);
26
+ const [isHover, setIsHover] = useState(false);
27
+ const [filteredOptions, setFilterdOptions] = useState([]);
28
+ const [index, setIndex] = useState();
29
+ useFlag({ state: [false, setIsOpen], safe: "overlay" });
30
+ const onKeyDown = (e) => {
31
+ if (!filteredOptions)
32
+ return;
33
+ if (typeof index === "undefined")
34
+ return setIndex(0);
35
+ if (e.key === "Enter") {
36
+ setText(filteredOptions[index][1]);
37
+ return setValue(filteredOptions[index][0]);
38
+ }
39
+ if (e.key === "ArrowDown")
40
+ return setIndex((index + 1) % filteredOptions.length);
41
+ if (e.key === "ArrowUp")
42
+ return setIndex((index - 1 + filteredOptions.length) % filteredOptions.length);
43
+ };
44
+ return _jsx("select", { className: "w-64 h-32 border-2" });
45
+ }
@@ -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;