@oneplatformdev/ui 0.0.1-beta.45 → 0.0.1-beta.46

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 (2) hide show
  1. package/Select/Select.mjs +48 -46
  2. package/package.json +1 -1
package/Select/Select.mjs CHANGED
@@ -1,65 +1,67 @@
1
- import { jsxs as d, jsx as a } from "react/jsx-runtime";
2
- import { Button as f } from "../Button/Button.mjs";
1
+ import { jsxs as d, jsx as c } from "react/jsx-runtime";
2
+ import { createElement as f } from "react";
3
+ import { Button as g } from "../Button/Button.mjs";
3
4
  import "../Button/buttonVariants.mjs";
4
- import { SelectRoot as g, SelectContent as p, SelectTrigger as h, SelectValue as v, SelectItem as u } from "./SelectRoot.mjs";
5
- import { isValidReactElement as c } from "@oneplatformdev/utils";
6
- const S = (o) => {
7
- const { placeholder: l, renderTrigger: e, slotProps: t } = o, n = /* @__PURE__ */ a(h, { ...(t == null ? void 0 : t.triggerProps) || {}, children: /* @__PURE__ */ a(v, { placeholder: l }) });
8
- return e && typeof e == "function" && c(e(o, n)) ? e(o, n) : n;
9
- }, C = (o) => {
10
- const { renderOption: l, option: e, index: t, options: n, ...i } = o, r = /* @__PURE__ */ a(u, { value: e.value, children: e.label }, e.value);
11
- return l && typeof l == "function" && c(l(
5
+ import { SelectRoot as p, SelectContent as h, SelectTrigger as v, SelectValue as S, SelectItem as u } from "./SelectRoot.mjs";
6
+ import { isValidReactElement as i } from "@oneplatformdev/utils";
7
+ const C = (r) => {
8
+ const { placeholder: l, renderTrigger: e, slotProps: n } = r, t = /* @__PURE__ */ c(v, { ...(n == null ? void 0 : n.triggerProps) || {}, children: /* @__PURE__ */ c(S, { placeholder: l }) });
9
+ return e && typeof e == "function" && i(e(r, t)) ? e(r, t) : t;
10
+ }, x = (r) => {
11
+ const { renderOption: l, option: e, index: n, options: t, ...a } = r, o = /* @__PURE__ */ c(u, { value: e.value, children: e.label }, e.value);
12
+ return l && typeof l == "function" && i(l(
12
13
  e,
13
- t,
14
14
  n,
15
- { ...i, options: n },
16
- r
17
- )) ? c(l(
18
- e,
19
15
  t,
20
- n,
21
- { ...i, options: n },
22
- r
23
- ), u) ? c(l(
16
+ { ...a, options: t },
17
+ o
18
+ )) ? i(l(
24
19
  e,
25
- t,
26
20
  n,
27
- { ...i, options: n },
28
- r
29
- )) : /* @__PURE__ */ a(u, { value: e.value, children: l(
21
+ t,
22
+ { ...a, options: t },
23
+ o
24
+ ), u) ? i(l(
30
25
  e,
26
+ n,
31
27
  t,
28
+ { ...a, options: t },
29
+ o
30
+ )) : /* @__PURE__ */ c(u, { value: e.value, children: l(
31
+ e,
32
32
  n,
33
- { ...i, options: n },
34
- r
35
- ) }, e.value) : r;
36
- }, T = (o) => {
33
+ t,
34
+ { ...a, options: t },
35
+ o
36
+ ) }, e.value) : o;
37
+ }, j = (r) => {
37
38
  const {
38
39
  value: l,
39
40
  options: e,
40
- onChange: t,
41
- nullable: n = !1,
42
- clearLabel: i = "Clear",
43
- disabled: r
44
- } = o;
41
+ onChange: n,
42
+ nullable: t = !1,
43
+ clearLabel: a = "Clear",
44
+ disabled: o
45
+ } = r;
45
46
  return /* @__PURE__ */ d(
46
- g,
47
+ p,
47
48
  {
48
49
  value: l,
49
- onValueChange: t,
50
- disabled: r,
50
+ onValueChange: n,
51
+ disabled: o,
51
52
  children: [
52
- /* @__PURE__ */ a(S, { ...o }),
53
- /* @__PURE__ */ d(p, { children: [
54
- n && /* @__PURE__ */ a(f, { className: "w-full px-2", variant: "secondary", size: "sm", onClick: () => {
55
- t("");
56
- }, children: i }),
57
- e.map((s, m) => /* @__PURE__ */ a(
58
- C,
53
+ /* @__PURE__ */ c(C, { ...r }),
54
+ /* @__PURE__ */ d(h, { children: [
55
+ t && /* @__PURE__ */ c(g, { className: "w-full px-2", variant: "secondary", size: "sm", onClick: () => {
56
+ n("");
57
+ }, children: a }),
58
+ e.map((m, s) => /* @__PURE__ */ f(
59
+ x,
59
60
  {
60
- ...o,
61
- option: s,
62
- index: m
61
+ ...r,
62
+ key: m.value,
63
+ option: m,
64
+ index: s
63
65
  }
64
66
  ))
65
67
  ] })
@@ -68,5 +70,5 @@ const S = (o) => {
68
70
  );
69
71
  };
70
72
  export {
71
- T as Select
73
+ j as Select
72
74
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneplatformdev/ui",
3
- "version": "0.0.1-beta.45",
3
+ "version": "0.0.1-beta.46",
4
4
  "description": "UI React Components.",
5
5
  "author": "One Platform Development Team",
6
6
  "keywords": [