@lotte-innovate/ui-component-test 0.0.44 → 0.0.45
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +281 -78
- package/package.json +3 -2
- package/dist/globals.css +0 -4
- package/dist/lib/Typography/Header/index.d.ts +0 -13
- package/dist/lib/Typography/Text/index.d.ts +0 -15
- package/dist/lib/Typography/index.d.ts +0 -2
- package/dist/lib/color/alpha.d.ts +0 -784
- package/dist/lib/color/constants.d.ts +0 -29
- package/dist/lib/color/dark.d.ts +0 -392
- package/dist/lib/color/krdsColors.d.ts +0 -309
- package/dist/lib/color/light.d.ts +0 -392
- package/dist/lib/components/Accordion/index.d.ts +0 -22
- package/dist/lib/components/AlertDialog/AlertDialogAction.d.ts +0 -14
- package/dist/lib/components/AlertDialog/AlertDialogCancel.d.ts +0 -13
- package/dist/lib/components/AlertDialog/AlertDialogContent.d.ts +0 -11
- package/dist/lib/components/AlertDialog/AlertDialogDescription.d.ts +0 -10
- package/dist/lib/components/AlertDialog/AlertDialogRoot.d.ts +0 -16
- package/dist/lib/components/AlertDialog/AlertDialogTitle.d.ts +0 -10
- package/dist/lib/components/AlertDialog/AlertDialogTrigger.d.ts +0 -17
- package/dist/lib/components/AlertDialog/index.d.ts +0 -11
- package/dist/lib/components/AspectRatio/index.d.ts +0 -10
- package/dist/lib/components/Avatar/index.d.ts +0 -21
- package/dist/lib/components/Badge/index.d.ts +0 -18
- package/dist/lib/components/BarChart/index.d.ts +0 -38
- package/dist/lib/components/BubbleChart/index.d.ts +0 -29
- package/dist/lib/components/Button/index.d.ts +0 -16
- package/dist/lib/components/Callout/CalloutIcon.d.ts +0 -13
- package/dist/lib/components/Callout/CalloutRoot.d.ts +0 -18
- package/dist/lib/components/Callout/CalloutText.d.ts +0 -10
- package/dist/lib/components/Callout/index.d.ts +0 -7
- package/dist/lib/components/Card/index.d.ts +0 -14
- package/dist/lib/components/Checkbox/index.d.ts +0 -17
- package/dist/lib/components/CheckboxCard/index.d.ts +0 -20
- package/dist/lib/components/CheckboxGroup/CheckboxGroupItem.d.ts +0 -5
- package/dist/lib/components/CheckboxGroup/CheckboxGroupRoot.d.ts +0 -17
- package/dist/lib/components/CheckboxGroup/index.d.ts +0 -6
- package/dist/lib/components/ContextMenu/ContextMenuCheckboxItem.d.ts +0 -4
- package/dist/lib/components/ContextMenu/ContextMenuContent.d.ts +0 -11
- package/dist/lib/components/ContextMenu/ContextMenuGroup.d.ts +0 -4
- package/dist/lib/components/ContextMenu/ContextMenuItem.d.ts +0 -13
- package/dist/lib/components/ContextMenu/ContextMenuItemIndicator.d.ts +0 -10
- package/dist/lib/components/ContextMenu/ContextMenuLabel.d.ts +0 -11
- package/dist/lib/components/ContextMenu/ContextMenuRadioGroup.d.ts +0 -8
- package/dist/lib/components/ContextMenu/ContextMenuRadioItem.d.ts +0 -4
- package/dist/lib/components/ContextMenu/ContextMenuRoot.d.ts +0 -13
- package/dist/lib/components/ContextMenu/ContextMenuSeparator.d.ts +0 -3
- package/dist/lib/components/ContextMenu/ContextMenuSubContent.d.ts +0 -11
- package/dist/lib/components/ContextMenu/ContextMenuSubTrigger.d.ts +0 -4
- package/dist/lib/components/ContextMenu/ContextMenuTrigger.d.ts +0 -4
- package/dist/lib/components/ContextMenu/index.d.ts +0 -17
- package/dist/lib/components/DataList/DataListItem.d.ts +0 -9
- package/dist/lib/components/DataList/DataListLabel.d.ts +0 -10
- package/dist/lib/components/DataList/DataListRoot.d.ts +0 -14
- package/dist/lib/components/DataList/DataListValue.d.ts +0 -11
- package/dist/lib/components/DataList/index.d.ts +0 -8
- package/dist/lib/components/Dialog/DialogAction.d.ts +0 -13
- package/dist/lib/components/Dialog/DialogCancel.d.ts +0 -11
- package/dist/lib/components/Dialog/DialogContent.d.ts +0 -11
- package/dist/lib/components/Dialog/DialogDescription.d.ts +0 -9
- package/dist/lib/components/Dialog/DialogRoot.d.ts +0 -15
- package/dist/lib/components/Dialog/DialogSlot.d.ts +0 -9
- package/dist/lib/components/Dialog/DialogTitle.d.ts +0 -11
- package/dist/lib/components/Dialog/DialogTrigger.d.ts +0 -3
- package/dist/lib/components/Dialog/index.d.ts +0 -15
- package/dist/lib/components/DoughnutChart/index.d.ts +0 -23
- package/dist/lib/components/DropdownMenu/DropdonMenuRadioGroup.d.ts +0 -3
- package/dist/lib/components/DropdownMenu/DropdonMenuSubContent.d.ts +0 -11
- package/dist/lib/components/DropdownMenu/DropdownMenuCheckboxItem.d.ts +0 -7
- package/dist/lib/components/DropdownMenu/DropdownMenuContent.d.ts +0 -11
- package/dist/lib/components/DropdownMenu/DropdownMenuItem.d.ts +0 -15
- package/dist/lib/components/DropdownMenu/DropdownMenuItemIndicator.d.ts +0 -10
- package/dist/lib/components/DropdownMenu/DropdownMenuLable.d.ts +0 -10
- package/dist/lib/components/DropdownMenu/DropdownMenuRadioItem.d.ts +0 -6
- package/dist/lib/components/DropdownMenu/DropdownMenuRoot.d.ts +0 -15
- package/dist/lib/components/DropdownMenu/DropdownMenuSeparator.d.ts +0 -3
- package/dist/lib/components/DropdownMenu/DropdownMenuSub.d.ts +0 -3
- package/dist/lib/components/DropdownMenu/DropdownMenuSubTrigger.d.ts +0 -4
- package/dist/lib/components/DropdownMenu/DropdownMenuTrigger.d.ts +0 -14
- package/dist/lib/components/DropdownMenu/index.d.ts +0 -20
- package/dist/lib/components/HoverCard/HoverCardContent.d.ts +0 -14
- package/dist/lib/components/HoverCard/HoverCardRoot.d.ts +0 -11
- package/dist/lib/components/HoverCard/HoverCardTrigger.d.ts +0 -3
- package/dist/lib/components/HoverCard/index.d.ts +0 -10
- package/dist/lib/components/IconButton/index.d.ts +0 -15
- package/dist/lib/components/Inset/index.d.ts +0 -10
- package/dist/lib/components/Label/index.d.ts +0 -17
- package/dist/lib/components/LineChart/index.d.ts +0 -44
- package/dist/lib/components/Menubar/MenubarCheckboxItem.d.ts +0 -4
- package/dist/lib/components/Menubar/MenubarContent.d.ts +0 -11
- package/dist/lib/components/Menubar/MenubarItem.d.ts +0 -13
- package/dist/lib/components/Menubar/MenubarItemIndicator.d.ts +0 -10
- package/dist/lib/components/Menubar/MenubarMenu.d.ts +0 -5
- package/dist/lib/components/Menubar/MenubarRadioGroup.d.ts +0 -8
- package/dist/lib/components/Menubar/MenubarRadioItem.d.ts +0 -4
- package/dist/lib/components/Menubar/MenubarRoot.d.ts +0 -19
- package/dist/lib/components/Menubar/MenubarSeparator.d.ts +0 -3
- package/dist/lib/components/Menubar/MenubarSub.d.ts +0 -3
- package/dist/lib/components/Menubar/MenubarSubContent.d.ts +0 -10
- package/dist/lib/components/Menubar/MenubarSubTrigger.d.ts +0 -4
- package/dist/lib/components/Menubar/MenubarTrigger.d.ts +0 -12
- package/dist/lib/components/Menubar/index.d.ts +0 -19
- package/dist/lib/components/NavigationMenu/NavigationMenuContent.d.ts +0 -11
- package/dist/lib/components/NavigationMenu/NavigationMenuIndicator.d.ts +0 -3
- package/dist/lib/components/NavigationMenu/NavigationMenuItem.d.ts +0 -3
- package/dist/lib/components/NavigationMenu/NavigationMenuLink.d.ts +0 -13
- package/dist/lib/components/NavigationMenu/NavigationMenuList.d.ts +0 -12
- package/dist/lib/components/NavigationMenu/NavigationMenuRoot.d.ts +0 -14
- package/dist/lib/components/NavigationMenu/NavigationMenuTrigger.d.ts +0 -13
- package/dist/lib/components/NavigationMenu/NavigationMenuViewport.d.ts +0 -12
- package/dist/lib/components/NavigationMenu/index.d.ts +0 -12
- package/dist/lib/components/PieChart/index.d.ts +0 -23
- package/dist/lib/components/Popover/PopoverClose.d.ts +0 -9
- package/dist/lib/components/Popover/PopoverContent.d.ts +0 -11
- package/dist/lib/components/Popover/PopoverRoot.d.ts +0 -12
- package/dist/lib/components/Popover/PopoverTrigger.d.ts +0 -3
- package/dist/lib/components/Popover/index.d.ts +0 -11
- package/dist/lib/components/Progress/index.d.ts +0 -13
- package/dist/lib/components/RadarChart/index.d.ts +0 -33
- package/dist/lib/components/Radio/index.d.ts +0 -13
- package/dist/lib/components/RadioCards/RadioCardsItem.d.ts +0 -10
- package/dist/lib/components/RadioCards/RadioCardsRoot.d.ts +0 -13
- package/dist/lib/components/RadioCards/index.d.ts +0 -6
- package/dist/lib/components/RadioGroup/RadioGroupItem.d.ts +0 -13
- package/dist/lib/components/RadioGroup/RadioGroupRoot.d.ts +0 -15
- package/dist/lib/components/RadioGroup/index.d.ts +0 -6
- package/dist/lib/components/ScrollArea/index.d.ts +0 -9
- package/dist/lib/components/SegmentedControl/SegmentedControlItem.d.ts +0 -6
- package/dist/lib/components/SegmentedControl/SegmentedControlRoot.d.ts +0 -14
- package/dist/lib/components/SegmentedControl/index.d.ts +0 -6
- package/dist/lib/components/Select/index.d.ts +0 -34
- package/dist/lib/components/Separator/index.d.ts +0 -11
- package/dist/lib/components/Skeleton/index.d.ts +0 -14
- package/dist/lib/components/Slider/index.d.ts +0 -14
- package/dist/lib/components/Spinner/index.d.ts +0 -15
- package/dist/lib/components/TabNav/index.d.ts +0 -15
- package/dist/lib/components/Table/index.d.ts +0 -30
- package/dist/lib/components/Tabs/index.d.ts +0 -22
- package/dist/lib/components/TextArea/index.d.ts +0 -16
- package/dist/lib/components/TextField/index.d.ts +0 -21
- package/dist/lib/components/Toast/ToastActionButton.d.ts +0 -14
- package/dist/lib/components/Toast/ToastDescription.d.ts +0 -13
- package/dist/lib/components/Toast/ToastRoot.d.ts +0 -27
- package/dist/lib/components/Toast/ToastTitle.d.ts +0 -13
- package/dist/lib/components/Toast/index.d.ts +0 -8
- package/dist/lib/components/Toggle/ToggleWithText.d.ts +0 -21
- package/dist/lib/components/Toggle/index.d.ts +0 -21
- package/dist/lib/components/ToggleGroup/ToggleGroupItem.d.ts +0 -17
- package/dist/lib/components/ToggleGroup/ToggleGroupRoot.d.ts +0 -15
- package/dist/lib/components/ToggleGroup/index.d.ts +0 -6
- package/dist/lib/components/ToggleSwitch/index.d.ts +0 -13
- package/dist/lib/components/Tooltip/index.d.ts +0 -19
- package/dist/lib/components/index.d.ts +0 -50
- package/dist/lib/constants.d.ts +0 -655
- package/dist/lib/index.d.ts +0 -2
- package/dist/lib/types.d.ts +0 -81
- package/dist/lib/utils/useDarkMode.d.ts +0 -1
- package/dist/lib/utils/utils.d.ts +0 -2
package/README.md
CHANGED
@@ -1,88 +1,62 @@
|
|
1
|
-
# LOTTE UI
|
1
|
+
# 🎨 LOTTE UI LIBRARY (L-UI)
|
2
2
|
|
3
3
|
<br />
|
4
4
|
|
5
|
-
##
|
5
|
+
## 📌목차
|
6
6
|
|
7
|
-
- [
|
8
|
-
- [
|
9
|
-
- [
|
10
|
-
- [
|
11
|
-
- [
|
12
|
-
- [
|
7
|
+
- [💁 소개](#소개)
|
8
|
+
- [🔨 기술스택](#기술스택)
|
9
|
+
- [💻 사전설치](#사전설치)
|
10
|
+
- [🟢 실행](#실행)
|
11
|
+
- [🛠️ 배포](#배포)
|
12
|
+
- [📁 구조](#구조)
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
모든 L-UI 구성 요소를 내보내는 단일 패키지입니다.
|
17
|
-
|
18
|
-
일관되고 통일된 컴포넌트를 제공하며 사용자 정의 및 재사용 가능합니다.
|
19
|
-
|
20
|
-
이 라이브러리는 React로 구축된 프로젝트를 지원합니다.
|
21
|
-
|
22
|
-
## Installation
|
23
|
-
|
24
|
-
패키지를 설치하기 위해 아래 명령어를 사용합니다.
|
25
|
-
|
26
|
-
```bash
|
27
|
-
npm i @lotte-innovate/lui
|
28
|
-
```
|
29
|
-
|
30
|
-
```bash
|
31
|
-
yarn add @lotte-innovate/lui
|
32
|
-
```
|
14
|
+
<br />
|
33
15
|
|
34
|
-
##
|
16
|
+
## 💁소개
|
35
17
|
|
36
|
-
|
18
|
+
<b>Lotte Innovate 디자인 가이드를 적용한 전사 표준 UI 라이브러리입니다.</b>
|
37
19
|
|
38
|
-
|
20
|
+
#### 주요 특징
|
39
21
|
|
40
|
-
|
41
|
-
import '@lotte-innovate/lui/dist/globals.css';
|
42
|
-
```
|
22
|
+
- <b>웹 표준 및 접근성 준수</b>
|
43
23
|
|
44
|
-
|
24
|
+
- Headless UI Library인 radix-ui를 사용하여 웹 접근성을 보장합니다.
|
25
|
+
- 정부 UI/UX 가이드라인을 준수하여 개발되었습니다.
|
45
26
|
|
46
|
-
|
27
|
+
- <b>다양한 컴포넌트</b>
|
47
28
|
|
48
|
-
|
49
|
-
import React from 'react';
|
50
|
-
import { Button } from '@lotte-innovate/lui';
|
29
|
+
- 45가지의 UI 컴포넌트와 6가지의 차트를 제공합니다.
|
51
30
|
|
52
|
-
|
53
|
-
return (
|
54
|
-
<div>
|
55
|
-
<Button onClick={() => alert('Button clicked!')}>Click Me</Button>
|
56
|
-
</div>
|
57
|
-
);
|
58
|
-
};
|
31
|
+
- <b>일관된 디자인</b>
|
59
32
|
|
60
|
-
|
61
|
-
|
33
|
+
- 모든 컴포넌트와 차트에 공통 Props (Color, Radius, Scaling, Weight, Appearance, Size)를 적용하여 디자인의 통일성을 유지합니다.
|
34
|
+
- 다크모드에서도 표준화된 색상을 적용하여 모든 컴포넌트에 일관되게 적용욉니다.
|
35
|
+
- [피그마 디자인 가이드 바로가기](https://www.figma.com/design/tlcB7UYdvUNzPk5T66FqLf/UI-%EB%9D%BC%EC%9D%B4%EB%B8%8C%EB%9F%AC%EB%A6%AC-%EA%B3%B5%EC%9C%A0%EC%9A%A9?node-id=0-1&node-type=canvas&t=PEwpe2j6PilPTwXC-0)
|
62
36
|
|
63
|
-
|
37
|
+
- <b>스토리북 통합</b>
|
64
38
|
|
65
|
-
|
66
|
-
|
67
|
-
import { IconButton } from '@lotte-innovate/lui';
|
68
|
-
import { MagnifyingGlassIcon } from '@radix-ui/react-icons';
|
39
|
+
- Storybook을 활용하여 컴포넌트를 문서화하고 테스트할 수 있습니다.
|
40
|
+
- [스토리북 바로가기](https://66849ef80cb87f1ca900f051-tqldgzbipz.chromatic.com/?path=/docs/welcome--docs)
|
69
41
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
<IconButton>
|
74
|
-
<MagnifyingGlassIcon />
|
75
|
-
</IconButton>
|
76
|
-
</div>
|
77
|
-
);
|
78
|
-
};
|
42
|
+
- <b>npm 패키지 배포</b>
|
43
|
+
- 디자인 시스템은 npm 패키지로 배포되어, 프로젝트에 쉽게 설치하고 사용할 수 있습니다.
|
44
|
+
- [NPM 패키지 바로가기](https://www.npmjs.com/package/@lotte-innovate/lui)
|
79
45
|
|
80
|
-
|
81
|
-
|
46
|
+
<br />
|
47
|
+
<details>
|
48
|
+
<summary>공통 Props 목록</summary>
|
82
49
|
|
83
|
-
|
50
|
+
| name | description | 단계 | option |
|
51
|
+
| ---------- | ------------------------------------------------- | -------- | --------------------------------------------- |
|
52
|
+
| Color | 27가지 색상을 라이트/다크/알파/알파다크 모드 제공 | 1~12단계 | blue, crimson, teal, orange, purple, amber... |
|
53
|
+
| Radius | 컴포넌트의 둥글기 적용 | 5단계 | none, small, medium, large, full |
|
54
|
+
| Scaling | 컴포넌트의 비율 | 5단계 | 90%, 95%, 100%, 105%, 110% |
|
55
|
+
| Weight | 컴포넌트의 텍스트 굵기 | 4단계 | regular, medium, semibold, bold |
|
56
|
+
| Appearance | 컴포넌트의 디자인 스타일 | 6단계 | classic, ghost, outline, soft, solid, surface |
|
57
|
+
| Size | 컴포넌트의 크기 | 5단계 | x-small, small, medium, large, x-large |
|
84
58
|
|
85
|
-
|
59
|
+
</details>
|
86
60
|
|
87
61
|
<details>
|
88
62
|
<summary>컴포넌트 목록</summary>
|
@@ -112,22 +86,251 @@ export default App;
|
|
112
86
|
|
113
87
|
</details>
|
114
88
|
|
115
|
-
<
|
116
|
-
<summary>공통 Props 목록</summary>
|
89
|
+
<br />
|
117
90
|
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
91
|
+
#### 스토리북 주요 화면
|
92
|
+
|
93
|
+
<div>
|
94
|
+
<div>
|
95
|
+
<p>Light, Dark Color</p>
|
96
|
+
<img src="/uploads/6ff420bc359758218c69e3fdabd9ec38/color.png" width="40%" />
|
97
|
+
<img src="/uploads/5c6296dc810dd5668330520057a094f4/color-dark.png" width="40%" />
|
98
|
+
</div>
|
99
|
+
<div>
|
100
|
+
<p>Header, Checkbox Component</p>
|
101
|
+
<img src="/uploads/8a01ff02586bf822f17e3f06f70f1857/header.png" width="40%" />
|
102
|
+
<img src="/uploads/a44c67d88d699d84dcb38a16900a2654/checkbox.png" width="40%" />
|
103
|
+
</div>
|
104
|
+
<div>
|
105
|
+
<p>SegmentedControl, Doughnutchart Component</p>
|
106
|
+
<img src="/uploads/54d0265e45325d56a8f5df5a947560d4/segmented.png" width="40%" />
|
107
|
+
<img src="/uploads/1e2d25043446da8c67ce62334043618b/doughnut-chart.png" width="40%" />
|
108
|
+
</div>
|
109
|
+
<div>
|
110
|
+
<p>Dark 모드일때 ToggleGroup, Dropdown Component</p>
|
111
|
+
<img src="/uploads/059d20ecfbc22f0864f4b769f30a1723/dark-toggle.png" width="40%" />
|
112
|
+
<img src="/uploads/d4b7006f59bb35a166105dad34ee232f/dark-dropdown.png" width="40%" />
|
113
|
+
</div>
|
114
|
+
</div>
|
126
115
|
|
127
|
-
|
116
|
+
<br />
|
117
|
+
|
118
|
+
## 🔨기술스택
|
119
|
+
|
120
|
+
#### Environment
|
121
|
+
|
122
|
+
![Visual Studio Code](https://img.shields.io/badge/Visual%20Studio%20Code-007ACC?style=for-the-badge&logo=Visual%20Studio%20Code&logoColor=white)
|
123
|
+
![Git](https://img.shields.io/badge/Git-F05032?style=for-the-badge&logo=Git&logoColor=white)
|
124
|
+
![Github](https://img.shields.io/badge/Gitlab-FC6D26?style=for-the-badge&logo=GitLab&logoColor=white)
|
125
|
+
|
126
|
+
#### Config
|
127
|
+
|
128
|
+
![npm](https://img.shields.io/badge/npm-CB3837?style=for-the-badge&logo=npm&logoColor=white)
|
129
|
+
|
130
|
+
#### Development
|
131
|
+
|
132
|
+
![JavaScript](https://img.shields.io/badge/JavaScript-F7DF1E?style=for-the-badge&logo=Javascript&logoColor=white)
|
133
|
+
![React](https://img.shields.io/badge/React-20232A?style=for-the-badge&logo=react&logoColor=61DAFB)
|
134
|
+
![Next.js](https://img.shields.io/badge/Next.js-000000?style=for-the-badge&logo=Next.js&logoColor=white)
|
135
|
+
![tailwind CSS](https://img.shields.io/badge/TailwindCSS-06B6D4?style=for-the-badge&logo=TailwindCSS&logoColor=white)
|
136
|
+
![storybook](https://img.shields.io/badge/storybook-FF4785?style=for-the-badge&logo=storybook&logoColor=white)
|
137
|
+
|
138
|
+
#### Communication
|
139
|
+
|
140
|
+
![Figma](https://img.shields.io/badge/Figma-F24E1E?style=for-the-badge&logo=Figma&logoColor=white)
|
141
|
+
![Github Issues](https://img.shields.io/badge/Github%20Issues-FC6D26?style=for-the-badge&logo=GitLab&logoColor=white)
|
142
|
+
|
143
|
+
#### Reference
|
144
|
+
|
145
|
+
![RadixUI](https://img.shields.io/badge/Radix%20UI-161618?style=for-the-badge&logo=RadixUI&logoColor=white)
|
146
|
+
![Chartjs](https://img.shields.io/badge/Chart.js-FF6384?style=for-the-badge&logo=Chart.js&logoColor=white)
|
147
|
+
|
148
|
+
<br />
|
149
|
+
|
150
|
+
## 💻사전설치
|
151
|
+
|
152
|
+
이 라이브러리는 React로 구축된 프로젝트를 지원하며 주요 사전 설치 라이브러리는 아래와 같습니다.
|
153
|
+
|
154
|
+
- radix-ui/primitives
|
155
|
+
- 컴포넌트 개발 시 활용할 라이브러리로 필요한 컴포넌트 별 설치
|
156
|
+
|
157
|
+
```shell
|
158
|
+
npm install @radix-ui/react-accordion@latest -E
|
159
|
+
```
|
160
|
+
|
161
|
+
- radix-ui/theme
|
162
|
+
- 일부 컴포넌트는 스타일이 적용된 theme 라이브러리 설치
|
163
|
+
|
164
|
+
```shell
|
165
|
+
npm install @radix-ui/themes -E
|
166
|
+
```
|
167
|
+
|
168
|
+
- chart.js
|
169
|
+
- 차트 컴포넌트 개발 시 활용
|
170
|
+
|
171
|
+
```shell
|
172
|
+
npm install chart.js
|
173
|
+
```
|
174
|
+
|
175
|
+
- storybook
|
176
|
+
- 컴포넌트 디자인 테스트를 위해 설치
|
177
|
+
|
178
|
+
```shell
|
179
|
+
npx sb init
|
180
|
+
npx storybook@latest add @storybook/addon-styling-webpack
|
181
|
+
```
|
182
|
+
|
183
|
+
- clsx
|
184
|
+
- 조건부 className 작성을 위해 사용
|
185
|
+
|
186
|
+
```shell
|
187
|
+
npm i clsx
|
188
|
+
```
|
189
|
+
|
190
|
+
- tailwind-merge
|
191
|
+
- 스타일 충돌 없이 자바스크립트에서 tailwind CSS 클래스를 효율적으로 병합하는 기능을 가진 라이브러리
|
192
|
+
|
193
|
+
```shell
|
194
|
+
npm i tailwind-merge
|
195
|
+
```
|
196
|
+
|
197
|
+
- class-variance-authority (CVA)
|
198
|
+
- 일관성 있는 UI를 정의하고 사용할 수 있도록 도와주는 툴로써 shadcn/ui 컴포넌트의 핵심 도구
|
199
|
+
|
200
|
+
```shell
|
201
|
+
npm i class-variance-authority
|
202
|
+
```
|
128
203
|
|
129
204
|
<br />
|
130
205
|
|
131
|
-
##
|
206
|
+
## 🟢실행
|
207
|
+
|
208
|
+
- 개발모드 실행
|
209
|
+
|
210
|
+
```shell
|
211
|
+
npm run dev
|
212
|
+
```
|
213
|
+
|
214
|
+
- 스토리북 실행
|
215
|
+
|
216
|
+
```shell
|
217
|
+
npm run storybook
|
218
|
+
```
|
219
|
+
|
220
|
+
> 접속주소(포트 6006 사용 시): `http://localhost:6006`
|
221
|
+
|
222
|
+
- 크로마틱 배포
|
223
|
+
- 터미널에서 크로마틱으로 배포된 주소 확인 가능
|
224
|
+
|
225
|
+
```shell
|
226
|
+
npm run chromatic
|
227
|
+
```
|
132
228
|
|
133
|
-
|
229
|
+
- 빌드
|
230
|
+
- 패키지 배포없이 스토리북과 컴포넌트 빌드가 필요할때 사용
|
231
|
+
|
232
|
+
```shell
|
233
|
+
npm run build:all
|
234
|
+
```
|
235
|
+
|
236
|
+
<br />
|
237
|
+
|
238
|
+
## 🛠️배포
|
239
|
+
|
240
|
+
> NPM 패키지로 배포하는 과정
|
241
|
+
|
242
|
+
- npm 로그인하기
|
243
|
+
|
244
|
+
```shell
|
245
|
+
npm login
|
246
|
+
```
|
247
|
+
|
248
|
+
- npm scope 배포
|
249
|
+
- npm 로그인 후, 조직 생성 시 @계정명 으로 scope 생성
|
250
|
+
scope로 생성된 패키지는 npm publish 시, 아래 옵션 추가
|
251
|
+
|
252
|
+
```shell
|
253
|
+
npm publish --access=public
|
254
|
+
```
|
255
|
+
|
256
|
+
- package.json "version" 수정 후 배포
|
257
|
+
- 버전 표기법
|
258
|
+
- 메이저: 기능 대거 추가 및 수정
|
259
|
+
- 마이너: 작은 기능 추가 및 수정
|
260
|
+
- 패치: 버그나 사소한 오류 수정
|
261
|
+
|
262
|
+
<br />
|
263
|
+
|
264
|
+
- npm 패키지 배포는 아래 명령어를 이용
|
265
|
+
|
266
|
+
```shell
|
267
|
+
npm run publish:npm
|
268
|
+
```
|
269
|
+
|
270
|
+
- package.json 에서 명시된 아래 파일들만 배포됨
|
271
|
+
|
272
|
+
```
|
273
|
+
"files": [
|
274
|
+
"dist/lib",
|
275
|
+
"dist/tailwind.config.d.ts",
|
276
|
+
"dist/tailwind.config.js",
|
277
|
+
"dist/globals.css"
|
278
|
+
],
|
279
|
+
```
|
280
|
+
|
281
|
+
<br />
|
282
|
+
|
283
|
+
## 📁구조
|
284
|
+
|
285
|
+
#### 디렉토리 구조
|
286
|
+
|
287
|
+
```
|
288
|
+
📦dist : 컴파일 시 생성되며 NPM 패키지로 배포됨
|
289
|
+
📦src
|
290
|
+
┣ 📂app
|
291
|
+
┃ ┣ 📜layout.tsx
|
292
|
+
┃ ┣ 📜page.tsx
|
293
|
+
┃ ┣ 📜stories.css : 스토리북 관련 CSS 파일
|
294
|
+
┃ ┣ 📜globals.css
|
295
|
+
┃ ┗ 📜styles.css
|
296
|
+
┣ 📂lib : NPM 패키지 배포에 필요한 컴포넌트가 들어있는 폴더
|
297
|
+
┃ ┣ 📂Typography
|
298
|
+
┃ ┃ ┣ 📂Header
|
299
|
+
┃ ┃ ┣ 📂Text
|
300
|
+
┃ ┃ ┗ 📜index.ts
|
301
|
+
┃ ┣ 📂color : 컴포넌트에서 사용하는 컬러 관련 파일 모음 폴더
|
302
|
+
┃ ┃ ┣ 📜alpha.ts
|
303
|
+
┃ ┃ ┣ 📜constants.ts
|
304
|
+
┃ ┃ ┣ 📜dark.ts
|
305
|
+
┃ ┃ ┣ 📜krdsColors.ts
|
306
|
+
┃ ┃ ┗ 📜light.ts
|
307
|
+
┃ ┣ 📂components : 배포되는 컴포넌트들이 들어있는 폴더
|
308
|
+
┃ ┃ ┣ 📂Accordion
|
309
|
+
┃ ┃ ┣ 📂AlertDialog
|
310
|
+
┃ ┃ ┣ 📂AspectRatio
|
311
|
+
┃ ┃ ┣ ...
|
312
|
+
┃ ┃ ┣ 📂ToggleGroup
|
313
|
+
┃ ┃ ┣ 📂ToggleSwitch
|
314
|
+
┃ ┃ ┣ 📂Tooltip
|
315
|
+
┃ ┃ ┗ 📜index.ts
|
316
|
+
┃ ┣ 📂utils
|
317
|
+
┃ ┃ ┗ 📜utils.ts : 공통 유틸 함수
|
318
|
+
┃ ┣ 📜README.md : NPM 전용 README 파일
|
319
|
+
┣ 📂stories : 디자인 테스트를 위한 스토리북 폴더
|
320
|
+
┃ ┣ 📂accordion
|
321
|
+
┃ ┣ 📂alert-dialog
|
322
|
+
┃ ┣ 📂aspect-ratio
|
323
|
+
┃ ┣ 📂assets : 스토리북 관련 이미지 폴더
|
324
|
+
┃ ┣ ...
|
325
|
+
┃ ┣ 📂toggle
|
326
|
+
┃ ┣ 📂tooltip
|
327
|
+
┃ ┣ 📜DarkAlphaColors.mdx
|
328
|
+
┃ ┣ 📜DarkColors.mdx
|
329
|
+
┃ ┣ 📜LightAlphaColors.mdx
|
330
|
+
┃ ┣ 📜LightColors.mdx
|
331
|
+
┃ ┣ 📜Welcome.mdx
|
332
|
+
┃ ┗ 📜Welcome.tsx
|
333
|
+
┗ 📂utils : 패키지 배포에 필요한 함수 모음
|
334
|
+
┣ 📜move.js
|
335
|
+
┗ 📜post-publish.js
|
336
|
+
```
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lotte-innovate/ui-component-test",
|
3
3
|
"description": "Lotte UI Library",
|
4
|
-
"version": "0.0.
|
4
|
+
"version": "0.0.45",
|
5
5
|
"private": false,
|
6
6
|
"type": "module",
|
7
7
|
"files": [
|
@@ -48,10 +48,11 @@
|
|
48
48
|
"start": "next start",
|
49
49
|
"storybook": "cross-env NODE_OPTIONS='--max-old-space-size=8192' storybook dev -p 6006",
|
50
50
|
"chromatic": "cross-env npx chromatic --project-token=$CHROMATIC_PROJECT_TOKEN",
|
51
|
-
"compile": "tsc --jsx react-jsx
|
51
|
+
"compile": "tsc --jsx react-jsx",
|
52
52
|
"build": "next build && npm run compile",
|
53
53
|
"build:css": "npx tailwindcss -i src/app/globals.css -o dist/globals.css --minify",
|
54
54
|
"build-storybook": "storybook build",
|
55
|
+
"build:test": "rm -fr dist/* && tsc -p tsconfig.json && tsc -p tsconfig-cjs.json",
|
55
56
|
"clean": "rimraf dist && mkdir dist",
|
56
57
|
"update-tailwind": "node update-tailwind-import.js",
|
57
58
|
"build:all": "npm run clean && npm run compile && node src/utils/move.js && npm run build:css && tsc-alias && npm run update-tailwind",
|