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