@sonamu-kit/react-components 0.1.7 → 0.1.9
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/components/index.d.ts +6 -5
- package/dist/components/ui/select/enum-select.d.ts +15 -0
- package/dist/components/ui/select/id-async-select.d.ts +25 -0
- package/dist/components/ui/select/select.d.ts +66 -0
- package/dist/contexts/index.d.ts +1 -1
- package/dist/contexts/sonamu-context.d.ts +14 -5
- package/dist/lib/form-helpers.d.ts +13 -1
- package/dist/react-components.es.js +13116 -14240
- package/dist/react-components.es.js.map +1 -1
- package/package.json +4 -2
- package/dist/components/ui/async-select.d.ts +0 -36
- package/dist/components/ui/multi-select.d.ts +0 -225
- package/dist/components/ui/select.d.ts +0 -20
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sonamu-kit/react-components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "CartaNova <dev@cartanova.ai>",
|
|
6
6
|
"repository": {
|
|
@@ -88,9 +88,10 @@
|
|
|
88
88
|
"sonner": "^2.0.7",
|
|
89
89
|
"tailwind-merge": "^3.4.0",
|
|
90
90
|
"vaul": "^1.1.2",
|
|
91
|
-
"zod": "^4.
|
|
91
|
+
"zod": "^4.3.6"
|
|
92
92
|
},
|
|
93
93
|
"peerDependencies": {
|
|
94
|
+
"@tanstack/react-query": "^5.90.12",
|
|
94
95
|
"@tanstack/react-router": "1.143.11",
|
|
95
96
|
"react": "^19.2.3",
|
|
96
97
|
"react-dom": "^19.2.3"
|
|
@@ -98,6 +99,7 @@
|
|
|
98
99
|
"devDependencies": {
|
|
99
100
|
"@iconify/json": "^2.2.421",
|
|
100
101
|
"@tailwindcss/vite": "^4.1.17",
|
|
102
|
+
"@tanstack/react-query": "^5.90.12",
|
|
101
103
|
"@tanstack/react-router": "1.143.11",
|
|
102
104
|
"@types/inflection": "^2.0.0",
|
|
103
105
|
"@types/react": "^19.2.7",
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export interface AsyncSelectOption<T = unknown> {
|
|
2
|
-
value: T;
|
|
3
|
-
label: string;
|
|
4
|
-
}
|
|
5
|
-
export interface AsyncSelectProps<T = number> {
|
|
6
|
-
/** 선택 옵션 배열 */
|
|
7
|
-
options: AsyncSelectOption<T>[];
|
|
8
|
-
/** 현재 선택된 값 */
|
|
9
|
-
value?: T | null;
|
|
10
|
-
/** 값 변경 핸들러 */
|
|
11
|
-
onValueChange?: (value: T | undefined) => void;
|
|
12
|
-
/** 로딩 상태 */
|
|
13
|
-
isLoading?: boolean;
|
|
14
|
-
/** placeholder 텍스트 */
|
|
15
|
-
placeholder?: string;
|
|
16
|
-
/** 검색 입력 placeholder */
|
|
17
|
-
searchPlaceholder?: string;
|
|
18
|
-
/** 결과 없음 텍스트 */
|
|
19
|
-
emptyText?: string;
|
|
20
|
-
/** 로딩 중 텍스트 */
|
|
21
|
-
loadingText?: string;
|
|
22
|
-
/** clearable 옵션 */
|
|
23
|
-
clearable?: boolean;
|
|
24
|
-
/** 비활성화 */
|
|
25
|
-
disabled?: boolean;
|
|
26
|
-
/** 추가 className */
|
|
27
|
-
className?: string;
|
|
28
|
-
/** 검색어 변경 핸들러 (서버 검색용) */
|
|
29
|
-
onSearch?: (keyword: string) => void;
|
|
30
|
-
/** 검색 디바운스 시간 (ms) */
|
|
31
|
-
searchDebounce?: number;
|
|
32
|
-
}
|
|
33
|
-
export declare function AsyncSelect<T = number>({ options, value, onValueChange, isLoading, placeholder, searchPlaceholder, emptyText, loadingText, clearable, disabled, className, onSearch, searchDebounce, }: AsyncSelectProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
34
|
-
export declare namespace AsyncSelect {
|
|
35
|
-
var displayName: string;
|
|
36
|
-
}
|
|
@@ -1,225 +0,0 @@
|
|
|
1
|
-
import { VariantProps } from 'class-variance-authority';
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
/**
|
|
4
|
-
* Animation types and configurations
|
|
5
|
-
*/
|
|
6
|
-
export interface AnimationConfig {
|
|
7
|
-
/** Badge animation type */
|
|
8
|
-
badgeAnimation?: "bounce" | "pulse" | "wiggle" | "fade" | "slide" | "none";
|
|
9
|
-
/** Popover animation type */
|
|
10
|
-
popoverAnimation?: "scale" | "slide" | "fade" | "flip" | "none";
|
|
11
|
-
/** Option hover animation type */
|
|
12
|
-
optionHoverAnimation?: "highlight" | "scale" | "glow" | "none";
|
|
13
|
-
/** Animation duration in seconds */
|
|
14
|
-
duration?: number;
|
|
15
|
-
/** Animation delay in seconds */
|
|
16
|
-
delay?: number;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Variants for the multi-select component to handle different styles.
|
|
20
|
-
* Uses class-variance-authority (cva) to define different styles based on "variant" prop.
|
|
21
|
-
*/
|
|
22
|
-
declare const multiSelectVariants: (props?: ({
|
|
23
|
-
variant?: "default" | "destructive" | "secondary" | "inverted" | null | undefined;
|
|
24
|
-
badgeAnimation?: "none" | "slide" | "bounce" | "pulse" | "wiggle" | "fade" | null | undefined;
|
|
25
|
-
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
26
|
-
/**
|
|
27
|
-
* Option interface for MultiSelect component
|
|
28
|
-
*/
|
|
29
|
-
interface MultiSelectOption {
|
|
30
|
-
/** The text to display for the option. */
|
|
31
|
-
label: string;
|
|
32
|
-
/** The unique value associated with the option. */
|
|
33
|
-
value: string;
|
|
34
|
-
/** Optional icon component to display alongside the option. */
|
|
35
|
-
icon?: React.ComponentType<{
|
|
36
|
-
className?: string;
|
|
37
|
-
}>;
|
|
38
|
-
/** Whether this option is disabled */
|
|
39
|
-
disabled?: boolean;
|
|
40
|
-
/** Custom styling for the option */
|
|
41
|
-
style?: {
|
|
42
|
-
/** Custom badge color */
|
|
43
|
-
badgeColor?: string;
|
|
44
|
-
/** Custom icon color */
|
|
45
|
-
iconColor?: string;
|
|
46
|
-
/** Gradient background for badge */
|
|
47
|
-
gradient?: string;
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Group interface for organizing options
|
|
52
|
-
*/
|
|
53
|
-
interface MultiSelectGroup {
|
|
54
|
-
/** Group heading */
|
|
55
|
-
heading: string;
|
|
56
|
-
/** Options in this group */
|
|
57
|
-
options: MultiSelectOption[];
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Props for MultiSelect component
|
|
61
|
-
*/
|
|
62
|
-
interface MultiSelectProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "animationConfig">, VariantProps<typeof multiSelectVariants> {
|
|
63
|
-
/**
|
|
64
|
-
* An array of option objects or groups to be displayed in the multi-select component.
|
|
65
|
-
*/
|
|
66
|
-
options: MultiSelectOption[] | MultiSelectGroup[];
|
|
67
|
-
/**
|
|
68
|
-
* Callback function triggered when the selected values change.
|
|
69
|
-
* Receives an array of the new selected values.
|
|
70
|
-
*/
|
|
71
|
-
onValueChange: (value: string[]) => void;
|
|
72
|
-
/**
|
|
73
|
-
* The current selected values.
|
|
74
|
-
*/
|
|
75
|
-
value: string[];
|
|
76
|
-
/**
|
|
77
|
-
* Placeholder text to be displayed when no values are selected.
|
|
78
|
-
* Optional, defaults to "Select options".
|
|
79
|
-
*/
|
|
80
|
-
placeholder?: string;
|
|
81
|
-
/**
|
|
82
|
-
* Animation duration in seconds for the visual effects (e.g., bouncing badges).
|
|
83
|
-
* Optional, defaults to 0 (no animation).
|
|
84
|
-
*/
|
|
85
|
-
animation?: number;
|
|
86
|
-
/**
|
|
87
|
-
* Advanced animation configuration for different component parts.
|
|
88
|
-
* Optional, allows fine-tuning of various animation effects.
|
|
89
|
-
*/
|
|
90
|
-
animationConfig?: AnimationConfig;
|
|
91
|
-
/**
|
|
92
|
-
* Maximum number of items to display. Extra selected items will be summarized.
|
|
93
|
-
* Optional, defaults to 3.
|
|
94
|
-
*/
|
|
95
|
-
maxCount?: number;
|
|
96
|
-
/**
|
|
97
|
-
* The modality of the popover. When set to true, interaction with outside elements
|
|
98
|
-
* will be disabled and only popover content will be visible to screen readers.
|
|
99
|
-
* Optional, defaults to false.
|
|
100
|
-
*/
|
|
101
|
-
modalPopover?: boolean;
|
|
102
|
-
/**
|
|
103
|
-
* If true, renders the multi-select component as a child of another component.
|
|
104
|
-
* Optional, defaults to false.
|
|
105
|
-
*/
|
|
106
|
-
asChild?: boolean;
|
|
107
|
-
/**
|
|
108
|
-
* Additional class names to apply custom styles to the multi-select component.
|
|
109
|
-
* Optional, can be used to add custom styles.
|
|
110
|
-
*/
|
|
111
|
-
className?: string;
|
|
112
|
-
/**
|
|
113
|
-
* If true, disables the select all functionality.
|
|
114
|
-
* Optional, defaults to false.
|
|
115
|
-
*/
|
|
116
|
-
hideSelectAll?: boolean;
|
|
117
|
-
/**
|
|
118
|
-
* If true, shows search functionality in the popover.
|
|
119
|
-
* If false, hides the search input completely.
|
|
120
|
-
* Optional, defaults to true.
|
|
121
|
-
*/
|
|
122
|
-
searchable?: boolean;
|
|
123
|
-
/**
|
|
124
|
-
* Custom empty state message when no options match search.
|
|
125
|
-
* Optional, defaults to "No results found."
|
|
126
|
-
*/
|
|
127
|
-
emptyIndicator?: React.ReactNode;
|
|
128
|
-
/**
|
|
129
|
-
* If true, allows the component to grow and shrink with its content.
|
|
130
|
-
* If false, uses fixed width behavior.
|
|
131
|
-
* Optional, defaults to false.
|
|
132
|
-
*/
|
|
133
|
-
autoSize?: boolean;
|
|
134
|
-
/**
|
|
135
|
-
* If true, shows badges in a single line with horizontal scroll.
|
|
136
|
-
* If false, badges wrap to multiple lines.
|
|
137
|
-
* Optional, defaults to false.
|
|
138
|
-
*/
|
|
139
|
-
singleLine?: boolean;
|
|
140
|
-
/**
|
|
141
|
-
* Custom CSS class for the popover content.
|
|
142
|
-
* Optional, can be used to customize popover appearance.
|
|
143
|
-
*/
|
|
144
|
-
popoverClassName?: string;
|
|
145
|
-
/**
|
|
146
|
-
* If true, disables the component completely.
|
|
147
|
-
* Optional, defaults to false.
|
|
148
|
-
*/
|
|
149
|
-
disabled?: boolean;
|
|
150
|
-
/**
|
|
151
|
-
* Responsive configuration for different screen sizes.
|
|
152
|
-
* Allows customizing maxCount and other properties based on viewport.
|
|
153
|
-
* Can be boolean true for default responsive behavior or an object for custom configuration.
|
|
154
|
-
*/
|
|
155
|
-
responsive?: boolean | {
|
|
156
|
-
/** Configuration for mobile devices (< 640px) */
|
|
157
|
-
mobile?: {
|
|
158
|
-
maxCount?: number;
|
|
159
|
-
hideIcons?: boolean;
|
|
160
|
-
compactMode?: boolean;
|
|
161
|
-
};
|
|
162
|
-
/** Configuration for tablet devices (640px - 1024px) */
|
|
163
|
-
tablet?: {
|
|
164
|
-
maxCount?: number;
|
|
165
|
-
hideIcons?: boolean;
|
|
166
|
-
compactMode?: boolean;
|
|
167
|
-
};
|
|
168
|
-
/** Configuration for desktop devices (> 1024px) */
|
|
169
|
-
desktop?: {
|
|
170
|
-
maxCount?: number;
|
|
171
|
-
hideIcons?: boolean;
|
|
172
|
-
compactMode?: boolean;
|
|
173
|
-
};
|
|
174
|
-
};
|
|
175
|
-
/**
|
|
176
|
-
* Minimum width for the component.
|
|
177
|
-
* Optional, defaults to auto-sizing based on content.
|
|
178
|
-
* When set, component will not shrink below this width.
|
|
179
|
-
*/
|
|
180
|
-
minWidth?: string;
|
|
181
|
-
/**
|
|
182
|
-
* Maximum width for the component.
|
|
183
|
-
* Optional, defaults to 100% of container.
|
|
184
|
-
* Component will not exceed container boundaries.
|
|
185
|
-
*/
|
|
186
|
-
maxWidth?: string;
|
|
187
|
-
/**
|
|
188
|
-
* If true, automatically removes duplicate options based on their value.
|
|
189
|
-
* Optional, defaults to false (shows warning in dev mode instead).
|
|
190
|
-
*/
|
|
191
|
-
deduplicateOptions?: boolean;
|
|
192
|
-
/**
|
|
193
|
-
* If true, automatically closes the popover after selecting an option.
|
|
194
|
-
* Useful for single-selection-like behavior or mobile UX.
|
|
195
|
-
* Optional, defaults to false.
|
|
196
|
-
*/
|
|
197
|
-
closeOnSelect?: boolean;
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* Imperative methods exposed through ref
|
|
201
|
-
*/
|
|
202
|
-
export interface MultiSelectRef {
|
|
203
|
-
/**
|
|
204
|
-
* Programmatically reset the component to its default value
|
|
205
|
-
*/
|
|
206
|
-
reset: () => void;
|
|
207
|
-
/**
|
|
208
|
-
* Get current selected values
|
|
209
|
-
*/
|
|
210
|
-
getSelectedValues: () => string[];
|
|
211
|
-
/**
|
|
212
|
-
* Set selected values programmatically
|
|
213
|
-
*/
|
|
214
|
-
handleValueChange: (values: string[]) => void;
|
|
215
|
-
/**
|
|
216
|
-
* Clear all selected values
|
|
217
|
-
*/
|
|
218
|
-
clear: () => void;
|
|
219
|
-
/**
|
|
220
|
-
* Focus the component
|
|
221
|
-
*/
|
|
222
|
-
focus: () => void;
|
|
223
|
-
}
|
|
224
|
-
export declare const MultiSelect: React.ForwardRefExoticComponent<MultiSelectProps & React.RefAttributes<MultiSelectRef>>;
|
|
225
|
-
export type { MultiSelectOption, MultiSelectGroup, MultiSelectProps };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Override } from '../../lib/types';
|
|
2
|
-
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
type SelectProps = Override<React.ComponentProps<typeof SelectPrimitive.Root>, {
|
|
5
|
-
name?: string;
|
|
6
|
-
onValueChange?: (value: string | undefined | null) => void;
|
|
7
|
-
onBlur?: React.FocusEventHandler<HTMLSelectElement>;
|
|
8
|
-
clearable?: boolean;
|
|
9
|
-
}>;
|
|
10
|
-
declare const Select: React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<HTMLSelectElement>>;
|
|
11
|
-
declare const SelectGroup: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
-
declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
|
|
13
|
-
declare const SelectTrigger: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
14
|
-
declare const SelectScrollUpButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
-
declare const SelectScrollDownButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
-
declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
-
declare const SelectLabel: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
-
declare const SelectItem: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
-
declare const SelectSeparator: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
20
|
-
export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton, };
|