@oneplatformdev/ui 0.0.1-beta.17 → 0.0.1-beta.2
Sign up to get free protection for your applications and to get access to all the features.
- package/AlertDialog/AlertDialog.d.ts +0 -14
- package/AlertDialog/AlertDialog.mjs +60 -58
- package/FormSelect/FormSelect.types.d.ts +1 -1
- package/Input/Input.d.ts +3 -5
- package/Input/Input.mjs +18 -58
- package/Input/Input.types.d.ts +2 -11
- package/Input/index.d.ts +0 -1
- package/Input/index.mjs +2 -5
- package/LazyLoader/LazyLoader.d.ts +0 -17
- package/LazyLoader/index.d.ts +1 -1
- package/LazyLoader/index.mjs +2 -3
- package/Search/index.d.ts +0 -1
- package/Search/index.mjs +2 -3
- package/Sidebar/Sidebar.d.ts +1 -1
- package/index.css +1 -1
- package/index.d.ts +0 -2
- package/index.mjs +293 -302
- package/package.json +6 -7
- package/Dropzone/Dropzone.d.ts +0 -22
- package/Dropzone/Dropzone.mjs +0 -136
- package/Dropzone/Dropzone.types.d.ts +0 -36
- package/Dropzone/DropzoneFilePreview.d.ts +0 -4
- package/Dropzone/DropzoneFilePreview.mjs +0 -9
- package/Dropzone/DropzoneUtils.d.ts +0 -4
- package/Dropzone/DropzoneUtils.mjs +0 -15
- package/Dropzone/index.d.ts +0 -2
- package/Dropzone/index.mjs +0 -7
- package/Dropzone/package.json +0 -7
- package/DropzoneFilePreview-Dhtv8F4u.js +0 -67
- package/FormDropzone/FormDropzone.d.ts +0 -4
- package/FormDropzone/FormDropzone.mjs +0 -26
- package/FormDropzone/FormDropzone.types.d.ts +0 -7
- package/FormDropzone/index.d.ts +0 -2
- package/FormDropzone/index.mjs +0 -4
- package/FormDropzone/package.json +0 -7
- package/Input/inputVariants.d.ts +0 -3
- package/Input/inputVariants.mjs +0 -18
@@ -6,10 +6,6 @@ import { FC, PropsWithChildren } from 'react';
|
|
6
6
|
* @public
|
7
7
|
* @see [Documentation](#)
|
8
8
|
* @example
|
9
|
-
* > Import:
|
10
|
-
* ```tsx
|
11
|
-
* import { AlertDialog } from '@oneplatformdev/ui/AlertDialog';
|
12
|
-
* ```
|
13
9
|
* > Simple example:
|
14
10
|
* ```tsx
|
15
11
|
* <AlertDialog
|
@@ -29,16 +25,6 @@ import { FC, PropsWithChildren } from 'react';
|
|
29
25
|
* onConfirm={(event) => console.log(event, 'Confirm')}
|
30
26
|
* />
|
31
27
|
* ```
|
32
|
-
* > Trigger example: Button with icon children
|
33
|
-
* ```tsx
|
34
|
-
* <AlertDialog
|
35
|
-
* trigger={<Button variant="outline" size="icon"><PencilLine /></Button>}
|
36
|
-
* title="Dialog title with icon trigger"
|
37
|
-
* description="Description text..."
|
38
|
-
* onCancel={(event) => console.log(event, 'Cancel')}
|
39
|
-
* onConfirm={(event) => console.log(event, 'Confirm')}
|
40
|
-
* />
|
41
|
-
* ```
|
42
28
|
*
|
43
29
|
* > Full content example:
|
44
30
|
* ```tsx
|
@@ -1,97 +1,99 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { cloneElement as a, useId as
|
3
|
-
import { AlertDialogRoot as
|
4
|
-
import {
|
5
|
-
|
6
|
-
|
7
|
-
|
1
|
+
import { jsxs as u, jsx as t } from "react/jsx-runtime";
|
2
|
+
import { cloneElement as a, useId as y, Children as E } from "react";
|
3
|
+
import { AlertDialogRoot as F, AlertDialogContent as h, AlertDialogTrigger as f, AlertDialogHeader as m, AlertDialogTitle as B, AlertDialogDescription as R, AlertDialogFooter as A, AlertDialogAction as C, AlertDialogCancel as k } from "./AlertDialogRoot.mjs";
|
4
|
+
import { Button as x } from "../Button/Button.mjs";
|
5
|
+
import "../Button/buttonVariants.mjs";
|
6
|
+
import { isValidReactElement as l } from "@oneplatformdev/utils";
|
7
|
+
const H = (n) => {
|
8
|
+
const { slotProps: e = {}, children: r } = n, o = e.trigger ?? {};
|
9
|
+
return l(r, f) ? a(
|
8
10
|
r,
|
9
11
|
{
|
10
12
|
...r.props || {},
|
11
|
-
...
|
13
|
+
...o
|
12
14
|
}
|
13
|
-
) : /* @__PURE__ */ t(
|
14
|
-
},
|
15
|
+
) : l(r, x) ? /* @__PURE__ */ t(f, { asChild: !0, ...o, children: r }) : /* @__PURE__ */ t(f, { asChild: !0, children: /* @__PURE__ */ t(x, { variant: "outline", ...o, children: r }) });
|
16
|
+
}, I = (n) => {
|
15
17
|
const {
|
16
18
|
title: e = "",
|
17
19
|
description: r = "",
|
18
|
-
slotProps:
|
19
|
-
children:
|
20
|
-
} =
|
21
|
-
return
|
22
|
-
|
23
|
-
{ ...
|
24
|
-
) : /* @__PURE__ */ t(
|
25
|
-
e &&
|
20
|
+
slotProps: o = {},
|
21
|
+
children: c
|
22
|
+
} = n, i = o.header ?? {}, d = o.title ?? {}, s = o.description ?? {};
|
23
|
+
return c ? l(c, m) ? a(
|
24
|
+
c,
|
25
|
+
{ ...c.props || {}, ...i }
|
26
|
+
) : /* @__PURE__ */ t(m, { ...i, children: c }) : /* @__PURE__ */ u(m, { children: [
|
27
|
+
e && l(e, B) ? a(
|
26
28
|
e,
|
27
29
|
{ ...e.props || {}, ...d }
|
28
30
|
) : /* @__PURE__ */ t(B, { ...d, children: e }),
|
29
|
-
r &&
|
31
|
+
r && l(r, R) ? a(
|
30
32
|
r,
|
31
|
-
{ ...r.props || {}, ...
|
32
|
-
) : /* @__PURE__ */ t(R, { ...
|
33
|
+
{ ...r.props || {}, ...s }
|
34
|
+
) : /* @__PURE__ */ t(R, { ...s, children: r })
|
33
35
|
] });
|
34
|
-
},
|
36
|
+
}, L = (n) => {
|
35
37
|
const {
|
36
38
|
slotProps: e = {},
|
37
39
|
children: r,
|
38
|
-
onCancel:
|
39
|
-
onConfirm:
|
40
|
-
cancelLabel:
|
40
|
+
onCancel: o,
|
41
|
+
onConfirm: c,
|
42
|
+
cancelLabel: i = "Cancel",
|
41
43
|
actionLabel: d = "Continue",
|
42
|
-
variant:
|
43
|
-
} =
|
44
|
-
return r ?
|
44
|
+
variant: s = "confirm"
|
45
|
+
} = n, T = y(), D = e.footer ?? {}, b = e.cancelButton ?? {}, P = e.actionButton ?? {};
|
46
|
+
return r ? l(r, A) ? a(
|
45
47
|
r,
|
46
|
-
{ ...r.props || {}, ...
|
47
|
-
) : /* @__PURE__ */ t(A, { ...
|
48
|
-
if (!p || !
|
49
|
-
const
|
50
|
-
return
|
51
|
-
}) }) : /* @__PURE__ */
|
52
|
-
|
48
|
+
{ ...r.props || {}, ...D }
|
49
|
+
) : /* @__PURE__ */ t(A, { ...D, children: E.map(r, (p, j) => {
|
50
|
+
if (!p || !l(p)) return;
|
51
|
+
const g = p, v = a(g, { ...g.props || {}, key: g.key || `footer-${T}-action-${j}` });
|
52
|
+
return l(p, C) || l(p, k) ? v : /* @__PURE__ */ t(C, { asChild: !0, children: v });
|
53
|
+
}) }) : /* @__PURE__ */ u(A, { children: [
|
54
|
+
s !== "alert" && /* @__PURE__ */ t(
|
53
55
|
k,
|
54
56
|
{
|
55
57
|
variant: "ghost",
|
56
|
-
onClick:
|
57
|
-
...
|
58
|
-
children:
|
58
|
+
onClick: o,
|
59
|
+
...b,
|
60
|
+
children: i
|
59
61
|
}
|
60
62
|
),
|
61
63
|
/* @__PURE__ */ t(
|
62
|
-
|
64
|
+
C,
|
63
65
|
{
|
64
|
-
onClick:
|
65
|
-
...
|
66
|
-
variant:
|
66
|
+
onClick: c,
|
67
|
+
...P,
|
68
|
+
variant: P.variant || s === "destructive" ? "destructive" : "default",
|
67
69
|
children: d
|
68
70
|
}
|
69
71
|
)
|
70
72
|
] });
|
71
|
-
},
|
73
|
+
}, J = (n) => {
|
72
74
|
const {
|
73
75
|
trigger: e,
|
74
76
|
header: r,
|
75
|
-
footer:
|
76
|
-
slotProps:
|
77
|
-
children:
|
77
|
+
footer: o,
|
78
|
+
slotProps: c = {},
|
79
|
+
children: i,
|
78
80
|
...d
|
79
|
-
} =
|
80
|
-
return /* @__PURE__ */
|
81
|
-
/* @__PURE__ */ t(
|
82
|
-
|
83
|
-
|
81
|
+
} = n, s = c.content ?? {};
|
82
|
+
return /* @__PURE__ */ u(F, { ...d, children: [
|
83
|
+
/* @__PURE__ */ t(H, { ...n, children: e }),
|
84
|
+
i ? l(i, h) ? a(
|
85
|
+
i,
|
84
86
|
{
|
85
|
-
...
|
86
|
-
...
|
87
|
+
...i.props || {},
|
88
|
+
...s
|
87
89
|
}
|
88
|
-
) : /* @__PURE__ */ t(
|
89
|
-
/* @__PURE__ */ t(
|
90
|
-
/* @__PURE__ */ t(
|
90
|
+
) : /* @__PURE__ */ t(h, { ...s, children: i }) : /* @__PURE__ */ u(h, { ...s, children: [
|
91
|
+
/* @__PURE__ */ t(I, { ...n, children: r }),
|
92
|
+
/* @__PURE__ */ t(L, { ...n, children: o })
|
91
93
|
] })
|
92
94
|
] });
|
93
95
|
};
|
94
96
|
export {
|
95
|
-
|
96
|
-
|
97
|
+
J as AlertDialog,
|
98
|
+
J as default
|
97
99
|
};
|
@@ -3,5 +3,5 @@ import { FormRenderControlExtendProps } from '../Form';
|
|
3
3
|
import { UseFormReturn } from 'react-hook-form';
|
4
4
|
import { FieldValues } from 'react-hook-form/dist/types/fields';
|
5
5
|
|
6
|
-
export interface FormSelectProps<Data extends FieldValues, Form extends UseFormReturn<Data>, ExtendOptionData> extends FormRenderControlExtendProps<Data, Form>,
|
6
|
+
export interface FormSelectProps<Data extends FieldValues, Form extends UseFormReturn<Data>, ExtendOptionData> extends FormRenderControlExtendProps<Data, Form>, SelectProps<ExtendOptionData> {
|
7
7
|
}
|
package/Input/Input.d.ts
CHANGED
@@ -1,6 +1,4 @@
|
|
1
1
|
import { InputProps } from './Input.types';
|
2
|
-
import
|
3
|
-
|
4
|
-
export
|
5
|
-
export declare const PasswordInput: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
6
|
-
export declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
2
|
+
import * as React from "react";
|
3
|
+
declare const Input: React.ForwardRefExoticComponent<Omit<InputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
4
|
+
export { Input };
|
package/Input/Input.mjs
CHANGED
@@ -1,61 +1,21 @@
|
|
1
|
-
import {
|
2
|
-
import
|
3
|
-
import {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
className:
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
/* @__PURE__ */ s(
|
18
|
-
"input",
|
19
|
-
{
|
20
|
-
type: o,
|
21
|
-
className: b(
|
22
|
-
N({ variant: r, className: a }),
|
23
|
-
!!i && "pl-8"
|
24
|
-
),
|
25
|
-
ref: e,
|
26
|
-
...u
|
27
|
-
}
|
28
|
-
)
|
29
|
-
] });
|
30
|
-
}
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
2
|
+
import * as n from "react";
|
3
|
+
import { cn as s } from "@oneplatformdev/utils";
|
4
|
+
const l = n.forwardRef(
|
5
|
+
({ className: e, type: r, ...o }, t) => /* @__PURE__ */ i(
|
6
|
+
"input",
|
7
|
+
{
|
8
|
+
type: r,
|
9
|
+
className: s(
|
10
|
+
"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
11
|
+
e
|
12
|
+
),
|
13
|
+
ref: t,
|
14
|
+
...o
|
15
|
+
}
|
16
|
+
)
|
31
17
|
);
|
32
|
-
|
33
|
-
const m = l.forwardRef(
|
34
|
-
(t, e) => {
|
35
|
-
const [a, r] = d(!1), o = a ? "text" : "password", n = () => {
|
36
|
-
r(!a);
|
37
|
-
};
|
38
|
-
return /* @__PURE__ */ c("div", { className: "relative", children: [
|
39
|
-
/* @__PURE__ */ s(p, { ...t, type: o, className: "pr-8", ref: e }),
|
40
|
-
/* @__PURE__ */ s(w, { isVisible: a, onClick: n })
|
41
|
-
] });
|
42
|
-
}
|
43
|
-
);
|
44
|
-
m.displayName = "PasswordInput";
|
45
|
-
const w = ({ isVisible: t, onClick: e }) => /* @__PURE__ */ s(
|
46
|
-
"button",
|
47
|
-
{
|
48
|
-
type: "button",
|
49
|
-
onClick: e,
|
50
|
-
className: "absolute top-1/2 right-3 transform -translate-y-1/2",
|
51
|
-
children: t ? /* @__PURE__ */ s(f, { size: 16 }) : /* @__PURE__ */ s(y, { size: 16 })
|
52
|
-
}
|
53
|
-
), I = l.forwardRef(
|
54
|
-
({ type: t, ...e }, a) => t === "password" ? /* @__PURE__ */ s(m, { type: t, ...e, ref: a }) : /* @__PURE__ */ s(p, { type: t, ...e, ref: a })
|
55
|
-
);
|
56
|
-
I.displayName = "Input";
|
18
|
+
l.displayName = "Input";
|
57
19
|
export {
|
58
|
-
|
59
|
-
I as Input,
|
60
|
-
m as PasswordInput
|
20
|
+
l as Input
|
61
21
|
};
|
package/Input/Input.types.d.ts
CHANGED
@@ -1,13 +1,4 @@
|
|
1
|
-
import {
|
2
|
-
import { VariantProps } from 'class-variance-authority';
|
3
|
-
import { default as React, ReactNode } from 'react';
|
1
|
+
import { ComponentProps } from 'react';
|
4
2
|
|
5
|
-
export interface
|
6
|
-
startAdornment?: ReactNode;
|
7
|
-
}
|
8
|
-
export interface InputSlotProps {
|
9
|
-
input?: InputSlotInputProps;
|
10
|
-
}
|
11
|
-
export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement>, VariantProps<typeof inputVariants> {
|
12
|
-
slotProps?: InputSlotProps;
|
3
|
+
export interface InputProps extends ComponentProps<'input'> {
|
13
4
|
}
|
package/Input/index.d.ts
CHANGED
package/Input/index.mjs
CHANGED
@@ -1,20 +1,3 @@
|
|
1
1
|
import { default as React, JSX } from 'react';
|
2
2
|
|
3
|
-
/**
|
4
|
-
* Component lazy load component.
|
5
|
-
* @public
|
6
|
-
* @see [Documentation](#)
|
7
|
-
* @example
|
8
|
-
* ```tsx
|
9
|
-
* import { lazy } from 'react';
|
10
|
-
* import { LazyLoader } from '@oneplatformdev/ui/LazyLoader';
|
11
|
-
*
|
12
|
-
* const ModuleComponentViewLazy = LazyLoader(
|
13
|
-
* lazy(() => import('path/to/module').then(module => ({
|
14
|
-
* default: module.ModuleComponentView,
|
15
|
-
* })),
|
16
|
-
* ),
|
17
|
-
* );
|
18
|
-
* ```
|
19
|
-
*/
|
20
3
|
export declare const LazyLoader: (Component: React.LazyExoticComponent<any>, showLoader?: boolean) => (props: any) => JSX.Element;
|
package/LazyLoader/index.d.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export { LazyLoader
|
1
|
+
export { LazyLoader } from './LazyLoader';
|
package/LazyLoader/index.mjs
CHANGED
package/Search/index.d.ts
CHANGED
package/Search/index.mjs
CHANGED
package/Sidebar/Sidebar.d.ts
CHANGED
@@ -25,7 +25,7 @@ declare const Sidebar: React.ForwardRefExoticComponent<Omit<React.ClassAttribute
|
|
25
25
|
declare const SidebarTrigger: React.ForwardRefExoticComponent<Omit<import('../Button').ButtonProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
26
26
|
declare const SidebarRail: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
27
27
|
declare const SidebarInset: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
28
|
-
declare const SidebarInput: React.ForwardRefExoticComponent<Omit<import('../Input').InputProps & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
28
|
+
declare const SidebarInput: React.ForwardRefExoticComponent<Omit<Omit<import('../Input').InputProps, "ref"> & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
29
29
|
declare const SidebarHeader: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
30
30
|
declare const SidebarFooter: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
31
31
|
declare const SidebarSeparator: React.ForwardRefExoticComponent<Omit<Omit<import('@radix-ui/react-separator').SeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|