@designbasekorea/ui 0.2.12 → 0.2.14
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 +6 -0
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.css.map +1 -1
- package/dist/index.esm.js +11 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +11 -4
- 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 +11 -4
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5279,7 +5279,7 @@ const Chip = ({ label, size = 'm', variant = 'default', color = 'primary', delet
|
|
|
5279
5279
|
};
|
|
5280
5280
|
Chip.displayName = 'Chip';
|
|
5281
5281
|
|
|
5282
|
-
const ColorPicker = ({ size = 'm', type = 'dropdown', value, defaultValue = '#006FFF', showInput = true, showAlpha = false, showFormatSelector = true, showCopyButton = true, disabled = false, readonly = false, onChange, className, }) => {
|
|
5282
|
+
const ColorPicker = ({ size = 'm', type = 'dropdown', position = 'bottom-left', value, defaultValue = '#006FFF', showInput = true, showAlpha = false, showFormatSelector = true, showCopyButton = true, disabled = false, readonly = false, onChange, className, }) => {
|
|
5283
5283
|
const [selectedColor, setSelectedColor] = React.useState(value || defaultValue);
|
|
5284
5284
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
5285
5285
|
const [hue, setHue] = React.useState(211);
|
|
@@ -5425,6 +5425,11 @@ const ColorPicker = ({ size = 'm', type = 'dropdown', value, defaultValue = '#00
|
|
|
5425
5425
|
const handleInputChange = (e) => {
|
|
5426
5426
|
const newValue = e.target.value.trim();
|
|
5427
5427
|
setInputValue(newValue);
|
|
5428
|
+
// HEX 값이 유효하면 실시간으로 색상 업데이트
|
|
5429
|
+
if (/^#[0-9A-F]{6}$/i.test(newValue)) {
|
|
5430
|
+
handleColorChange(newValue.toUpperCase());
|
|
5431
|
+
updateHSLFromHex(newValue);
|
|
5432
|
+
}
|
|
5428
5433
|
};
|
|
5429
5434
|
// 입력 필드에서 포커스 아웃 시 검증 및 적용
|
|
5430
5435
|
const handleInputBlur = () => {
|
|
@@ -5512,7 +5517,7 @@ const ColorPicker = ({ size = 'm', type = 'dropdown', value, defaultValue = '#00
|
|
|
5512
5517
|
return;
|
|
5513
5518
|
setIsOpen(!isOpen);
|
|
5514
5519
|
};
|
|
5515
|
-
const classes = clsx('designbase-color-picker', `designbase-color-picker--${size}`, {
|
|
5520
|
+
const classes = clsx('designbase-color-picker', `designbase-color-picker--${size}`, `designbase-color-picker--${position}`, {
|
|
5516
5521
|
'designbase-color-picker--disabled': disabled,
|
|
5517
5522
|
'designbase-color-picker--readonly': readonly,
|
|
5518
5523
|
'designbase-color-picker--open': isOpen,
|
|
@@ -9359,7 +9364,7 @@ const ProgressStep = ({ items, size = 'm', layout = 'vertical', currentStep = 0,
|
|
|
9359
9364
|
}) }));
|
|
9360
9365
|
};
|
|
9361
9366
|
|
|
9362
|
-
const RangeSlider = ({ value, range, min = 0, max = 100, step = 1, size = 'm', variant = 'default', showValue = false, showMarks = false, marks = [], markLabels = {}, disabled = false, readOnly = false, fullWidth = false, vertical = false, onChange, onRangeChange, className, ...props }) => {
|
|
9367
|
+
const RangeSlider = ({ value, range, min = 0, max = 100, step = 1, size = 'm', variant = 'default', showValue = false, valuePosition = 'top', showMarks = false, marks = [], markLabels = {}, disabled = false, readOnly = false, fullWidth = false, vertical = false, onChange, onRangeChange, className, ...props }) => {
|
|
9363
9368
|
const [internalValue, setInternalValue] = React.useState(value ?? min);
|
|
9364
9369
|
const [internalRange, setInternalRange] = React.useState(range ?? [min, max]);
|
|
9365
9370
|
const [isDragging, setIsDragging] = React.useState(false);
|
|
@@ -9370,6 +9375,8 @@ const RangeSlider = ({ value, range, min = 0, max = 100, step = 1, size = 'm', v
|
|
|
9370
9375
|
const isControlled = value !== undefined || range !== undefined;
|
|
9371
9376
|
const currentValue = isControlled ? (value ?? internalValue) : internalValue;
|
|
9372
9377
|
const currentRange = isControlled ? (range ?? internalRange) : internalRange;
|
|
9378
|
+
// 단일 값일 때 기본적으로 우측에 표시
|
|
9379
|
+
const effectiveValuePosition = valuePosition === 'top' && range === undefined ? 'right' : valuePosition;
|
|
9373
9380
|
// 값 정규화
|
|
9374
9381
|
const normalizeValue = React.useCallback((val) => {
|
|
9375
9382
|
return Math.max(min, Math.min(max, val));
|
|
@@ -9539,7 +9546,7 @@ const RangeSlider = ({ value, range, min = 0, max = 100, step = 1, size = 'm', v
|
|
|
9539
9546
|
}, "aria-hidden": "true", children: markLabels[mark] && (jsxRuntime.jsx("span", { className: "designbase-range-slider__mark-label", children: markLabels[mark] })) }, mark));
|
|
9540
9547
|
});
|
|
9541
9548
|
};
|
|
9542
|
-
const classes = clsx('designbase-range-slider', `designbase-range-slider--${size}`, `designbase-range-slider--${variant}`, {
|
|
9549
|
+
const classes = clsx('designbase-range-slider', `designbase-range-slider--${size}`, `designbase-range-slider--${variant}`, `designbase-range-slider--value-${effectiveValuePosition}`, {
|
|
9543
9550
|
'designbase-range-slider--disabled': disabled,
|
|
9544
9551
|
'designbase-range-slider--readonly': readOnly,
|
|
9545
9552
|
'designbase-range-slider--full-width': fullWidth,
|