@oneplatformdev/ui 0.0.1-beta.26 → 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.
- package/Input/Input.mjs +27 -31
- package/package.json +5 -5
package/Input/Input.mjs
CHANGED
|
@@ -1,37 +1,33 @@
|
|
|
1
1
|
import { jsxs as f, jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { Eye as g, EyeOff as
|
|
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
|
|
6
|
-
const c =
|
|
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:
|
|
11
|
-
type:
|
|
12
|
-
slotProps: { input:
|
|
13
|
-
onChange:
|
|
14
|
-
onTransform:
|
|
10
|
+
variant: o,
|
|
11
|
+
type: i,
|
|
12
|
+
slotProps: { input: l } = {},
|
|
13
|
+
onChange: m,
|
|
14
|
+
onTransform: n,
|
|
15
15
|
...y
|
|
16
|
-
} = t, { startAdornment:
|
|
16
|
+
} = t, { startAdornment: p } = l || {};
|
|
17
17
|
return /* @__PURE__ */ f("div", { className: "relative", children: [
|
|
18
|
-
!!
|
|
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:
|
|
23
|
-
className:
|
|
24
|
-
v({ variant:
|
|
25
|
-
!!
|
|
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: (
|
|
30
|
-
|
|
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 =
|
|
38
|
+
const d = u.forwardRef(
|
|
43
39
|
(t, a) => {
|
|
44
|
-
const [e,
|
|
45
|
-
|
|
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:
|
|
49
|
-
/* @__PURE__ */ s(
|
|
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
|
|
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(
|
|
56
|
+
children: t ? /* @__PURE__ */ s(g, { size: 16 }) : /* @__PURE__ */ s(b, { size: 16 })
|
|
61
57
|
}
|
|
62
|
-
),
|
|
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
|
-
|
|
61
|
+
I.displayName = "Input";
|
|
66
62
|
export {
|
|
67
63
|
c as BaseInput,
|
|
68
|
-
|
|
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.
|
|
3
|
+
"version": "0.0.1-beta.28",
|
|
4
4
|
"description": "UI React Components.",
|
|
5
5
|
"author": "One Platform Development Team",
|
|
6
6
|
"keywords": [
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
44
44
|
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
45
45
|
"react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
46
|
-
"@oneplatformdev/hooks": "~0.0.1-beta.
|
|
47
|
-
"@oneplatformdev/utils": "~0.0.2-beta.
|
|
46
|
+
"@oneplatformdev/hooks": "~0.0.1-beta.7",
|
|
47
|
+
"@oneplatformdev/utils": "~0.0.2-beta.17",
|
|
48
48
|
"lucide-react": "^0.469.0"
|
|
49
49
|
},
|
|
50
50
|
"peerDependenciesMeta": {
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@hookform/resolvers": "^3.9.1",
|
|
60
|
-
"@oneplatformdev/hooks": "
|
|
61
|
-
"@oneplatformdev/utils": "
|
|
60
|
+
"@oneplatformdev/hooks": "~0.0.1-beta.7",
|
|
61
|
+
"@oneplatformdev/utils": "~0.0.2-beta.16",
|
|
62
62
|
"@radix-ui/react-accordion": "^1.2.2",
|
|
63
63
|
"@radix-ui/react-alert-dialog": "^1.1.4",
|
|
64
64
|
"@radix-ui/react-aspect-ratio": "^1.1.1",
|