@designbasekorea/ui 0.4.0 → 0.5.1

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.
package/dist/index.umd.js CHANGED
@@ -2898,197 +2898,429 @@
2898
2898
  var classnamesExports = classnames.exports;
2899
2899
  var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
2900
2900
 
2901
- const AnimationBackground = ({ type = 'gradient', speed = 3000, repeat = 0, delay = 0, direction = 'left', colors = ['#667eea', '#764ba2', '#f093fb', '#f5576c'], width = '100%', height = '200px', borderRadius = 0, opacity = 1, blendMode = 'normal', particleCount = 50, particleSize = 2, starCount = 100, starSize = 2, clickable = false, disabled = false, className, onClick, children, }) => {
2902
- const [isVisible, setIsVisible] = React.useState(false);
2903
- const [isAnimating, setIsAnimating] = React.useState(false);
2904
- const containerRef = React.useRef(null);
2905
- const canvasRef = React.useRef(null);
2906
- React.useEffect(() => {
2907
- if (delay > 0) {
2908
- const timer = setTimeout(() => {
2909
- setIsVisible(true);
2910
- }, delay);
2911
- return () => clearTimeout(timer);
2912
- }
2913
- else {
2914
- setIsVisible(true);
2901
+ /**
2902
+ * Canvas 렌더러: particles, stars, wave, pulse
2903
+ */
2904
+ const hexToRgb$1 = (hex) => {
2905
+ const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
2906
+ return result
2907
+ ? {
2908
+ r: parseInt(result[1], 16),
2909
+ g: parseInt(result[2], 16),
2910
+ b: parseInt(result[3], 16),
2915
2911
  }
2916
- }, [delay]);
2917
- // 반복 애니메이션
2918
- React.useEffect(() => {
2919
- if (repeat > 0) {
2920
- let repeatCount = 0;
2921
- const repeatAnimation = () => {
2922
- setIsAnimating(true);
2923
- setTimeout(() => {
2924
- setIsAnimating(false);
2925
- repeatCount++;
2926
- if (repeatCount < repeat) {
2927
- setTimeout(repeatAnimation, speed);
2928
- }
2929
- }, speed);
2930
- };
2931
- if (isVisible) {
2932
- setTimeout(repeatAnimation, speed);
2912
+ : { r: 0, g: 0, b: 0 };
2913
+ };
2914
+ const drawParticles = (ctx, width, height, particlesRef, options) => {
2915
+ if (particlesRef.current.length !== options.count) {
2916
+ particlesRef.current = Array.from({ length: options.count }).map(() => ({
2917
+ x: Math.random() * width,
2918
+ y: Math.random() * height,
2919
+ vx: (Math.random() - 0.5) * 1.5,
2920
+ vy: (Math.random() - 0.5) * 1.5,
2921
+ size: Math.random() * options.size + 1,
2922
+ color: options.colors[Math.floor(Math.random() * options.colors.length)],
2923
+ }));
2924
+ }
2925
+ const particles = particlesRef.current;
2926
+ const interactionRadius = 150;
2927
+ particles.forEach((p, i) => {
2928
+ p.x += p.vx;
2929
+ p.y += p.vy;
2930
+ if (p.x < 0 || p.x > width)
2931
+ p.vx *= -1;
2932
+ if (p.y < 0 || p.y > height)
2933
+ p.vy *= -1;
2934
+ if (options.clickable) {
2935
+ const dx = options.mouse.x - p.x;
2936
+ const dy = options.mouse.y - p.y;
2937
+ const distance = Math.sqrt(dx * dx + dy * dy);
2938
+ if (distance < interactionRadius) {
2939
+ const force = (interactionRadius - distance) / interactionRadius;
2940
+ p.vx += (dx / distance) * force * 0.5;
2941
+ p.vy += (dy / distance) * force * 0.5;
2942
+ }
2943
+ const maxSpeed = 3;
2944
+ const speed = Math.sqrt(p.vx * p.vx + p.vy * p.vy);
2945
+ if (speed > maxSpeed) {
2946
+ p.vx = (p.vx / speed) * maxSpeed;
2947
+ p.vy = (p.vy / speed) * maxSpeed;
2948
+ }
2949
+ }
2950
+ ctx.beginPath();
2951
+ ctx.arc(p.x, p.y, p.size, 0, Math.PI * 2);
2952
+ ctx.fillStyle = p.color;
2953
+ ctx.fill();
2954
+ for (let j = i + 1; j < particles.length; j++) {
2955
+ const p2 = particles[j];
2956
+ const dx = p.x - p2.x;
2957
+ const dy = p.y - p2.y;
2958
+ const dist = Math.sqrt(dx * dx + dy * dy);
2959
+ if (dist < 100) {
2960
+ ctx.beginPath();
2961
+ ctx.strokeStyle = p.color;
2962
+ ctx.globalAlpha = 1 - dist / 100;
2963
+ ctx.lineWidth = 0.5;
2964
+ ctx.moveTo(p.x, p.y);
2965
+ ctx.lineTo(p2.x, p2.y);
2966
+ ctx.stroke();
2967
+ ctx.globalAlpha = 1;
2933
2968
  }
2934
2969
  }
2935
- }, [repeat, speed, isVisible]);
2936
- // Canvas 애니메이션 (particles, stars 타입용)
2937
- React.useEffect(() => {
2938
- if ((type === 'particles' || type === 'stars') && canvasRef.current && isVisible) {
2939
- const canvas = canvasRef.current;
2940
- const ctx = canvas.getContext('2d');
2941
- if (!ctx)
2942
- return;
2943
- const resizeCanvas = () => {
2944
- const rect = containerRef.current?.getBoundingClientRect();
2945
- if (rect) {
2946
- canvas.width = rect.width;
2947
- canvas.height = rect.height;
2948
- }
2949
- };
2950
- resizeCanvas();
2951
- window.addEventListener('resize', resizeCanvas);
2952
- const particles = [];
2953
- // 파티클 초기화
2954
- const initParticles = () => {
2955
- particles.length = 0;
2956
- const count = type === 'particles' ? particleCount : starCount;
2957
- const size = type === 'particles' ? particleSize : starSize;
2958
- for (let i = 0; i < count; i++) {
2959
- particles.push({
2960
- x: Math.random() * canvas.width,
2961
- y: Math.random() * canvas.height,
2962
- vx: (Math.random() - 0.5) * 2,
2963
- vy: (Math.random() - 0.5) * 2,
2964
- size: Math.random() * size + 1,
2965
- color: colors[Math.floor(Math.random() * colors.length)],
2966
- });
2967
- }
2968
- };
2969
- initParticles();
2970
- const animate = () => {
2971
- ctx.clearRect(0, 0, canvas.width, canvas.height);
2972
- particles.forEach(particle => {
2973
- // 위치 업데이트
2974
- particle.x += particle.vx;
2975
- particle.y += particle.vy;
2976
- // 경계 처리
2977
- if (particle.x < 0 || particle.x > canvas.width)
2978
- particle.vx *= -1;
2979
- if (particle.y < 0 || particle.y > canvas.height)
2980
- particle.vy *= -1;
2981
- // 그리기
2982
- ctx.beginPath();
2983
- ctx.arc(particle.x, particle.y, particle.size, 0, Math.PI * 2);
2984
- ctx.fillStyle = particle.color;
2985
- ctx.fill();
2970
+ });
2971
+ };
2972
+ const drawStars = (ctx, width, height, starsRef, options) => {
2973
+ if (starsRef.current.length !== options.count) {
2974
+ starsRef.current = Array.from({ length: options.count }).map(() => ({
2975
+ x: Math.random() * width,
2976
+ y: Math.random() * height,
2977
+ size: Math.random() * options.size,
2978
+ blinkSpeed: Math.random() * 0.05 + 0.01,
2979
+ color: options.colors[Math.floor(Math.random() * options.colors.length)],
2980
+ }));
2981
+ }
2982
+ starsRef.current.forEach(star => {
2983
+ star.y -= 0.05;
2984
+ if (star.y < 0)
2985
+ star.y = height;
2986
+ const opacity = 0.5 + Math.sin(options.time * star.blinkSpeed) * 0.5;
2987
+ ctx.beginPath();
2988
+ ctx.arc(star.x, star.y, star.size, 0, Math.PI * 2);
2989
+ ctx.fillStyle = star.color;
2990
+ ctx.globalAlpha = opacity;
2991
+ ctx.fill();
2992
+ ctx.globalAlpha = 1;
2993
+ });
2994
+ };
2995
+ const drawWaves = (ctx, width, height, options) => {
2996
+ const { colors, offset, speedFactor } = options;
2997
+ offset.current += 0.02 * speedFactor;
2998
+ colors.forEach((color, i) => {
2999
+ ctx.beginPath();
3000
+ ctx.moveTo(0, height);
3001
+ const freq = 0.003 + i * 0.001;
3002
+ const amp = 30 + i * 20;
3003
+ const phase = offset.current + i * 2;
3004
+ for (let x = 0; x <= width; x += 10) {
3005
+ const y = height / 2 +
3006
+ Math.sin(x * freq + phase) * amp +
3007
+ Math.sin(x * 0.001 + phase * 0.5) * 50;
3008
+ ctx.lineTo(x, y);
3009
+ }
3010
+ ctx.lineTo(width, height);
3011
+ ctx.lineTo(0, height);
3012
+ ctx.closePath();
3013
+ ctx.fillStyle = color;
3014
+ ctx.fill();
3015
+ });
3016
+ };
3017
+ const drawPulse = (ctx, width, height, options) => {
3018
+ const { colors, time, intensity } = options;
3019
+ const centerX = width / 2;
3020
+ const centerY = height / 2;
3021
+ const maxRadius = Math.max(width, height) * 0.8;
3022
+ const intensityMap = { subtle: 0.5, medium: 1, vivid: 1.5 };
3023
+ const factor = intensityMap[intensity];
3024
+ colors.forEach((color, i) => {
3025
+ const t = time * 0.02 * factor + (i * (Math.PI * 2)) / colors.length;
3026
+ const radius = (Math.sin(t) * 0.2 + 0.5) * maxRadius;
3027
+ const alpha = (Math.sin(t + Math.PI) * 0.2 + 0.3) * factor;
3028
+ const gradient = ctx.createRadialGradient(centerX, centerY, 0, centerX, centerY, radius);
3029
+ const rgb = hexToRgb$1(color);
3030
+ gradient.addColorStop(0, `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, 0)`);
3031
+ gradient.addColorStop(0.5, `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${alpha * 0.5})`);
3032
+ gradient.addColorStop(1, `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, 0)`);
3033
+ ctx.fillStyle = gradient;
3034
+ ctx.fillRect(0, 0, width, height);
3035
+ });
3036
+ };
3037
+
3038
+ const CanvasLayer = ({ type, colors, speed, particleCount, particleSize, starCount, starSize, intensity, clickable, }) => {
3039
+ const canvasRef = React.useRef(null);
3040
+ const containerRef = React.useRef(null);
3041
+ const requestRef = React.useRef(undefined);
3042
+ const frameCountRef = React.useRef(0);
3043
+ const mouseRef = React.useRef({ x: -9999, y: -9999 });
3044
+ const particlesRef = React.useRef([]);
3045
+ const starsRef = React.useRef([]);
3046
+ const waveOffsetRef = React.useRef(0);
3047
+ const handleResize = React.useCallback(() => {
3048
+ const canvas = canvasRef.current;
3049
+ const container = containerRef.current;
3050
+ if (!canvas || !container)
3051
+ return;
3052
+ const dpr = window.devicePixelRatio || 1;
3053
+ const rect = container.getBoundingClientRect();
3054
+ canvas.width = rect.width * dpr;
3055
+ canvas.height = rect.height * dpr;
3056
+ canvas.style.width = `${rect.width}px`;
3057
+ canvas.style.height = `${rect.height}px`;
3058
+ const ctx = canvas.getContext('2d');
3059
+ if (ctx)
3060
+ ctx.scale(dpr, dpr);
3061
+ }, []);
3062
+ const animate = React.useCallback(() => {
3063
+ const canvas = canvasRef.current;
3064
+ if (!canvas)
3065
+ return;
3066
+ const ctx = canvas.getContext('2d');
3067
+ if (!ctx)
3068
+ return;
3069
+ const dpr = window.devicePixelRatio || 1;
3070
+ const width = canvas.width / dpr;
3071
+ const height = canvas.height / dpr;
3072
+ ctx.clearRect(0, 0, width, height);
3073
+ const time = frameCountRef.current * (3000 / (speed || 3000));
3074
+ frameCountRef.current += 1;
3075
+ switch (type) {
3076
+ case 'particles':
3077
+ drawParticles(ctx, width, height, particlesRef, {
3078
+ count: particleCount,
3079
+ colors,
3080
+ size: particleSize,
3081
+ mouse: mouseRef.current,
3082
+ clickable,
2986
3083
  });
2987
- requestAnimationFrame(animate);
2988
- };
2989
- animate();
2990
- return () => {
2991
- window.removeEventListener('resize', resizeCanvas);
2992
- };
2993
- }
2994
- }, [type, isVisible, colors, particleCount, particleSize, starCount, starSize]);
2995
- const handleClick = () => {
2996
- if (clickable && !disabled && onClick) {
2997
- onClick();
2998
- }
2999
- };
3000
- const getGradientStyle = () => {
3001
- if (type === 'gradient' || type === 'rainbow') {
3002
- const gradientColors = type === 'rainbow'
3003
- ? ['#ff0000', '#ff8000', '#ffff00', '#80ff00', '#00ff00', '#00ff80', '#00ffff', '#0080ff', '#0000ff', '#8000ff', '#ff00ff', '#ff0080']
3004
- : colors;
3005
- if (direction === 'radial') {
3006
- return {
3007
- background: `radial-gradient(circle, ${gradientColors.join(', ')})`,
3008
- backgroundSize: '400% 400%',
3009
- };
3010
- }
3011
- else {
3012
- const angle = direction === 'left' ? '90deg' :
3013
- direction === 'right' ? '270deg' :
3014
- direction === 'up' ? '0deg' :
3015
- direction === 'down' ? '180deg' :
3016
- direction === 'diagonal' ? '45deg' : '90deg';
3017
- return {
3018
- background: `linear-gradient(${angle}, ${gradientColors.join(', ')})`,
3019
- backgroundSize: '400% 400%',
3020
- };
3021
- }
3022
- }
3023
- return {};
3024
- };
3025
- const getWaveStyle = () => {
3026
- if (type === 'wave') {
3027
- return {
3028
- '--wave-colors': colors.join(', '),
3029
- };
3030
- }
3031
- return {};
3032
- };
3033
- const getAuroraStyle = () => {
3034
- if (type === 'aurora') {
3035
- return {
3036
- '--aurora-colors': colors.join(', '),
3037
- };
3038
- }
3039
- return {};
3040
- };
3041
- const getFireStyle = () => {
3042
- if (type === 'fire') {
3043
- return {
3044
- '--fire-colors': colors.join(', '),
3045
- };
3084
+ break;
3085
+ case 'stars':
3086
+ drawStars(ctx, width, height, starsRef, {
3087
+ count: starCount,
3088
+ colors,
3089
+ size: starSize,
3090
+ time,
3091
+ });
3092
+ break;
3093
+ case 'wave':
3094
+ drawWaves(ctx, width, height, {
3095
+ colors,
3096
+ offset: waveOffsetRef,
3097
+ speedFactor: 10000 / (speed || 5000),
3098
+ });
3099
+ break;
3100
+ case 'pulse':
3101
+ drawPulse(ctx, width, height, {
3102
+ colors,
3103
+ time,
3104
+ intensity,
3105
+ });
3106
+ break;
3046
3107
  }
3047
- return {};
3108
+ requestRef.current = requestAnimationFrame(animate);
3109
+ }, [
3110
+ type,
3111
+ colors,
3112
+ speed,
3113
+ particleCount,
3114
+ particleSize,
3115
+ starCount,
3116
+ starSize,
3117
+ intensity,
3118
+ clickable,
3119
+ ]);
3120
+ React.useEffect(() => {
3121
+ handleResize();
3122
+ window.addEventListener('resize', handleResize);
3123
+ particlesRef.current = [];
3124
+ starsRef.current = [];
3125
+ waveOffsetRef.current = 0;
3126
+ frameCountRef.current = 0;
3127
+ requestRef.current = requestAnimationFrame(animate);
3128
+ return () => {
3129
+ window.removeEventListener('resize', handleResize);
3130
+ if (requestRef.current)
3131
+ cancelAnimationFrame(requestRef.current);
3132
+ };
3133
+ }, [animate, handleResize]);
3134
+ const handleMouseMove = (e) => {
3135
+ if (!containerRef.current)
3136
+ return;
3137
+ const rect = containerRef.current.getBoundingClientRect();
3138
+ mouseRef.current = {
3139
+ x: e.clientX - rect.left,
3140
+ y: e.clientY - rect.top,
3141
+ };
3048
3142
  };
3049
- const getOceanStyle = () => {
3050
- if (type === 'ocean') {
3051
- return {
3052
- '--ocean-colors': colors.join(', '),
3053
- };
3054
- }
3055
- return {};
3143
+ const handleMouseLeave = () => {
3144
+ mouseRef.current = { x: -9999, y: -9999 };
3056
3145
  };
3057
- const getSunsetStyle = () => {
3058
- if (type === 'sunset') {
3146
+ return (jsxRuntime.jsx("div", { ref: containerRef, className: "designbase-animation-background__canvas-layer", onMouseMove: handleMouseMove, onMouseLeave: handleMouseLeave, children: jsxRuntime.jsx("canvas", { ref: canvasRef, className: "designbase-animation-background__canvas" }) }));
3147
+ };
3148
+
3149
+ const CSSGradientLayer = ({ type, direction, colors, speed, }) => {
3150
+ const getBackgroundStyle = () => {
3151
+ const safeColors = colors.length > 0 ? colors : ['#ccc'];
3152
+ const gradientStr = safeColors.join(', ');
3153
+ if (type === 'gradient') {
3154
+ let angle = '90deg';
3155
+ switch (direction) {
3156
+ case 'up':
3157
+ angle = '0deg';
3158
+ break;
3159
+ case 'down':
3160
+ angle = '180deg';
3161
+ break;
3162
+ case 'left':
3163
+ angle = '270deg';
3164
+ break;
3165
+ case 'right':
3166
+ angle = '90deg';
3167
+ break;
3168
+ case 'diagonal':
3169
+ angle = '45deg';
3170
+ break;
3171
+ case 'radial':
3172
+ return {
3173
+ backgroundImage: `radial-gradient(circle, ${gradientStr})`,
3174
+ backgroundSize: '200% 200%',
3175
+ };
3176
+ }
3059
3177
  return {
3060
- '--sunset-colors': colors.join(', '),
3178
+ backgroundImage: `linear-gradient(${angle}, ${gradientStr})`,
3179
+ backgroundSize: '200% 200%',
3061
3180
  };
3062
3181
  }
3063
3182
  return {};
3064
3183
  };
3065
- const classes = classNames('designbase-animation-background', `designbase-animation-background--${type}`, `designbase-animation-background--${direction}`, {
3066
- 'designbase-animation-background--visible': isVisible,
3067
- 'designbase-animation-background--animating': isAnimating,
3068
- 'designbase-animation-background--clickable': clickable,
3069
- 'designbase-animation-background--disabled': disabled,
3070
- }, className);
3184
+ const duration = `${Math.max(2, speed / 1000)}s`;
3185
+ return (jsxRuntime.jsx("div", { className: "designbase-animation-background__css-layer", style: {
3186
+ ...getBackgroundStyle(),
3187
+ animation: `designbase-gradient-move ${duration} ease infinite`,
3188
+ }, children: jsxRuntime.jsx("style", { children: `
3189
+ @keyframes designbase-gradient-move {
3190
+ 0% { background-position: 0% 50%; }
3191
+ 50% { background-position: 100% 50%; }
3192
+ 100% { background-position: 0% 50%; }
3193
+ }
3194
+ ` }) }));
3195
+ };
3196
+
3197
+ const MeshAuroraLayer = ({ colors, speed, blur, intensity, theme, }) => {
3198
+ const baseOpacity = intensity === 'subtle' ? 0.3 : intensity === 'medium' ? 0.6 : 0.8;
3199
+ const duration = Math.max(5, speed / 1000);
3200
+ const palette = colors.length >= 3
3201
+ ? colors
3202
+ : ['#4f46e5', '#ec4899', '#06b6d4', '#8b5cf6'];
3203
+ const blendMode = theme === 'dark' ? 'screen' : 'multiply';
3204
+ const filterStyle = `blur(${blur}px)`;
3205
+ const blobBaseClass = 'designbase-animation-background__aurora-blob';
3206
+ return (jsxRuntime.jsxs("div", { className: "designbase-animation-background__aurora-mesh", children: [jsxRuntime.jsx("div", { className: blobBaseClass, style: {
3207
+ backgroundColor: palette[0],
3208
+ filter: filterStyle,
3209
+ opacity: baseOpacity,
3210
+ animationDuration: `${duration}s`,
3211
+ top: '-10%',
3212
+ left: '-10%',
3213
+ animationDelay: '0s',
3214
+ mixBlendMode: blendMode,
3215
+ } }), jsxRuntime.jsx("div", { className: blobBaseClass, style: {
3216
+ backgroundColor: palette[1],
3217
+ filter: filterStyle,
3218
+ opacity: baseOpacity,
3219
+ animationDuration: `${duration * 1.2}s`,
3220
+ top: '-10%',
3221
+ right: '-10%',
3222
+ animationDelay: '2s',
3223
+ mixBlendMode: blendMode,
3224
+ } }), jsxRuntime.jsx("div", { className: blobBaseClass, style: {
3225
+ backgroundColor: palette[2],
3226
+ filter: filterStyle,
3227
+ opacity: baseOpacity,
3228
+ animationDuration: `${duration * 1.5}s`,
3229
+ bottom: '-20%',
3230
+ left: '20%',
3231
+ animationDelay: '4s',
3232
+ mixBlendMode: blendMode,
3233
+ } }), palette[3] && (jsxRuntime.jsx("div", { className: blobBaseClass, style: {
3234
+ backgroundColor: palette[3],
3235
+ filter: filterStyle,
3236
+ opacity: baseOpacity,
3237
+ animationDuration: `${duration * 1.1}s`,
3238
+ bottom: '-10%',
3239
+ right: '-10%',
3240
+ animationDelay: '1s',
3241
+ mixBlendMode: blendMode,
3242
+ } })), jsxRuntime.jsx("div", { className: "designbase-animation-background__aurora-noise", style: {
3243
+ opacity: theme === 'dark' ? 0.03 : 0.05,
3244
+ backgroundImage: `url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E")`,
3245
+ } })] }));
3246
+ };
3247
+
3248
+ const GridOverlay = ({ size = 40, color = '#ffffff', opacity = 0.1, }) => {
3071
3249
  const style = {
3250
+ position: 'absolute',
3251
+ inset: 0,
3252
+ width: '100%',
3253
+ height: '100%',
3254
+ pointerEvents: 'none',
3255
+ zIndex: 1,
3256
+ backgroundImage: `
3257
+ linear-gradient(to right, ${color} 1px, transparent 1px),
3258
+ linear-gradient(to bottom, ${color} 1px, transparent 1px)
3259
+ `,
3260
+ backgroundSize: `${size}px ${size}px`,
3261
+ opacity,
3262
+ // 은은하게 전체에 라인 유지, 맨 아래만 살짝 페이드
3263
+ maskImage: 'linear-gradient(to bottom, black 0%, black 92%, transparent 100%)',
3264
+ WebkitMaskImage: 'linear-gradient(to bottom, black 0%, black 92%, transparent 100%)',
3265
+ };
3266
+ return jsxRuntime.jsx("div", { className: "designbase-animation-background__grid-overlay", style: style });
3267
+ };
3268
+
3269
+ const AnimationBackground = ({ type = 'gradient', theme = 'dark', intensity = 'subtle', blur = 80, speed = 3000, repeat = 0, direction = 'left', colors = ['#667eea', '#764ba2', '#f093fb'], width = '100%', height = '100%', borderRadius = 0, opacity = 1, blendMode = 'normal', particleCount = 50, particleSize = 2, starCount = 100, starSize = 1.5, clickable = false, disabled = false, className = '', onClick, children, showGrid = false, gridSize = 40, gridColor, gridOpacity = 0.1, }) => {
3270
+ const backgroundColor = theme === 'dark' ? 'var(--db-surface-base, #0f172a)' : 'var(--db-surface-base, #ffffff)';
3271
+ const effectiveGridColor = gridColor ?? (theme === 'dark' ? '#ffffff' : '#000000');
3272
+ const containerStyle = {
3072
3273
  width: typeof width === 'number' ? `${width}px` : width,
3073
3274
  height: typeof height === 'number' ? `${height}px` : height,
3074
3275
  borderRadius: typeof borderRadius === 'number' ? `${borderRadius}px` : borderRadius,
3075
3276
  opacity,
3076
3277
  mixBlendMode: blendMode,
3077
- ...getGradientStyle(),
3078
- ...getWaveStyle(),
3079
- ...getAuroraStyle(),
3080
- ...getFireStyle(),
3081
- ...getOceanStyle(),
3082
- ...getSunsetStyle(),
3083
- '--db-animation-speed': `${speed}ms`,
3278
+ position: 'relative',
3279
+ overflow: 'hidden',
3280
+ backgroundColor: type !== 'gradient' ? backgroundColor : undefined,
3084
3281
  };
3085
- const renderContent = () => {
3086
- if (type === 'particles' || type === 'stars') {
3087
- return (jsxRuntime.jsx("canvas", { ref: canvasRef, className: "designbase-animation-background__canvas", style: { width: '100%', height: '100%' } }));
3282
+ const content = React.useMemo(() => {
3283
+ if (disabled)
3284
+ return null;
3285
+ switch (type) {
3286
+ case 'particles':
3287
+ case 'stars':
3288
+ case 'wave':
3289
+ case 'pulse':
3290
+ return (jsxRuntime.jsx(CanvasLayer, { type: type, colors: colors, speed: speed, particleCount: particleCount, particleSize: particleSize, starCount: starCount, starSize: starSize, intensity: intensity, clickable: clickable }));
3291
+ case 'aurora':
3292
+ return (jsxRuntime.jsx(MeshAuroraLayer, { colors: colors, speed: speed, blur: blur, intensity: intensity, theme: theme }));
3293
+ case 'gradient':
3294
+ return (jsxRuntime.jsx(CSSGradientLayer, { type: type, direction: direction, colors: colors, speed: speed }));
3295
+ default:
3296
+ return null;
3088
3297
  }
3089
- return children;
3090
- };
3091
- return (jsxRuntime.jsx("div", { ref: containerRef, className: classes, style: style, onClick: handleClick, children: renderContent() }));
3298
+ }, [
3299
+ type,
3300
+ disabled,
3301
+ colors,
3302
+ speed,
3303
+ intensity,
3304
+ blur,
3305
+ theme,
3306
+ particleCount,
3307
+ particleSize,
3308
+ starCount,
3309
+ starSize,
3310
+ clickable,
3311
+ direction,
3312
+ ]);
3313
+ const classes = classNames('designbase-animation-background', `designbase-animation-background--${type}`, {
3314
+ 'designbase-animation-background--clickable': clickable,
3315
+ 'designbase-animation-background--disabled': disabled,
3316
+ }, className);
3317
+ return (jsxRuntime.jsxs("div", { className: classes, style: containerStyle, onClick: clickable && !disabled ? onClick : undefined, children: [jsxRuntime.jsx("div", { className: "designbase-animation-background__layers", style: {
3318
+ position: 'absolute',
3319
+ inset: 0,
3320
+ width: '100%',
3321
+ height: '100%',
3322
+ zIndex: 0,
3323
+ }, children: content }), showGrid && (jsxRuntime.jsx(GridOverlay, { size: gridSize, color: effectiveGridColor, opacity: gridOpacity })), children && (jsxRuntime.jsx("div", { className: "designbase-animation-background__content", style: { position: 'relative', zIndex: 10, width: '100%', height: '100%' }, children: children }))] }));
3092
3324
  };
3093
3325
 
3094
3326
  const AnimationText = ({ children, type = 'fade', speed = 1000, repeat = 0, delay = 0, direction = 'left', size = 'm', color = 'primary', customColor, weight = 'normal', align = 'left', gradientColors = ['#667eea', '#764ba2'], waveColors = ['#ff6b6b', '#4ecdc4', '#45b7d1', '#96ceb4', '#feca57'], glowColor = '#667eea', clickable = false, disabled = false, className, onClick, }) => {
@@ -4254,7 +4486,7 @@
4254
4486
  };
4255
4487
  SearchBar.displayName = 'SearchBar';
4256
4488
 
4257
- const Select = ({ value, defaultValue, options, label, placeholder = '선택하세요', multiple = false, searchable = false, disabled = false, readOnly = false, required = false, error = false, errorMessage, helperText, size = 'm', fullWidth = false, dropdownWidth = 'auto', position = 'bottom', maxHeight = 200, showClearButton = true, className, onChange, onFocus, onBlur, ...props }) => {
4489
+ const Select = ({ value, defaultValue, options, label, placeholder = '선택하세요', multiple = false, searchable = false, disabled = false, readOnly = false, required = false, error = false, errorMessage, helperText, size = 'm', fullWidth = false, dropdownWidth = 'auto', position = 'bottom', maxHeight = 200, showClearButton = true, useMobileBottomSheet = false, className, onChange, onFocus, onBlur, ...props }) => {
4258
4490
  const [isOpen, setIsOpen] = React.useState(false);
4259
4491
  const [selectedValue, setSelectedValue] = React.useState(value ?? defaultValue ?? (multiple ? [] : ''));
4260
4492
  const [searchTerm, setSearchTerm] = React.useState('');
@@ -4413,6 +4645,7 @@
4413
4645
  });
4414
4646
  const dropdownClasses = clsx('designbase-select__dropdown', `designbase-select__dropdown--${dropdownWidth}`, `designbase-select__dropdown--${position}`, {
4415
4647
  'designbase-select__dropdown--open': isOpen,
4648
+ 'designbase-select__dropdown--mobile-sheet': useMobileBottomSheet,
4416
4649
  });
4417
4650
  const filteredOptions = getFilteredOptions();
4418
4651
  const selectedLabels = getSelectedLabels();
@@ -7813,7 +8046,7 @@
7813
8046
  return;
7814
8047
  onClick?.();
7815
8048
  };
7816
- return (jsxRuntime.jsxs("div", { className: classes, style: customStyle, onClick: handleClick, role: clickable ? 'button' : undefined, tabIndex: clickable ? 0 : undefined, children: [icon && (jsxRuntime.jsx("div", { className: clsx('designbase-stat__icon', `designbase-stat__icon--${iconPosition}`), children: icon })), jsxRuntime.jsxs("div", { className: "designbase-stat__content", children: [jsxRuntime.jsxs("div", { className: "designbase-stat__main", children: [jsxRuntime.jsx("div", { className: "designbase-stat__value", children: value }), jsxRuntime.jsx("div", { className: "designbase-stat__label", children: label })] }), showChange && change && (jsxRuntime.jsx("div", { className: clsx('designbase-stat__change', getChangeClass()), children: getChangeText() })), showDescription && description && (jsxRuntime.jsx("div", { className: "designbase-stat__description", children: description }))] }), showProgress && typeof progress === 'number' && (jsxRuntime.jsx("div", { className: "designbase-stat__progress", children: jsxRuntime.jsx(Progressbar, { value: Math.min(Math.max(progress, 0), 100), size: "s", variant: color === 'primary' ? 'primary' : color === 'success' ? 'success' : color === 'warning' ? 'warning' : color === 'error' ? 'danger' : 'default' }) }))] }));
8049
+ return (jsxRuntime.jsxs("div", { className: classes, style: customStyle, onClick: handleClick, role: clickable ? 'button' : undefined, tabIndex: clickable ? 0 : undefined, children: [icon && (jsxRuntime.jsx("div", { className: clsx('designbase-stat__icon', `designbase-stat__icon--${iconPosition}`), children: icon })), jsxRuntime.jsxs("div", { className: "designbase-stat__content", children: [jsxRuntime.jsx("div", { className: "designbase-stat__main", children: variant === 'iconBox' ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: "designbase-stat__label", children: label }), jsxRuntime.jsx("div", { className: "designbase-stat__value", children: value })] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: "designbase-stat__value", children: value }), jsxRuntime.jsx("div", { className: "designbase-stat__label", children: label })] })) }), showChange && change && (jsxRuntime.jsx("div", { className: clsx('designbase-stat__change', getChangeClass()), children: getChangeText() })), showDescription && description && (jsxRuntime.jsx("div", { className: "designbase-stat__description", children: description }))] }), showProgress && typeof progress === 'number' && (jsxRuntime.jsx("div", { className: "designbase-stat__progress", children: jsxRuntime.jsx(Progressbar, { value: Math.min(Math.max(progress, 0), 100), size: "s", variant: color === 'primary' ? 'primary' : color === 'success' ? 'success' : color === 'warning' ? 'warning' : color === 'error' ? 'danger' : 'default' }) }))] }));
7817
8050
  };
7818
8051
 
7819
8052
  const HeroFeature = ({ title, subtitle, description, image, imageAlt, backgroundImage, backgroundVideo, overlayColor, overlayOpacity = 0.5, buttons = [], badge, stats = [], icon, size = 'l', variant = 'default', theme = 'light', alignment = 'left', animated = false, parallax = false, fullHeight = false, minHeight, maxHeight, className, }) => {
@@ -8339,22 +8572,26 @@
8339
8572
  return (jsxRuntime.jsx("div", { className: classes, children: items.map((item, index) => renderItem(item, index)) }));
8340
8573
  };
8341
8574
 
8342
- const DesignBaseLogo = ({ width = 193, height = 40, color = 'currentColor', className, }) => {
8343
- return (jsxRuntime.jsx("svg", { width: width, height: height, viewBox: "0 0 386 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, "aria-label": "DesignBase Logo", children: jsxRuntime.jsxs("g", { fill: color, children: [jsxRuntime.jsx("polygon", { points: "58.4,23.6 77.3,23.6 77.3,16.2 58.4,16.2 58.4,7.7 79.4,7.7 79.4,0.4 49.5,0.4 49.5,39.6 80,39.6 80,32.3 58.4,32.3" }), jsxRuntime.jsx("path", { d: "M95.6,10.8c0-2.1,2-3.2,5-3.2s8.1,1.6,12.2,4l3.4-7.3c-4.5-2.8-9.6-4.2-14.9-4.2c-9.1,0-15.2,4.5-15.2,11.6 c0,13.9,20.9,9.6,20.9,17c0,2.4-2.2,3.8-5.8,3.8c-4.2,0-9.9-2.3-13.9-5.9l-3.5,7.2c4.9,4,11,6.2,17.3,6.2c8.7,0,15.4-4.1,15.4-11.8 C116.5,13.9,95.6,18,95.6,10.8z" }), jsxRuntime.jsx("rect", { x: "122.7", y: "0.4", width: "8.8", height: "39.2" }), jsxRuntime.jsx("path", { d: "M158.8,7.8c4,0.1,7.8,1.7,10.8,4.4l5-6.3c-4.4-3.7-10-5.7-15.7-5.7c-12.2,0-21.4,8.5-21.4,19.9s9,20,20.9,20 c5.7-0.1,11.2-1.9,15.9-5.1V19.8h-7.6v10.3c-2.4,1.3-5,2-7.7,2.1h-0.4c-6.7-0.1-12.1-5.6-12-12.3v-0.4 C146.7,13,152.2,7.7,158.8,7.8z" }), jsxRuntime.jsx("polygon", { points: "209.1,25.6 190.1,0.4 182,0.4 182,39.6 190.5,39.6 190.5,14.5 209.5,39.6 217.5,39.6 217.5,0.4 209.1,0.4" }), jsxRuntime.jsx("path", { d: "M263.3,18.8c4-0.9,6.9-4.5,6.8-8.6c0-6-5.4-9.8-14-9.8h-24.5v6.5l6.4,1v31.8h18.7c9.1,0,14.8-4.2,14.8-10.9 C271.7,23.8,268.2,19.5,263.3,18.8z M246.9,7.6h8.7c3.4-0.1,5.4,1.5,5.4,4.2s-2,4.4-5.4,4.4h-8.7V7.6z M255.7,32.4h-8.7v-9.3h8.7 c4.1,0,6.7,1.7,6.7,4.5C262.4,30.6,259.8,32.4,255.7,32.4z" }), jsxRuntime.jsx("path", { d: "M290.5,0.4l-17,39.2h9.1l3.1-7.6h18.2l3,7.6h9.5L299.6,0.4H290.5z M288.6,24.9l6.2-15.2l6.2,15.2L288.6,24.9z" }), jsxRuntime.jsx("path", { d: "M328.9,10.8c0-2.1,2-3.2,5-3.2s8.1,1.6,12.2,4l3.4-7.3C345,1.4,339.9,0,334.6,0c-9.1,0-15.2,4.5-15.2,11.6 c0,13.9,20.9,9.6,20.9,17c0,2.4-2.2,3.8-5.8,3.8c-4.1,0-9.9-2.3-13.9-5.9l-3.5,7.2c4.9,4,11,6.2,17.3,6.2c8.7,0,15.4-4.1,15.4-11.8 C349.8,13.9,328.9,18,328.9,10.8z" }), jsxRuntime.jsx("polygon", { points: "364.4,32.3 364.4,23.6 383.3,23.6 383.3,16.2 364.4,16.2 364.4,7.7 385.4,7.7 385.4,0.4 355.5,0.4 355.5,39.6 386,39.6 386,32.3" }), jsxRuntime.jsx("path", { d: "M23.1,0.4H0v6.5l6.5,1v31.8h16.3c12.4,0,21-8.1,21-19.6S35.2,0.4,23.1,0.4z M34.7,20.1c0,7.2-4.8,12.1-11.4,12.1h-8V7.8H23 C29.8,7.8,34.8,12.8,34.7,20.1L34.7,20.1z" })] }) }));
8575
+ const DesignBaseLogo = ({ width = 193, height = 40, color, className, }) => {
8576
+ // color 전달되지 않으면 원본 색상(검정) 사용, 전달되면 해당 색상 사용
8577
+ const fillColor = color || '#000000';
8578
+ return (jsxRuntime.jsx("svg", { width: width, height: height, viewBox: "0 0 386 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, "aria-label": "DesignBase Logo", children: jsxRuntime.jsxs("g", { fill: fillColor, children: [jsxRuntime.jsx("polygon", { points: "58.4,23.6 77.3,23.6 77.3,16.2 58.4,16.2 58.4,7.7 79.4,7.7 79.4,0.4 49.5,0.4 49.5,39.6 80,39.6 80,32.3 58.4,32.3" }), jsxRuntime.jsx("path", { d: "M95.6,10.8c0-2.1,2-3.2,5-3.2s8.1,1.6,12.2,4l3.4-7.3c-4.5-2.8-9.6-4.2-14.9-4.2c-9.1,0-15.2,4.5-15.2,11.6 c0,13.9,20.9,9.6,20.9,17c0,2.4-2.2,3.8-5.8,3.8c-4.2,0-9.9-2.3-13.9-5.9l-3.5,7.2c4.9,4,11,6.2,17.3,6.2c8.7,0,15.4-4.1,15.4-11.8 C116.5,13.9,95.6,18,95.6,10.8z" }), jsxRuntime.jsx("rect", { x: "122.7", y: "0.4", width: "8.8", height: "39.2" }), jsxRuntime.jsx("path", { d: "M158.8,7.8c4,0.1,7.8,1.7,10.8,4.4l5-6.3c-4.4-3.7-10-5.7-15.7-5.7c-12.2,0-21.4,8.5-21.4,19.9s9,20,20.9,20 c5.7-0.1,11.2-1.9,15.9-5.1V19.8h-7.6v10.3c-2.4,1.3-5,2-7.7,2.1h-0.4c-6.7-0.1-12.1-5.6-12-12.3v-0.4 C146.7,13,152.2,7.7,158.8,7.8z" }), jsxRuntime.jsx("polygon", { points: "209.1,25.6 190.1,0.4 182,0.4 182,39.6 190.5,39.6 190.5,14.5 209.5,39.6 217.5,39.6 217.5,0.4 209.1,0.4" }), jsxRuntime.jsx("path", { d: "M263.3,18.8c4-0.9,6.9-4.5,6.8-8.6c0-6-5.4-9.8-14-9.8h-24.5v6.5l6.4,1v31.8h18.7c9.1,0,14.8-4.2,14.8-10.9 C271.7,23.8,268.2,19.5,263.3,18.8z M246.9,7.6h8.7c3.4-0.1,5.4,1.5,5.4,4.2s-2,4.4-5.4,4.4h-8.7V7.6z M255.7,32.4h-8.7v-9.3h8.7 c4.1,0,6.7,1.7,6.7,4.5C262.4,30.6,259.8,32.4,255.7,32.4z" }), jsxRuntime.jsx("path", { d: "M290.5,0.4l-17,39.2h9.1l3.1-7.6h18.2l3,7.6h9.5L299.6,0.4H290.5z M288.6,24.9l6.2-15.2l6.2,15.2L288.6,24.9z" }), jsxRuntime.jsx("path", { d: "M328.9,10.8c0-2.1,2-3.2,5-3.2s8.1,1.6,12.2,4l3.4-7.3C345,1.4,339.9,0,334.6,0c-9.1,0-15.2,4.5-15.2,11.6 c0,13.9,20.9,9.6,20.9,17c0,2.4-2.2,3.8-5.8,3.8c-4.1,0-9.9-2.3-13.9-5.9l-3.5,7.2c4.9,4,11,6.2,17.3,6.2c8.7,0,15.4-4.1,15.4-11.8 C349.8,13.9,328.9,18,328.9,10.8z" }), jsxRuntime.jsx("polygon", { points: "364.4,32.3 364.4,23.6 383.3,23.6 383.3,16.2 364.4,16.2 364.4,7.7 385.4,7.7 385.4,0.4 355.5,0.4 355.5,39.6 386,39.6 386,32.3" }), jsxRuntime.jsx("path", { d: "M23.1,0.4H0v6.5l6.5,1v31.8h16.3c12.4,0,21-8.1,21-19.6S35.2,0.4,23.1,0.4z M34.7,20.1c0,7.2-4.8,12.1-11.4,12.1h-8V7.8H23 C29.8,7.8,34.8,12.8,34.7,20.1L34.7,20.1z" })] }) }));
8344
8579
  };
8345
8580
  DesignBaseLogo.displayName = 'DesignBaseLogo';
8346
8581
 
8347
- const DesignBaseLogoMark = ({ size = 38, color = 'currentColor', className, }) => {
8582
+ const DesignBaseLogoMark = ({ size = 38, color, className, }) => {
8348
8583
  // 원본 비율 유지: 95:100
8349
8584
  const aspectRatio = 95 / 100;
8350
8585
  const width = size * aspectRatio;
8351
8586
  const height = size;
8352
- return (jsxRuntime.jsx("svg", { width: width, height: height, viewBox: "0 0 95 100", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, "aria-label": "DesignBase Mark", children: jsxRuntime.jsx("path", { fill: color, d: "M45,0H0V8l10,2V90L0,92v8H45A50,50,0,0,0,45,0ZM43.12,90H20V10H38.33a15,15,0,0,1,0,30H30.11V50h13a20,20,0,0,1,0,40ZM71.4,80A30,30,0,0,0,55.83,42.83,24.93,24.93,0,0,0,60.27,13,40,40,0,0,1,71.4,80Z" }) }));
8587
+ // color가 전달되지 않으면 원본 색상(검정) 사용, 전달되면 해당 색상 사용
8588
+ const fillColor = color || '#000000';
8589
+ return (jsxRuntime.jsx("svg", { width: width, height: height, viewBox: "0 0 95 100", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, "aria-label": "DesignBase Mark", children: jsxRuntime.jsx("path", { fill: fillColor, d: "M45,0H0V8l10,2V90L0,92v8H45A50,50,0,0,0,45,0ZM43.12,90H20V10H38.33a15,15,0,0,1,0,30H30.11V50h13a20,20,0,0,1,0,40ZM71.4,80A30,30,0,0,0,55.83,42.83,24.93,24.93,0,0,0,60.27,13,40,40,0,0,1,71.4,80Z" }) }));
8353
8590
  };
8354
8591
  DesignBaseLogoMark.displayName = 'DesignBaseLogoMark';
8355
8592
 
8356
- const Logo = ({ type = 'designbase', text = 'Logo', src, alt, size = 'm', variant = 'default', clickable = false, href, target = '_self', fullWidth = false, className, onClick, ...props }) => {
8357
- const classes = clsx('designbase-logo', `designbase-logo--${size}`, `designbase-logo--${variant}`, {
8593
+ const Logo = ({ type = 'designbase', text = 'Logo', src, alt, size = 'm', variant = 'original', clickable = false, href, target = '_self', fullWidth = false, className, onClick, ...props }) => {
8594
+ const classes = clsx('designbase-logo', `designbase-logo--${size}`, variant && `designbase-logo--${variant}`, {
8358
8595
  'designbase-logo--clickable': clickable || href,
8359
8596
  'designbase-logo--full-width': fullWidth,
8360
8597
  'designbase-logo--svg': type !== 'custom',
@@ -8380,12 +8617,18 @@
8380
8617
  };
8381
8618
  // variant별 색상 매핑
8382
8619
  const getLogoColor = () => {
8620
+ // original일 때는 undefined를 반환하여 SVG 원본 색상(검정) 사용
8621
+ // color prop을 전달하지 않으면 SVG 로고 컴포넌트가 원본 색상을 사용
8622
+ if (variant === 'original') {
8623
+ return undefined;
8624
+ }
8383
8625
  const colors = {
8626
+ light: '#ffffff', // 밝은 색상 (흰색)
8627
+ dark: '#000000', // 어두운 색상 (검정)
8384
8628
  default: 'var(--db-text-primary)',
8385
8629
  primary: 'var(--db-brand-primary)',
8386
8630
  secondary: 'var(--db-text-secondary)',
8387
- white: 'var(--db-text-inverse-primary)',
8388
- dark: 'var(--db-text-primary)',
8631
+ white: '#ffffff', // white는 light와 동일하게 처리
8389
8632
  };
8390
8633
  return colors[variant];
8391
8634
  };
@@ -8394,11 +8637,11 @@
8394
8637
  const color = getLogoColor();
8395
8638
  // DesignBase 풀 로고
8396
8639
  if (type === 'designbase') {
8397
- return (jsxRuntime.jsx(DesignBaseLogo, { width: width, height: height, color: color, className: "designbase-logo__svg" }));
8640
+ return (jsxRuntime.jsx(DesignBaseLogo, { width: width, height: height, ...(color !== undefined && { color }), className: "designbase-logo__svg" }));
8398
8641
  }
8399
8642
  // DesignBase 심볼 마크
8400
8643
  if (type === 'designbase-mark') {
8401
- return (jsxRuntime.jsx(DesignBaseLogoMark, { size: markSize, color: color, className: "designbase-logo__svg" }));
8644
+ return (jsxRuntime.jsx(DesignBaseLogoMark, { size: markSize, ...(color !== undefined && { color }), className: "designbase-logo__svg" }));
8402
8645
  }
8403
8646
  // 커스텀 로고
8404
8647
  if (src) {
@@ -11481,7 +11724,7 @@
11481
11724
  // 기본 상태 아이콘 (아이콘 패키지에서 가져온 아이콘 사용)
11482
11725
  const iconMap = {
11483
11726
  success: icons.CircleCheckFilledIcon,
11484
- error: icons.DeleteIcon,
11727
+ error: icons.ErrorIcon,
11485
11728
  warning: icons.WarningIcon,
11486
11729
  info: icons.InfoIcon,
11487
11730
  };