Skip to content

Commit a5c13ac

Browse files
committed
Feat: v1_complate
1 parent 2c55687 commit a5c13ac

14 files changed

+984
-58
lines changed

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,13 @@
2020
"react": ">=18.0.0",
2121
"react-dom": ">=18.0.0",
2222
"framer-motion": ">=11.0.0",
23-
"tailwindcss": ">=3.4.0"
23+
"tailwindcss": ">=3.4.0",
24+
"recharts": ">=2.0.0",
25+
"lucide-react": ">=0.300.0"
2426
},
2527
"devDependencies": {
28+
"recharts": "^2.12.3",
29+
"lucide-react": "^0.400.0",
2630
"@types/react": "^18.2.0",
2731
"@types/react-dom": "^18.2.0",
2832
"typescript": "^5.0.0",

pnpm-lock.yaml

Lines changed: 929 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/animation/miniHoverAnimation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// miniHoverMotion.ts
22
// hover 시 scale, rotate, brightness 등 시각적 강조 효과 세트
33

4-
import { Variants } from "framer-motion";
4+
import { Variants } from "../miniComponentConfig";
55

66
/** 살짝 커지는 효과 */
77
export const hoverScale = (

src/animation/miniViewPort.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ViewportOptions } from "framer-motion";
1+
import { ViewportOptions } from "../miniComponentConfig";
22

33
export const defaultViewport: ViewportOptions = {
44
once: true,

src/basic-ui/miniBox.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
"use client";
22

3-
import { motion as fk, HTMLMotionProps, Variants } from "framer-motion";
3+
import { motion as fk, HTMLMotionProps } from "framer-motion";
44
import {
55
mergeVariants,
66
MiniComponetType,
77
MiniUiSize,
88
MiniUiType,
9+
Variants,
910
} from "../miniComponentConfig";
1011
import { defaultViewport } from "../animation/miniViewPort";
1112

src/basic-ui/miniButton.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
"use client";
22

3-
import { motion as fk, HTMLMotionProps, Variants } from "framer-motion";
3+
import { motion as fk, HTMLMotionProps } from "framer-motion";
44
import {
55
mergeVariants,
66
MiniComponetType,
77
MiniUiSize,
88
MiniUiType,
9+
Variants,
910
} from "../miniComponentConfig";
1011
import { defaultViewport } from "../animation/miniViewPort";
1112

src/basic-ui/miniImage.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { ViewportOptions } from "framer-motion";
2-
import { MiniComponetType } from "../miniComponentConfig";
1+
import { MiniComponetType, ViewportOptions } from "../miniComponentConfig";
32
import { defaultViewport } from "../animation/miniViewPort";
43
import MiniBox from "./miniBox";
54
import React from "react";

src/basic-ui/miniInput.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
"use client";
22

3-
import { motion as fk, HTMLMotionProps, Variants } from "framer-motion";
3+
import { motion as fk, HTMLMotionProps } from "framer-motion";
44
import {
55
mergeVariants,
66
MiniComponetType,
77
MiniUiSize,
88
MiniUiType,
9+
Variants,
910
} from "../miniComponentConfig";
1011
import { defaultViewport } from "../animation/miniViewPort";
1112

src/basic-ui/miniRadiaChart.tsx

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,58 @@
11
"use client";
22

33
import { RadialBar, RadialBarChart, ResponsiveContainer } from "recharts";
4-
import { PolarChartProps } from "recharts/types/util/types";
54

6-
interface MiniRadiaChartProp extends PolarChartProps {
7-
label: string;
5+
export interface PolarChartProps {
86
width?: number;
97
height?: number;
10-
matchData: MiniMatchType[];
8+
cx?: number | string;
9+
cy?: number | string;
10+
innerRadius?: number | string;
11+
outerRadius?: number | string;
12+
barSize?: number;
13+
startAngle?: number;
14+
endAngle?: number;
15+
data?: any[];
16+
className?: string;
1117
}
1218

1319
export interface MiniMatchType {
1420
name: string;
1521
value: number;
1622
fill: string;
1723
}
24+
25+
interface MiniRadiaChartProp extends PolarChartProps {
26+
label: string;
27+
matchData?: MiniMatchType[];
28+
}
29+
1830
export default function MiniRadiaChart({
1931
label,
2032
width = 150,
2133
height = 150,
2234
matchData = [{ name: "적합도", value: 50, fill: "var(--brand)" }],
2335
...props
2436
}: MiniRadiaChartProp) {
37+
const value = matchData[0]?.value ?? 0;
38+
2539
return (
26-
<div>
40+
<div className="flex flex-col items-center">
2741
<h4 className="text-lg font-semibold mb-2">{label}</h4>
2842
<ResponsiveContainer width={width} height={height}>
2943
<RadialBarChart
3044
data={matchData}
31-
startAngle={(matchData[0].value / 100) * 360}
45+
startAngle={(value / 100) * 360}
46+
endAngle={0}
47+
innerRadius="60%"
48+
outerRadius="100%"
49+
barSize={12}
3250
{...props}
3351
>
3452
<RadialBar dataKey="value" cornerRadius={8} />
3553
</RadialBarChart>
3654
</ResponsiveContainer>
37-
<p className="text-2xl text-[var(--text-light)]">{matchData[0].value}%</p>
55+
<p className="text-2xl text-[var(--text-light)] mt-[-10px]">{value}%</p>
3856
</div>
3957
);
4058
}

src/basic-ui/miniTextarea.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
"use client";
22

3-
import { motion as fk, HTMLMotionProps, Variants } from "framer-motion";
3+
import { motion as fk, HTMLMotionProps } from "framer-motion";
44
import {
55
mergeVariants,
66
MiniComponetType,
77
MiniUiSize,
88
MiniUiType,
9+
Variants,
910
} from "../miniComponentConfig";
1011
import { defaultViewport } from "../animation/miniViewPort";
1112

0 commit comments

Comments
 (0)