@yamada-ui/native-select 0.1.12 → 0.2.1
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.
|
@@ -37,7 +37,7 @@ var NativeSelect = forwardRef((props, ref) => {
|
|
|
37
37
|
height,
|
|
38
38
|
minH,
|
|
39
39
|
minHeight,
|
|
40
|
-
|
|
40
|
+
options = [],
|
|
41
41
|
value,
|
|
42
42
|
placeholder,
|
|
43
43
|
isRequired,
|
|
@@ -49,8 +49,8 @@ var NativeSelect = forwardRef((props, ref) => {
|
|
|
49
49
|
const formControlProps = pickObject(rest, formControlProperties);
|
|
50
50
|
const [layoutProps, selectPorps] = splitObject(rest, layoutStylesProperties);
|
|
51
51
|
let computedChildren = [];
|
|
52
|
-
if (!children &&
|
|
53
|
-
computedChildren =
|
|
52
|
+
if (!children && options.length) {
|
|
53
|
+
computedChildren = options.map(({ label, value: value2, ...props2 }, i) => {
|
|
54
54
|
if (!isArray(value2)) {
|
|
55
55
|
return /* @__PURE__ */ jsx(NativeOption, { value: value2, ...props2, children: label }, i);
|
|
56
56
|
} else {
|
package/dist/index.js
CHANGED
|
@@ -48,7 +48,7 @@ var NativeSelect = (0, import_core.forwardRef)((props, ref) => {
|
|
|
48
48
|
height,
|
|
49
49
|
minH,
|
|
50
50
|
minHeight,
|
|
51
|
-
|
|
51
|
+
options = [],
|
|
52
52
|
value,
|
|
53
53
|
placeholder,
|
|
54
54
|
isRequired,
|
|
@@ -60,8 +60,8 @@ var NativeSelect = (0, import_core.forwardRef)((props, ref) => {
|
|
|
60
60
|
const formControlProps = (0, import_utils.pickObject)(rest, import_form_control.formControlProperties);
|
|
61
61
|
const [layoutProps, selectPorps] = (0, import_utils.splitObject)(rest, import_core.layoutStylesProperties);
|
|
62
62
|
let computedChildren = [];
|
|
63
|
-
if (!children &&
|
|
64
|
-
computedChildren =
|
|
63
|
+
if (!children && options.length) {
|
|
64
|
+
computedChildren = options.map(({ label, value: value2, ...props2 }, i) => {
|
|
65
65
|
if (!(0, import_utils.isArray)(value2)) {
|
|
66
66
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NativeOption, { value: value2, ...props2, children: label }, i);
|
|
67
67
|
} else {
|
package/dist/index.mjs
CHANGED
package/dist/native-select.d.ts
CHANGED
|
@@ -9,12 +9,37 @@ type UINativeOption = Omit<DetailedHTMLProps<OptionHTMLAttributes<HTMLOptionElem
|
|
|
9
9
|
value?: Value | UINativeOption[];
|
|
10
10
|
};
|
|
11
11
|
type NativeSelectOptions = {
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* If provided, generate options based on data.
|
|
14
|
+
*
|
|
15
|
+
* @default '[]'
|
|
16
|
+
*/
|
|
17
|
+
options?: UINativeOption[];
|
|
18
|
+
/**
|
|
19
|
+
* The placeholder for select.
|
|
20
|
+
*/
|
|
13
21
|
placeholder?: string;
|
|
22
|
+
/**
|
|
23
|
+
* If `true`, include placeholders in options.
|
|
24
|
+
*
|
|
25
|
+
* @default true
|
|
26
|
+
*/
|
|
14
27
|
placeholderInOptions?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* The border color when the input is focused.
|
|
30
|
+
*/
|
|
15
31
|
focusBorderColor?: string;
|
|
32
|
+
/**
|
|
33
|
+
* The border color when the input is invalid.
|
|
34
|
+
*/
|
|
16
35
|
errorBorderColor?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Props for container element.
|
|
38
|
+
*/
|
|
17
39
|
containerProps?: Omit<HTMLUIProps<'div'>, 'children'>;
|
|
40
|
+
/**
|
|
41
|
+
* Props for icon element.
|
|
42
|
+
*/
|
|
18
43
|
iconProps?: HTMLUIProps<'div'>;
|
|
19
44
|
};
|
|
20
45
|
type NativeSelectProps = Omit<HTMLUIProps<'select'>, 'size'> & ThemeProps<'Select'> & NativeSelectOptions & FormControlOptions;
|
package/dist/native-select.js
CHANGED
|
@@ -46,7 +46,7 @@ var NativeSelect = (0, import_core.forwardRef)((props, ref) => {
|
|
|
46
46
|
height,
|
|
47
47
|
minH,
|
|
48
48
|
minHeight,
|
|
49
|
-
|
|
49
|
+
options = [],
|
|
50
50
|
value,
|
|
51
51
|
placeholder,
|
|
52
52
|
isRequired,
|
|
@@ -58,8 +58,8 @@ var NativeSelect = (0, import_core.forwardRef)((props, ref) => {
|
|
|
58
58
|
const formControlProps = (0, import_utils.pickObject)(rest, import_form_control.formControlProperties);
|
|
59
59
|
const [layoutProps, selectPorps] = (0, import_utils.splitObject)(rest, import_core.layoutStylesProperties);
|
|
60
60
|
let computedChildren = [];
|
|
61
|
-
if (!children &&
|
|
62
|
-
computedChildren =
|
|
61
|
+
if (!children && options.length) {
|
|
62
|
+
computedChildren = options.map(({ label, value: value2, ...props2 }, i) => {
|
|
63
63
|
if (!(0, import_utils.isArray)(value2)) {
|
|
64
64
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NativeOption, { value: value2, ...props2, children: label }, i);
|
|
65
65
|
} else {
|
package/dist/native-select.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yamada-ui/native-select",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Yamada UI native select component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"yamada",
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"url": "https://github.com/hirotomoyamada/yamada-ui/issues"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@yamada-ui/core": "0.
|
|
38
|
+
"@yamada-ui/core": "0.4.0",
|
|
39
39
|
"@yamada-ui/utils": "0.1.1",
|
|
40
|
-
"@yamada-ui/form-control": "0.1
|
|
41
|
-
"@yamada-ui/icon": "0.1
|
|
40
|
+
"@yamada-ui/form-control": "0.2.1",
|
|
41
|
+
"@yamada-ui/icon": "0.2.1"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"react": "^18.0.0",
|
|
@@ -72,6 +72,6 @@
|
|
|
72
72
|
"build:fast": "tsup src",
|
|
73
73
|
"clean": "rimraf dist .turbo",
|
|
74
74
|
"typecheck": "tsc --noEmit",
|
|
75
|
-
"gen:
|
|
75
|
+
"gen:docs": "tsx ../../../scripts/generate-docs"
|
|
76
76
|
}
|
|
77
77
|
}
|