@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.
- package/README.md +42 -42
- package/asset/SVG.d.ts +5 -0
- package/asset/SVG.tsx +27 -27
- package/asset/svg/Close.tsx +32 -32
- package/asset/svg/Direction.tsx +36 -36
- package/asset/svg/Email.tsx +20 -20
- package/asset/svg/Icon.tsx +186 -186
- package/asset/svg/Image.tsx +24 -24
- package/asset/svg/Notification.tsx +34 -34
- package/asset/svg/Operation.d.ts +7 -0
- package/asset/svg/Operation.js +8 -0
- package/asset/svg/Operation.tsx +104 -66
- package/asset/svg/Phone.tsx +20 -20
- package/asset/svg/Profile.tsx +27 -27
- package/asset/svg/Symbol.tsx +60 -60
- package/asset/svg/TOSEL.tsx +63 -63
- package/card/design/Card.design.js +4 -2
- package/card/design/RollCard.design.d.ts +1 -1
- package/card/design/RollCard.design.js +35 -4
- package/card/index.d.ts +1 -0
- package/card/index.js +1 -0
- package/card/template/NavCard.js +2 -2
- package/card/template/ProgressCard.d.ts +10 -0
- package/card/template/ProgressCard.js +42 -0
- package/globals.css +226 -226
- package/interface/Action.d.ts +6 -6
- package/interface/Card.d.ts +2 -0
- package/interface/Modal.d.ts +9 -2
- package/interface/Property.d.ts +1 -1
- package/interface/Theme.d.ts +2 -0
- package/interface/Theme.js +1 -0
- package/interface/index.d.ts +1 -0
- package/interface/index.js +1 -0
- package/layout/widget/dashboard/mypage/Navigate.js +2 -2
- package/layout/widget/dashboard/mypage/Profile.js +1 -1
- package/modal/design/Modal.design.js +2 -2
- package/modal/index.d.ts +2 -1
- package/modal/index.js +2 -1
- package/modal/template/{ConfirmModal → Confirm}/Tag.d.ts +1 -0
- package/modal/template/Confirm/Tag.js +30 -0
- package/modal/template/Postcode.d.ts +2 -0
- package/modal/template/Postcode.js +27 -0
- package/package.json +2 -1
- package/tailwind.config.ts +619 -618
- package/version.txt +1 -1
- package/widget/template/Select/Select.LG.d.ts +2 -0
- package/widget/template/Select/Select.LG.js +45 -0
- package/widget/template/Select/Select.d.ts +2 -0
- package/widget/{design/Select.design.js → template/Select/Select.js} +14 -6
- package/widget/template/Select/index.d.ts +6 -0
- package/widget/template/Select/index.js +4 -0
- package/modal/template/ConfirmModal/Tag.js +0 -19
- package/widget/design/Select.design.d.ts +0 -2
- package/widget/template/Select.d.ts +0 -3
- package/widget/template/Select.js +0 -6
- /package/modal/template/{ConfirmModal → Confirm}/Confirm.d.ts +0 -0
- /package/modal/template/{ConfirmModal → Confirm}/Confirm.js +0 -0
- /package/modal/template/{ConfirmModal → Confirm}/Input.d.ts +0 -0
- /package/modal/template/{ConfirmModal → Confirm}/Input.js +0 -0
- /package/modal/template/{ConfirmModal → Confirm}/Reimage.d.ts +0 -0
- /package/modal/template/{ConfirmModal → Confirm}/Reimage.js +0 -0
- /package/modal/template/{ConfirmModal → Confirm}/Switch.d.ts +0 -0
- /package/modal/template/{ConfirmModal → Confirm}/Switch.js +0 -0
- /package/modal/template/{ConfirmModal → Confirm}/index.d.ts +0 -0
- /package/modal/template/{ConfirmModal → Confirm}/index.js +0 -0
package/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0.
|
|
1
|
+
1.0.53
|
|
@@ -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
|
+
}
|
|
@@ -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 "
|
|
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 "
|
|
6
|
-
import { useFlag } from "
|
|
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
|
|
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);
|
|
@@ -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
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|