reaxify 0.0.69 → 0.0.70
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/dist/components/Skeleton/index.cjs.js +1 -1
- package/dist/components/Skeleton/index.es.js +1 -1
- package/dist/components/Spacer/index.d.ts +6 -0
- package/dist/components/Tabs/index.cjs.js +1 -1
- package/dist/components/Tabs/index.d.ts +3 -0
- package/dist/components/Tabs/index.es.js +48 -43
- package/dist/hooks/useAutoFill.cjs.js +1 -1
- package/dist/hooks/useAutoFill.d.ts +3 -1
- package/dist/hooks/useAutoFill.es.js +18 -17
- package/dist/providers/ThemeProvider.d.ts +4 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";const u=require("../../_virtual/jsx-runtime.cjs.js");require("react");const i=require("../../hooks/useClasses.cjs.js"),o=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js");function a({className:e,children:s,...t}){const n=i(r=>r.skeleton.base);return u.jsxRuntimeExports.jsx("span",{className:o.twMerge("inline-block
|
|
1
|
+
"use client";"use strict";const u=require("../../_virtual/jsx-runtime.cjs.js");require("react");const i=require("../../hooks/useClasses.cjs.js"),o=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js");function a({className:e,children:s,...t}){const n=i(r=>r.skeleton.base);return u.jsxRuntimeExports.jsx("span",{className:o.twMerge("inline-block w-10 h-10 rounded bg-gray-200 text-gray-200 animate-pulse",n,e),...t,children:s})}module.exports=a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("../../_virtual/jsx-runtime.cjs.js"),n=require("react"),w=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js"),g=require("../../helpers/cn.cjs.js"),p=require("../../hooks/useClasses.cjs.js"),R=require("../Button/index.cjs.js"),b=n.createContext({active:null,onChange:()=>{},buttonGroupClasses:""});function m({active:r=null,onChange:s=()=>{},children:u}){const a=p(l=>l.tabs.buttonGroup.base),c=n.useMemo(()=>g("relative flex items-center",a),[a]);return d.jsxRuntimeExports.jsx(b.Provider,{value:{active:r,onChange:s,buttonGroupClasses:c},children:u})}function q({className:r,...s}){const[u,a]=n.useState(!1),c=p(t=>t.tabs.indicator.base),{active:l}=n.useContext(b),f=n.useRef(null),x=n.useCallback(()=>{const t=f.current,e=t==null?void 0:t.parentElement,o=e==null?void 0:e.querySelector("button[data-active='true']");if(!e||!o||!t)return;const i=(o==null?void 0:o.offsetLeft)??0,C=window.getComputedStyle(o).paddingInline,j=(o==null?void 0:o.getBoundingClientRect().width)??0,v=i,y=j;t.style.setProperty("--left",`${v}px`),t.style.setProperty("--width",`${y}px`),t.style.setProperty("--padding-x",`${C}`)},[]);return n.useEffect(()=>{x(),requestAnimationFrame(()=>a(!0))},[x,l]),d.jsxRuntimeExports.jsx("span",{ref:f,className:w.twMerge("absolute bottom-0 left-(--left,0px) rtl:left-(--left,100%) w-(--width,0px) px-(--padding-x,0px) h-px overflow-hidden",u?"transition-[width,left,padding]":"",c,r),...s,children:d.jsxRuntimeExports.jsx("span",{className:"block size-full rounded-full bg-primary"})})}function E({eventKey:r,className:s,children:u,onClick:a,...c}){const l=p(i=>i.tabs.button.base),f=p(i=>i.tabs.button.active),{active:x,onChange:t}=n.useContext(b),e=r===x,h=n.useMemo(()=>typeof s=="function"?s({isActive:e}):s,[e,s]),o=i=>{!e&&t(r),a==null||a(i)};return d.jsxRuntimeExports.jsx(R,{as:"button",type:"button","data-active":e,onClick:o,color:e?"primary":null,variant:"text",className:g("shadow-none border-none",l,e&&f,h),...c,children:u})}function I({eventKey:r,children:s}){const{active:u}=n.useContext(b);return u!==r?null:d.jsxRuntimeExports.jsx(n.Fragment,{children:s})}m.Indicator=q;m.Button=E;m.Item=I;exports.TabsContext=b;exports.default=m;
|
|
@@ -1,81 +1,86 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { j as c } from "../../_virtual/jsx-runtime.es.js";
|
|
3
|
-
import { createContext as
|
|
3
|
+
import { createContext as I, useMemo as g, 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
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
const
|
|
5
|
+
import C from "../../helpers/cn.es.js";
|
|
6
|
+
import p from "../../hooks/useClasses.es.js";
|
|
7
|
+
import S from "../Button/index.es.js";
|
|
8
|
+
const b = I({
|
|
9
9
|
active: null,
|
|
10
10
|
onChange: () => {
|
|
11
11
|
},
|
|
12
12
|
buttonGroupClasses: ""
|
|
13
13
|
});
|
|
14
|
-
function x({ active:
|
|
15
|
-
}, children:
|
|
16
|
-
const
|
|
17
|
-
return /* @__PURE__ */ c.jsx(
|
|
14
|
+
function x({ active: o = null, onChange: n = () => {
|
|
15
|
+
}, children: a }) {
|
|
16
|
+
const r = p((u) => u.tabs.buttonGroup.base), l = g(() => C("relative flex items-center", r), [r]);
|
|
17
|
+
return /* @__PURE__ */ c.jsx(b.Provider, { value: { active: o, onChange: n, buttonGroupClasses: l }, children: a });
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
className:
|
|
21
|
-
...
|
|
19
|
+
function $({
|
|
20
|
+
className: o,
|
|
21
|
+
...n
|
|
22
22
|
}) {
|
|
23
|
-
const [
|
|
24
|
-
const t =
|
|
25
|
-
if (!
|
|
26
|
-
const
|
|
27
|
-
t.style.setProperty("--left", `${
|
|
23
|
+
const [a, r] = P(!1), l = p((t) => t.tabs.indicator.base), { active: u } = m(b), d = T(null), f = A(() => {
|
|
24
|
+
const t = d.current, e = t == null ? void 0 : t.parentElement, s = e == null ? void 0 : e.querySelector("button[data-active='true']");
|
|
25
|
+
if (!e || !s || !t) return;
|
|
26
|
+
const i = (s == null ? void 0 : s.offsetLeft) ?? 0, w = window.getComputedStyle(s).paddingInline, y = (s == null ? void 0 : s.getBoundingClientRect().width) ?? 0, v = i, j = y;
|
|
27
|
+
t.style.setProperty("--left", `${v}px`), t.style.setProperty("--width", `${j}px`), t.style.setProperty("--padding-x", `${w}`);
|
|
28
28
|
}, []);
|
|
29
29
|
return R(() => {
|
|
30
|
-
|
|
31
|
-
}, [
|
|
30
|
+
f(), requestAnimationFrame(() => r(!0));
|
|
31
|
+
}, [f, u]), /* @__PURE__ */ c.jsx(
|
|
32
32
|
"span",
|
|
33
33
|
{
|
|
34
|
-
ref:
|
|
34
|
+
ref: d,
|
|
35
35
|
className: G(
|
|
36
36
|
"absolute bottom-0 left-(--left,0px) rtl:left-(--left,100%) w-(--width,0px) px-(--padding-x,0px) h-px overflow-hidden",
|
|
37
|
-
|
|
37
|
+
a ? "transition-[width,left,padding]" : "",
|
|
38
38
|
l,
|
|
39
|
-
|
|
39
|
+
o
|
|
40
40
|
),
|
|
41
|
-
...
|
|
41
|
+
...n,
|
|
42
42
|
children: /* @__PURE__ */ c.jsx("span", { className: "block size-full rounded-full bg-primary" })
|
|
43
43
|
}
|
|
44
44
|
);
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
eventKey:
|
|
48
|
-
className:
|
|
49
|
-
children:
|
|
50
|
-
onClick:
|
|
46
|
+
function q({
|
|
47
|
+
eventKey: o,
|
|
48
|
+
className: n,
|
|
49
|
+
children: a,
|
|
50
|
+
onClick: r,
|
|
51
51
|
...l
|
|
52
52
|
}) {
|
|
53
|
-
const
|
|
54
|
-
!
|
|
53
|
+
const u = p((i) => i.tabs.button.base), d = p((i) => i.tabs.button.active), { active: f, onChange: t } = m(b), e = o === f, h = g(() => typeof n == "function" ? n({ isActive: e }) : n, [e, n]), s = (i) => {
|
|
54
|
+
!e && t(o), r == null || r(i);
|
|
55
55
|
};
|
|
56
56
|
return /* @__PURE__ */ c.jsx(
|
|
57
|
-
|
|
57
|
+
S,
|
|
58
58
|
{
|
|
59
59
|
as: "button",
|
|
60
60
|
type: "button",
|
|
61
|
-
"data-active":
|
|
62
|
-
onClick:
|
|
63
|
-
color:
|
|
61
|
+
"data-active": e,
|
|
62
|
+
onClick: s,
|
|
63
|
+
color: e ? "primary" : null,
|
|
64
64
|
variant: "text",
|
|
65
|
-
className:
|
|
65
|
+
className: C(
|
|
66
|
+
"shadow-none border-none",
|
|
67
|
+
u,
|
|
68
|
+
e && d,
|
|
69
|
+
h
|
|
70
|
+
),
|
|
66
71
|
...l,
|
|
67
|
-
children:
|
|
72
|
+
children: a
|
|
68
73
|
}
|
|
69
74
|
);
|
|
70
75
|
}
|
|
71
|
-
function
|
|
72
|
-
const { active:
|
|
73
|
-
return
|
|
76
|
+
function F({ eventKey: o, children: n }) {
|
|
77
|
+
const { active: a } = m(b);
|
|
78
|
+
return a !== o ? null : /* @__PURE__ */ c.jsx(E, { children: n });
|
|
74
79
|
}
|
|
75
|
-
x.Indicator =
|
|
76
|
-
x.Button =
|
|
77
|
-
x.Item =
|
|
80
|
+
x.Indicator = $;
|
|
81
|
+
x.Button = q;
|
|
82
|
+
x.Item = F;
|
|
78
83
|
export {
|
|
79
|
-
|
|
84
|
+
b as TabsContext,
|
|
80
85
|
x as default
|
|
81
86
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";const
|
|
1
|
+
"use client";"use strict";const a=require("react");function f(s,e){const l=a.useRef(null);a.useEffect(()=>{var t,u;if(e!=null&&e.skip)return;l.current=new AbortController;const r=l.current;return(u=(t=navigator==null?void 0:navigator.credentials)==null?void 0:t.get)==null||u.call(t,{otp:{transport:["sms"]},signal:r.signal}).then(c=>{const n=c;s((n==null?void 0:n.code)||null)}).catch(c=>{console.error(c)}),()=>{r==null||r.abort("signal has been aborted.")}},[e==null?void 0:e.skip])}module.exports=f;
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useRef as
|
|
3
|
-
function
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
var t,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import { useRef as s, useEffect as f } from "react";
|
|
3
|
+
function b(u, e) {
|
|
4
|
+
const a = s(null);
|
|
5
|
+
f(() => {
|
|
6
|
+
var t, c;
|
|
7
|
+
if (e != null && e.skip) return;
|
|
8
|
+
a.current = new AbortController();
|
|
9
|
+
const r = a.current;
|
|
10
|
+
return (c = (t = navigator == null ? void 0 : navigator.credentials) == null ? void 0 : t.get) == null || c.call(t, {
|
|
10
11
|
// eslint-disable-next-line
|
|
11
12
|
// @ts-ignore
|
|
12
13
|
otp: { transport: ["sms"] },
|
|
13
|
-
signal:
|
|
14
|
-
}).then((
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
}).catch((
|
|
18
|
-
console.error(
|
|
14
|
+
signal: r.signal
|
|
15
|
+
}).then((l) => {
|
|
16
|
+
const n = l;
|
|
17
|
+
u((n == null ? void 0 : n.code) || null);
|
|
18
|
+
}).catch((l) => {
|
|
19
|
+
console.error(l);
|
|
19
20
|
}), () => {
|
|
20
|
-
|
|
21
|
+
r == null || r.abort("signal has been aborted.");
|
|
21
22
|
};
|
|
22
|
-
}, []);
|
|
23
|
+
}, [e == null ? void 0 : e.skip]);
|
|
23
24
|
}
|
|
24
25
|
export {
|
|
25
|
-
|
|
26
|
+
b as default
|
|
26
27
|
};
|
|
@@ -131,6 +131,9 @@ export type ThemeProviderContextType = {
|
|
|
131
131
|
skeleton: {
|
|
132
132
|
base: string;
|
|
133
133
|
};
|
|
134
|
+
spacer: {
|
|
135
|
+
base: string;
|
|
136
|
+
};
|
|
134
137
|
stack: {
|
|
135
138
|
base: string;
|
|
136
139
|
variants: {
|
|
@@ -172,6 +175,7 @@ export type ThemeProviderContextType = {
|
|
|
172
175
|
};
|
|
173
176
|
button: {
|
|
174
177
|
base: string;
|
|
178
|
+
active: string;
|
|
175
179
|
};
|
|
176
180
|
};
|
|
177
181
|
typography: {
|