@designbasekorea/ui 0.2.33 → 0.2.35
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 +1 -1
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.css.map +1 -1
- package/dist/index.esm.js +61 -21
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +61 -21
- 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 +61 -21
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2477,58 +2477,57 @@ const Button = React.forwardRef(({ variant = 'primary', size = 'm', radius, full
|
|
|
2477
2477
|
});
|
|
2478
2478
|
Button.displayName = 'Button';
|
|
2479
2479
|
|
|
2480
|
-
// 톤별 색상 팔레트
|
|
2480
|
+
// 톤별 색상 팔레트 (Light Tone은 더 밝은 색상만 사용)
|
|
2481
2481
|
const colorPalettes = {
|
|
2482
2482
|
primary: {
|
|
2483
|
-
light: ['#eff6ff', '#dbeafe', '#bfdbfe', '#93c5fd'
|
|
2483
|
+
light: ['#eff6ff', '#dbeafe', '#bfdbfe', '#93c5fd'], // blue-50 ~ blue-300 (더 밝게, blue-400 제거)
|
|
2484
2484
|
vivid: ['#3b82f6', '#2563eb', '#1d4ed8', '#1e40af', '#1e3a8a'], // blue-500 ~ blue-900
|
|
2485
2485
|
dark: ['#0f172a', '#1e293b', '#334155', '#475569', '#64748b'], // slate-900 ~ slate-600 (더 어둡게)
|
|
2486
2486
|
},
|
|
2487
2487
|
secondary: {
|
|
2488
|
-
light: ['#f8fafc', '#f1f5f9', '#e2e8f0', '#cbd5e1'
|
|
2488
|
+
light: ['#f8fafc', '#f1f5f9', '#e2e8f0', '#cbd5e1'], // slate-50 ~ slate-300 (더 밝게, slate-400 제거)
|
|
2489
2489
|
vivid: ['#6b7280', '#4b5563', '#374151', '#1f2937', '#111827'], // gray-500 ~ gray-900
|
|
2490
2490
|
dark: ['#0f0f0f', '#1a1a1a', '#262626', '#404040', '#525252'], // neutral-950 ~ neutral-600 (더 어둡게)
|
|
2491
2491
|
},
|
|
2492
2492
|
success: {
|
|
2493
|
-
light: ['#f0fdf4', '#dcfce7', '#bbf7d0', '#86efac'
|
|
2493
|
+
light: ['#f0fdf4', '#dcfce7', '#bbf7d0', '#86efac'], // green-50 ~ green-300 (더 밝게, green-400 제거)
|
|
2494
2494
|
vivid: ['#22c55e', '#16a34a', '#15803d', '#166534', '#14532d'], // green-500 ~ green-900
|
|
2495
2495
|
dark: ['#052e16', '#14532d', '#166534', '#15803d', '#16a34a'], // green-950 ~ green-600 (더 어둡게)
|
|
2496
2496
|
},
|
|
2497
2497
|
warning: {
|
|
2498
|
-
light: ['#fffbeb', '#fef3c7', '#fde68a'
|
|
2498
|
+
light: ['#fffbeb', '#fef3c7', '#fde68a'], // amber-50 ~ amber-200 (더 밝게, amber-300 이상 제거)
|
|
2499
2499
|
vivid: ['#f59e0b', '#d97706', '#b45309', '#92400e', '#78350f'], // amber-600 ~ amber-900
|
|
2500
2500
|
dark: ['#451a03', '#78350f', '#92400e', '#b45309', '#d97706'], // amber-950 ~ amber-600 (더 어둡게)
|
|
2501
2501
|
},
|
|
2502
2502
|
error: {
|
|
2503
|
-
light: ['#fef2f2', '#fecaca', '#fca5a5'
|
|
2503
|
+
light: ['#fef2f2', '#fecaca', '#fca5a5'], // red-50 ~ red-200 (더 밝게, red-300 이상 제거)
|
|
2504
2504
|
vivid: ['#ef4444', '#dc2626', '#b91c1c', '#991b1b', '#7f1d1d'], // red-500 ~ red-900
|
|
2505
2505
|
dark: ['#450a0a', '#7f1d1d', '#991b1b', '#b91c1c', '#dc2626'], // red-950 ~ red-600 (더 어둡게)
|
|
2506
2506
|
},
|
|
2507
2507
|
info: {
|
|
2508
|
-
light: ['#eff6ff', '#dbeafe', '#bfdbfe', '#93c5fd'
|
|
2508
|
+
light: ['#eff6ff', '#dbeafe', '#bfdbfe', '#93c5fd'], // blue-50 ~ blue-300 (더 밝게, blue-400 제거)
|
|
2509
2509
|
vivid: ['#3b82f6', '#2563eb', '#1d4ed8', '#1e40af', '#1e3a8a'], // blue-500 ~ blue-900
|
|
2510
2510
|
dark: ['#0f172a', '#1e293b', '#334155', '#475569', '#64748b'], // slate-900 ~ slate-600 (더 어둡게)
|
|
2511
2511
|
},
|
|
2512
2512
|
purple: {
|
|
2513
|
-
light: ['#faf5ff', '#f3e8ff', '#e9d5ff', '#d8b4fe'
|
|
2513
|
+
light: ['#faf5ff', '#f3e8ff', '#e9d5ff', '#d8b4fe'], // purple-50 ~ purple-300 (더 밝게, purple-400 제거)
|
|
2514
2514
|
vivid: ['#a855f7', '#9333ea', '#7c3aed', '#6d28d9', '#5b21b6'], // purple-600 ~ purple-900
|
|
2515
2515
|
dark: ['#3b0764', '#581c87', '#6b21a8', '#7c3aed', '#9333ea'], // purple-950 ~ purple-600 (더 어둡게)
|
|
2516
2516
|
},
|
|
2517
2517
|
ocean: {
|
|
2518
|
-
light: ['#f0fdfa', '#ccfbf1', '#99f6e4'
|
|
2518
|
+
light: ['#f0fdfa', '#ccfbf1', '#99f6e4'], // teal-50 ~ teal-200 (더 밝게, teal-300 이상 제거)
|
|
2519
2519
|
vivid: ['#14b8a6', '#0d9488', '#0f766e', '#115e59', '#134e4a'], // teal-500 ~ teal-900
|
|
2520
2520
|
dark: ['#042f2e', '#134e4a', '#115e59', '#0f766e', '#0d9488'], // teal-950 ~ teal-600 (더 어둡게)
|
|
2521
2521
|
},
|
|
2522
2522
|
sunset: {
|
|
2523
|
-
light: ['#fff7ed', '#fed7aa', '#fdba74'
|
|
2523
|
+
light: ['#fff7ed', '#fed7aa', '#fdba74'], // orange-50 ~ orange-200 (더 밝게, orange-300 이상 제거)
|
|
2524
2524
|
vivid: ['#f97316', '#ea580c', '#c2410c', '#9a3412', '#7c2d12'], // orange-600 ~ orange-900
|
|
2525
2525
|
dark: ['#431407', '#7c2d12', '#9a3412', '#c2410c', '#ea580c'], // orange-950 ~ orange-600 (더 어둡게)
|
|
2526
2526
|
},
|
|
2527
2527
|
};
|
|
2528
|
-
const RandomGradient = ({ scheme = 'primary', tone = 'vivid', width = '100%', height = '600px', blur =
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
const minBlur = Math.max(60, blur);
|
|
2528
|
+
const RandomGradient = ({ scheme = 'primary', tone = 'vivid', width = '100%', height = '600px', blur = 80, colorCount = 4, animated = false, animationDuration = 10, overlay = true, overlayOpacity = 0.2, children, className, }) => {
|
|
2529
|
+
// 블러 최소값 80으로 제한 (더 부드러운 그라데이션을 위해)
|
|
2530
|
+
const minBlur = Math.max(80, blur);
|
|
2532
2531
|
// 그라데이션 생성 함수
|
|
2533
2532
|
const generateGradient = React.useMemo(() => {
|
|
2534
2533
|
return () => {
|
|
@@ -2546,13 +2545,54 @@ const RandomGradient = ({ scheme = 'primary', tone = 'vivid', width = '100%', he
|
|
|
2546
2545
|
return {
|
|
2547
2546
|
background: `radial-gradient(circle at ${centerX}% ${centerY}%, ${gradientStops})`,
|
|
2548
2547
|
filter: `blur(${minBlur}px)`,
|
|
2549
|
-
transition: `
|
|
2548
|
+
transition: animated ? `background ${animationDuration}s ease-in-out` : 'none', // 블러는 transition 적용 안 함
|
|
2550
2549
|
};
|
|
2551
2550
|
};
|
|
2552
|
-
}, [scheme, tone, colorCount, minBlur, animationDuration]);
|
|
2553
|
-
// 초기 그라데이션
|
|
2551
|
+
}, [scheme, tone, colorCount, minBlur, animationDuration, animated]);
|
|
2552
|
+
// 초기 그라데이션 생성 함수
|
|
2553
|
+
const createInitialGradient = React.useCallback(() => {
|
|
2554
|
+
const schemeColors = colorPalettes[scheme][tone];
|
|
2555
|
+
const numColors = Math.min(6, Math.max(3, colorCount));
|
|
2556
|
+
const colors = [];
|
|
2557
|
+
for (let i = 0; i < numColors; i++) {
|
|
2558
|
+
const randomColor = schemeColors[Math.floor(Math.random() * schemeColors.length)];
|
|
2559
|
+
colors.push(randomColor);
|
|
2560
|
+
}
|
|
2561
|
+
const positions = Array.from({ length: numColors }, () => Math.random() * 100).sort((a, b) => a - b);
|
|
2562
|
+
const gradientStops = colors.map((color, i) => `${color} ${positions[i]}%`).join(', ');
|
|
2563
|
+
const centerX = Math.random() * 100;
|
|
2564
|
+
const centerY = Math.random() * 100;
|
|
2565
|
+
return {
|
|
2566
|
+
background: `radial-gradient(circle at ${centerX}% ${centerY}%, ${gradientStops})`,
|
|
2567
|
+
filter: `blur(${minBlur}px)`,
|
|
2568
|
+
transition: animated ? `background ${animationDuration}s ease-in-out` : 'none',
|
|
2569
|
+
};
|
|
2570
|
+
}, [scheme, tone, colorCount, minBlur, animated, animationDuration]);
|
|
2571
|
+
// 초기 그라데이션을 즉시 계산하여 설정 (useState 초기값 함수 사용)
|
|
2572
|
+
const [gradientStyle, setGradientStyle] = React.useState(() => {
|
|
2573
|
+
const schemeColors = colorPalettes[scheme][tone];
|
|
2574
|
+
const numColors = Math.min(6, Math.max(3, colorCount));
|
|
2575
|
+
const colors = [];
|
|
2576
|
+
for (let i = 0; i < numColors; i++) {
|
|
2577
|
+
const randomColor = schemeColors[Math.floor(Math.random() * schemeColors.length)];
|
|
2578
|
+
colors.push(randomColor);
|
|
2579
|
+
}
|
|
2580
|
+
const positions = Array.from({ length: numColors }, () => Math.random() * 100).sort((a, b) => a - b);
|
|
2581
|
+
const gradientStops = colors.map((color, i) => `${color} ${positions[i]}%`).join(', ');
|
|
2582
|
+
const centerX = Math.random() * 100;
|
|
2583
|
+
const centerY = Math.random() * 100;
|
|
2584
|
+
return {
|
|
2585
|
+
background: `radial-gradient(circle at ${centerX}% ${centerY}%, ${gradientStops})`,
|
|
2586
|
+
filter: `blur(${minBlur}px)`,
|
|
2587
|
+
transition: animated ? `background ${animationDuration}s ease-in-out` : 'none',
|
|
2588
|
+
};
|
|
2589
|
+
});
|
|
2590
|
+
// props 변경 시 그라데이션 업데이트
|
|
2591
|
+
React.useEffect(() => {
|
|
2592
|
+
setGradientStyle(createInitialGradient());
|
|
2593
|
+
}, [createInitialGradient]);
|
|
2594
|
+
// 애니메이션 업데이트
|
|
2554
2595
|
React.useEffect(() => {
|
|
2555
|
-
setGradientStyle(generateGradient());
|
|
2556
2596
|
if (animated) {
|
|
2557
2597
|
const interval = setInterval(() => {
|
|
2558
2598
|
setGradientStyle(generateGradient());
|
|
@@ -3973,7 +4013,7 @@ ModalHeader.displayName = 'ModalHeader';
|
|
|
3973
4013
|
ModalBody.displayName = 'ModalBody';
|
|
3974
4014
|
ModalFooter.displayName = 'ModalFooter';
|
|
3975
4015
|
|
|
3976
|
-
const Label = ({ children, htmlFor, required = false, size = '
|
|
4016
|
+
const Label = ({ children, htmlFor, required = false, size = 's', disabled = false, error = false, className, onClick, }) => {
|
|
3977
4017
|
const classes = [
|
|
3978
4018
|
'designbase-label',
|
|
3979
4019
|
`designbase-label--${size}`,
|
|
@@ -4020,7 +4060,7 @@ const Input = React.forwardRef(({ type = 'text', label, placeholder, defaultValu
|
|
|
4020
4060
|
lg: 18,
|
|
4021
4061
|
};
|
|
4022
4062
|
const iconSize = iconSizeMap[size];
|
|
4023
|
-
return (jsxRuntime.jsxs("div", { className: classes, children: [label && (jsxRuntime.jsx(Label, { htmlFor: inputId, required: required, error: error, disabled: disabled, size: size === 's' ? '
|
|
4063
|
+
return (jsxRuntime.jsxs("div", { className: classes, children: [label && (jsxRuntime.jsx(Label, { htmlFor: inputId, required: required, error: error, disabled: disabled, size: size === 's' ? 's' : size === 'm' ? 'm' : 'l', children: label })), jsxRuntime.jsxs("div", { className: "designbase-input__wrapper", children: [actualStartIcon && (jsxRuntime.jsx("div", { className: "designbase-input__start-icon", children: React.createElement(actualStartIcon, { size: iconSize }) })), jsxRuntime.jsx("input", { ...props, ref: forwardedRef, id: inputId, type: actualType, value: value, defaultValue: defaultValue, placeholder: placeholder, disabled: disabled, readOnly: readOnly, required: required, className: inputClasses, onChange: handleChange, onFocus: onFocus, onBlur: onBlur, "aria-describedby": clsx(helperText && helperTextId, error && errorMessage && errorMessageId), "aria-invalid": error }), isPassword && (jsxRuntime.jsx("button", { type: "button", className: "designbase-input__password-toggle", onClick: handlePasswordToggle, disabled: disabled, "aria-label": showPassword ? '비밀번호 숨기기' : '비밀번호 보기', children: React.createElement(PasswordIcon, { size: iconSize }) })), EndIcon && !isPassword && (jsxRuntime.jsx("div", { className: "designbase-input__end-icon", children: React.createElement(EndIcon, { size: iconSize }) }))] }), helperText && !error && (jsxRuntime.jsx("p", { id: helperTextId, className: "designbase-input__helper-text", children: helperText })), error && errorMessage && (jsxRuntime.jsx("p", { id: errorMessageId, className: "designbase-input__error-message", children: errorMessage }))] }));
|
|
4024
4064
|
});
|
|
4025
4065
|
Input.displayName = 'Input';
|
|
4026
4066
|
|
|
@@ -6963,7 +7003,7 @@ const Textarea = React.forwardRef(({ label, placeholder, defaultValue, value, si
|
|
|
6963
7003
|
}, className);
|
|
6964
7004
|
const textareaClasses = clsx('designbase-textarea__field', textareaClassName);
|
|
6965
7005
|
const isOverLimit = maxLength && currentLength > maxLength;
|
|
6966
|
-
return (jsxRuntime.jsxs("div", { className: classes, children: [label && (jsxRuntime.jsx(Label, { htmlFor: textareaId, required: required, error: error, disabled: disabled, size: size === 's' ? '
|
|
7006
|
+
return (jsxRuntime.jsxs("div", { className: classes, children: [label && (jsxRuntime.jsx(Label, { htmlFor: textareaId, required: required, error: error, disabled: disabled, size: size === 's' ? 's' : size === 'm' ? 'm' : 'l', children: label })), showCharacterCount && characterCountPosition === 'top' && (jsxRuntime.jsx("div", { className: "designbase-textarea__character-count designbase-textarea__character-count--top", children: jsxRuntime.jsxs("span", { className: clsx('designbase-textarea__character-count-text', {
|
|
6967
7007
|
'designbase-textarea__character-count-text--error': isOverLimit
|
|
6968
7008
|
}), children: [currentLength, maxLength && ` / ${maxLength}`] }) })), jsxRuntime.jsx("div", { className: "designbase-textarea__wrapper", children: jsxRuntime.jsx("textarea", { ref: forwardedRef, id: textareaId, className: textareaClasses, placeholder: placeholder, defaultValue: defaultValue, value: value, rows: rows, maxLength: maxLength, disabled: disabled, readOnly: readOnly, required: required, "aria-describedby": clsx({
|
|
6969
7009
|
[helperTextId]: helperText,
|