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