@yamada-ui/native-select 0.3.7 → 0.4.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.
@@ -32,7 +32,7 @@ var [NativeSelectProvider, useNativeSelect] = createContext({
32
32
  });
33
33
  var NativeSelect = forwardRef(
34
34
  (props, ref) => {
35
- const [styles, mergedProps] = useMultiComponentStyle("Select", props);
35
+ const [styles, mergedProps] = useMultiComponentStyle("NativeSelect", props);
36
36
  let {
37
37
  className,
38
38
  children,
@@ -43,7 +43,6 @@ var NativeSelect = forwardRef(
43
43
  minH,
44
44
  minHeight,
45
45
  options = [],
46
- value,
47
46
  placeholder,
48
47
  containerProps,
49
48
  iconProps,
@@ -51,15 +50,15 @@ var NativeSelect = forwardRef(
51
50
  } = omitThemeProps(mergedProps);
52
51
  rest = useFormControlProps(rest);
53
52
  const formControlProps = pickObject(rest, formControlProperties);
54
- const [layoutProps, selectPorps] = splitObject(rest, layoutStylesProperties);
53
+ const [layoutProps, selectProps] = splitObject(rest, layoutStylesProperties);
55
54
  let computedChildren = [];
56
55
  if (!children && options.length) {
57
- computedChildren = options.map(({ label, value: value2, ...props2 }, i) => {
58
- if (!isArray(value2)) {
59
- return /* @__PURE__ */ jsx(NativeOption, { value: value2, ...props2, children: label }, i);
56
+ computedChildren = options.map(({ label, value, ...props2 }, i) => {
57
+ if (!isArray(value)) {
58
+ return /* @__PURE__ */ jsx(NativeOption, { value, ...props2, children: label }, i);
60
59
  } else {
61
- return /* @__PURE__ */ jsx(NativeOptionGroup, { label, ...props2, children: value2.map(
62
- ({ label: label2, value: value3, ...props3 }, i2) => !isArray(value3) ? /* @__PURE__ */ jsx(NativeOption, { value: value3, ...props3, children: label2 }, i2) : null
60
+ return /* @__PURE__ */ jsx(NativeOptionGroup, { label, ...props2, children: value.map(
61
+ ({ label: label2, value: value2, ...props3 }, i2) => !isArray(value2) ? /* @__PURE__ */ jsx(NativeOption, { value: value2, ...props3, children: label2 }, i2) : null
63
62
  ) }, i);
64
63
  }
65
64
  });
@@ -84,14 +83,13 @@ var NativeSelect = forwardRef(
84
83
  {
85
84
  ref,
86
85
  className: cx("ui-native-select-field", className),
87
- value,
88
86
  __css: {
89
87
  paddingEnd: "2rem",
90
88
  h: h != null ? h : height,
91
89
  minH: minH != null ? minH : minHeight,
92
90
  ...styles.field
93
91
  },
94
- ...selectPorps,
92
+ ...selectProps,
95
93
  children: [
96
94
  placeholder ? /* @__PURE__ */ jsx(NativeOption, { value: "", hidden: !placeholderInOptions, children: placeholder }) : null,
97
95
  children != null ? children : computedChildren
package/dist/index.js CHANGED
@@ -40,7 +40,7 @@ var [NativeSelectProvider, useNativeSelect] = (0, import_utils.createContext)({
40
40
  });
41
41
  var NativeSelect = (0, import_core.forwardRef)(
42
42
  (props, ref) => {
43
- const [styles, mergedProps] = (0, import_core.useMultiComponentStyle)("Select", props);
43
+ const [styles, mergedProps] = (0, import_core.useMultiComponentStyle)("NativeSelect", props);
44
44
  let {
45
45
  className,
46
46
  children,
@@ -51,7 +51,6 @@ var NativeSelect = (0, import_core.forwardRef)(
51
51
  minH,
52
52
  minHeight,
53
53
  options = [],
54
- value,
55
54
  placeholder,
56
55
  containerProps,
57
56
  iconProps,
@@ -59,15 +58,15 @@ var NativeSelect = (0, import_core.forwardRef)(
59
58
  } = (0, import_core.omitThemeProps)(mergedProps);
60
59
  rest = (0, import_form_control.useFormControlProps)(rest);
61
60
  const formControlProps = (0, import_utils.pickObject)(rest, import_form_control.formControlProperties);
62
- const [layoutProps, selectPorps] = (0, import_utils.splitObject)(rest, import_core.layoutStylesProperties);
61
+ const [layoutProps, selectProps] = (0, import_utils.splitObject)(rest, import_core.layoutStylesProperties);
63
62
  let computedChildren = [];
64
63
  if (!children && options.length) {
65
- computedChildren = options.map(({ label, value: value2, ...props2 }, i) => {
66
- if (!(0, import_utils.isArray)(value2)) {
67
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NativeOption, { value: value2, ...props2, children: label }, i);
64
+ computedChildren = options.map(({ label, value, ...props2 }, i) => {
65
+ if (!(0, import_utils.isArray)(value)) {
66
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NativeOption, { value, ...props2, children: label }, i);
68
67
  } else {
69
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NativeOptionGroup, { label, ...props2, children: value2.map(
70
- ({ label: label2, value: value3, ...props3 }, i2) => !(0, import_utils.isArray)(value3) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NativeOption, { value: value3, ...props3, children: label2 }, i2) : null
68
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NativeOptionGroup, { label, ...props2, children: value.map(
69
+ ({ label: label2, value: value2, ...props3 }, i2) => !(0, import_utils.isArray)(value2) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NativeOption, { value: value2, ...props3, children: label2 }, i2) : null
71
70
  ) }, i);
72
71
  }
73
72
  });
@@ -92,14 +91,13 @@ var NativeSelect = (0, import_core.forwardRef)(
92
91
  {
93
92
  ref,
94
93
  className: (0, import_utils.cx)("ui-native-select-field", className),
95
- value,
96
94
  __css: {
97
95
  paddingEnd: "2rem",
98
96
  h: h != null ? h : height,
99
97
  minH: minH != null ? minH : minHeight,
100
98
  ...styles.field
101
99
  },
102
- ...selectPorps,
100
+ ...selectProps,
103
101
  children: [
104
102
  placeholder ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NativeOption, { value: "", hidden: !placeholderInOptions, children: placeholder }) : null,
105
103
  children != null ? children : computedChildren
package/dist/index.mjs CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  NativeOption,
4
4
  NativeOptionGroup,
5
5
  NativeSelect
6
- } from "./chunk-37WY4I2Y.mjs";
6
+ } from "./chunk-6KO77FUQ.mjs";
7
7
  export {
8
8
  NativeOption,
9
9
  NativeOptionGroup,
@@ -38,7 +38,7 @@ var [NativeSelectProvider, useNativeSelect] = (0, import_utils.createContext)({
38
38
  });
39
39
  var NativeSelect = (0, import_core.forwardRef)(
40
40
  (props, ref) => {
41
- const [styles, mergedProps] = (0, import_core.useMultiComponentStyle)("Select", props);
41
+ const [styles, mergedProps] = (0, import_core.useMultiComponentStyle)("NativeSelect", props);
42
42
  let {
43
43
  className,
44
44
  children,
@@ -49,7 +49,6 @@ var NativeSelect = (0, import_core.forwardRef)(
49
49
  minH,
50
50
  minHeight,
51
51
  options = [],
52
- value,
53
52
  placeholder,
54
53
  containerProps,
55
54
  iconProps,
@@ -57,15 +56,15 @@ var NativeSelect = (0, import_core.forwardRef)(
57
56
  } = (0, import_core.omitThemeProps)(mergedProps);
58
57
  rest = (0, import_form_control.useFormControlProps)(rest);
59
58
  const formControlProps = (0, import_utils.pickObject)(rest, import_form_control.formControlProperties);
60
- const [layoutProps, selectPorps] = (0, import_utils.splitObject)(rest, import_core.layoutStylesProperties);
59
+ const [layoutProps, selectProps] = (0, import_utils.splitObject)(rest, import_core.layoutStylesProperties);
61
60
  let computedChildren = [];
62
61
  if (!children && options.length) {
63
- computedChildren = options.map(({ label, value: value2, ...props2 }, i) => {
64
- if (!(0, import_utils.isArray)(value2)) {
65
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NativeOption, { value: value2, ...props2, children: label }, i);
62
+ computedChildren = options.map(({ label, value, ...props2 }, i) => {
63
+ if (!(0, import_utils.isArray)(value)) {
64
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NativeOption, { value, ...props2, children: label }, i);
66
65
  } else {
67
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NativeOptionGroup, { label, ...props2, children: value2.map(
68
- ({ label: label2, value: value3, ...props3 }, i2) => !(0, import_utils.isArray)(value3) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NativeOption, { value: value3, ...props3, children: label2 }, i2) : null
66
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NativeOptionGroup, { label, ...props2, children: value.map(
67
+ ({ label: label2, value: value2, ...props3 }, i2) => !(0, import_utils.isArray)(value2) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NativeOption, { value: value2, ...props3, children: label2 }, i2) : null
69
68
  ) }, i);
70
69
  }
71
70
  });
@@ -90,14 +89,13 @@ var NativeSelect = (0, import_core.forwardRef)(
90
89
  {
91
90
  ref,
92
91
  className: (0, import_utils.cx)("ui-native-select-field", className),
93
- value,
94
92
  __css: {
95
93
  paddingEnd: "2rem",
96
94
  h: h != null ? h : height,
97
95
  minH: minH != null ? minH : minHeight,
98
96
  ...styles.field
99
97
  },
100
- ...selectPorps,
98
+ ...selectProps,
101
99
  children: [
102
100
  placeholder ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NativeOption, { value: "", hidden: !placeholderInOptions, children: placeholder }) : null,
103
101
  children != null ? children : computedChildren
@@ -3,7 +3,7 @@ import {
3
3
  NativeOption,
4
4
  NativeOptionGroup,
5
5
  NativeSelect
6
- } from "./chunk-37WY4I2Y.mjs";
6
+ } from "./chunk-6KO77FUQ.mjs";
7
7
  export {
8
8
  NativeOption,
9
9
  NativeOptionGroup,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yamada-ui/native-select",
3
- "version": "0.3.7",
3
+ "version": "0.4.0",
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.10.0",
39
- "@yamada-ui/utils": "0.2.1",
40
- "@yamada-ui/form-control": "0.3.7",
41
- "@yamada-ui/icon": "0.3.5"
38
+ "@yamada-ui/core": "0.11.1",
39
+ "@yamada-ui/utils": "0.3.0",
40
+ "@yamada-ui/form-control": "0.3.9",
41
+ "@yamada-ui/icon": "0.3.7"
42
42
  },
43
43
  "devDependencies": {
44
44
  "react": "^18.0.0",