maru_design2 2.29.1 → 2.31.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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.31.0](https://github.com/42maru-ai/maru-design2/compare/v2.30.0...v2.31.0) (2026-02-09)
4
+
5
+
6
+ ### Features
7
+
8
+ * :hammer: Badge & Toast & ButtonGroups ([d096c12](https://github.com/42maru-ai/maru-design2/commit/d096c1201ad014d4fa9854fe5d535b0de9e60244))
9
+
10
+ ## [2.30.0](https://github.com/42maru-ai/maru-design2/compare/v2.29.1...v2.30.0) (2026-01-30)
11
+
12
+
13
+ ### Features
14
+
15
+ * :hammer: Radio & Slider & Toggle UI ([#693](https://github.com/42maru-ai/maru-design2/issues/693)) ([b7038de](https://github.com/42maru-ai/maru-design2/commit/b7038de4105fc7086f931cc751503a62f79d35de))
16
+
3
17
  ## [2.29.1](https://github.com/42maru-ai/maru-design2/compare/v2.29.0...v2.29.1) (2026-01-06)
4
18
 
5
19
 
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import { TBadgeColor, TBadgeVariant } from '../../../enums/variant';
3
+ import './badge.scss';
4
+ export interface BadgeProps {
5
+ /**
6
+ * 컴포넌트에 들어갈 내용
7
+ */
8
+ children: React.ReactNode;
9
+ /**
10
+ * 배지 색상
11
+ */
12
+ color?: TBadgeColor;
13
+ /**
14
+ * 배지 스타일 변형
15
+ */
16
+ variant?: TBadgeVariant;
17
+ className?: string;
18
+ /**
19
+ * 설정하면 X아이콘이 렌더링되고 클릭 이벤트가 할당됩니다.
20
+ */
21
+ onXIconClick?: () => void;
22
+ }
23
+ export declare function Badge({ children, color, variant, className, onXIconClick, }: BadgeProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './Badge';
@@ -37,6 +37,7 @@ export declare const iconmap: {
37
37
  };
38
38
  };
39
39
  export declare const ICONS: {
40
+ readonly X_s1210: "X_s1210";
40
41
  readonly AlertCircle_s1413: "AlertCircle_s1413";
41
42
  readonly AlertCircle_s1610: "AlertCircle_s1610";
42
43
  readonly AlertCircle_s1615: "AlertCircle_s1615";
@@ -3,12 +3,21 @@ import { TRadioColor } from '../../../enums/color';
3
3
  import { TGap } from '../../../enums/gap';
4
4
  import './radio.scss';
5
5
  export interface RadioProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'checked' | 'type'> {
6
+ /**
7
+ * 라디오 토글의 값
8
+ */
6
9
  checked?: boolean;
10
+ /**
11
+ * 기본 회색, 메인 테마색 ['primary']
12
+ */
7
13
  color?: TRadioColor;
8
14
  /**
9
15
  * 컴포넌트와 라벨 사이의 거리. ['8px', '4px', '2px']
10
16
  */
11
17
  gap?: TGap;
18
+ /**
19
+ * 라디오 버튼 옆 문자 내용
20
+ */
12
21
  label?: string;
13
22
  }
14
23
  export declare const Radio: React.ForwardRefExoticComponent<RadioProps & React.RefAttributes<HTMLInputElement>>;
@@ -25,7 +25,14 @@ export interface SliderProps {
25
25
  * 값 증가 단위 (기본값: 1)
26
26
  */
27
27
  step?: number;
28
+ /**
29
+ * 값 표시 여부
30
+ */
31
+ showValue?: boolean;
28
32
  disabled?: boolean;
29
33
  className?: string;
30
34
  }
31
- export declare function Slider({ value, onChange, color, min, max, step, disabled, className, }: SliderProps): import("react/jsx-runtime").JSX.Element;
35
+ /**
36
+ * showValue에 관한 글: showValue가 true면 기존 input에 있는 thumb를 숨기고 custom thumb를 보여준다.
37
+ */
38
+ export declare function Slider({ value, onChange, color, min, max, step, showValue, disabled, className, }: SliderProps): import("react/jsx-runtime").JSX.Element;
@@ -8,6 +8,9 @@ export interface ToggleProps {
8
8
  * ['primary', 'secondary', 'positive', 'warning', 'danger']. (@v1 variant)
9
9
  */
10
10
  color?: TColor;
11
+ /**
12
+ * 비활성화 여부
13
+ */
11
14
  disabled?: boolean;
12
15
  /**
13
16
  * 텍스트가 있는 토글.
@@ -16,5 +19,13 @@ export interface ToggleProps {
16
19
  left?: string;
17
20
  right?: string;
18
21
  };
22
+ /**
23
+ * 토글 아이콘 표시 여부
24
+ */
25
+ showIcon?: boolean;
26
+ /**
27
+ * 토글 크기 배율 (기본값: 1)
28
+ */
29
+ scale?: number;
19
30
  }
20
- export declare function Toggle({ checked, onChange, className, color, disabled, text, }: ToggleProps): import("react/jsx-runtime").JSX.Element;
31
+ export declare function Toggle({ checked, onChange, className, color, disabled, text, showIcon, scale, }: ToggleProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,56 @@
1
+ import React from 'react';
2
+ import './button-group.scss';
3
+ export interface ButtonGroupButton<T extends string> {
4
+ /**
5
+ * 표시할 라벨
6
+ */
7
+ label: React.ReactNode;
8
+ /**
9
+ * 선택 값
10
+ */
11
+ value: T;
12
+ /**
13
+ * 버튼 커스텀 클래스
14
+ */
15
+ className?: string;
16
+ }
17
+ export interface ButtonGroupProps<T extends string> {
18
+ /**
19
+ * 선택된 값
20
+ */
21
+ value: T;
22
+ /**
23
+ * 값 변경 함수
24
+ */
25
+ onChange: (value: T) => void;
26
+ /**
27
+ * 버튼 리스트
28
+ *
29
+ * ```tsx
30
+ * {
31
+ * label: React.ReactNode;
32
+ * value: T;
33
+ * className?: string;
34
+ * }
35
+ * ```
36
+ */
37
+ buttons: ButtonGroupButton<T>[];
38
+ /**
39
+ * 스타일 타입
40
+ * - segmented: 버튼들을 간격을 두고 묶여있는 형태 (기본값).
41
+ * - segmented-secondary: segmented와 동일한 래퍼,
42
+ * 선택된 버튼이 흰색 배경 + primary색 텍스트 컬러.
43
+ * - icon: 아웃라인 버튼 안에 간격없이 붙어있는 형태.
44
+ */
45
+ variant?: 'segmented' | 'segmented-secondary' | 'icon';
46
+ /**
47
+ * 사이즈
48
+ */
49
+ size?: 'sm' | 'md';
50
+ /**
51
+ * 전체 비활성화 여부
52
+ */
53
+ disabled?: boolean;
54
+ className?: string;
55
+ }
56
+ export declare function ButtonGroup<T extends string>({ value, onChange, buttons, variant, size, disabled, className, }: ButtonGroupProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './ButtonGroup';
@@ -11,6 +11,10 @@ export interface IToast {
11
11
  content: string;
12
12
  onClick: () => void;
13
13
  };
14
+ revert?: {
15
+ label: string;
16
+ onRevert: () => void;
17
+ };
14
18
  details?: IToastDetailItem[];
15
19
  disableAutoOff?: boolean;
16
20
  }
@@ -12,7 +12,11 @@ export interface ToastStyleProps {
12
12
  content: string;
13
13
  onClick: () => void;
14
14
  };
15
+ revert?: {
16
+ label: string;
17
+ onRevert: () => void;
18
+ };
15
19
  details?: IToastDetailItem[];
16
20
  onClose: () => void;
17
21
  }
18
- export declare function ToastStyle({ variant, content, title, closeButton, details, onClose, }: ToastStyleProps): import("react/jsx-runtime").JSX.Element;
22
+ export declare function ToastStyle({ variant, content, title, closeButton, revert, details, onClose, }: ToastStyleProps): import("react/jsx-runtime").JSX.Element;
@@ -2,10 +2,10 @@ export type TTheme = 'blue' | 'green' | 'navy';
2
2
  declare const DColor: {
3
3
  readonly primary: "var(--p)";
4
4
  readonly secondary: "#8c8c8c";
5
- readonly positive: "#32a483";
5
+ readonly positive: "#308acc";
6
6
  readonly warning: "#ffb020";
7
7
  readonly danger: "#e53e3e";
8
- readonly success: "#308acc";
8
+ readonly success: "#32a483";
9
9
  };
10
10
  export declare const COLORS: string[];
11
11
  export type TColor = (typeof COLORS)[number];
@@ -6,3 +6,7 @@ export declare const TOAST_VARIANTS: readonly ["success", "warning", "danger"];
6
6
  export type TToastVariant = (typeof TOAST_VARIANTS)[number];
7
7
  export declare const SKELETON_VARIANTS: readonly ["frame"];
8
8
  export type TSkeletonVariant = (typeof SKELETON_VARIANTS)[number];
9
+ export declare const BADGE_COLORS: readonly ["primary", "secondary", "blue", "green", "purple"];
10
+ export type TBadgeColor = (typeof BADGE_COLORS)[number];
11
+ export declare const BADGE_VARIANTS: readonly ["default", "outlined"];
12
+ export type TBadgeVariant = (typeof BADGE_VARIANTS)[number];
@@ -0,0 +1 @@
1
+ import './fonts.scss';