@nextlevel_korea/design-system 2.0.6 → 2.1.0
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.
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface IProps {
|
|
2
|
+
contactList: {
|
|
3
|
+
idx: number;
|
|
4
|
+
name: string;
|
|
5
|
+
label: string;
|
|
6
|
+
type: string;
|
|
7
|
+
isRequired: boolean;
|
|
8
|
+
}[];
|
|
9
|
+
}
|
|
10
|
+
declare const Contact: ({ contactList }: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export default Contact;
|
|
12
|
+
//# sourceMappingURL=Contact.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Contact.d.ts","sourceRoot":"","sources":["../../../src/components/Contact/Contact.tsx"],"names":[],"mappings":"AAEA,UAAU,MAAM;IACd,WAAW,EAAE;QACX,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,OAAO,CAAC;KACrB,EAAE,CAAC;CACL;AAED,QAAA,MAAM,OAAO,GAAI,iBAAiB,MAAM,4CAwEvC,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
const Contact = ({ contactList }) => {
|
|
3
|
+
const renderField = (field) => {
|
|
4
|
+
const { name, label, type, isRequired } = field;
|
|
5
|
+
const renderInput = () => {
|
|
6
|
+
switch (type) {
|
|
7
|
+
case 'text':
|
|
8
|
+
return (_jsx("input", { type: "text", className: "w-full border-[1.5px] border-solid border-[#ccc] bg-transparent px-3 py-3 outline-none", placeholder: `${label}을(를) 입력해 주세요`, name: name }));
|
|
9
|
+
case 'email':
|
|
10
|
+
return (_jsx("input", { type: "email", className: "w-full border-[1.5px] border-solid border-[#ccc] bg-transparent px-3 py-3 outline-none", placeholder: "\uC774\uBA54\uC77C \uC8FC\uC18C\uB97C \uC785\uB825\uD574 \uC8FC\uC138\uC694", name: name }));
|
|
11
|
+
case 'phone':
|
|
12
|
+
return (_jsx("input", { type: "tel", className: "w-full border-[1.5px] border-solid border-[#ccc] bg-transparent px-3 py-3 outline-none", placeholder: "\uBC88\uD638\uB97C \uC785\uB825\uD574 \uC8FC\uC138\uC694 ('-' \uC81C\uC678)", name: name }));
|
|
13
|
+
case 'textarea':
|
|
14
|
+
return (_jsx("textarea", { className: "h-[300px] w-full border-[1.5px] border-solid border-[#ccc] bg-transparent px-3 py-3 outline-none md:h-[350px]", placeholder: `${label}을(를) 입력해 주세요`, name: name }));
|
|
15
|
+
default:
|
|
16
|
+
return (_jsx("input", { type: "text", className: "w-full border-[1.5px] border-solid border-[#ccc] bg-transparent px-3 py-3 outline-none", placeholder: `${label}을 입력해 주세요`, name: name }));
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
return (_jsxs("div", { className: "flex w-full flex-col gap-[12px] md:flex-row md:gap-0", children: [_jsxs("p", { className: "w-[250px] text-[18px] font-semibold tracking-[-0.5px] md:text-[22px]", children: [label, isRequired && _jsx("span", { className: "text-red-500 ml-1", children: "*" })] }), _jsx("div", { className: "flex w-full flex-col gap-[10px]", children: renderInput() })] }, field.idx));
|
|
20
|
+
};
|
|
21
|
+
return (_jsx("div", { className: "flex w-full flex-col gap-5 md:gap-10", children: contactList.map(renderField) }));
|
|
22
|
+
};
|
|
23
|
+
export default Contact;
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAGlE,OAAO,aAAa,CAAC"}
|
package/dist/index.js
CHANGED