@loword/loword-design-system 0.0.9 → 0.0.11
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/dist/components/LDAutoComplete/AutoCompleteBase.js +6 -6
- package/dist/components/LDBadge/LDBadge.d.ts +5 -6
- package/dist/components/LDBadge/LDBadge.d.ts.map +1 -1
- package/dist/components/LDBadge/LDBadge.js +2 -2
- package/dist/components/LDBreadCrumb/LDBreadCrumb.d.ts +1 -2
- package/dist/components/LDBreadCrumb/LDBreadCrumb.d.ts.map +1 -1
- package/dist/components/LDButton/LDButton.d.ts +3 -3
- package/dist/components/LDButton/LDButton.d.ts.map +1 -1
- package/dist/components/LDButton/LDButton.js +5 -5
- package/dist/components/LDCalendar/LDCalendar.d.ts +7 -6
- package/dist/components/LDCalendar/LDCalendar.d.ts.map +1 -1
- package/dist/components/LDCalendar/LDCalendar.js +59 -16
- package/dist/components/LDCarousel/CarouselBase.d.ts.map +1 -1
- package/dist/components/LDCarousel/CarouselBase.js +8 -4
- package/dist/components/LDCheckbox/CheckboxBase.d.ts +1 -3
- package/dist/components/LDCheckbox/CheckboxBase.d.ts.map +1 -1
- package/dist/components/LDCheckbox/CheckboxBase.js +3 -3
- package/dist/components/LDCheckbox/LDCheckbox.d.ts.map +1 -1
- package/dist/components/LDCheckbox/LDCheckbox.js +4 -4
- package/dist/components/LDCheckbox/LDCheckboxGroup.js +1 -1
- package/dist/components/LDCheckbox/LDFormCheckbox.d.ts +14 -0
- package/dist/components/LDCheckbox/LDFormCheckbox.d.ts.map +1 -0
- package/dist/components/LDCheckbox/{FormCheckbox.js → LDFormCheckbox.js} +2 -2
- package/dist/components/LDCheckbox/LDFormCheckboxGroup.d.ts +13 -0
- package/dist/components/LDCheckbox/LDFormCheckboxGroup.d.ts.map +1 -0
- package/dist/components/LDCheckbox/{FormCheckboxGroup.js → LDFormCheckboxGroup.js} +2 -2
- package/dist/components/LDDatePicker/LDDatePicker.d.ts +10 -4
- package/dist/components/LDDatePicker/LDDatePicker.d.ts.map +1 -1
- package/dist/components/LDDatePicker/LDDatePicker.js +95 -25
- package/dist/components/LDDatePicker/LDFormDatePicker.d.ts +13 -0
- package/dist/components/LDDatePicker/LDFormDatePicker.d.ts.map +1 -0
- package/dist/components/LDDatePicker/LDFormDatePicker.js +15 -0
- package/dist/components/LDDateRangePicker/LDDateRangePicker.d.ts +13 -6
- package/dist/components/LDDateRangePicker/LDDateRangePicker.d.ts.map +1 -1
- package/dist/components/LDDateRangePicker/LDDateRangePicker.js +143 -93
- package/dist/components/LDDateRangePicker/LDFormDateRangePicker.d.ts +13 -0
- package/dist/components/LDDateRangePicker/LDFormDateRangePicker.d.ts.map +1 -0
- package/dist/components/LDDateRangePicker/LDFormDateRangePicker.js +20 -0
- package/dist/components/LDDrawer/LDDrawer.js +2 -2
- package/dist/components/LDFileUpload/FileUploadBase.d.ts +11 -3
- package/dist/components/LDFileUpload/FileUploadBase.d.ts.map +1 -1
- package/dist/components/LDFileUpload/FileUploadBase.js +17 -17
- package/dist/components/LDFileUpload/LDFileUpload.d.ts.map +1 -1
- package/dist/components/LDFileUpload/LDFileUpload.js +3 -1
- package/dist/components/LDFileUpload/LDFileUploadList.js +1 -1
- package/dist/components/LDFileUpload/LDImageUpload.d.ts +2 -0
- package/dist/components/LDFileUpload/LDImageUpload.d.ts.map +1 -1
- package/dist/components/LDFileUpload/LDImageUpload.js +5 -1
- package/dist/components/LDFileUpload/LDImageUploadList.js +1 -1
- package/dist/components/LDForm/LDFormErrorMessage.d.ts +3 -1
- package/dist/components/LDForm/LDFormErrorMessage.d.ts.map +1 -1
- package/dist/components/LDForm/LDFormErrorMessage.js +2 -2
- package/dist/components/LDInput/LDFormInput.d.ts +1 -1
- package/dist/components/LDInput/LDFormInput.d.ts.map +1 -1
- package/dist/components/LDInput/LDFormInput.js +37 -14
- package/dist/components/LDInput/LDInput.d.ts +4 -3
- package/dist/components/LDInput/LDInput.d.ts.map +1 -1
- package/dist/components/LDInput/LDInput.js +49 -48
- package/dist/components/LDModal/LDModal.d.ts +19 -40
- package/dist/components/LDModal/LDModal.d.ts.map +1 -1
- package/dist/components/LDModal/LDModal.js +56 -70
- package/dist/components/LDModal/LDModalView.d.ts +51 -0
- package/dist/components/LDModal/LDModalView.d.ts.map +1 -0
- package/dist/components/LDModal/LDModalView.js +72 -0
- package/dist/components/LDOTPInput/LDOTPInput.d.ts.map +1 -1
- package/dist/components/LDOTPInput/LDOTPInput.js +4 -3
- package/dist/components/LDPagination/LDPagination.d.ts +5 -1
- package/dist/components/LDPagination/LDPagination.d.ts.map +1 -1
- package/dist/components/LDPagination/LDPagination.js +10 -1
- package/dist/components/LDPagination/PaginationBase.d.ts +13 -4
- package/dist/components/LDPagination/PaginationBase.d.ts.map +1 -1
- package/dist/components/LDPagination/PaginationBase.js +8 -7
- package/dist/components/LDPopover/LDPopover.js +3 -3
- package/dist/components/LDRadio/LDFormRadioGroup.d.ts +13 -0
- package/dist/components/LDRadio/LDFormRadioGroup.d.ts.map +1 -0
- package/dist/components/LDRadio/{FormRadioGroup.js → LDFormRadioGroup.js} +2 -2
- package/dist/components/LDRadio/LDRadio.d.ts +1 -1
- package/dist/components/LDRadio/LDRadio.d.ts.map +1 -1
- package/dist/components/LDRadio/LDRadio.js +15 -6
- package/dist/components/LDRadio/LDRadioGroup.d.ts.map +1 -1
- package/dist/components/LDRadio/LDRadioGroup.js +1 -1
- package/dist/components/LDRadio/RadioBase.d.ts +2 -3
- package/dist/components/LDRadio/RadioBase.d.ts.map +1 -1
- package/dist/components/LDRadio/RadioBase.js +7 -4
- package/dist/components/LDSelect/LDFormMultiSelect.d.ts +13 -0
- package/dist/components/LDSelect/LDFormMultiSelect.d.ts.map +1 -0
- package/dist/components/LDSelect/{FormMultiSelect.js → LDFormMultiSelect.js} +2 -2
- package/dist/components/LDSelect/LDFormSelect.d.ts +13 -0
- package/dist/components/LDSelect/LDFormSelect.d.ts.map +1 -0
- package/dist/components/LDSelect/LDFormSelect.js +10 -0
- package/dist/components/LDSelect/LDMultiSelect.d.ts +6 -3
- package/dist/components/LDSelect/LDMultiSelect.d.ts.map +1 -1
- package/dist/components/LDSelect/LDMultiSelect.js +35 -31
- package/dist/components/LDSelect/LDSelect.d.ts +6 -3
- package/dist/components/LDSelect/LDSelect.d.ts.map +1 -1
- package/dist/components/LDSelect/LDSelect.js +37 -30
- package/dist/components/LDSelect/SelectBase.d.ts.map +1 -1
- package/dist/components/LDSelect/SelectBase.js +21 -7
- package/dist/components/LDSpinner/LDSpinner.d.ts +1 -1
- package/dist/components/LDSpinner/LDSpinner.d.ts.map +1 -1
- package/dist/components/LDSpinner/LDSpinner.js +6 -6
- package/dist/components/LDTable/LDTanstackTable.js +1 -1
- package/dist/components/LDTable/TableField.d.ts +1 -1
- package/dist/components/LDTable/TableField.d.ts.map +1 -1
- package/dist/components/LDTextarea/LDFormTextarea.d.ts +14 -0
- package/dist/components/LDTextarea/LDFormTextarea.d.ts.map +1 -0
- package/dist/components/LDTextarea/{FormTextarea.js → LDFormTextarea.js} +2 -2
- package/dist/components/LDTextarea/LDTextarea.d.ts +1 -1
- package/dist/components/LDTextarea/LDTextarea.d.ts.map +1 -1
- package/dist/components/LDTextarea/LDTextarea.js +30 -30
- package/dist/components/LDTimePicker/LDFormTimePicker.d.ts +12 -0
- package/dist/components/LDTimePicker/LDFormTimePicker.d.ts.map +1 -0
- package/dist/components/LDTimePicker/{FormTimePicker.js → LDFormTimePicker.js} +3 -3
- package/dist/components/LDTimePicker/LDTimePicker.js +2 -2
- package/dist/components/LDToast/LDToast.js +1 -1
- package/dist/components/LDToggleButton/LDFormToggleButton.d.ts +12 -0
- package/dist/components/LDToggleButton/LDFormToggleButton.d.ts.map +1 -0
- package/dist/components/LDToggleButton/{FormToggleButton.js → LDFormToggleButton.js} +2 -2
- package/dist/index.css +349 -207
- package/dist/index.d.ts +13 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -13
- package/dist/utils/cn.d.ts.map +1 -1
- package/dist/utils/cn.js +25 -1
- package/dist/utils/file.d.ts +2 -2
- package/dist/utils/file.d.ts.map +1 -1
- package/dist/utils/file.js +26 -23
- package/dist/utils/renderIcon.d.ts +1 -2
- package/dist/utils/renderIcon.d.ts.map +1 -1
- package/dist/utils/renderIcon.js +5 -4
- package/package.json +1 -1
- package/src/styles/components/button.css +2 -2
- package/src/styles/components/index.css +1 -0
- package/src/styles/components/input.css +2 -2
- package/src/styles/components/select.css +61 -0
- package/src/styles/motion.css +37 -0
- package/src/theme.css +3 -0
- package/dist/components/Icon/LucideIcon.d.ts +0 -12
- package/dist/components/Icon/LucideIcon.d.ts.map +0 -1
- package/dist/components/Icon/LucideIcon.js +0 -49
- package/dist/components/LDCheckbox/FormCheckbox.d.ts +0 -14
- package/dist/components/LDCheckbox/FormCheckbox.d.ts.map +0 -1
- package/dist/components/LDCheckbox/FormCheckboxGroup.d.ts +0 -13
- package/dist/components/LDCheckbox/FormCheckboxGroup.d.ts.map +0 -1
- package/dist/components/LDDatePicker/FormDatePicker.d.ts +0 -12
- package/dist/components/LDDatePicker/FormDatePicker.d.ts.map +0 -1
- package/dist/components/LDDatePicker/FormDatePicker.js +0 -12
- package/dist/components/LDDateRangePicker/FormDateRangePicker.d.ts +0 -12
- package/dist/components/LDDateRangePicker/FormDateRangePicker.d.ts.map +0 -1
- package/dist/components/LDDateRangePicker/FormDateRangePicker.js +0 -10
- package/dist/components/LDModal/openModal.d.ts +0 -24
- package/dist/components/LDModal/openModal.d.ts.map +0 -1
- package/dist/components/LDModal/openModal.js +0 -52
- package/dist/components/LDRadio/FormRadioGroup.d.ts +0 -13
- package/dist/components/LDRadio/FormRadioGroup.d.ts.map +0 -1
- package/dist/components/LDSelect/FormMultiSelect.d.ts +0 -13
- package/dist/components/LDSelect/FormMultiSelect.d.ts.map +0 -1
- package/dist/components/LDSelect/FormSelect.d.ts +0 -13
- package/dist/components/LDSelect/FormSelect.d.ts.map +0 -1
- package/dist/components/LDSelect/FormSelect.js +0 -10
- package/dist/components/LDTextarea/FormTextarea.d.ts +0 -14
- package/dist/components/LDTextarea/FormTextarea.d.ts.map +0 -1
- package/dist/components/LDTimePicker/FormTimePicker.d.ts +0 -12
- package/dist/components/LDTimePicker/FormTimePicker.d.ts.map +0 -1
- package/dist/components/LDToggleButton/FormToggleButton.d.ts +0 -12
- package/dist/components/LDToggleButton/FormToggleButton.d.ts.map +0 -1
|
@@ -2,6 +2,13 @@ import { Dispatch, type ReactNode, SetStateAction } from 'react';
|
|
|
2
2
|
import { TMimeType } from '../../constants/file.js';
|
|
3
3
|
import { type LDButtonProps } from '../LDButton/LDButton.js';
|
|
4
4
|
import { IFile } from '../../utils/file.js';
|
|
5
|
+
export interface IFileUploadClassNames {
|
|
6
|
+
root?: string;
|
|
7
|
+
input?: string;
|
|
8
|
+
card?: string;
|
|
9
|
+
cardList?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
}
|
|
5
12
|
interface FileUploadContextType {
|
|
6
13
|
recommendedSize?: {
|
|
7
14
|
width: number;
|
|
@@ -16,6 +23,7 @@ interface FileUploadContextType {
|
|
|
16
23
|
onDeleteFile: (file: IFile) => Promise<boolean>;
|
|
17
24
|
disabled?: boolean;
|
|
18
25
|
readOnly?: boolean;
|
|
26
|
+
classNames?: IFileUploadClassNames;
|
|
19
27
|
}
|
|
20
28
|
export declare const useFileUploadContext: () => FileUploadContextType;
|
|
21
29
|
interface RootProps {
|
|
@@ -32,7 +40,7 @@ interface RootProps {
|
|
|
32
40
|
onDeleteFile: (file: IFile) => Promise<boolean>;
|
|
33
41
|
disabled?: boolean;
|
|
34
42
|
readOnly?: boolean;
|
|
35
|
-
|
|
43
|
+
classNames?: IFileUploadClassNames;
|
|
36
44
|
children?: ReactNode;
|
|
37
45
|
}
|
|
38
46
|
interface InputProps extends Omit<LDButtonProps<'button'>, 'type'> {
|
|
@@ -44,10 +52,10 @@ interface ICardListProps {
|
|
|
44
52
|
className?: string;
|
|
45
53
|
}
|
|
46
54
|
export declare const FileUploadBase: {
|
|
47
|
-
Root: ({ recommendedSize, maxSize, allowedExtensions, maxFileCount, fileList, setFileList, onChangeFile, onDeleteFile, disabled, readOnly,
|
|
55
|
+
Root: ({ recommendedSize, maxSize, allowedExtensions, maxFileCount, fileList, setFileList, onChangeFile, onDeleteFile, disabled, readOnly, classNames, children, }: RootProps) => import("react/jsx-runtime").JSX.Element;
|
|
48
56
|
Input: ({ type, label, ...props }: InputProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
49
57
|
CardList: (props: ICardListProps) => import("react/jsx-runtime").JSX.Element;
|
|
50
|
-
Description: (
|
|
58
|
+
Description: (props: {
|
|
51
59
|
className?: string;
|
|
52
60
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
53
61
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileUploadBase.d.ts","sourceRoot":"","sources":["../../../src/components/LDFileUpload/FileUploadBase.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,QAAQ,EACR,KAAK,SAAS,EACd,cAAc,EAIf,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"FileUploadBase.d.ts","sourceRoot":"","sources":["../../../src/components/LDFileUpload/FileUploadBase.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,QAAQ,EACR,KAAK,SAAS,EACd,cAAc,EAIf,MAAM,OAAO,CAAC;AAGf,OAAO,EAAmB,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAiB,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAEpE,OAAO,EAIL,KAAK,EAKN,MAAM,kBAAkB,CAAC;AAI1B,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,UAAU,qBAAqB;IAC7B,eAAe,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,SAAS,EAAE,CAAC;IAC/B,QAAQ,EAAE,KAAK,EAAE,CAAC;IAClB,WAAW,EAAE,QAAQ,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IAC/C,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,YAAY,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAChD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,qBAAqB,CAAC;CACpC;AAID,eAAO,MAAM,oBAAoB,6BAUhC,CAAC;AAEF,UAAU,SAAS;IACjB,eAAe,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,SAAS,EAAE,CAAC;IAC/B,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;IACvB,WAAW,EAAE,QAAQ,CAAC,cAAc,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;IACpD,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,YAAY,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAChD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,qBAAqB,CAAC;IACnC,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAqCD,UAAU,UAAW,SAAQ,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAChE,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA8HD,UAAU,cAAc;IACtB,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAiQD,eAAO,MAAM,cAAc;wKA3ZxB,SAAS;uCA+BT,UAAU;sBA6HY,cAAc;yBAgOX;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE;CAoCjD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { createContext, useContext, useState, } from 'react';
|
|
4
|
+
import { Images, Trash2 } from 'lucide-react';
|
|
4
5
|
import cn from '../../utils/cn.js';
|
|
5
6
|
import { FILE_EXTENSIONS } from '../../constants/file.js';
|
|
6
7
|
import LDButton from '../LDButton/LDButton.js';
|
|
@@ -16,7 +17,7 @@ export const useFileUploadContext = () => {
|
|
|
16
17
|
}
|
|
17
18
|
return fileUploadContext;
|
|
18
19
|
};
|
|
19
|
-
const Root = ({ recommendedSize, maxSize, allowedExtensions, maxFileCount, fileList, setFileList, onChangeFile, onDeleteFile, disabled, readOnly,
|
|
20
|
+
const Root = ({ recommendedSize, maxSize, allowedExtensions, maxFileCount, fileList, setFileList, onChangeFile, onDeleteFile, disabled, readOnly, classNames, children, }) => {
|
|
20
21
|
return (_jsx(FileUploadContext.Provider, { value: {
|
|
21
22
|
recommendedSize,
|
|
22
23
|
maxSize,
|
|
@@ -26,13 +27,13 @@ const Root = ({ recommendedSize, maxSize, allowedExtensions, maxFileCount, fileL
|
|
|
26
27
|
setFileList,
|
|
27
28
|
onChangeFile,
|
|
28
29
|
onDeleteFile,
|
|
30
|
+
classNames,
|
|
29
31
|
disabled,
|
|
30
32
|
readOnly,
|
|
31
|
-
}, children: _jsx("div", { className: cn('w-full',
|
|
33
|
+
}, children: _jsx("div", { className: cn('w-full', classNames?.root), children: children }) }));
|
|
32
34
|
};
|
|
33
35
|
const Input = ({ type = 'default', label = '파일 선택', ...props }) => {
|
|
34
|
-
const { allowedExtensions, maxSize, fileList, setFileList, maxFileCount, onChangeFile, disabled, readOnly, } = useFileUploadContext();
|
|
35
|
-
// readOnly는 보기 전용 — 추가 입력 자체를 렌더하지 않는다.
|
|
36
|
+
const { allowedExtensions, maxSize, fileList, setFileList, maxFileCount, onChangeFile, disabled, readOnly, classNames, } = useFileUploadContext();
|
|
36
37
|
if (readOnly)
|
|
37
38
|
return null;
|
|
38
39
|
const getFileError = async (file) => {
|
|
@@ -88,14 +89,13 @@ const Input = ({ type = 'default', label = '파일 선택', ...props }) => {
|
|
|
88
89
|
if (type === 'image') {
|
|
89
90
|
return (_jsxs("label", { className: cn('border-3 border-dotted rounded-xl border-neutral100 bg-neutral50 text-neutral500', 'size-21 flex justify-center items-center ld-transition', disabled
|
|
90
91
|
? 'opacity-50 cursor-not-allowed'
|
|
91
|
-
: 'hover:bg-neutral-100 hover:border-neutral200 hover:cursor-pointer hover:text-neutral600', props.className), children: [renderIcon(
|
|
92
|
+
: 'hover:bg-neutral-100 hover:border-neutral200 hover:cursor-pointer hover:text-neutral600', props.className, classNames?.input), children: [renderIcon(_jsx(Images, {}), 'size-6'), fileInput] }));
|
|
92
93
|
}
|
|
93
|
-
return (_jsxs(LDButton, { as: "label", ...props, disabled: disabled, children: [label, fileInput] }));
|
|
94
|
+
return (_jsxs(LDButton, { as: "label", ...props, className: cn(props.className, classNames?.input), disabled: disabled, children: [label, fileInput] }));
|
|
94
95
|
};
|
|
95
96
|
const CardList = (props) => {
|
|
96
|
-
const { fileList, setFileList, allowedExtensions, maxSize, onChangeFile, onDeleteFile, disabled, readOnly, } = useFileUploadContext();
|
|
97
|
+
const { fileList, setFileList, allowedExtensions, maxSize, onChangeFile, onDeleteFile, disabled, readOnly, classNames, } = useFileUploadContext();
|
|
97
98
|
const [hoveredList, setHoveredList] = useState(new Array(fileList.length).fill(false));
|
|
98
|
-
// 교체/삭제 차단은 disabled·readOnly 공통. 흐림(opacity)·not-allowed 커서는 disabled에만.
|
|
99
99
|
const locked = disabled || readOnly;
|
|
100
100
|
const handleFile = async (e, idx) => {
|
|
101
101
|
const files = e.target.files;
|
|
@@ -154,7 +154,7 @@ const CardList = (props) => {
|
|
|
154
154
|
? 'cursor-not-allowed'
|
|
155
155
|
: readOnly
|
|
156
156
|
? 'cursor-default'
|
|
157
|
-
: 'hover:cursor-pointer'), onMouseOver: () => {
|
|
157
|
+
: 'hover:cursor-pointer', classNames?.card), onMouseOver: () => {
|
|
158
158
|
setHoveredList((prev) => {
|
|
159
159
|
const next = [...prev];
|
|
160
160
|
next[idx] = true;
|
|
@@ -170,29 +170,29 @@ const CardList = (props) => {
|
|
|
170
170
|
e.preventDefault();
|
|
171
171
|
e.stopPropagation();
|
|
172
172
|
await handleDeleteFile(idx);
|
|
173
|
-
}, disabled: locked, variant: "ghost", leftIcon:
|
|
173
|
+
}, disabled: locked, variant: "ghost", leftIcon: _jsx(Trash2, {}), color: "neutral", className: cn('text-neutral700 absolute top-2 right-2 rounded-sm bg-neutral-100 px-0 flex justify-center items-center min-w-0 h-5 w-5 ld-transition', hoveredList[idx] && !locked ? 'opacity-100' : 'opacity-0') })] }, `${file.fileName}_${idx}`)));
|
|
174
174
|
if (fileList.length <= 1) {
|
|
175
175
|
return (_jsx("div", { className: cn('flex flex-row gap-sm', props.className), children: cards }));
|
|
176
176
|
}
|
|
177
|
-
return (_jsx(LDCarousel, { className: props.className, slideSize: "auto", gap: 8, showArrows: false, showDots: false, slides: cards }));
|
|
177
|
+
return (_jsx(LDCarousel, { className: cn(props.className, classNames?.cardList), slideSize: "auto", gap: 8, showArrows: false, showDots: false, slides: cards }));
|
|
178
178
|
}
|
|
179
|
-
return (_jsx("div", { className:
|
|
179
|
+
return (_jsx("div", { className: cn('flex flex-col gap-sm w-full', classNames?.cardList), children: fileList.map((file, idx) => (_jsxs("label", { className: cn('w-full flex flex-row justify-between items-center px-4 py-3 bg-neutral50 rounded-lg', disabled
|
|
180
180
|
? 'cursor-not-allowed'
|
|
181
181
|
: readOnly
|
|
182
182
|
? 'cursor-default'
|
|
183
|
-
: 'hover:cursor-pointer'), children: [_jsxs("div", { className: "flex flex-row items-center gap-sm", children: [_jsx("div", { className: "size-15 overflow-hidden rounded-lg", children: _jsx("div", { className: "flex size-full items-center justify-center text-neutral500 bg-white", children: isImage(file.fileName) ? (_jsx("img", { src: file?.src, alt: file?.fileName, className: "size-full object-cover" })) : (renderIcon(getFileIcon(file.fileName), 'size-8')) }) }), _jsx("div", { className: "text-neutral700 display16", children: file.fileName })] }), _jsx("input", { type: "file", onClick: (e) => (e.currentTarget.value = ''), onChange: (e) => handleFile(e, idx), disabled: locked, className: "sr-only" }), _jsx(LDButton, { onClick: async (e) => {
|
|
183
|
+
: 'hover:cursor-pointer', classNames?.card), children: [_jsxs("div", { className: "flex flex-row items-center gap-sm", children: [_jsx("div", { className: "size-15 overflow-hidden rounded-lg", children: _jsx("div", { className: "flex size-full items-center justify-center text-neutral500 bg-white", children: isImage(file.fileName) ? (_jsx("img", { src: file?.src, alt: file?.fileName, className: "size-full object-cover" })) : (renderIcon(getFileIcon(file.fileName), 'size-8')) }) }), _jsx("div", { className: "text-neutral700 display16", children: file.fileName })] }), _jsx("input", { type: "file", onClick: (e) => (e.currentTarget.value = ''), onChange: (e) => handleFile(e, idx), disabled: locked, className: "sr-only" }), _jsx(LDButton, { onClick: async (e) => {
|
|
184
184
|
e.stopPropagation();
|
|
185
185
|
await handleDeleteFile(idx);
|
|
186
|
-
}, disabled: locked, variant: "ghost", leftIcon:
|
|
186
|
+
}, disabled: locked, variant: "ghost", leftIcon: _jsx(Trash2, {}), size: "large", color: "neutral", className: cn('text-neutral500 rounded-sm bg-white px-0 flex justify-center items-center min-w-0 h-10 w-10 ld-transition', locked && 'opacity-0 pointer-events-none') })] }, `${file.fileName}_${idx}`))) }));
|
|
187
187
|
};
|
|
188
|
-
const Description = (
|
|
189
|
-
const { recommendedSize, maxSize, allowedExtensions, maxFileCount } = useFileUploadContext();
|
|
188
|
+
const Description = (props) => {
|
|
189
|
+
const { recommendedSize, maxSize, allowedExtensions, maxFileCount, classNames, } = useFileUploadContext();
|
|
190
190
|
const recommendedSizeText = recommendedSize &&
|
|
191
191
|
`권장 사이즈 ${recommendedSize.width}x${recommendedSize.height}, `;
|
|
192
192
|
const requiredText = `최대 크기 ${getFileSizeUnit(maxSize)}`;
|
|
193
193
|
const extensionsText = ` (${allowedExtensions.map((item) => FILE_EXTENSIONS[item]).join(', ')})`;
|
|
194
194
|
const countText = maxFileCount > 1 ? `, 최대 ${maxFileCount}개` : '';
|
|
195
|
-
return (_jsxs("p", { className: cn('display12 text-neutral400 semibold', className), children: [recommendedSizeText, requiredText, extensionsText, countText] }));
|
|
195
|
+
return (_jsxs("p", { className: cn('display12 text-neutral400 semibold', props.className, classNames?.description), children: [recommendedSizeText, requiredText, extensionsText, countText] }));
|
|
196
196
|
};
|
|
197
197
|
export const FileUploadBase = {
|
|
198
198
|
Root,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LDFileUpload.d.ts","sourceRoot":"","sources":["../../../src/components/LDFileUpload/LDFileUpload.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAGzC,UAAU,kBAAkB;IAC1B,eAAe,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,SAAS,EAAE,CAAC;IAC/B,YAAY,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,YAAY,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAChD,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,YAAY,GAAI,OAAO,kBAAkB,
|
|
1
|
+
{"version":3,"file":"LDFileUpload.d.ts","sourceRoot":"","sources":["../../../src/components/LDFileUpload/LDFileUpload.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAGzC,UAAU,kBAAkB;IAC1B,eAAe,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,SAAS,EAAE,CAAC;IAC/B,YAAY,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,YAAY,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAChD,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,YAAY,GAAI,OAAO,kBAAkB,4CA2B9C,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -3,6 +3,8 @@ import FileUploadBase from '../../components/LDFileUpload/FileUploadBase.js';
|
|
|
3
3
|
import { useState } from 'react';
|
|
4
4
|
const LDFileUpload = (props) => {
|
|
5
5
|
const [fileList, setFileList] = useState([]);
|
|
6
|
-
return (_jsxs(FileUploadBase.Root, { fileList: fileList, setFileList: setFileList, maxSize: props.maxSize, allowedExtensions: props.allowedExtensions, recommendedSize: props.recommendedSize ?? { width: 1200, height: 800 }, maxFileCount: 1, onChangeFile: props.onChangeFile, onDeleteFile: props.onDeleteFile,
|
|
6
|
+
return (_jsxs(FileUploadBase.Root, { fileList: fileList, setFileList: setFileList, maxSize: props.maxSize, allowedExtensions: props.allowedExtensions, recommendedSize: props.recommendedSize ?? { width: 1200, height: 800 }, maxFileCount: 1, onChangeFile: props.onChangeFile, onDeleteFile: props.onDeleteFile, classNames: {
|
|
7
|
+
root: 'flex flex-col gap-sm ld-transition',
|
|
8
|
+
}, disabled: props.disabled, readOnly: props.readOnly, children: [fileList[0]?.src ? (_jsx(FileUploadBase.CardList, {})) : (_jsx(FileUploadBase.Input, { className: "w-fit" })), props.isExistDescription && _jsx(FileUploadBase.Description, {})] }));
|
|
7
9
|
};
|
|
8
10
|
export default LDFileUpload;
|
|
@@ -3,6 +3,6 @@ import FileUploadBase from '../../components/LDFileUpload/FileUploadBase.js';
|
|
|
3
3
|
import { useState } from 'react';
|
|
4
4
|
const LDFileUploadList = (props) => {
|
|
5
5
|
const [fileList, setFileList] = useState([]);
|
|
6
|
-
return (_jsxs(FileUploadBase.Root, { fileList: fileList, setFileList: setFileList, maxSize: props.maxSize, allowedExtensions: props.allowedExtensions, recommendedSize: props.recommendedSize ?? { width: 1200, height: 800 }, maxFileCount: props.maxFileCount, onChangeFile: props.onChangeFile, onDeleteFile: props.onDeleteFile,
|
|
6
|
+
return (_jsxs(FileUploadBase.Root, { fileList: fileList, setFileList: setFileList, maxSize: props.maxSize, allowedExtensions: props.allowedExtensions, recommendedSize: props.recommendedSize ?? { width: 1200, height: 800 }, maxFileCount: props.maxFileCount, onChangeFile: props.onChangeFile, onDeleteFile: props.onDeleteFile, classNames: { root: 'flex flex-col gap-sm ld-transition' }, disabled: props.disabled, readOnly: props.readOnly, children: [fileList.length < props.maxFileCount && !props.disabled && (_jsx(FileUploadBase.Input, { className: "w-fit" })), props.isExistDescription && _jsx(FileUploadBase.Description, {}), _jsx("div", { className: "flex flex-row gap-sm", children: fileList.length > 0 && _jsx(FileUploadBase.CardList, {}) })] }));
|
|
7
7
|
};
|
|
8
8
|
export default LDFileUploadList;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IFileUploadClassNames } from '../../components/LDFileUpload/FileUploadBase.js';
|
|
1
2
|
import { TMimeType } from '../../constants/file.js';
|
|
2
3
|
import { IFile } from '../../utils/file.js';
|
|
3
4
|
interface ILDImageUploadProps {
|
|
@@ -12,6 +13,7 @@ interface ILDImageUploadProps {
|
|
|
12
13
|
isExistDescription?: boolean;
|
|
13
14
|
disabled?: boolean;
|
|
14
15
|
readOnly?: boolean;
|
|
16
|
+
classNames?: IFileUploadClassNames;
|
|
15
17
|
}
|
|
16
18
|
declare const LDImageUpload: (props: ILDImageUploadProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
19
|
export default LDImageUpload;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LDImageUpload.d.ts","sourceRoot":"","sources":["../../../src/components/LDFileUpload/LDImageUpload.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LDImageUpload.d.ts","sourceRoot":"","sources":["../../../src/components/LDFileUpload/LDImageUpload.tsx"],"names":[],"mappings":"AAAA,OAAuB,EACrB,qBAAqB,EACtB,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAIzC,UAAU,mBAAmB;IAC3B,eAAe,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,SAAS,EAAE,CAAC;IAC/B,YAAY,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,YAAY,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAChD,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,qBAAqB,CAAC;CACpC;AAED,QAAA,MAAM,aAAa,GAAI,OAAO,mBAAmB,4CA4BhD,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import FileUploadBase from '../../components/LDFileUpload/FileUploadBase.js';
|
|
3
3
|
import { useState } from 'react';
|
|
4
|
+
import cn from '../../utils/cn.js';
|
|
4
5
|
const LDImageUpload = (props) => {
|
|
5
6
|
const [fileList, setFileList] = useState([]);
|
|
6
|
-
return (_jsxs(FileUploadBase.Root, { fileList: fileList, setFileList: setFileList, maxSize: props.maxSize, allowedExtensions: props.allowedExtensions, recommendedSize: props.recommendedSize ?? { width: 1200, height: 800 }, maxFileCount: 1, onChangeFile: props.onChangeFile, onDeleteFile: props.onDeleteFile,
|
|
7
|
+
return (_jsxs(FileUploadBase.Root, { fileList: fileList, setFileList: setFileList, maxSize: props.maxSize, allowedExtensions: props.allowedExtensions, recommendedSize: props.recommendedSize ?? { width: 1200, height: 800 }, maxFileCount: 1, onChangeFile: props.onChangeFile, onDeleteFile: props.onDeleteFile, classNames: {
|
|
8
|
+
...props.classNames,
|
|
9
|
+
root: cn('flex flex-col gap-sm ld-transition', props.classNames?.root),
|
|
10
|
+
}, disabled: props.disabled, readOnly: props.readOnly, children: [fileList[0]?.src ? (_jsx(FileUploadBase.CardList, { type: "image" })) : (_jsx(FileUploadBase.Input, { type: "image" })), props.isExistDescription && _jsx(FileUploadBase.Description, {})] }));
|
|
7
11
|
};
|
|
8
12
|
export default LDImageUpload;
|
|
@@ -3,6 +3,6 @@ import FileUploadBase from '../../components/LDFileUpload/FileUploadBase.js';
|
|
|
3
3
|
import { useState } from 'react';
|
|
4
4
|
const LDImageUploadList = (props) => {
|
|
5
5
|
const [fileList, setFileList] = useState([]);
|
|
6
|
-
return (_jsxs(FileUploadBase.Root, { fileList: fileList, setFileList: setFileList, maxSize: props.maxSize, allowedExtensions: props.allowedExtensions, recommendedSize: props.recommendedSize ?? { width: 1200, height: 800 }, maxFileCount: props.maxFileCount, onChangeFile: props.onChangeFile, onDeleteFile: props.onDeleteFile,
|
|
6
|
+
return (_jsxs(FileUploadBase.Root, { fileList: fileList, setFileList: setFileList, maxSize: props.maxSize, allowedExtensions: props.allowedExtensions, recommendedSize: props.recommendedSize ?? { width: 1200, height: 800 }, maxFileCount: props.maxFileCount, onChangeFile: props.onChangeFile, onDeleteFile: props.onDeleteFile, classNames: { root: 'flex flex-col gap-sm ld-transition' }, disabled: props.disabled, readOnly: props.readOnly, children: [_jsxs("div", { className: "flex flex-row gap-sm", children: [fileList.length > 0 && _jsx(FileUploadBase.CardList, { type: "image" }), fileList.length < props.maxFileCount && !props.disabled && (_jsx(FileUploadBase.Input, { type: "image" }))] }), props.isExistDescription && _jsx(FileUploadBase.Description, {})] }));
|
|
7
7
|
};
|
|
8
8
|
export default LDImageUploadList;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
1
2
|
interface LDFormErrorMessageProps {
|
|
2
3
|
id?: string;
|
|
3
4
|
error: string;
|
|
4
5
|
disabled?: boolean;
|
|
5
6
|
className?: string;
|
|
7
|
+
style?: CSSProperties;
|
|
6
8
|
}
|
|
7
|
-
declare const LDFormErrorMessage: ({ id, error, disabled, className, }: LDFormErrorMessageProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare const LDFormErrorMessage: ({ id, error, disabled, className, style, }: LDFormErrorMessageProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
10
|
export default LDFormErrorMessage;
|
|
9
11
|
//# sourceMappingURL=LDFormErrorMessage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LDFormErrorMessage.d.ts","sourceRoot":"","sources":["../../../src/components/LDForm/LDFormErrorMessage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LDFormErrorMessage.d.ts","sourceRoot":"","sources":["../../../src/components/LDForm/LDFormErrorMessage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAuB,MAAM,OAAO,CAAC;AAG3D,UAAU,uBAAuB;IAC/B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED,QAAA,MAAM,kBAAkB,GAAI,4CAMzB,uBAAuB,4CA0BzB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useEffect, useState } from 'react';
|
|
4
4
|
import cn from '../../utils/cn.js';
|
|
5
|
-
const LDFormErrorMessage = ({ id, error, disabled = false, className, }) => {
|
|
5
|
+
const LDFormErrorMessage = ({ id, error, disabled = false, className, style, }) => {
|
|
6
6
|
const visible = Boolean(error) && !disabled;
|
|
7
7
|
const [displayError, setDisplayError] = useState(error);
|
|
8
8
|
useEffect(() => {
|
|
@@ -12,6 +12,6 @@ const LDFormErrorMessage = ({ id, error, disabled = false, className, }) => {
|
|
|
12
12
|
return (_jsx("div", { id: id, role: "alert", onAnimationEnd: () => {
|
|
13
13
|
if (!visible)
|
|
14
14
|
setDisplayError('');
|
|
15
|
-
}, className: cn('text-danger600 display12 bold absolute bottom-1 right-2', visible ? 'animate-fade-in' : 'animate-fade-out', className), children: displayError && `*${displayError}` }, visible ? displayError : 'hidden'));
|
|
15
|
+
}, className: cn('text-danger600 display12 bold absolute bottom-1 right-2', visible ? 'animate-fade-in' : 'animate-fade-out', className), style: style, children: displayError && `*${displayError}` }, visible ? displayError : 'hidden'));
|
|
16
16
|
};
|
|
17
17
|
export default LDFormErrorMessage;
|
|
@@ -10,6 +10,6 @@ interface LDFormInputProps extends Omit<LDInputProps, 'name' | 'onChange' | 'val
|
|
|
10
10
|
errorClassName?: string;
|
|
11
11
|
showEditIcon?: boolean;
|
|
12
12
|
}
|
|
13
|
-
declare const LDFormInput: ({ name, options, variant,
|
|
13
|
+
declare const LDFormInput: ({ name, options, variant, size, block, disabled, ref, customErrorMessage, isHiddenErrorMessage, errorClassName, showEditIcon, rightAddon, ...props }: LDFormInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
export default LDFormInput;
|
|
15
15
|
//# sourceMappingURL=LDFormInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LDFormInput.d.ts","sourceRoot":"","sources":["../../../src/components/LDInput/LDFormInput.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"LDFormInput.d.ts","sourceRoot":"","sources":["../../../src/components/LDInput/LDFormInput.tsx"],"names":[],"mappings":"AAEA,OAAO,EAML,KAAK,GAAG,EACT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAgB,EACd,KAAK,YAAY,EAGlB,MAAM,WAAW,CAAC;AAQnB,UAAU,gBAAiB,SAAQ,IAAI,CACrC,YAAY,EACZ,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,QAAQ,CACzC;IACC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAYD,QAAA,MAAM,WAAW,GAAI,sJAclB,gBAAgB,4CAiGlB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1,24 +1,47 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx,
|
|
3
|
-
import
|
|
4
|
-
import
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { Children, Fragment, isValidElement, useMemo, } from 'react';
|
|
4
|
+
import LDInput, { iconSizes, } from './LDInput.js';
|
|
5
5
|
import LDFormField from '../LDForm/LDFormField.js';
|
|
6
6
|
import LDFormErrorMessage from '../LDForm/LDFormErrorMessage.js';
|
|
7
7
|
import cn from '../../utils/cn.js';
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
import { Pencil, X } from 'lucide-react';
|
|
9
|
+
import { renderIcon } from '../../utils/renderIcon.js';
|
|
10
|
+
import { iconSizeClasses } from '../../components/LDButton/LDButton.js';
|
|
11
|
+
// addon 아이콘 사이 gap과 동일한 값 (addonListGapClasses = control-padding-x / 2)
|
|
12
|
+
const controlPaddingXVars = {
|
|
13
|
+
'2xsmall': '--control-padding-x-input-2xs',
|
|
14
|
+
xsmall: '--control-padding-x-input-xs',
|
|
15
|
+
small: '--control-padding-x-input-sm',
|
|
16
|
+
medium: '--control-padding-x-input-md',
|
|
17
|
+
large: '--control-padding-x-input-lg',
|
|
18
|
+
xlarge: '--control-padding-x-input-xl',
|
|
19
|
+
};
|
|
20
|
+
const LDFormInput = ({ name, options, variant = 'filled', size = 'small', block = false, disabled = false, ref, customErrorMessage = '', isHiddenErrorMessage = false, errorClassName, showEditIcon = false, rightAddon, ...props }) => {
|
|
21
|
+
const iconSize = iconSizes[size ?? 'medium'];
|
|
22
|
+
const count = useMemo(() => {
|
|
23
|
+
const editIconCount = showEditIcon && !disabled ? 1 : 0;
|
|
24
|
+
const innerCount = isValidElement(rightAddon) && rightAddon.type === Fragment
|
|
25
|
+
? Children.count(rightAddon.props.children)
|
|
26
|
+
: Children.count(rightAddon);
|
|
27
|
+
const visibleIcon = !props.hiddenPasswordToggle && props.type === 'password' ? 1 : 0;
|
|
28
|
+
return editIconCount + visibleIcon + innerCount;
|
|
29
|
+
}, [
|
|
30
|
+
showEditIcon,
|
|
31
|
+
disabled,
|
|
32
|
+
rightAddon,
|
|
33
|
+
props.hiddenPasswordToggle,
|
|
34
|
+
props.type,
|
|
35
|
+
]);
|
|
10
36
|
return (_jsx(LDFormField, { name: name, options: options, customErrorMessage: customErrorMessage, disabled: disabled, ref: ref, children: ({ field, fieldState, resetField }) => {
|
|
11
|
-
const editIconAddon = showEditIcon && !disabled ? (_jsxs(
|
|
37
|
+
const editIconAddon = showEditIcon && !disabled ? (_jsxs("div", { className: "relative", style: { width: iconSize, height: iconSize }, children: [_jsx("span", { className: "absolute top-1/2 left-1/2 -translate-1/2 opacity-100 group-focus-within:opacity-0", children: _jsx(Pencil, { size: iconSize }) }), _jsx("button", { type: "button", "aria-label": "\uC785\uB825 \uB0B4\uC6A9 \uCD08\uAE30\uD654", onMouseDown: (e) => {
|
|
12
38
|
e.preventDefault();
|
|
13
39
|
resetField({ defaultValue: '' });
|
|
14
|
-
}, className:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
[
|
|
18
|
-
}
|
|
19
|
-
const combinedAddon = editIconAddon || rightAddon ? (_jsxs(_Fragment, { children: [editIconAddon, rightAddon] })) : undefined;
|
|
20
|
-
return (_jsxs("div", { className: cn('relative border-2 border-transparent', block ? 'w-full' : 'w-auto'), children: [_jsx(LDInput, { ...props, ...field, value: field.value ?? '', variant: variant, color: fieldState.hasError ? 'danger' : 'neutral', size: size, block: block, rightAddon: combinedAddon, "aria-invalid": fieldState.hasError, "aria-describedby": fieldState.hasError ? fieldState.errorId : undefined }), !isHiddenErrorMessage && (_jsx(LDFormErrorMessage, { id: fieldState.errorId, error: fieldState.error, disabled: disabled, className: cn((showEditIcon || rightAddon || props.showPasswordToggle) &&
|
|
21
|
-
'right-8', errorClassName) }))] }));
|
|
40
|
+
}, className: "absolute top-1/2 left-1/2 -translate-1/2 opacity-0 group-focus-within:opacity-100 text-neutral500 cursor-pointer ld-transition", children: _jsx(X, { size: iconSize }) })] })) : null;
|
|
41
|
+
const combinedAddon = editIconAddon || rightAddon ? (_jsxs(_Fragment, { children: [editIconAddon, renderIcon(rightAddon, iconSizeClasses[size])] })) : undefined;
|
|
42
|
+
return (_jsxs("div", { className: cn('relative', block ? 'w-full' : 'w-auto'), children: [_jsx(LDInput, { ...props, ...field, value: field.value ?? '', variant: variant, color: fieldState.hasError ? 'danger' : 'neutral', size: size, block: block, rightAddon: combinedAddon, "aria-invalid": fieldState.hasError, "aria-describedby": fieldState.hasError ? fieldState.errorId : undefined }), !isHiddenErrorMessage && (_jsx(LDFormErrorMessage, { id: fieldState.errorId, error: fieldState.error, disabled: disabled, className: errorClassName, style: {
|
|
43
|
+
marginRight: `calc(${count * iconSize}px + var(${controlPaddingXVars[size]}) / 2 * ${count})`,
|
|
44
|
+
} }))] }));
|
|
22
45
|
} }));
|
|
23
46
|
};
|
|
24
47
|
export default LDFormInput;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { type InputHTMLAttributes, type ReactNode, type Ref } from 'react';
|
|
2
2
|
type InputVariant = 'filled' | 'outline' | 'ghost';
|
|
3
3
|
type InputColor = 'neutral' | 'point' | 'danger';
|
|
4
|
-
export type InputSize = '
|
|
4
|
+
export type InputSize = '2xsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
|
|
5
5
|
export declare const inputSizeClasses: Record<InputSize, string>;
|
|
6
|
+
export declare const addonListRightOffsetClasses: Record<InputSize, string>;
|
|
6
7
|
export declare const iconSizes: Record<InputSize, number>;
|
|
7
8
|
export interface LDInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'color' | 'size'> {
|
|
8
9
|
/** 입력 필드 스타일 유형 */
|
|
@@ -12,7 +13,7 @@ export interface LDInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>
|
|
|
12
13
|
/** 입력 필드 높이 및 폰트 크기 프리셋 */
|
|
13
14
|
size?: InputSize;
|
|
14
15
|
/** 비밀번호 표시/숨김 토글 버튼 */
|
|
15
|
-
|
|
16
|
+
hiddenPasswordToggle?: boolean;
|
|
16
17
|
/** true 시 너비 100% */
|
|
17
18
|
block?: boolean;
|
|
18
19
|
/** 우측 부가 요소 (아이콘 등) */
|
|
@@ -20,6 +21,6 @@ export interface LDInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>
|
|
|
20
21
|
/** input 요소 ref */
|
|
21
22
|
ref?: Ref<HTMLInputElement>;
|
|
22
23
|
}
|
|
23
|
-
declare const LDInput: ({ variant, color, size,
|
|
24
|
+
declare const LDInput: ({ variant, color, size, block, type, disabled, className, style, rightAddon, hiddenPasswordToggle, ref, ...props }: LDInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
25
|
export default LDInput;
|
|
25
26
|
//# sourceMappingURL=LDInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LDInput.d.ts","sourceRoot":"","sources":["../../../src/components/LDInput/LDInput.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"LDInput.d.ts","sourceRoot":"","sources":["../../../src/components/LDInput/LDInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,mBAAmB,EACxB,KAAK,SAAS,EACd,KAAK,GAAG,EACT,MAAM,OAAO,CAAC;AAMf,KAAK,YAAY,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC;AACnD,KAAK,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;AACjD,MAAM,MAAM,SAAS,GACjB,SAAS,GACT,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,OAAO,GACP,QAAQ,CAAC;AAoCb,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAOtD,CAAC;AAWF,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAOjE,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAO/C,CAAC;AAGF,MAAM,WAAW,YAAa,SAAQ,IAAI,CACxC,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,OAAO,GAAG,MAAM,CACjB;IACC,mBAAmB;IACnB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,YAAY;IACZ,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,2BAA2B;IAC3B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,uBAAuB;IACvB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,qBAAqB;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,uBAAuB;IACvB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,mBAAmB;IACnB,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;CAC7B;AAED,QAAA,MAAM,OAAO,GAAI,oHAad,YAAY,4CA2Fd,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1,79 +1,80 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState, } from 'react';
|
|
2
|
+
import { useState, isValidElement, } from 'react';
|
|
3
3
|
import InputBase from './InputBase.js';
|
|
4
|
-
import LucideIcon from '../Icon/LucideIcon.js';
|
|
5
4
|
import cn from '../../utils/cn.js';
|
|
5
|
+
import { Eye, EyeOff } from 'lucide-react';
|
|
6
6
|
// ── 스타일 매핑 ──
|
|
7
7
|
const variantColorClasses = {
|
|
8
8
|
filled: {
|
|
9
|
-
neutral: 'bg-neutral50 text-neutral900 border-none outline-2 outline-transparent [outline-style:solid] focus:bg-tintBlue focus:outline-lb500',
|
|
10
|
-
point: 'bg-tintBlue text-neutral900 border-none outline-2 outline-transparent [outline-style:solid] focus:outline-lb500',
|
|
11
|
-
danger: 'bg-tintRed text-neutral900 border-none outline-2 outline-
|
|
9
|
+
neutral: 'bg-neutral50 text-neutral900 border-none outline-2 outline-transparent [outline-style:solid] [outline-offset:-2px] focus:bg-tintBlue focus:outline-lb500',
|
|
10
|
+
point: 'bg-tintBlue text-neutral900 border-none outline-2 outline-transparent [outline-style:solid] [outline-offset:-2px] focus:outline-lb500',
|
|
11
|
+
danger: 'bg-tintRed text-neutral900 border-none outline-2 outline-transparent [outline-style:solid] [outline-offset:-2px] outline-danger600',
|
|
12
12
|
},
|
|
13
13
|
outline: {
|
|
14
|
-
neutral: 'bg-transparent text-neutral900 border-2
|
|
15
|
-
point: 'bg-transparent text-neutral900 border-2
|
|
16
|
-
danger: 'bg-transparent text-neutral900 border-2
|
|
14
|
+
neutral: 'bg-transparent text-neutral900 border-none outline-2 outline-neutral100 [outline-style:solid] [outline-offset:-2px] focus:outline-lb500',
|
|
15
|
+
point: 'bg-transparent text-neutral900 border-none outline-2 outline-lb500 [outline-style:solid] [outline-offset:-2px]',
|
|
16
|
+
danger: 'bg-transparent text-neutral900 border-none outline-2 outline-danger600 [outline-style:solid] [outline-offset:-2px]',
|
|
17
17
|
},
|
|
18
18
|
ghost: {
|
|
19
|
-
neutral: 'bg-transparent
|
|
20
|
-
point: 'bg-transparent
|
|
21
|
-
danger: 'bg-transparent
|
|
19
|
+
neutral: 'bg-transparent border-none outline-2 outline-transparent [outline-style:solid] [outline-offset:-2px] focus:bg-neutral50',
|
|
20
|
+
point: 'bg-transparent border-none outline-2 outline-transparent [outline-style:solid] [outline-offset:-2px] focus:bg-tintBlue',
|
|
21
|
+
danger: 'bg-transparent border-none outline-2 outline-transparent [outline-style:solid] [outline-offset:-2px] outline-danger600 focus:bg-tintRed',
|
|
22
22
|
},
|
|
23
23
|
};
|
|
24
24
|
const disabledVariantClasses = {
|
|
25
|
-
filled: 'bg-mono100 text-
|
|
26
|
-
outline: 'bg-
|
|
27
|
-
ghost: 'bg-
|
|
28
|
-
};
|
|
29
|
-
// addon 아이콘 버튼 hover 색 — color 프리셋에 맞춰 강조(LDFormInput reset 아이콘과 동일 컨셉)
|
|
30
|
-
const addonHoverColorClasses = {
|
|
31
|
-
neutral: 'hover:text-neutral600',
|
|
32
|
-
point: 'hover:text-lb500',
|
|
33
|
-
danger: 'hover:text-danger600',
|
|
25
|
+
filled: 'bg-mono100 text-neutral300 border-none',
|
|
26
|
+
outline: 'bg-mono100 text-neutral300 border-none',
|
|
27
|
+
ghost: 'bg-mono100 text-neutral300 border-none',
|
|
34
28
|
};
|
|
35
29
|
export const inputSizeClasses = {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
30
|
+
'2xsmall': 'input-2xs',
|
|
31
|
+
xsmall: 'input-xs',
|
|
32
|
+
small: 'input-sm',
|
|
33
|
+
medium: 'input-md',
|
|
34
|
+
large: 'input-lg',
|
|
35
|
+
xlarge: 'input-xl',
|
|
36
|
+
};
|
|
37
|
+
const addonListGapClasses = {
|
|
38
|
+
'2xsmall': 'gap-[calc(var(--control-padding-x-input-2xs)/2)]',
|
|
39
|
+
xsmall: 'gap-[calc(var(--control-padding-x-input-xs)/2)]',
|
|
40
|
+
small: 'gap-[calc(var(--control-padding-x-input-sm)/2)]',
|
|
41
|
+
medium: 'gap-[calc(var(--control-padding-x-input-md)/2)]',
|
|
42
|
+
large: 'gap-[calc(var(--control-padding-x-input-lg)/2)]',
|
|
43
|
+
xlarge: 'gap-[calc(var(--control-padding-x-input-xl)/2)]',
|
|
42
44
|
};
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
export const addonListRightOffsetClasses = {
|
|
46
|
+
'2xsmall': 'right-[var(--control-padding-x-input-2xs)]',
|
|
47
|
+
xsmall: 'right-[var(--control-padding-x-input-xs)]',
|
|
48
|
+
small: 'right-[var(--control-padding-x-input-sm)]',
|
|
49
|
+
medium: 'right-[var(--control-padding-x-input-md)]',
|
|
50
|
+
large: 'right-[var(--control-padding-x-input-lg)]',
|
|
51
|
+
xlarge: 'right-[var(--control-padding-x-input-xl)]',
|
|
50
52
|
};
|
|
51
53
|
export const iconSizes = {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
'2xsmall': 8,
|
|
55
|
+
xsmall: 12,
|
|
56
|
+
small: 16,
|
|
57
|
+
medium: 20,
|
|
58
|
+
large: 24,
|
|
59
|
+
xlarge: 28,
|
|
58
60
|
};
|
|
59
|
-
const LDInput = ({ variant, color = 'neutral', size,
|
|
61
|
+
const LDInput = ({ variant, color = 'neutral', size, block = false, type = 'text', disabled = false, className, style, rightAddon, hiddenPasswordToggle = false, ref, ...props }) => {
|
|
62
|
+
const isExistAddonIconList = isValidElement(rightAddon);
|
|
60
63
|
const [passwordVisible, setPasswordVisible] = useState(false);
|
|
61
|
-
const
|
|
64
|
+
const isPasswordToggle = !hiddenPasswordToggle && type === 'password';
|
|
65
|
+
const resolvedType = isPasswordToggle
|
|
62
66
|
? passwordVisible
|
|
63
67
|
? 'text'
|
|
64
68
|
: 'password'
|
|
65
69
|
: type;
|
|
66
70
|
const iconSize = iconSizes[size ?? 'medium'];
|
|
67
|
-
const passwordToggleAddon =
|
|
68
|
-
? 'cursor-not-allowed'
|
|
69
|
-
: cn('cursor-pointer', addonHoverColorClasses[color])), children: _jsx(LucideIcon, { name: passwordVisible ? 'eye' : 'eyeOff', size: iconSize }) })) : null;
|
|
70
|
-
const resolvedRightAddon = rightAddon ?? passwordToggleAddon;
|
|
71
|
+
const passwordToggleAddon = isPasswordToggle ? (_jsxs("button", { type: "button", "aria-label": passwordVisible ? '비밀번호 숨기기' : '비밀번호 표시', "aria-pressed": passwordVisible, onClick: () => setPasswordVisible(!passwordVisible), disabled: disabled, style: { width: iconSize, height: iconSize }, className: cn('relative text-neutral500 ld-transition flex items-center', disabled ? 'cursor-not-allowed' : 'cursor-pointer'), children: [_jsx(Eye, { size: iconSize, className: cn('ld-transition absolute top-1/2 left-1/2 -translate-1/2', passwordVisible ? 'opacity-100' : 'opacity-0') }), _jsx(EyeOff, { size: iconSize, className: cn('ld-transition absolute top-1/2 left-1/2 -translate-1/2', passwordVisible ? 'opacity-0' : 'opacity-100') })] })) : null;
|
|
71
72
|
const { width, height, minWidth, maxWidth, minHeight, maxHeight, ...fieldStyle } = style ?? {};
|
|
72
73
|
const rootStyle = { width, height, minWidth, maxWidth, minHeight, maxHeight };
|
|
73
|
-
const fieldClassName = cn('w-full bold placeholder-
|
|
74
|
+
const fieldClassName = cn('w-full bold placeholder-neutral300 ld-transition', variant &&
|
|
74
75
|
(disabled
|
|
75
76
|
? disabledVariantClasses[variant]
|
|
76
|
-
: variantColorClasses[variant][color]), size && !height && inputSizeClasses[size],
|
|
77
|
-
return (_jsxs(InputBase.Root, { block: block, style: rootStyle, children: [_jsx(InputBase.Field, { ref: ref, type: resolvedType, disabled: disabled, className: fieldClassName, style: fieldStyle, ...props }),
|
|
77
|
+
: variantColorClasses[variant][color]), size && !height && inputSizeClasses[size], height && 'h-full', disabled && 'cursor-not-allowed', 'read-only:cursor-not-allowed', className);
|
|
78
|
+
return (_jsxs(InputBase.Root, { block: block, style: rootStyle, children: [_jsx(InputBase.Field, { ref: ref, type: resolvedType, disabled: disabled, className: fieldClassName, style: fieldStyle, ...props }), _jsxs(InputBase.Addon, { position: "right", className: cn('text-neutral500 flex flex-row items-center', size ? addonListRightOffsetClasses[size] : 'right-2.5', isExistAddonIconList && addonListGapClasses[size ?? 'small']), children: [rightAddon, passwordToggleAddon] })] }));
|
|
78
79
|
};
|
|
79
80
|
export default LDInput;
|
|
@@ -1,51 +1,30 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export
|
|
3
|
-
export interface ModalButtons {
|
|
4
|
-
direction?: 'row' | 'column';
|
|
5
|
-
list?: ModalButton[];
|
|
6
|
-
}
|
|
7
|
-
export interface ModalButton<T = unknown> {
|
|
8
|
-
/** 버튼 텍스트 */
|
|
9
|
-
label: string;
|
|
10
|
-
/** 버튼 식별 값 (onButtonClick에 전달) */
|
|
11
|
-
value: T;
|
|
12
|
-
/** 버튼 스타일 유형 */
|
|
13
|
-
variant?: 'solid' | 'outline' | 'ghost';
|
|
14
|
-
/** 버튼 색상 테마 */
|
|
15
|
-
color?: 'neutral' | 'point' | 'danger';
|
|
16
|
-
/** 클릭 핸들러 (false 반환 시 모달 닫힘 방지) */
|
|
17
|
-
onClick?: () => void | boolean | Promise<void | boolean>;
|
|
18
|
-
}
|
|
19
|
-
export interface LDModalProps {
|
|
20
|
-
/** 모달 열림 상태 (제어 컴포넌트) */
|
|
21
|
-
open?: boolean;
|
|
22
|
-
/** 초기 열림 상태 (비제어 컴포넌트) */
|
|
23
|
-
defaultOpen?: boolean;
|
|
24
|
-
/** 열림 상태 변경 시 호출되는 콜백 */
|
|
25
|
-
onOpenChange?: (open: boolean) => void;
|
|
26
|
-
/** 서브 타이틀 (title 위에 표시) */
|
|
1
|
+
import { type ModalSize } from './LDModalView.js';
|
|
2
|
+
export interface LDModalOptions<T = undefined> {
|
|
27
3
|
name?: string;
|
|
28
|
-
/** 모달 제목 */
|
|
29
4
|
title?: string;
|
|
30
|
-
/** 모달 설명 텍스트 */
|
|
31
5
|
description?: string;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
6
|
+
content?: React.ReactNode | ((args: {
|
|
7
|
+
onClose: (value?: T) => void;
|
|
8
|
+
}) => React.ReactNode);
|
|
9
|
+
buttons?: {
|
|
10
|
+
value: T;
|
|
11
|
+
label: string;
|
|
12
|
+
variant?: 'solid' | 'outline' | 'ghost';
|
|
13
|
+
color?: 'neutral' | 'point' | 'danger';
|
|
14
|
+
onClick?: () => void | boolean | Promise<void | boolean>;
|
|
15
|
+
}[];
|
|
16
|
+
/** 버튼 배치 방향 */
|
|
17
|
+
buttonsDirection?: 'row' | 'column';
|
|
35
18
|
size?: ModalSize;
|
|
36
|
-
/** 너비 직접 지정 (size보다 우선) */
|
|
37
19
|
icon?: 'success' | 'fail';
|
|
38
|
-
/**
|
|
39
|
-
buttons?: ModalButtons;
|
|
40
|
-
/** 스크롤 동작 */
|
|
20
|
+
/** 스크롤 동작 (LDModalView와 동일) */
|
|
41
21
|
scrollBehavior?: 'inside' | 'outside';
|
|
42
|
-
/** 추가 CSS 클래스
|
|
22
|
+
/** 모달 패널에 적용할 추가 CSS 클래스 */
|
|
43
23
|
className?: string;
|
|
44
|
-
/** 인라인 스타일 (
|
|
24
|
+
/** 모달 패널 인라인 스타일 (자유 width/height 등) */
|
|
45
25
|
style?: React.CSSProperties;
|
|
46
|
-
|
|
47
|
-
onButtonClick?: (value: unknown) => void;
|
|
26
|
+
onBeforeClose?: () => Promise<boolean> | boolean;
|
|
48
27
|
}
|
|
49
|
-
declare const LDModal:
|
|
28
|
+
declare const LDModal: <T = undefined>(options: LDModalOptions<T>) => Promise<T | undefined>;
|
|
50
29
|
export default LDModal;
|
|
51
30
|
//# sourceMappingURL=LDModal.d.ts.map
|