@oneplatformdev/ui 0.0.1-beta.93 → 0.0.1-beta.96
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 +37 -31
- package/Input/Input.types.d.ts +3 -2
- package/Sheet/Sheet.d.ts +5 -2
- package/Sheet/Sheet.mjs +33 -33
- package/package.json +1 -1
package/Input/Input.mjs
CHANGED
@@ -1,33 +1,39 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import d, { useState as
|
3
|
-
import { Eye as
|
4
|
-
import { inputVariants as
|
1
|
+
import { jsxs as N, jsx as a } from "react/jsx-runtime";
|
2
|
+
import d, { useState as v } from "react";
|
3
|
+
import { Eye as w, EyeOff as h } from "lucide-react";
|
4
|
+
import { inputVariants as P } from "./inputVariants.mjs";
|
5
5
|
import { cn as f } from "@oneplatformdev/utils";
|
6
6
|
const p = d.forwardRef(
|
7
|
-
(t,
|
7
|
+
(t, s) => {
|
8
8
|
const {
|
9
|
-
className:
|
9
|
+
className: e,
|
10
10
|
variant: o,
|
11
11
|
type: c,
|
12
12
|
slotProps: { input: u, wrapper: n } = {},
|
13
|
-
onChange:
|
14
|
-
onTransform:
|
13
|
+
onChange: i,
|
14
|
+
onTransform: l,
|
15
15
|
...g
|
16
|
-
} = t, {
|
17
|
-
|
16
|
+
} = t, {
|
17
|
+
startAdornment: m,
|
18
|
+
className: I,
|
19
|
+
...b
|
20
|
+
} = u || {};
|
21
|
+
return /* @__PURE__ */ N("div", { ...n || {}, className: f("relative", n == null ? void 0 : n.className), children: [
|
18
22
|
!!m && /* @__PURE__ */ a("span", { className: "absolute left-[10px] top-1/2 -translate-y-1/2", children: m }),
|
19
23
|
/* @__PURE__ */ a(
|
20
24
|
"input",
|
21
25
|
{
|
22
26
|
type: c,
|
23
27
|
className: f(
|
24
|
-
|
25
|
-
!!m && "pl-8"
|
28
|
+
P({ variant: o, className: e }),
|
29
|
+
!!m && "pl-8",
|
30
|
+
I
|
26
31
|
),
|
27
|
-
ref:
|
32
|
+
ref: s,
|
33
|
+
...b,
|
28
34
|
...g,
|
29
35
|
onChange: (r) => {
|
30
|
-
typeof (
|
36
|
+
typeof (l == null ? void 0 : l(r.target.value, r)) == "string" && (r.target.value = l(r.target.value, r)), i && i(r);
|
31
37
|
}
|
32
38
|
}
|
33
39
|
)
|
@@ -35,33 +41,33 @@ const p = d.forwardRef(
|
|
35
41
|
}
|
36
42
|
);
|
37
43
|
p.displayName = "Input";
|
38
|
-
const
|
39
|
-
(t,
|
40
|
-
var n,
|
41
|
-
const [
|
42
|
-
o(!
|
44
|
+
const y = d.forwardRef(
|
45
|
+
(t, s) => {
|
46
|
+
var n, i, l;
|
47
|
+
const [e, o] = v(!1), c = e ? "text" : "password", u = () => {
|
48
|
+
o(!e);
|
43
49
|
};
|
44
|
-
return /* @__PURE__ */
|
45
|
-
/* @__PURE__ */ a(p, { ...t, type: c, className: "pr-8", ref:
|
46
|
-
/* @__PURE__ */ a(
|
50
|
+
return /* @__PURE__ */ N("div", { ...((n = t == null ? void 0 : t.slotProps) == null ? void 0 : n.wrapper) || {}, className: f("relative", (l = (i = t == null ? void 0 : t.slotProps) == null ? void 0 : i.wrapper) == null ? void 0 : l.className), children: [
|
51
|
+
/* @__PURE__ */ a(p, { ...t, type: c, className: "pr-8", ref: s }),
|
52
|
+
/* @__PURE__ */ a(x, { isVisible: e, onClick: u })
|
47
53
|
] });
|
48
54
|
}
|
49
55
|
);
|
50
|
-
|
51
|
-
const
|
56
|
+
y.displayName = "PasswordInput";
|
57
|
+
const x = ({ isVisible: t, onClick: s }) => /* @__PURE__ */ a(
|
52
58
|
"button",
|
53
59
|
{
|
54
60
|
type: "button",
|
55
|
-
onClick:
|
61
|
+
onClick: s,
|
56
62
|
className: "absolute top-1/2 right-3 transform -translate-y-1/2",
|
57
|
-
children: t ? /* @__PURE__ */ a(
|
63
|
+
children: t ? /* @__PURE__ */ a(w, { size: 16 }) : /* @__PURE__ */ a(h, { size: 16 })
|
58
64
|
}
|
59
|
-
),
|
60
|
-
({ type: t, ...
|
65
|
+
), V = d.forwardRef(
|
66
|
+
({ type: t, ...s }, e) => t === "password" ? /* @__PURE__ */ a(y, { type: t, ...s, ref: e }) : /* @__PURE__ */ a(p, { type: t, ...s, ref: e })
|
61
67
|
);
|
62
|
-
|
68
|
+
V.displayName = "Input";
|
63
69
|
export {
|
64
70
|
p as BaseInput,
|
65
|
-
|
66
|
-
|
71
|
+
V as Input,
|
72
|
+
y as PasswordInput
|
67
73
|
};
|
package/Input/Input.types.d.ts
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
+
import { BaseInput } from './Input';
|
1
2
|
import { inputVariants } from './inputVariants';
|
2
3
|
import { VariantProps } from 'class-variance-authority';
|
3
|
-
import { default as React, ChangeEvent, HTMLAttributes, ReactNode } from 'react';
|
4
|
+
import { default as React, ChangeEvent, ComponentPropsWithoutRef, HTMLAttributes, ReactNode } from 'react';
|
4
5
|
|
5
|
-
export interface InputSlotInputProps {
|
6
|
+
export interface InputSlotInputProps extends ComponentPropsWithoutRef<typeof BaseInput> {
|
6
7
|
startAdornment?: ReactNode;
|
7
8
|
}
|
8
9
|
export interface InputSlotProps {
|
package/Sheet/Sheet.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
2
|
-
import * as React from
|
3
|
-
import * as SheetPrimitive from
|
2
|
+
import * as React from 'react';
|
3
|
+
import * as SheetPrimitive from '@radix-ui/react-dialog';
|
4
4
|
declare const Sheet: React.FC<SheetPrimitive.DialogProps>;
|
5
5
|
declare const SheetTrigger: React.ForwardRefExoticComponent<SheetPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
6
6
|
declare const SheetClose: React.ForwardRefExoticComponent<SheetPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
@@ -10,6 +10,9 @@ declare const sheetVariants: (props?: ({
|
|
10
10
|
side?: "top" | "right" | "bottom" | "left" | null | undefined;
|
11
11
|
} & import('class-variance-authority/dist/types').ClassProp) | undefined) => string;
|
12
12
|
interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {
|
13
|
+
slotProps?: {
|
14
|
+
overlay?: React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>;
|
15
|
+
};
|
13
16
|
}
|
14
17
|
declare const SheetContent: React.ForwardRefExoticComponent<SheetContentProps & React.RefAttributes<HTMLDivElement>>;
|
15
18
|
declare const SheetHeader: {
|
package/Sheet/Sheet.mjs
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
import { jsx as o, jsxs as
|
1
|
+
import { jsx as o, jsxs as d } from "react/jsx-runtime";
|
2
2
|
import * as r from "react";
|
3
3
|
import * as e from "@radix-ui/react-dialog";
|
4
|
-
import { cva as
|
5
|
-
import { X as
|
4
|
+
import { cva as f } from "class-variance-authority";
|
5
|
+
import { X as p } from "lucide-react";
|
6
6
|
import { cn as i } from "@oneplatformdev/utils";
|
7
|
-
const
|
7
|
+
const R = e.Root, T = e.Trigger, j = e.Close, h = e.Portal, l = r.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ o(
|
8
8
|
e.Overlay,
|
9
9
|
{
|
10
10
|
className: i(
|
@@ -15,8 +15,8 @@ const C = e.Root, R = e.Trigger, T = e.Close, p = e.Portal, d = r.forwardRef(({
|
|
15
15
|
ref: s
|
16
16
|
}
|
17
17
|
));
|
18
|
-
|
19
|
-
const
|
18
|
+
l.displayName = e.Overlay.displayName;
|
19
|
+
const g = f(
|
20
20
|
"fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",
|
21
21
|
{
|
22
22
|
variants: {
|
@@ -31,17 +31,17 @@ const h = c(
|
|
31
31
|
side: "right"
|
32
32
|
}
|
33
33
|
}
|
34
|
-
),
|
35
|
-
/* @__PURE__ */ o(
|
36
|
-
/* @__PURE__ */
|
34
|
+
), u = r.forwardRef(({ side: t = "right", className: a, children: s, slotProps: n, ...m }, c) => /* @__PURE__ */ d(h, { children: [
|
35
|
+
/* @__PURE__ */ o(l, { ...(n == null ? void 0 : n.overlay) || {} }),
|
36
|
+
/* @__PURE__ */ d(
|
37
37
|
e.Content,
|
38
38
|
{
|
39
|
-
ref:
|
40
|
-
className: i(
|
41
|
-
...
|
39
|
+
ref: c,
|
40
|
+
className: i(g({ side: t }), a),
|
41
|
+
...m,
|
42
42
|
children: [
|
43
|
-
/* @__PURE__ */
|
44
|
-
/* @__PURE__ */ o(
|
43
|
+
/* @__PURE__ */ d(e.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
|
44
|
+
/* @__PURE__ */ o(p, { className: "h-4 w-4" }),
|
45
45
|
/* @__PURE__ */ o("span", { className: "sr-only", children: "Close" })
|
46
46
|
] }),
|
47
47
|
s
|
@@ -49,8 +49,8 @@ const h = c(
|
|
49
49
|
}
|
50
50
|
)
|
51
51
|
] }));
|
52
|
-
|
53
|
-
const
|
52
|
+
u.displayName = e.Content.displayName;
|
53
|
+
const y = ({
|
54
54
|
className: t,
|
55
55
|
...a
|
56
56
|
}) => /* @__PURE__ */ o(
|
@@ -63,8 +63,8 @@ const u = ({
|
|
63
63
|
...a
|
64
64
|
}
|
65
65
|
);
|
66
|
-
|
67
|
-
const
|
66
|
+
y.displayName = "SheetHeader";
|
67
|
+
const x = ({
|
68
68
|
className: t,
|
69
69
|
...a
|
70
70
|
}) => /* @__PURE__ */ o(
|
@@ -77,8 +77,8 @@ const y = ({
|
|
77
77
|
...a
|
78
78
|
}
|
79
79
|
);
|
80
|
-
|
81
|
-
const
|
80
|
+
x.displayName = "SheetFooter";
|
81
|
+
const N = r.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ o(
|
82
82
|
e.Title,
|
83
83
|
{
|
84
84
|
ref: s,
|
@@ -86,8 +86,8 @@ const x = r.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ o(
|
|
86
86
|
...a
|
87
87
|
}
|
88
88
|
));
|
89
|
-
|
90
|
-
const
|
89
|
+
N.displayName = e.Title.displayName;
|
90
|
+
const b = r.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ o(
|
91
91
|
e.Description,
|
92
92
|
{
|
93
93
|
ref: s,
|
@@ -95,16 +95,16 @@ const N = r.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ o(
|
|
95
95
|
...a
|
96
96
|
}
|
97
97
|
));
|
98
|
-
|
98
|
+
b.displayName = e.Description.displayName;
|
99
99
|
export {
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
100
|
+
R as Sheet,
|
101
|
+
j as SheetClose,
|
102
|
+
u as SheetContent,
|
103
|
+
b as SheetDescription,
|
104
|
+
x as SheetFooter,
|
105
|
+
y as SheetHeader,
|
106
|
+
l as SheetOverlay,
|
107
|
+
h as SheetPortal,
|
108
|
+
N as SheetTitle,
|
109
|
+
T as SheetTrigger
|
110
110
|
};
|