@oneplatformdev/ui 0.0.1-beta.27 → 0.0.1-beta.28

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/Input/Input.mjs +27 -31
  2. package/package.json +1 -1
package/Input/Input.mjs CHANGED
@@ -1,37 +1,33 @@
1
1
  import { jsxs as f, jsx as s } from "react/jsx-runtime";
2
- import p, { useState as b } from "react";
3
- import { Eye as g, EyeOff as h } from "lucide-react";
2
+ import u, { useState as N } from "react";
3
+ import { Eye as g, EyeOff as b } from "lucide-react";
4
4
  import { inputVariants as v } from "./inputVariants.mjs";
5
- import { cn as w } from "@oneplatformdev/utils";
6
- const c = p.forwardRef(
5
+ import { cn as h } from "@oneplatformdev/utils";
6
+ const c = u.forwardRef(
7
7
  (t, a) => {
8
8
  const {
9
9
  className: e,
10
- variant: r,
11
- type: o,
12
- slotProps: { input: i } = {},
13
- onChange: u,
14
- onTransform: m,
10
+ variant: o,
11
+ type: i,
12
+ slotProps: { input: l } = {},
13
+ onChange: m,
14
+ onTransform: n,
15
15
  ...y
16
- } = t, { startAdornment: l } = i || {};
16
+ } = t, { startAdornment: p } = l || {};
17
17
  return /* @__PURE__ */ f("div", { className: "relative", children: [
18
- !!l && /* @__PURE__ */ s("span", { className: "absolute left-[10px] top-1/2 -translate-y-1/2", children: l }),
18
+ !!p && /* @__PURE__ */ s("span", { className: "absolute left-[10px] top-1/2 -translate-y-1/2", children: p }),
19
19
  /* @__PURE__ */ s(
20
20
  "input",
21
21
  {
22
- type: o,
23
- className: w(
24
- v({ variant: r, className: e }),
25
- !!l && "pl-8"
22
+ type: i,
23
+ className: h(
24
+ v({ variant: o, className: e }),
25
+ !!p && "pl-8"
26
26
  ),
27
27
  ref: a,
28
28
  ...y,
29
- onChange: (n) => {
30
- if (m) {
31
- const N = m(n.target.value, n);
32
- n.target.value = JSON.stringify(N);
33
- }
34
- u && u(n);
29
+ onChange: (r) => {
30
+ typeof (n == null ? void 0 : n(r.target.value, r)) == "string" && (r.target.value = n(r.target.value, r)), m && m(r);
35
31
  }
36
32
  }
37
33
  )
@@ -39,32 +35,32 @@ const c = p.forwardRef(
39
35
  }
40
36
  );
41
37
  c.displayName = "Input";
42
- const d = p.forwardRef(
38
+ const d = u.forwardRef(
43
39
  (t, a) => {
44
- const [e, r] = b(!1), o = e ? "text" : "password", i = () => {
45
- r(!e);
40
+ const [e, o] = N(!1), i = e ? "text" : "password", l = () => {
41
+ o(!e);
46
42
  };
47
43
  return /* @__PURE__ */ f("div", { className: "relative", children: [
48
- /* @__PURE__ */ s(c, { ...t, type: o, className: "pr-8", ref: a }),
49
- /* @__PURE__ */ s(I, { isVisible: e, onClick: i })
44
+ /* @__PURE__ */ s(c, { ...t, type: i, className: "pr-8", ref: a }),
45
+ /* @__PURE__ */ s(w, { isVisible: e, onClick: l })
50
46
  ] });
51
47
  }
52
48
  );
53
49
  d.displayName = "PasswordInput";
54
- const I = ({ isVisible: t, onClick: a }) => /* @__PURE__ */ s(
50
+ const w = ({ isVisible: t, onClick: a }) => /* @__PURE__ */ s(
55
51
  "button",
56
52
  {
57
53
  type: "button",
58
54
  onClick: a,
59
55
  className: "absolute top-1/2 right-3 transform -translate-y-1/2",
60
- children: t ? /* @__PURE__ */ s(g, { size: 16 }) : /* @__PURE__ */ s(h, { size: 16 })
56
+ children: t ? /* @__PURE__ */ s(g, { size: 16 }) : /* @__PURE__ */ s(b, { size: 16 })
61
57
  }
62
- ), x = p.forwardRef(
58
+ ), I = u.forwardRef(
63
59
  ({ type: t, ...a }, e) => t === "password" ? /* @__PURE__ */ s(d, { type: t, ...a, ref: e }) : /* @__PURE__ */ s(c, { type: t, ...a, ref: e })
64
60
  );
65
- x.displayName = "Input";
61
+ I.displayName = "Input";
66
62
  export {
67
63
  c as BaseInput,
68
- x as Input,
64
+ I as Input,
69
65
  d as PasswordInput
70
66
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneplatformdev/ui",
3
- "version": "0.0.1-beta.27",
3
+ "version": "0.0.1-beta.28",
4
4
  "description": "UI React Components.",
5
5
  "author": "One Platform Development Team",
6
6
  "keywords": [