@loword/loword-design-system 0.0.11 → 0.0.13
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/LDAccordion/AccordionBase.d.ts +41 -0
- package/dist/components/LDAccordion/AccordionBase.d.ts.map +1 -0
- package/dist/components/LDAccordion/AccordionBase.js +24 -0
- package/dist/components/LDAccordion/LDAccordion.d.ts +31 -0
- package/dist/components/LDAccordion/LDAccordion.d.ts.map +1 -0
- package/dist/components/LDAccordion/LDAccordion.js +21 -0
- package/dist/components/LDAvatar/LDAvatar.d.ts +1 -1
- package/dist/components/LDAvatar/LDAvatar.d.ts.map +1 -1
- package/dist/components/LDAvatar/LDAvatar.js +19 -10
- package/dist/components/LDCalendar/CalendarBase.d.ts +17 -0
- package/dist/components/LDCalendar/CalendarBase.d.ts.map +1 -0
- package/dist/components/LDCalendar/CalendarBase.js +49 -0
- package/dist/components/LDCalendar/LDCalendar.d.ts +4 -11
- package/dist/components/LDCalendar/LDCalendar.d.ts.map +1 -1
- package/dist/components/LDCalendar/LDCalendar.js +9 -40
- package/dist/components/LDCarousel/CarouselBase.d.ts +3 -3
- package/dist/components/LDCarousel/CarouselBase.d.ts.map +1 -1
- package/dist/components/LDCarousel/CarouselBase.js +9 -7
- package/dist/components/LDCarousel/LDCarousel.d.ts +7 -8
- package/dist/components/LDCarousel/LDCarousel.d.ts.map +1 -1
- package/dist/components/LDCarousel/LDCarousel.js +2 -2
- package/dist/components/LDCheckbox/CheckboxBase.js +1 -1
- package/dist/components/LDCheckbox/LDCheckbox.d.ts +2 -5
- package/dist/components/LDCheckbox/LDCheckbox.d.ts.map +1 -1
- package/dist/components/LDCheckbox/LDCheckbox.js +65 -7
- package/dist/components/LDCheckbox/LDCheckboxGroup.d.ts +3 -3
- package/dist/components/LDCheckbox/LDCheckboxGroup.d.ts.map +1 -1
- package/dist/components/LDCheckbox/LDCheckboxGroup.js +11 -2
- package/dist/components/LDCheckbox/LDFormCheckbox.d.ts +1 -3
- package/dist/components/LDCheckbox/LDFormCheckbox.d.ts.map +1 -1
- package/dist/components/LDCheckbox/LDFormCheckbox.js +3 -4
- package/dist/components/LDCheckbox/LDFormCheckboxGroup.d.ts +1 -3
- package/dist/components/LDCheckbox/LDFormCheckboxGroup.d.ts.map +1 -1
- package/dist/components/LDCheckbox/LDFormCheckboxGroup.js +3 -4
- package/dist/components/LDDataCalendar/DataCalendarBase.d.ts +17 -1
- package/dist/components/LDDataCalendar/DataCalendarBase.d.ts.map +1 -1
- package/dist/components/LDDataCalendar/DataCalendarBase.js +34 -4
- package/dist/components/LDDataCalendar/LDDataCalendar.d.ts +27 -10
- package/dist/components/LDDataCalendar/LDDataCalendar.d.ts.map +1 -1
- package/dist/components/LDDataCalendar/LDDataCalendar.js +8 -8
- package/dist/components/LDDatePicker/LDDatePicker.d.ts.map +1 -1
- package/dist/components/LDDatePicker/LDDatePicker.js +1 -1
- package/dist/components/LDDateRangePicker/LDDateRangePicker.d.ts.map +1 -1
- package/dist/components/LDDateRangePicker/LDDateRangePicker.js +1 -1
- package/dist/components/LDDrawer/LDDrawer.d.ts +2 -0
- package/dist/components/LDDrawer/LDDrawer.d.ts.map +1 -1
- package/dist/components/LDDrawer/LDDrawer.js +1 -1
- package/dist/components/LDEditor/LDEditor.d.ts.map +1 -1
- package/dist/components/LDEditor/LDEditor.js +94 -54
- package/dist/components/LDEmpty/EmptyBase.d.ts +19 -0
- package/dist/components/LDEmpty/EmptyBase.d.ts.map +1 -0
- package/dist/components/LDEmpty/EmptyBase.js +18 -0
- package/dist/components/LDEmpty/LDEmpty.d.ts +35 -0
- package/dist/components/LDEmpty/LDEmpty.d.ts.map +1 -0
- package/dist/components/LDEmpty/LDEmpty.js +30 -0
- package/dist/components/LDFileUpload/FileUploadBase.d.ts.map +1 -1
- package/dist/components/LDFileUpload/FileUploadBase.js +6 -6
- package/dist/components/LDFileUpload/LDFileUpload.d.ts +3 -0
- package/dist/components/LDFileUpload/LDFileUpload.d.ts.map +1 -1
- package/dist/components/LDFileUpload/LDFileUpload.js +2 -4
- package/dist/components/LDFileUpload/LDFileUploadList.d.ts +3 -0
- package/dist/components/LDFileUpload/LDFileUploadList.d.ts.map +1 -1
- package/dist/components/LDFileUpload/LDFileUploadList.js +1 -3
- package/dist/components/LDFileUpload/LDImageUpload.d.ts +3 -0
- package/dist/components/LDFileUpload/LDImageUpload.d.ts.map +1 -1
- package/dist/components/LDFileUpload/LDImageUpload.js +2 -4
- package/dist/components/LDFileUpload/LDImageUploadList.d.ts +3 -0
- package/dist/components/LDFileUpload/LDImageUploadList.d.ts.map +1 -1
- package/dist/components/LDFileUpload/LDImageUploadList.js +1 -3
- package/dist/components/LDInput/InputBase.d.ts +5 -3
- package/dist/components/LDInput/InputBase.d.ts.map +1 -1
- package/dist/components/LDInput/InputBase.js +4 -4
- package/dist/components/LDInput/LDFormInput.d.ts.map +1 -1
- package/dist/components/LDInput/LDFormInput.js +7 -27
- package/dist/components/LDInput/LDInput.d.ts +8 -2
- package/dist/components/LDInput/LDInput.d.ts.map +1 -1
- package/dist/components/LDInput/LDInput.js +91 -28
- package/dist/components/LDLNB/LDLNB.d.ts +42 -0
- package/dist/components/LDLNB/LDLNB.d.ts.map +1 -0
- package/dist/components/LDLNB/LDLNB.js +34 -0
- package/dist/components/LDLNB/LDLNBBase.d.ts +5 -13
- package/dist/components/LDLNB/LDLNBBase.d.ts.map +1 -1
- package/dist/components/LDLNB/LDLNBBase.js +52 -18
- package/dist/components/LDMenuBar/LDMenuBar.d.ts +33 -19
- package/dist/components/LDMenuBar/LDMenuBar.d.ts.map +1 -1
- package/dist/components/LDMenuBar/LDMenuBar.js +13 -27
- package/dist/components/LDMenuBar/MenuBarBase.d.ts +4 -5
- package/dist/components/LDMenuBar/MenuBarBase.d.ts.map +1 -1
- package/dist/components/LDMenuBar/MenuBarBase.js +12 -14
- package/dist/components/LDModal/LDModal.d.ts +2 -1
- package/dist/components/LDModal/LDModal.d.ts.map +1 -1
- package/dist/components/LDModal/LDModal.js +1 -1
- package/dist/components/LDModal/LDModalView.d.ts +11 -3
- package/dist/components/LDModal/LDModalView.d.ts.map +1 -1
- package/dist/components/LDModal/LDModalView.js +4 -4
- package/dist/components/LDNotification/LDNotification.d.ts +40 -0
- package/dist/components/LDNotification/LDNotification.d.ts.map +1 -0
- package/dist/components/LDNotification/LDNotification.js +76 -0
- package/dist/components/LDNotification/NotificationBase.d.ts +29 -0
- package/dist/components/LDNotification/NotificationBase.d.ts.map +1 -0
- package/dist/components/LDNotification/NotificationBase.js +27 -0
- package/dist/components/LDOTPInput/LDFormOTPInput.d.ts +15 -0
- package/dist/components/LDOTPInput/LDFormOTPInput.d.ts.map +1 -0
- package/dist/components/LDOTPInput/LDFormOTPInput.js +8 -0
- package/dist/components/LDOTPInput/LDOTPInput.d.ts +10 -22
- package/dist/components/LDOTPInput/LDOTPInput.d.ts.map +1 -1
- package/dist/components/LDOTPInput/LDOTPInput.js +44 -73
- package/dist/components/LDOTPInput/OTPInputBase.d.ts +46 -0
- package/dist/components/LDOTPInput/OTPInputBase.d.ts.map +1 -0
- package/dist/components/LDOTPInput/OTPInputBase.js +48 -0
- package/dist/components/LDPagination/LDPagination.d.ts +1 -1
- package/dist/components/LDPagination/LDPagination.d.ts.map +1 -1
- package/dist/components/LDPagination/LDPagination.js +1 -8
- package/dist/components/LDPopover/LDPopover.d.ts +1 -1
- package/dist/components/LDPopover/LDPopover.d.ts.map +1 -1
- package/dist/components/LDPopover/LDPopover.js +5 -4
- package/dist/components/LDProgressBar/LDProgressBar.d.ts +16 -0
- package/dist/components/LDProgressBar/LDProgressBar.d.ts.map +1 -0
- package/dist/components/LDProgressBar/LDProgressBar.js +9 -0
- package/dist/components/LDProgressBar/ProgressBarBase.d.ts +11 -0
- package/dist/components/LDProgressBar/ProgressBarBase.d.ts.map +1 -0
- package/dist/components/LDProgressBar/ProgressBarBase.js +10 -0
- package/dist/components/LDRadio/LDFormRadioGroup.d.ts +1 -3
- package/dist/components/LDRadio/LDFormRadioGroup.d.ts.map +1 -1
- package/dist/components/LDRadio/LDFormRadioGroup.js +3 -4
- 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 +58 -12
- package/dist/components/LDRadio/LDRadioGroup.d.ts +5 -3
- package/dist/components/LDRadio/LDRadioGroup.d.ts.map +1 -1
- package/dist/components/LDRadio/LDRadioGroup.js +11 -2
- package/dist/components/LDSectionNav/LDSectionNav.d.ts +11 -0
- package/dist/components/LDSectionNav/LDSectionNav.d.ts.map +1 -0
- package/dist/components/LDSectionNav/LDSectionNav.js +11 -0
- package/dist/components/LDSectionNav/SectionNavBase.d.ts +20 -0
- package/dist/components/LDSectionNav/SectionNavBase.d.ts.map +1 -0
- package/dist/components/LDSectionNav/SectionNavBase.js +53 -0
- package/dist/components/LDSelect/LDMultiSelect.js +3 -3
- package/dist/components/LDSelect/LDSelect.d.ts.map +1 -1
- package/dist/components/LDSelect/LDSelect.js +2 -2
- package/dist/components/LDTable/LDCollapsibleTanstackTable.d.ts.map +1 -1
- package/dist/components/LDTable/LDCollapsibleTanstackTable.js +12 -9
- package/dist/components/LDTable/LDTable.d.ts.map +1 -1
- package/dist/components/LDTable/LDTable.js +1 -1
- package/dist/components/LDTable/LDTanstackTable.d.ts.map +1 -1
- package/dist/components/LDTable/LDTanstackTable.js +5 -6
- package/dist/components/LDTable/TableField.d.ts.map +1 -1
- package/dist/components/LDTextarea/LDTextarea.js +1 -1
- package/dist/components/LDTimePicker/LDTimePicker.js +1 -1
- package/dist/components/LDToast/LDToaster.d.ts +2 -1
- package/dist/components/LDToast/LDToaster.d.ts.map +1 -1
- package/dist/components/LDToast/LDToaster.js +2 -2
- package/dist/components/LDToggleButton/LDFormToggleButton.d.ts +1 -3
- package/dist/components/LDToggleButton/LDFormToggleButton.d.ts.map +1 -1
- package/dist/components/LDToggleButton/LDFormToggleButton.js +3 -4
- package/dist/components/LDTooltip/LDTooltip.js +1 -1
- package/dist/components/LDTooltip/TooltipBase.d.ts +6 -2
- package/dist/components/LDTooltip/TooltipBase.d.ts.map +1 -1
- package/dist/components/LDTooltip/TooltipBase.js +4 -4
- package/dist/index.css +633 -166
- package/dist/index.d.ts +21 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +25 -13
- package/package.json +14 -2
- package/src/styles/carousel.css +15 -14
- package/src/styles/components/editor.css +6 -0
- package/src/styles/components/input.css +14 -0
- package/src/styles/components/shared.css +6 -6
- package/src/styles/motion.css +78 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { AlignCenter, AlignJustify, AlignLeft, AlignRight, Bold, ChevronDown, Image as ImageIcon, Italic, Link2, List, ListOrdered, Redo, Strikethrough, Underline, Undo, Unlink, } from 'lucide-react';
|
|
4
|
-
import { useState } from 'react';
|
|
4
|
+
import { useEffect, useState } from 'react';
|
|
5
5
|
import { useEditorState } from '@tiptap/react';
|
|
6
|
+
import { BubbleMenu } from '@tiptap/react/menus';
|
|
6
7
|
import EditorBase, { useEditorContext } from './EditorBase.js';
|
|
7
8
|
import { createEditorExtensions } from './extensions.js';
|
|
8
9
|
import cn from '../../utils/cn.js';
|
|
@@ -42,7 +43,16 @@ const LDEditor = ({ content, onChange, className, handleImageUpload, }) => {
|
|
|
42
43
|
};
|
|
43
44
|
const EditorToolbar = ({ handleImageUpload, }) => {
|
|
44
45
|
const [linkUrl, setLinkUrl] = useState('');
|
|
46
|
+
const [isMobile, setIsMobile] = useState(false);
|
|
45
47
|
const { editor } = useEditorContext();
|
|
48
|
+
// 모바일(<768px)에서는 인라인 서식을 버블 메뉴로 옮기고 상단 툴바는 슬림하게.
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
const mql = window.matchMedia('(max-width: 767px)');
|
|
51
|
+
const sync = () => setIsMobile(mql.matches);
|
|
52
|
+
sync();
|
|
53
|
+
mql.addEventListener('change', sync);
|
|
54
|
+
return () => mql.removeEventListener('change', sync);
|
|
55
|
+
}, []);
|
|
46
56
|
const state = useEditorState({
|
|
47
57
|
editor,
|
|
48
58
|
selector: ({ editor }) => {
|
|
@@ -105,58 +115,88 @@ const EditorToolbar = ({ handleImageUpload, }) => {
|
|
|
105
115
|
};
|
|
106
116
|
if (!editor || !state)
|
|
107
117
|
return null;
|
|
108
|
-
return (_jsxs(EditorBase.Toolbar, { className: "gap-5 px-4 py-3 rounded-t-md border border-neutral200", children: [_jsx(EditorBase.Toolbar.Dropdown, { className: "bg-white border border-neutral200 rounded-lg shadow-lg min-w-[120px]", trigger: ({ toggle }) => (_jsx(EditorBase.Toolbar.LDButton, { onClick: toggle, className: cn(iconBtn, 'flex items-center gap-5 px-2'), children: _jsx("span", { className: "whitespace-nowrap min-w-10", children: state.headingLevel ? `제목 ${state.headingLevel}` : '본문' }) })), children: ({ close }) => HEADINGS.map(({ label, level }) => (_jsx("button", { type: "button", onClick: (e) => {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
118
|
+
return (_jsxs(_Fragment, { children: [_jsxs(EditorBase.Toolbar, { className: "gap-5 px-4 py-3 rounded-t-md border border-neutral200", children: [_jsx(EditorBase.Toolbar.Dropdown, { className: "bg-white border border-neutral200 rounded-lg shadow-lg min-w-[120px]", trigger: ({ toggle }) => (_jsx(EditorBase.Toolbar.LDButton, { onClick: toggle, className: cn(iconBtn, 'flex items-center gap-5 px-2'), children: _jsx("span", { className: "whitespace-nowrap min-w-10", children: state.headingLevel ? `제목 ${state.headingLevel}` : '본문' }) })), children: ({ close }) => HEADINGS.map(({ label, level }) => (_jsx("button", { type: "button", onClick: (e) => {
|
|
119
|
+
e.preventDefault();
|
|
120
|
+
if (level === 0)
|
|
121
|
+
editor.chain().focus().setParagraph().run();
|
|
122
|
+
else
|
|
123
|
+
editor.chain().focus().toggleHeading({ level }).run();
|
|
124
|
+
close();
|
|
125
|
+
}, className: "w-full px-3 py-2 cursor-pointer text-left text-sm hover:bg-mono100 first:rounded-t-lg last:rounded-b-lg", children: label }, level))) }), !isMobile && (_jsxs(_Fragment, { children: [_jsx(LDDivider, {}), _jsx(EditorBase.Toolbar.LDButton, { onClick: () => editor.chain().focus().toggleBold().run(), className: cn(iconBtn, state.isBold && activeBtn), children: _jsx(Bold, { className: "w-5 h-5" }) }), _jsx(EditorBase.Toolbar.LDButton, { onClick: () => editor.chain().focus().toggleItalic().run(), className: cn(iconBtn, state.isItalic && activeBtn), children: _jsx(Italic, { className: "w-5 h-5" }) }), _jsx(EditorBase.Toolbar.LDButton, { onClick: () => editor.chain().focus().toggleUnderline().run(), className: cn(iconBtn, state.isUnderline && activeBtn), children: _jsx(Underline, { className: "w-5 h-5" }) }), _jsx(EditorBase.Toolbar.LDButton, { onClick: () => editor.chain().focus().toggleStrike().run(), className: cn(iconBtn, state.isStrike && activeBtn), children: _jsx(Strikethrough, { className: "w-5 h-5" }) }), _jsx(LDDivider, {}), _jsx(EditorBase.Toolbar.Dropdown, { className: "border border-neutral200 bg-white rounded-lg shadow-lg min-w-[100px]", trigger: ({ toggle }) => (_jsxs(EditorBase.Toolbar.LDButton, { onClick: toggle, className: cn(iconBtn, 'flex items-center gap-1 px-2'), children: [_jsx("span", { className: "text-sm whitespace-nowrap", children: state.fontSize }), _jsx(ChevronDown, { className: "w-4 h-4" })] })), children: ({ close }) => FONT_SIZES.map((size) => (_jsx("button", { type: "button", onClick: (e) => {
|
|
126
|
+
e.preventDefault();
|
|
127
|
+
editor.chain().focus().setFontSize(size).run();
|
|
128
|
+
close();
|
|
129
|
+
}, className: "w-full px-3 py-2 cursor-pointer text-left text-sm hover:bg-mono100 first:rounded-t-lg last:rounded-b-lg", children: size }, size))) }), _jsx(EditorBase.Toolbar.Dropdown, { className: "bg-white border border-neutral200 rounded-lg shadow-lg min-w-[140px]", trigger: ({ toggle }) => (_jsxs(EditorBase.Toolbar.LDButton, { onClick: toggle, className: cn(iconBtn, 'flex items-center gap-2 px-2'), children: [_jsx("span", { className: "w-4 h-4 rounded-full", style: { backgroundColor: state.color } }), state.color, _jsx(ChevronDown, { className: "w-4 h-4" })] })), children: ({ close }) => COLORS.map((color) => (_jsxs("button", { type: "button", onClick: (e) => {
|
|
130
|
+
e.preventDefault();
|
|
131
|
+
editor.chain().focus().setColor(color.value).run();
|
|
132
|
+
close();
|
|
133
|
+
}, className: "flex items-center gap-2 w-full px-3 py-2 cursor-pointer text-left text-sm hover:bg-mono100 first:rounded-t-lg last:rounded-b-lg", children: [_jsx("span", { className: "w-4 h-4 rounded-full", style: { backgroundColor: color.value } }), _jsx("span", { children: color.label })] }, color.value))) }), _jsx(LDDivider, {}), ['left', 'center', 'right', 'justify'].map((align) => {
|
|
134
|
+
const Icon = {
|
|
135
|
+
left: AlignLeft,
|
|
136
|
+
center: AlignCenter,
|
|
137
|
+
right: AlignRight,
|
|
138
|
+
justify: AlignJustify,
|
|
139
|
+
}[align];
|
|
140
|
+
return (_jsx(EditorBase.Toolbar.LDButton, { onClick: () => editor.chain().focus().setTextAlign(align).run(), className: cn(iconBtn, state.align[align] && activeBtn), children: _jsx(Icon, { className: "w-5 h-5" }) }, align));
|
|
141
|
+
})] })), _jsx(LDDivider, {}), _jsx(EditorBase.Toolbar.LDButton, { onClick: () => editor.chain().focus().toggleBulletList().run(), className: cn(iconBtn, state.isBulletList && activeBtn), children: _jsx(List, { className: "w-5 h-5" }) }), _jsx(EditorBase.Toolbar.LDButton, { onClick: () => editor.chain().focus().toggleOrderedList().run(), className: cn(iconBtn, state.isOrderedList && activeBtn), children: _jsx(ListOrdered, { className: "w-5 h-5" }) }), _jsx(LDDivider, {}), _jsx(EditorBase.Toolbar.LDButton, { disabled: !state.canUndo, onClick: () => editor.chain().focus().undo().run(), className: iconBtn, children: _jsx(Undo, { className: "w-5 h-5" }) }), _jsx(EditorBase.Toolbar.LDButton, { disabled: !state.canRedo, onClick: () => editor.chain().focus().redo().run(), className: iconBtn, children: _jsx(Redo, { className: "w-5 h-5" }) }), !isMobile && (_jsxs(_Fragment, { children: [_jsx(LDDivider, {}), _jsx(EditorBase.Toolbar.Dropdown, { className: "bg-white border border-neutral200 rounded-lg shadow-lg p-3 min-w-[280px]", trigger: ({ toggle }) => (_jsx(EditorBase.Toolbar.LDButton, { onClick: () => {
|
|
142
|
+
setLinkUrl(editor.getAttributes('link').href || '');
|
|
143
|
+
toggle();
|
|
144
|
+
}, className: cn(iconBtn, state.isLink && activeBtn), children: _jsx(Link2, { className: "w-5 h-5" }) })), children: ({ close }) => {
|
|
145
|
+
const applyLink = () => {
|
|
146
|
+
const chain = editor.chain().focus().extendMarkRange('link');
|
|
147
|
+
if (linkUrl === '') {
|
|
148
|
+
chain.unsetLink().run();
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
const url = /^https?:\/\//.test(linkUrl)
|
|
152
|
+
? linkUrl
|
|
153
|
+
: `https://${linkUrl}`;
|
|
154
|
+
chain.setLink({ href: url }).run();
|
|
155
|
+
}
|
|
156
|
+
setLinkUrl('');
|
|
157
|
+
close();
|
|
158
|
+
};
|
|
159
|
+
return (_jsxs(_Fragment, { children: [_jsx("input", { type: "text", autoFocus: true, placeholder: "URL\uC744 \uC785\uB825\uD558\uC138\uC694", value: linkUrl, onChange: (e) => setLinkUrl(e.target.value), onKeyDown: (e) => e.key === 'Enter' && applyLink(), className: "w-full px-3 py-2 border border-neutral200 rounded-lg text-sm outline-none transition duration-300 focus:border-blue-500" }), _jsxs("div", { className: "flex gap-2 mt-2", children: [_jsx("button", { type: "button", onClick: (e) => {
|
|
160
|
+
e.preventDefault();
|
|
161
|
+
applyLink();
|
|
162
|
+
}, className: "flex-1 px-3 py-1.5 bg-blue-500 text-white rounded-lg text-sm transition duration-300 hover:bg-blue-600", children: "\uC801\uC6A9" }), _jsx("button", { type: "button", onClick: (e) => {
|
|
163
|
+
e.preventDefault();
|
|
164
|
+
setLinkUrl('');
|
|
165
|
+
close();
|
|
166
|
+
}, className: "px-3 py-1.5 border border-neutral200 rounded-lg text-sm transition duration-300 hover:bg-mono100", children: "\uCDE8\uC18C" })] })] }));
|
|
167
|
+
} }), _jsx(EditorBase.Toolbar.LDButton, { disabled: !state.isLink, onClick: () => editor.chain().focus().unsetLink().run(), className: iconBtn, children: _jsx(Unlink, { className: "w-5 h-5" }) })] })), _jsx(LDDivider, {}), _jsxs("label", { className: cn(iconBtn, 'relative'), children: [_jsx(ImageIcon, { className: "w-5 h-5" }), _jsx("input", { type: "file", accept: "image/*", className: "absolute inset-0 w-full h-full opacity-0 cursor-pointer", onChange: (e) => {
|
|
168
|
+
handleImageUploadAction(e.target.files);
|
|
169
|
+
e.target.value = '';
|
|
170
|
+
} })] })] }), isMobile && (_jsxs(BubbleMenu, { editor: editor, className: "flex items-center gap-1 rounded-lg border border-neutral200 bg-white p-1 shadow-lg", children: [_jsx(EditorBase.Toolbar.LDButton, { onClick: () => editor.chain().focus().toggleBold().run(), className: cn(iconBtn, state.isBold && activeBtn), children: _jsx(Bold, { className: "w-5 h-5" }) }), _jsx(EditorBase.Toolbar.LDButton, { onClick: () => editor.chain().focus().toggleItalic().run(), className: cn(iconBtn, state.isItalic && activeBtn), children: _jsx(Italic, { className: "w-5 h-5" }) }), _jsx(EditorBase.Toolbar.LDButton, { onClick: () => editor.chain().focus().toggleUnderline().run(), className: cn(iconBtn, state.isUnderline && activeBtn), children: _jsx(Underline, { className: "w-5 h-5" }) }), _jsx(EditorBase.Toolbar.LDButton, { onClick: () => editor.chain().focus().toggleStrike().run(), className: cn(iconBtn, state.isStrike && activeBtn), children: _jsx(Strikethrough, { className: "w-5 h-5" }) }), _jsx(EditorBase.Toolbar.Dropdown, { className: "bg-white border border-neutral200 rounded-lg shadow-lg min-w-[140px]", trigger: ({ toggle }) => (_jsxs(EditorBase.Toolbar.LDButton, { onClick: toggle, className: cn(iconBtn, 'flex items-center gap-1 px-2'), children: [_jsx("span", { className: "w-4 h-4 rounded-full", style: { backgroundColor: state.color } }), _jsx(ChevronDown, { className: "w-4 h-4" })] })), children: ({ close }) => COLORS.map((color) => (_jsxs("button", { type: "button", onClick: (e) => {
|
|
171
|
+
e.preventDefault();
|
|
172
|
+
editor.chain().focus().setColor(color.value).run();
|
|
173
|
+
close();
|
|
174
|
+
}, className: "flex items-center gap-2 w-full px-3 py-2 cursor-pointer text-left text-sm hover:bg-mono100 first:rounded-t-lg last:rounded-b-lg", children: [_jsx("span", { className: "w-4 h-4 rounded-full", style: { backgroundColor: color.value } }), _jsx("span", { children: color.label })] }, color.value))) }), _jsx(EditorBase.Toolbar.Dropdown, { className: "bg-white border border-neutral200 rounded-lg shadow-lg p-3 min-w-[240px]", trigger: ({ toggle }) => (_jsx(EditorBase.Toolbar.LDButton, { onClick: () => {
|
|
175
|
+
setLinkUrl(editor.getAttributes('link').href || '');
|
|
176
|
+
toggle();
|
|
177
|
+
}, className: cn(iconBtn, state.isLink && activeBtn), children: _jsx(Link2, { className: "w-5 h-5" }) })), children: ({ close }) => {
|
|
178
|
+
const applyLink = () => {
|
|
179
|
+
const chain = editor.chain().focus().extendMarkRange('link');
|
|
180
|
+
if (linkUrl === '') {
|
|
181
|
+
chain.unsetLink().run();
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
const url = /^https?:\/\//.test(linkUrl)
|
|
185
|
+
? linkUrl
|
|
186
|
+
: `https://${linkUrl}`;
|
|
187
|
+
chain.setLink({ href: url }).run();
|
|
188
|
+
}
|
|
189
|
+
setLinkUrl('');
|
|
190
|
+
close();
|
|
191
|
+
};
|
|
192
|
+
return (_jsxs(_Fragment, { children: [_jsx("input", { type: "text", autoFocus: true, placeholder: "URL\uC744 \uC785\uB825\uD558\uC138\uC694", value: linkUrl, onChange: (e) => setLinkUrl(e.target.value), onKeyDown: (e) => e.key === 'Enter' && applyLink(), className: "w-full px-3 py-2 border border-neutral200 rounded-lg text-sm outline-none transition duration-300 focus:border-blue-500" }), _jsxs("div", { className: "flex gap-2 mt-2", children: [_jsx("button", { type: "button", onClick: (e) => {
|
|
193
|
+
e.preventDefault();
|
|
194
|
+
applyLink();
|
|
195
|
+
}, className: "flex-1 px-3 py-1.5 bg-blue-500 text-white rounded-lg text-sm transition duration-300 hover:bg-blue-600", children: "\uC801\uC6A9" }), _jsx("button", { type: "button", onClick: (e) => {
|
|
196
|
+
e.preventDefault();
|
|
197
|
+
setLinkUrl('');
|
|
198
|
+
close();
|
|
199
|
+
}, className: "px-3 py-1.5 border border-neutral200 rounded-lg text-sm transition duration-300 hover:bg-mono100", children: "\uCDE8\uC18C" })] })] }));
|
|
200
|
+
} })] }))] }));
|
|
161
201
|
};
|
|
162
202
|
export default LDEditor;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode, Ref } from 'react';
|
|
2
|
+
interface RootProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
ref?: Ref<HTMLDivElement>;
|
|
5
|
+
}
|
|
6
|
+
interface ImageProps {
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
interface DescriptionProps {
|
|
10
|
+
description?: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const EmptyBase: {
|
|
14
|
+
Root: ({ ref, children, className, ...props }: RootProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
Image: ({ children }: ImageProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
Description: ({ description, className }: DescriptionProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
17
|
+
};
|
|
18
|
+
export default EmptyBase;
|
|
19
|
+
//# sourceMappingURL=EmptyBase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmptyBase.d.ts","sourceRoot":"","sources":["../../../src/components/LDEmpty/EmptyBase.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEvD,UAAU,SAAU,SAAQ,cAAc,CAAC,cAAc,CAAC;IACxD,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAUD,UAAU,UAAU;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAMD,UAAU,gBAAgB;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAQD,eAAO,MAAM,SAAS;mDA3BgC,SAAS;0BAYlC,UAAU;8CASU,gBAAgB;CAUhE,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
const Root = ({ ref, children, className, ...props }) => {
|
|
3
|
+
return (_jsx("div", { ref: ref, className: className, ...props, children: children }));
|
|
4
|
+
};
|
|
5
|
+
const Image = ({ children }) => {
|
|
6
|
+
return _jsx("div", { "aria-hidden": "true", children: children });
|
|
7
|
+
};
|
|
8
|
+
const Description = ({ description, className }) => {
|
|
9
|
+
if (!description)
|
|
10
|
+
return null;
|
|
11
|
+
return _jsx("span", { className: className, children: description });
|
|
12
|
+
};
|
|
13
|
+
export const EmptyBase = {
|
|
14
|
+
Root,
|
|
15
|
+
Image,
|
|
16
|
+
Description,
|
|
17
|
+
};
|
|
18
|
+
export default EmptyBase;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
export type EmptySize = 'small' | 'medium' | 'large';
|
|
3
|
+
type EmptyDirection = 'col' | 'row';
|
|
4
|
+
export interface LDEmptyProps {
|
|
5
|
+
/**
|
|
6
|
+
* 표시할 이미지/아이콘입니다. 생략하면 기본 빈 상태 일러스트가 렌더링됩니다.
|
|
7
|
+
*/
|
|
8
|
+
image?: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* 이미지 아래 표시할 설명 텍스트입니다. (기본값: 'No Data')
|
|
11
|
+
*/
|
|
12
|
+
description?: string;
|
|
13
|
+
/**
|
|
14
|
+
* 이미지 크기와 설명 타이포그래피 스케일을 결정합니다. (기본값: 'medium')
|
|
15
|
+
*/
|
|
16
|
+
size?: EmptySize;
|
|
17
|
+
/**
|
|
18
|
+
* 이미지/텍스트 정렬 방향을 결정합니다. (기본값: 'col')
|
|
19
|
+
*/
|
|
20
|
+
direction?: EmptyDirection;
|
|
21
|
+
/**
|
|
22
|
+
* 추가적인 스타일 클래스를 지정합니다.
|
|
23
|
+
*/
|
|
24
|
+
className?: string;
|
|
25
|
+
/**
|
|
26
|
+
* 인라인 스타일을 지정합니다. Root 엘리먼트에 그대로 전달됩니다.
|
|
27
|
+
*/
|
|
28
|
+
style?: CSSProperties;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* 데이터가 없을 때 표시하는 빈 상태 컴포넌트입니다.
|
|
32
|
+
*/
|
|
33
|
+
declare const LDEmpty: ({ image, description, size, direction, className, style, }: LDEmptyProps) => import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
export default LDEmpty;
|
|
35
|
+
//# sourceMappingURL=LDEmpty.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LDEmpty.d.ts","sourceRoot":"","sources":["../../../src/components/LDEmpty/LDEmpty.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIjD,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AACrD,KAAK,cAAc,GAAG,KAAK,GAAG,KAAK,CAAC;AA6CpC,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED;;GAEG;AACH,QAAA,MAAM,OAAO,GAAI,4DAOd,YAAY,4CAqBd,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import cn from '../../utils/cn.js';
|
|
3
|
+
import EmptyBase from './EmptyBase.js';
|
|
4
|
+
const GAP_CLASS_MAP = {
|
|
5
|
+
small: 'gap-xs',
|
|
6
|
+
medium: 'gap-sm',
|
|
7
|
+
large: 'gap-md',
|
|
8
|
+
};
|
|
9
|
+
const IMAGE_WIDTH_MAP = {
|
|
10
|
+
small: 48,
|
|
11
|
+
medium: 64,
|
|
12
|
+
large: 92,
|
|
13
|
+
};
|
|
14
|
+
const DESCRIPTION_CLASS_MAP = {
|
|
15
|
+
small: 'display12',
|
|
16
|
+
medium: 'display14',
|
|
17
|
+
large: 'display16',
|
|
18
|
+
};
|
|
19
|
+
// antd Empty.PRESENTED_IMAGE_SIMPLE(viewBox 0 0 64 41) 포팅, 색상만 loword mono 토큰으로 치환
|
|
20
|
+
const DefaultEmptyImage = ({ width }) => {
|
|
21
|
+
const height = (width * 41) / 64;
|
|
22
|
+
return (_jsx("svg", { width: width, height: height, viewBox: "0 0 64 41", xmlns: "http://www.w3.org/2000/svg", children: _jsxs("g", { transform: "translate(0 1)", fill: "none", fillRule: "evenodd", children: [_jsx("ellipse", { className: "fill-mono100", cx: "32", cy: "33", rx: "32", ry: "7" }), _jsxs("g", { className: "stroke-mono300", fillRule: "nonzero", children: [_jsx("path", { d: "M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z" }), _jsx("path", { className: "fill-mono50", d: "M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z" })] })] }) }));
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* 데이터가 없을 때 표시하는 빈 상태 컴포넌트입니다.
|
|
26
|
+
*/
|
|
27
|
+
const LDEmpty = ({ image, description = 'No Data', size = 'medium', direction = 'col', className, style, }) => {
|
|
28
|
+
return (_jsxs(EmptyBase.Root, { className: cn('flex items-center justify-center', direction === 'col' && 'flex-col', direction === 'row' && 'flex-row', GAP_CLASS_MAP[size], className), style: style, children: [_jsx(EmptyBase.Image, { children: image ?? _jsx(DefaultEmptyImage, { width: IMAGE_WIDTH_MAP[size] }) }), _jsx(EmptyBase.Description, { description: description, className: cn('text-neutral500', DESCRIPTION_CLASS_MAP[size]) })] }));
|
|
29
|
+
};
|
|
30
|
+
export default LDEmpty;
|
|
@@ -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;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;
|
|
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;AAyQD,eAAO,MAAM,cAAc;wKAnaxB,SAAS;uCA+BT,UAAU;sBA6HY,cAAc;yBAwOX;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE;CAoCjD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -87,9 +87,9 @@ const Input = ({ type = 'default', label = '파일 선택', ...props }) => {
|
|
|
87
87
|
};
|
|
88
88
|
const fileInput = (_jsx("input", { type: "file", multiple: maxFileCount > 1, onClick: (e) => (e.currentTarget.value = ''), onChange: (e) => handleFile(e), disabled: disabled, className: "sr-only" }));
|
|
89
89
|
if (type === 'image') {
|
|
90
|
-
return (_jsxs("label", { className: cn('
|
|
90
|
+
return (_jsxs("label", { className: cn('outline-3 -outline-offset-3 outline-dotted rounded-xl outline-neutral100 bg-neutral50 text-neutral500', 'size-21 flex justify-center items-center ld-transition', disabled
|
|
91
91
|
? 'opacity-50 cursor-not-allowed'
|
|
92
|
-
: 'hover:bg-neutral-100 hover:
|
|
92
|
+
: 'hover:bg-neutral-100 hover:outline-neutral200 hover:cursor-pointer hover:text-neutral600', props.className, classNames?.input), children: [renderIcon(_jsx(Images, {}), 'size-6'), fileInput] }));
|
|
93
93
|
}
|
|
94
94
|
return (_jsxs(LDButton, { as: "label", ...props, className: cn(props.className, classNames?.input), disabled: disabled, children: [label, fileInput] }));
|
|
95
95
|
};
|
|
@@ -150,7 +150,7 @@ const CardList = (props) => {
|
|
|
150
150
|
}
|
|
151
151
|
};
|
|
152
152
|
if (props.type === 'image') {
|
|
153
|
-
const cards = fileList.map((file, idx) => (_jsxs("label", { className: cn('relative block size-21 overflow-hidden rounded-[21px]', disabled
|
|
153
|
+
const cards = fileList.map((file, idx) => (_jsxs("label", { className: cn('group relative block size-21 overflow-hidden rounded-[21px] outline-3 -outline-offset-3 outline-neutral200', disabled
|
|
154
154
|
? 'cursor-not-allowed'
|
|
155
155
|
: readOnly
|
|
156
156
|
? 'cursor-default'
|
|
@@ -166,15 +166,15 @@ const CardList = (props) => {
|
|
|
166
166
|
next[idx] = false;
|
|
167
167
|
return next;
|
|
168
168
|
});
|
|
169
|
-
}, children: [_jsx("img", { src: file?.src, alt: file?.fileName, className: "size-full object-cover" }), _jsx("input", { type: "file", onClick: (e) => (e.currentTarget.value = ''), onChange: (e) => handleFile(e, idx), disabled: locked, className: "sr-only" }), _jsx(LDButton, { onClick: async (e) => {
|
|
169
|
+
}, children: [_jsx("img", { src: file?.src, alt: file?.fileName, className: "size-full object-cover" }), _jsx("span", { className: cn('pointer-events-none absolute inset-0 opacity-0 ld-transition', !locked && 'bg-black/25 group-hover:opacity-100') }), _jsx("input", { type: "file", onClick: (e) => (e.currentTarget.value = ''), onChange: (e) => handleFile(e, idx), disabled: locked, className: "sr-only" }), _jsx(LDButton, { onClick: async (e) => {
|
|
170
170
|
e.preventDefault();
|
|
171
171
|
e.stopPropagation();
|
|
172
172
|
await handleDeleteFile(idx);
|
|
173
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
|
-
return (_jsx("div", { className: cn('flex flex-row gap-sm', props.className), children: cards }));
|
|
175
|
+
return (_jsx("div", { className: cn('flex flex-row gap-sm w-full h-full', props.className), children: cards }));
|
|
176
176
|
}
|
|
177
|
-
return (_jsx(LDCarousel, { className: cn(props.className, classNames?.cardList),
|
|
177
|
+
return (_jsx(LDCarousel, { className: cn(props.className, classNames?.cardList), slidesPerView: "auto", gap: 8, arrowPosition: "none", showDots: false, slides: cards }));
|
|
178
178
|
}
|
|
179
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'
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { TMimeType } from '../../constants/file.js';
|
|
2
2
|
import { IFile } from '../../utils/file.js';
|
|
3
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
3
4
|
interface ILDFileUploadProps {
|
|
4
5
|
recommendedSize?: {
|
|
5
6
|
width: number;
|
|
@@ -12,6 +13,8 @@ interface ILDFileUploadProps {
|
|
|
12
13
|
isExistDescription?: boolean;
|
|
13
14
|
disabled?: boolean;
|
|
14
15
|
readOnly?: boolean;
|
|
16
|
+
fileList: IFile[];
|
|
17
|
+
setFileList: Dispatch<SetStateAction<IFile[]>>;
|
|
15
18
|
}
|
|
16
19
|
declare const LDFileUpload: (props: ILDFileUploadProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
20
|
export default LDFileUpload;
|
|
@@ -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;
|
|
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;AACzC,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEjD,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;IACnB,QAAQ,EAAE,KAAK,EAAE,CAAC;IAClB,WAAW,EAAE,QAAQ,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;CAChD;AAED,QAAA,MAAM,YAAY,GAAI,OAAO,kBAAkB,4CAyB9C,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import FileUploadBase from '../../components/LDFileUpload/FileUploadBase.js';
|
|
3
|
-
import { useState } from 'react';
|
|
4
3
|
const LDFileUpload = (props) => {
|
|
5
|
-
|
|
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: {
|
|
4
|
+
return (_jsxs(FileUploadBase.Root, { fileList: props.fileList, setFileList: props.setFileList, maxSize: props.maxSize, allowedExtensions: props.allowedExtensions, recommendedSize: props.recommendedSize ?? { width: 1200, height: 800 }, maxFileCount: 1, onChangeFile: props.onChangeFile, onDeleteFile: props.onDeleteFile, classNames: {
|
|
7
5
|
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, {})] }));
|
|
6
|
+
}, disabled: props.disabled, readOnly: props.readOnly, children: [props.fileList[0]?.src ? (_jsx(FileUploadBase.CardList, {})) : (_jsx(FileUploadBase.Input, { className: "w-fit" })), props.isExistDescription && _jsx(FileUploadBase.Description, {})] }));
|
|
9
7
|
};
|
|
10
8
|
export default LDFileUpload;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { TMimeType } from '../../constants/file.js';
|
|
2
2
|
import { IFile } from '../../utils/file.js';
|
|
3
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
3
4
|
interface ILDFileUploadListProps {
|
|
4
5
|
recommendedSize?: {
|
|
5
6
|
width: number;
|
|
@@ -13,6 +14,8 @@ interface ILDFileUploadListProps {
|
|
|
13
14
|
isExistDescription?: boolean;
|
|
14
15
|
disabled?: boolean;
|
|
15
16
|
readOnly?: boolean;
|
|
17
|
+
fileList: IFile[];
|
|
18
|
+
setFileList: Dispatch<SetStateAction<IFile[]>>;
|
|
16
19
|
}
|
|
17
20
|
declare const LDFileUploadList: (props: ILDFileUploadListProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
21
|
export default LDFileUploadList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LDFileUploadList.d.ts","sourceRoot":"","sources":["../../../src/components/LDFileUpload/LDFileUploadList.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"LDFileUploadList.d.ts","sourceRoot":"","sources":["../../../src/components/LDFileUpload/LDFileUploadList.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAY,MAAM,OAAO,CAAC;AAE3D,UAAU,sBAAsB;IAC9B,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,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,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,KAAK,EAAE,CAAC;IAClB,WAAW,EAAE,QAAQ,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;CAChD;AAED,QAAA,MAAM,gBAAgB,GAAI,OAAO,sBAAsB,4CAwBtD,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import FileUploadBase from '../../components/LDFileUpload/FileUploadBase.js';
|
|
3
|
-
import { useState } from 'react';
|
|
4
3
|
const LDFileUploadList = (props) => {
|
|
5
|
-
|
|
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, {}) })] }));
|
|
4
|
+
return (_jsxs(FileUploadBase.Root, { fileList: props.fileList, setFileList: props.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: [props.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: props.fileList.length > 0 && _jsx(FileUploadBase.CardList, {}) })] }));
|
|
7
5
|
};
|
|
8
6
|
export default LDFileUploadList;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IFileUploadClassNames } from '../../components/LDFileUpload/FileUploadBase.js';
|
|
2
2
|
import { TMimeType } from '../../constants/file.js';
|
|
3
3
|
import { IFile } from '../../utils/file.js';
|
|
4
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
4
5
|
interface ILDImageUploadProps {
|
|
5
6
|
recommendedSize?: {
|
|
6
7
|
width: number;
|
|
@@ -14,6 +15,8 @@ interface ILDImageUploadProps {
|
|
|
14
15
|
disabled?: boolean;
|
|
15
16
|
readOnly?: boolean;
|
|
16
17
|
classNames?: IFileUploadClassNames;
|
|
18
|
+
fileList: IFile[];
|
|
19
|
+
setFileList: Dispatch<SetStateAction<IFile[]>>;
|
|
17
20
|
}
|
|
18
21
|
declare const LDImageUpload: (props: ILDImageUploadProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
22
|
export default LDImageUpload;
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;AACzC,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAY,MAAM,OAAO,CAAC;AAG3D,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;IACnC,QAAQ,EAAE,KAAK,EAAE,CAAC;IAClB,WAAW,EAAE,QAAQ,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;CAChD;AAED,QAAA,MAAM,aAAa,GAAI,OAAO,mBAAmB,4CA0BhD,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import FileUploadBase from '../../components/LDFileUpload/FileUploadBase.js';
|
|
3
|
-
import { useState } from 'react';
|
|
4
3
|
import cn from '../../utils/cn.js';
|
|
5
4
|
const LDImageUpload = (props) => {
|
|
6
|
-
|
|
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: {
|
|
5
|
+
return (_jsxs(FileUploadBase.Root, { fileList: props.fileList, setFileList: props.setFileList, maxSize: props.maxSize, allowedExtensions: props.allowedExtensions, recommendedSize: props.recommendedSize ?? { width: 1200, height: 800 }, maxFileCount: 1, onChangeFile: props.onChangeFile, onDeleteFile: props.onDeleteFile, classNames: {
|
|
8
6
|
...props.classNames,
|
|
9
7
|
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, {})] }));
|
|
8
|
+
}, disabled: props.disabled, readOnly: props.readOnly, children: [props.fileList[0]?.src ? (_jsx(FileUploadBase.CardList, { type: "image" })) : (_jsx(FileUploadBase.Input, { type: "image" })), props.isExistDescription && _jsx(FileUploadBase.Description, {})] }));
|
|
11
9
|
};
|
|
12
10
|
export default LDImageUpload;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { TMimeType } from '../../constants/file.js';
|
|
2
2
|
import { IFile } from '../../utils/file.js';
|
|
3
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
3
4
|
interface ILDImageUploadListProps {
|
|
4
5
|
recommendedSize?: {
|
|
5
6
|
width: number;
|
|
@@ -13,6 +14,8 @@ interface ILDImageUploadListProps {
|
|
|
13
14
|
isExistDescription?: boolean;
|
|
14
15
|
disabled?: boolean;
|
|
15
16
|
readOnly?: boolean;
|
|
17
|
+
fileList: IFile[];
|
|
18
|
+
setFileList: Dispatch<SetStateAction<IFile[]>>;
|
|
16
19
|
}
|
|
17
20
|
declare const LDImageUploadList: (props: ILDImageUploadListProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
21
|
export default LDImageUploadList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LDImageUploadList.d.ts","sourceRoot":"","sources":["../../../src/components/LDFileUpload/LDImageUploadList.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"LDImageUploadList.d.ts","sourceRoot":"","sources":["../../../src/components/LDFileUpload/LDImageUploadList.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAY,MAAM,OAAO,CAAC;AAE3D,UAAU,uBAAuB;IAC/B,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,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,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,KAAK,EAAE,CAAC;IAClB,WAAW,EAAE,QAAQ,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;CAChD;AAED,QAAA,MAAM,iBAAiB,GAAI,OAAO,uBAAuB,4CAwBxD,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import FileUploadBase from '../../components/LDFileUpload/FileUploadBase.js';
|
|
3
|
-
import { useState } from 'react';
|
|
4
3
|
const LDImageUploadList = (props) => {
|
|
5
|
-
|
|
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, {})] }));
|
|
4
|
+
return (_jsxs(FileUploadBase.Root, { fileList: props.fileList, setFileList: props.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 w-full h-full", children: [props.fileList.length > 0 && _jsx(FileUploadBase.CardList, { type: "image" }), props.fileList.length < props.maxFileCount && !props.disabled && (_jsx(FileUploadBase.Input, { type: "image" }))] }), props.isExistDescription && _jsx(FileUploadBase.Description, {})] }));
|
|
7
5
|
};
|
|
8
6
|
export default LDImageUploadList;
|
|
@@ -4,19 +4,21 @@ interface RootProps {
|
|
|
4
4
|
className?: string;
|
|
5
5
|
style?: React.CSSProperties;
|
|
6
6
|
children?: ReactNode;
|
|
7
|
+
ref?: Ref<HTMLDivElement>;
|
|
7
8
|
}
|
|
8
9
|
interface FieldProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
9
10
|
ref?: Ref<HTMLInputElement>;
|
|
10
11
|
}
|
|
11
12
|
interface AddonProps {
|
|
12
|
-
position?: 'left' | 'right';
|
|
13
13
|
className?: string;
|
|
14
|
+
style?: React.CSSProperties;
|
|
14
15
|
children?: ReactNode;
|
|
16
|
+
ref?: Ref<HTMLSpanElement>;
|
|
15
17
|
}
|
|
16
18
|
export declare const InputBase: {
|
|
17
|
-
Root: ({ block, className, style, children }: RootProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
Root: ({ block, className, style, children, ref, }: RootProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
20
|
Field: ({ ref, ...props }: FieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
Addon: ({
|
|
21
|
+
Addon: ({ className, style, children, ref }: AddonProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
22
|
};
|
|
21
23
|
export default InputBase;
|
|
22
24
|
//# sourceMappingURL=InputBase.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputBase.d.ts","sourceRoot":"","sources":["../../../src/components/LDInput/InputBase.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AAI3E,UAAU,SAAS;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,QAAQ,CAAC,EAAE,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"InputBase.d.ts","sourceRoot":"","sources":["../../../src/components/LDInput/InputBase.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AAI3E,UAAU,SAAS;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAyBD,UAAU,UAAW,SAAQ,mBAAmB,CAAC,gBAAgB,CAAC;IAChE,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;CAC7B;AAOD,UAAU,UAAU;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,GAAG,CAAC,EAAE,GAAG,CAAC,eAAe,CAAC,CAAC;CAC5B;AAcD,eAAO,MAAM,SAAS;wDA7CnB,SAAS;+BAqBsB,UAAU;iDAYQ,UAAU;CAgB7D,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import cn from '../../utils/cn.js';
|
|
3
|
-
const Root = ({ block = false, className, style, children }) => {
|
|
4
|
-
return (_jsx("div", { style: style, className: cn('relative flex group', block && 'w-full', className), children: children }));
|
|
3
|
+
const Root = ({ block = false, className, style, children, ref, }) => {
|
|
4
|
+
return (_jsx("div", { ref: ref, style: style, className: cn('relative flex items-center group', block && 'w-full', className), children: children }));
|
|
5
5
|
};
|
|
6
6
|
const Field = ({ ref, ...props }) => {
|
|
7
7
|
return _jsx("input", { ref: ref, ...props });
|
|
8
8
|
};
|
|
9
|
-
const Addon = ({
|
|
10
|
-
return (_jsx("span", { className: cn('
|
|
9
|
+
const Addon = ({ className, style, children, ref }) => {
|
|
10
|
+
return (_jsx("span", { ref: ref, style: style, className: cn('flex items-center', className), children: children }));
|
|
11
11
|
};
|
|
12
12
|
export const InputBase = {
|
|
13
13
|
Root,
|
|
@@ -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,EAAU,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AACzC,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;AAED,QAAA,MAAM,WAAW,GAAI,sJAclB,gBAAgB,4CA+ElB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|