@lotte-innovate/ui-component-test 0.2.87-beta.1 → 0.2.88

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.
Files changed (129) hide show
  1. package/README.md +225 -221
  2. package/dist/globals.css +4 -4
  3. package/dist/lib/Typography/Header/index.mjs +1 -1
  4. package/dist/lib/Typography/Text/index.mjs +1 -1
  5. package/dist/lib/components/Accordion/index.mjs +1 -1
  6. package/dist/lib/components/AlertDialog/AlertDialogRoot.mjs +1 -1
  7. package/dist/lib/components/AlertDialog/index.mjs.map +1 -1
  8. package/dist/lib/components/AspectRatio/index.mjs +1 -1
  9. package/dist/lib/components/Avatar/index.mjs +1 -1
  10. package/dist/lib/components/Badge/index.mjs +1 -1
  11. package/dist/lib/components/BarChart/index.mjs +1 -1
  12. package/dist/lib/components/Box/index.mjs +1 -1
  13. package/dist/lib/components/Box/index.mjs.map +1 -1
  14. package/dist/lib/components/Breadcrumb/index.mjs.map +1 -1
  15. package/dist/lib/components/BubbleChart/index.mjs +1 -1
  16. package/dist/lib/components/Button/index.mjs +1 -1
  17. package/dist/lib/components/Calendar/index.mjs +1 -1
  18. package/dist/lib/components/Callout/index.mjs.map +1 -1
  19. package/dist/lib/components/Card/index.mjs +1 -1
  20. package/dist/lib/components/Checkbox/index.mjs +1 -1
  21. package/dist/lib/components/CheckboxCard/index.mjs +1 -1
  22. package/dist/lib/components/CheckboxGroup/CheckboxGroupItem.mjs +1 -1
  23. package/dist/lib/components/CheckboxGroup/CheckboxGroupRoot.mjs +1 -1
  24. package/dist/lib/components/CheckboxGroup/index.mjs.map +1 -1
  25. package/dist/lib/components/Collapsible/index.mjs +1 -1
  26. package/dist/lib/components/Container/index.mjs +1 -1
  27. package/dist/lib/components/Container/index.mjs.map +1 -1
  28. package/dist/lib/components/ContextMenu/ContextMenuRoot.mjs +1 -1
  29. package/dist/lib/components/ContextMenu/index.mjs.map +1 -1
  30. package/dist/lib/components/DataList/index.mjs.map +1 -1
  31. package/dist/lib/components/Datepicker/index.mjs +1 -1
  32. package/dist/lib/components/DatetimePicker/index.mjs +1 -1
  33. package/dist/lib/components/Dialog/DialogRoot.mjs +1 -1
  34. package/dist/lib/components/Dialog/index.mjs.map +1 -1
  35. package/dist/lib/components/DoughnutChart/index.mjs +1 -1
  36. package/dist/lib/components/DropdownMenu/DropdownMenuRoot.mjs +1 -1
  37. package/dist/lib/components/DropdownMenu/index.mjs.map +1 -1
  38. package/dist/lib/components/Editor/index.mjs +1 -1
  39. package/dist/lib/components/Flex/index.mjs +1 -1
  40. package/dist/lib/components/Flex/index.mjs.map +1 -1
  41. package/dist/lib/components/Footer/index.js +1 -1
  42. package/dist/lib/components/Footer/index.mjs +1 -1
  43. package/dist/lib/components/Gnb/GnbLogo.js +1 -1
  44. package/dist/lib/components/Gnb/GnbLogo.mjs +1 -1
  45. package/dist/lib/components/Gnb/GnbLogo.mjs.map +1 -1
  46. package/dist/lib/components/Gnb/GnbMenu.js +1 -1
  47. package/dist/lib/components/Gnb/GnbMenu.mjs +1 -1
  48. package/dist/lib/components/Gnb/GnbMenuItem.js +1 -1
  49. package/dist/lib/components/Gnb/GnbMenuItem.mjs +1 -1
  50. package/dist/lib/components/Gnb/index.mjs.map +1 -1
  51. package/dist/lib/components/Grid/NumberingPagination.mjs +1 -1
  52. package/dist/lib/components/Grid/NumberingPagination.mjs.map +1 -1
  53. package/dist/lib/components/Grid/index.js +2 -1
  54. package/dist/lib/components/Grid/index.mjs +1 -1
  55. package/dist/lib/components/Grid/useGrid.js +3 -1
  56. package/dist/lib/components/Grid/useGrid.mjs +1 -1
  57. package/dist/lib/components/GridLayout/index.mjs +1 -1
  58. package/dist/lib/components/GridLayout/index.mjs.map +1 -1
  59. package/dist/lib/components/HoverCard/HoverCardRoot.mjs +1 -1
  60. package/dist/lib/components/HoverCard/index.mjs.map +1 -1
  61. package/dist/lib/components/IconButton/index.mjs +1 -1
  62. package/dist/lib/components/Inset/index.mjs +1 -1
  63. package/dist/lib/components/Label/index.mjs +1 -1
  64. package/dist/lib/components/LineChart/index.mjs +1 -1
  65. package/dist/lib/components/Menubar/MenubarRoot.mjs +1 -1
  66. package/dist/lib/components/Menubar/index.mjs.map +1 -1
  67. package/dist/lib/components/Modal/ModalTitle.mjs +1 -1
  68. package/dist/lib/components/Modal/index.mjs.map +1 -1
  69. package/dist/lib/components/NavigationMenu/NavigationMenuRoot.mjs +1 -1
  70. package/dist/lib/components/NavigationMenu/index.mjs.map +1 -1
  71. package/dist/lib/components/PieChart/index.mjs +1 -1
  72. package/dist/lib/components/Popover/index.mjs.map +1 -1
  73. package/dist/lib/components/Progress/index.mjs +1 -1
  74. package/dist/lib/components/RadarChart/index.mjs +1 -1
  75. package/dist/lib/components/Radio/index.mjs +1 -1
  76. package/dist/lib/components/RadioCards/RadioCardsRoot.mjs +1 -1
  77. package/dist/lib/components/RadioCards/index.mjs.map +1 -1
  78. package/dist/lib/components/RadioGroup/RadioGroupRoot.mjs +1 -1
  79. package/dist/lib/components/RadioGroup/index.mjs.map +1 -1
  80. package/dist/lib/components/ScrollArea/index.mjs +1 -1
  81. package/dist/lib/components/SearchBar/index.mjs +1 -1
  82. package/dist/lib/components/SegmentedControl/SegmentedControlRoot.mjs +1 -1
  83. package/dist/lib/components/SegmentedControl/index.mjs.map +1 -1
  84. package/dist/lib/components/Select/index.mjs +1 -1
  85. package/dist/lib/components/Separator/index.mjs +1 -1
  86. package/dist/lib/components/SideBar/index.mjs +1 -1
  87. package/dist/lib/components/Skeleton/index.mjs +1 -1
  88. package/dist/lib/components/Slider/index.mjs +1 -1
  89. package/dist/lib/components/Spinner/index.mjs +1 -1
  90. package/dist/lib/components/TabNav/index.mjs +1 -1
  91. package/dist/lib/components/Tabs/DynamicTabs.mjs +1 -1
  92. package/dist/lib/components/Tabs/index.mjs +1 -1
  93. package/dist/lib/components/TextArea/index.mjs +1 -1
  94. package/dist/lib/components/TextField/index.mjs +1 -1
  95. package/dist/lib/components/Timeline/TimelineRoot.mjs +1 -1
  96. package/dist/lib/components/Timeline/index.mjs.map +1 -1
  97. package/dist/lib/components/Toast/ToastActionButton.mjs +1 -1
  98. package/dist/lib/components/Toast/index.mjs.map +1 -1
  99. package/dist/lib/components/Toggle/ToggleWithText.mjs +1 -1
  100. package/dist/lib/components/Toggle/index.mjs +1 -1
  101. package/dist/lib/components/ToggleGroup/ToggleGroupRoot.mjs +1 -1
  102. package/dist/lib/components/ToggleGroup/index.mjs.map +1 -1
  103. package/dist/lib/components/ToggleSwitch/index.mjs +1 -1
  104. package/dist/lib/components/Tooltip/index.mjs +1 -1
  105. package/dist/lib/components/Tree/index.mjs +1 -1
  106. package/dist/lib/index.mjs +1 -1
  107. package/dist/lib/node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.mjs +2 -0
  108. package/dist/lib/node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.mjs.map +1 -0
  109. package/dist/lib/node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.mjs +2 -0
  110. package/dist/lib/node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.mjs.map +1 -0
  111. package/dist/lib/node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.mjs +2 -0
  112. package/dist/lib/node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.mjs.map +1 -0
  113. package/dist/lib/node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.mjs +2 -0
  114. package/dist/lib/node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.mjs.map +1 -0
  115. package/dist/lib/node_modules/date-fns/esm/locale/ko/_lib/formatDistance/index.mjs +2 -0
  116. package/dist/lib/node_modules/date-fns/esm/locale/ko/_lib/formatDistance/index.mjs.map +1 -0
  117. package/dist/lib/node_modules/date-fns/esm/locale/ko/_lib/formatLong/index.mjs +2 -0
  118. package/dist/lib/node_modules/date-fns/esm/locale/ko/_lib/formatLong/index.mjs.map +1 -0
  119. package/dist/lib/node_modules/date-fns/esm/locale/ko/_lib/formatRelative/index.mjs +2 -0
  120. package/dist/lib/node_modules/date-fns/esm/locale/ko/_lib/formatRelative/index.mjs.map +1 -0
  121. package/dist/lib/node_modules/date-fns/esm/locale/ko/_lib/localize/index.mjs +2 -0
  122. package/dist/lib/node_modules/date-fns/esm/locale/ko/_lib/localize/index.mjs.map +1 -0
  123. package/dist/lib/node_modules/date-fns/esm/locale/ko/_lib/match/index.mjs +2 -0
  124. package/dist/lib/node_modules/date-fns/esm/locale/ko/_lib/match/index.mjs.map +1 -0
  125. package/dist/lib/node_modules/date-fns/esm/locale/ko/index.mjs +2 -0
  126. package/dist/lib/node_modules/date-fns/esm/locale/ko/index.mjs.map +1 -0
  127. package/dist/lib/tsconfig.tsbuildinfo +1 -1
  128. package/dist/tsconfig.tsbuildinfo +1 -1
  129. package/package.json +151 -155
package/README.md CHANGED
@@ -1,221 +1,225 @@
1
- # LOTTE UI COMPONENT LIBRARY
2
-
3
- <br />
4
-
5
- ## 목차
6
-
7
- - [Introduction](#introduction)
8
- - [Installation](#installation)
9
- - [Setup](#setup)
10
- - [Usage](#usage)
11
- - [Components](#components)
12
- - [Theme](#theme)
13
- - [License](#license)
14
-
15
- ## Introduction
16
-
17
- 모든 L-UI 구성 요소를 내보내는 단일 패키지입니다.
18
-
19
- 일관되고 통일된 컴포넌트를 제공하며 사용자 정의 및 재사용 가능합니다.
20
-
21
- 이 라이브러리는 React로 구축된 프로젝트를 지원합니다.
22
-
23
- ## Installation
24
-
25
- 패키지를 설치하기 위해 아래 명령어를 사용합니다.
26
-
27
- ```bash
28
- npm i @lotte-innovate/lui
29
- ```
30
-
31
- ## Setup
32
-
33
- 패키지를 설치한 후 css 스타일을 프로젝트로 가져옵니다.
34
-
35
- 프로젝트 App 진입 파일에 다음 줄을 추가해줍니다.
36
-
37
- ```javascript
38
- import '@lotte-innovate/lui/dist/globals.css';
39
- ```
40
-
41
- ## Usage
42
-
43
- React 프로젝트에서 컴포넌트를 사용하는 방법에 대한 예시입니다.
44
-
45
- ```tsx
46
- import React from 'react';
47
- import { Button } from '@lotte-innovate/lui';
48
-
49
- const App = () => {
50
- return (
51
- <div>
52
- <Button onClick={() => alert('Button clicked!')}>Click Me</Button>
53
- </div>
54
- );
55
- };
56
-
57
- export default App;
58
- ```
59
-
60
- 컴포넌트에서 아이콘을 사용하려면, 다음과 같은 방법으로 아이콘을 가져올 수 있습니다.
61
-
62
- ```tsx
63
- import React from 'react';
64
- import { IconButton } from '@lotte-innovate/lui';
65
- import { MagnifyingGlassIcon } from '@radix-ui/react-icons';
66
-
67
- const App = () => {
68
- return (
69
- <div>
70
- <IconButton>
71
- <MagnifyingGlassIcon />
72
- </IconButton>
73
- </div>
74
- );
75
- };
76
-
77
- export default App;
78
- ```
79
-
80
- ## Components
81
-
82
- <br />
83
-
84
- <details>
85
- <summary>컴포넌트 목록</summary>
86
-
87
- | 구분 | 종류 |
88
- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
89
- | Typography 컴포넌트 | Header, Text |
90
- | 기본 컴포넌트 | Avatar, Badge, Button, IconButton, Label |
91
- | 입력 컴포넌트 | DatePicker, DatetimePicker, Editor, Slider, TextArea, TextField |
92
- | 선택 컴포넌트 | Checkbox, CheckboxCards, CheckboxGroup, Radio, RadioCards, RadioGroup, Select, Toggle, ToggleGroup, ToggleSwitch |
93
- | 네비게이션 컴포넌트 | Breadcrumb, DynamicTabs, GNB, Menubar, NavigationMenu, SNB, Tab Nav, Tabs |
94
- | 레이아웃 컴포넌트 | AspectRatio, Box, Card, Collapsible, Container, Flex, Footer, Grid, GridLayout, Inset, ScrollArea, Separator, Table, Timeline |
95
- | 피드백 컴포넌트 | AlertDialog, Dialog, HoverCard, Modal, Popover, Toast, Tooltip |
96
- | 로딩 컴포넌트 | Progress, Skeleton, Spinner |
97
- | 메뉴 선택 컴포넌트 | ContextMenu, DropdownMenu, SegmentedControl |
98
- | 컴포넌트 | Accordian, Callout, DataList, SearchBar |
99
-
100
- </details>
101
- <details>
102
- <summary>차트 목록</summary>
103
-
104
- | 구분 | 종류 |
105
- | --------- | ------------- |
106
- | 비교 차트 | Bar, Line |
107
- | 구성 차트 | Pie, Doughnut |
108
- | 분포 차트 | Bubble |
109
- | 관계 차트 | Radar |
110
-
111
- </details>
112
-
113
- <details>
114
- <summary>공통 Props 목록</summary>
115
-
116
- | name | description | 단계 | option | 테마적용여부 |
117
- | ---------- | ------------------------------------------------- | -------- | --------------------------------------------- | ------------ |
118
- | Color | 27가지 색상을 라이트/다크/알파/알파다크 모드 제공 | 1~12단계 | blue, crimson, teal, orange, purple, amber... | O |
119
- | Radius | 컴포넌트의 둥글기 적용 | 5단계 | none, small, medium, large, full | O |
120
- | Scaling | 컴포넌트의 비율 | 5단계 | 90%, 95%, 100%, 105%, 110% | O |
121
- | Weight | 컴포넌트의 텍스트 굵기 | 4단계 | regular, medium, semibold, bold | O |
122
- | Appearance | 컴포넌트의 디자인 스타일 | 6단계 | classic, ghost, outline, soft, solid, surface | X |
123
- | Size | 컴포넌트의 크기 | 5단계 | x-small, small, medium, large, x-large | X |
124
-
125
- </details>
126
-
127
- <br />
128
-
129
- ## Theme
130
-
131
- 컴포넌트들은 공통 Props를 개별적으로 적용할 수도 있고, 테마를 통해 컴포넌트의 스타일을 한번에 변경할 수도 있습니다.
132
-
133
- L-UI는 테마 컨텍스트를 제공하여 `Color`, `Radius`, `Scaling`, `Weight` 를 모든 컴포넌트에 동일한 스타일을 지정할 수 있습니다..
134
-
135
- 먼저 App 최상단에 `LuiThemeProvider`를 추가하여 테마 컨텍스트를 제공합니다.
136
-
137
- > Next.js와 같은 프레임워크를 사용하는 프로젝트에서 사용 예시
138
-
139
- ```tsx
140
- import { LuiThemeProvider } from '@lotte-innovate/lui';
141
-
142
- export default function RootLayout({
143
- children,
144
- }: Readonly<{
145
- children: React.ReactNode;
146
- }>) {
147
- return (
148
- <html lang="en" className="bg-white">
149
- <body>
150
- <LuiThemeProvider>{children}</LuiThemeProvider>
151
- </body>
152
- </html>
153
- );
154
- }
155
- ```
156
-
157
- > 클라이언트 사이드 프로젝트에서 사용 예시
158
-
159
- ```tsx
160
- import { LuiThemeProvider } from '@lotte-innovate/lui';
161
-
162
- const root = ReactDOM.createRoot(document.getElementById('root'));
163
- root.render(
164
- <LuiThemeProvider>
165
- <App />
166
- </LuiThemeProvider>,
167
- );
168
- ```
169
-
170
- 테마를 변경하려면 `useTheme`훅을 사용합니다.
171
-
172
- `useTheme`훅은 현재 테마와 테마를 업데이트할 수 있는 함수를 제공합니다.
173
-
174
- ```tsx
175
- import { useTheme, Button } from '@lotte-innovate/lui';
176
-
177
- const ThemeChanger = () => {
178
- const { theme, updateTheme } = useTheme();
179
-
180
- // 초기 값 설정 시
181
- theme.themeRadius = 'none';
182
- theme.themeColor = 'olive';
183
- theme.themeScaling = '90%';
184
- theme.themeWeight = 'regular';
185
-
186
- // 테마 변경 시
187
- updateTheme({ themeRadius: 'full', themeColor: 'amber', themeScaling: '110%' });
188
-
189
- return (
190
- <div>
191
- <Button>버튼</Button>
192
- </div>
193
- );
194
- };
195
- ```
196
-
197
- 테마가 적용되었지만 일부 컴포넌트는 스타일을 다르게 하고 싶은 경우, 각 컴포넌트에 직접 Props를 전달하여 스타일을 재정의할 수 있습니다.
198
-
199
- ```tsx
200
- import { useTheme, Button } from '@lotte-innovate/lui';
201
-
202
- const ThemeChanger = () => {
203
- const { theme } = useTheme();
204
-
205
- theme.themeRadius: 'full';
206
- theme.themeColor: 'blue';
207
-
208
- return (
209
- <div>
210
- <Button>테마 적용 버튼</Button>
211
- <Button radius="none" color="crimson">테마 미적용 버튼</Button>
212
- </div>
213
- );
214
- };
215
- ```
216
-
217
- <br />
218
-
219
- ## License
220
-
221
- @lotte-innovate
1
+ # LOTTE UI COMPONENT LIBRARY
2
+
3
+ <br />
4
+
5
+ ## 목차
6
+
7
+ - [Introduction](#introduction)
8
+ - [Installation](#installation)
9
+ - [Setup](#setup)
10
+ - [Usage](#usage)
11
+ - [Components](#components)
12
+ - [Theme](#theme)
13
+ - [License](#license)
14
+
15
+ ## Introduction
16
+
17
+ 모든 L-UI 구성 요소를 내보내는 단일 패키지입니다.
18
+
19
+ 일관되고 통일된 컴포넌트를 제공하며 사용자 정의 및 재사용 가능합니다.
20
+
21
+ 이 라이브러리는 React로 구축된 프로젝트를 지원합니다.
22
+
23
+ ## Installation
24
+
25
+ 패키지를 설치하기 위해 아래 명령어를 사용합니다.
26
+
27
+ ```bash
28
+ npm i @lotte-innovate/lui
29
+ ```
30
+
31
+ ```bash
32
+ yarn add @lotte-innovate/lui
33
+ ```
34
+
35
+ ## Setup
36
+
37
+ 패키지를 설치한 후 css 스타일을 프로젝트로 가져옵니다.
38
+
39
+ 프로젝트 App 진입 파일에 다음 줄을 추가해줍니다.
40
+
41
+ ```javascript
42
+ import '@lotte-innovate/lui/dist/globals.css';
43
+ ```
44
+
45
+ ## Usage
46
+
47
+ React 프로젝트에서 컴포넌트를 사용하는 방법에 대한 예시입니다.
48
+
49
+ ```tsx
50
+ import React from 'react';
51
+ import { Button } from '@lotte-innovate/lui';
52
+
53
+ const App = () => {
54
+ return (
55
+ <div>
56
+ <Button onClick={() => alert('Button clicked!')}>Click Me</Button>
57
+ </div>
58
+ );
59
+ };
60
+
61
+ export default App;
62
+ ```
63
+
64
+ 컴포넌트에서 아이콘을 사용하려면, 다음과 같은 방법으로 아이콘을 가져올 수 있습니다.
65
+
66
+ ```tsx
67
+ import React from 'react';
68
+ import { IconButton } from '@lotte-innovate/lui';
69
+ import { MagnifyingGlassIcon } from '@radix-ui/react-icons';
70
+
71
+ const App = () => {
72
+ return (
73
+ <div>
74
+ <IconButton>
75
+ <MagnifyingGlassIcon />
76
+ </IconButton>
77
+ </div>
78
+ );
79
+ };
80
+
81
+ export default App;
82
+ ```
83
+
84
+ ## Components
85
+
86
+ <br />
87
+
88
+ <details>
89
+ <summary>컴포넌트 목록</summary>
90
+
91
+ | 구분 | 종류 |
92
+ | ------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
93
+ | Typography 컴포넌트 | Header, Text |
94
+ | 기본 컴포넌트 | Avatar, Badge, Button, IconButton, Label |
95
+ | 입력 컴포넌트 | DatePicker, DatetimePicker, Editor, Slider, TextArea, TextField |
96
+ | 선택 컴포넌트 | Checkbox, CheckboxCards, CheckboxGroup, Radio, RadioCards, RadioGroup, Select, Toggle, ToggleGroup, ToggleSwitch |
97
+ | 네비게이션 컴포넌트 | Breadcrumb, DynamicTabs, GNB, Menubar, NavigationMenu, SNB, Tab Nav, Tabs |
98
+ | 레이아웃 컴포넌트 | AspectRatio, Box, Card, Collapsible, Container, Flex, Footer, Grid, GridLayout, Inset, ScrollArea, Separator, Table, Timeline |
99
+ | 피드백 컴포넌트 | AlertDialog, Dialog, HoverCard, Modal, Popover, Toast, Tooltip |
100
+ | 로딩 컴포넌트 | Progress, Skeleton, Spinner |
101
+ | 메뉴 선택 컴포넌트 | ContextMenu, DropdownMenu, SegmentedControl |
102
+ | 그 외 컴포넌트 | Accordian, Callout, DataList, SearchBar |
103
+
104
+ </details>
105
+ <details>
106
+ <summary>차트 목록</summary>
107
+
108
+ | 구분 | 종류 |
109
+ | --------- | ------------- |
110
+ | 비교 차트 | Bar, Line |
111
+ | 구성 차트 | Pie, Doughnut |
112
+ | 분포 차트 | Bubble |
113
+ | 관계 차트 | Radar |
114
+
115
+ </details>
116
+
117
+ <details>
118
+ <summary>공통 Props 목록</summary>
119
+
120
+ | name | description | 단계 | option | 테마적용여부 |
121
+ | ---------- | ------------------------------------------------- | -------- | --------------------------------------------- | ------------ |
122
+ | Color | 27가지 색상을 라이트/다크/알파/알파다크 모드 제공 | 1~12단계 | blue, crimson, teal, orange, purple, amber... | O |
123
+ | Radius | 컴포넌트의 둥글기 적용 | 5단계 | none, small, medium, large, full | O |
124
+ | Scaling | 컴포넌트의 비율 | 5단계 | 90%, 95%, 100%, 105%, 110% | O |
125
+ | Weight | 컴포넌트의 텍스트 굵기 | 4단계 | regular, medium, semibold, bold | O |
126
+ | Appearance | 컴포넌트의 디자인 스타일 | 6단계 | classic, ghost, outline, soft, solid, surface | X |
127
+ | Size | 컴포넌트의 크기 | 5단계 | x-small, small, medium, large, x-large | X |
128
+
129
+ </details>
130
+
131
+ <br />
132
+
133
+ ## Theme
134
+
135
+ 컴포넌트들은 공통 Props를 개별적으로 적용할 수도 있고, 테마를 통해 컴포넌트의 스타일을 한번에 변경할 수도 있습니다.
136
+
137
+ L-UI는 테마 컨텍스트를 제공하여 `Color`, `Radius`, `Scaling`, `Weight` 를 모든 컴포넌트에 동일한 스타일을 지정할 수 있습니다..
138
+
139
+ 먼저 App 최상단에 `LuiThemeProvider`를 추가하여 테마 컨텍스트를 제공합니다.
140
+
141
+ > Next.js와 같은 프레임워크를 사용하는 프로젝트에서 사용 예시
142
+
143
+ ```tsx
144
+ import { LuiThemeProvider } from '@lotte-innovate/lui';
145
+
146
+ export default function RootLayout({
147
+ children,
148
+ }: Readonly<{
149
+ children: React.ReactNode;
150
+ }>) {
151
+ return (
152
+ <html lang="en" className="bg-white">
153
+ <body>
154
+ <LuiThemeProvider>{children}</LuiThemeProvider>
155
+ </body>
156
+ </html>
157
+ );
158
+ }
159
+ ```
160
+
161
+ > 클라이언트 사이드 프로젝트에서 사용 예시
162
+
163
+ ```tsx
164
+ import { LuiThemeProvider } from '@lotte-innovate/lui';
165
+
166
+ const root = ReactDOM.createRoot(document.getElementById('root'));
167
+ root.render(
168
+ <LuiThemeProvider>
169
+ <App />
170
+ </LuiThemeProvider>,
171
+ );
172
+ ```
173
+
174
+ 테마를 변경하려면 `useTheme`훅을 사용합니다.
175
+
176
+ `useTheme`훅은 현재 테마와 테마를 업데이트할 수 있는 함수를 제공합니다.
177
+
178
+ ```tsx
179
+ import { useTheme, Button } from '@lotte-innovate/lui';
180
+
181
+ const ThemeChanger = () => {
182
+ const { theme, updateTheme } = useTheme();
183
+
184
+ // 초기 값 설정 시
185
+ theme.themeRadius = 'none';
186
+ theme.themeColor = 'olive';
187
+ theme.themeScaling = '90%';
188
+ theme.themeWeight = 'regular';
189
+
190
+ // 테마 변경 시
191
+ updateTheme({ themeRadius: 'full', themeColor: 'amber', themeScaling: '110%' });
192
+
193
+ return (
194
+ <div>
195
+ <Button>버튼</Button>
196
+ </div>
197
+ );
198
+ };
199
+ ```
200
+
201
+ 테마가 적용되었지만 일부 컴포넌트는 스타일을 다르게 하고 싶은 경우, 각 컴포넌트에 직접 Props를 전달하여 스타일을 재정의할 수 있습니다.
202
+
203
+ ```tsx
204
+ import { useTheme, Button } from '@lotte-innovate/lui';
205
+
206
+ const ThemeChanger = () => {
207
+ const { theme } = useTheme();
208
+
209
+ theme.themeRadius: 'full';
210
+ theme.themeColor: 'blue';
211
+
212
+ return (
213
+ <div>
214
+ <Button>테마 적용 버튼</Button>
215
+ <Button radius="none" color="crimson">테마 미적용 버튼</Button>
216
+ </div>
217
+ );
218
+ };
219
+ ```
220
+
221
+ <br />
222
+
223
+ ## License
224
+
225
+ @lotte-innovate