reaxify 0.0.65 → 0.0.66

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 client";"use strict";const a=require("../../_virtual/jsx-runtime.cjs.js"),t=require("react"),m=require("../../hooks/useClasses.cjs.js"),c=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js");function p({color:o="primary",size:i="md",className:d,...u}){const r=m(e=>e.spinner),s=t.useMemo(()=>{var n;if(!o)return"border-current";const e={primary:"border-primary",secondary:"border-secondary",success:"border-success",info:"border-info",warning:"border-warning",danger:"border-danger",dark:"border-dark",light:"border-light"};return[e==null?void 0:e[o],(n=r==null?void 0:r.color)==null?void 0:n[o]]},[o,r==null?void 0:r.color]),b=t.useMemo(()=>{var n;const e={sm:"border-2 size-4",md:"border-3 size-6",lg:"border-4 size-8"};return[e==null?void 0:e[i],(n=r==null?void 0:r.size)==null?void 0:n[i]]},[i,r==null?void 0:r.size]);return a.jsxRuntimeExports.jsx("span",{className:c.twMerge("inline-block align-middle rounded-full animate-spin",r==null?void 0:r.base,s,"border-l-transparent",b,d),...u})}module.exports=p;
1
+ "use client";"use strict";const b=require("../../_virtual/jsx-runtime.cjs.js"),i=require("react"),c=require("../../hooks/useClasses.cjs.js"),m=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js");function p({color:o="primary",size:t="md",className:d,...u}){const r=c(e=>e.spinner),s=i.useMemo(()=>{var n;if(!o)return"border-current";const e={primary:"border-primary",secondary:"border-secondary",success:"border-success",info:"border-info",warning:"border-warning",danger:"border-danger",dark:"border-dark",light:"border-light"};return[e==null?void 0:e[o],(n=r==null?void 0:r.color)==null?void 0:n[o]]},[o,r==null?void 0:r.color]),a=i.useMemo(()=>{var n;const e={sm:"border-2 w-4",md:"border-3 w-6",lg:"border-4 w-8"};return[e==null?void 0:e[t],(n=r==null?void 0:r.size)==null?void 0:n[t]]},[t,r==null?void 0:r.size]);return b.jsxRuntimeExports.jsx("span",{className:m.twMerge("inline-block align-middle rounded-full animate-spin aspect-square",r==null?void 0:r.base,s,"border-l-transparent",a,d),...u})}module.exports=p;
@@ -1,15 +1,15 @@
1
1
  "use client";
2
- import { j as u } from "../../_virtual/jsx-runtime.es.js";
2
+ import { j as b } from "../../_virtual/jsx-runtime.es.js";
3
3
  import { useMemo as d } from "react";
4
4
  import p from "../../hooks/useClasses.es.js";
5
5
  import { twMerge as s } from "../../node_modules/tailwind-merge/dist/bundle-mjs.es.js";
6
- function y({
6
+ function w({
7
7
  color: o = "primary",
8
- size: i = "md",
9
- className: t,
10
- ...m
8
+ size: t = "md",
9
+ className: i,
10
+ ...a
11
11
  }) {
12
- const r = p((e) => e.spinner), a = d(() => {
12
+ const r = p((e) => e.spinner), m = d(() => {
13
13
  var n;
14
14
  if (!o) return "border-current";
15
15
  const e = {
@@ -23,30 +23,30 @@ function y({
23
23
  light: "border-light"
24
24
  };
25
25
  return [e == null ? void 0 : e[o], (n = r == null ? void 0 : r.color) == null ? void 0 : n[o]];
26
- }, [o, r == null ? void 0 : r.color]), b = d(() => {
26
+ }, [o, r == null ? void 0 : r.color]), u = d(() => {
27
27
  var n;
28
28
  const e = {
29
- sm: "border-2 size-4",
30
- md: "border-3 size-6",
31
- lg: "border-4 size-8"
29
+ sm: "border-2 w-4",
30
+ md: "border-3 w-6",
31
+ lg: "border-4 w-8"
32
32
  };
33
- return [e == null ? void 0 : e[i], (n = r == null ? void 0 : r.size) == null ? void 0 : n[i]];
34
- }, [i, r == null ? void 0 : r.size]);
35
- return /* @__PURE__ */ u.jsx(
33
+ return [e == null ? void 0 : e[t], (n = r == null ? void 0 : r.size) == null ? void 0 : n[t]];
34
+ }, [t, r == null ? void 0 : r.size]);
35
+ return /* @__PURE__ */ b.jsx(
36
36
  "span",
37
37
  {
38
38
  className: s(
39
- "inline-block align-middle rounded-full animate-spin",
39
+ "inline-block align-middle rounded-full animate-spin aspect-square",
40
40
  r == null ? void 0 : r.base,
41
- a,
41
+ m,
42
42
  "border-l-transparent",
43
- b,
44
- t
43
+ u,
44
+ i
45
45
  ),
46
- ...m
46
+ ...a
47
47
  }
48
48
  );
49
49
  }
50
50
  export {
51
- y as default
51
+ w as default
52
52
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("../../_virtual/jsx-runtime.cjs.js"),e=require("react"),v=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js"),g=require("../../helpers/cn.cjs.js"),m=require("../../hooks/useClasses.cjs.js"),R=require("../Button/index.cjs.js"),d=e.createContext({active:null,onChange:()=>{},buttonGroupClasses:""});function p({active:s=null,onChange:r=()=>{},children:a}){const n=m(i=>i.tabs.buttonGroup.base),c=e.useMemo(()=>g("relative flex items-center",n),[n]);return l.jsxRuntimeExports.jsx(d.Provider,{value:{active:s,onChange:r,buttonGroupClasses:c},children:a})}function q({className:s,...r}){const[a,n]=e.useState(!1),c=m(t=>t.tabs.indicator.base),{active:i}=e.useContext(d),x=e.useRef(null),b=e.useCallback(()=>{const t=x.current,u=t==null?void 0:t.parentElement,o=u==null?void 0:u.querySelector("button[data-active='true']");if(!u||!o||!t)return;const h=(o==null?void 0:o.offsetLeft)??0,j=window.getComputedStyle(o).paddingInline,C=(o==null?void 0:o.getBoundingClientRect().width)??0,w=h,y=C;t.style.setProperty("--left",`${w}px`),t.style.setProperty("--width",`${y}px`),t.style.setProperty("--padding-x",`${j}`)},[]);return e.useEffect(()=>{b(),n(!0)},[b,i]),l.jsxRuntimeExports.jsx("span",{ref:x,className:v.twMerge("absolute bottom-0 left-(--left,0px) rtl:left-(--left,100%) w-(--width,0px) px-(--padding-x,0px) h-px overflow-hidden",a?"transition-[width,left,padding]":"",c,s),...r,children:l.jsxRuntimeExports.jsx("span",{className:"block size-full rounded-full bg-primary"})})}function E({eventKey:s,className:r,children:a,onClick:n,...c}){const i=m(f=>f.tabs.button.base),{active:x,onChange:b}=e.useContext(d),t=s===x,u=f=>{!t&&b(s),n==null||n(f)};return l.jsxRuntimeExports.jsx(R,{as:"button",type:"button","data-active":t,onClick:u,color:t?"primary":null,variant:"text",className:g("shadow-none border-none",i,r),...c,children:a})}function I({eventKey:s,children:r}){const{active:a}=e.useContext(d);return a!==s?null:l.jsxRuntimeExports.jsx(e.Fragment,{children:r})}p.Indicator=q;p.Button=E;p.Item=I;exports.TabsContext=d;exports.default=p;
1
+ "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("../../_virtual/jsx-runtime.cjs.js"),e=require("react"),v=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js"),g=require("../../helpers/cn.cjs.js"),m=require("../../hooks/useClasses.cjs.js"),R=require("../Button/index.cjs.js"),d=e.createContext({active:null,onChange:()=>{},buttonGroupClasses:""});function p({active:s=null,onChange:r=()=>{},children:a}){const n=m(c=>c.tabs.buttonGroup.base),i=e.useMemo(()=>g("relative flex items-center",n),[n]);return l.jsxRuntimeExports.jsx(d.Provider,{value:{active:s,onChange:r,buttonGroupClasses:i},children:a})}function q({className:s,...r}){const[a,n]=e.useState(!1),i=m(t=>t.tabs.indicator.base),{active:c}=e.useContext(d),x=e.useRef(null),b=e.useCallback(()=>{const t=x.current,u=t==null?void 0:t.parentElement,o=u==null?void 0:u.querySelector("button[data-active='true']");if(!u||!o||!t)return;const h=(o==null?void 0:o.offsetLeft)??0,j=window.getComputedStyle(o).paddingInline,C=(o==null?void 0:o.getBoundingClientRect().width)??0,w=h,y=C;t.style.setProperty("--left",`${w}px`),t.style.setProperty("--width",`${y}px`),t.style.setProperty("--padding-x",`${j}`)},[]);return e.useEffect(()=>{b(),requestAnimationFrame(()=>n(!0))},[b,c]),l.jsxRuntimeExports.jsx("span",{ref:x,className:v.twMerge("absolute bottom-0 left-(--left,0px) rtl:left-(--left,100%) w-(--width,0px) px-(--padding-x,0px) h-px overflow-hidden",a?"transition-[width,left,padding]":"",i,s),...r,children:l.jsxRuntimeExports.jsx("span",{className:"block size-full rounded-full bg-primary"})})}function E({eventKey:s,className:r,children:a,onClick:n,...i}){const c=m(f=>f.tabs.button.base),{active:x,onChange:b}=e.useContext(d),t=s===x,u=f=>{!t&&b(s),n==null||n(f)};return l.jsxRuntimeExports.jsx(R,{as:"button",type:"button","data-active":t,onClick:u,color:t?"primary":null,variant:"text",className:g("shadow-none border-none",c,r),...i,children:a})}function I({eventKey:s,children:r}){const{active:a}=e.useContext(d);return a!==s?null:l.jsxRuntimeExports.jsx(e.Fragment,{children:r})}p.Indicator=q;p.Button=E;p.Item=I;exports.TabsContext=d;exports.default=p;
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { j as i } from "../../_virtual/jsx-runtime.es.js";
3
- import { createContext as j, useMemo as I, useState as P, useContext as m, useRef as T, useCallback as R, useEffect as A, Fragment as E } from "react";
2
+ import { j as c } from "../../_virtual/jsx-runtime.es.js";
3
+ import { createContext as j, useMemo as I, useState as P, useContext as m, useRef as T, useCallback as A, useEffect as R, Fragment as E } from "react";
4
4
  import { twMerge as G } from "../../node_modules/tailwind-merge/dist/bundle-mjs.es.js";
5
5
  import h from "../../helpers/cn.es.js";
6
6
  import b from "../../hooks/useClasses.es.js";
@@ -13,22 +13,22 @@ const p = j({
13
13
  });
14
14
  function x({ active: e = null, onChange: o = () => {
15
15
  }, children: r }) {
16
- const n = b((c) => c.tabs.buttonGroup.base), l = I(() => h("relative flex items-center", n), [n]);
17
- return /* @__PURE__ */ i.jsx(p.Provider, { value: { active: e, onChange: o, buttonGroupClasses: l }, children: r });
16
+ const n = b((i) => i.tabs.buttonGroup.base), l = I(() => h("relative flex items-center", n), [n]);
17
+ return /* @__PURE__ */ c.jsx(p.Provider, { value: { active: e, onChange: o, buttonGroupClasses: l }, children: r });
18
18
  }
19
19
  function S({
20
20
  className: e,
21
21
  ...o
22
22
  }) {
23
- const [r, n] = P(!1), l = b((t) => t.tabs.indicator.base), { active: c } = m(p), u = T(null), d = R(() => {
23
+ const [r, n] = P(!1), l = b((t) => t.tabs.indicator.base), { active: i } = m(p), u = T(null), d = A(() => {
24
24
  const t = u.current, a = t == null ? void 0 : t.parentElement, s = a == null ? void 0 : a.querySelector("button[data-active='true']");
25
25
  if (!a || !s || !t) return;
26
26
  const g = (s == null ? void 0 : s.offsetLeft) ?? 0, w = window.getComputedStyle(s).paddingInline, y = (s == null ? void 0 : s.getBoundingClientRect().width) ?? 0, C = g, v = y;
27
27
  t.style.setProperty("--left", `${C}px`), t.style.setProperty("--width", `${v}px`), t.style.setProperty("--padding-x", `${w}`);
28
28
  }, []);
29
- return A(() => {
30
- d(), n(!0);
31
- }, [d, c]), /* @__PURE__ */ i.jsx(
29
+ return R(() => {
30
+ d(), requestAnimationFrame(() => n(!0));
31
+ }, [d, i]), /* @__PURE__ */ c.jsx(
32
32
  "span",
33
33
  {
34
34
  ref: u,
@@ -39,7 +39,7 @@ function S({
39
39
  e
40
40
  ),
41
41
  ...o,
42
- children: /* @__PURE__ */ i.jsx("span", { className: "block size-full rounded-full bg-primary" })
42
+ children: /* @__PURE__ */ c.jsx("span", { className: "block size-full rounded-full bg-primary" })
43
43
  }
44
44
  );
45
45
  }
@@ -50,10 +50,10 @@ function $({
50
50
  onClick: n,
51
51
  ...l
52
52
  }) {
53
- const c = b((f) => f.tabs.button.base), { active: u, onChange: d } = m(p), t = e === u, a = (f) => {
53
+ const i = b((f) => f.tabs.button.base), { active: u, onChange: d } = m(p), t = e === u, a = (f) => {
54
54
  !t && d(e), n == null || n(f);
55
55
  };
56
- return /* @__PURE__ */ i.jsx(
56
+ return /* @__PURE__ */ c.jsx(
57
57
  N,
58
58
  {
59
59
  as: "button",
@@ -62,19 +62,19 @@ function $({
62
62
  onClick: a,
63
63
  color: t ? "primary" : null,
64
64
  variant: "text",
65
- className: h("shadow-none border-none", c, o),
65
+ className: h("shadow-none border-none", i, o),
66
66
  ...l,
67
67
  children: r
68
68
  }
69
69
  );
70
70
  }
71
- function L({ eventKey: e, children: o }) {
71
+ function q({ eventKey: e, children: o }) {
72
72
  const { active: r } = m(p);
73
- return r !== e ? null : /* @__PURE__ */ i.jsx(E, { children: o });
73
+ return r !== e ? null : /* @__PURE__ */ c.jsx(E, { children: o });
74
74
  }
75
75
  x.Indicator = S;
76
76
  x.Button = $;
77
- x.Item = L;
77
+ x.Item = q;
78
78
  export {
79
79
  p as TabsContext,
80
80
  x as default
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Accordion/index.cjs.js"),r=require("./Badge/index.cjs.js"),n=require("./Box/index.cjs.js"),i=require("./Button/index.cjs.js"),t=require("./ButtonGroup/index.cjs.js"),o=require("./Card/index.cjs.js"),u=require("./Drawer/index.cjs.js"),d=require("./InputGroup/index.cjs.js"),c=require("./Menu/index.cjs.js"),s=require("./Modal/index.cjs.js"),q=require("./Portal/index.cjs.js"),x=require("./Progress/index.cjs.js"),$=require("./Skeleton/index.cjs.js"),a=require("./Spinner/index.cjs.js"),l=require("./Stack/index.cjs.js"),p=require("./Switch/index.cjs.js"),f=require("./Table/index.cjs.js"),g=require("./Tabs/index.cjs.js"),S=require("./Tooltip/index.cjs.js"),b=require("./Typography/index.cjs.js");;/* empty css */exports.Accordion=e;exports.Badge=r;exports.Box=n;exports.Button=i;exports.ButtonGroup=t.default;exports.Card=o;exports.Drawer=u.default;exports.InputGroup=d;exports.Menu=c;exports.Modal=s.default;exports.Portal=q;exports.Progress=x;exports.Skeleton=$;exports.Spinner=a;exports.Stack=l;exports.Switch=p;exports.Table=f;exports.Tabs=g.default;exports.Tooltip=S;exports.Typography=b;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Accordion/index.cjs.js"),r=require("./Badge/index.cjs.js"),n=require("./Button/index.cjs.js"),i=require("./ButtonGroup/index.cjs.js"),t=require("./Card/index.cjs.js"),o=require("./Drawer/index.cjs.js"),u=require("./InputGroup/index.cjs.js"),d=require("./Menu/index.cjs.js"),c=require("./Modal/index.cjs.js"),s=require("./Portal/index.cjs.js"),q=require("./Progress/index.cjs.js"),x=require("./Skeleton/index.cjs.js"),$=require("./Spinner/index.cjs.js"),a=require("./Stack/index.cjs.js"),l=require("./Switch/index.cjs.js"),p=require("./Table/index.cjs.js"),f=require("./Tabs/index.cjs.js"),g=require("./Tooltip/index.cjs.js"),S=require("./Typography/index.cjs.js");;/* empty css */exports.Accordion=e;exports.Badge=r;exports.Button=n;exports.ButtonGroup=i.default;exports.Card=t;exports.Drawer=o.default;exports.InputGroup=u;exports.Menu=d;exports.Modal=c.default;exports.Portal=s;exports.Progress=q;exports.Skeleton=x;exports.Spinner=$;exports.Stack=a;exports.Switch=l;exports.Table=p;exports.Tabs=f.default;exports.Tooltip=g;exports.Typography=S;
@@ -1,6 +1,5 @@
1
1
  export { default as Accordion } from './Accordion';
2
2
  export { default as Badge } from './Badge';
3
- export { default as Box } from './Box';
4
3
  export { default as Button } from './Button';
5
4
  export { default as ButtonGroup } from './ButtonGroup';
6
5
  export { default as Card } from './Card';
@@ -1,44 +1,42 @@
1
1
  "use client";
2
2
  import { default as e } from "./Accordion/index.es.js";
3
3
  import { default as f } from "./Badge/index.es.js";
4
- import { default as u } from "./Box/index.es.js";
5
- import { default as d } from "./Button/index.es.js";
6
- import { default as m } from "./ButtonGroup/index.es.js";
7
- import { default as n } from "./Card/index.es.js";
8
- import { default as c } from "./Drawer/index.es.js";
9
- import { default as S } from "./InputGroup/index.es.js";
10
- import { default as g } from "./Menu/index.es.js";
11
- import { default as h } from "./Modal/index.es.js";
12
- import { default as w } from "./Portal/index.es.js";
13
- import { default as G } from "./Progress/index.es.js";
14
- import { default as P } from "./Skeleton/index.es.js";
15
- import { default as C } from "./Spinner/index.es.js";
16
- import { default as I } from "./Stack/index.es.js";
17
- import { default as q } from "./Switch/index.es.js";
18
- import { default as z } from "./Table/index.es.js";
19
- import { default as F } from "./Tabs/index.es.js";
20
- import { default as J } from "./Tooltip/index.es.js";
21
- import { default as L } from "./Typography/index.es.js";
4
+ import { default as u } from "./Button/index.es.js";
5
+ import { default as d } from "./ButtonGroup/index.es.js";
6
+ import { default as m } from "./Card/index.es.js";
7
+ import { default as n } from "./Drawer/index.es.js";
8
+ import { default as c } from "./InputGroup/index.es.js";
9
+ import { default as T } from "./Menu/index.es.js";
10
+ import { default as B } from "./Modal/index.es.js";
11
+ import { default as h } from "./Portal/index.es.js";
12
+ import { default as w } from "./Progress/index.es.js";
13
+ import { default as G } from "./Skeleton/index.es.js";
14
+ import { default as P } from "./Spinner/index.es.js";
15
+ import { default as C } from "./Stack/index.es.js";
16
+ import { default as I } from "./Switch/index.es.js";
17
+ import { default as q } from "./Table/index.es.js";
18
+ import { default as z } from "./Tabs/index.es.js";
19
+ import { default as F } from "./Tooltip/index.es.js";
20
+ import { default as J } from "./Typography/index.es.js";
22
21
  /* empty css */
23
22
  export {
24
23
  e as Accordion,
25
24
  f as Badge,
26
- u as Box,
27
- d as Button,
28
- m as ButtonGroup,
29
- n as Card,
30
- c as Drawer,
31
- S as InputGroup,
32
- g as Menu,
33
- h as Modal,
34
- w as Portal,
35
- G as Progress,
36
- P as Skeleton,
37
- C as Spinner,
38
- I as Stack,
39
- q as Switch,
40
- z as Table,
41
- F as Tabs,
42
- J as Tooltip,
43
- L as Typography
25
+ u as Button,
26
+ d as ButtonGroup,
27
+ m as Card,
28
+ n as Drawer,
29
+ c as InputGroup,
30
+ T as Menu,
31
+ B as Modal,
32
+ h as Portal,
33
+ w as Progress,
34
+ G as Skeleton,
35
+ P as Spinner,
36
+ C as Stack,
37
+ I as Switch,
38
+ q as Table,
39
+ z as Tabs,
40
+ F as Tooltip,
41
+ J as Typography
44
42
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "reaxify",
3
3
  "private": false,
4
- "version": "0.0.65",
4
+ "version": "0.0.66",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
7
7
  "files": [
@@ -1 +0,0 @@
1
- "use client";"use strict";const u=require("../../_virtual/jsx-runtime.cjs.js"),i=require("../../helpers/cn.cjs.js");require("react");const c=require("../../hooks/useClasses.cjs.js");function x({as:s,className:t,...n}){const e=c(o=>o.box),r=s||"div";return u.jsxRuntimeExports.jsx(r,{className:i(e==null?void 0:e.base,t),...n})}module.exports=x;
@@ -1,3 +0,0 @@
1
- import { ComponentPropsWithAs } from '../../types';
2
- import { ElementType } from 'react';
3
- export default function Box<E extends ElementType = "div">({ as, className, ...props }: ComponentPropsWithAs<E>): import("react/jsx-runtime").JSX.Element;
@@ -1,16 +0,0 @@
1
- "use client";
2
- import { j as n } from "../../_virtual/jsx-runtime.es.js";
3
- import i from "../../helpers/cn.es.js";
4
- import "react";
5
- import p from "../../hooks/useClasses.es.js";
6
- function f({
7
- as: t,
8
- className: s,
9
- ...r
10
- }) {
11
- const o = p((m) => m.box), e = t || "div";
12
- return /* @__PURE__ */ n.jsx(e, { className: i(o == null ? void 0 : o.base, s), ...r });
13
- }
14
- export {
15
- f as default
16
- };