@loword/loword-design-system 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +77 -3
- package/dist/components/BreadCrumb/BreadCrumb.d.ts +17 -0
- package/dist/components/BreadCrumb/BreadCrumb.d.ts.map +1 -0
- package/dist/components/BreadCrumb/BreadCrumb.js +37 -0
- package/dist/components/BreadCrumb/BreadCrumbBase.d.ts +9 -0
- package/dist/components/BreadCrumb/BreadCrumbBase.d.ts.map +1 -0
- package/dist/components/BreadCrumb/BreadCrumbBase.js +17 -0
- package/dist/components/Button/ButtonSpinner.d.ts +1 -2
- package/dist/components/Button/ButtonSpinner.d.ts.map +1 -1
- package/dist/components/Button/ButtonSpinner.js +3 -2
- package/dist/components/Callout/Callout.d.ts +10 -0
- package/dist/components/Callout/Callout.d.ts.map +1 -0
- package/dist/components/Callout/Callout.js +6 -0
- package/dist/components/Callout/CalloutBase.d.ts +18 -0
- package/dist/components/Callout/CalloutBase.d.ts.map +1 -0
- package/dist/components/Callout/CalloutBase.js +21 -0
- package/dist/components/Divider/Divider.d.ts +9 -0
- package/dist/components/Divider/Divider.d.ts.map +1 -0
- package/dist/components/Divider/Divider.js +11 -0
- package/dist/components/Divider/DividerBase.d.ts +9 -0
- package/dist/components/Divider/DividerBase.d.ts.map +1 -0
- package/dist/components/Divider/DividerBase.js +9 -0
- package/dist/components/FileUpload/FileUploadBase.d.ts +5 -5
- package/dist/components/FileUpload/FileUploadBase.d.ts.map +1 -1
- package/dist/components/FileUpload/FileUploadBase.js +4 -4
- package/dist/components/Form/FormField.d.ts +2 -2
- package/dist/components/LDAvatar/AvatarBase.d.ts +32 -0
- package/dist/components/LDAvatar/AvatarBase.d.ts.map +1 -0
- package/dist/components/LDAvatar/AvatarBase.js +49 -0
- package/dist/components/LDAvatar/LDAvatar.d.ts +11 -0
- package/dist/components/LDAvatar/LDAvatar.d.ts.map +1 -0
- package/dist/components/LDAvatar/LDAvatar.js +24 -0
- package/dist/components/LDBadge/BadgeBase.d.ts +10 -0
- package/dist/components/LDBadge/BadgeBase.d.ts.map +1 -0
- package/dist/components/LDBadge/BadgeBase.js +9 -0
- package/dist/components/LDBadge/LDBadge.d.ts +25 -0
- package/dist/components/LDBadge/LDBadge.d.ts.map +1 -0
- package/dist/components/LDBadge/LDBadge.js +36 -0
- package/dist/components/LDBreadCrumb/BreadCrumbBase.d.ts +9 -0
- package/dist/components/LDBreadCrumb/BreadCrumbBase.d.ts.map +1 -0
- package/dist/components/LDBreadCrumb/BreadCrumbBase.js +17 -0
- package/dist/components/LDBreadCrumb/LDBreadCrumb.d.ts +17 -0
- package/dist/components/LDBreadCrumb/LDBreadCrumb.d.ts.map +1 -0
- package/dist/components/LDBreadCrumb/LDBreadCrumb.js +37 -0
- package/dist/components/LDButton/ButtonBase.d.ts +5 -0
- package/dist/components/LDButton/ButtonBase.d.ts.map +1 -0
- package/dist/components/LDButton/ButtonBase.js +10 -0
- package/dist/components/LDButton/ButtonSpinner.d.ts +8 -0
- package/dist/components/LDButton/ButtonSpinner.d.ts.map +1 -0
- package/dist/components/LDButton/ButtonSpinner.js +15 -0
- package/dist/components/LDButton/LDButton.d.ts +26 -0
- package/dist/components/LDButton/LDButton.d.ts.map +1 -0
- package/dist/components/LDButton/LDButton.js +102 -0
- package/dist/components/LDCalendar/LDCalendar.d.ts +16 -0
- package/dist/components/LDCalendar/LDCalendar.d.ts.map +1 -0
- package/dist/components/LDCalendar/LDCalendar.js +75 -0
- package/dist/components/LDCallout/CalloutBase.d.ts +18 -0
- package/dist/components/LDCallout/CalloutBase.d.ts.map +1 -0
- package/dist/components/LDCallout/CalloutBase.js +21 -0
- package/dist/components/LDCallout/LDCallout.d.ts +10 -0
- package/dist/components/LDCallout/LDCallout.d.ts.map +1 -0
- package/dist/components/LDCallout/LDCallout.js +6 -0
- package/dist/components/LDCarousel/CarouselBase.d.ts +98 -0
- package/dist/components/LDCarousel/CarouselBase.d.ts.map +1 -0
- package/dist/components/LDCarousel/CarouselBase.js +144 -0
- package/dist/components/LDCarousel/LDCarousel.d.ts +50 -0
- package/dist/components/LDCarousel/LDCarousel.d.ts.map +1 -0
- package/dist/components/LDCarousel/LDCarousel.js +22 -0
- package/dist/components/LDCheckbox/CheckboxBase.d.ts +40 -0
- package/dist/components/LDCheckbox/CheckboxBase.d.ts.map +1 -0
- package/dist/components/LDCheckbox/CheckboxBase.js +57 -0
- package/dist/components/LDCheckbox/FormCheckbox.d.ts +14 -0
- package/dist/components/LDCheckbox/FormCheckbox.d.ts.map +1 -0
- package/dist/components/LDCheckbox/FormCheckbox.js +9 -0
- package/dist/components/LDCheckbox/FormCheckboxGroup.d.ts +13 -0
- package/dist/components/LDCheckbox/FormCheckboxGroup.d.ts.map +1 -0
- package/dist/components/LDCheckbox/FormCheckboxGroup.js +9 -0
- package/dist/components/LDCheckbox/LDCheckbox.d.ts +27 -0
- package/dist/components/LDCheckbox/LDCheckbox.d.ts.map +1 -0
- package/dist/components/LDCheckbox/LDCheckbox.js +30 -0
- package/dist/components/LDCheckbox/LDCheckboxGroup.d.ts +22 -0
- package/dist/components/LDCheckbox/LDCheckboxGroup.d.ts.map +1 -0
- package/dist/components/LDCheckbox/LDCheckboxGroup.js +13 -0
- package/dist/components/LDDataCalendar/DataCalendarBase.d.ts +45 -0
- package/dist/components/LDDataCalendar/DataCalendarBase.d.ts.map +1 -0
- package/dist/components/LDDataCalendar/DataCalendarBase.js +57 -0
- package/dist/components/LDDataCalendar/LDDataCalendar.d.ts +12 -0
- package/dist/components/LDDataCalendar/LDDataCalendar.d.ts.map +1 -0
- package/dist/components/LDDataCalendar/LDDataCalendar.js +13 -0
- package/dist/components/LDDatePicker/FormDatePicker.d.ts +12 -0
- package/dist/components/LDDatePicker/FormDatePicker.d.ts.map +1 -0
- package/dist/components/LDDatePicker/FormDatePicker.js +12 -0
- package/dist/components/LDDatePicker/LDDatePicker.d.ts +34 -0
- package/dist/components/LDDatePicker/LDDatePicker.d.ts.map +1 -0
- package/dist/components/LDDatePicker/LDDatePicker.js +44 -0
- package/dist/components/LDDateRangePicker/FormDateRangePicker.d.ts +12 -0
- package/dist/components/LDDateRangePicker/FormDateRangePicker.d.ts.map +1 -0
- package/dist/components/LDDateRangePicker/FormDateRangePicker.js +10 -0
- package/dist/components/LDDateRangePicker/LDDateRangePicker.d.ts +49 -0
- package/dist/components/LDDateRangePicker/LDDateRangePicker.d.ts.map +1 -0
- package/dist/components/LDDateRangePicker/LDDateRangePicker.js +197 -0
- package/dist/components/LDDivider/DividerBase.d.ts +9 -0
- package/dist/components/LDDivider/DividerBase.d.ts.map +1 -0
- package/dist/components/LDDivider/DividerBase.js +9 -0
- package/dist/components/LDDivider/LDDivider.d.ts +9 -0
- package/dist/components/LDDivider/LDDivider.d.ts.map +1 -0
- package/dist/components/LDDivider/LDDivider.js +11 -0
- package/dist/components/LDDrawer/DrawerBase.d.ts +52 -0
- package/dist/components/LDDrawer/DrawerBase.d.ts.map +1 -0
- package/dist/components/LDDrawer/DrawerBase.js +38 -0
- package/dist/components/LDDrawer/LDDrawer.d.ts +51 -0
- package/dist/components/LDDrawer/LDDrawer.d.ts.map +1 -0
- package/dist/components/LDDrawer/LDDrawer.js +30 -0
- package/dist/components/LDEditor/EditorBase.d.ts +52 -0
- package/dist/components/LDEditor/EditorBase.d.ts.map +1 -0
- package/dist/components/LDEditor/EditorBase.js +89 -0
- package/dist/components/LDEditor/LDEditor.d.ts +12 -0
- package/dist/components/LDEditor/LDEditor.d.ts.map +1 -0
- package/dist/components/LDEditor/LDEditor.js +162 -0
- package/dist/components/LDEditor/LDViewer.d.ts +7 -0
- package/dist/components/LDEditor/LDViewer.d.ts.map +1 -0
- package/dist/components/LDEditor/LDViewer.js +9 -0
- package/dist/components/LDEditor/extensions.d.ts +6 -0
- package/dist/components/LDEditor/extensions.d.ts.map +1 -0
- package/dist/components/LDEditor/extensions.js +38 -0
- package/dist/components/LDFileUpload/LDFileUploadBase.d.ts +50 -0
- package/dist/components/LDFileUpload/LDFileUploadBase.d.ts.map +1 -0
- package/dist/components/LDFileUpload/LDFileUploadBase.js +102 -0
- package/dist/components/LDInput/FormInput.d.ts +15 -0
- package/dist/components/LDInput/FormInput.d.ts.map +1 -0
- package/dist/components/LDInput/FormInput.js +19 -0
- package/dist/components/LDInput/InputBase.d.ts +22 -0
- package/dist/components/LDInput/InputBase.d.ts.map +1 -0
- package/dist/components/LDInput/InputBase.js +17 -0
- package/dist/components/LDInput/LDInput.d.ts +24 -0
- package/dist/components/LDInput/LDInput.d.ts.map +1 -0
- package/dist/components/LDInput/LDInput.js +71 -0
- package/dist/components/LDLNB/LDLNBBase.d.ts +82 -0
- package/dist/components/LDLNB/LDLNBBase.d.ts.map +1 -0
- package/dist/components/LDLNB/LDLNBBase.js +108 -0
- package/dist/components/LDLoadingDots/LDLoadingDots.d.ts +8 -0
- package/dist/components/LDLoadingDots/LDLoadingDots.d.ts.map +1 -0
- package/dist/components/LDLoadingDots/LDLoadingDots.js +29 -0
- package/dist/components/LDMenuBar/LDMenuBar.d.ts +21 -0
- package/dist/components/LDMenuBar/LDMenuBar.d.ts.map +1 -0
- package/dist/components/LDMenuBar/LDMenuBar.js +33 -0
- package/dist/components/LDMenuBar/MenuBarBase.d.ts +43 -0
- package/dist/components/LDMenuBar/MenuBarBase.d.ts.map +1 -0
- package/dist/components/LDMenuBar/MenuBarBase.js +69 -0
- package/dist/components/LDModal/LDModal.d.ts +51 -0
- package/dist/components/LDModal/LDModal.d.ts.map +1 -0
- package/dist/components/LDModal/LDModal.js +72 -0
- package/dist/components/LDModal/ModalBase.d.ts +42 -0
- package/dist/components/LDModal/ModalBase.d.ts.map +1 -0
- package/dist/components/LDModal/ModalBase.js +30 -0
- package/dist/components/LDModal/openModal.d.ts +24 -0
- package/dist/components/LDModal/openModal.d.ts.map +1 -0
- package/dist/components/LDModal/openModal.js +52 -0
- package/dist/components/LDOTPInput/LDOTPInput.d.ts +46 -0
- package/dist/components/LDOTPInput/LDOTPInput.d.ts.map +1 -0
- package/dist/components/LDOTPInput/LDOTPInput.js +87 -0
- package/dist/components/LDPagination/LDPagination.d.ts +12 -0
- package/dist/components/LDPagination/LDPagination.d.ts.map +1 -0
- package/dist/components/LDPagination/LDPagination.js +5 -0
- package/dist/components/LDPagination/PaginationBase.d.ts +36 -0
- package/dist/components/LDPagination/PaginationBase.d.ts.map +1 -0
- package/dist/components/LDPagination/PaginationBase.js +44 -0
- package/dist/components/LDPagination/paginationUtils.d.ts +2 -0
- package/dist/components/LDPagination/paginationUtils.d.ts.map +1 -0
- package/dist/components/LDPagination/paginationUtils.js +18 -0
- package/dist/components/LDPopover/LDPopover.d.ts +42 -0
- package/dist/components/LDPopover/LDPopover.d.ts.map +1 -0
- package/dist/components/LDPopover/LDPopover.js +31 -0
- package/dist/components/LDPopover/PopoverBase.d.ts +31 -0
- package/dist/components/LDPopover/PopoverBase.d.ts.map +1 -0
- package/dist/components/LDPopover/PopoverBase.js +18 -0
- package/dist/components/LDRadio/FormRadioGroup.d.ts +13 -0
- package/dist/components/LDRadio/FormRadioGroup.d.ts.map +1 -0
- package/dist/components/LDRadio/FormRadioGroup.js +9 -0
- package/dist/components/LDRadio/LDRadio.d.ts +24 -0
- package/dist/components/LDRadio/LDRadio.d.ts.map +1 -0
- package/dist/components/LDRadio/LDRadio.js +39 -0
- package/dist/components/LDRadio/LDRadioGroup.d.ts +22 -0
- package/dist/components/LDRadio/LDRadioGroup.d.ts.map +1 -0
- package/dist/components/LDRadio/LDRadioGroup.js +7 -0
- package/dist/components/LDRadio/RadioBase.d.ts +38 -0
- package/dist/components/LDRadio/RadioBase.d.ts.map +1 -0
- package/dist/components/LDRadio/RadioBase.js +46 -0
- package/dist/components/LDScrollArea/LDScrollArea.d.ts +15 -0
- package/dist/components/LDScrollArea/LDScrollArea.d.ts.map +1 -0
- package/dist/components/LDScrollArea/LDScrollArea.js +10 -0
- package/dist/components/LDSelect/FormMultiSelect.d.ts +13 -0
- package/dist/components/LDSelect/FormMultiSelect.d.ts.map +1 -0
- package/dist/components/LDSelect/FormMultiSelect.js +14 -0
- package/dist/components/LDSelect/FormSelect.d.ts +13 -0
- package/dist/components/LDSelect/FormSelect.d.ts.map +1 -0
- package/dist/components/LDSelect/FormSelect.js +10 -0
- package/dist/components/LDSelect/LDMultiSelect.d.ts +31 -0
- package/dist/components/LDSelect/LDMultiSelect.d.ts.map +1 -0
- package/dist/components/LDSelect/LDMultiSelect.js +59 -0
- package/dist/components/LDSelect/LDSelect.d.ts +41 -0
- package/dist/components/LDSelect/LDSelect.d.ts.map +1 -0
- package/dist/components/LDSelect/LDSelect.js +55 -0
- package/dist/components/LDSelect/SelectBase.d.ts +59 -0
- package/dist/components/LDSelect/SelectBase.d.ts.map +1 -0
- package/dist/components/LDSelect/SelectBase.js +211 -0
- package/dist/components/LDSkeleton/LDSkeleton.d.ts +10 -0
- package/dist/components/LDSkeleton/LDSkeleton.d.ts.map +1 -0
- package/dist/components/LDSkeleton/LDSkeleton.js +8 -0
- package/dist/components/LDSlider/LDSlider.d.ts +23 -0
- package/dist/components/LDSlider/LDSlider.d.ts.map +1 -0
- package/dist/components/LDSlider/LDSlider.js +195 -0
- package/dist/components/LDSpinner/LDSpinner.d.ts +25 -0
- package/dist/components/LDSpinner/LDSpinner.d.ts.map +1 -0
- package/dist/components/LDSpinner/LDSpinner.js +20 -0
- package/dist/components/LDTable/LDTable.d.ts +34 -0
- package/dist/components/LDTable/LDTable.d.ts.map +1 -0
- package/dist/components/LDTable/LDTable.js +29 -0
- package/dist/components/LDTable/LDTanstackTable.d.ts +23 -0
- package/dist/components/LDTable/LDTanstackTable.d.ts.map +1 -0
- package/dist/components/LDTable/LDTanstackTable.js +35 -0
- package/dist/components/LDTable/TableBase.d.ts +37 -0
- package/dist/components/LDTable/TableBase.d.ts.map +1 -0
- package/dist/components/LDTable/TableBase.js +39 -0
- package/dist/components/LDTable/TableField.d.ts +64 -0
- package/dist/components/LDTable/TableField.d.ts.map +1 -0
- package/dist/components/LDTable/TableField.js +87 -0
- package/dist/components/LDTimePicker/FormTimePicker.d.ts +12 -0
- package/dist/components/LDTimePicker/FormTimePicker.d.ts.map +1 -0
- package/dist/components/LDTimePicker/FormTimePicker.js +12 -0
- package/dist/components/LDTimePicker/LDTimePicker.d.ts +27 -0
- package/dist/components/LDTimePicker/LDTimePicker.d.ts.map +1 -0
- package/dist/components/LDTimePicker/LDTimePicker.js +120 -0
- package/dist/components/LDToast/LDToast.d.ts +18 -0
- package/dist/components/LDToast/LDToast.d.ts.map +1 -0
- package/dist/components/LDToast/LDToast.js +42 -0
- package/dist/components/LDToast/LDToaster.d.ts +7 -0
- package/dist/components/LDToast/LDToaster.d.ts.map +1 -0
- package/dist/components/LDToast/LDToaster.js +7 -0
- package/dist/components/LDToggleButton/FormToggleButton.d.ts +12 -0
- package/dist/components/LDToggleButton/FormToggleButton.d.ts.map +1 -0
- package/dist/components/LDToggleButton/FormToggleButton.js +9 -0
- package/dist/components/LDToggleButton/LDToggleButton.d.ts +31 -0
- package/dist/components/LDToggleButton/LDToggleButton.d.ts.map +1 -0
- package/dist/components/LDToggleButton/LDToggleButton.js +42 -0
- package/dist/components/LDToggleButton/ToggleButtonBase.d.ts +41 -0
- package/dist/components/LDToggleButton/ToggleButtonBase.d.ts.map +1 -0
- package/dist/components/LDToggleButton/ToggleButtonBase.js +59 -0
- package/dist/components/LDTooltip/LDTooltip.d.ts +18 -0
- package/dist/components/LDTooltip/LDTooltip.d.ts.map +1 -0
- package/dist/components/LDTooltip/LDTooltip.js +13 -0
- package/dist/components/LDTooltip/TooltipBase.d.ts +39 -0
- package/dist/components/LDTooltip/TooltipBase.d.ts.map +1 -0
- package/dist/components/LDTooltip/TooltipBase.js +46 -0
- package/dist/components/LNB/LNBBase.js +2 -2
- package/dist/components/Spinner/Spinner.d.ts +1 -1
- package/dist/components/Spinner/Spinner.d.ts.map +1 -1
- package/dist/components/Spinner/Spinner.js +1 -1
- package/dist/index.css +115 -13
- package/dist/index.d.ts +52 -49
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +88 -82
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,24 +1,93 @@
|
|
|
1
1
|
# @loword/loword-design-system
|
|
2
2
|
|
|
3
|
-
loword
|
|
3
|
+
[](https://www.npmjs.com/package/@loword/loword-design-system)
|
|
4
|
+
[](./LICENSE)
|
|
5
|
+
|
|
6
|
+
로워드 디자인 시스템 — React 19 컴포넌트 패키지. Tailwind CSS v4 기반이며 NPM(ESM)으로 배포됩니다.
|
|
7
|
+
|
|
8
|
+
> 모든 공개 컴포넌트는 `LD` 접두사를 사용합니다 (예: `LDButton`, `LDModal`, `LDInput`).
|
|
9
|
+
|
|
10
|
+
## 요구사항
|
|
11
|
+
|
|
12
|
+
- **React 19** / **React DOM 19** (peer dependency)
|
|
13
|
+
- **Tailwind CSS v4** — 스타일 적용을 위해 필요
|
|
14
|
+
- **Next.js 15** — 일부 컴포넌트(`LDTanstackTable`, `LDBreadCrumb`)는 `next/navigation`·`next/link`에 의존하므로 Next 환경에서만 동작 (optional)
|
|
4
15
|
|
|
5
16
|
## 설치
|
|
6
17
|
|
|
7
18
|
```bash
|
|
8
19
|
npm install @loword/loword-design-system
|
|
20
|
+
# 또는
|
|
21
|
+
pnpm add @loword/loword-design-system
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
특정 컴포넌트(Editor, Carousel, Drawer, Table, Select, DatePicker 등)는 해당 기능의 라이브러리를 **optional peer dependency**로 사용합니다. 그 컴포넌트를 쓸 때만 함께 설치하세요 — 예: `@tiptap/*`(Editor), `embla-carousel-react`(Carousel), `vaul`(Drawer), `@radix-ui/*`(Modal/Popover/Tooltip/Select), `@tanstack/react-table`(Table), `react-day-picker`·`dayjs`(DatePicker), `react-hot-toast`(Toast).
|
|
25
|
+
|
|
26
|
+
## 설정
|
|
27
|
+
|
|
28
|
+
스타일시트를 앱 진입점에서 **한 번** import 합니다.
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
import '@loword/loword-design-system/styles.css';
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## 사용
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
import { LDButton } from '@loword/loword-design-system';
|
|
38
|
+
|
|
39
|
+
export default function Example() {
|
|
40
|
+
return (
|
|
41
|
+
<LDButton variant="solid" color="point" onClick={() => alert('clicked')}>
|
|
42
|
+
확인
|
|
43
|
+
</LDButton>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
명령형 API 예시:
|
|
49
|
+
|
|
50
|
+
```tsx
|
|
51
|
+
import { openModal, Toast } from '@loword/loword-design-system';
|
|
52
|
+
|
|
53
|
+
const result = await openModal({ title: '삭제할까요?', /* ... */ });
|
|
54
|
+
Toast.success('저장되었습니다');
|
|
9
55
|
```
|
|
10
56
|
|
|
57
|
+
### import 방식
|
|
58
|
+
|
|
11
59
|
```ts
|
|
12
|
-
|
|
13
|
-
import '@loword/loword-design-system
|
|
60
|
+
// 1) barrel — 이름으로 가져오기
|
|
61
|
+
import { LDButton, LDModal, LDInput } from '@loword/loword-design-system';
|
|
62
|
+
|
|
63
|
+
// 2) 개별 경로 — 트리셰이킹/명시적 경로
|
|
64
|
+
import LDButton from '@loword/loword-design-system/components/LDButton/LDButton';
|
|
14
65
|
```
|
|
15
66
|
|
|
67
|
+
## 컴포넌트
|
|
68
|
+
|
|
69
|
+
**기본/입력**: `LDButton` · `LDInput` · `LDCheckbox` · `LDCheckboxGroup` · `LDRadio` · `LDRadioGroup` · `LDSelect` · `LDMultiSelect` · `LDToggleButton` · `LDSlider` · `LDOTPInput` · `LDFileUploadBase`
|
|
70
|
+
|
|
71
|
+
**날짜/시간**: `LDCalendar` · `LDDataCalendar` · `LDDatePicker` · `LDDateRangePicker` · `LDTimePicker`
|
|
72
|
+
|
|
73
|
+
**레이아웃/표시**: `LDBadge` · `LDAvatar` · `LDDivider` · `LDCallout` · `LDSkeleton` · `LDSpinner` · `LDLoadingDots` · `LDScrollArea` · `LDBreadCrumb` · `LDMenuBar` · `LDLNBBase`
|
|
74
|
+
|
|
75
|
+
**오버레이/피드백/내비**: `LDModal` (+ `openModal`) · `LDDrawer` · `LDPopover` · `LDTooltip` · `LDToast` · `LDToaster`
|
|
76
|
+
|
|
77
|
+
**콘텐츠**: `LDEditor` · `LDViewer` · `LDCarousel` · `LDTable` · `LDTanstackTable` · `LDPagination`
|
|
78
|
+
|
|
79
|
+
**폼 연동 / 헬퍼** (LD 접두사 없음): `Form` · `NativeForm` · `FormField` · `FormErrorMessage` · `FormInput` · `FormSelect` · `FormMultiSelect` · `FormCheckbox` · `FormCheckboxGroup` · `FormRadioGroup` · `FormDatePicker` · `FormDateRangePicker` · `FormTimePicker` · `FormToggleButton` · `TableField` · `LucideIcon`
|
|
80
|
+
|
|
81
|
+
> 폼 래퍼(`Form*`, `TableField`)와 `LucideIcon`은 디자인 컴포넌트가 아니므로 원래 이름을 유지합니다.
|
|
82
|
+
|
|
16
83
|
## 빠른 시작 (개발)
|
|
17
84
|
|
|
18
85
|
```bash
|
|
19
86
|
pnpm install # 의존성 설치
|
|
20
87
|
pnpm storybook # Storybook 개발 서버 (port 6006)
|
|
21
88
|
pnpm build # 프로덕션 빌드
|
|
89
|
+
pnpm check-types # 타입 체크
|
|
90
|
+
pnpm lint # 린트 (--max-warnings 0)
|
|
22
91
|
```
|
|
23
92
|
|
|
24
93
|
## 문서
|
|
@@ -29,3 +98,8 @@ pnpm build # 프로덕션 빌드
|
|
|
29
98
|
- 스타일 체계 (디자인 토큰, `cn()`)
|
|
30
99
|
- Storybook 스타일 제어 및 stories 생성 방법
|
|
31
100
|
- Props 문서화 (JSDoc)
|
|
101
|
+
- **변경 이력**: [docs/CHANGELOG.md](./docs/CHANGELOG.md)
|
|
102
|
+
|
|
103
|
+
## 라이선스
|
|
104
|
+
|
|
105
|
+
[MIT](./LICENSE)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type ButtonSize } from '../Button/Button.js';
|
|
3
|
+
import { type IconName } from '../Icon/LucideIcon.js';
|
|
4
|
+
export interface BreadCrumbItem {
|
|
5
|
+
label: string;
|
|
6
|
+
href?: string;
|
|
7
|
+
icon?: IconName | ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export interface BreadCrumbProps {
|
|
10
|
+
items: BreadCrumbItem[];
|
|
11
|
+
size?: ButtonSize;
|
|
12
|
+
separator?: ReactNode;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
declare const BreadCrumb: ({ items, size, separator, className, }: BreadCrumbProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export default BreadCrumb;
|
|
17
|
+
//# sourceMappingURL=BreadCrumb.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BreadCrumb.d.ts","sourceRoot":"","sources":["../../../src/components/BreadCrumb/BreadCrumb.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAe,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAInD,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC7B;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA6BD,QAAA,MAAM,UAAU,GAAI,wCAKjB,eAAe,4CAiDjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import BreadCrumbBase from './BreadCrumbBase.js';
|
|
4
|
+
import Button from '../Button/Button.js';
|
|
5
|
+
import { renderIcon } from '../../utils/renderIcon.js';
|
|
6
|
+
import cn from '../../utils/cn.js';
|
|
7
|
+
const textSizeClasses = {
|
|
8
|
+
'2xsmall': 'bread-crumb-2xs',
|
|
9
|
+
xsmall: 'bread-crumb-xs',
|
|
10
|
+
small: 'bread-crumb-sm',
|
|
11
|
+
medium: 'bread-crumb-md',
|
|
12
|
+
large: 'bread-crumb-lg',
|
|
13
|
+
xlarge: 'bread-crumb-xl',
|
|
14
|
+
};
|
|
15
|
+
const iconSizeClasses = {
|
|
16
|
+
'2xsmall': 'icon-2xs',
|
|
17
|
+
xsmall: 'icon-xs',
|
|
18
|
+
small: 'icon-sm',
|
|
19
|
+
medium: 'icon-md',
|
|
20
|
+
large: 'icon-lg',
|
|
21
|
+
xlarge: 'icon-xl',
|
|
22
|
+
};
|
|
23
|
+
const separatorIconSizeClasses = {
|
|
24
|
+
'2xsmall': '[&>svg]:icon-2xs',
|
|
25
|
+
xsmall: '[&>svg]:icon-xs',
|
|
26
|
+
small: '[&>svg]:icon-sm',
|
|
27
|
+
medium: '[&>svg]:icon-md',
|
|
28
|
+
large: '[&>svg]:icon-lg',
|
|
29
|
+
xlarge: '[&>svg]:icon-xl',
|
|
30
|
+
};
|
|
31
|
+
const BreadCrumb = ({ items, size = 'small', separator, className, }) => {
|
|
32
|
+
return (_jsx(BreadCrumbBase.Root, { children: _jsx(BreadCrumbBase.List, { className: className, children: items.map((item, index) => {
|
|
33
|
+
const isCurrent = index === items.length - 1;
|
|
34
|
+
return (_jsxs(React.Fragment, { children: [_jsx(BreadCrumbBase.Item, { className: "gap-xs", children: !item.href ? (_jsxs("span", { "aria-current": "page", className: cn(textSizeClasses[size], 'flex items-center text-neutral700 gap-0.5'), children: [renderIcon(item.icon, iconSizeClasses[size]), item.label] })) : (_jsx(Button, { as: "a", href: item.href, variant: "ghost", color: "neutral", size: size, leftIcon: item.icon, className: "h-auto! px-0! min-w-0 hover:bg-transparent active:bg-transparent text-neutral700 regular flex flex-row gap-0.5", children: item.label })) }), !isCurrent && (_jsx(BreadCrumbBase.Separator, { className: separatorIconSizeClasses[size], children: separator }))] }, `${item.label}-${index}`));
|
|
35
|
+
}) }) }));
|
|
36
|
+
};
|
|
37
|
+
export default BreadCrumb;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const BreadCrumb: {
|
|
3
|
+
Root: ({ className, ...props }: React.ComponentProps<"nav">) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
List: ({ className, ...props }: React.ComponentProps<"ol">) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
Item: ({ className, children, ...props }: React.ComponentProps<"li">) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
Separator: ({ children, className, ...props }: React.ComponentProps<"li">) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
};
|
|
8
|
+
export default BreadCrumb;
|
|
9
|
+
//# sourceMappingURL=BreadCrumbBase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BreadCrumbBase.d.ts","sourceRoot":"","sources":["../../../src/components/BreadCrumb/BreadCrumbBase.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA8C/B,eAAO,MAAM,UAAU;oCA1CgB,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;oCAI3B,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC;8CAU9D,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC;mDAY1B,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC;CAgB4B,CAAC;AAE1D,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronRightIcon } from 'lucide-react';
|
|
3
|
+
import cn from '../../utils/cn.js';
|
|
4
|
+
const Root = ({ className, ...props }) => {
|
|
5
|
+
return _jsx("nav", { "aria-label": "breadcrumb", className: cn(className), ...props });
|
|
6
|
+
};
|
|
7
|
+
const List = ({ className, ...props }) => {
|
|
8
|
+
return (_jsx("ol", { className: cn('flex flex-wrap items-center', className), ...props }));
|
|
9
|
+
};
|
|
10
|
+
const Item = ({ className, children, ...props }) => {
|
|
11
|
+
return (_jsx("li", { className: cn('inline-flex items-center', className), ...props, children: children }));
|
|
12
|
+
};
|
|
13
|
+
const Separator = ({ children, className, ...props }) => {
|
|
14
|
+
return (_jsx("li", { role: "presentation", "aria-hidden": "true", className: cn('inline-flex items-center justify-center text-neutral700 [&>svg]:shrink-0', className), ...props, children: children ?? _jsx(ChevronRightIcon, {}) }));
|
|
15
|
+
};
|
|
16
|
+
export const BreadCrumb = { Root, List, Item, Separator };
|
|
17
|
+
export default BreadCrumb;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
interface ButtonSpinnerProps {
|
|
2
2
|
size?: ButtonSpinnerSize;
|
|
3
|
-
repeat?: 'once' | 'infinite';
|
|
4
3
|
className?: string;
|
|
5
4
|
}
|
|
6
5
|
type ButtonSpinnerSize = '2xsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
|
|
7
|
-
declare const ButtonSpinner: ({ size,
|
|
6
|
+
declare const ButtonSpinner: ({ size, className }: ButtonSpinnerProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
7
|
export default ButtonSpinner;
|
|
9
8
|
//# sourceMappingURL=ButtonSpinner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonSpinner.d.ts","sourceRoot":"","sources":["../../../src/components/Button/ButtonSpinner.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ButtonSpinner.d.ts","sourceRoot":"","sources":["../../../src/components/Button/ButtonSpinner.tsx"],"names":[],"mappings":"AAGA,UAAU,kBAAkB;IAC1B,IAAI,CAAC,EAAE,iBAAiB,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,KAAK,iBAAiB,GAClB,SAAS,GACT,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,OAAO,GACP,QAAQ,CAAC;AAWb,QAAA,MAAM,aAAa,GAAI,qBAA+B,kBAAkB,4CAMvE,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import Spinner from '../Spinner/Spinner.js';
|
|
2
3
|
import cn from '../../utils/cn.js';
|
|
3
4
|
const sizeClasses = {
|
|
4
5
|
'2xsmall': 'spinner-2xs',
|
|
@@ -8,7 +9,7 @@ const sizeClasses = {
|
|
|
8
9
|
large: 'spinner-lg',
|
|
9
10
|
xlarge: 'spinner-xl',
|
|
10
11
|
};
|
|
11
|
-
const ButtonSpinner = ({ size = 'small',
|
|
12
|
-
return (_jsx(
|
|
12
|
+
const ButtonSpinner = ({ size = 'small', className }) => {
|
|
13
|
+
return (_jsx(Spinner, { className: cn('shrink-0 text-current', sizeClasses[size], className) }));
|
|
13
14
|
};
|
|
14
15
|
export default ButtonSpinner;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
interface INoticeProps {
|
|
3
|
+
title: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
button?: ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const Callout: (props: INoticeProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default Callout;
|
|
10
|
+
//# sourceMappingURL=Callout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Callout.d.ts","sourceRoot":"","sources":["../../../src/components/Callout/Callout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,UAAU,YAAY;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,OAAO,GAAI,OAAO,YAAY,4CAUnC,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import CalloutBase from './CalloutBase.js';
|
|
3
|
+
const Callout = (props) => {
|
|
4
|
+
return (_jsxs(CalloutBase.Root, { className: props.className, children: [_jsxs("div", { className: "flex flex-col gap-xs", children: [_jsx(CalloutBase.Title, { title: props.title }), _jsx(CalloutBase.Description, { description: props.description })] }), props.button] }));
|
|
5
|
+
};
|
|
6
|
+
export default Callout;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode, Ref } from 'react';
|
|
2
|
+
interface RootProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
ref?: Ref<HTMLDivElement>;
|
|
5
|
+
}
|
|
6
|
+
export declare const CalloutBase: {
|
|
7
|
+
Root: ({ ref, children, className, ...props }: RootProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
Title: (props: {
|
|
9
|
+
title?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
+
Description: (props: {
|
|
13
|
+
description?: string;
|
|
14
|
+
className?: string;
|
|
15
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
16
|
+
};
|
|
17
|
+
export default CalloutBase;
|
|
18
|
+
//# sourceMappingURL=CalloutBase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalloutBase.d.ts","sourceRoot":"","sources":["../../../src/components/Callout/CalloutBase.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGvD,UAAU,SAAU,SAAQ,cAAc,CAAC,cAAc,CAAC;IACxD,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAqCD,eAAO,MAAM,WAAW;mDAnC8B,SAAS;mBAezC;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE;yBAUhC;QAAE,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE;CAcvE,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import cn from '../../utils/cn.js';
|
|
3
|
+
const Root = ({ ref, children, className, ...props }) => {
|
|
4
|
+
return (_jsx("div", { ref: ref, className: cn('inline-flex flex-row items-center justify-between bg-tintBlue w-full p-5 rounded-lg', className), ...props, children: children }));
|
|
5
|
+
};
|
|
6
|
+
const Title = (props) => {
|
|
7
|
+
if (!props.title)
|
|
8
|
+
return null;
|
|
9
|
+
return (_jsx("span", { className: cn('text-lb500 extrabold display16', props.className), children: props.title }));
|
|
10
|
+
};
|
|
11
|
+
const Description = (props) => {
|
|
12
|
+
if (!props.description)
|
|
13
|
+
return null;
|
|
14
|
+
return (_jsx("span", { className: cn('text-lb500 display14', props.className), children: props.description }));
|
|
15
|
+
};
|
|
16
|
+
export const CalloutBase = {
|
|
17
|
+
Root,
|
|
18
|
+
Title,
|
|
19
|
+
Description,
|
|
20
|
+
};
|
|
21
|
+
export default CalloutBase;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type DividerBaseRootProps } from './DividerBase.js';
|
|
2
|
+
export type TOrientation = 'horizontal' | 'vertical';
|
|
3
|
+
export interface DividerProps extends Omit<DividerBaseRootProps, 'children'> {
|
|
4
|
+
orientation?: TOrientation;
|
|
5
|
+
decorative?: boolean;
|
|
6
|
+
}
|
|
7
|
+
declare const Divider: ({ orientation, decorative, className, ...props }: DividerProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default Divider;
|
|
9
|
+
//# sourceMappingURL=Divider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Divider.d.ts","sourceRoot":"","sources":["../../../src/components/Divider/Divider.tsx"],"names":[],"mappings":"AACA,OAAoB,EAAE,KAAK,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAEvE,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG,UAAU,CAAC;AAErD,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,oBAAoB,EAAE,UAAU,CAAC;IAC1E,WAAW,CAAC,EAAE,YAAY,CAAC;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAOD,QAAA,MAAM,OAAO,GAAI,kDAKd,YAAY,4CASd,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import cn from '../../utils/cn.js';
|
|
3
|
+
import DividerBase from './DividerBase.js';
|
|
4
|
+
const orientationClasses = {
|
|
5
|
+
horizontal: 'w-full h-px',
|
|
6
|
+
vertical: 'h-full w-px',
|
|
7
|
+
};
|
|
8
|
+
const Divider = ({ orientation = 'horizontal', decorative = true, className, ...props }) => {
|
|
9
|
+
return (_jsx(DividerBase.Root, { role: decorative ? 'undefined' : 'separator', "aria-orientation": decorative ? undefined : orientation, className: cn(orientationClasses[orientation], className), ...props }));
|
|
10
|
+
};
|
|
11
|
+
export default Divider;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type HTMLAttributes, type Ref } from 'react';
|
|
2
|
+
export interface DividerBaseRootProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
ref?: Ref<HTMLDivElement>;
|
|
4
|
+
}
|
|
5
|
+
export declare const DividerBase: {
|
|
6
|
+
Root: ({ ref, className, ...props }: DividerBaseRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
};
|
|
8
|
+
export default DividerBase;
|
|
9
|
+
//# sourceMappingURL=DividerBase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DividerBase.d.ts","sourceRoot":"","sources":["../../../src/components/Divider/DividerBase.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AAGtD,MAAM,WAAW,oBAAqB,SAAQ,cAAc,CAAC,cAAc,CAAC;IAC1E,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAYD,eAAO,MAAM,WAAW;yCAVoB,oBAAoB;CAY/D,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import cn from '../../utils/cn.js';
|
|
3
|
+
const Root = ({ ref, className, ...props }) => {
|
|
4
|
+
return (_jsx("div", { ref: ref, className: cn('shrink-0 bg-neutral100', className), ...props }));
|
|
5
|
+
};
|
|
6
|
+
export const DividerBase = {
|
|
7
|
+
Root,
|
|
8
|
+
};
|
|
9
|
+
export default DividerBase;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Dispatch, type ReactNode, SetStateAction } from 'react';
|
|
2
2
|
import { TMimeType } from '../../constants/file.js';
|
|
3
|
-
import { type
|
|
3
|
+
import { type LDButtonProps } from '../../components/LDButton/LDButton.js';
|
|
4
4
|
import { IFile } from '../../utils/file.js';
|
|
5
|
-
interface
|
|
5
|
+
interface FileUploadContextType {
|
|
6
6
|
recommendedSize?: {
|
|
7
7
|
width: number;
|
|
8
8
|
height: number;
|
|
@@ -13,7 +13,7 @@ interface EditorContextType {
|
|
|
13
13
|
setFileList: Dispatch<SetStateAction<IFile[]>>;
|
|
14
14
|
maxFileCount: number;
|
|
15
15
|
}
|
|
16
|
-
export declare const useFileUploadContext: () =>
|
|
16
|
+
export declare const useFileUploadContext: () => FileUploadContextType;
|
|
17
17
|
interface RootProps {
|
|
18
18
|
recommendedSize?: {
|
|
19
19
|
width: number;
|
|
@@ -27,7 +27,7 @@ interface RootProps {
|
|
|
27
27
|
className?: string;
|
|
28
28
|
children?: ReactNode;
|
|
29
29
|
}
|
|
30
|
-
interface
|
|
30
|
+
interface LDInputProps extends LDButtonProps<'button'> {
|
|
31
31
|
onChangeFile: ({ fileName, fileBase64, file, }: {
|
|
32
32
|
fileName: string;
|
|
33
33
|
fileBase64: string;
|
|
@@ -37,7 +37,7 @@ interface InputProps extends ButtonProps<'button'> {
|
|
|
37
37
|
}
|
|
38
38
|
export declare const FileUploadBase: {
|
|
39
39
|
Root: ({ recommendedSize, maxSize, allowedExtensions, maxFileCount, fileList, setFileList, className, children, }: RootProps) => import("react/jsx-runtime").JSX.Element;
|
|
40
|
-
|
|
40
|
+
LDInput: ({ onChangeFile, label, ...props }: LDInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
41
41
|
CardList: ({ emptyContent, className, }: {
|
|
42
42
|
emptyContent?: ReactNode;
|
|
43
43
|
className?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileUploadBase.d.ts","sourceRoot":"","sources":["../../../src/components/FileUpload/FileUploadBase.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,QAAQ,EACR,KAAK,SAAS,EACd,cAAc,
|
|
1
|
+
{"version":3,"file":"FileUploadBase.d.ts","sourceRoot":"","sources":["../../../src/components/FileUpload/FileUploadBase.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,QAAQ,EACR,KAAK,SAAS,EACd,cAAc,EAGf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAmB,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAiB,EACf,KAAK,aAAa,EACnB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAGL,KAAK,EAKN,MAAM,kBAAkB,CAAC;AAG1B,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;CACtB;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,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AA8BD,UAAU,YAAa,SAAQ,aAAa,CAAC,QAAQ,CAAC;IACpD,YAAY,EAAE,CAAC,EACb,QAAQ,EACR,UAAU,EACV,IAAI,GACL,EAAE;QACD,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;QACnB,IAAI,EAAE,IAAI,CAAC;KACZ,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAmJD,eAAO,MAAM,cAAc;uHAjLxB,SAAS;iDAoCT,YAAY;6CA2EZ;QACD,YAAY,CAAC,EAAE,SAAS,CAAC;QACzB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB;iCA6CmC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE;CAuBzD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
3
3
|
import { createContext, useContext, } from 'react';
|
|
4
4
|
import cn from '../../utils/cn.js';
|
|
5
5
|
import { FILE_EXTENSIONS } from '../../constants/file.js';
|
|
6
|
-
import
|
|
6
|
+
import LDButton from '../../components/LDButton/LDButton.js';
|
|
7
7
|
import { fileToBase64, getFileSizeUnit, isImage, validAllowedExtesions, validFileSize, validImageSize, } from '../../utils/file.js';
|
|
8
8
|
import Toast from '../../components/Toast/Toast.js';
|
|
9
9
|
const FileUploadContext = createContext(null);
|
|
@@ -25,7 +25,7 @@ const Root = ({ recommendedSize, maxSize, allowedExtensions, maxFileCount, fileL
|
|
|
25
25
|
setFileList,
|
|
26
26
|
}, children: _jsx("div", { className: cn('w-full', className), children: children }) }));
|
|
27
27
|
};
|
|
28
|
-
const
|
|
28
|
+
const LDInput = ({ onChangeFile, label = '파일 선택', ...props }) => {
|
|
29
29
|
const { allowedExtensions, maxSize, fileList, setFileList, maxFileCount } = useFileUploadContext();
|
|
30
30
|
const getFileError = async (file) => {
|
|
31
31
|
if (!validAllowedExtesions(file, allowedExtensions)) {
|
|
@@ -70,7 +70,7 @@ const Input = ({ onChangeFile, label = '파일 선택', ...props }) => {
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
};
|
|
73
|
-
return (_jsxs(
|
|
73
|
+
return (_jsxs(LDButton, { as: "label", ...props, children: [label, _jsx("input", { type: "file", multiple: maxFileCount > 1, onClick: (e) => (e.currentTarget.value = ''), onChange: (e) => handleFile(e), className: "sr-only" })] }));
|
|
74
74
|
};
|
|
75
75
|
const CardList = ({ emptyContent, className, }) => {
|
|
76
76
|
/*
|
|
@@ -95,7 +95,7 @@ const Description = ({ className }) => {
|
|
|
95
95
|
};
|
|
96
96
|
export const FileUploadBase = {
|
|
97
97
|
Root,
|
|
98
|
-
|
|
98
|
+
LDInput,
|
|
99
99
|
CardList,
|
|
100
100
|
Description,
|
|
101
101
|
};
|
|
@@ -18,7 +18,7 @@ interface FormFieldRenderProps<TValue = any> {
|
|
|
18
18
|
value: TValue;
|
|
19
19
|
/**
|
|
20
20
|
* react-hook-form의 controllerField.ref와 외부 ref를 합친 콜백 ref.
|
|
21
|
-
*
|
|
21
|
+
* LDInput, LDSelect 등 다양한 DOM 요소에 연결되므로 element 타입을 any로 받음.
|
|
22
22
|
*/
|
|
23
23
|
ref: (element: any) => void;
|
|
24
24
|
/**
|
|
@@ -44,7 +44,7 @@ interface FormFieldProps<TValue = any> {
|
|
|
44
44
|
customErrorMessage?: string;
|
|
45
45
|
disabled?: boolean;
|
|
46
46
|
/**
|
|
47
|
-
*
|
|
47
|
+
* LDInput, LDSelect 등 다양한 컴포넌트의 ref를 받아야 하므로 Ref<any>로 선언.
|
|
48
48
|
* (HTMLInputElement, HTMLButtonElement 등 요소 타입이 사용처마다 다름)
|
|
49
49
|
*/
|
|
50
50
|
ref?: Ref<any>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
interface AvatarContextType {
|
|
3
|
+
src?: string | null;
|
|
4
|
+
status: 'idle' | 'loading' | 'loaded' | 'error';
|
|
5
|
+
setStatus: (status: 'idle' | 'loading' | 'loaded' | 'error') => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const useAvatarContext: () => AvatarContextType;
|
|
8
|
+
interface RootProps {
|
|
9
|
+
src?: string | null;
|
|
10
|
+
className?: string;
|
|
11
|
+
style?: React.CSSProperties;
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
interface ImageProps {
|
|
15
|
+
alt?: string;
|
|
16
|
+
width?: number;
|
|
17
|
+
height?: number;
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
interface FallbackProps {
|
|
21
|
+
className?: string;
|
|
22
|
+
children?: ReactNode;
|
|
23
|
+
/** 이미지 로드 지연 처리용 딜레이(ms). 기본값 0 (즉시 표시) */
|
|
24
|
+
delayMs?: number;
|
|
25
|
+
}
|
|
26
|
+
export declare const AvatarBase: {
|
|
27
|
+
Root: ({ src, className, style, children }: RootProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
Image: ({ alt, width, height, className }: ImageProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
29
|
+
Fallback: ({ className, children, delayMs }: FallbackProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
30
|
+
};
|
|
31
|
+
export default AvatarBase;
|
|
32
|
+
//# sourceMappingURL=AvatarBase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AvatarBase.d.ts","sourceRoot":"","sources":["../../../src/components/LDAvatar/AvatarBase.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAIf,UAAU,iBAAiB;IACzB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;IAChD,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,KAAK,IAAI,CAAC;CACtE;AAID,eAAO,MAAM,gBAAgB,yBAO5B,CAAC;AAGF,UAAU,SAAS;IACjB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAiCD,UAAU,UAAU;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAqBD,UAAU,aAAa;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,2CAA2C;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AA6BD,eAAO,MAAM,UAAU;gDA3F4B,SAAS;+CAsCC,UAAU;iDA0Bf,aAAa;CA+BpE,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { createContext, useContext, useState, useEffect, } from 'react';
|
|
4
|
+
import cn from '../../utils/cn.js';
|
|
5
|
+
const AvatarContext = createContext(null);
|
|
6
|
+
export const useAvatarContext = () => {
|
|
7
|
+
const ctx = useContext(AvatarContext);
|
|
8
|
+
if (!ctx)
|
|
9
|
+
throw new Error('AvatarBase 하위 컴포넌트는 Root 내부에서 사용해야 합니다.');
|
|
10
|
+
return ctx;
|
|
11
|
+
};
|
|
12
|
+
const Root = ({ src, className, style, children }) => {
|
|
13
|
+
const [status, setStatus] = useState(src ? 'loading' : 'error');
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
setStatus(src ? 'loading' : 'error');
|
|
16
|
+
}, [src]);
|
|
17
|
+
return (_jsx(AvatarContext, { value: {
|
|
18
|
+
src,
|
|
19
|
+
status,
|
|
20
|
+
setStatus,
|
|
21
|
+
}, children: _jsx("span", { style: style, className: cn('relative flex shrink-0 overflow-hidden rounded-full', className), children: children }) }));
|
|
22
|
+
};
|
|
23
|
+
const Image = ({ alt = 'avatar', width, height, className }) => {
|
|
24
|
+
const { src, status, setStatus } = useAvatarContext();
|
|
25
|
+
if (!src || status === 'error')
|
|
26
|
+
return null;
|
|
27
|
+
return (_jsx("img", { src: src, alt: alt, width: width, height: height, onLoad: () => setStatus('loaded'), onError: () => setStatus('error'), className: cn('aspect-square h-full w-full object-cover', className) }));
|
|
28
|
+
};
|
|
29
|
+
const Fallback = ({ className, children, delayMs = 0 }) => {
|
|
30
|
+
const { status } = useAvatarContext();
|
|
31
|
+
const [show, setShow] = useState(delayMs === 0);
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
if (delayMs === 0) {
|
|
34
|
+
setShow(true);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const timer = setTimeout(() => setShow(true), delayMs);
|
|
38
|
+
return () => clearTimeout(timer);
|
|
39
|
+
}, [delayMs]);
|
|
40
|
+
if (status === 'loaded' || !show)
|
|
41
|
+
return null;
|
|
42
|
+
return (_jsx("span", { className: cn('flex h-full w-full items-center justify-center rounded-full', className), children: children }));
|
|
43
|
+
};
|
|
44
|
+
export const AvatarBase = {
|
|
45
|
+
Root,
|
|
46
|
+
Image,
|
|
47
|
+
Fallback,
|
|
48
|
+
};
|
|
49
|
+
export default AvatarBase;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type AvatarSize = 'sm' | 'md' | 'lg';
|
|
2
|
+
export interface LDAvatarProps {
|
|
3
|
+
src?: string | null;
|
|
4
|
+
alt?: string;
|
|
5
|
+
size?: AvatarSize;
|
|
6
|
+
className?: string;
|
|
7
|
+
style?: React.CSSProperties;
|
|
8
|
+
}
|
|
9
|
+
declare const LDAvatar: ({ src, alt, size, className, style, }: LDAvatarProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default LDAvatar;
|
|
11
|
+
//# sourceMappingURL=LDAvatar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LDAvatar.d.ts","sourceRoot":"","sources":["../../../src/components/LDAvatar/LDAvatar.tsx"],"names":[],"mappings":"AAKA,KAAK,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAqBrC,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,QAAA,MAAM,QAAQ,GAAI,uCAMf,aAAa,4CAef,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { UserRound } from 'lucide-react';
|
|
3
|
+
import AvatarBase from './AvatarBase.js';
|
|
4
|
+
import cn from '../../utils/cn.js';
|
|
5
|
+
const SIZE_MAP = {
|
|
6
|
+
sm: 'w-8 h-8',
|
|
7
|
+
md: 'w-12 h-12',
|
|
8
|
+
lg: 'w-16 h-16',
|
|
9
|
+
};
|
|
10
|
+
const IMAGE_SIZE_MAP = {
|
|
11
|
+
sm: 32,
|
|
12
|
+
md: 48,
|
|
13
|
+
lg: 64,
|
|
14
|
+
};
|
|
15
|
+
const ICON_SIZE_MAP = {
|
|
16
|
+
sm: 24,
|
|
17
|
+
md: 32,
|
|
18
|
+
lg: 40,
|
|
19
|
+
};
|
|
20
|
+
const LDAvatar = ({ src, alt = 'avatar', size = 'sm', className, style, }) => {
|
|
21
|
+
const px = IMAGE_SIZE_MAP[size];
|
|
22
|
+
return (_jsxs(AvatarBase.Root, { src: src, style: style, className: cn(SIZE_MAP[size], className), children: [_jsx(AvatarBase.Image, { alt: alt, width: px, height: px }), _jsx(AvatarBase.Fallback, { className: "bg-mono100", children: _jsx(UserRound, { size: ICON_SIZE_MAP[size], className: "text-mono400" }) })] }));
|
|
23
|
+
};
|
|
24
|
+
export default LDAvatar;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode, type Ref } from 'react';
|
|
2
|
+
interface RootProps extends HTMLAttributes<HTMLSpanElement> {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
ref?: Ref<HTMLSpanElement>;
|
|
5
|
+
}
|
|
6
|
+
export declare const BadgeBase: {
|
|
7
|
+
Root: ({ className, children, ref, ...props }: RootProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
};
|
|
9
|
+
export default BadgeBase;
|
|
10
|
+
//# sourceMappingURL=BadgeBase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BadgeBase.d.ts","sourceRoot":"","sources":["../../../src/components/LDBadge/BadgeBase.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AAItE,UAAU,SAAU,SAAQ,cAAc,CAAC,eAAe,CAAC;IACzD,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,GAAG,CAAC,EAAE,GAAG,CAAC,eAAe,CAAC,CAAC;CAC5B;AAcD,eAAO,MAAM,SAAS;mDAZgC,SAAS;CAc9D,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import cn from '../../utils/cn.js';
|
|
3
|
+
const Root = ({ className, children, ref, ...props }) => {
|
|
4
|
+
return (_jsx("span", { ref: ref, className: cn('inline-flex items-center justify-center', className), ...props, children: children }));
|
|
5
|
+
};
|
|
6
|
+
export const BadgeBase = {
|
|
7
|
+
Root,
|
|
8
|
+
};
|
|
9
|
+
export default BadgeBase;
|