@pop-ui/core 0.0.11 → 0.0.14
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 +1 -1
- package/dist/assets/PretendardVariable.woff2 +0 -0
- package/dist/assets/core-O7aPPk54.css +1 -0
- package/dist/core.js +490 -463
- package/dist/core.umd.cjs +1 -1
- package/dist/types/index.d.ts +206 -1
- package/package.json +70 -79
- package/dist/components/Alert/Alert.stories.js +0 -18
- package/dist/components/Alert/index.js +0 -31
- package/dist/components/Button/Button.stories.js +0 -42
- package/dist/components/Button/index.js +0 -28
- package/dist/components/Checkbox/Checkbox.stories.js +0 -14
- package/dist/components/Checkbox/index.js +0 -23
- package/dist/components/DatePicker/DatePicker.stories.js +0 -27
- package/dist/components/DatePicker/index.js +0 -23
- package/dist/components/Dropdown/Dropdown.stories.js +0 -16
- package/dist/components/Dropdown/index.js +0 -40
- package/dist/components/ImageUploader/ImageUploader.stories.js +0 -9
- package/dist/components/ImageUploader/index.js +0 -28
- package/dist/components/Modal/Modal.stories.js +0 -13
- package/dist/components/Modal/index.js +0 -20
- package/dist/components/Pagination/Pagination.stories.js +0 -14
- package/dist/components/Pagination/index.js +0 -49
- package/dist/components/Radio/Radio.stories.js +0 -14
- package/dist/components/Radio/index.js +0 -15
- package/dist/components/SearchBar/SearchBar.stories.js +0 -16
- package/dist/components/SearchBar/index.js +0 -34
- package/dist/components/SegmentButton/SegmentButton.stories.js +0 -14
- package/dist/components/SegmentButton/index.js +0 -19
- package/dist/components/Tab/Tab.stories.js +0 -28
- package/dist/components/Tab/index.js +0 -8
- package/dist/components/Table/Table.stories.js +0 -127
- package/dist/components/Table/index.js +0 -112
- package/dist/components/TextField/TextField.stories.js +0 -36
- package/dist/components/TextField/index.js +0 -44
- package/dist/components/TimePicker/TimePicker.stories.js +0 -13
- package/dist/components/TimePicker/index.js +0 -26
- package/dist/components/Toggle/Toggle.stories.js +0 -15
- package/dist/components/Toggle/index.js +0 -34
- package/dist/components/Tooltip/Tooltip.stories.js +0 -24
- package/dist/components/Tooltip/index.js +0 -8
- package/dist/components/index.js +0 -17
- package/dist/components/shared/styles.js +0 -219
- package/dist/core.css +0 -1
- package/dist/helpers/checkMessage/checkMessage.test.js +0 -9
- package/dist/helpers/checkMessage/index.js +0 -8
- package/dist/index.js +0 -1
- package/dist/types/components/Alert/Alert.stories.d.ts +0 -3
- package/dist/types/components/Alert/index.d.ts +0 -9
- package/dist/types/components/Button/Button.stories.d.ts +0 -7
- package/dist/types/components/Button/index.d.ts +0 -8
- package/dist/types/components/Checkbox/Checkbox.stories.d.ts +0 -3
- package/dist/types/components/Checkbox/index.d.ts +0 -6
- package/dist/types/components/DatePicker/DatePicker.stories.d.ts +0 -5
- package/dist/types/components/DatePicker/index.d.ts +0 -9
- package/dist/types/components/Dropdown/Dropdown.stories.d.ts +0 -3
- package/dist/types/components/Dropdown/index.d.ts +0 -12
- package/dist/types/components/ImageUploader/ImageUploader.stories.d.ts +0 -3
- package/dist/types/components/ImageUploader/index.d.ts +0 -12
- package/dist/types/components/Modal/Modal.stories.d.ts +0 -3
- package/dist/types/components/Modal/index.d.ts +0 -7
- package/dist/types/components/Pagination/Pagination.stories.d.ts +0 -3
- package/dist/types/components/Pagination/index.d.ts +0 -10
- package/dist/types/components/Radio/Radio.stories.d.ts +0 -3
- package/dist/types/components/Radio/index.d.ts +0 -6
- package/dist/types/components/SearchBar/SearchBar.stories.d.ts +0 -3
- package/dist/types/components/SearchBar/index.d.ts +0 -14
- package/dist/types/components/SegmentButton/SegmentButton.stories.d.ts +0 -3
- package/dist/types/components/SegmentButton/index.d.ts +0 -7
- package/dist/types/components/Tab/Tab.stories.d.ts +0 -3
- package/dist/types/components/Tab/index.d.ts +0 -13
- package/dist/types/components/Table/Table.stories.d.ts +0 -5
- package/dist/types/components/Table/index.d.ts +0 -23
- package/dist/types/components/TextField/TextField.stories.d.ts +0 -5
- package/dist/types/components/TextField/index.d.ts +0 -18
- package/dist/types/components/TimePicker/TimePicker.stories.d.ts +0 -3
- package/dist/types/components/TimePicker/index.d.ts +0 -6
- package/dist/types/components/Toggle/Toggle.stories.d.ts +0 -3
- package/dist/types/components/Toggle/index.d.ts +0 -9
- package/dist/types/components/Tooltip/Tooltip.stories.d.ts +0 -3
- package/dist/types/components/Tooltip/index.d.ts +0 -7
- package/dist/types/components/index.d.ts +0 -17
- package/dist/types/components/shared/styles.d.ts +0 -86
- package/dist/types/helpers/checkMessage/checkMessage.test.d.ts +0 -1
- package/dist/types/helpers/checkMessage/index.d.ts +0 -1
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { Button as MantineButton, } from "@mantine/core";
|
|
4
|
-
import styles from "./styles.module.scss";
|
|
5
|
-
export const Button = ({ children, size = "md", styleType = "primary", ...props }) => {
|
|
6
|
-
let sizeStyle = styles.md_button;
|
|
7
|
-
if (size === "sm") {
|
|
8
|
-
sizeStyle = styles.sm_button;
|
|
9
|
-
}
|
|
10
|
-
else if (size === "lg") {
|
|
11
|
-
sizeStyle = styles.lg_button;
|
|
12
|
-
}
|
|
13
|
-
let buttonStyle = styles.primary;
|
|
14
|
-
if (styleType === "basic") {
|
|
15
|
-
buttonStyle = styles.basic;
|
|
16
|
-
}
|
|
17
|
-
else if (styleType === "primaryline") {
|
|
18
|
-
buttonStyle = styles.primaryline;
|
|
19
|
-
}
|
|
20
|
-
else if (styleType === "danger") {
|
|
21
|
-
buttonStyle = styles.danger;
|
|
22
|
-
}
|
|
23
|
-
else if (styleType === "setting") {
|
|
24
|
-
buttonStyle = styles.setting;
|
|
25
|
-
}
|
|
26
|
-
return (_jsx(MantineButton, { type: "button", className: `${buttonStyle} ${sizeStyle}`, ...props, children: children }));
|
|
27
|
-
};
|
|
28
|
-
export default Button;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Checkbox } from ".";
|
|
3
|
-
export default {
|
|
4
|
-
title: "Core/Checkbox",
|
|
5
|
-
component: Checkbox,
|
|
6
|
-
};
|
|
7
|
-
const Template = (args) => _jsx(Checkbox, { ...args });
|
|
8
|
-
export const defaultCheckbox = Template.bind({});
|
|
9
|
-
defaultCheckbox.args = {
|
|
10
|
-
label: "checkbox label",
|
|
11
|
-
description: "description text",
|
|
12
|
-
size: "md",
|
|
13
|
-
disabled: false,
|
|
14
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { Checkbox as MantineCheckbox, } from "@mantine/core";
|
|
4
|
-
import styles from "./styles.module.scss";
|
|
5
|
-
export const Checkbox = ({ size = "md", ...props }) => {
|
|
6
|
-
let sizeStyle = styles.md_checkbox;
|
|
7
|
-
let sizeNumber = 24;
|
|
8
|
-
if (size === "sm") {
|
|
9
|
-
sizeStyle = styles.sm_checkbox;
|
|
10
|
-
sizeNumber = 18;
|
|
11
|
-
}
|
|
12
|
-
else if (size === "lg") {
|
|
13
|
-
sizeStyle = styles.lg_checkbox;
|
|
14
|
-
sizeNumber = 32;
|
|
15
|
-
}
|
|
16
|
-
return (_jsx(MantineCheckbox, { className: sizeStyle, styles: {
|
|
17
|
-
inner: {
|
|
18
|
-
width: sizeNumber,
|
|
19
|
-
height: sizeNumber,
|
|
20
|
-
},
|
|
21
|
-
}, ...props }));
|
|
22
|
-
};
|
|
23
|
-
export default Checkbox;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { DatePicker } from ".";
|
|
3
|
-
export default {
|
|
4
|
-
title: "Core/DatePicker",
|
|
5
|
-
component: DatePicker,
|
|
6
|
-
};
|
|
7
|
-
const Template = (args) => _jsx(DatePicker, { ...args });
|
|
8
|
-
export const datePicker = Template.bind({});
|
|
9
|
-
datePicker.args = {
|
|
10
|
-
size: "md",
|
|
11
|
-
type: "default",
|
|
12
|
-
disabled: false,
|
|
13
|
-
withTime: false,
|
|
14
|
-
};
|
|
15
|
-
export const datetimePicker = Template.bind({});
|
|
16
|
-
datetimePicker.args = {
|
|
17
|
-
size: "md",
|
|
18
|
-
disabled: false,
|
|
19
|
-
withTime: true,
|
|
20
|
-
};
|
|
21
|
-
export const rangePicker = Template.bind({});
|
|
22
|
-
rangePicker.args = {
|
|
23
|
-
size: "md",
|
|
24
|
-
type: "range",
|
|
25
|
-
disabled: false,
|
|
26
|
-
withTime: false,
|
|
27
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import "dayjs/locale/ko";
|
|
4
|
-
import { DatePickerInput, DateTimePicker, } from "@mantine/dates";
|
|
5
|
-
import ic_calendar from "../../assets/icons/ic_calendar.svg";
|
|
6
|
-
import styles from "./styles.module.scss";
|
|
7
|
-
export const DatePicker = ({ size = "md", type = "default", withTime, ...props }) => {
|
|
8
|
-
let sizeStyle = styles.md_textfield;
|
|
9
|
-
let iconSize = 18;
|
|
10
|
-
if (size === "sm") {
|
|
11
|
-
sizeStyle = styles.sm_textfield;
|
|
12
|
-
iconSize = 14;
|
|
13
|
-
}
|
|
14
|
-
else if (size === "lg") {
|
|
15
|
-
sizeStyle = styles.lg_textfield;
|
|
16
|
-
iconSize = 24;
|
|
17
|
-
}
|
|
18
|
-
if (withTime) {
|
|
19
|
-
return (_jsx(DateTimePicker, { placeholder: undefined, onPointerEnterCapture: undefined, onPointerLeaveCapture: undefined, className: sizeStyle, size: size, locale: "ko", firstDayOfWeek: 0, monthLabelFormat: "YYYY년 MM월", valueFormat: "YYYY-MM-DD | a hh:mm", rightSection: _jsx("img", { width: iconSize, src: ic_calendar }), ...props }));
|
|
20
|
-
}
|
|
21
|
-
return (_jsx(DatePickerInput, { className: sizeStyle, type: type, size: size, locale: "ko", firstDayOfWeek: 0, monthLabelFormat: "YYYY년 MM월", valueFormat: "YYYY-MM-DD", rightSection: _jsx("img", { width: iconSize, src: ic_calendar }), ...props }));
|
|
22
|
-
};
|
|
23
|
-
export default DatePicker;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Dropdown } from ".";
|
|
3
|
-
export default {
|
|
4
|
-
title: "Core/Dropdown",
|
|
5
|
-
component: Dropdown,
|
|
6
|
-
};
|
|
7
|
-
const Template = (args) => _jsx(Dropdown, { ...args });
|
|
8
|
-
export const defaultDropdown = Template.bind({});
|
|
9
|
-
defaultDropdown.args = {
|
|
10
|
-
label: "label text",
|
|
11
|
-
labelPosition: "top",
|
|
12
|
-
size: "md",
|
|
13
|
-
required: false,
|
|
14
|
-
disabled: false,
|
|
15
|
-
data: ["select 1", "select 2", "select 3"],
|
|
16
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Input, Select, Tooltip } from "@mantine/core";
|
|
4
|
-
import ic_tooltip from "../../assets/icons/ic_tooltip.svg";
|
|
5
|
-
import ic_chevron_up from "../../assets/icons/ic_chevron_up.svg";
|
|
6
|
-
import ic_chevron_down from "../../assets/icons/ic_chevron_down.svg";
|
|
7
|
-
import styles from "./styles.module.scss";
|
|
8
|
-
import { useState } from "react";
|
|
9
|
-
export const Dropdown = ({ label, labelPosition = "top", size = "md", required, tooltip, tooltipPosition = "top", errorMsg, description, ...props }) => {
|
|
10
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
11
|
-
let labelStyle = styles.md_label;
|
|
12
|
-
let selectStyle = styles.md_textfield;
|
|
13
|
-
let tooltipStyle = styles.md_tooltip;
|
|
14
|
-
let chevronSize = 18;
|
|
15
|
-
if (size === "sm") {
|
|
16
|
-
labelStyle = styles.sm_label;
|
|
17
|
-
selectStyle = styles.sm_textfield;
|
|
18
|
-
tooltipStyle = styles.sm_tooltip;
|
|
19
|
-
chevronSize = 14;
|
|
20
|
-
}
|
|
21
|
-
else if (size === "lg") {
|
|
22
|
-
labelStyle = styles.lg_label;
|
|
23
|
-
selectStyle = styles.lg_textfield;
|
|
24
|
-
tooltipStyle = styles.lg_tooltip;
|
|
25
|
-
chevronSize = 24;
|
|
26
|
-
}
|
|
27
|
-
return (_jsxs("div", { className: labelPosition === "top"
|
|
28
|
-
? styles.top_label_textfield
|
|
29
|
-
: styles.left_label_textfield, children: [_jsxs("div", { children: [label && (_jsx(Input.Label, { required: required, className: labelStyle, children: label })), tooltip && (_jsx(Tooltip, { label: tooltip, position: tooltipPosition, children: _jsx("img", { className: tooltipStyle, src: ic_tooltip, alt: "tooltip_icon" }) }))] }), _jsxs("div", { children: [_jsx(Select, { ...props, size: size, error: errorMsg, className: selectStyle, rightSection: isOpen ? (_jsx("img", { width: chevronSize, src: ic_chevron_up })) : (_jsx("img", { width: chevronSize, src: ic_chevron_down })), onDropdownOpen: () => setIsOpen(true), onDropdownClose: () => setIsOpen(false), styles: () => ({
|
|
30
|
-
item: {
|
|
31
|
-
"&[data-selected]": {
|
|
32
|
-
"&, &:hover": {
|
|
33
|
-
backgroundColor: "#e7e7e7",
|
|
34
|
-
color: "#000000",
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
}) }), description && (_jsx(Input.Description, { className: styles.input_description, children: description })), errorMsg && (_jsx(Input.Error, { className: styles.input_error_msg, children: errorMsg }))] })] }));
|
|
39
|
-
};
|
|
40
|
-
export default Dropdown;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { ImageUploader } from ".";
|
|
3
|
-
export default {
|
|
4
|
-
title: "Core/ImageUploader",
|
|
5
|
-
component: ImageUploader,
|
|
6
|
-
};
|
|
7
|
-
const Template = (args) => (_jsx(ImageUploader, { ...args }));
|
|
8
|
-
export const defaultImageUploader = Template.bind({});
|
|
9
|
-
defaultImageUploader.args = {};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { useCallback, useState } from "react";
|
|
4
|
-
import { Dropzone, IMAGE_MIME_TYPE, } from "@mantine/dropzone";
|
|
5
|
-
import styles from "./styles.module.scss";
|
|
6
|
-
import ic_image_colored from "../../assets/icons/ic_image_colored.svg";
|
|
7
|
-
import ic_cancel_circle from "../../assets/icons/ic_cancel_circle.svg";
|
|
8
|
-
export const ImageUploader = ({ width, height, defaultMsg = "이미지 업로드", file, onDrop, showClearButton, onClear, ...props }) => {
|
|
9
|
-
const [fileData, setFileData] = useState(file);
|
|
10
|
-
const handleFileDataClear = useCallback(() => {
|
|
11
|
-
setFileData(undefined);
|
|
12
|
-
if (onClear) {
|
|
13
|
-
onClear();
|
|
14
|
-
}
|
|
15
|
-
}, [onClear]);
|
|
16
|
-
return (_jsxs("div", { className: styles.image_uploader_wrapper, children: [showClearButton && fileData ? (_jsx("div", { className: styles.file_clear_button, onClick: handleFileDataClear, children: _jsx("img", { src: ic_cancel_circle, alt: "clear_file_data" }) })) : null, _jsx(Dropzone, { ...props, maxFiles: 1, className: styles.image_uploader, accept: IMAGE_MIME_TYPE, onDrop: (e) => {
|
|
17
|
-
setFileData(e[0]);
|
|
18
|
-
if (onDrop) {
|
|
19
|
-
onDrop(e);
|
|
20
|
-
}
|
|
21
|
-
}, style: {
|
|
22
|
-
width,
|
|
23
|
-
height,
|
|
24
|
-
}, children: _jsx(_Fragment, { children: fileData ? (_jsx("img", { className: styles.preview, src: typeof fileData === "string"
|
|
25
|
-
? fileData
|
|
26
|
-
: URL.createObjectURL(fileData), alt: `파일명: ${typeof fileData === "string" ? fileData : fileData.name}`, title: `파일명: ${typeof fileData === "string" ? fileData : fileData.name}` })) : (_jsxs("div", { children: [_jsx("img", { src: ic_image_colored, alt: "ic_image_colored" }), _jsx("span", { children: defaultMsg })] })) }) })] }));
|
|
27
|
-
};
|
|
28
|
-
export default ImageUploader;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Modal } from ".";
|
|
3
|
-
export default {
|
|
4
|
-
title: "Core/Modal",
|
|
5
|
-
component: Modal,
|
|
6
|
-
};
|
|
7
|
-
const Template = (args) => _jsx(Modal, { ...args });
|
|
8
|
-
export const defaultModal = Template.bind({});
|
|
9
|
-
defaultModal.args = {
|
|
10
|
-
children: "test",
|
|
11
|
-
opened: true,
|
|
12
|
-
centered: false,
|
|
13
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { Modal as MantineModal, } from "@mantine/core";
|
|
4
|
-
export const Modal = ({ size = "md", width, withCloseButton = false, ...props }) => {
|
|
5
|
-
let sizeNumber = 768;
|
|
6
|
-
if (size === "xs") {
|
|
7
|
-
sizeNumber = 360;
|
|
8
|
-
}
|
|
9
|
-
else if (size === "sm") {
|
|
10
|
-
sizeNumber = 544;
|
|
11
|
-
}
|
|
12
|
-
else if (size === "lg") {
|
|
13
|
-
sizeNumber = 1000;
|
|
14
|
-
}
|
|
15
|
-
else if (size === "xl") {
|
|
16
|
-
sizeNumber = 1200;
|
|
17
|
-
}
|
|
18
|
-
return (_jsx(MantineModal, { size: width || sizeNumber, withCloseButton: withCloseButton, ...props }));
|
|
19
|
-
};
|
|
20
|
-
export default Modal;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Pagination } from ".";
|
|
3
|
-
export default {
|
|
4
|
-
title: "Core/Pagination",
|
|
5
|
-
component: Pagination,
|
|
6
|
-
};
|
|
7
|
-
const Template = (args) => _jsx(Pagination, { ...args });
|
|
8
|
-
export const defaultPagination = Template.bind({});
|
|
9
|
-
defaultPagination.args = {
|
|
10
|
-
currentPageIdx: 0,
|
|
11
|
-
rowsPerPage: 10,
|
|
12
|
-
totalLength: 50,
|
|
13
|
-
paginationSize: 5,
|
|
14
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useMemo, useState } from "react";
|
|
4
|
-
import chevron_left from "../../assets/icons/ic_chevron_left.svg";
|
|
5
|
-
import chevron_right from "../../assets/icons/ic_chevron_right.svg";
|
|
6
|
-
import style from "./style.module.scss";
|
|
7
|
-
export const Pagination = ({ currentPageIdx, rowsPerPage, totalLength, paginationSize, onPageChange, ...props }) => {
|
|
8
|
-
const [currentIdx, setCurrentIdx] = useState(currentPageIdx);
|
|
9
|
-
const [maxPageRows, setMaxPageRows] = useState(50);
|
|
10
|
-
const [totalrows, setTotalRows] = useState(1);
|
|
11
|
-
const [paginationLength, setPaginationLength] = useState(5);
|
|
12
|
-
useMemo(() => {
|
|
13
|
-
setCurrentIdx(currentPageIdx);
|
|
14
|
-
setMaxPageRows(rowsPerPage || 50);
|
|
15
|
-
setTotalRows(totalLength || 1);
|
|
16
|
-
setPaginationLength(paginationSize || 5);
|
|
17
|
-
}, [currentPageIdx, rowsPerPage, totalLength, paginationSize]);
|
|
18
|
-
const onClickPrev = () => {
|
|
19
|
-
if (onPageChange) {
|
|
20
|
-
onPageChange(currentIdx - ((currentIdx % paginationLength) + 1));
|
|
21
|
-
}
|
|
22
|
-
setCurrentIdx((prev) => prev - ((prev % paginationLength) + 1));
|
|
23
|
-
};
|
|
24
|
-
const onClickNext = () => {
|
|
25
|
-
if (onPageChange) {
|
|
26
|
-
onPageChange(currentIdx + paginationLength - (currentIdx % paginationLength));
|
|
27
|
-
}
|
|
28
|
-
setCurrentIdx((prev) => prev + paginationLength - (prev % paginationLength));
|
|
29
|
-
};
|
|
30
|
-
return (_jsxs("div", { ...props, className: style.pagination, children: [currentIdx >= paginationLength ? (_jsx("button", { className: style.arrow, onClick: onClickPrev, children: _jsx("img", { src: chevron_left, alt: "prev" }) })) : null, new Array(paginationLength).fill(0).map((_v, index) => {
|
|
31
|
-
const indexNumber = Math.floor(currentIdx / paginationLength) * paginationLength +
|
|
32
|
-
index +
|
|
33
|
-
1;
|
|
34
|
-
if (indexNumber > Math.ceil(totalrows / maxPageRows)) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
return (_jsx("button", { className: currentIdx === indexNumber - 1
|
|
38
|
-
? style.page_index_active
|
|
39
|
-
: style.page_index, onClick: () => {
|
|
40
|
-
setCurrentIdx(indexNumber - 1);
|
|
41
|
-
if (onPageChange) {
|
|
42
|
-
onPageChange(indexNumber - 1);
|
|
43
|
-
}
|
|
44
|
-
}, children: indexNumber }, `pagination_${index}`));
|
|
45
|
-
}), Math.floor(currentIdx / paginationLength) * paginationLength +
|
|
46
|
-
paginationLength <
|
|
47
|
-
Math.ceil(totalrows / maxPageRows) ? (_jsx("button", { className: style.arrow, onClick: onClickNext, children: _jsx("img", { src: chevron_right, alt: "next" }) })) : null] }));
|
|
48
|
-
};
|
|
49
|
-
export default Pagination;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Radio } from ".";
|
|
3
|
-
export default {
|
|
4
|
-
title: "Core/Radio",
|
|
5
|
-
component: Radio,
|
|
6
|
-
};
|
|
7
|
-
const Template = (args) => _jsx(Radio, { ...args });
|
|
8
|
-
export const defaultRadio = Template.bind({});
|
|
9
|
-
defaultRadio.args = {
|
|
10
|
-
label: "radio label",
|
|
11
|
-
description: "description text",
|
|
12
|
-
size: "md",
|
|
13
|
-
disabled: false,
|
|
14
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { Radio as MantineRadio, } from "@mantine/core";
|
|
4
|
-
import styles from "./styles.module.scss";
|
|
5
|
-
export const Radio = ({ size = "md", ...props }) => {
|
|
6
|
-
let sizeStyle = styles.md_radio;
|
|
7
|
-
if (size === "sm") {
|
|
8
|
-
sizeStyle = styles.sm_radio;
|
|
9
|
-
}
|
|
10
|
-
else if (size === "lg") {
|
|
11
|
-
sizeStyle = styles.lg_radio;
|
|
12
|
-
}
|
|
13
|
-
return _jsx(MantineRadio, { className: sizeStyle, size: size, ...props });
|
|
14
|
-
};
|
|
15
|
-
export default Radio;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { SearchBar } from ".";
|
|
3
|
-
export default {
|
|
4
|
-
title: "Core/SearchBar",
|
|
5
|
-
component: SearchBar,
|
|
6
|
-
};
|
|
7
|
-
const Template = (args) => _jsx(SearchBar, { ...args });
|
|
8
|
-
export const defaultSearchBar = Template.bind({});
|
|
9
|
-
defaultSearchBar.args = {
|
|
10
|
-
label: "label text",
|
|
11
|
-
labelPosition: "top",
|
|
12
|
-
size: "md",
|
|
13
|
-
required: false,
|
|
14
|
-
disabled: false,
|
|
15
|
-
data: ["select 1", "select 2", "select 3"],
|
|
16
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Autocomplete, Input, Tooltip } from "@mantine/core";
|
|
4
|
-
import ic_tooltip from "../../assets/icons/ic_tooltip.svg";
|
|
5
|
-
import ic_input_clear from "../../assets/icons/ic_input_clear.svg";
|
|
6
|
-
import ic_search from "../../assets/icons/ic_search.svg";
|
|
7
|
-
import styles from "./styles.module.scss";
|
|
8
|
-
import { useCallback, useState } from "react";
|
|
9
|
-
export const SearchBar = ({ label, labelPosition = "top", size = "md", required, tooltip, tooltipPosition = "top", errorMsg, description, onChange, onClear, ...props }) => {
|
|
10
|
-
const [textCount, setTextCount] = useState(0);
|
|
11
|
-
let labelStyle = styles.md_label;
|
|
12
|
-
let searchBarStyle = styles.md_textfield;
|
|
13
|
-
let tooltipStyle = styles.md_tooltip;
|
|
14
|
-
if (size === "sm") {
|
|
15
|
-
labelStyle = styles.sm_label;
|
|
16
|
-
searchBarStyle = styles.sm_textfield;
|
|
17
|
-
tooltipStyle = styles.sm_tooltip;
|
|
18
|
-
}
|
|
19
|
-
else if (size === "lg") {
|
|
20
|
-
labelStyle = styles.lg_label;
|
|
21
|
-
searchBarStyle = styles.lg_textfield;
|
|
22
|
-
tooltipStyle = styles.lg_tooltip;
|
|
23
|
-
}
|
|
24
|
-
const onChangeHandler = useCallback((value) => {
|
|
25
|
-
if (onChange) {
|
|
26
|
-
setTextCount(value?.length);
|
|
27
|
-
onChange(value);
|
|
28
|
-
}
|
|
29
|
-
}, [onChange]);
|
|
30
|
-
return (_jsxs("div", { className: labelPosition === "top"
|
|
31
|
-
? styles.top_label_textfield
|
|
32
|
-
: styles.left_label_textfield, children: [_jsxs("div", { children: [label && (_jsx(Input.Label, { required: required, className: labelStyle, children: label })), tooltip && (_jsx(Tooltip, { label: tooltip, position: tooltipPosition, children: _jsx("img", { className: tooltipStyle, src: ic_tooltip, alt: "tooltip_icon" }) }))] }), _jsxs("div", { children: [_jsx("div", { className: styles.textfield_wrapper, children: _jsx(Autocomplete, { ...props, size: size, error: errorMsg, className: searchBarStyle, onChange: onChangeHandler, icon: _jsx("img", { src: ic_search }), iconWidth: 48, rightSection: onClear && textCount > 0 ? (_jsx("div", { className: styles.clear_button, onClick: onClear, children: _jsx("img", { src: ic_input_clear }) })) : undefined }) }), description && (_jsx(Input.Description, { className: styles.input_description, children: description })), errorMsg && (_jsx(Input.Error, { className: styles.input_error_msg, children: errorMsg }))] })] }));
|
|
33
|
-
};
|
|
34
|
-
export default SearchBar;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { SegmentButton } from ".";
|
|
3
|
-
export default {
|
|
4
|
-
title: "Core/SegmentButton",
|
|
5
|
-
component: SegmentButton,
|
|
6
|
-
};
|
|
7
|
-
const Template = (args) => (_jsx(SegmentButton, { ...args }));
|
|
8
|
-
export const defaultSegmentButton = Template.bind({});
|
|
9
|
-
defaultSegmentButton.args = {
|
|
10
|
-
data: ["data1", "data2", "data3"],
|
|
11
|
-
size: "md",
|
|
12
|
-
radius: 6,
|
|
13
|
-
disabled: false,
|
|
14
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { SegmentedControl } from "@mantine/core";
|
|
4
|
-
import styles from "./styles.module.scss";
|
|
5
|
-
export const SegmentButton = ({ size = "md", radius = 6, ...props }) => {
|
|
6
|
-
let sizeStyle = styles.md_segment_button;
|
|
7
|
-
if (size === "sm") {
|
|
8
|
-
sizeStyle = styles.sm_segment_button;
|
|
9
|
-
}
|
|
10
|
-
else if (size === "lg") {
|
|
11
|
-
sizeStyle = styles.lg_segment_button;
|
|
12
|
-
}
|
|
13
|
-
return (_jsx(SegmentedControl, { className: sizeStyle, size: size, radius: radius, styles: {
|
|
14
|
-
control: {
|
|
15
|
-
borderWidth: "0 !important",
|
|
16
|
-
},
|
|
17
|
-
}, ...props }));
|
|
18
|
-
};
|
|
19
|
-
export default SegmentButton;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { Tab } from ".";
|
|
3
|
-
export default {
|
|
4
|
-
title: "Core/Tab",
|
|
5
|
-
component: Tab,
|
|
6
|
-
};
|
|
7
|
-
const Template = (args) => _jsx(Tab, { ...args });
|
|
8
|
-
export const defaultTab = Template.bind({});
|
|
9
|
-
defaultTab.args = {
|
|
10
|
-
tabList: [
|
|
11
|
-
{
|
|
12
|
-
title: "tab title 1",
|
|
13
|
-
value: "default tab 1",
|
|
14
|
-
body: _jsx(_Fragment, { children: "default tab body 1" }),
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
title: "tab title 2",
|
|
18
|
-
value: "default tab 2",
|
|
19
|
-
body: _jsx(_Fragment, { children: "default tab body 2" }),
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
title: "tab title 3",
|
|
23
|
-
value: "default tab 3",
|
|
24
|
-
body: _jsx(_Fragment, { children: "default tab body 3" }),
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
|
-
defaultValue: "default tab 1",
|
|
28
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Tabs } from "@mantine/core";
|
|
4
|
-
import styles from "./styles.module.scss";
|
|
5
|
-
export const Tab = ({ tabList = [], containerPaddingTop, ...props }) => {
|
|
6
|
-
return (_jsxs(Tabs, { ...props, children: [_jsx(Tabs.List, { className: styles.tab_title_list, children: tabList?.map((tab, index) => (_jsxs(Tabs.Tab, { value: tab.value, icon: tab.icon, children: [tab.title, _jsx("div", { className: styles.border_bottom })] }, `tab_${index}`))) }), tabList?.map((tab, index) => (_jsx(Tabs.Panel, { value: tab.value, pt: containerPaddingTop, children: tab.body }, `tab_panel_${index}`)))] }));
|
|
7
|
-
};
|
|
8
|
-
export default Tab;
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Table } from ".";
|
|
3
|
-
export default {
|
|
4
|
-
title: "Core/Table",
|
|
5
|
-
component: Table,
|
|
6
|
-
};
|
|
7
|
-
const Template = (args) => _jsx(Table, { ...args });
|
|
8
|
-
export const defaultTable = Template.bind({});
|
|
9
|
-
defaultTable.args = {
|
|
10
|
-
headerList: ["전기", "불", "물", "풀"],
|
|
11
|
-
striped: true,
|
|
12
|
-
draggable: false,
|
|
13
|
-
tableData: [
|
|
14
|
-
{
|
|
15
|
-
electric: { cell: "피츄", sortTarget: "피츄" },
|
|
16
|
-
fire: { cell: "파이리", sortTarget: "파이리" },
|
|
17
|
-
water: { cell: "꼬부기", sortTarget: "꼬부기" },
|
|
18
|
-
leaf: { cell: "이상해씨", sortTarget: "이상해씨" },
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
electric: { cell: "피카츄", sortTarget: "피카츄" },
|
|
22
|
-
fire: { cell: "리자드", sortTarget: "리자드" },
|
|
23
|
-
water: { cell: "어니부기", sortTarget: "어니부기" },
|
|
24
|
-
leaf: { cell: "이상해풀", sortTarget: "이상해풀" },
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
electric: { cell: "라이츄", sortTarget: "라이츄" },
|
|
28
|
-
fire: { cell: "리자몽", sortTarget: "리자몽" },
|
|
29
|
-
water: { cell: "거북왕", sortTarget: "거북왕" },
|
|
30
|
-
leaf: { cell: "이상해꽃", sortTarget: "이상해꽃" },
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
electric: { cell: "찌리리공", sortTarget: "찌리리공" },
|
|
34
|
-
fire: { cell: "식스테일", sortTarget: "식스테일" },
|
|
35
|
-
water: { cell: "갸라도스", sortTarget: "갸라도스" },
|
|
36
|
-
leaf: { cell: "뚜벅초", sortTarget: "뚜벅초" },
|
|
37
|
-
},
|
|
38
|
-
],
|
|
39
|
-
};
|
|
40
|
-
export const sortableTable = Template.bind({});
|
|
41
|
-
sortableTable.args = {
|
|
42
|
-
headerList: ["전기", "불", "물", "풀", "순번", "선택(정렬테스트용)"],
|
|
43
|
-
striped: true,
|
|
44
|
-
sortable: true,
|
|
45
|
-
tableData: [
|
|
46
|
-
{
|
|
47
|
-
electric: { cell: "피츄", sortTarget: "피츄" },
|
|
48
|
-
fire: { cell: "파이리", sortTarget: "파이리" },
|
|
49
|
-
water: { cell: "꼬부기", sortTarget: "꼬부기" },
|
|
50
|
-
leaf: { cell: "이상해씨", sortTarget: "이상해씨" },
|
|
51
|
-
num: { cell: 1, sortTarget: 1 },
|
|
52
|
-
select: {
|
|
53
|
-
cell: _jsx("input", { type: "checkbox", readOnly: true, checked: true }),
|
|
54
|
-
sortTarget: true,
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
electric: { cell: "피카츄", sortTarget: "피카츄" },
|
|
59
|
-
fire: { cell: "리자드", sortTarget: "리자드" },
|
|
60
|
-
water: { cell: "어니부기", sortTarget: "어니부기" },
|
|
61
|
-
leaf: { cell: "이상해풀", sortTarget: "이상해풀" },
|
|
62
|
-
num: { cell: 2, sortTarget: 2 },
|
|
63
|
-
select: {
|
|
64
|
-
cell: _jsx("input", { type: "checkbox", readOnly: true, checked: false }),
|
|
65
|
-
sortTarget: false,
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
electric: { cell: "라이츄", sortTarget: "라이츄" },
|
|
70
|
-
fire: { cell: "리자몽", sortTarget: "리자몽" },
|
|
71
|
-
water: { cell: "거북왕", sortTarget: "거북왕" },
|
|
72
|
-
leaf: { cell: "이상해꽃", sortTarget: "이상해꽃" },
|
|
73
|
-
num: { cell: 3, sortTarget: 3 },
|
|
74
|
-
select: {
|
|
75
|
-
cell: _jsx("input", { type: "checkbox", readOnly: true, checked: true }),
|
|
76
|
-
sortTarget: true,
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
electric: { cell: "찌리리공", sortTarget: "찌리리공" },
|
|
81
|
-
fire: { cell: "식스테일", sortTarget: "식스테일" },
|
|
82
|
-
water: { cell: "갸라도스", sortTarget: "갸라도스" },
|
|
83
|
-
leaf: { cell: "뚜벅초", sortTarget: "뚜벅초" },
|
|
84
|
-
num: { cell: 4, sortTarget: 4 },
|
|
85
|
-
select: {
|
|
86
|
-
cell: _jsx("input", { type: "checkbox", readOnly: true, checked: false }),
|
|
87
|
-
sortTarget: false,
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
],
|
|
91
|
-
};
|
|
92
|
-
export const draggableTable = Template.bind({});
|
|
93
|
-
draggableTable.args = {
|
|
94
|
-
headerList: ["전기", "불", "물", "풀"],
|
|
95
|
-
striped: true,
|
|
96
|
-
sortable: false,
|
|
97
|
-
draggable: true,
|
|
98
|
-
onDragEnd: (rows) => {
|
|
99
|
-
console.log(rows);
|
|
100
|
-
},
|
|
101
|
-
tableData: [
|
|
102
|
-
{
|
|
103
|
-
electric: { cell: "피츄", sortTarget: "피츄", dndId: 0 },
|
|
104
|
-
fire: { cell: "파이리", sortTarget: "파이리" },
|
|
105
|
-
water: { cell: "꼬부기", sortTarget: "꼬부기" },
|
|
106
|
-
leaf: { cell: "이상해씨", sortTarget: "이상해씨" },
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
electric: { cell: "피카츄", sortTarget: "피카츄", dndId: 1 },
|
|
110
|
-
fire: { cell: "리자드", sortTarget: "리자드" },
|
|
111
|
-
water: { cell: "어니부기", sortTarget: "어니부기" },
|
|
112
|
-
leaf: { cell: "이상해풀", sortTarget: "이상해풀" },
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
electric: { cell: "라이츄", sortTarget: "라이츄", dndId: 2 },
|
|
116
|
-
fire: { cell: "리자몽", sortTarget: "리자몽" },
|
|
117
|
-
water: { cell: "거북왕", sortTarget: "거북왕" },
|
|
118
|
-
leaf: { cell: "이상해꽃", sortTarget: "이상해꽃" },
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
electric: { cell: "찌리리공", sortTarget: "찌리리공", dndId: 3 },
|
|
122
|
-
fire: { cell: "식스테일", sortTarget: "식스테일" },
|
|
123
|
-
water: { cell: "갸라도스", sortTarget: "갸라도스" },
|
|
124
|
-
leaf: { cell: "뚜벅초", sortTarget: "뚜벅초" },
|
|
125
|
-
},
|
|
126
|
-
],
|
|
127
|
-
};
|