@oneplatformdev/ui 0.0.1-beta.60 → 0.0.1-beta.61

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 CHANGED
@@ -1,66 +1,67 @@
1
- import { jsxs as f, jsx as s } from "react/jsx-runtime";
2
- import u, { useState as N } from "react";
3
- import { Eye as g, EyeOff as b } from "lucide-react";
4
- import { inputVariants as v } from "./inputVariants.mjs";
5
- import { cn as h } from "@oneplatformdev/utils";
6
- const c = u.forwardRef(
7
- (t, a) => {
1
+ import { jsxs as y, jsx as a } from "react/jsx-runtime";
2
+ import d, { useState as b } from "react";
3
+ import { Eye as v, EyeOff as w } from "lucide-react";
4
+ import { inputVariants as h } from "./inputVariants.mjs";
5
+ import { cn as f } from "@oneplatformdev/utils";
6
+ const p = d.forwardRef(
7
+ (t, e) => {
8
8
  const {
9
- className: e,
9
+ className: s,
10
10
  variant: o,
11
- type: i,
12
- slotProps: { input: l } = {},
13
- onChange: m,
14
- onTransform: n,
15
- ...y
16
- } = t, { startAdornment: p } = l || {};
17
- return /* @__PURE__ */ f("div", { className: "relative", children: [
18
- !!p && /* @__PURE__ */ s("span", { className: "absolute left-[10px] top-1/2 -translate-y-1/2", children: p }),
19
- /* @__PURE__ */ s(
11
+ type: c,
12
+ slotProps: { input: u, wrapper: n } = {},
13
+ onChange: l,
14
+ onTransform: i,
15
+ ...g
16
+ } = t, { startAdornment: m } = u || {};
17
+ return /* @__PURE__ */ y("div", { ...n || {}, className: f("relative", n == null ? void 0 : n.className), children: [
18
+ !!m && /* @__PURE__ */ a("span", { className: "absolute left-[10px] top-1/2 -translate-y-1/2", children: m }),
19
+ /* @__PURE__ */ a(
20
20
  "input",
21
21
  {
22
- type: i,
23
- className: h(
24
- v({ variant: o, className: e }),
25
- !!p && "pl-8"
22
+ type: c,
23
+ className: f(
24
+ h({ variant: o, className: s }),
25
+ !!m && "pl-8"
26
26
  ),
27
- ref: a,
28
- ...y,
27
+ ref: e,
28
+ ...g,
29
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);
30
+ typeof (i == null ? void 0 : i(r.target.value, r)) == "string" && (r.target.value = i(r.target.value, r)), l && l(r);
31
31
  }
32
32
  }
33
33
  )
34
34
  ] });
35
35
  }
36
36
  );
37
- c.displayName = "Input";
38
- const d = u.forwardRef(
39
- (t, a) => {
40
- const [e, o] = N(!1), i = e ? "text" : "password", l = () => {
41
- o(!e);
37
+ p.displayName = "Input";
38
+ const N = d.forwardRef(
39
+ (t, e) => {
40
+ var n, l, i;
41
+ const [s, o] = b(!1), c = s ? "text" : "password", u = () => {
42
+ o(!s);
42
43
  };
43
- return /* @__PURE__ */ f("div", { className: "relative", children: [
44
- /* @__PURE__ */ s(c, { ...t, type: i, className: "pr-8", ref: a }),
45
- /* @__PURE__ */ s(w, { isVisible: e, onClick: l })
44
+ return /* @__PURE__ */ y("div", { ...((n = t == null ? void 0 : t.slotProps) == null ? void 0 : n.wrapper) || {}, className: f("relative", (i = (l = t == null ? void 0 : t.slotProps) == null ? void 0 : l.wrapper) == null ? void 0 : i.className), children: [
45
+ /* @__PURE__ */ a(p, { ...t, type: c, className: "pr-8", ref: e }),
46
+ /* @__PURE__ */ a(I, { isVisible: s, onClick: u })
46
47
  ] });
47
48
  }
48
49
  );
49
- d.displayName = "PasswordInput";
50
- const w = ({ isVisible: t, onClick: a }) => /* @__PURE__ */ s(
50
+ N.displayName = "PasswordInput";
51
+ const I = ({ isVisible: t, onClick: e }) => /* @__PURE__ */ a(
51
52
  "button",
52
53
  {
53
54
  type: "button",
54
- onClick: a,
55
+ onClick: e,
55
56
  className: "absolute top-1/2 right-3 transform -translate-y-1/2",
56
- children: t ? /* @__PURE__ */ s(g, { size: 16 }) : /* @__PURE__ */ s(b, { size: 16 })
57
+ children: t ? /* @__PURE__ */ a(v, { size: 16 }) : /* @__PURE__ */ a(w, { size: 16 })
57
58
  }
58
- ), I = u.forwardRef(
59
- ({ type: t, ...a }, e) => t === "password" ? /* @__PURE__ */ s(d, { type: t, ...a, ref: e }) : /* @__PURE__ */ s(c, { type: t, ...a, ref: e })
59
+ ), x = d.forwardRef(
60
+ ({ type: t, ...e }, s) => t === "password" ? /* @__PURE__ */ a(N, { type: t, ...e, ref: s }) : /* @__PURE__ */ a(p, { type: t, ...e, ref: s })
60
61
  );
61
- I.displayName = "Input";
62
+ x.displayName = "Input";
62
63
  export {
63
- c as BaseInput,
64
- I as Input,
65
- d as PasswordInput
64
+ p as BaseInput,
65
+ x as Input,
66
+ N as PasswordInput
66
67
  };
@@ -1,12 +1,13 @@
1
1
  import { inputVariants } from './inputVariants';
2
2
  import { VariantProps } from 'class-variance-authority';
3
- import { default as React, ChangeEvent, ReactNode } from 'react';
3
+ import { default as React, ChangeEvent, HTMLAttributes, ReactNode } from 'react';
4
4
 
5
5
  export interface InputSlotInputProps {
6
6
  startAdornment?: ReactNode;
7
7
  }
8
8
  export interface InputSlotProps {
9
9
  input?: InputSlotInputProps;
10
+ wrapper?: HTMLAttributes<HTMLDivElement>;
10
11
  }
11
12
  export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement>, VariantProps<typeof inputVariants> {
12
13
  slotProps?: InputSlotProps;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneplatformdev/ui",
3
- "version": "0.0.1-beta.60",
3
+ "version": "0.0.1-beta.61",
4
4
  "description": "UI React Components.",
5
5
  "author": "One Platform Development Team",
6
6
  "keywords": [
@@ -14,20 +14,20 @@ const r = (a, e = "hsl") => `${e}(var(${a}))`, d = {
14
14
  // '&:is(.dark *)',
15
15
  // ] ],
16
16
  theme: {
17
- screens: {
18
- sm: "480px",
19
- md: "768px",
20
- lg: "976px",
21
- xl: "1440px"
22
- },
23
- container: {
24
- center: !0,
25
- padding: "2rem",
26
- screens: {
27
- "2xl": "1536px"
28
- }
29
- },
30
17
  extend: {
18
+ screens: {
19
+ sm: "480px",
20
+ md: "768px",
21
+ lg: "976px",
22
+ xl: "1440px"
23
+ },
24
+ container: {
25
+ center: !0,
26
+ padding: "2rem",
27
+ screens: {
28
+ "2xl": "1536px"
29
+ }
30
+ },
31
31
  borderRadius: {
32
32
  sm: "calc(var(--radius) - 4px)",
33
33
  md: "calc(var(--radius) - 2px)",