sud-ui 1.9.2 โ†’ 2.0.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.
Files changed (43) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +26 -8
  3. package/dist/components/SoonUIDesign.d.ts +11 -11
  4. package/dist/components/commonType.d.ts +10 -10
  5. package/dist/components/dataDisplay/Calendar.d.ts +9 -8
  6. package/dist/components/dataDisplay/Card.d.ts +23 -14
  7. package/dist/components/dataDisplay/Carousel.d.ts +7 -6
  8. package/dist/components/dataDisplay/Collapse.d.ts +12 -11
  9. package/dist/components/dataDisplay/Drawer.d.ts +15 -13
  10. package/dist/components/dataDisplay/Modal.d.ts +12 -11
  11. package/dist/components/dataDisplay/Segmented.d.ts +2 -1
  12. package/dist/components/dataDisplay/Table.d.ts +2 -1
  13. package/dist/components/dataDisplay/Tabs.d.ts +2 -1
  14. package/dist/components/dataEntry/Checkbox.d.ts +22 -4
  15. package/dist/components/dataEntry/ColorPicker.d.ts +2 -1
  16. package/dist/components/dataEntry/Input.d.ts +10 -10
  17. package/dist/components/dataEntry/Radio.d.ts +22 -4
  18. package/dist/components/dataEntry/Rate.d.ts +3 -2
  19. package/dist/components/dataEntry/Select.d.ts +17 -16
  20. package/dist/components/dataEntry/Slider.d.ts +2 -1
  21. package/dist/components/dataEntry/Switch.d.ts +22 -3
  22. package/dist/components/dataEntry/TimeSelector.d.ts +2 -1
  23. package/dist/components/feedback/Progress.d.ts +19 -19
  24. package/dist/components/general/Button.d.ts +11 -8
  25. package/dist/components/layout/index.d.ts +10 -10
  26. package/dist/components/navigation/Breadcrumb.d.ts +6 -4
  27. package/dist/components/navigation/Divider.d.ts +2 -1
  28. package/dist/components/navigation/Dropdown.d.ts +11 -11
  29. package/dist/components/navigation/Menu.d.ts +2 -1
  30. package/dist/components/navigation/Pagination.d.ts +2 -1
  31. package/dist/components/navigation/base/PopupBase.d.ts +15 -12
  32. package/dist/index.css +1 -1
  33. package/dist/index.d.ts +64 -64
  34. package/dist/index.js +5091 -4791
  35. package/dist/index.js.map +1 -1
  36. package/dist/theme/ThemeContext.d.ts +42 -42
  37. package/dist/theme/darkTheme.d.ts +3 -3
  38. package/dist/theme/defaultTheme.d.ts +3 -3
  39. package/dist/theme/index.d.ts +4 -4
  40. package/dist/theme/themeUtils.d.ts +80 -80
  41. package/docs/improvement-plan.md +271 -271
  42. package/docs/surface-guidelines.md +29 -29
  43. package/package.json +20 -6
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 SeeUSoon93
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Soon UI Design Library [![npm version](https://img.shields.io/badge/npm-1.9.2-blue)](https://www.npmjs.com/package/sud-ui)
1
+ # Soon UI Design Library [![npm version](https://img.shields.io/npm/v/sud-ui.svg)](https://www.npmjs.com/package/sud-ui)
2
2
 
3
3
  ## **Soon UI Design (SUD)** is a React UI library that helps you quickly build responsive and polished interfaces using reusable components and customizable design tokens.
4
4
 
@@ -13,7 +13,7 @@
13
13
  ## ๐Ÿ“ฆ Installation
14
14
 
15
15
  ```bash
16
- npm install sud-ui
16
+ npm install sud-ui sud-icons
17
17
  ```
18
18
 
19
19
  ## ๐Ÿงช Examples Built with Soon UI
@@ -30,9 +30,10 @@ Check out real projects built using the SUD component library:
30
30
  ## ๐Ÿš€ Quick Start
31
31
 
32
32
  ```jsx
33
- import React from "react";
34
- import { Card, Typography, Avatar, Tag } from "sud-ui";
35
- import { LogoGithub } from "sud-icons";
33
+ import React from "react";
34
+ import { Card, Typography, Avatar, Tag } from "sud-ui";
35
+ import { LogoGithub } from "sud-icons";
36
+ import "sud-ui/dist/index.css";
36
37
 
37
38
  export default function App() {
38
39
  return (
@@ -98,8 +99,10 @@ checklist and surface rules.
98
99
 
99
100
  SUD provides full theming support via `SoonUIDesign`.
100
101
 
101
- ```jsx
102
- import { SoonUIDesign, defaultTheme, darkTheme } from "sud-ui";
102
+ ```jsx
103
+ import { useState } from "react";
104
+ import { Button, SoonUIDesign, defaultTheme, darkTheme } from "sud-ui";
105
+ import "sud-ui/dist/index.css";
103
106
 
104
107
  const customTheme = {
105
108
  ...defaultTheme,
@@ -143,7 +146,22 @@ export default function App() {
143
146
  </SoonUIDesign>
144
147
  );
145
148
  }
146
- ```
149
+ ```
150
+
151
+ ## 2.0 stability changes
152
+
153
+ - `Button` now forwards native button attributes and refs, and defaults to
154
+ `type="button"`.
155
+ - `Checkbox`, `Radio`, and `Switch` now use native form controls for keyboard and
156
+ form support.
157
+ - `Modal` and `Drawer` now trap and restore focus, close with Escape, and lock
158
+ background scrolling.
159
+ - `Image` preview is keyboard accessible, and library motion respects the
160
+ reduced-motion preference.
161
+ - Controlled `Calendar` values and ranges can be cleared with `null`.
162
+ - Notification `onClose` callbacks now run for manual and automatic dismissal.
163
+
164
+ See [`CHANGELOG.md`](./CHANGELOG.md) for migration details.
147
165
 
148
166
  ## ๐Ÿ“š Documentation
149
167
 
@@ -1,11 +1,11 @@
1
- import type { FC, ReactNode } from "react";
2
- import type { SUDTheme } from "../theme";
3
-
4
- export interface SoonUIDesignProps {
5
- children?: ReactNode;
6
- theme?: SUDTheme;
7
- darkTheme?: SUDTheme;
8
- isDarkMode?: boolean;
9
- }
10
-
11
- export declare const SoonUIDesign: FC<SoonUIDesignProps>;
1
+ import type { FC, ReactNode } from "react";
2
+ import type { SUDTheme } from "../theme";
3
+
4
+ export interface SoonUIDesignProps {
5
+ children?: ReactNode;
6
+ theme?: SUDTheme;
7
+ darkTheme?: SUDTheme;
8
+ isDarkMode?: boolean;
9
+ }
10
+
11
+ export declare const SoonUIDesign: FC<SoonUIDesignProps>;
@@ -52,16 +52,16 @@ export type borderType =
52
52
  | "outset"
53
53
  | "none";
54
54
 
55
- export type shadowType = "none" | "sm" | "md" | "lg" | "xl";
56
-
57
- export type surfaceType =
58
- | "bare"
59
- | "outlined"
60
- | "elevated"
61
- | "floating"
62
- | "overlay";
63
-
64
- export type fontSizeType =
55
+ export type shadowType = "none" | "sm" | "md" | "lg" | "xl";
56
+
57
+ export type surfaceType =
58
+ | "bare"
59
+ | "outlined"
60
+ | "elevated"
61
+ | "floating"
62
+ | "overlay";
63
+
64
+ export type fontSizeType =
65
65
  | "xs"
66
66
  | "sm"
67
67
  | "base"
@@ -12,8 +12,9 @@ export interface CalendarItem {
12
12
  itemProps?: HTMLAttributes<HTMLSpanElement>;
13
13
  }
14
14
 
15
- export interface CalendarProps extends HTMLAttributes<HTMLDivElement> {
16
- value?: Date;
15
+ export interface CalendarProps
16
+ extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
17
+ value?: Date | null;
17
18
  onChange?: (date: Date | { startDate: Date; endDate: Date | null }) => void;
18
19
  items?: CalendarItem[];
19
20
  view?: CalendarView;
@@ -34,11 +35,11 @@ export interface CalendarProps extends HTMLAttributes<HTMLDivElement> {
34
35
  width?: number | string;
35
36
  height?: number | string;
36
37
  range?: boolean;
37
- startDate?: Date;
38
- endDate?: Date;
39
- size?: CalendarSize;
40
- holidays?: string[];
41
- holidaysStyle?: CSSProperties;
42
- }
38
+ startDate?: Date | null;
39
+ endDate?: Date | null;
40
+ size?: CalendarSize;
41
+ holidays?: string[];
42
+ holidaysStyle?: CSSProperties;
43
+ }
43
44
 
44
45
  export declare const Calendar: FC<CalendarProps>;
@@ -1,11 +1,17 @@
1
- import type { ReactNode, CSSProperties, FC, HTMLAttributes } from "react";
1
+ import type {
2
+ ReactNode,
3
+ CSSProperties,
4
+ ForwardRefExoticComponent,
5
+ HTMLAttributes,
6
+ RefAttributes
7
+ } from "react";
2
8
  import type {
3
- defaultColorType,
4
- shapeType,
5
- borderType,
6
- shadowType,
7
- surfaceType
8
- } from "../commonType";
9
+ defaultColorType,
10
+ shapeType,
11
+ borderType,
12
+ shadowType,
13
+ surfaceType
14
+ } from "../commonType";
9
15
 
10
16
  export type CardVariant =
11
17
  | "card"
@@ -14,7 +20,8 @@ export type CardVariant =
14
20
  | "notification"
15
21
  | "toast";
16
22
 
17
- export interface CardProps extends HTMLAttributes<HTMLDivElement> {
23
+ export interface CardProps
24
+ extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
18
25
  /** ์นด๋“œ ์ œ๋ชฉ */
19
26
  title?: ReactNode;
20
27
  /** ์นด๋“œ ๋‚ด์šฉ */
@@ -41,11 +48,11 @@ export interface CardProps extends HTMLAttributes<HTMLDivElement> {
41
48
  borderWeight?: number;
42
49
  /** ์นด๋“œ ๋ชจ์–‘ */
43
50
  shape?: shapeType;
44
- /** ๊ทธ๋ฆผ์ž ํšจ๊ณผ */
45
- shadow?: shadowType;
46
- /** ๊ธฐ๋ณธ surface ํ”„๋ฆฌ์…‹ */
47
- surface?: surfaceType;
48
- /** ์นด๋“œ ๋„ˆ๋น„ */
51
+ /** ๊ทธ๋ฆผ์ž ํšจ๊ณผ */
52
+ shadow?: shadowType;
53
+ /** ๊ธฐ๋ณธ surface ํ”„๋ฆฌ์…‹ */
54
+ surface?: surfaceType;
55
+ /** ์นด๋“œ ๋„ˆ๋น„ */
49
56
  width?: number | string;
50
57
  /** ์นด๋“œ ๋†’์ด */
51
58
  height?: number | string;
@@ -65,4 +72,6 @@ export interface CardProps extends HTMLAttributes<HTMLDivElement> {
65
72
  isDrawer?: boolean;
66
73
  }
67
74
 
68
- export declare const Card: FC<CardProps>;
75
+ export declare const Card: ForwardRefExoticComponent<
76
+ CardProps & RefAttributes<HTMLDivElement>
77
+ >;
@@ -1,12 +1,13 @@
1
1
  import type { ReactNode, CSSProperties, FC, HTMLAttributes } from "react";
2
2
 
3
- export interface CarouselProps extends HTMLAttributes<HTMLDivElement> {
3
+ export interface CarouselProps
4
+ extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
4
5
  items?: ReactNode[];
5
- itemWidthRatio?: number;
6
- itemCount?: number;
7
- itemGap?: number;
8
- overlapOffsetRatio?: number;
9
- autoPlay?: boolean;
6
+ itemWidthRatio?: number;
7
+ itemCount?: number;
8
+ itemGap?: number;
9
+ overlapOffsetRatio?: number;
10
+ autoPlay?: boolean;
10
11
  autoPlayInterval?: number;
11
12
  scaleRatio?: number;
12
13
  opacityRatio?: number;
@@ -1,11 +1,11 @@
1
1
  import type { ReactNode, CSSProperties, FC, HTMLAttributes } from "react";
2
2
  import type {
3
- defaultColorType,
4
- shapeType,
5
- borderType,
6
- shadowType,
7
- surfaceType
8
- } from "../commonType";
3
+ defaultColorType,
4
+ shapeType,
5
+ borderType,
6
+ shadowType,
7
+ surfaceType
8
+ } from "../commonType";
9
9
 
10
10
  export type CollapseSize = "sm" | "md" | "lg";
11
11
 
@@ -15,7 +15,8 @@ export interface CollapseItem {
15
15
  children: ReactNode;
16
16
  }
17
17
 
18
- export interface CollapseProps extends HTMLAttributes<HTMLDivElement> {
18
+ export interface CollapseProps
19
+ extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
19
20
  items?: CollapseItem[];
20
21
  openKeys?: string[];
21
22
  defaultOpenKeys?: string[];
@@ -29,10 +30,10 @@ export interface CollapseProps extends HTMLAttributes<HTMLDivElement> {
29
30
  headerColor?: string;
30
31
  contentColorType?: defaultColorType;
31
32
  contentBackground?: string;
32
- contentColor?: string;
33
- shadow?: shadowType;
34
- surface?: surfaceType;
35
- disabledKeys?: string[];
33
+ contentColor?: string;
34
+ shadow?: shadowType;
35
+ surface?: surfaceType;
36
+ disabledKeys?: string[];
36
37
  className?: string;
37
38
  size?: CollapseSize;
38
39
  shape?: shapeType;
@@ -1,17 +1,19 @@
1
1
  import type { ReactNode, CSSProperties, FC, HTMLAttributes } from "react";
2
2
  import type {
3
- defaultColorType,
4
- shapeType,
5
- borderType,
6
- shadowType,
7
- surfaceType
8
- } from "../commonType";
3
+ defaultColorType,
4
+ shapeType,
5
+ borderType,
6
+ shadowType,
7
+ surfaceType
8
+ } from "../commonType";
9
9
 
10
10
  export type DrawerPlacement = "left" | "right" | "top" | "bottom";
11
11
 
12
- export interface DrawerProps extends HTMLAttributes<HTMLDivElement> {
13
- open?: boolean;
14
- onClose?: () => void;
12
+ export interface DrawerProps
13
+ extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
14
+ open?: boolean;
15
+ onClose?: () => void;
16
+ onEsc?: boolean;
15
17
  title?: ReactNode;
16
18
  children?: ReactNode;
17
19
  footer?: ReactNode;
@@ -24,10 +26,10 @@ export interface DrawerProps extends HTMLAttributes<HTMLDivElement> {
24
26
  borderColor?: string;
25
27
  borderType?: borderType;
26
28
  borderWeight?: number;
27
- shape?: shapeType;
28
- shadow?: shadowType;
29
- surface?: surfaceType;
30
- width?: number | string;
29
+ shape?: shapeType;
30
+ shadow?: shadowType;
31
+ surface?: surfaceType;
32
+ width?: number | string;
31
33
  height?: number | string;
32
34
  className?: string;
33
35
  placement?: DrawerPlacement;
@@ -1,13 +1,14 @@
1
1
  import type { ReactNode, CSSProperties, FC, HTMLAttributes } from "react";
2
2
  import type {
3
- defaultColorType,
4
- shapeType,
5
- borderType,
6
- shadowType,
7
- surfaceType
8
- } from "../commonType";
3
+ defaultColorType,
4
+ shapeType,
5
+ borderType,
6
+ shadowType,
7
+ surfaceType
8
+ } from "../commonType";
9
9
 
10
- export interface ModalProps extends HTMLAttributes<HTMLDivElement> {
10
+ export interface ModalProps
11
+ extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
11
12
  open?: boolean;
12
13
  onClose?: () => void;
13
14
  onEsc?: boolean;
@@ -21,10 +22,10 @@ export interface ModalProps extends HTMLAttributes<HTMLDivElement> {
21
22
  borderColor?: string;
22
23
  borderType?: borderType;
23
24
  borderWeight?: number;
24
- shape?: shapeType;
25
- shadow?: shadowType;
26
- surface?: surfaceType;
27
- width?: number | string;
25
+ shape?: shapeType;
26
+ shadow?: shadowType;
27
+ surface?: surfaceType;
28
+ width?: number | string;
28
29
  height?: number | string;
29
30
  className?: string;
30
31
  divider?: boolean;
@@ -14,7 +14,8 @@ export interface SegmentedOption {
14
14
  disabled?: boolean;
15
15
  }
16
16
 
17
- export interface SegmentedProps extends HTMLAttributes<HTMLDivElement> {
17
+ export interface SegmentedProps
18
+ extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
18
19
  options?: (SegmentedOption | string | number)[];
19
20
  value?: string | number;
20
21
  onChange?: (value: string | number) => void;
@@ -28,7 +28,8 @@ export type TableSorter<T> = {
28
28
  order: TableSortOrder;
29
29
  } | null;
30
30
 
31
- export interface TableProps<T = any> extends HTMLAttributes<HTMLDivElement> {
31
+ export interface TableProps<T = any>
32
+ extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
32
33
  columns: TableColumn<T>[];
33
34
  dataSource: T[];
34
35
  rowKey?: string | ((record: T) => string);
@@ -21,7 +21,8 @@ export interface TabPaneProps {
21
21
  children?: ReactNode;
22
22
  }
23
23
 
24
- export interface TabsProps extends HTMLAttributes<HTMLDivElement> {
24
+ export interface TabsProps
25
+ extends Omit<HTMLAttributes<HTMLDivElement>, "color" | "onChange"> {
25
26
  value?: string;
26
27
  defaultValue?: string;
27
28
  onChange?: (key: string) => void;
@@ -1,4 +1,11 @@
1
- import type { ReactNode, CSSProperties, FC, HTMLAttributes } from "react";
1
+ import type {
2
+ ReactNode,
3
+ CSSProperties,
4
+ FC,
5
+ ForwardRefExoticComponent,
6
+ InputHTMLAttributes,
7
+ RefAttributes
8
+ } from "react";
2
9
  import type { defaultColorType } from "../commonType";
3
10
 
4
11
  export type CheckboxLabelPosition = "left" | "right" | "top" | "bottom";
@@ -10,8 +17,17 @@ export interface CheckboxOption {
10
17
  disabled?: boolean;
11
18
  }
12
19
 
13
- export interface CheckboxProps
14
- extends Omit<HTMLAttributes<HTMLLabelElement>, "onChange"> {
20
+ export interface CheckboxProps
21
+ extends Omit<
22
+ InputHTMLAttributes<HTMLInputElement>,
23
+ | "type"
24
+ | "onChange"
25
+ | "checked"
26
+ | "defaultChecked"
27
+ | "color"
28
+ | "style"
29
+ | "className"
30
+ > {
15
31
  checked?: boolean;
16
32
  defaultChecked?: boolean;
17
33
  onChange?: (checked: boolean) => void;
@@ -49,7 +65,9 @@ export interface CheckboxGroupProps {
49
65
  className?: string;
50
66
  }
51
67
 
52
- declare const Checkbox: FC<CheckboxProps> & {
68
+ declare const Checkbox: ForwardRefExoticComponent<
69
+ CheckboxProps & RefAttributes<HTMLInputElement>
70
+ > & {
53
71
  Group: FC<CheckboxGroupProps>;
54
72
  };
55
73
 
@@ -19,7 +19,8 @@ export interface ColorPickerColor {
19
19
  rgba: string;
20
20
  }
21
21
 
22
- export interface ColorPickerProps extends HTMLAttributes<HTMLDivElement> {
22
+ export interface ColorPickerProps
23
+ extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
23
24
  color?: string;
24
25
  onChange?: (color: ColorPickerColor) => void;
25
26
  open?: boolean;
@@ -44,7 +44,7 @@ export type InputType =
44
44
  export interface InputProps
45
45
  extends Omit<
46
46
  HTMLAttributes<HTMLInputElement>,
47
- "onChange" | "onClick" | "onKeyDown"
47
+ "onChange" | "onClick" | "onKeyDown" | "prefix"
48
48
  > {
49
49
  background?: string;
50
50
  color?: string;
@@ -126,12 +126,12 @@ export interface OTPProps
126
126
  length?: number;
127
127
  }
128
128
 
129
- export declare const Textarea: FC<TextareaProps>;
130
- export declare const OTP: FC<OTPProps>;
131
-
132
- export declare const Input: FC<InputProps> & {
133
- Textarea: typeof Textarea;
134
- OTP: typeof OTP;
135
- };
136
-
137
- export default Input;
129
+ export declare const Textarea: FC<TextareaProps>;
130
+ export declare const OTP: FC<OTPProps>;
131
+
132
+ export declare const Input: FC<InputProps> & {
133
+ Textarea: typeof Textarea;
134
+ OTP: typeof OTP;
135
+ };
136
+
137
+ export default Input;
@@ -1,4 +1,11 @@
1
- import type { ReactNode, CSSProperties, FC, HTMLAttributes } from "react";
1
+ import type {
2
+ ReactNode,
3
+ CSSProperties,
4
+ FC,
5
+ ForwardRefExoticComponent,
6
+ InputHTMLAttributes,
7
+ RefAttributes
8
+ } from "react";
2
9
  import type { defaultColorType } from "../commonType";
3
10
 
4
11
  export type RadioLabelPosition = "left" | "right" | "top" | "bottom";
@@ -10,8 +17,17 @@ export interface RadioOption {
10
17
  disabled?: boolean;
11
18
  }
12
19
 
13
- export interface RadioProps
14
- extends Omit<HTMLAttributes<HTMLLabelElement>, "onChange"> {
20
+ export interface RadioProps
21
+ extends Omit<
22
+ InputHTMLAttributes<HTMLInputElement>,
23
+ | "type"
24
+ | "onChange"
25
+ | "checked"
26
+ | "defaultChecked"
27
+ | "color"
28
+ | "style"
29
+ | "className"
30
+ > {
15
31
  checked?: boolean;
16
32
  defaultChecked?: boolean;
17
33
  onChange?: (checked: boolean) => void;
@@ -47,7 +63,9 @@ export interface RadioGroupProps {
47
63
  className?: string;
48
64
  }
49
65
 
50
- declare const Radio: FC<RadioProps> & {
66
+ declare const Radio: ForwardRefExoticComponent<
67
+ RadioProps & RefAttributes<HTMLInputElement>
68
+ > & {
51
69
  Group: FC<RadioGroupProps>;
52
70
  };
53
71
 
@@ -2,7 +2,8 @@ import type { ReactElement, CSSProperties, FC, HTMLAttributes } from "react";
2
2
 
3
3
  export type RateIcon = "star" | "heart" | ReactElement;
4
4
 
5
- export interface RateProps extends HTMLAttributes<HTMLDivElement> {
5
+ export interface RateProps
6
+ extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
6
7
  count?: number;
7
8
  allowHalf?: boolean;
8
9
  defaultValue?: number;
@@ -20,4 +21,4 @@ export interface RateProps extends HTMLAttributes<HTMLDivElement> {
20
21
  icon?: RateIcon;
21
22
  }
22
23
 
23
- export declare const Rate: FC<RateProps>;
24
+ export declare const Rate: FC<RateProps>;
@@ -1,22 +1,23 @@
1
1
  import type { ReactNode, CSSProperties, FC, HTMLAttributes } from "react";
2
2
  import type {
3
3
  defaultColorType,
4
- shapeType,
5
- borderType,
6
- shadowType,
7
- tagColorType,
8
- surfaceType
9
- } from "../commonType";
4
+ shapeType,
5
+ borderType,
6
+ shadowType,
7
+ tagColorType,
8
+ surfaceType
9
+ } from "../commonType";
10
10
 
11
11
  export type SelectSize = "sm" | "md" | "lg";
12
12
 
13
- export interface SelectOption {
14
- value: string | number;
15
- label: ReactNode;
16
- content?: ReactNode;
17
- }
13
+ export interface SelectOption {
14
+ value: string | number;
15
+ label: ReactNode;
16
+ content?: ReactNode;
17
+ }
18
18
 
19
- export interface SelectProps extends HTMLAttributes<HTMLDivElement> {
19
+ export interface SelectProps
20
+ extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
20
21
  background?: string;
21
22
  color?: string;
22
23
  border?: boolean;
@@ -30,10 +31,10 @@ export interface SelectProps extends HTMLAttributes<HTMLDivElement> {
30
31
  style?: CSSProperties;
31
32
  value?: string | number | (string | number)[];
32
33
  onChange?: (value: string | number | (string | number)[]) => void;
33
- shape?: shapeType;
34
- shadow?: shadowType;
35
- surface?: surfaceType;
36
- size?: SelectSize;
34
+ shape?: shapeType;
35
+ shadow?: shadowType;
36
+ surface?: surfaceType;
37
+ size?: SelectSize;
37
38
  id?: string;
38
39
  tagColorType?: tagColorType;
39
40
  colorType?: defaultColorType;
@@ -4,7 +4,8 @@ import type { defaultColorType, borderType, shadowType } from "../commonType";
4
4
 
5
5
  export type SliderSize = "sm" | "md" | "lg";
6
6
 
7
- export interface SliderProps extends HTMLAttributes<HTMLDivElement> {
7
+ export interface SliderProps
8
+ extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
8
9
  min?: number;
9
10
  max?: number;
10
11
  value?: number;
@@ -1,7 +1,24 @@
1
- import type { ReactNode, CSSProperties, FC, HTMLAttributes } from "react";
1
+ import type {
2
+ ReactNode,
3
+ CSSProperties,
4
+ ForwardRefExoticComponent,
5
+ InputHTMLAttributes,
6
+ RefAttributes
7
+ } from "react";
2
8
  import type { defaultColorType, shadowType } from "../commonType";
3
9
 
4
- export interface SwitchProps extends HTMLAttributes<HTMLDivElement> {
10
+ export interface SwitchProps
11
+ extends Omit<
12
+ InputHTMLAttributes<HTMLInputElement>,
13
+ | "type"
14
+ | "onChange"
15
+ | "checked"
16
+ | "defaultChecked"
17
+ | "color"
18
+ | "size"
19
+ | "style"
20
+ | "className"
21
+ > {
5
22
  checked?: boolean;
6
23
  defaultChecked?: boolean;
7
24
  onChange?: (checked: boolean) => void;
@@ -22,5 +39,7 @@ export interface SwitchProps extends HTMLAttributes<HTMLDivElement> {
22
39
  ariaLabel?: string;
23
40
  }
24
41
 
25
- declare const Switch: FC<SwitchProps>;
42
+ declare const Switch: ForwardRefExoticComponent<
43
+ SwitchProps & RefAttributes<HTMLInputElement>
44
+ >;
26
45
  export default Switch;
@@ -13,7 +13,8 @@ export interface TimeSelectorValue {
13
13
  endTime?: Date;
14
14
  }
15
15
 
16
- export interface TimeSelectorProps extends HTMLAttributes<HTMLDivElement> {
16
+ export interface TimeSelectorProps
17
+ extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
17
18
  value?: Date | TimeSelectorValue;
18
19
  onChange?: (value: Date | TimeSelectorValue) => void;
19
20
  range?: boolean;