reaxify 0.0.20 → 0.0.21
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const i=require("../../node_modules/react/jsx-runtime.cjs.js"),t=require("../../helpers/cn.cjs.js"),p=require("react"),y=require("../../hooks/useClasses.cjs.js");require("../Form/index.cjs.js");const j=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js");function q({color:o="primary",value:u=0,animate:n=!1,className:f
|
|
1
|
+
"use strict";const i=require("../../node_modules/react/jsx-runtime.cjs.js"),t=require("../../helpers/cn.cjs.js"),p=require("react"),y=require("../../hooks/useClasses.cjs.js");require("../Form/index.cjs.js");const j=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js");function q({color:o="primary",value:u=0,animate:n=!1,className:s,...f}){const r=y(e=>e.progress),h=p.useMemo(()=>{var d,g,a,x,l,c,b,m;if(!o)return"border-transparent";const e={primary:t("bg-primary/15 text-primary",(d=r==null?void 0:r.color)==null?void 0:d.primary),secondary:t("bg-secondary/15 text-secondary",(g=r==null?void 0:r.color)==null?void 0:g.secondary),success:t("bg-success/15 text-success",(a=r==null?void 0:r.color)==null?void 0:a.success),info:t("bg-info/15 text-info",(x=r==null?void 0:r.color)==null?void 0:x.info),warning:t("bg-warning/15 text-warning",(l=r==null?void 0:r.color)==null?void 0:l.warning),danger:t("bg-danger/15 text-danger",(c=r==null?void 0:r.color)==null?void 0:c.danger),dark:t("bg-dark/15 text-dark",(b=r==null?void 0:r.color)==null?void 0:b.dark),light:t("bg-light/15 text-light",(m=r==null?void 0:r.color)==null?void 0:m.light)};return(e==null?void 0:e[o])??null},[o,r==null?void 0:r.color]),w=p.useMemo(()=>{if(!n)return`${Math.max(u,0)}%`},[u,n]);return i.jsxRuntimeExports.jsxs("div",{className:j.twMerge("relative block w-full h-2.5 rounded-full overflow-hidden",r==null?void 0:r.base,h,s),...f,children:[i.jsxRuntimeExports.jsx("span",{style:{width:w},className:t("absolute h-full max-w-full bg-current rounded-[inherit] top-0 bottom-0 start-0",n?"animate-linear-progress-1":"transition-[width]")}),n&&i.jsxRuntimeExports.jsx("span",{className:"absolute h-full max-w-full bg-current rounded-[inherit] top-0 bottom-0 start-0 animate-linear-progress-2"})]})}module.exports=q;
|
|
@@ -1,68 +1,59 @@
|
|
|
1
|
-
import { j as
|
|
1
|
+
import { j as i } from "../../node_modules/react/jsx-runtime.es.js";
|
|
2
2
|
import t from "../../helpers/cn.es.js";
|
|
3
|
-
import { useMemo as
|
|
3
|
+
import { useMemo as x } from "react";
|
|
4
4
|
import j from "../../hooks/useClasses.es.js";
|
|
5
5
|
import "../Form/index.es.js";
|
|
6
6
|
import { twMerge as k } from "../../node_modules/tailwind-merge/dist/bundle-mjs.es.js";
|
|
7
7
|
function P({
|
|
8
|
-
color:
|
|
9
|
-
value:
|
|
8
|
+
color: e = "primary",
|
|
9
|
+
value: a = 0,
|
|
10
10
|
animate: n = !1,
|
|
11
|
-
className:
|
|
12
|
-
...
|
|
11
|
+
className: h,
|
|
12
|
+
...c
|
|
13
13
|
}) {
|
|
14
|
-
const r = j((o) => o.progress),
|
|
15
|
-
var g, u, m,
|
|
16
|
-
if (!
|
|
14
|
+
const r = j((o) => o.progress), w = x(() => {
|
|
15
|
+
var d, g, u, m, f, l, p, b;
|
|
16
|
+
if (!e) return "border-transparent";
|
|
17
17
|
const o = {
|
|
18
|
-
primary: t("bg-primary/15 text-primary", (
|
|
18
|
+
primary: t("bg-primary/15 text-primary", (d = r == null ? void 0 : r.color) == null ? void 0 : d.primary),
|
|
19
19
|
secondary: t(
|
|
20
20
|
"bg-secondary/15 text-secondary",
|
|
21
|
-
(
|
|
21
|
+
(g = r == null ? void 0 : r.color) == null ? void 0 : g.secondary
|
|
22
22
|
),
|
|
23
|
-
success: t("bg-success/15 text-success", (
|
|
24
|
-
info: t("bg-info/15 text-info", (
|
|
23
|
+
success: t("bg-success/15 text-success", (u = r == null ? void 0 : r.color) == null ? void 0 : u.success),
|
|
24
|
+
info: t("bg-info/15 text-info", (m = r == null ? void 0 : r.color) == null ? void 0 : m.info),
|
|
25
25
|
warning: t("bg-warning/15 text-warning", (f = r == null ? void 0 : r.color) == null ? void 0 : f.warning),
|
|
26
|
-
danger: t("bg-danger/15 text-danger", (
|
|
27
|
-
dark: t("bg-dark/15 text-dark", (
|
|
28
|
-
light: t("bg-light/15 text-light", (
|
|
26
|
+
danger: t("bg-danger/15 text-danger", (l = r == null ? void 0 : r.color) == null ? void 0 : l.danger),
|
|
27
|
+
dark: t("bg-dark/15 text-dark", (p = r == null ? void 0 : r.color) == null ? void 0 : p.dark),
|
|
28
|
+
light: t("bg-light/15 text-light", (b = r == null ? void 0 : r.color) == null ? void 0 : b.light)
|
|
29
29
|
};
|
|
30
|
-
return (o == null ? void 0 : o[
|
|
31
|
-
}, [
|
|
30
|
+
return (o == null ? void 0 : o[e]) ?? null;
|
|
31
|
+
}, [e, r == null ? void 0 : r.color]), y = x(() => {
|
|
32
32
|
if (!n)
|
|
33
|
-
return `${
|
|
34
|
-
}, [
|
|
35
|
-
return /* @__PURE__ */
|
|
33
|
+
return `${Math.max(a, 0)}%`;
|
|
34
|
+
}, [a, n]);
|
|
35
|
+
return /* @__PURE__ */ i.jsxs(
|
|
36
36
|
"div",
|
|
37
37
|
{
|
|
38
38
|
className: k(
|
|
39
39
|
"relative block w-full h-2.5 rounded-full overflow-hidden",
|
|
40
40
|
r == null ? void 0 : r.base,
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
w,
|
|
42
|
+
h
|
|
43
43
|
),
|
|
44
|
-
...
|
|
44
|
+
...c,
|
|
45
45
|
children: [
|
|
46
|
-
/* @__PURE__ */
|
|
46
|
+
/* @__PURE__ */ i.jsx(
|
|
47
47
|
"span",
|
|
48
48
|
{
|
|
49
|
-
style: { width:
|
|
49
|
+
style: { width: y },
|
|
50
50
|
className: t(
|
|
51
51
|
"absolute h-full max-w-full bg-current rounded-[inherit] top-0 bottom-0 start-0",
|
|
52
52
|
n ? "animate-linear-progress-1" : "transition-[width]"
|
|
53
53
|
)
|
|
54
54
|
}
|
|
55
55
|
),
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
-
"span",
|
|
58
|
-
{
|
|
59
|
-
style: { width: a },
|
|
60
|
-
className: t(
|
|
61
|
-
"absolute h-full max-w-full bg-current rounded-[inherit] top-0 bottom-0 start-0",
|
|
62
|
-
n ? "animate-linear-progress-2" : "transition-[width]"
|
|
63
|
-
)
|
|
64
|
-
}
|
|
65
|
-
)
|
|
56
|
+
n && /* @__PURE__ */ i.jsx("span", { className: "absolute h-full max-w-full bg-current rounded-[inherit] top-0 bottom-0 start-0 animate-linear-progress-2" })
|
|
66
57
|
]
|
|
67
58
|
}
|
|
68
59
|
);
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ComponentProps, ElementType, ReactNode } from 'react';
|
|
2
|
-
import { TransitionStatus } from 'react-transition-group';
|
|
3
2
|
export type ComponentPropsWithoutAs<E extends ElementType, P extends Record<string, unknown> = {}> = P & Omit<ComponentProps<E>, keyof P>;
|
|
4
3
|
export type ComponentPropsWithAs<E extends ElementType, P extends Record<string, unknown> = {}> = P & {
|
|
5
4
|
as?: E;
|
|
@@ -15,9 +14,6 @@ export type ToggleProps = {
|
|
|
15
14
|
open?: boolean;
|
|
16
15
|
onClose?: VoidFunction;
|
|
17
16
|
};
|
|
18
|
-
export type TransitionClasses = {
|
|
19
|
-
[key in TransitionStatus]: string;
|
|
20
|
-
};
|
|
21
17
|
export type RecursivePartial<T> = {
|
|
22
18
|
[P in keyof T]?: RecursivePartial<T[P]>;
|
|
23
19
|
};
|