@moondreamsdev/dreamer-ui 1.7.23 → 1.7.25
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.
|
@@ -15,6 +15,8 @@ export interface SelectProps {
|
|
|
15
15
|
disabled?: boolean;
|
|
16
16
|
/** Whether to show a clear button to reset selection. */
|
|
17
17
|
clearable?: boolean;
|
|
18
|
+
/** Whether to allow adding new options when search query doesn't match. Requires `searchable` to be true. */
|
|
19
|
+
allowAdd?: boolean;
|
|
18
20
|
/** The size variant of the select. */
|
|
19
21
|
size?: SelectSize;
|
|
20
22
|
/** Additional CSS classes to apply to the select container. */
|
|
@@ -31,6 +33,8 @@ export interface SelectProps {
|
|
|
31
33
|
onChange?: (value: string) => void;
|
|
32
34
|
/** Callback fired when search input changes (searchable mode). */
|
|
33
35
|
onSearch?: (searchTerm: string) => void;
|
|
36
|
+
/** Callback fired when adding a new option (allowAdd mode). */
|
|
37
|
+
onAdd?: (value: string) => void;
|
|
34
38
|
/** Placeholder text for the search input (searchable mode). */
|
|
35
39
|
searchPlaceholder?: string;
|
|
36
40
|
}
|
|
@@ -66,6 +70,18 @@ export interface SelectProps {
|
|
|
66
70
|
* searchPlaceholder="Search frameworks..."
|
|
67
71
|
* onChange={setFramework}
|
|
68
72
|
* />
|
|
73
|
+
*
|
|
74
|
+
* // Searchable select with add functionality
|
|
75
|
+
* <Select
|
|
76
|
+
* options={options}
|
|
77
|
+
* searchable
|
|
78
|
+
* allowAdd
|
|
79
|
+
* onAdd={(newValue) => {
|
|
80
|
+
* setOptions([...options, { text: newValue, value: newValue }]);
|
|
81
|
+
* }}
|
|
82
|
+
* onChange={setValue}
|
|
83
|
+
* placeholder="Select or add new..."
|
|
84
|
+
* />
|
|
69
85
|
* ```
|
|
70
86
|
*/
|
|
71
|
-
export declare function Select({ options, value, placeholder, searchable, disabled, clearable, size, className, triggerClassName, dropdownClassName, id, ref, onChange, onSearch, searchPlaceholder, }: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
87
|
+
export declare function Select({ options, value, placeholder, searchable, disabled, clearable, allowAdd, size, className, triggerClassName, dropdownClassName, id, ref, onChange, onSearch, onAdd, searchPlaceholder, }: SelectProps): import("react/jsx-runtime").JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moondreamsdev/dreamer-ui",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.25",
|
|
4
4
|
"homepage": "https://ui.moondreams.dev",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -23,27 +23,27 @@
|
|
|
23
23
|
"require": "./dist/index.js"
|
|
24
24
|
},
|
|
25
25
|
"./components": {
|
|
26
|
-
"types": "./dist/
|
|
26
|
+
"types": "./dist/components.d.ts",
|
|
27
27
|
"import": "./dist/components.esm.js",
|
|
28
28
|
"require": "./dist/components.js"
|
|
29
29
|
},
|
|
30
30
|
"./hooks": {
|
|
31
|
-
"types": "./dist/
|
|
31
|
+
"types": "./dist/hooks.d.ts",
|
|
32
32
|
"import": "./dist/hooks.esm.js",
|
|
33
33
|
"require": "./dist/hooks.js"
|
|
34
34
|
},
|
|
35
35
|
"./providers": {
|
|
36
|
-
"types": "./dist/
|
|
36
|
+
"types": "./dist/providers.d.ts",
|
|
37
37
|
"import": "./dist/providers.esm.js",
|
|
38
38
|
"require": "./dist/providers.js"
|
|
39
39
|
},
|
|
40
40
|
"./symbols": {
|
|
41
|
-
"types": "./dist/
|
|
41
|
+
"types": "./dist/symbols.d.ts",
|
|
42
42
|
"import": "./dist/symbols.esm.js",
|
|
43
43
|
"require": "./dist/symbols.js"
|
|
44
44
|
},
|
|
45
45
|
"./utils": {
|
|
46
|
-
"types": "./dist/
|
|
46
|
+
"types": "./dist/utils.d.ts",
|
|
47
47
|
"import": "./dist/utils.esm.js",
|
|
48
48
|
"require": "./dist/utils.js"
|
|
49
49
|
},
|