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,5 +1,5 @@
1
- import { ElementType } from 'react';
2
1
  import { ComponentPropsWithAs, ToggleProps } from '../../types';
2
+ import { ElementType } from 'react';
3
3
  type MenuProps = ToggleProps & {
4
4
  anchorEl?: HTMLElement | null;
5
5
  closeOnClick?: boolean;
@@ -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,...h}){const r=y(e=>e.progress),w=p.useMemo(()=>{var g,a,l,x,c,b,s,m;if(!o)return"border-transparent";const e={primary:t("bg-primary/15 text-primary",(g=r==null?void 0:r.color)==null?void 0:g.primary),secondary:t("bg-secondary/15 text-secondary",(a=r==null?void 0:r.color)==null?void 0:a.secondary),success:t("bg-success/15 text-success",(l=r==null?void 0:r.color)==null?void 0:l.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",(c=r==null?void 0:r.color)==null?void 0:c.warning),danger:t("bg-danger/15 text-danger",(b=r==null?void 0:r.color)==null?void 0:b.danger),dark:t("bg-dark/15 text-dark",(s=r==null?void 0:r.color)==null?void 0:s.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]),d=p.useMemo(()=>{if(!n)return`${u}%`},[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,w,f),...h,children:[i.jsxRuntimeExports.jsx("span",{style:{width:d},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]")}),i.jsxRuntimeExports.jsx("span",{style:{width:d},className:t("absolute h-full max-w-full bg-current rounded-[inherit] top-0 bottom-0 start-0",n?"animate-linear-progress-2":"transition-[width]")})]})}module.exports=q;
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 e } from "../../node_modules/react/jsx-runtime.es.js";
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 h } from "react";
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: i = "primary",
9
- value: d = 0,
8
+ color: e = "primary",
9
+ value: a = 0,
10
10
  animate: n = !1,
11
- className: c,
12
- ...w
11
+ className: h,
12
+ ...c
13
13
  }) {
14
- const r = j((o) => o.progress), y = h(() => {
15
- var g, u, m, l, f, p, b, x;
16
- if (!i) return "border-transparent";
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", (g = r == null ? void 0 : r.color) == null ? void 0 : g.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
- (u = r == null ? void 0 : r.color) == null ? void 0 : u.secondary
21
+ (g = r == null ? void 0 : r.color) == null ? void 0 : g.secondary
22
22
  ),
23
- success: t("bg-success/15 text-success", (m = r == null ? void 0 : r.color) == null ? void 0 : m.success),
24
- info: t("bg-info/15 text-info", (l = r == null ? void 0 : r.color) == null ? void 0 : l.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", (p = r == null ? void 0 : r.color) == null ? void 0 : p.danger),
27
- dark: t("bg-dark/15 text-dark", (b = r == null ? void 0 : r.color) == null ? void 0 : b.dark),
28
- light: t("bg-light/15 text-light", (x = r == null ? void 0 : r.color) == null ? void 0 : x.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[i]) ?? null;
31
- }, [i, r == null ? void 0 : r.color]), a = h(() => {
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 `${d}%`;
34
- }, [d, n]);
35
- return /* @__PURE__ */ e.jsxs(
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
- y,
42
- c
41
+ w,
42
+ h
43
43
  ),
44
- ...w,
44
+ ...c,
45
45
  children: [
46
- /* @__PURE__ */ e.jsx(
46
+ /* @__PURE__ */ i.jsx(
47
47
  "span",
48
48
  {
49
- style: { width: a },
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__ */ e.jsx(
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
  );
@@ -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
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "reaxify",
3
3
  "private": false,
4
- "version": "0.0.20",
4
+ "version": "0.0.21",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
7
7
  "files": [