@oneplatformdev/ui 0.0.1-beta.7 → 0.0.1-beta.71
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/Accordion/Accordion.d.ts +2 -2
- package/Accordion/Accordion.mjs +23 -20
- package/AlertDialog/AlertDialogRoot.d.ts +2 -2
- package/AlertDialog/AlertDialogRoot.mjs +7 -7
- package/Button/buttonVariants.mjs +4 -4
- package/Calendar/Calendar.mjs +3 -2
- package/Checkbox/Checkbox.d.ts +5 -4
- package/Checkbox/Checkbox.mjs +48 -21
- package/Checkbox/Checkbox.types.d.ts +10 -0
- package/Checkbox/index.d.ts +2 -1
- package/Checkbox/index.mjs +3 -2
- package/Combobox/Combobox.d.ts +2 -2
- package/Combobox/Combobox.mjs +127 -87
- package/Combobox/Combobox.types.d.ts +13 -1
- package/Command/Command.d.ts +1 -1
- package/DataTable/DataTable.d.ts +10 -3
- package/DataTable/DataTable.mjs +33 -33
- package/DataTable/DataTableColumnFilter.d.ts +4 -0
- package/DataTable/DataTableColumnFilter.mjs +31 -0
- package/DatePicker/DatePicker.mjs +2 -2
- package/Dialog/Dialog.d.ts +2 -2
- package/Dialog/Dialog.mjs +14 -12
- package/Dropzone/Dropzone.d.ts +22 -0
- package/Dropzone/Dropzone.mjs +151 -0
- package/Dropzone/Dropzone.types.d.ts +38 -0
- package/Dropzone/DropzoneFilePreview.d.ts +4 -0
- package/Dropzone/DropzoneFilePreview.mjs +9 -0
- package/Dropzone/DropzoneSinglePickPreview.d.ts +9 -0
- package/Dropzone/DropzoneSinglePickPreview.mjs +38 -0
- package/Dropzone/DropzoneUtils.d.ts +5 -0
- package/Dropzone/DropzoneUtils.mjs +24 -0
- package/Dropzone/index.d.ts +2 -0
- package/Dropzone/index.mjs +7 -0
- package/Dropzone/package.json +7 -0
- package/DropzoneFilePreview-Dhtv8F4u.js +67 -0
- package/Form/Form.d.ts +2 -2
- package/Form/Form.mjs +48 -45
- package/Form/FormRenderControl.d.ts +2 -3
- package/Form/FormRenderControl.mjs +10 -10
- package/Form/FormRenderControl.types.d.ts +5 -7
- package/FormCheckbox/FormCheckbox.d.ts +2 -3
- package/FormCheckbox/FormCheckbox.mjs +23 -23
- package/FormCheckbox/FormCheckbox.types.d.ts +3 -3
- package/FormCombobox/FormCombobox.d.ts +2 -2
- package/FormCombobox/FormCombobox.types.d.ts +2 -3
- package/FormDatePicker/FormDatePicker.d.ts +2 -2
- package/FormDatePicker/FormDatePicker.mjs +20 -18
- package/FormDatePicker/FormDatePicker.types.d.ts +2 -3
- package/FormDropzone/FormDropzone.d.ts +4 -0
- package/FormDropzone/FormDropzone.mjs +19 -0
- package/FormDropzone/FormDropzone.types.d.ts +6 -0
- package/FormDropzone/index.d.ts +2 -0
- package/FormDropzone/index.mjs +4 -0
- package/FormDropzone/package.json +7 -0
- package/FormInput/FormInput.d.ts +2 -3
- package/FormInput/FormInput.mjs +25 -17
- package/FormInput/FormInput.types.d.ts +2 -3
- package/FormRadio/FormRadio.d.ts +4 -0
- package/FormRadio/FormRadio.mjs +40 -0
- package/FormRadio/FormRadio.types.d.ts +6 -0
- package/FormRadio/index.d.ts +2 -0
- package/FormRadio/index.mjs +4 -0
- package/FormRadio/package.json +7 -0
- package/FormSelect/FormSelect.d.ts +2 -3
- package/FormSelect/FormSelect.mjs +19 -17
- package/FormSelect/FormSelect.types.d.ts +2 -3
- package/FormTextarea/FormTextarea.d.ts +2 -3
- package/FormTextarea/FormTextarea.mjs +13 -12
- package/FormTextarea/FormTextarea.types.d.ts +2 -3
- package/Input/Input.mjs +40 -34
- package/Input/Input.types.d.ts +4 -1
- package/Input/inputVariants.mjs +9 -3
- package/Label/Label.d.ts +2 -2
- package/Label/labelVariants.mjs +7 -4
- package/LazyLoader/LazyLoader.mjs +5 -4
- package/LoadingMask/LoadingMask.d.ts +4 -1
- package/LoadingMask/LoadingMask.mjs +18 -56
- package/LoadingMask/LoadingMask.types.d.ts +5 -0
- package/LoadingMask/RenderLoadingMask.d.ts +3 -0
- package/LoadingMask/RenderLoadingMask.mjs +108 -0
- package/LoadingMask/index.d.ts +2 -0
- package/LoadingMask/index.mjs +4 -2
- package/Radio/Radio.d.ts +4 -0
- package/Radio/Radio.mjs +12 -0
- package/Radio/Radio.types.d.ts +11 -0
- package/Radio/index.d.ts +2 -0
- package/Radio/index.mjs +4 -0
- package/Radio/package.json +7 -0
- package/RadioGroup/RadioGroup.d.ts +9 -3
- package/RadioGroup/RadioGroup.mjs +37 -19
- package/RadioGroup/index.mjs +4 -3
- package/ScrollArea/ScrollArea.d.ts +2 -2
- package/ScrollArea/ScrollArea.mjs +26 -13
- package/Select/Select.mjs +93 -63
- package/Select/Select.types.d.ts +9 -2
- package/Select/SelectRoot.d.ts +2 -2
- package/Select/SelectRoot.mjs +1 -0
- package/TablePagination/TablePagination.d.ts +16 -0
- package/TablePagination/TablePagination.mjs +74 -0
- package/TablePagination/index.d.ts +1 -0
- package/TablePagination/index.mjs +4 -0
- package/TablePagination/package.json +7 -0
- package/Tabs/Tabs.d.ts +3 -2
- package/Tabs/Tabs.mjs +20 -6
- package/Tabs/Tabs.types.d.ts +5 -2
- package/Tabs/index.mjs +8 -7
- package/Textarea/Textarea.d.ts +1 -1
- package/Textarea/Textarea.mjs +71 -15
- package/Textarea/Textarea.types.d.ts +16 -2
- package/Textarea/useAutosizeTextArea.d.ts +3 -0
- package/Textarea/useAutosizeTextArea.mjs +20 -0
- package/Toast/toastVariants.mjs +3 -3
- package/index.css +1 -1
- package/index.d.ts +3 -0
- package/index.mjs +332 -318
- package/package.json +9 -8
- package/tailwind.config.mjs +13 -13
@@ -1,38 +1,40 @@
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
2
|
-
import { FormControl as
|
3
|
-
import { FormRenderControl as
|
2
|
+
import { FormControl as f } from "../Form/Form.mjs";
|
3
|
+
import { FormRenderControl as d } from "../Form/FormRenderControl.mjs";
|
4
4
|
import "../Select/SelectRoot.mjs";
|
5
|
-
import { Select as
|
6
|
-
const
|
5
|
+
import { Select as g } from "../Select/Select.mjs";
|
6
|
+
const S = (n) => {
|
7
7
|
const {
|
8
|
-
form:
|
8
|
+
form: m,
|
9
9
|
label: i,
|
10
|
-
name:
|
11
|
-
options:
|
10
|
+
name: p,
|
11
|
+
options: l = [],
|
12
12
|
onChange: r,
|
13
|
-
|
14
|
-
|
13
|
+
containerProps: c,
|
14
|
+
...s
|
15
|
+
} = n;
|
15
16
|
return /* @__PURE__ */ e(
|
16
|
-
|
17
|
+
d,
|
17
18
|
{
|
18
|
-
form:
|
19
|
-
name:
|
19
|
+
form: m,
|
20
|
+
name: p,
|
20
21
|
label: i,
|
22
|
+
containerProps: c,
|
21
23
|
render: ({ field: t }) => /* @__PURE__ */ e(
|
22
|
-
|
24
|
+
g,
|
23
25
|
{
|
24
26
|
value: t.value,
|
25
|
-
options:
|
27
|
+
options: l,
|
26
28
|
onChange: (o) => {
|
27
29
|
t.onChange(o), r == null || r(o);
|
28
30
|
},
|
29
|
-
renderTrigger: (o,
|
30
|
-
...
|
31
|
+
renderTrigger: (o, a) => /* @__PURE__ */ e(f, { children: a }),
|
32
|
+
...s
|
31
33
|
}
|
32
34
|
)
|
33
35
|
}
|
34
36
|
);
|
35
37
|
};
|
36
38
|
export {
|
37
|
-
|
39
|
+
S as FormSelect
|
38
40
|
};
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import { SelectProps } from '../Select';
|
2
2
|
import { FormRenderControlExtendProps } from '../Form';
|
3
|
-
import {
|
4
|
-
import { FieldValues } from 'react-hook-form/dist/types/fields';
|
3
|
+
import { FieldValues } from 'react-hook-form';
|
5
4
|
|
6
|
-
export interface FormSelectProps<Data extends FieldValues,
|
5
|
+
export interface FormSelectProps<Data extends FieldValues, ExtendOptionData> extends FormRenderControlExtendProps<Data>, Omit<SelectProps<ExtendOptionData>, 'onChange'>, Partial<Pick<SelectProps<ExtendOptionData>, 'onChange'>> {
|
7
6
|
}
|
@@ -1,5 +1,4 @@
|
|
1
|
-
import {
|
2
|
-
import { FieldValues } from 'react-hook-form/dist/types/fields';
|
1
|
+
import { FieldValues } from 'react-hook-form';
|
3
2
|
import { FormTextareaProps } from './FormTextarea.types';
|
4
3
|
|
5
|
-
export declare const FormTextarea: <Data extends FieldValues
|
4
|
+
export declare const FormTextarea: <Data extends FieldValues>(props: FormTextareaProps<Data>) => import("react/jsx-runtime").JSX.Element;
|
@@ -1,26 +1,27 @@
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
2
|
-
import { FormControl as
|
3
|
-
import { FormRenderControl as
|
4
|
-
import { Textarea as
|
5
|
-
const
|
6
|
-
const { form:
|
2
|
+
import { FormControl as p } from "../Form/Form.mjs";
|
3
|
+
import { FormRenderControl as i } from "../Form/FormRenderControl.mjs";
|
4
|
+
import { Textarea as s } from "../Textarea/Textarea.mjs";
|
5
|
+
const F = (e) => {
|
6
|
+
const { form: t, label: m, name: n, containerProps: a, ...l } = e;
|
7
7
|
return /* @__PURE__ */ r(
|
8
|
-
|
8
|
+
i,
|
9
9
|
{
|
10
|
-
form:
|
10
|
+
form: t,
|
11
11
|
name: n,
|
12
|
-
label:
|
13
|
-
|
14
|
-
|
12
|
+
label: m,
|
13
|
+
containerProps: a,
|
14
|
+
render: ({ field: o }) => /* @__PURE__ */ r(p, { children: /* @__PURE__ */ r(
|
15
|
+
s,
|
15
16
|
{
|
16
17
|
...o,
|
17
18
|
value: o.value || "",
|
18
|
-
...
|
19
|
+
...l
|
19
20
|
}
|
20
21
|
) })
|
21
22
|
}
|
22
23
|
);
|
23
24
|
};
|
24
25
|
export {
|
25
|
-
|
26
|
+
F as FormTextarea
|
26
27
|
};
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import { TextareaProps } from '../Textarea';
|
2
2
|
import { FormRenderControlExtendProps } from '../Form';
|
3
|
-
import {
|
4
|
-
import { FieldValues } from 'react-hook-form/dist/types/fields';
|
3
|
+
import { FieldValues } from 'react-hook-form';
|
5
4
|
|
6
|
-
export interface FormTextareaProps<Data extends FieldValues
|
5
|
+
export interface FormTextareaProps<Data extends FieldValues> extends FormRenderControlExtendProps<Data>, Omit<TextareaProps, 'form' | 'name'> {
|
7
6
|
}
|
package/Input/Input.mjs
CHANGED
@@ -1,61 +1,67 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import
|
3
|
-
import { Eye as
|
4
|
-
import { inputVariants as
|
5
|
-
import { cn as
|
6
|
-
const p =
|
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
7
|
(t, e) => {
|
8
8
|
const {
|
9
|
-
className:
|
10
|
-
variant:
|
11
|
-
type:
|
12
|
-
slotProps: { input: n } = {},
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
9
|
+
className: s,
|
10
|
+
variant: o,
|
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(
|
18
20
|
"input",
|
19
21
|
{
|
20
|
-
type:
|
21
|
-
className:
|
22
|
-
|
23
|
-
!!
|
22
|
+
type: c,
|
23
|
+
className: f(
|
24
|
+
h({ variant: o, className: s }),
|
25
|
+
!!m && "pl-8"
|
24
26
|
),
|
25
27
|
ref: e,
|
26
|
-
...
|
28
|
+
...g,
|
29
|
+
onChange: (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
|
+
}
|
27
32
|
}
|
28
33
|
)
|
29
34
|
] });
|
30
35
|
}
|
31
36
|
);
|
32
37
|
p.displayName = "Input";
|
33
|
-
const
|
38
|
+
const N = d.forwardRef(
|
34
39
|
(t, e) => {
|
35
|
-
|
36
|
-
|
40
|
+
var n, l, i;
|
41
|
+
const [s, o] = b(!1), c = s ? "text" : "password", u = () => {
|
42
|
+
o(!s);
|
37
43
|
};
|
38
|
-
return /* @__PURE__ */
|
39
|
-
/* @__PURE__ */
|
40
|
-
/* @__PURE__ */
|
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 })
|
41
47
|
] });
|
42
48
|
}
|
43
49
|
);
|
44
|
-
|
45
|
-
const
|
50
|
+
N.displayName = "PasswordInput";
|
51
|
+
const I = ({ isVisible: t, onClick: e }) => /* @__PURE__ */ a(
|
46
52
|
"button",
|
47
53
|
{
|
48
54
|
type: "button",
|
49
55
|
onClick: e,
|
50
56
|
className: "absolute top-1/2 right-3 transform -translate-y-1/2",
|
51
|
-
children: t ? /* @__PURE__ */
|
57
|
+
children: t ? /* @__PURE__ */ a(v, { size: 16 }) : /* @__PURE__ */ a(w, { size: 16 })
|
52
58
|
}
|
53
|
-
),
|
54
|
-
({ type: t, ...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 })
|
55
61
|
);
|
56
|
-
|
62
|
+
x.displayName = "Input";
|
57
63
|
export {
|
58
64
|
p as BaseInput,
|
59
|
-
|
60
|
-
|
65
|
+
x as Input,
|
66
|
+
N as PasswordInput
|
61
67
|
};
|
package/Input/Input.types.d.ts
CHANGED
@@ -1,13 +1,16 @@
|
|
1
1
|
import { inputVariants } from './inputVariants';
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
3
|
-
import { default as React, 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;
|
14
|
+
/** func transform event.target.value before onChange event call*/
|
15
|
+
onTransform?: (value: string, event: ChangeEvent<HTMLInputElement>) => string;
|
13
16
|
}
|
package/Input/inputVariants.mjs
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
import { cva as e } from "class-variance-authority";
|
2
|
-
const
|
3
|
-
|
2
|
+
const t = e(
|
3
|
+
[
|
4
|
+
"flex h-10 w-full rounded-md border border-input px-3 py-2",
|
5
|
+
"text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground",
|
6
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
7
|
+
"group-data-[state=invalid]/form-control:border-destructive",
|
8
|
+
"group-data-[state=valid]/form-control:border-input"
|
9
|
+
],
|
4
10
|
{
|
5
11
|
variants: {
|
6
12
|
variant: {
|
@@ -14,5 +20,5 @@ const r = e(
|
|
14
20
|
}
|
15
21
|
);
|
16
22
|
export {
|
17
|
-
|
23
|
+
t as inputVariants
|
18
24
|
};
|
package/Label/Label.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
2
|
-
import * as React from
|
3
|
-
import * as LabelPrimitive from
|
2
|
+
import * as React from 'react';
|
3
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
4
4
|
declare const Label: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: import('class-variance-authority/dist/types').ClassProp | undefined) => string> & React.RefAttributes<HTMLLabelElement>>;
|
5
5
|
export { Label };
|
package/Label/labelVariants.mjs
CHANGED
@@ -1,7 +1,10 @@
|
|
1
|
-
import { cva as
|
2
|
-
const a =
|
3
|
-
"
|
4
|
-
|
1
|
+
import { cva as t } from "class-variance-authority";
|
2
|
+
const a = t([
|
3
|
+
"peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
4
|
+
"text-md font-medium leading-[150%]",
|
5
|
+
"group-data-[state=valid]/form-control:text-[#363B4E]",
|
6
|
+
"group-data-[state=invalid]/form-control:text-destructive"
|
7
|
+
]);
|
5
8
|
export {
|
6
9
|
a as labelVariants
|
7
10
|
};
|
@@ -1,7 +1,8 @@
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
2
|
-
import { Suspense as
|
3
|
-
import { LoadingMask as
|
4
|
-
|
2
|
+
import { Suspense as a } from "react";
|
3
|
+
import { LoadingMask as e } from "../LoadingMask/LoadingMask.mjs";
|
4
|
+
import "../LoadingMask/RenderLoadingMask.mjs";
|
5
|
+
const s = (r, m = !0) => (t) => /* @__PURE__ */ o(a, { fallback: m ? /* @__PURE__ */ o(e, {}) : null, children: /* @__PURE__ */ o(r, { ...t }) });
|
5
6
|
export {
|
6
|
-
|
7
|
+
s as LazyLoader
|
7
8
|
};
|
@@ -1,59 +1,21 @@
|
|
1
|
-
import { jsx as
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
"
|
13
|
-
|
14
|
-
d: "M17.1475 6.8525L16.0625 7.9375",
|
15
|
-
stroke: "currentColor",
|
16
|
-
strokeWidth: "2",
|
17
|
-
strokeLinecap: "round",
|
18
|
-
strokeLinejoin: "round"
|
19
|
-
}
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
2
|
+
import { RenderLoadingMask as r } from "./RenderLoadingMask.mjs";
|
3
|
+
import { cn as o } from "@oneplatformdev/utils";
|
4
|
+
const f = (t) => {
|
5
|
+
const { fullWidth: s = !1, className: i, ...n } = t;
|
6
|
+
return s ? /* @__PURE__ */ e(
|
7
|
+
"div",
|
8
|
+
{
|
9
|
+
...n,
|
10
|
+
className: o(
|
11
|
+
"absolute inset-0",
|
12
|
+
"flex items-center justify-center",
|
13
|
+
i
|
20
14
|
),
|
21
|
-
/* @__PURE__ */ r
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
d: "M17.1475 17.1475L16.0625 16.0625",
|
26
|
-
stroke: "currentColor",
|
27
|
-
strokeWidth: "2",
|
28
|
-
strokeLinecap: "round",
|
29
|
-
strokeLinejoin: "round"
|
30
|
-
}
|
31
|
-
),
|
32
|
-
/* @__PURE__ */ r("path", { d: "M12 17.75V19.25", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
33
|
-
/* @__PURE__ */ r(
|
34
|
-
"path",
|
35
|
-
{
|
36
|
-
d: "M6.8525 17.1475L7.9375 16.0625",
|
37
|
-
stroke: "currentColor",
|
38
|
-
strokeWidth: "2",
|
39
|
-
strokeLinecap: "round",
|
40
|
-
strokeLinejoin: "round"
|
41
|
-
}
|
42
|
-
),
|
43
|
-
/* @__PURE__ */ r("path", { d: "M4.75 12H6.25", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
44
|
-
/* @__PURE__ */ r(
|
45
|
-
"path",
|
46
|
-
{
|
47
|
-
d: "M6.8525 6.8525L7.9375 7.9375",
|
48
|
-
stroke: "currentColor",
|
49
|
-
strokeWidth: "2",
|
50
|
-
strokeLinecap: "round",
|
51
|
-
strokeLinejoin: "round"
|
52
|
-
}
|
53
|
-
)
|
54
|
-
]
|
55
|
-
}
|
56
|
-
) });
|
15
|
+
children: /* @__PURE__ */ e(r, {})
|
16
|
+
}
|
17
|
+
) : /* @__PURE__ */ e(r, {});
|
18
|
+
};
|
57
19
|
export {
|
58
|
-
|
20
|
+
f as LoadingMask
|
59
21
|
};
|
@@ -0,0 +1,108 @@
|
|
1
|
+
import { jsx as r, jsxs as s } from "react/jsx-runtime";
|
2
|
+
import { forwardRef as i } from "react";
|
3
|
+
import { cn as d } from "@oneplatformdev/utils";
|
4
|
+
const u = i((o, e) => {
|
5
|
+
const { className: t, ...n } = o;
|
6
|
+
return /* @__PURE__ */ r(
|
7
|
+
"div",
|
8
|
+
{
|
9
|
+
...n,
|
10
|
+
ref: e,
|
11
|
+
className: d("flex flex-1 items-center justify-center", t),
|
12
|
+
children: /* @__PURE__ */ s(
|
13
|
+
"svg",
|
14
|
+
{
|
15
|
+
className: "h-8 w-8 animate-spin text-gray-900 dark:text-gray-50",
|
16
|
+
viewBox: "0 0 24 24",
|
17
|
+
fill: "none",
|
18
|
+
xmlns: "http://www.w3.org/2000/svg",
|
19
|
+
children: [
|
20
|
+
/* @__PURE__ */ r(
|
21
|
+
"path",
|
22
|
+
{
|
23
|
+
d: "M12 4.75V6.25",
|
24
|
+
stroke: "currentColor",
|
25
|
+
strokeWidth: "2",
|
26
|
+
strokeLinecap: "round",
|
27
|
+
strokeLinejoin: "round"
|
28
|
+
}
|
29
|
+
),
|
30
|
+
/* @__PURE__ */ r(
|
31
|
+
"path",
|
32
|
+
{
|
33
|
+
d: "M17.1475 6.8525L16.0625 7.9375",
|
34
|
+
stroke: "currentColor",
|
35
|
+
strokeWidth: "2",
|
36
|
+
strokeLinecap: "round",
|
37
|
+
strokeLinejoin: "round"
|
38
|
+
}
|
39
|
+
),
|
40
|
+
/* @__PURE__ */ r(
|
41
|
+
"path",
|
42
|
+
{
|
43
|
+
d: "M19.25 12H17.75",
|
44
|
+
stroke: "currentColor",
|
45
|
+
strokeWidth: "2",
|
46
|
+
strokeLinecap: "round",
|
47
|
+
strokeLinejoin: "round"
|
48
|
+
}
|
49
|
+
),
|
50
|
+
/* @__PURE__ */ r(
|
51
|
+
"path",
|
52
|
+
{
|
53
|
+
d: "M17.1475 17.1475L16.0625 16.0625",
|
54
|
+
stroke: "currentColor",
|
55
|
+
strokeWidth: "2",
|
56
|
+
strokeLinecap: "round",
|
57
|
+
strokeLinejoin: "round"
|
58
|
+
}
|
59
|
+
),
|
60
|
+
/* @__PURE__ */ r(
|
61
|
+
"path",
|
62
|
+
{
|
63
|
+
d: "M12 17.75V19.25",
|
64
|
+
stroke: "currentColor",
|
65
|
+
strokeWidth: "2",
|
66
|
+
strokeLinecap: "round",
|
67
|
+
strokeLinejoin: "round"
|
68
|
+
}
|
69
|
+
),
|
70
|
+
/* @__PURE__ */ r(
|
71
|
+
"path",
|
72
|
+
{
|
73
|
+
d: "M6.8525 17.1475L7.9375 16.0625",
|
74
|
+
stroke: "currentColor",
|
75
|
+
strokeWidth: "2",
|
76
|
+
strokeLinecap: "round",
|
77
|
+
strokeLinejoin: "round"
|
78
|
+
}
|
79
|
+
),
|
80
|
+
/* @__PURE__ */ r(
|
81
|
+
"path",
|
82
|
+
{
|
83
|
+
d: "M4.75 12H6.25",
|
84
|
+
stroke: "currentColor",
|
85
|
+
strokeWidth: "2",
|
86
|
+
strokeLinecap: "round",
|
87
|
+
strokeLinejoin: "round"
|
88
|
+
}
|
89
|
+
),
|
90
|
+
/* @__PURE__ */ r(
|
91
|
+
"path",
|
92
|
+
{
|
93
|
+
d: "M6.8525 6.8525L7.9375 7.9375",
|
94
|
+
stroke: "currentColor",
|
95
|
+
strokeWidth: "2",
|
96
|
+
strokeLinecap: "round",
|
97
|
+
strokeLinejoin: "round"
|
98
|
+
}
|
99
|
+
)
|
100
|
+
]
|
101
|
+
}
|
102
|
+
)
|
103
|
+
}
|
104
|
+
);
|
105
|
+
});
|
106
|
+
export {
|
107
|
+
u as RenderLoadingMask
|
108
|
+
};
|
package/LoadingMask/index.d.ts
CHANGED
package/LoadingMask/index.mjs
CHANGED
package/Radio/Radio.d.ts
ADDED
package/Radio/Radio.mjs
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
2
|
+
import { RadioGroup as c, RadioGroupLabel as u } from "../RadioGroup/RadioGroup.mjs";
|
3
|
+
const l = (e) => {
|
4
|
+
const { options: f = [], renderOption: r, ...s } = e;
|
5
|
+
return /* @__PURE__ */ a(c, { ...s, children: f.map((t) => {
|
6
|
+
const o = /* @__PURE__ */ a(u, { ...t }, t.value);
|
7
|
+
return !r || typeof r != "function" || !(r != null && r(t, u)) ? o : r == null ? void 0 : r(t, u);
|
8
|
+
}) });
|
9
|
+
};
|
10
|
+
export {
|
11
|
+
l as Radio
|
12
|
+
};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { RadioGroup, RadioGroupLabel } from '../RadioGroup/RadioGroup';
|
2
|
+
import { ComponentPropsWithoutRef, FC, ReactNode } from 'react';
|
3
|
+
|
4
|
+
export interface RadioOptionProps<Value extends string | number = string> {
|
5
|
+
value: Value;
|
6
|
+
label: ReactNode;
|
7
|
+
}
|
8
|
+
export interface RadioProps extends Partial<ComponentPropsWithoutRef<typeof RadioGroup>> {
|
9
|
+
options?: RadioOptionProps[];
|
10
|
+
renderOption?: (option: RadioOptionProps, DefaultOptionComponent: FC<ComponentPropsWithoutRef<typeof RadioGroupLabel>>) => ReactNode | null;
|
11
|
+
}
|
package/Radio/index.d.ts
ADDED
package/Radio/index.mjs
ADDED
@@ -1,5 +1,11 @@
|
|
1
|
-
import * as
|
2
|
-
import * as
|
1
|
+
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
2
|
+
import * as React from 'react';
|
3
3
|
declare const RadioGroup: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
4
4
|
declare const RadioGroupItem: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
5
|
-
|
5
|
+
declare const RadioGroupLabel: React.ForwardRefExoticComponent<{
|
6
|
+
label: React.ReactNode;
|
7
|
+
value: string;
|
8
|
+
} & {
|
9
|
+
children?: React.ReactNode | undefined;
|
10
|
+
} & React.RefAttributes<HTMLLabelElement>>;
|
11
|
+
export { RadioGroup, RadioGroupItem, RadioGroupLabel };
|