Skip to content

Commit e2cf90e

Browse files
authored
Merge pull request #55 from ssi02014/dev
chore: esbuild 추가 및 buttonIcon props 제거
2 parents 27d8818 + 4e21274 commit e2cf90e

File tree

11 files changed

+1284
-329
lines changed

11 files changed

+1284
-329
lines changed

.github/workflows/npm-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- name: Node Setup 🔔
1313
uses: actions/setup-node@v3
1414
with:
15-
node-version: 18
15+
node-version: 20
1616
registry-url: 'https://registry.npmjs.org'
1717
- name: Install & Build 🔨
1818
run: |

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20

README.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,6 @@ import iconImage from '../assets/colorImage.png';
120120
const App = () => {
121121
return (
122122
<ThumbnailGenerator
123-
buttonIcon={<img src={iconImage} width={30} height={30} alt="iconImage" />}
124-
// To insert the inner icon of the button that opens the thumbnail modal, use the ReactNode.
125-
// If you do not include this option, the default icon will be used.
126-
127123
iconSize="medium"
128124
// Through this property, you can specify the size of the button icon.
129125
// However, if you are inserting a custom button icon, this option is meaningless.
@@ -159,7 +155,6 @@ const App = () => {
159155
<html lang="en">
160156
<head>
161157
<!-- ... -->
162-
163158
<!-- Add a web font -->
164159
<link rel="preconnect" href="https://fonts.googleapis.com" />
165160
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
@@ -192,14 +187,9 @@ const App = () => {
192187
}
193188
```
194189

195-
<br />
196190
<br />
197191

198192
## API 📄
199-
- buttonIcon
200-
- **Optional**
201-
- Default: <img width="43" alt="스크린샷 2023-02-20 오후 10 48 05" src="https://user-images.githubusercontent.com/64779472/220125380-77aaaa79-9baf-4252-aa46-a44e6e91dd3d.png">
202-
- Type: `ReactNode`
203193
- iconPosition
204194
- **Optional**
205195
- Sequence: [top, right, bottom, left]

package.json

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,11 @@
4242
"@emotion/babel-preset-css-prop": "^11.11.0",
4343
"@emotion/react": "^11.11.1",
4444
"@emotion/styled": "^11.11.0",
45-
"@rollup/plugin-alias": "^5.0.0",
46-
"@rollup/plugin-babel": "^6.0.3",
47-
"@rollup/plugin-commonjs": "^25.0.0",
48-
"@rollup/plugin-node-resolve": "^15.1.0",
49-
"@rollup/plugin-terser": "^0.4.3",
50-
"@rollup/plugin-typescript": "^11.1.1",
45+
"@rollup/plugin-alias": "^5.1.0",
46+
"@rollup/plugin-commonjs": "^25.0.7",
47+
"@rollup/plugin-node-resolve": "^15.2.3",
48+
"@rollup/plugin-terser": "^0.4.4",
49+
"@rollup/plugin-typescript": "^11.1.6",
5150
"@storybook/addon-actions": "^7.0.18",
5251
"@storybook/addon-essentials": "^7.0.18",
5352
"@storybook/addon-interactions": "^7.0.18",
@@ -63,6 +62,7 @@
6362
"@typescript-eslint/eslint-plugin": "^5.59.9",
6463
"@typescript-eslint/parser": "^5.59.9",
6564
"core-js": "^3.29.1",
65+
"esbuild": "^0.21.1",
6666
"eslint": "^8.34.0",
6767
"eslint-config-prettier": "^8.6.0",
6868
"eslint-plugin-react": "^7.32.2",
@@ -75,7 +75,8 @@
7575
"react-color-palette": "^6.2.0",
7676
"react-dom": "^18.2.0",
7777
"react-scripts": "^5.0.1",
78-
"rollup": "^3.23.1",
78+
"rollup": "^4.17.2",
79+
"rollup-plugin-esbuild": "^6.1.1",
7980
"rollup-plugin-peer-deps-external": "^2.2.4",
8081
"storybook": "^7.0.18",
8182
"tsconfig-paths-webpack-plugin": "^4.0.0",
@@ -95,5 +96,8 @@
9596
"icon",
9697
"generator",
9798
"emotion"
98-
]
99+
],
100+
"dependencies": {
101+
"@modern-kit/react": "^1.4.0"
102+
}
99103
}

rollup.config.mjs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import nodeResolve from '@rollup/plugin-node-resolve';
2-
import babel from '@rollup/plugin-babel';
32
import terser from '@rollup/plugin-terser';
43
import typescript from '@rollup/plugin-typescript';
54
import commonjs from '@rollup/plugin-commonjs';
65
import peerDepsExternal from 'rollup-plugin-peer-deps-external';
76
import alias from '@rollup/plugin-alias';
87
import pkg from './package.json' assert { type: 'json' };
98
import path from 'path';
9+
import esbuild from 'rollup-plugin-esbuild';
1010

1111
const extensions = ['.js', '.jsx', '.ts', '.tsx'];
1212
const __dirname = path.resolve();
@@ -34,11 +34,7 @@ export default {
3434
extensions,
3535
}),
3636
commonjs({ include: 'node_modules/**' }),
37-
babel({
38-
exclude: /node_modules/,
39-
extensions,
40-
include: ['src/**/*'],
41-
}),
37+
esbuild(),
4238
typescript({ tsconfig: './tsconfig.json', exclude: ['**/*.stories.tsx'] }),
4339
alias({
4440
entries: [{ find: '@', replacement: path.resolve(__dirname, './src') }],

src/components/Accordion/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { useCallback, useRef, useState } from 'react';
22
import * as S from './styled';
33
import { arrowBottom, arrowTop } from '@assets/icons';
44
import Icon from '../../components/Icon';
5+
import { useToggle } from '@modern-kit/react';
56

67
interface AccordionProps {
78
title: string;
@@ -11,15 +12,14 @@ interface AccordionProps {
1112

1213
const Accordion = ({ title, children, maxHeight = 200 }: AccordionProps) => {
1314
const panelRef = useRef<HTMLDivElement>(null);
14-
const [isOpenPanel, setIsOpenPanel] = useState(false);
15+
const [isOpenPanel, setIsOpenPanel] = useToggle();
1516

1617
const handleToggle = useCallback(() => {
17-
setIsOpenPanel(!isOpenPanel);
18+
setIsOpenPanel();
1819

1920
if (!panelRef.current) return;
2021
if (isOpenPanel) {
2122
panelRef.current.style.overflow = 'hidden';
22-
2323
return;
2424
}
2525
setTimeout(() => {

src/components/ColorPicker/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import React, {
88
} from 'react';
99
import { Color, ColorPicker as PaletteColorPicker } from 'react-color-palette';
1010
import { IconButton } from '../Icon/styled';
11-
import { Portal } from '@devgrace/react';
11+
import { Portal } from '@modern-kit/react';
1212

1313
interface ColorPickerProps {
1414
children: React.ReactNode;

src/components/Icon/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { ComponentProps } from 'react';
22

3-
const Icon = ({ src, width, height }: ComponentProps<'img'>) => {
4-
return <img src={src} width={width} height={height} />;
3+
const Icon = ({ src, width, height, ...rest }: ComponentProps<'img'>) => {
4+
return <img src={src} width={width} height={height} {...rest} />;
55
};
66

77
export default Icon;

src/hooks/useIsMounted.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/stories/components/ThumbnailGenerator.stories.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React from 'react';
22
import { StoryFn } from '@storybook/react';
33
import ThumbnailGenerator from '@lib/ThumbnailGenerator';
44
import { Size } from '@utils/style';
5-
import { toggleButton } from '@assets/icons';
65

76
export default {
87
title: 'components/ThumbnailGenerator',
@@ -24,7 +23,6 @@ export default {
2423

2524
interface Props {
2625
iconSize?: Size;
27-
buttonIcon?: React.ReactNode;
2826
modalPosition?: 'left' | 'right' | 'center';
2927
iconPosition?: [number, number, number, number];
3028
isFullWidth?: boolean;
@@ -52,7 +50,6 @@ export const Default = {
5250

5351
args: {
5452
iconSize: 'medium',
55-
buttonIcon: <img src={toggleButton} width={40} height={40} />,
5653
modalPosition: 'right',
5754
iconPosition: [0, 20, 20, 0],
5855
isFullWidth: false,

0 commit comments

Comments
 (0)