@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.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +41 -21
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.css.map +1 -1
- package/dist/index.esm.js +428 -185
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +427 -184
- package/dist/index.js.map +1 -1
- package/dist/index.umd.css +1 -1
- package/dist/index.umd.css.map +1 -1
- package/dist/index.umd.js +427 -184
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import React, { useState, useCallback, useEffect, useRef, useMemo, useContext, useLayoutEffect, forwardRef, useId, createContext } from 'react';
|
|
3
|
-
import { ChevronDownIcon, StarIcon, TrendingUpIcon, StarFilledIcon, CartIcon, CloseIcon, ArrowRightIcon, InfoFilledIcon, ErrorFilledIcon, WarningFilledIcon, CircleCheckFilledIcon, RefreshIcon, ChevronLeftIcon, PauseIcon, PlayIcon, ChevronRightIcon, RepeatIcon, MuteFilledIcon, VolumeUpIcon, SettingsIcon, UserIcon, HideIcon, ShowIcon, SearchIcon, ChevronUpIcon, GalleryIcon, HeartIcon, BookmarkIcon, ShareAltIcon, DownloadIcon, ArrowLeftIcon, ShrinkIcon, ExpandIcon, DoneIcon as DoneIcon$1, CopyIcon, EyedropperIcon, BulbIcon, CloudCloseIcon, BellActiveIcon, AwardIcon, CalendarIcon, PlusIcon, ErrorIcon, FileBlankIcon, ClockIcon, MinusIcon as MinusIcon$1, VideoIcon, CodeIcon, WriteIcon, UploadIcon, ArrowBarLeftIcon, ArrowBarRightIcon, StarHalfIcon, MoveIcon, MoreVerticalIcon, ArrowDownIcon, ArrowUpLeftIcon, ArrowUpRightIcon, ArrowDownLeftIcon, ArrowDownRightIcon, FacebookIcon, XIcon, InstagramIcon, LinkedinIcon, PinterestIcon, WhatsappIcon, TelegramIcon, MailIcon, LinkIcon, ScanQrcodeIcon, CaretUpdownFilledIcon,
|
|
3
|
+
import { ChevronDownIcon, StarIcon, TrendingUpIcon, StarFilledIcon, CartIcon, CloseIcon, ArrowRightIcon, InfoFilledIcon, ErrorFilledIcon, WarningFilledIcon, CircleCheckFilledIcon, RefreshIcon, ChevronLeftIcon, PauseIcon, PlayIcon, ChevronRightIcon, RepeatIcon, MuteFilledIcon, VolumeUpIcon, SettingsIcon, UserIcon, HideIcon, ShowIcon, SearchIcon, ChevronUpIcon, GalleryIcon, HeartIcon, BookmarkIcon, ShareAltIcon, DownloadIcon, ArrowLeftIcon, ShrinkIcon, ExpandIcon, DoneIcon as DoneIcon$1, CopyIcon, EyedropperIcon, BulbIcon, CloudCloseIcon, BellActiveIcon, AwardIcon, CalendarIcon, PlusIcon, ErrorIcon, FileBlankIcon, ClockIcon, MinusIcon as MinusIcon$1, VideoIcon, CodeIcon, WriteIcon, UploadIcon, ArrowBarLeftIcon, ArrowBarRightIcon, StarHalfIcon, MoveIcon, MoreVerticalIcon, ArrowDownIcon, ArrowUpLeftIcon, ArrowUpRightIcon, ArrowDownLeftIcon, ArrowDownRightIcon, FacebookIcon, XIcon, InstagramIcon, LinkedinIcon, PinterestIcon, WhatsappIcon, TelegramIcon, MailIcon, LinkIcon, ScanQrcodeIcon, CaretUpdownFilledIcon, WarningIcon, InfoIcon } from '@designbasekorea/icons';
|
|
4
4
|
import { flushSync, createPortal } from 'react-dom';
|
|
5
5
|
|
|
6
6
|
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
@@ -2897,197 +2897,429 @@ var classnames = {exports: {}};
|
|
|
2897
2897
|
var classnamesExports = classnames.exports;
|
|
2898
2898
|
var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
|
|
2899
2899
|
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
const
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
return () => clearTimeout(timer);
|
|
2911
|
-
}
|
|
2912
|
-
else {
|
|
2913
|
-
setIsVisible(true);
|
|
2900
|
+
/**
|
|
2901
|
+
* Canvas 렌더러: particles, stars, wave, pulse
|
|
2902
|
+
*/
|
|
2903
|
+
const hexToRgb$1 = (hex) => {
|
|
2904
|
+
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
2905
|
+
return result
|
|
2906
|
+
? {
|
|
2907
|
+
r: parseInt(result[1], 16),
|
|
2908
|
+
g: parseInt(result[2], 16),
|
|
2909
|
+
b: parseInt(result[3], 16),
|
|
2914
2910
|
}
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2911
|
+
: { r: 0, g: 0, b: 0 };
|
|
2912
|
+
};
|
|
2913
|
+
const drawParticles = (ctx, width, height, particlesRef, options) => {
|
|
2914
|
+
if (particlesRef.current.length !== options.count) {
|
|
2915
|
+
particlesRef.current = Array.from({ length: options.count }).map(() => ({
|
|
2916
|
+
x: Math.random() * width,
|
|
2917
|
+
y: Math.random() * height,
|
|
2918
|
+
vx: (Math.random() - 0.5) * 1.5,
|
|
2919
|
+
vy: (Math.random() - 0.5) * 1.5,
|
|
2920
|
+
size: Math.random() * options.size + 1,
|
|
2921
|
+
color: options.colors[Math.floor(Math.random() * options.colors.length)],
|
|
2922
|
+
}));
|
|
2923
|
+
}
|
|
2924
|
+
const particles = particlesRef.current;
|
|
2925
|
+
const interactionRadius = 150;
|
|
2926
|
+
particles.forEach((p, i) => {
|
|
2927
|
+
p.x += p.vx;
|
|
2928
|
+
p.y += p.vy;
|
|
2929
|
+
if (p.x < 0 || p.x > width)
|
|
2930
|
+
p.vx *= -1;
|
|
2931
|
+
if (p.y < 0 || p.y > height)
|
|
2932
|
+
p.vy *= -1;
|
|
2933
|
+
if (options.clickable) {
|
|
2934
|
+
const dx = options.mouse.x - p.x;
|
|
2935
|
+
const dy = options.mouse.y - p.y;
|
|
2936
|
+
const distance = Math.sqrt(dx * dx + dy * dy);
|
|
2937
|
+
if (distance < interactionRadius) {
|
|
2938
|
+
const force = (interactionRadius - distance) / interactionRadius;
|
|
2939
|
+
p.vx += (dx / distance) * force * 0.5;
|
|
2940
|
+
p.vy += (dy / distance) * force * 0.5;
|
|
2941
|
+
}
|
|
2942
|
+
const maxSpeed = 3;
|
|
2943
|
+
const speed = Math.sqrt(p.vx * p.vx + p.vy * p.vy);
|
|
2944
|
+
if (speed > maxSpeed) {
|
|
2945
|
+
p.vx = (p.vx / speed) * maxSpeed;
|
|
2946
|
+
p.vy = (p.vy / speed) * maxSpeed;
|
|
2947
|
+
}
|
|
2948
|
+
}
|
|
2949
|
+
ctx.beginPath();
|
|
2950
|
+
ctx.arc(p.x, p.y, p.size, 0, Math.PI * 2);
|
|
2951
|
+
ctx.fillStyle = p.color;
|
|
2952
|
+
ctx.fill();
|
|
2953
|
+
for (let j = i + 1; j < particles.length; j++) {
|
|
2954
|
+
const p2 = particles[j];
|
|
2955
|
+
const dx = p.x - p2.x;
|
|
2956
|
+
const dy = p.y - p2.y;
|
|
2957
|
+
const dist = Math.sqrt(dx * dx + dy * dy);
|
|
2958
|
+
if (dist < 100) {
|
|
2959
|
+
ctx.beginPath();
|
|
2960
|
+
ctx.strokeStyle = p.color;
|
|
2961
|
+
ctx.globalAlpha = 1 - dist / 100;
|
|
2962
|
+
ctx.lineWidth = 0.5;
|
|
2963
|
+
ctx.moveTo(p.x, p.y);
|
|
2964
|
+
ctx.lineTo(p2.x, p2.y);
|
|
2965
|
+
ctx.stroke();
|
|
2966
|
+
ctx.globalAlpha = 1;
|
|
2932
2967
|
}
|
|
2933
2968
|
}
|
|
2934
|
-
}
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
const
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2969
|
+
});
|
|
2970
|
+
};
|
|
2971
|
+
const drawStars = (ctx, width, height, starsRef, options) => {
|
|
2972
|
+
if (starsRef.current.length !== options.count) {
|
|
2973
|
+
starsRef.current = Array.from({ length: options.count }).map(() => ({
|
|
2974
|
+
x: Math.random() * width,
|
|
2975
|
+
y: Math.random() * height,
|
|
2976
|
+
size: Math.random() * options.size,
|
|
2977
|
+
blinkSpeed: Math.random() * 0.05 + 0.01,
|
|
2978
|
+
color: options.colors[Math.floor(Math.random() * options.colors.length)],
|
|
2979
|
+
}));
|
|
2980
|
+
}
|
|
2981
|
+
starsRef.current.forEach(star => {
|
|
2982
|
+
star.y -= 0.05;
|
|
2983
|
+
if (star.y < 0)
|
|
2984
|
+
star.y = height;
|
|
2985
|
+
const opacity = 0.5 + Math.sin(options.time * star.blinkSpeed) * 0.5;
|
|
2986
|
+
ctx.beginPath();
|
|
2987
|
+
ctx.arc(star.x, star.y, star.size, 0, Math.PI * 2);
|
|
2988
|
+
ctx.fillStyle = star.color;
|
|
2989
|
+
ctx.globalAlpha = opacity;
|
|
2990
|
+
ctx.fill();
|
|
2991
|
+
ctx.globalAlpha = 1;
|
|
2992
|
+
});
|
|
2993
|
+
};
|
|
2994
|
+
const drawWaves = (ctx, width, height, options) => {
|
|
2995
|
+
const { colors, offset, speedFactor } = options;
|
|
2996
|
+
offset.current += 0.02 * speedFactor;
|
|
2997
|
+
colors.forEach((color, i) => {
|
|
2998
|
+
ctx.beginPath();
|
|
2999
|
+
ctx.moveTo(0, height);
|
|
3000
|
+
const freq = 0.003 + i * 0.001;
|
|
3001
|
+
const amp = 30 + i * 20;
|
|
3002
|
+
const phase = offset.current + i * 2;
|
|
3003
|
+
for (let x = 0; x <= width; x += 10) {
|
|
3004
|
+
const y = height / 2 +
|
|
3005
|
+
Math.sin(x * freq + phase) * amp +
|
|
3006
|
+
Math.sin(x * 0.001 + phase * 0.5) * 50;
|
|
3007
|
+
ctx.lineTo(x, y);
|
|
3008
|
+
}
|
|
3009
|
+
ctx.lineTo(width, height);
|
|
3010
|
+
ctx.lineTo(0, height);
|
|
3011
|
+
ctx.closePath();
|
|
3012
|
+
ctx.fillStyle = color;
|
|
3013
|
+
ctx.fill();
|
|
3014
|
+
});
|
|
3015
|
+
};
|
|
3016
|
+
const drawPulse = (ctx, width, height, options) => {
|
|
3017
|
+
const { colors, time, intensity } = options;
|
|
3018
|
+
const centerX = width / 2;
|
|
3019
|
+
const centerY = height / 2;
|
|
3020
|
+
const maxRadius = Math.max(width, height) * 0.8;
|
|
3021
|
+
const intensityMap = { subtle: 0.5, medium: 1, vivid: 1.5 };
|
|
3022
|
+
const factor = intensityMap[intensity];
|
|
3023
|
+
colors.forEach((color, i) => {
|
|
3024
|
+
const t = time * 0.02 * factor + (i * (Math.PI * 2)) / colors.length;
|
|
3025
|
+
const radius = (Math.sin(t) * 0.2 + 0.5) * maxRadius;
|
|
3026
|
+
const alpha = (Math.sin(t + Math.PI) * 0.2 + 0.3) * factor;
|
|
3027
|
+
const gradient = ctx.createRadialGradient(centerX, centerY, 0, centerX, centerY, radius);
|
|
3028
|
+
const rgb = hexToRgb$1(color);
|
|
3029
|
+
gradient.addColorStop(0, `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, 0)`);
|
|
3030
|
+
gradient.addColorStop(0.5, `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${alpha * 0.5})`);
|
|
3031
|
+
gradient.addColorStop(1, `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, 0)`);
|
|
3032
|
+
ctx.fillStyle = gradient;
|
|
3033
|
+
ctx.fillRect(0, 0, width, height);
|
|
3034
|
+
});
|
|
3035
|
+
};
|
|
3036
|
+
|
|
3037
|
+
const CanvasLayer = ({ type, colors, speed, particleCount, particleSize, starCount, starSize, intensity, clickable, }) => {
|
|
3038
|
+
const canvasRef = useRef(null);
|
|
3039
|
+
const containerRef = useRef(null);
|
|
3040
|
+
const requestRef = useRef(undefined);
|
|
3041
|
+
const frameCountRef = useRef(0);
|
|
3042
|
+
const mouseRef = useRef({ x: -9999, y: -9999 });
|
|
3043
|
+
const particlesRef = useRef([]);
|
|
3044
|
+
const starsRef = useRef([]);
|
|
3045
|
+
const waveOffsetRef = useRef(0);
|
|
3046
|
+
const handleResize = useCallback(() => {
|
|
3047
|
+
const canvas = canvasRef.current;
|
|
3048
|
+
const container = containerRef.current;
|
|
3049
|
+
if (!canvas || !container)
|
|
3050
|
+
return;
|
|
3051
|
+
const dpr = window.devicePixelRatio || 1;
|
|
3052
|
+
const rect = container.getBoundingClientRect();
|
|
3053
|
+
canvas.width = rect.width * dpr;
|
|
3054
|
+
canvas.height = rect.height * dpr;
|
|
3055
|
+
canvas.style.width = `${rect.width}px`;
|
|
3056
|
+
canvas.style.height = `${rect.height}px`;
|
|
3057
|
+
const ctx = canvas.getContext('2d');
|
|
3058
|
+
if (ctx)
|
|
3059
|
+
ctx.scale(dpr, dpr);
|
|
3060
|
+
}, []);
|
|
3061
|
+
const animate = useCallback(() => {
|
|
3062
|
+
const canvas = canvasRef.current;
|
|
3063
|
+
if (!canvas)
|
|
3064
|
+
return;
|
|
3065
|
+
const ctx = canvas.getContext('2d');
|
|
3066
|
+
if (!ctx)
|
|
3067
|
+
return;
|
|
3068
|
+
const dpr = window.devicePixelRatio || 1;
|
|
3069
|
+
const width = canvas.width / dpr;
|
|
3070
|
+
const height = canvas.height / dpr;
|
|
3071
|
+
ctx.clearRect(0, 0, width, height);
|
|
3072
|
+
const time = frameCountRef.current * (3000 / (speed || 3000));
|
|
3073
|
+
frameCountRef.current += 1;
|
|
3074
|
+
switch (type) {
|
|
3075
|
+
case 'particles':
|
|
3076
|
+
drawParticles(ctx, width, height, particlesRef, {
|
|
3077
|
+
count: particleCount,
|
|
3078
|
+
colors,
|
|
3079
|
+
size: particleSize,
|
|
3080
|
+
mouse: mouseRef.current,
|
|
3081
|
+
clickable,
|
|
2985
3082
|
});
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
}
|
|
3010
|
-
else {
|
|
3011
|
-
const angle = direction === 'left' ? '90deg' :
|
|
3012
|
-
direction === 'right' ? '270deg' :
|
|
3013
|
-
direction === 'up' ? '0deg' :
|
|
3014
|
-
direction === 'down' ? '180deg' :
|
|
3015
|
-
direction === 'diagonal' ? '45deg' : '90deg';
|
|
3016
|
-
return {
|
|
3017
|
-
background: `linear-gradient(${angle}, ${gradientColors.join(', ')})`,
|
|
3018
|
-
backgroundSize: '400% 400%',
|
|
3019
|
-
};
|
|
3020
|
-
}
|
|
3021
|
-
}
|
|
3022
|
-
return {};
|
|
3023
|
-
};
|
|
3024
|
-
const getWaveStyle = () => {
|
|
3025
|
-
if (type === 'wave') {
|
|
3026
|
-
return {
|
|
3027
|
-
'--wave-colors': colors.join(', '),
|
|
3028
|
-
};
|
|
3029
|
-
}
|
|
3030
|
-
return {};
|
|
3031
|
-
};
|
|
3032
|
-
const getAuroraStyle = () => {
|
|
3033
|
-
if (type === 'aurora') {
|
|
3034
|
-
return {
|
|
3035
|
-
'--aurora-colors': colors.join(', '),
|
|
3036
|
-
};
|
|
3037
|
-
}
|
|
3038
|
-
return {};
|
|
3039
|
-
};
|
|
3040
|
-
const getFireStyle = () => {
|
|
3041
|
-
if (type === 'fire') {
|
|
3042
|
-
return {
|
|
3043
|
-
'--fire-colors': colors.join(', '),
|
|
3044
|
-
};
|
|
3083
|
+
break;
|
|
3084
|
+
case 'stars':
|
|
3085
|
+
drawStars(ctx, width, height, starsRef, {
|
|
3086
|
+
count: starCount,
|
|
3087
|
+
colors,
|
|
3088
|
+
size: starSize,
|
|
3089
|
+
time,
|
|
3090
|
+
});
|
|
3091
|
+
break;
|
|
3092
|
+
case 'wave':
|
|
3093
|
+
drawWaves(ctx, width, height, {
|
|
3094
|
+
colors,
|
|
3095
|
+
offset: waveOffsetRef,
|
|
3096
|
+
speedFactor: 10000 / (speed || 5000),
|
|
3097
|
+
});
|
|
3098
|
+
break;
|
|
3099
|
+
case 'pulse':
|
|
3100
|
+
drawPulse(ctx, width, height, {
|
|
3101
|
+
colors,
|
|
3102
|
+
time,
|
|
3103
|
+
intensity,
|
|
3104
|
+
});
|
|
3105
|
+
break;
|
|
3045
3106
|
}
|
|
3046
|
-
|
|
3107
|
+
requestRef.current = requestAnimationFrame(animate);
|
|
3108
|
+
}, [
|
|
3109
|
+
type,
|
|
3110
|
+
colors,
|
|
3111
|
+
speed,
|
|
3112
|
+
particleCount,
|
|
3113
|
+
particleSize,
|
|
3114
|
+
starCount,
|
|
3115
|
+
starSize,
|
|
3116
|
+
intensity,
|
|
3117
|
+
clickable,
|
|
3118
|
+
]);
|
|
3119
|
+
useEffect(() => {
|
|
3120
|
+
handleResize();
|
|
3121
|
+
window.addEventListener('resize', handleResize);
|
|
3122
|
+
particlesRef.current = [];
|
|
3123
|
+
starsRef.current = [];
|
|
3124
|
+
waveOffsetRef.current = 0;
|
|
3125
|
+
frameCountRef.current = 0;
|
|
3126
|
+
requestRef.current = requestAnimationFrame(animate);
|
|
3127
|
+
return () => {
|
|
3128
|
+
window.removeEventListener('resize', handleResize);
|
|
3129
|
+
if (requestRef.current)
|
|
3130
|
+
cancelAnimationFrame(requestRef.current);
|
|
3131
|
+
};
|
|
3132
|
+
}, [animate, handleResize]);
|
|
3133
|
+
const handleMouseMove = (e) => {
|
|
3134
|
+
if (!containerRef.current)
|
|
3135
|
+
return;
|
|
3136
|
+
const rect = containerRef.current.getBoundingClientRect();
|
|
3137
|
+
mouseRef.current = {
|
|
3138
|
+
x: e.clientX - rect.left,
|
|
3139
|
+
y: e.clientY - rect.top,
|
|
3140
|
+
};
|
|
3047
3141
|
};
|
|
3048
|
-
const
|
|
3049
|
-
|
|
3050
|
-
return {
|
|
3051
|
-
'--ocean-colors': colors.join(', '),
|
|
3052
|
-
};
|
|
3053
|
-
}
|
|
3054
|
-
return {};
|
|
3142
|
+
const handleMouseLeave = () => {
|
|
3143
|
+
mouseRef.current = { x: -9999, y: -9999 };
|
|
3055
3144
|
};
|
|
3056
|
-
|
|
3057
|
-
|
|
3145
|
+
return (jsx("div", { ref: containerRef, className: "designbase-animation-background__canvas-layer", onMouseMove: handleMouseMove, onMouseLeave: handleMouseLeave, children: jsx("canvas", { ref: canvasRef, className: "designbase-animation-background__canvas" }) }));
|
|
3146
|
+
};
|
|
3147
|
+
|
|
3148
|
+
const CSSGradientLayer = ({ type, direction, colors, speed, }) => {
|
|
3149
|
+
const getBackgroundStyle = () => {
|
|
3150
|
+
const safeColors = colors.length > 0 ? colors : ['#ccc'];
|
|
3151
|
+
const gradientStr = safeColors.join(', ');
|
|
3152
|
+
if (type === 'gradient') {
|
|
3153
|
+
let angle = '90deg';
|
|
3154
|
+
switch (direction) {
|
|
3155
|
+
case 'up':
|
|
3156
|
+
angle = '0deg';
|
|
3157
|
+
break;
|
|
3158
|
+
case 'down':
|
|
3159
|
+
angle = '180deg';
|
|
3160
|
+
break;
|
|
3161
|
+
case 'left':
|
|
3162
|
+
angle = '270deg';
|
|
3163
|
+
break;
|
|
3164
|
+
case 'right':
|
|
3165
|
+
angle = '90deg';
|
|
3166
|
+
break;
|
|
3167
|
+
case 'diagonal':
|
|
3168
|
+
angle = '45deg';
|
|
3169
|
+
break;
|
|
3170
|
+
case 'radial':
|
|
3171
|
+
return {
|
|
3172
|
+
backgroundImage: `radial-gradient(circle, ${gradientStr})`,
|
|
3173
|
+
backgroundSize: '200% 200%',
|
|
3174
|
+
};
|
|
3175
|
+
}
|
|
3058
3176
|
return {
|
|
3059
|
-
|
|
3177
|
+
backgroundImage: `linear-gradient(${angle}, ${gradientStr})`,
|
|
3178
|
+
backgroundSize: '200% 200%',
|
|
3060
3179
|
};
|
|
3061
3180
|
}
|
|
3062
3181
|
return {};
|
|
3063
3182
|
};
|
|
3064
|
-
const
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3183
|
+
const duration = `${Math.max(2, speed / 1000)}s`;
|
|
3184
|
+
return (jsx("div", { className: "designbase-animation-background__css-layer", style: {
|
|
3185
|
+
...getBackgroundStyle(),
|
|
3186
|
+
animation: `designbase-gradient-move ${duration} ease infinite`,
|
|
3187
|
+
}, children: jsx("style", { children: `
|
|
3188
|
+
@keyframes designbase-gradient-move {
|
|
3189
|
+
0% { background-position: 0% 50%; }
|
|
3190
|
+
50% { background-position: 100% 50%; }
|
|
3191
|
+
100% { background-position: 0% 50%; }
|
|
3192
|
+
}
|
|
3193
|
+
` }) }));
|
|
3194
|
+
};
|
|
3195
|
+
|
|
3196
|
+
const MeshAuroraLayer = ({ colors, speed, blur, intensity, theme, }) => {
|
|
3197
|
+
const baseOpacity = intensity === 'subtle' ? 0.3 : intensity === 'medium' ? 0.6 : 0.8;
|
|
3198
|
+
const duration = Math.max(5, speed / 1000);
|
|
3199
|
+
const palette = colors.length >= 3
|
|
3200
|
+
? colors
|
|
3201
|
+
: ['#4f46e5', '#ec4899', '#06b6d4', '#8b5cf6'];
|
|
3202
|
+
const blendMode = theme === 'dark' ? 'screen' : 'multiply';
|
|
3203
|
+
const filterStyle = `blur(${blur}px)`;
|
|
3204
|
+
const blobBaseClass = 'designbase-animation-background__aurora-blob';
|
|
3205
|
+
return (jsxs("div", { className: "designbase-animation-background__aurora-mesh", children: [jsx("div", { className: blobBaseClass, style: {
|
|
3206
|
+
backgroundColor: palette[0],
|
|
3207
|
+
filter: filterStyle,
|
|
3208
|
+
opacity: baseOpacity,
|
|
3209
|
+
animationDuration: `${duration}s`,
|
|
3210
|
+
top: '-10%',
|
|
3211
|
+
left: '-10%',
|
|
3212
|
+
animationDelay: '0s',
|
|
3213
|
+
mixBlendMode: blendMode,
|
|
3214
|
+
} }), jsx("div", { className: blobBaseClass, style: {
|
|
3215
|
+
backgroundColor: palette[1],
|
|
3216
|
+
filter: filterStyle,
|
|
3217
|
+
opacity: baseOpacity,
|
|
3218
|
+
animationDuration: `${duration * 1.2}s`,
|
|
3219
|
+
top: '-10%',
|
|
3220
|
+
right: '-10%',
|
|
3221
|
+
animationDelay: '2s',
|
|
3222
|
+
mixBlendMode: blendMode,
|
|
3223
|
+
} }), jsx("div", { className: blobBaseClass, style: {
|
|
3224
|
+
backgroundColor: palette[2],
|
|
3225
|
+
filter: filterStyle,
|
|
3226
|
+
opacity: baseOpacity,
|
|
3227
|
+
animationDuration: `${duration * 1.5}s`,
|
|
3228
|
+
bottom: '-20%',
|
|
3229
|
+
left: '20%',
|
|
3230
|
+
animationDelay: '4s',
|
|
3231
|
+
mixBlendMode: blendMode,
|
|
3232
|
+
} }), palette[3] && (jsx("div", { className: blobBaseClass, style: {
|
|
3233
|
+
backgroundColor: palette[3],
|
|
3234
|
+
filter: filterStyle,
|
|
3235
|
+
opacity: baseOpacity,
|
|
3236
|
+
animationDuration: `${duration * 1.1}s`,
|
|
3237
|
+
bottom: '-10%',
|
|
3238
|
+
right: '-10%',
|
|
3239
|
+
animationDelay: '1s',
|
|
3240
|
+
mixBlendMode: blendMode,
|
|
3241
|
+
} })), jsx("div", { className: "designbase-animation-background__aurora-noise", style: {
|
|
3242
|
+
opacity: theme === 'dark' ? 0.03 : 0.05,
|
|
3243
|
+
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")`,
|
|
3244
|
+
} })] }));
|
|
3245
|
+
};
|
|
3246
|
+
|
|
3247
|
+
const GridOverlay = ({ size = 40, color = '#ffffff', opacity = 0.1, }) => {
|
|
3070
3248
|
const style = {
|
|
3249
|
+
position: 'absolute',
|
|
3250
|
+
inset: 0,
|
|
3251
|
+
width: '100%',
|
|
3252
|
+
height: '100%',
|
|
3253
|
+
pointerEvents: 'none',
|
|
3254
|
+
zIndex: 1,
|
|
3255
|
+
backgroundImage: `
|
|
3256
|
+
linear-gradient(to right, ${color} 1px, transparent 1px),
|
|
3257
|
+
linear-gradient(to bottom, ${color} 1px, transparent 1px)
|
|
3258
|
+
`,
|
|
3259
|
+
backgroundSize: `${size}px ${size}px`,
|
|
3260
|
+
opacity,
|
|
3261
|
+
// 은은하게 전체에 라인 유지, 맨 아래만 살짝 페이드
|
|
3262
|
+
maskImage: 'linear-gradient(to bottom, black 0%, black 92%, transparent 100%)',
|
|
3263
|
+
WebkitMaskImage: 'linear-gradient(to bottom, black 0%, black 92%, transparent 100%)',
|
|
3264
|
+
};
|
|
3265
|
+
return jsx("div", { className: "designbase-animation-background__grid-overlay", style: style });
|
|
3266
|
+
};
|
|
3267
|
+
|
|
3268
|
+
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, }) => {
|
|
3269
|
+
const backgroundColor = theme === 'dark' ? 'var(--db-surface-base, #0f172a)' : 'var(--db-surface-base, #ffffff)';
|
|
3270
|
+
const effectiveGridColor = gridColor ?? (theme === 'dark' ? '#ffffff' : '#000000');
|
|
3271
|
+
const containerStyle = {
|
|
3071
3272
|
width: typeof width === 'number' ? `${width}px` : width,
|
|
3072
3273
|
height: typeof height === 'number' ? `${height}px` : height,
|
|
3073
3274
|
borderRadius: typeof borderRadius === 'number' ? `${borderRadius}px` : borderRadius,
|
|
3074
3275
|
opacity,
|
|
3075
3276
|
mixBlendMode: blendMode,
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
...getFireStyle(),
|
|
3080
|
-
...getOceanStyle(),
|
|
3081
|
-
...getSunsetStyle(),
|
|
3082
|
-
'--db-animation-speed': `${speed}ms`,
|
|
3277
|
+
position: 'relative',
|
|
3278
|
+
overflow: 'hidden',
|
|
3279
|
+
backgroundColor: type !== 'gradient' ? backgroundColor : undefined,
|
|
3083
3280
|
};
|
|
3084
|
-
const
|
|
3085
|
-
if (
|
|
3086
|
-
return
|
|
3281
|
+
const content = useMemo(() => {
|
|
3282
|
+
if (disabled)
|
|
3283
|
+
return null;
|
|
3284
|
+
switch (type) {
|
|
3285
|
+
case 'particles':
|
|
3286
|
+
case 'stars':
|
|
3287
|
+
case 'wave':
|
|
3288
|
+
case 'pulse':
|
|
3289
|
+
return (jsx(CanvasLayer, { type: type, colors: colors, speed: speed, particleCount: particleCount, particleSize: particleSize, starCount: starCount, starSize: starSize, intensity: intensity, clickable: clickable }));
|
|
3290
|
+
case 'aurora':
|
|
3291
|
+
return (jsx(MeshAuroraLayer, { colors: colors, speed: speed, blur: blur, intensity: intensity, theme: theme }));
|
|
3292
|
+
case 'gradient':
|
|
3293
|
+
return (jsx(CSSGradientLayer, { type: type, direction: direction, colors: colors, speed: speed }));
|
|
3294
|
+
default:
|
|
3295
|
+
return null;
|
|
3087
3296
|
}
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3297
|
+
}, [
|
|
3298
|
+
type,
|
|
3299
|
+
disabled,
|
|
3300
|
+
colors,
|
|
3301
|
+
speed,
|
|
3302
|
+
intensity,
|
|
3303
|
+
blur,
|
|
3304
|
+
theme,
|
|
3305
|
+
particleCount,
|
|
3306
|
+
particleSize,
|
|
3307
|
+
starCount,
|
|
3308
|
+
starSize,
|
|
3309
|
+
clickable,
|
|
3310
|
+
direction,
|
|
3311
|
+
]);
|
|
3312
|
+
const classes = classNames('designbase-animation-background', `designbase-animation-background--${type}`, {
|
|
3313
|
+
'designbase-animation-background--clickable': clickable,
|
|
3314
|
+
'designbase-animation-background--disabled': disabled,
|
|
3315
|
+
}, className);
|
|
3316
|
+
return (jsxs("div", { className: classes, style: containerStyle, onClick: clickable && !disabled ? onClick : undefined, children: [jsx("div", { className: "designbase-animation-background__layers", style: {
|
|
3317
|
+
position: 'absolute',
|
|
3318
|
+
inset: 0,
|
|
3319
|
+
width: '100%',
|
|
3320
|
+
height: '100%',
|
|
3321
|
+
zIndex: 0,
|
|
3322
|
+
}, children: content }), showGrid && (jsx(GridOverlay, { size: gridSize, color: effectiveGridColor, opacity: gridOpacity })), children && (jsx("div", { className: "designbase-animation-background__content", style: { position: 'relative', zIndex: 10, width: '100%', height: '100%' }, children: children }))] }));
|
|
3091
3323
|
};
|
|
3092
3324
|
|
|
3093
3325
|
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, }) => {
|
|
@@ -4253,7 +4485,7 @@ const SearchBar = ({ value, defaultValue = '', placeholder = '검색...', size =
|
|
|
4253
4485
|
};
|
|
4254
4486
|
SearchBar.displayName = 'SearchBar';
|
|
4255
4487
|
|
|
4256
|
-
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 }) => {
|
|
4488
|
+
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 }) => {
|
|
4257
4489
|
const [isOpen, setIsOpen] = useState(false);
|
|
4258
4490
|
const [selectedValue, setSelectedValue] = useState(value ?? defaultValue ?? (multiple ? [] : ''));
|
|
4259
4491
|
const [searchTerm, setSearchTerm] = useState('');
|
|
@@ -4412,6 +4644,7 @@ const Select = ({ value, defaultValue, options, label, placeholder = '선택하
|
|
|
4412
4644
|
});
|
|
4413
4645
|
const dropdownClasses = clsx('designbase-select__dropdown', `designbase-select__dropdown--${dropdownWidth}`, `designbase-select__dropdown--${position}`, {
|
|
4414
4646
|
'designbase-select__dropdown--open': isOpen,
|
|
4647
|
+
'designbase-select__dropdown--mobile-sheet': useMobileBottomSheet,
|
|
4415
4648
|
});
|
|
4416
4649
|
const filteredOptions = getFilteredOptions();
|
|
4417
4650
|
const selectedLabels = getSelectedLabels();
|
|
@@ -7812,7 +8045,7 @@ const Stat = ({ value, label, icon, iconPosition = 'left', size = 'm', variant =
|
|
|
7812
8045
|
return;
|
|
7813
8046
|
onClick?.();
|
|
7814
8047
|
};
|
|
7815
|
-
return (jsxs("div", { className: classes, style: customStyle, onClick: handleClick, role: clickable ? 'button' : undefined, tabIndex: clickable ? 0 : undefined, children: [icon && (jsx("div", { className: clsx('designbase-stat__icon', `designbase-stat__icon--${iconPosition}`), children: icon })), jsxs("div", { className: "designbase-stat__content", children: [
|
|
8048
|
+
return (jsxs("div", { className: classes, style: customStyle, onClick: handleClick, role: clickable ? 'button' : undefined, tabIndex: clickable ? 0 : undefined, children: [icon && (jsx("div", { className: clsx('designbase-stat__icon', `designbase-stat__icon--${iconPosition}`), children: icon })), jsxs("div", { className: "designbase-stat__content", children: [jsx("div", { className: "designbase-stat__main", children: variant === 'iconBox' ? (jsxs(Fragment, { children: [jsx("div", { className: "designbase-stat__label", children: label }), jsx("div", { className: "designbase-stat__value", children: value })] })) : (jsxs(Fragment, { children: [jsx("div", { className: "designbase-stat__value", children: value }), jsx("div", { className: "designbase-stat__label", children: label })] })) }), showChange && change && (jsx("div", { className: clsx('designbase-stat__change', getChangeClass()), children: getChangeText() })), showDescription && description && (jsx("div", { className: "designbase-stat__description", children: description }))] }), showProgress && typeof progress === 'number' && (jsx("div", { className: "designbase-stat__progress", children: 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' }) }))] }));
|
|
7816
8049
|
};
|
|
7817
8050
|
|
|
7818
8051
|
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, }) => {
|
|
@@ -8338,22 +8571,26 @@ const List = ({ items, size = 'm', variant = 'default', itemType = 'default', la
|
|
|
8338
8571
|
return (jsx("div", { className: classes, children: items.map((item, index) => renderItem(item, index)) }));
|
|
8339
8572
|
};
|
|
8340
8573
|
|
|
8341
|
-
const DesignBaseLogo = ({ width = 193, height = 40, color
|
|
8342
|
-
|
|
8574
|
+
const DesignBaseLogo = ({ width = 193, height = 40, color, className, }) => {
|
|
8575
|
+
// color가 전달되지 않으면 원본 색상(검정) 사용, 전달되면 해당 색상 사용
|
|
8576
|
+
const fillColor = color || '#000000';
|
|
8577
|
+
return (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: jsxs("g", { fill: fillColor, children: [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" }), 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" }), jsx("rect", { x: "122.7", y: "0.4", width: "8.8", height: "39.2" }), 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" }), 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" }), 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" }), 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" }), 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" }), 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" }), 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" })] }) }));
|
|
8343
8578
|
};
|
|
8344
8579
|
DesignBaseLogo.displayName = 'DesignBaseLogo';
|
|
8345
8580
|
|
|
8346
|
-
const DesignBaseLogoMark = ({ size = 38, color
|
|
8581
|
+
const DesignBaseLogoMark = ({ size = 38, color, className, }) => {
|
|
8347
8582
|
// 원본 비율 유지: 95:100
|
|
8348
8583
|
const aspectRatio = 95 / 100;
|
|
8349
8584
|
const width = size * aspectRatio;
|
|
8350
8585
|
const height = size;
|
|
8351
|
-
|
|
8586
|
+
// color가 전달되지 않으면 원본 색상(검정) 사용, 전달되면 해당 색상 사용
|
|
8587
|
+
const fillColor = color || '#000000';
|
|
8588
|
+
return (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: 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" }) }));
|
|
8352
8589
|
};
|
|
8353
8590
|
DesignBaseLogoMark.displayName = 'DesignBaseLogoMark';
|
|
8354
8591
|
|
|
8355
|
-
const Logo = ({ type = 'designbase', text = 'Logo', src, alt, size = 'm', variant = '
|
|
8356
|
-
const classes = clsx('designbase-logo', `designbase-logo--${size}`, `designbase-logo--${variant}`, {
|
|
8592
|
+
const Logo = ({ type = 'designbase', text = 'Logo', src, alt, size = 'm', variant = 'original', clickable = false, href, target = '_self', fullWidth = false, className, onClick, ...props }) => {
|
|
8593
|
+
const classes = clsx('designbase-logo', `designbase-logo--${size}`, variant && `designbase-logo--${variant}`, {
|
|
8357
8594
|
'designbase-logo--clickable': clickable || href,
|
|
8358
8595
|
'designbase-logo--full-width': fullWidth,
|
|
8359
8596
|
'designbase-logo--svg': type !== 'custom',
|
|
@@ -8379,12 +8616,18 @@ const Logo = ({ type = 'designbase', text = 'Logo', src, alt, size = 'm', varian
|
|
|
8379
8616
|
};
|
|
8380
8617
|
// variant별 색상 매핑
|
|
8381
8618
|
const getLogoColor = () => {
|
|
8619
|
+
// original일 때는 undefined를 반환하여 SVG 원본 색상(검정) 사용
|
|
8620
|
+
// color prop을 전달하지 않으면 SVG 로고 컴포넌트가 원본 색상을 사용
|
|
8621
|
+
if (variant === 'original') {
|
|
8622
|
+
return undefined;
|
|
8623
|
+
}
|
|
8382
8624
|
const colors = {
|
|
8625
|
+
light: '#ffffff', // 밝은 색상 (흰색)
|
|
8626
|
+
dark: '#000000', // 어두운 색상 (검정)
|
|
8383
8627
|
default: 'var(--db-text-primary)',
|
|
8384
8628
|
primary: 'var(--db-brand-primary)',
|
|
8385
8629
|
secondary: 'var(--db-text-secondary)',
|
|
8386
|
-
white: '
|
|
8387
|
-
dark: 'var(--db-text-primary)',
|
|
8630
|
+
white: '#ffffff', // white는 light와 동일하게 처리
|
|
8388
8631
|
};
|
|
8389
8632
|
return colors[variant];
|
|
8390
8633
|
};
|
|
@@ -8393,11 +8636,11 @@ const Logo = ({ type = 'designbase', text = 'Logo', src, alt, size = 'm', varian
|
|
|
8393
8636
|
const color = getLogoColor();
|
|
8394
8637
|
// DesignBase 풀 로고
|
|
8395
8638
|
if (type === 'designbase') {
|
|
8396
|
-
return (jsx(DesignBaseLogo, { width: width, height: height, color
|
|
8639
|
+
return (jsx(DesignBaseLogo, { width: width, height: height, ...(color !== undefined && { color }), className: "designbase-logo__svg" }));
|
|
8397
8640
|
}
|
|
8398
8641
|
// DesignBase 심볼 마크
|
|
8399
8642
|
if (type === 'designbase-mark') {
|
|
8400
|
-
return (jsx(DesignBaseLogoMark, { size: markSize, color
|
|
8643
|
+
return (jsx(DesignBaseLogoMark, { size: markSize, ...(color !== undefined && { color }), className: "designbase-logo__svg" }));
|
|
8401
8644
|
}
|
|
8402
8645
|
// 커스텀 로고
|
|
8403
8646
|
if (src) {
|
|
@@ -11480,7 +11723,7 @@ const Toast = ({ id, status = 'info', title, description, icon: Icon, duration =
|
|
|
11480
11723
|
// 기본 상태 아이콘 (아이콘 패키지에서 가져온 아이콘 사용)
|
|
11481
11724
|
const iconMap = {
|
|
11482
11725
|
success: CircleCheckFilledIcon,
|
|
11483
|
-
error:
|
|
11726
|
+
error: ErrorIcon,
|
|
11484
11727
|
warning: WarningIcon,
|
|
11485
11728
|
info: InfoIcon,
|
|
11486
11729
|
};
|