@lotte-innovate/ui-component-test 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +163 -163
- package/dist/Typography/Header/index.d.ts +1 -1
- package/dist/Typography/Header/index.jsx +4 -4
- package/dist/Typography/Text/index.jsx +4 -4
- package/dist/Typography/index.d.ts +2 -2
- package/dist/Typography/index.js +2 -3
- package/dist/app/layout.jsx +2 -2
- package/dist/app/page.d.ts +1 -1
- package/dist/app/page.jsx +6 -39
- package/dist/app/template/colorPicker.d.ts +1 -1
- package/dist/app/template/colorPicker.jsx +7 -7
- package/dist/app/template/theme.jsx +6 -33
- package/dist/components/Accordion/index.jsx +13 -13
- package/dist/components/AlertDialog/AlertDialogAction.jsx +3 -3
- package/dist/components/AlertDialog/AlertDialogCancel.jsx +3 -3
- package/dist/components/AlertDialog/AlertDialogContent.jsx +6 -6
- package/dist/components/AlertDialog/AlertDialogDescription.jsx +3 -3
- package/dist/components/AlertDialog/AlertDialogTitle.jsx +3 -3
- package/dist/components/AlertDialog/AlertDialogTrigger.jsx +3 -3
- package/dist/components/AlertDialog/index.jsx +4 -2
- package/dist/components/AspectRatio/index.jsx +3 -3
- package/dist/components/Avatar/index.jsx +6 -6
- package/dist/components/Badge/index.jsx +2 -2
- package/dist/components/BubbleChart/index.jsx +1 -1
- package/dist/components/Button/index.jsx +3 -3
- package/dist/components/Callout/CalloutIcon.jsx +7 -7
- package/dist/components/Callout/CalloutText.jsx +3 -3
- package/dist/components/Callout/index.jsx +5 -5
- package/dist/components/Card/index.jsx +3 -3
- package/dist/components/Checkbox/index.jsx +10 -10
- package/dist/components/CheckboxCard/index.jsx +4 -4
- package/dist/components/CheckboxGroup/CheckboxGroupItem.jsx +4 -4
- package/dist/components/CheckboxGroup/index.jsx +5 -5
- package/dist/components/ContextMenu/ContextMenuCheckboxItem.jsx +6 -6
- package/dist/components/ContextMenu/ContextMenuContent.jsx +5 -5
- package/dist/components/ContextMenu/ContextMenuGroup.jsx +2 -2
- package/dist/components/ContextMenu/ContextMenuItem.jsx +4 -4
- package/dist/components/ContextMenu/ContextMenuItemIndicator.jsx +3 -3
- package/dist/components/ContextMenu/ContextMenuLabel.jsx +3 -3
- package/dist/components/ContextMenu/ContextMenuRadioGroup.jsx +4 -4
- package/dist/components/ContextMenu/ContextMenuRadioItem.jsx +6 -6
- package/dist/components/ContextMenu/ContextMenuSeparator.jsx +3 -3
- package/dist/components/ContextMenu/ContextMenuSubContent.jsx +6 -6
- package/dist/components/ContextMenu/ContextMenuSubTrigger.jsx +8 -8
- package/dist/components/ContextMenu/ContextMenuTrigger.jsx +3 -3
- package/dist/components/ContextMenu/index.jsx +5 -3
- package/dist/components/DataList/DataListItem.jsx +3 -3
- package/dist/components/DataList/DataListLabel.jsx +3 -3
- package/dist/components/DataList/DataListValue.jsx +3 -3
- package/dist/components/DataList/index.jsx +5 -5
- package/dist/components/Dialog/DialogAction.jsx +3 -3
- package/dist/components/Dialog/DialogCancel.jsx +3 -3
- package/dist/components/Dialog/DialogContent.jsx +3 -3
- package/dist/components/Dialog/DialogDescription.jsx +3 -3
- package/dist/components/Dialog/DialogSlot.jsx +3 -3
- package/dist/components/Dialog/DialogTitle.jsx +3 -3
- package/dist/components/Dialog/DialogTrigger.jsx +2 -2
- package/dist/components/Dialog/index.jsx +2 -2
- package/dist/components/DoughnutChart/index.jsx +1 -1
- package/dist/components/DropdownMenu/DropdonMenuRadioGroup.jsx +4 -4
- package/dist/components/DropdownMenu/DropdonMenuSubContent.jsx +5 -5
- package/dist/components/DropdownMenu/DropdownMenuCheckboxItem.jsx +6 -6
- package/dist/components/DropdownMenu/DropdownMenuContent.jsx +5 -5
- package/dist/components/DropdownMenu/DropdownMenuItem.jsx +4 -4
- package/dist/components/DropdownMenu/DropdownMenuItemIndicator.jsx +3 -3
- package/dist/components/DropdownMenu/DropdownMenuLable.jsx +3 -3
- package/dist/components/DropdownMenu/DropdownMenuRadioItem.jsx +6 -6
- package/dist/components/DropdownMenu/DropdownMenuSeparator.jsx +1 -1
- package/dist/components/DropdownMenu/DropdownMenuSubTrigger.jsx +5 -5
- package/dist/components/DropdownMenu/DropdownMenuTrigger.jsx +2 -2
- package/dist/components/HoverCard/HoverCardContent.jsx +2 -2
- package/dist/components/HoverCard/HoverCardTrigger.jsx +2 -2
- package/dist/components/HoverCard/index.jsx +2 -2
- package/dist/components/IconButton/index.jsx +2 -2
- package/dist/components/Inset/index.jsx +4 -4
- package/dist/components/Label/index.jsx +2 -2
- package/dist/components/Menubar/MenubarCheckboxItem.jsx +6 -6
- package/dist/components/Menubar/MenubarContent.jsx +5 -5
- package/dist/components/Menubar/MenubarItem.jsx +4 -4
- package/dist/components/Menubar/MenubarItemIndicator.jsx +3 -3
- package/dist/components/Menubar/MenubarRadioGroup.jsx +4 -4
- package/dist/components/Menubar/MenubarRadioItem.jsx +6 -6
- package/dist/components/Menubar/MenubarSeparator.jsx +3 -3
- package/dist/components/Menubar/MenubarSubContent.jsx +3 -3
- package/dist/components/Menubar/MenubarSubTrigger.jsx +6 -6
- package/dist/components/Menubar/MenubarTrigger.jsx +3 -3
- package/dist/components/Menubar/index.jsx +5 -5
- package/dist/components/NavigationMenu/NavigationMenuContent.jsx +3 -3
- package/dist/components/NavigationMenu/NavigationMenuIndicator.jsx +4 -4
- package/dist/components/NavigationMenu/NavigationMenuItem.jsx +2 -2
- package/dist/components/NavigationMenu/NavigationMenuLink.jsx +3 -3
- package/dist/components/NavigationMenu/NavigationMenuList.jsx +4 -4
- package/dist/components/NavigationMenu/NavigationMenuTrigger.jsx +4 -4
- package/dist/components/NavigationMenu/NavigationMenuViewport.jsx +3 -3
- package/dist/components/NavigationMenu/index.jsx +5 -5
- package/dist/components/PieChart/index.jsx +1 -1
- package/dist/components/Popover/PopoverClose.jsx +2 -2
- package/dist/components/Popover/PopoverContent.jsx +2 -2
- package/dist/components/Popover/PopoverTrigger.jsx +2 -2
- package/dist/components/Popover/index.jsx +2 -2
- package/dist/components/Progress/index.jsx +2 -2
- package/dist/components/Radio/index.jsx +7 -7
- package/dist/components/RadioCards/RadioCardsItem.jsx +2 -2
- package/dist/components/RadioCards/index.jsx +4 -4
- package/dist/components/RadioGroup/RadioGroupItem.jsx +2 -2
- package/dist/components/RadioGroup/index.jsx +4 -4
- package/dist/components/ScrollArea/index.jsx +4 -4
- package/dist/components/SegmentedControl/SegmentedControlItem.jsx +2 -2
- package/dist/components/SegmentedControl/index.jsx +4 -4
- package/dist/components/Select/index.jsx +20 -18
- package/dist/components/Separator/index.jsx +5 -5
- package/dist/components/Skeleton/index.jsx +5 -5
- package/dist/components/Slider/index.jsx +3 -3
- package/dist/components/Spinner/index.jsx +4 -4
- package/dist/components/TabNav/index.jsx +6 -6
- package/dist/components/Table/index.d.ts +2 -1
- package/dist/components/Table/index.jsx +17 -17
- package/dist/components/Tabs/index.jsx +10 -10
- package/dist/components/TextArea/index.jsx +2 -2
- package/dist/components/TextField/index.jsx +7 -7
- package/dist/components/Toast/ToastActionButton.jsx +3 -3
- package/dist/components/Toast/ToastDescription.jsx +5 -5
- package/dist/components/Toast/ToastTitle.jsx +3 -3
- package/dist/components/Toast/index.jsx +8 -8
- package/dist/components/Toggle/ToggleWithText.jsx +3 -3
- package/dist/components/Toggle/index.jsx +2 -2
- package/dist/components/ToggleGroup/index.jsx +4 -4
- package/dist/components/ToggleGroup/toggleGroupItem.jsx +2 -2
- package/dist/components/ToggleSwitch/index.jsx +5 -5
- package/dist/components/Tooltip/index.d.ts +1 -1
- package/dist/components/Tooltip/index.jsx +11 -11
- package/dist/components/index.d.ts +0 -2
- package/dist/index.d.ts +2 -5
- package/dist/index.js +0 -3
- package/dist/stories/Welcome.jsx +19 -19
- package/dist/stories/accordion/Accordion.stories.jsx +19 -19
- package/dist/stories/alert-dialog/AlertDialog.stories.jsx +14 -14
- package/dist/stories/aspect-ratio/AspectRatio.stories.jsx +29 -29
- package/dist/stories/avatar/Avatar.stories.jsx +12 -12
- package/dist/stories/badge/Badge.stories.jsx +44 -44
- package/dist/stories/bubble-chart/BubbleChart.stories.jsx +9 -9
- package/dist/stories/button/Button.stories.jsx +34 -34
- package/dist/stories/button/IconButton.stories.jsx +14 -14
- package/dist/stories/callout/Callout.stories.jsx +107 -107
- package/dist/stories/card/Card.stories.jsx +51 -51
- package/dist/stories/checkbox/Checkbox.stories.jsx +57 -57
- package/dist/stories/checkbox/CheckboxCard.stories.jsx +36 -36
- package/dist/stories/checkbox/CheckboxGroup.stories.jsx +73 -73
- package/dist/stories/context-menu/ContextMenu.stories.jsx +70 -70
- package/dist/stories/data-list/DataList.stories.jsx +102 -102
- package/dist/stories/dialog/Dialog.stories.jsx +24 -24
- package/dist/stories/doughnut-chart/DoughnutChart.stories.jsx +9 -9
- package/dist/stories/dropdown-menu/DropdownMenu.stories.jsx +96 -96
- package/dist/stories/header/Header.stories.jsx +20 -20
- package/dist/stories/hover-card/HoverCard.stories.jsx +28 -28
- package/dist/stories/inset/Inset.stories.jsx +16 -16
- package/dist/stories/label/Label.stories.jsx +22 -22
- package/dist/stories/menubar/Menubar.stories.jsx +38 -38
- package/dist/stories/navigation-menu/NavigationMenu.stories.d.ts +11 -11
- package/dist/stories/navigation-menu/NavigationMenu.stories.jsx +67 -67
- package/dist/stories/pie-chart/PieChart.stories.jsx +20 -20
- package/dist/stories/popover/Popover.stories.jsx +34 -34
- package/dist/stories/progress/Progress.stories.jsx +6 -6
- package/dist/stories/radio/Radio.stories.jsx +11 -11
- package/dist/stories/radio/RadioCards.stories.jsx +60 -60
- package/dist/stories/radio/RadioGroup.stories.jsx +55 -55
- package/dist/stories/scroll-area/ScrollArea.stories.jsx +61 -61
- package/dist/stories/segmented-control/SegmentedControl.stories.jsx +22 -22
- package/dist/stories/select/Select.stories.jsx +62 -62
- package/dist/stories/separator/Separator.stories.jsx +25 -25
- package/dist/stories/skeleton/Skeleton.stories.jsx +28 -28
- package/dist/stories/slider/Slider.stories.jsx +12 -12
- package/dist/stories/spinner/Spinner.stories.jsx +26 -26
- package/dist/stories/switch/Switch.stories.jsx +12 -12
- package/dist/stories/tab-nav/TabNav.stories.jsx +10 -10
- package/dist/stories/table/Table.stories.jsx +28 -28
- package/dist/stories/tabs/Tabs.stories.jsx +18 -18
- package/dist/stories/text/Text.stories.jsx +16 -16
- package/dist/stories/textArea/TextArea.stories.jsx +17 -17
- package/dist/stories/textfield/TextField.stories.jsx +33 -33
- package/dist/stories/toast/Toast.stories.jsx +19 -19
- package/dist/stories/toggle/Toggle.stories.jsx +18 -18
- package/dist/stories/toggle/ToggleGroup.stories.jsx +34 -34
- package/dist/stories/tooltip/Tooltip.stories.jsx +14 -14
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +120 -118
- package/dist/app/template/badgeTemplate.d.ts +0 -12
- package/dist/app/template/badgeTemplate.jsx +0 -82
- package/dist/app/template/buttonTemplate.d.ts +0 -12
- package/dist/app/template/buttonTemplate.jsx +0 -82
- package/dist/app/template/textTemplate.d.ts +0 -11
- package/dist/app/template/textTemplate.jsx +0 -72
package/README.md
CHANGED
@@ -1,163 +1,163 @@
|
|
1
|
-
# radix-ui 라이브러리 활용 Storybook UI Component 만들기
|
2
|
-
|
3
|
-
<br />
|
4
|
-
|
5
|
-
## 사전 설치 라이브러리
|
6
|
-
|
7
|
-
- radix-ui
|
8
|
-
- 주요 컴포넌트 사용 시 활용할 Headless UI 라이브러리
|
9
|
-
|
10
|
-
```shell
|
11
|
-
npm install @radix-ui/react-popover@latest -E
|
12
|
-
```
|
13
|
-
|
14
|
-
- storybook
|
15
|
-
- 컴포넌트 관리를 위해 사용
|
16
|
-
|
17
|
-
```shell
|
18
|
-
npx sb init
|
19
|
-
npx storybook@latest add @storybook/addon-styling-webpack
|
20
|
-
```
|
21
|
-
|
22
|
-
- clsx
|
23
|
-
- 조건부 className 작성을 위해 사용
|
24
|
-
|
25
|
-
```shell
|
26
|
-
npm i clsx
|
27
|
-
```
|
28
|
-
|
29
|
-
- tailwind-merge
|
30
|
-
- 스타일 충돌 없이 자바스크립트에서 tailwind CSS 클래스를 효율적으로 병합하는 기능을 가진 라이브러리
|
31
|
-
|
32
|
-
```shell
|
33
|
-
npm i tailwind-merge
|
34
|
-
```
|
35
|
-
|
36
|
-
- class-variance-authority (CVA)
|
37
|
-
- 일관성 있는 UI를 정의하고 사용할 수 있도록 도와주는 툴로써 shadcn/ui 컴포넌트의 핵심 도구
|
38
|
-
|
39
|
-
```shell
|
40
|
-
npm i class-variance-authority
|
41
|
-
```
|
42
|
-
|
43
|
-
<br />
|
44
|
-
|
45
|
-
## 실행
|
46
|
-
|
47
|
-
- 스토리북 실행
|
48
|
-
|
49
|
-
```shell
|
50
|
-
npm run storybook
|
51
|
-
```
|
52
|
-
|
53
|
-
> 접속주소(포트 6006 사용 시): `http://localhost:6006`
|
54
|
-
|
55
|
-
- 웹페이지 실행
|
56
|
-
|
57
|
-
```shell
|
58
|
-
npm run dev
|
59
|
-
```
|
60
|
-
|
61
|
-
> 접속주소(포트 3000 사용 시): `http://localhost:3000`
|
62
|
-
|
63
|
-
## package publish
|
64
|
-
|
65
|
-
- 타입스크립트 컴파일
|
66
|
-
|
67
|
-
```shell
|
68
|
-
npm run publish:npm
|
69
|
-
```
|
70
|
-
|
71
|
-
- npm package 배포 시
|
72
|
-
|
73
|
-
- npm 로그인
|
74
|
-
|
75
|
-
```shell
|
76
|
-
npm login
|
77
|
-
```
|
78
|
-
|
79
|
-
- package.json 버전 수정 후 컴파일 진행
|
80
|
-
|
81
|
-
```shell
|
82
|
-
npm run publish:npm
|
83
|
-
```
|
84
|
-
|
85
|
-
- 패키지 배포
|
86
|
-
|
87
|
-
```shell
|
88
|
-
npm publish
|
89
|
-
```
|
90
|
-
|
91
|
-
- npm scope 배포
|
92
|
-
- npm 로그인 후, 조직 생성 시 @계정명 으로 scope 생성
|
93
|
-
scope로 생성된 패키지는 npm publish 시, 아래 옵션 추가
|
94
|
-
|
95
|
-
```shell
|
96
|
-
npm publish --access=public
|
97
|
-
```
|
98
|
-
|
99
|
-
|
100
|
-
- npm package 미배포시
|
101
|
-
|
102
|
-
- package.json 버전 수정 후 컴파일 진행
|
103
|
-
|
104
|
-
```shell
|
105
|
-
npm run publish:npm
|
106
|
-
```
|
107
|
-
|
108
|
-
- dist/ 파일 및 설정파일 추출 후 전달
|
109
|
-
|
110
|
-
## 사용자 이용 방법
|
111
|
-
|
112
|
-
### npm 배포 시
|
113
|
-
|
114
|
-
- npm package 설치
|
115
|
-
|
116
|
-
```sh
|
117
|
-
npm install <package_name>
|
118
|
-
```
|
119
|
-
|
120
|
-
### npm 미배포시
|
121
|
-
|
122
|
-
- 전달 받은 package 모듈 파일을 node_modules/ 폴더에 추가
|
123
|
-
|
124
|
-
### tailwind 설정 방법
|
125
|
-
|
126
|
-
- tailwind config 파일 설정
|
127
|
-
|
128
|
-
```js
|
129
|
-
// tailwind.config.ts
|
130
|
-
import type { Config } from 'tailwindcss';
|
131
|
-
// UI 라이브러리 tailwind config 파일 호출
|
132
|
-
// >>>>>>>> 추가
|
133
|
-
const packageTailwindConfig = require('ui-component-test/tailwind.config.js');
|
134
|
-
// >>>>>>>>
|
135
|
-
|
136
|
-
const config: Config = {
|
137
|
-
content: [
|
138
|
-
'./src/pages/**/*.{js,ts,jsx,tsx,mdx,zip}',
|
139
|
-
'./src/components/**/*.{js,ts,jsx,tsx,mdx,zip}',
|
140
|
-
'./src/app/**/*.{js,ts,jsx,tsx,mdx,zip}',
|
141
|
-
// 해당 프로젝트 css 표준 컴포넌트에 적용 가능
|
142
|
-
// >>>>>>>> 추가
|
143
|
-
'./node_modules/ui-component-test/**/*.{js,ts,jsx,tsx,mdx,zip}',
|
144
|
-
// >>>>>>>>
|
145
|
-
],
|
146
|
-
theme: {
|
147
|
-
extend: {
|
148
|
-
backgroundImage: {
|
149
|
-
'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))',
|
150
|
-
'gradient-conic': 'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))',
|
151
|
-
},
|
152
|
-
colors: {},
|
153
|
-
// UI 라이브러리 tailwind config 파일 적용
|
154
|
-
// >>>>>>>> 추가
|
155
|
-
...packageTailwindConfig?.theme?.extend,
|
156
|
-
// >>>>>>>>
|
157
|
-
},
|
158
|
-
},
|
159
|
-
plugins: [],
|
160
|
-
};
|
161
|
-
export default config;
|
162
|
-
|
163
|
-
```
|
1
|
+
# radix-ui 라이브러리 활용 Storybook UI Component 만들기
|
2
|
+
|
3
|
+
<br />
|
4
|
+
|
5
|
+
## 사전 설치 라이브러리
|
6
|
+
|
7
|
+
- radix-ui
|
8
|
+
- 주요 컴포넌트 사용 시 활용할 Headless UI 라이브러리
|
9
|
+
|
10
|
+
```shell
|
11
|
+
npm install @radix-ui/react-popover@latest -E
|
12
|
+
```
|
13
|
+
|
14
|
+
- storybook
|
15
|
+
- 컴포넌트 관리를 위해 사용
|
16
|
+
|
17
|
+
```shell
|
18
|
+
npx sb init
|
19
|
+
npx storybook@latest add @storybook/addon-styling-webpack
|
20
|
+
```
|
21
|
+
|
22
|
+
- clsx
|
23
|
+
- 조건부 className 작성을 위해 사용
|
24
|
+
|
25
|
+
```shell
|
26
|
+
npm i clsx
|
27
|
+
```
|
28
|
+
|
29
|
+
- tailwind-merge
|
30
|
+
- 스타일 충돌 없이 자바스크립트에서 tailwind CSS 클래스를 효율적으로 병합하는 기능을 가진 라이브러리
|
31
|
+
|
32
|
+
```shell
|
33
|
+
npm i tailwind-merge
|
34
|
+
```
|
35
|
+
|
36
|
+
- class-variance-authority (CVA)
|
37
|
+
- 일관성 있는 UI를 정의하고 사용할 수 있도록 도와주는 툴로써 shadcn/ui 컴포넌트의 핵심 도구
|
38
|
+
|
39
|
+
```shell
|
40
|
+
npm i class-variance-authority
|
41
|
+
```
|
42
|
+
|
43
|
+
<br />
|
44
|
+
|
45
|
+
## 실행
|
46
|
+
|
47
|
+
- 스토리북 실행
|
48
|
+
|
49
|
+
```shell
|
50
|
+
npm run storybook
|
51
|
+
```
|
52
|
+
|
53
|
+
> 접속주소(포트 6006 사용 시): `http://localhost:6006`
|
54
|
+
|
55
|
+
- 웹페이지 실행
|
56
|
+
|
57
|
+
```shell
|
58
|
+
npm run dev
|
59
|
+
```
|
60
|
+
|
61
|
+
> 접속주소(포트 3000 사용 시): `http://localhost:3000`
|
62
|
+
|
63
|
+
## package publish
|
64
|
+
|
65
|
+
- 타입스크립트 컴파일
|
66
|
+
|
67
|
+
```shell
|
68
|
+
npm run publish:npm
|
69
|
+
```
|
70
|
+
|
71
|
+
- npm package 배포 시
|
72
|
+
|
73
|
+
- npm 로그인
|
74
|
+
|
75
|
+
```shell
|
76
|
+
npm login
|
77
|
+
```
|
78
|
+
|
79
|
+
- package.json 버전 수정 후 컴파일 진행
|
80
|
+
|
81
|
+
```shell
|
82
|
+
npm run publish:npm
|
83
|
+
```
|
84
|
+
|
85
|
+
- 패키지 배포
|
86
|
+
|
87
|
+
```shell
|
88
|
+
npm publish
|
89
|
+
```
|
90
|
+
|
91
|
+
- npm scope 배포
|
92
|
+
- npm 로그인 후, 조직 생성 시 @계정명 으로 scope 생성
|
93
|
+
scope로 생성된 패키지는 npm publish 시, 아래 옵션 추가
|
94
|
+
|
95
|
+
```shell
|
96
|
+
npm publish --access=public
|
97
|
+
```
|
98
|
+
|
99
|
+
|
100
|
+
- npm package 미배포시
|
101
|
+
|
102
|
+
- package.json 버전 수정 후 컴파일 진행
|
103
|
+
|
104
|
+
```shell
|
105
|
+
npm run publish:npm
|
106
|
+
```
|
107
|
+
|
108
|
+
- dist/ 파일 및 설정파일 추출 후 전달
|
109
|
+
|
110
|
+
## 사용자 이용 방법
|
111
|
+
|
112
|
+
### npm 배포 시
|
113
|
+
|
114
|
+
- npm package 설치
|
115
|
+
|
116
|
+
```sh
|
117
|
+
npm install <package_name>
|
118
|
+
```
|
119
|
+
|
120
|
+
### npm 미배포시
|
121
|
+
|
122
|
+
- 전달 받은 package 모듈 파일을 node_modules/ 폴더에 추가
|
123
|
+
|
124
|
+
### tailwind 설정 방법
|
125
|
+
|
126
|
+
- tailwind config 파일 설정
|
127
|
+
|
128
|
+
```js
|
129
|
+
// tailwind.config.ts
|
130
|
+
import type { Config } from 'tailwindcss';
|
131
|
+
// UI 라이브러리 tailwind config 파일 호출
|
132
|
+
// >>>>>>>> 추가
|
133
|
+
const packageTailwindConfig = require('ui-component-test/tailwind.config.js');
|
134
|
+
// >>>>>>>>
|
135
|
+
|
136
|
+
const config: Config = {
|
137
|
+
content: [
|
138
|
+
'./src/pages/**/*.{js,ts,jsx,tsx,mdx,zip}',
|
139
|
+
'./src/components/**/*.{js,ts,jsx,tsx,mdx,zip}',
|
140
|
+
'./src/app/**/*.{js,ts,jsx,tsx,mdx,zip}',
|
141
|
+
// 해당 프로젝트 css 표준 컴포넌트에 적용 가능
|
142
|
+
// >>>>>>>> 추가
|
143
|
+
'./node_modules/ui-component-test/**/*.{js,ts,jsx,tsx,mdx,zip}',
|
144
|
+
// >>>>>>>>
|
145
|
+
],
|
146
|
+
theme: {
|
147
|
+
extend: {
|
148
|
+
backgroundImage: {
|
149
|
+
'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))',
|
150
|
+
'gradient-conic': 'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))',
|
151
|
+
},
|
152
|
+
colors: {},
|
153
|
+
// UI 라이브러리 tailwind config 파일 적용
|
154
|
+
// >>>>>>>> 추가
|
155
|
+
...packageTailwindConfig?.theme?.extend,
|
156
|
+
// >>>>>>>>
|
157
|
+
},
|
158
|
+
},
|
159
|
+
plugins: [],
|
160
|
+
};
|
161
|
+
export default config;
|
162
|
+
|
163
|
+
```
|
@@ -6,7 +6,7 @@ export interface HeaderProps extends VariantProps<typeof headerVariants> {
|
|
6
6
|
}
|
7
7
|
declare let headerVariants: (props?: ({
|
8
8
|
weight?: "medium" | "regular" | "semibold" | "bold" | null | undefined;
|
9
|
-
headers?: "
|
9
|
+
headers?: "h2" | "h3" | "h1" | "h4" | "h5" | "h6" | null | undefined;
|
10
10
|
color?: string | null | undefined;
|
11
11
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
12
12
|
export declare const Header: React.ForwardRefExoticComponent<Omit<import("@radix-ui/themes").HeadingProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & HeaderProps & React.RefAttributes<HTMLHeadingElement>>;
|
@@ -48,10 +48,10 @@ export var Header = React.forwardRef(function (_a, ref) {
|
|
48
48
|
var className = _a.className, children = _a.children, size = _a.size, weight = _a.weight, color = _a.color, headers = _a.headers, align = _a.align, rootProps = __rest(_a, ["className", "children", "size", "weight", "color", "headers", "align"]);
|
49
49
|
if (!headers)
|
50
50
|
headers = 'h1';
|
51
|
-
return (<Theme>
|
52
|
-
<HeadingTheme ref={ref} as={headers} size={size} align={align} className={cn('leading-normal', headerVariants({ weight: weight, color: color }), className)} {...rootProps}>
|
53
|
-
{children}
|
54
|
-
</HeadingTheme>
|
51
|
+
return (<Theme>
|
52
|
+
<HeadingTheme ref={ref} as={headers} size={size} align={align} className={cn('leading-normal', headerVariants({ weight: weight, color: color }), className)} {...rootProps}>
|
53
|
+
{children}
|
54
|
+
</HeadingTheme>
|
55
55
|
</Theme>);
|
56
56
|
});
|
57
57
|
Header.displayName = 'Header';
|
@@ -37,10 +37,10 @@ var textVariants = cva('text', {
|
|
37
37
|
});
|
38
38
|
export var Text = forwardRef(function (_a, ref) {
|
39
39
|
var className = _a.className, children = _a.children, as = _a.as, align = _a.align, weight = _a.weight, color = _a.color, size = _a.size, props = __rest(_a, ["className", "children", "as", "align", "weight", "color", "size"]);
|
40
|
-
return (<Theme>
|
41
|
-
<TextTheme as={as} ref={ref} size={size} align={align} className={cn(textVariants({ weight: weight, color: color }), className)} {...props}>
|
42
|
-
{children}
|
43
|
-
</TextTheme>
|
40
|
+
return (<Theme>
|
41
|
+
<TextTheme as={as} ref={ref} size={size} align={align} className={cn(textVariants({ weight: weight, color: color }), className)} {...props}>
|
42
|
+
{children}
|
43
|
+
</TextTheme>
|
44
44
|
</Theme>);
|
45
45
|
});
|
46
46
|
Text.displayName = 'Text';
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export { default as Header } from './Header';
|
2
|
-
export { default as Text } from './Text';
|
1
|
+
export { default as Header } from './Header';
|
2
|
+
export { default as Text } from './Text';
|
package/dist/Typography/index.js
CHANGED
@@ -1,3 +1,2 @@
|
|
1
|
-
|
2
|
-
export { default as
|
3
|
-
export { default as Text } from '../Typography/Text';
|
1
|
+
export { default as Header } from './Header';
|
2
|
+
export { default as Text } from './Text';
|
package/dist/app/layout.jsx
CHANGED
@@ -7,7 +7,7 @@ export var metadata = {
|
|
7
7
|
};
|
8
8
|
export default function RootLayout(_a) {
|
9
9
|
var children = _a.children;
|
10
|
-
return (<html lang="en">
|
11
|
-
<body className={inter.className}>{children}</body>
|
10
|
+
return (<html lang="en">
|
11
|
+
<body className={inter.className}>{children}</body>
|
12
12
|
</html>);
|
13
13
|
}
|
package/dist/app/page.d.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
export default function Home():
|
2
|
+
export default function Home(): React.JSX.Element;
|
package/dist/app/page.jsx
CHANGED
@@ -1,42 +1,9 @@
|
|
1
1
|
'use client';
|
2
|
-
import React
|
3
|
-
import
|
4
|
-
import BadgeTemplate from './template/badgeTemplate';
|
5
|
-
import ButtonTemplate from './template/buttonTemplate';
|
6
|
-
import TextTemplate from './template/textTemplate';
|
7
|
-
import Button from 'components/Button';
|
8
|
-
import { Toast, ToastActionButton, ToastDescription } from 'components/Toast';
|
2
|
+
import React from 'react';
|
3
|
+
// import { Button, IconButton } from '@lotte-innovate/ui-component-test';
|
9
4
|
export default function Home() {
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
var _e = useState('blue'), fontColorTheme = _e[0], setFontColorTheme = _e[1];
|
15
|
-
var _f = useState('light'), mode = _f[0], setMode = _f[1];
|
16
|
-
var _g = useState(false), mounted = _g[0], setMounted = _g[1];
|
17
|
-
var _h = useState(false), open = _h[0], setOpen = _h[1];
|
18
|
-
useEffect(function () {
|
19
|
-
setMounted(true);
|
20
|
-
}, []);
|
21
|
-
return (mounted && (<div className={"flex flex-col w-full h-auto min-h-screen ".concat(mode == 'light' ? 'bg-white text-black' : 'bg-black text-white', " p-3")}>
|
22
|
-
<div onClick={function () {
|
23
|
-
setMode(mode === 'light' ? 'dark' : 'light');
|
24
|
-
}}>
|
25
|
-
{mode === 'light' ? 'light' : 'dark'}
|
26
|
-
</div>
|
27
|
-
<Button onClick={function () { return setOpen(true); }} className="w-[200px]" scaling={'95%'}>
|
28
|
-
toast
|
29
|
-
</Button>
|
30
|
-
<Toast openToast={open} setOpenToast={setOpen}>
|
31
|
-
<ToastDescription>There was a problem with your request.</ToastDescription>
|
32
|
-
<ToastActionButton altText="액션버튼">버튼</ToastActionButton>
|
33
|
-
</Toast>
|
34
|
-
<Theme setRadiusTheme={setRadiusTheme} setScalingTheme={setScalingTheme} setFontWeightTheme={setFontWeightTheme} setColorTheme={setColorTheme} setFontColorTheme={setFontColorTheme} mode={mode}/>
|
35
|
-
|
36
|
-
<BadgeTemplate radiusTheme={radiusTheme} scalingTheme={scalingTheme} fontWeightTheme={fontWeightTheme} colorTheme={colorTheme} mode={mode}/>
|
37
|
-
|
38
|
-
<ButtonTemplate radiusTheme={radiusTheme} scalingTheme={scalingTheme} fontWeightTheme={fontWeightTheme} colorTheme={colorTheme} mode={mode}/>
|
39
|
-
|
40
|
-
<TextTemplate scalingTheme={scalingTheme} fontWeightTheme={fontWeightTheme} colorTheme={fontColorTheme} mode={mode}/>
|
41
|
-
</div>));
|
5
|
+
return (<div className="flex m-2">
|
6
|
+
{/* <Button>버튼</Button> */}
|
7
|
+
{/* <IconButton /> */}
|
8
|
+
</div>);
|
42
9
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import { IColor } from 'types';
|
3
|
-
declare const ColorPicker: ({ setColorTheme,
|
3
|
+
declare const ColorPicker: ({ setColorTheme, }: {
|
4
4
|
setColorTheme: (color: IColor) => void;
|
5
5
|
mode: string;
|
6
6
|
}) => import("react").JSX.Element;
|
@@ -1,19 +1,19 @@
|
|
1
1
|
'use client';
|
2
2
|
import { bgColorStyle } from '../../constants';
|
3
3
|
var ColorPicker = function (_a) {
|
4
|
-
var setColorTheme = _a.setColorTheme
|
4
|
+
var setColorTheme = _a.setColorTheme;
|
5
5
|
var handleColorClick = function (color) {
|
6
6
|
setColorTheme(color);
|
7
7
|
};
|
8
|
-
return (<div>
|
9
|
-
<div className="flex flex-row flex-wrap gap-2">
|
8
|
+
return (<div>
|
9
|
+
<div className="flex flex-row flex-wrap gap-2">
|
10
10
|
{Object.entries(bgColorStyle).map(function (_a) {
|
11
11
|
var key = _a[0], value = _a[1];
|
12
|
-
return (<button className={"w-12 p-2 rounded-full text-xs cursor-pointer hover:border-gray-900 ".concat(value, " text-white hover:text-black")} key={key}>
|
13
|
-
{key.replace('Dark', '')}
|
12
|
+
return (<button className={"w-12 p-2 rounded-full text-xs cursor-pointer hover:border-gray-900 ".concat(value, " text-white hover:text-black")} key={key}>
|
13
|
+
{key.replace('Dark', '')}
|
14
14
|
</button>);
|
15
|
-
})}
|
16
|
-
</div>
|
15
|
+
})}
|
16
|
+
</div>
|
17
17
|
</div>);
|
18
18
|
};
|
19
19
|
export default ColorPicker;
|
@@ -1,44 +1,17 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import ColorPicker from './colorPicker';
|
3
|
-
import { radiusOptions, scalingOptions, weightOptions } from '../../constants';
|
4
3
|
var Theme = function (_a) {
|
5
4
|
var setRadiusTheme = _a.setRadiusTheme, setScalingTheme = _a.setScalingTheme, setFontWeightTheme = _a.setFontWeightTheme, setColorTheme = _a.setColorTheme, setFontColorTheme = _a.setFontColorTheme, mode = _a.mode;
|
6
5
|
var setColor = function (color) {
|
7
6
|
setColorTheme(color);
|
8
7
|
setFontColorTheme(color);
|
9
8
|
};
|
10
|
-
return (<div className="flex flex-col p-3">
|
11
|
-
<p className="text-2xl font-bold">Themes</p>
|
12
|
-
<div className="flex flex-col text-xl gap-2">
|
13
|
-
Accent Color
|
14
|
-
<ColorPicker mode={mode} setColorTheme={setColor}/>
|
15
|
-
</div>
|
16
|
-
<div className="flex gap-4">
|
17
|
-
<div className="flex gap-2">
|
18
|
-
<p>Radius</p>
|
19
|
-
<select className="border border-gray-900" onChange={function (e) { return setRadiusTheme(e.target.value); }} defaultValue={'full'}>
|
20
|
-
{radiusOptions.map(function (item) { return (<option key={item} value={item}>
|
21
|
-
{item}
|
22
|
-
</option>); })}
|
23
|
-
</select>
|
24
|
-
</div>
|
25
|
-
<div className="flex gap-2">
|
26
|
-
<p>Scaling</p>
|
27
|
-
<select className="border border-gray-900" onChange={function (e) { return setScalingTheme(e.target.value); }}>
|
28
|
-
{scalingOptions.map(function (item) { return (<option key={item} value={item}>
|
29
|
-
{item}
|
30
|
-
</option>); })}
|
31
|
-
</select>
|
32
|
-
</div>
|
33
|
-
<div className="flex gap-2">
|
34
|
-
<p>Font Weight</p>
|
35
|
-
<select className="border border-gray-900" onChange={function (e) { return setFontWeightTheme(e.target.value); }} defaultValue={'semibold'}>
|
36
|
-
{weightOptions.map(function (item) { return (<option key={item} value={item}>
|
37
|
-
{item}
|
38
|
-
</option>); })}
|
39
|
-
</select>
|
40
|
-
</div>
|
41
|
-
</div>
|
9
|
+
return (<div className="flex flex-col p-3">
|
10
|
+
<p className="text-2xl font-bold">Themes</p>
|
11
|
+
<div className="flex flex-col text-xl gap-2">
|
12
|
+
Accent Color
|
13
|
+
<ColorPicker mode={mode} setColorTheme={setColor}/>
|
14
|
+
</div>
|
42
15
|
</div>);
|
43
16
|
};
|
44
17
|
export default Theme;
|
@@ -36,34 +36,34 @@ var accoridanVariants = cva('', {
|
|
36
36
|
});
|
37
37
|
export var Accordion = React.forwardRef(function (_a, forwardedRef) {
|
38
38
|
var className = _a.className, children = _a.children, scaling = _a.scaling, rootProps = __rest(_a, ["className", "children", "scaling"]);
|
39
|
-
return (<AccordionPrimitive.Root className={cn('w-[280px] rounded-md border border-slateA-4 dark:border-slateDarkA-4', accoridanVariants({ scaling: scaling }), className)} {...rootProps} ref={forwardedRef}>
|
40
|
-
{children}
|
39
|
+
return (<AccordionPrimitive.Root className={cn('w-[280px] rounded-md border border-slateA-4 dark:border-slateDarkA-4', accoridanVariants({ scaling: scaling }), className)} {...rootProps} ref={forwardedRef}>
|
40
|
+
{children}
|
41
41
|
</AccordionPrimitive.Root>);
|
42
42
|
});
|
43
43
|
Accordion.displayName = 'AccordionRoot';
|
44
44
|
export var AccordionItem = React.forwardRef(function (_a, forwardedRef) {
|
45
45
|
var className = _a.className, children = _a.children, rootProps = __rest(_a, ["className", "children"]);
|
46
|
-
return (<AccordionPrimitive.Item {...rootProps} ref={forwardedRef} className={cn('w-[278px] mt-px overflow-hidden first:mt-0 first:rounded-t last:rounded-b ', className)}>
|
47
|
-
{children}
|
46
|
+
return (<AccordionPrimitive.Item {...rootProps} ref={forwardedRef} className={cn('w-[278px] mt-px overflow-hidden first:mt-0 first:rounded-t last:rounded-b ', className)}>
|
47
|
+
{children}
|
48
48
|
</AccordionPrimitive.Item>);
|
49
49
|
});
|
50
50
|
AccordionItem.displayName = 'AccordionItem';
|
51
51
|
export var AccordionTrigger = React.forwardRef(function (_a, forwardedRef) {
|
52
52
|
var className = _a.className, children = _a.children, _b = _a.color, color = _b === void 0 ? 'red' : _b, rootProps = __rest(_a, ["className", "children", "color"]);
|
53
|
-
return (<AccordionPrimitive.Header {...rootProps} className={cn('flex', className)}>
|
54
|
-
<AccordionPrimitive.Trigger {...rootProps} ref={forwardedRef} className={cn(" w-[278px] group flex h-[44px] cursor-default items-center justify-between py-[10px] px-[20px] text-base font-normal ", "dark:bg-[#111113] text-".concat(color, "A-11 dark:text-").concat(color, "Dark-11 "), "hover:bg-".concat(color, "A-4 dark:hover:bg-").concat(color, "Dark-4 hover:text-").concat(color, "A-11 dark:hover:text-").concat(color, "DarkA-11"), "data-[state=open]:bg-".concat(color, "A-5 dark:data-[state=open]:bg-").concat(color, "DarkA-5"), "disabled:bg-slateA-3 disabled:dark:bg-slateDarkA-3 disabled:text-slateA-3 disabled:dark:text-slateDarkA-8", className)}>
|
55
|
-
{children}
|
56
|
-
<ChevronDownIcon className="ease-[cubic-bezier(0.87,_0,_0.13,_1)] transition-transform duration-300 group-data-[state=open]:rotate-180" aria-hidden/>
|
57
|
-
</AccordionPrimitive.Trigger>
|
53
|
+
return (<AccordionPrimitive.Header {...rootProps} className={cn('flex', className)}>
|
54
|
+
<AccordionPrimitive.Trigger {...rootProps} ref={forwardedRef} className={cn(" w-[278px] group flex h-[44px] cursor-default items-center justify-between py-[10px] px-[20px] text-base font-normal ", "dark:bg-[#111113] text-".concat(color, "A-11 dark:text-").concat(color, "Dark-11 "), "hover:bg-".concat(color, "A-4 dark:hover:bg-").concat(color, "Dark-4 hover:text-").concat(color, "A-11 dark:hover:text-").concat(color, "DarkA-11"), "data-[state=open]:bg-".concat(color, "A-5 dark:data-[state=open]:bg-").concat(color, "DarkA-5"), "disabled:bg-slateA-3 disabled:dark:bg-slateDarkA-3 disabled:text-slateA-3 disabled:dark:text-slateDarkA-8", className)}>
|
55
|
+
{children}
|
56
|
+
<ChevronDownIcon className="ease-[cubic-bezier(0.87,_0,_0.13,_1)] transition-transform duration-300 group-data-[state=open]:rotate-180" aria-hidden/>
|
57
|
+
</AccordionPrimitive.Trigger>
|
58
58
|
</AccordionPrimitive.Header>);
|
59
59
|
});
|
60
60
|
AccordionTrigger.displayName = 'AccordionTrigger';
|
61
61
|
export var AccordionContent = React.forwardRef(function (_a, forwardedRef) {
|
62
62
|
var className = _a.className, children = _a.children, rootProps = __rest(_a, ["className", "children"]);
|
63
|
-
return (<AccordionPrimitive.Content {...rootProps} ref={forwardedRef} className={cn('w-[278px] max-h-[800px] bg-slateA-2 dark:bg-slateDarkA-2 border-t border-t-slateA-4 dark:border-t-slateDarkA-4 text-slateA-11 dark:text-slateDarkA-11 data-[state=open]:animate-slideDown data-[state=closed]:animate-slideUp overflow-hidden text-[16px]', className)}>
|
64
|
-
<div className="px-[20px] py-[15px] text-base font-normal h-auto max-h-[1000px] overflow-y-auto">
|
65
|
-
{children}
|
66
|
-
</div>
|
63
|
+
return (<AccordionPrimitive.Content {...rootProps} ref={forwardedRef} className={cn('w-[278px] max-h-[800px] bg-slateA-2 dark:bg-slateDarkA-2 border-t border-t-slateA-4 dark:border-t-slateDarkA-4 text-slateA-11 dark:text-slateDarkA-11 data-[state=open]:animate-slideDown data-[state=closed]:animate-slideUp overflow-hidden text-[16px]', className)}>
|
64
|
+
<div className="px-[20px] py-[15px] text-base font-normal h-auto max-h-[1000px] overflow-y-auto">
|
65
|
+
{children}
|
66
|
+
</div>
|
67
67
|
</AccordionPrimitive.Content>);
|
68
68
|
});
|
69
69
|
AccordionContent.displayName = 'AccordionContent';
|
@@ -23,7 +23,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
23
23
|
import React, { forwardRef } from 'react';
|
24
24
|
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
25
25
|
import { cva } from 'class-variance-authority';
|
26
|
-
import { cn } from '
|
26
|
+
import { cn } from 'utils/utils';
|
27
27
|
import { appearanceStyle, primaryColorStyle, weightVariants } from '../../constants';
|
28
28
|
export var alertDialogActionVariants = cva("inline-flex items-center justify-center px-[15px] outline-none focus:shadow-[0_0_0_2px] font-normal", {
|
29
29
|
variants: {
|
@@ -53,8 +53,8 @@ export var alertDialogActionVariants = cva("inline-flex items-center justify-cen
|
|
53
53
|
export var AlertDialogAction = forwardRef(function (_a, ref) {
|
54
54
|
var className = _a.className, children = _a.children, radius = _a.radius, weight = _a.weight, size = _a.size, _b = _a.color, color = _b === void 0 ? 'red' : _b, _c = _a.appearance, appearance = _c === void 0 ? 'solid' : _c, props = __rest(_a, ["className", "children", "radius", "weight", "size", "color", "appearance"]);
|
55
55
|
var buttonClassName = cn(alertDialogActionVariants({ radius: radius, size: size, weight: weight, color: color }), appearanceStyle(appearance, color), className);
|
56
|
-
return (<AlertDialogPrimitive.Action ref={ref} className={buttonClassName} {...props}>
|
57
|
-
{children}
|
56
|
+
return (<AlertDialogPrimitive.Action ref={ref} className={buttonClassName} {...props}>
|
57
|
+
{children}
|
58
58
|
</AlertDialogPrimitive.Action>);
|
59
59
|
});
|
60
60
|
AlertDialogAction.displayName = 'AlertDialogAction';
|
@@ -23,7 +23,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
23
23
|
import React, { forwardRef } from 'react';
|
24
24
|
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
25
25
|
import { cva } from 'class-variance-authority';
|
26
|
-
import { cn } from '
|
26
|
+
import { cn } from 'utils/utils';
|
27
27
|
import { weightVariants } from '../../constants';
|
28
28
|
export var alertDialogCancelVariants = cva("inline-flex justify-center items-center text-slate-11 bg-slate-3 outline-none border-none\n dark:text-slateDark-11 dark:bg-slateDark-3 dark:hover:bg-slateDarkA-4\n active:border-none hover:cursor-pointer hover:bg-slateA-4", {
|
29
29
|
variants: {
|
@@ -50,8 +50,8 @@ export var alertDialogCancelVariants = cva("inline-flex justify-center items-cen
|
|
50
50
|
});
|
51
51
|
export var AlertDialogCancel = forwardRef(function (_a, ref) {
|
52
52
|
var className = _a.className, children = _a.children, radius = _a.radius, size = _a.size, weight = _a.weight, _b = _a.appearance, appearance = _b === void 0 ? 'solid' : _b, props = __rest(_a, ["className", "children", "radius", "size", "weight", "appearance"]);
|
53
|
-
return (<AlertDialogPrimitive.Cancel ref={ref} {...props} className={cn(alertDialogCancelVariants({ radius: radius, size: size, weight: weight }), className)}>
|
54
|
-
{children}
|
53
|
+
return (<AlertDialogPrimitive.Cancel ref={ref} {...props} className={cn(alertDialogCancelVariants({ radius: radius, size: size, weight: weight }), className)}>
|
54
|
+
{children}
|
55
55
|
</AlertDialogPrimitive.Cancel>);
|
56
56
|
});
|
57
57
|
AlertDialogCancel.displayName = 'AlertDialogCancel';
|