@designbasekorea/ui 0.3.4 → 0.4.0
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 +7 -3
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.css.map +1 -1
- package/dist/index.esm.js +14 -11
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +14 -11
- 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 +14 -11
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -3855,7 +3855,7 @@ const Breadcrumbs = ({ items, size = 'm', breadcrumbStyle = 'default', separator
|
|
|
3855
3855
|
};
|
|
3856
3856
|
Breadcrumbs.displayName = 'Breadcrumbs';
|
|
3857
3857
|
|
|
3858
|
-
const SegmentControl = ({ options, defaultValue, value, size = 'm', fullWidth = false, disabled = false, className, onChange, ...props }) => {
|
|
3858
|
+
const SegmentControl = ({ options, defaultValue, value, size = 'm', variant = 'default', fullWidth = false, disabled = false, className, onChange, ...props }) => {
|
|
3859
3859
|
const [selectedValue, setSelectedValue] = useState(value ?? defaultValue ?? options[0]?.value ?? '');
|
|
3860
3860
|
const [focusedIndex, setFocusedIndex] = useState(-1);
|
|
3861
3861
|
const containerRef = useRef(null);
|
|
@@ -3930,7 +3930,7 @@ const SegmentControl = ({ options, defaultValue, value, size = 'm', fullWidth =
|
|
|
3930
3930
|
setFocusedIndex(-1);
|
|
3931
3931
|
}, []);
|
|
3932
3932
|
const selectedIndex = options.findIndex(option => option.value === selectedValue);
|
|
3933
|
-
const classes = clsx('designbase-segment-control', `designbase-segment-control--${size}`, {
|
|
3933
|
+
const classes = clsx('designbase-segment-control', `designbase-segment-control--${size}`, `designbase-segment-control--${variant}`, {
|
|
3934
3934
|
'designbase-segment-control--full-width': fullWidth,
|
|
3935
3935
|
'designbase-segment-control--disabled': disabled,
|
|
3936
3936
|
}, className);
|
|
@@ -3950,7 +3950,7 @@ const SegmentControl = ({ options, defaultValue, value, size = 'm', fullWidth =
|
|
|
3950
3950
|
else {
|
|
3951
3951
|
segmentRefs.current.delete(option.value);
|
|
3952
3952
|
}
|
|
3953
|
-
}, className: segmentClasses, role: "tab", "aria-selected": isSelected, "aria-disabled": isDisabled, tabIndex: isSelected ? 0 : -1, disabled: isDisabled, onClick: () => handleSegmentSelect(option.value), onFocus: () => handleSegmentFocus(index), onBlur: handleSegmentBlur, children: [option.icon && (jsx("span", { className: "designbase-segment-control__segment-icon", children: jsx(option.icon, { size: size === 's' ? 14 : size === 'l' ? 18 : 16 }) })), jsx("span", { className: "designbase-segment-control__segment-label", children: option.label })] }, option.value));
|
|
3953
|
+
}, className: segmentClasses, role: "tab", "aria-selected": isSelected, "aria-disabled": isDisabled, tabIndex: isSelected ? 0 : -1, disabled: isDisabled, onClick: () => handleSegmentSelect(option.value), onFocus: () => handleSegmentFocus(index), onBlur: handleSegmentBlur, children: [option.icon && (jsx("span", { className: "designbase-segment-control__segment-icon", children: jsx(option.icon, { size: size === 's' ? 14 : size === 'l' ? 18 : 16 }) })), variant === 'default' && (jsx("span", { className: "designbase-segment-control__segment-label", children: option.label })), variant === 'icon-only' && !option.icon && (jsx("span", { className: "designbase-segment-control__segment-label", "aria-label": option.label, children: option.label }))] }, option.value));
|
|
3954
3954
|
}), jsx("div", { className: "designbase-segment-control__indicator", style: {
|
|
3955
3955
|
transform: `translateX(${selectedIndex * 100}%)`,
|
|
3956
3956
|
width: `${100 / options.length}%`,
|
|
@@ -11398,20 +11398,23 @@ const Timeline = ({ items, type = 'alternate', variant = 'default', size = 'm',
|
|
|
11398
11398
|
'designbase-timeline__item--disabled': item.disabled,
|
|
11399
11399
|
});
|
|
11400
11400
|
const contentClasses = clsx('designbase-timeline__content', `designbase-timeline__content--${itemPosition}`);
|
|
11401
|
-
const
|
|
11401
|
+
const itemStatus = item.status || 'pending';
|
|
11402
|
+
const dotClasses = clsx('designbase-timeline__dot', `designbase-timeline__dot--${itemColor}`, `designbase-timeline__dot--${variant}`, `designbase-timeline__dot--${itemStatus}`, {
|
|
11402
11403
|
'designbase-timeline__dot--clickable': isClickable,
|
|
11404
|
+
'designbase-timeline__dot--with-icon': item.icon,
|
|
11405
|
+
'designbase-timeline__dot--with-number': item.number && !item.icon,
|
|
11403
11406
|
});
|
|
11404
|
-
return (jsxs("div", { className: itemClasses, children: [jsxs("div", { className: "designbase-timeline__indicator-container", children: [jsx("div", { className: dotClasses, onClick: () => handleItemClick(item, index), tabIndex: isClickable ? 0 : -1, role: isClickable ? 'button' : undefined, "aria-label": `${item.title} 타임라인
|
|
11407
|
+
return (jsxs("div", { className: itemClasses, children: [jsxs("div", { className: "designbase-timeline__indicator-container", children: [itemStatus === 'active' && !item.icon && item.number === undefined && (jsx("div", { className: "designbase-timeline__pulse" })), jsx("div", { className: dotClasses, onClick: () => handleItemClick(item, index), tabIndex: isClickable ? 0 : -1, role: isClickable ? 'button' : undefined, "aria-label": item.title ? `${item.title} 타임라인 점` : `타임라인 점 ${index + 1}`, onKeyDown: (e) => {
|
|
11405
11408
|
if (e.key === 'Enter' || e.key === ' ') {
|
|
11406
11409
|
e.preventDefault();
|
|
11407
11410
|
handleItemClick(item, index);
|
|
11408
11411
|
}
|
|
11409
|
-
}, children: item.icon ? (jsx("div", { className: "designbase-timeline__icon", children: item.icon })) : (jsx("span", { className: "designbase-timeline__number", children:
|
|
11410
|
-
|
|
11411
|
-
|
|
11412
|
-
|
|
11413
|
-
|
|
11414
|
-
|
|
11412
|
+
}, children: item.icon ? (jsx("div", { className: "designbase-timeline__icon", children: item.icon })) : item.number !== undefined ? (jsx("span", { className: "designbase-timeline__number", children: item.number })) : null }), !isLast && (jsx("div", { className: "designbase-timeline__connector" }))] }), jsxs("div", { className: contentClasses, children: [item.timestamp && (jsx("div", { className: "designbase-timeline__timestamp", children: item.timestamp })), jsx("div", { className: "designbase-timeline__content-inner", onClick: () => handleItemClick(item, index), tabIndex: isClickable ? 0 : -1, role: isClickable ? 'button' : undefined, "aria-label": item.title ? `${item.title} 타임라인 아이템` : `타임라인 아이템 ${index + 1}`, onKeyDown: (e) => {
|
|
11413
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
11414
|
+
e.preventDefault();
|
|
11415
|
+
handleItemClick(item, index);
|
|
11416
|
+
}
|
|
11417
|
+
}, children: item.content ? (item.content) : (jsxs(Fragment, { children: [item.title && (jsx("h3", { className: "designbase-timeline__title", children: item.title })), item.description && (jsx("p", { className: "designbase-timeline__description", children: item.description }))] })) })] })] }, item.id));
|
|
11415
11418
|
}) }) }));
|
|
11416
11419
|
};
|
|
11417
11420
|
|