reaxify 0.0.36 → 0.0.37
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const s=require("../../node_modules/react/jsx-runtime.cjs.js"),g=require("../../helpers/cn.cjs.js"),i=require("react"),y=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js");function f({checked:e,onChange:n,disabled:o,color:a="primary",size:b="md",inputProps:t={},className:u,...c}){const d=i.useMemo(()=>"",[e]),m=i.useMemo(()=>{const r={primary:e?"bg-primary border-primary":"bg-white border-[#e8eaee]",secondary:e?"bg-secondary border-secondary":"bg-white border-[#e8eaee]",success:e?"bg-success border-success":"bg-white border-[#e8eaee]",info:e?"bg-info border-info":"bg-white border-[#e8eaee]",warning:e?"bg-warning border-warning":"bg-white border-[#e8eaee]",danger:e?"bg-danger border-danger":"bg-white border-[#e8eaee]",dark:e?"bg-dark border-dark":"bg-white border-[#e8eaee]",light:e?"bg-light border-light":"bg-white border-[#e8eaee]"};return r==null?void 0:r[a]},[a,e]),w=i.useMemo(()=>{const r={primary:e?"bg-primary ":"bg-black",secondary:e?"bg-secondary":"bg-black",success:e?"bg-success":"bg-black",info:e?"bg-info":"bg-black",warning:e?"bg-warning":"bg-black",danger:e?"bg-danger":"bg-black",dark:e?"bg-dark":"bg-black",light:e?"bg-light":"bg-black"};return r==null?void 0:r[a]},[a,e]),x=i.useMemo(()=>{const r={sm:"[--size:0.25rem]",md:"[--size:0.5rem]",lg:"[--size:0.75rem]"};return r==null?void 0:r[b]},[b]),h=r=>{var l;n==null||n(r.currentTarget.checked),(l=t.onChange)==null||l.call(t,r)};return s.jsxRuntimeExports.jsxs("span",{className:y.twMerge(x,"[--w:2.5rem] [--h:1.875rem] [--t:0.75rem] [--width:calc(var(--w)+var(--size)*2)] [--height:calc(var(--h)+var(--size))] [--thumb:calc(var(--t)+var(--size))] [--scale:0] hover:[--scale:1]","inline-flex w-(--width) h-(--height) overflow-hidden p-3 relative align-middle",o&&"opacity-75",d,u),...c,children:[s.jsxRuntimeExports.jsx("input",{...t,type:"checkbox",className:"peer absolute inset-0 size-full opacity-0 cursor-pointer disabled:cursor-not-allowed z-[2]",checked:e,disabled:o,onChange:h}),s.jsxRuntimeExports.jsxs("span",{className:"inline-flex justify-center items-center size-(--height) rounded-full absolute inset-y-0 my-auto start-0 peer-checked:start-[calc(100%-var(--height))] transition-[inset-inline-start] z-[1]",children:[s.jsxRuntimeExports.jsx("span",{className:"absolute size-full inset-0 bg-black/5 rounded-full scale-(--scale) transition-[scale]"}),s.jsxRuntimeExports.jsx("span",{className:g("absolute size-(--thumb) inset-0 m-auto border rounded-full shadow transition-colors",m)})]}),s.jsxRuntimeExports.jsx("span",{className:g("size-full rounded-full opacity-35 transition-colors",w)})]})}module.exports=f;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { j as a } from "../../node_modules/react/jsx-runtime.es.js";
|
|
2
|
+
import g from "../../helpers/cn.es.js";
|
|
3
|
+
import { useMemo as i } from "react";
|
|
4
|
+
import { twMerge as y } from "../../node_modules/tailwind-merge/dist/bundle-mjs.es.js";
|
|
5
|
+
function j({
|
|
6
|
+
checked: e,
|
|
7
|
+
onChange: n,
|
|
8
|
+
disabled: b,
|
|
9
|
+
color: s = "primary",
|
|
10
|
+
size: l = "md",
|
|
11
|
+
inputProps: t = {},
|
|
12
|
+
className: d,
|
|
13
|
+
...m
|
|
14
|
+
}) {
|
|
15
|
+
const c = i(() => "", [e]), u = i(() => {
|
|
16
|
+
const r = {
|
|
17
|
+
primary: e ? "bg-primary border-primary" : "bg-white border-[#e8eaee]",
|
|
18
|
+
secondary: e ? "bg-secondary border-secondary" : "bg-white border-[#e8eaee]",
|
|
19
|
+
success: e ? "bg-success border-success" : "bg-white border-[#e8eaee]",
|
|
20
|
+
info: e ? "bg-info border-info" : "bg-white border-[#e8eaee]",
|
|
21
|
+
warning: e ? "bg-warning border-warning" : "bg-white border-[#e8eaee]",
|
|
22
|
+
danger: e ? "bg-danger border-danger" : "bg-white border-[#e8eaee]",
|
|
23
|
+
dark: e ? "bg-dark border-dark" : "bg-white border-[#e8eaee]",
|
|
24
|
+
light: e ? "bg-light border-light" : "bg-white border-[#e8eaee]"
|
|
25
|
+
};
|
|
26
|
+
return r == null ? void 0 : r[s];
|
|
27
|
+
}, [s, e]), w = i(() => {
|
|
28
|
+
const r = {
|
|
29
|
+
primary: e ? "bg-primary " : "bg-black",
|
|
30
|
+
secondary: e ? "bg-secondary" : "bg-black",
|
|
31
|
+
success: e ? "bg-success" : "bg-black",
|
|
32
|
+
info: e ? "bg-info" : "bg-black",
|
|
33
|
+
warning: e ? "bg-warning" : "bg-black",
|
|
34
|
+
danger: e ? "bg-danger" : "bg-black",
|
|
35
|
+
dark: e ? "bg-dark" : "bg-black",
|
|
36
|
+
light: e ? "bg-light" : "bg-black"
|
|
37
|
+
};
|
|
38
|
+
return r == null ? void 0 : r[s];
|
|
39
|
+
}, [s, e]), f = i(() => {
|
|
40
|
+
const r = {
|
|
41
|
+
sm: "[--size:0.25rem]",
|
|
42
|
+
md: "[--size:0.5rem]",
|
|
43
|
+
lg: "[--size:0.75rem]"
|
|
44
|
+
};
|
|
45
|
+
return r == null ? void 0 : r[l];
|
|
46
|
+
}, [l]), h = (r) => {
|
|
47
|
+
var o;
|
|
48
|
+
n == null || n(r.currentTarget.checked), (o = t.onChange) == null || o.call(t, r);
|
|
49
|
+
};
|
|
50
|
+
return /* @__PURE__ */ a.jsxs(
|
|
51
|
+
"span",
|
|
52
|
+
{
|
|
53
|
+
className: y(
|
|
54
|
+
f,
|
|
55
|
+
"[--w:2.5rem] [--h:1.875rem] [--t:0.75rem] [--width:calc(var(--w)+var(--size)*2)] [--height:calc(var(--h)+var(--size))] [--thumb:calc(var(--t)+var(--size))] [--scale:0] hover:[--scale:1]",
|
|
56
|
+
"inline-flex w-(--width) h-(--height) overflow-hidden p-3 relative align-middle",
|
|
57
|
+
b && "opacity-75",
|
|
58
|
+
c,
|
|
59
|
+
d
|
|
60
|
+
),
|
|
61
|
+
...m,
|
|
62
|
+
children: [
|
|
63
|
+
/* @__PURE__ */ a.jsx(
|
|
64
|
+
"input",
|
|
65
|
+
{
|
|
66
|
+
...t,
|
|
67
|
+
type: "checkbox",
|
|
68
|
+
className: "peer absolute inset-0 size-full opacity-0 cursor-pointer disabled:cursor-not-allowed z-[2]",
|
|
69
|
+
checked: e,
|
|
70
|
+
disabled: b,
|
|
71
|
+
onChange: h
|
|
72
|
+
}
|
|
73
|
+
),
|
|
74
|
+
/* @__PURE__ */ a.jsxs("span", { className: "inline-flex justify-center items-center size-(--height) rounded-full absolute inset-y-0 my-auto start-0 peer-checked:start-[calc(100%-var(--height))] transition-[inset-inline-start] z-[1]", children: [
|
|
75
|
+
/* @__PURE__ */ a.jsx("span", { className: "absolute size-full inset-0 bg-black/5 rounded-full scale-(--scale) transition-[scale]" }),
|
|
76
|
+
/* @__PURE__ */ a.jsx(
|
|
77
|
+
"span",
|
|
78
|
+
{
|
|
79
|
+
className: g(
|
|
80
|
+
"absolute size-(--thumb) inset-0 m-auto border rounded-full shadow transition-colors",
|
|
81
|
+
u
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
)
|
|
85
|
+
] }),
|
|
86
|
+
/* @__PURE__ */ a.jsx(
|
|
87
|
+
"span",
|
|
88
|
+
{
|
|
89
|
+
className: g(
|
|
90
|
+
"size-full rounded-full opacity-35 transition-colors",
|
|
91
|
+
w
|
|
92
|
+
)
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
export {
|
|
100
|
+
j as default
|
|
101
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"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("./Form/index.cjs.js"),c=require("./InputGroup/index.cjs.js"),s=require("./Menu/index.cjs.js"),q=require("./Modal/index.cjs.js"),x=require("./Portal/index.cjs.js"),$=require("./Progress/index.cjs.js"),a=require("./Skeleton/index.cjs.js"),l=require("./Spinner/index.cjs.js"),p=require("./Stack/index.cjs.js"),f=require("./
|
|
1
|
+
"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("./Form/index.cjs.js"),c=require("./InputGroup/index.cjs.js"),s=require("./Menu/index.cjs.js"),q=require("./Modal/index.cjs.js"),x=require("./Portal/index.cjs.js"),$=require("./Progress/index.cjs.js"),a=require("./Skeleton/index.cjs.js"),l=require("./Spinner/index.cjs.js"),p=require("./Stack/index.cjs.js"),f=require("./Switch/index.cjs.js"),g=require("./Table/index.cjs.js"),S=require("./Tabs/index.cjs.js"),b=require("./Tooltip/index.cjs.js"),T=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.Form=d.default;exports.InputGroup=c;exports.Menu=s;exports.Modal=q.default;exports.Portal=x;exports.Progress=$;exports.Skeleton=a;exports.Spinner=l;exports.Stack=p;exports.Switch=f;exports.Table=g;exports.Tabs=S.default;exports.Tooltip=b;exports.Typography=T;
|
|
@@ -14,6 +14,7 @@ export { default as Progress } from './Progress';
|
|
|
14
14
|
export { default as Skeleton } from './Skeleton';
|
|
15
15
|
export { default as Spinner } from './Spinner';
|
|
16
16
|
export { default as Stack } from './Stack';
|
|
17
|
+
export { default as Switch } from './Switch';
|
|
17
18
|
export { default as Table } from './Table';
|
|
18
19
|
export { default as Tabs } from './Tabs';
|
|
19
20
|
export { default as Tooltip } from './Tooltip';
|
|
@@ -4,20 +4,21 @@ import { default as u } from "./Box/index.es.js";
|
|
|
4
4
|
import { default as d } from "./Button/index.es.js";
|
|
5
5
|
import { default as m } from "./ButtonGroup/index.es.js";
|
|
6
6
|
import { default as n } from "./Card/index.es.js";
|
|
7
|
-
import { default as
|
|
8
|
-
import { default as
|
|
9
|
-
import { default as
|
|
10
|
-
import { default as
|
|
11
|
-
import { default as
|
|
12
|
-
import { default as
|
|
13
|
-
import { default as
|
|
7
|
+
import { default as c } from "./Drawer/index.es.js";
|
|
8
|
+
import { default as S } from "./Form/index.es.js";
|
|
9
|
+
import { default as g } from "./InputGroup/index.es.js";
|
|
10
|
+
import { default as h } from "./Menu/index.es.js";
|
|
11
|
+
import { default as w } from "./Modal/index.es.js";
|
|
12
|
+
import { default as G } from "./Portal/index.es.js";
|
|
13
|
+
import { default as P } from "./Progress/index.es.js";
|
|
14
14
|
import { default as C } from "./Skeleton/index.es.js";
|
|
15
15
|
import { default as F } from "./Spinner/index.es.js";
|
|
16
16
|
import { default as j } from "./Stack/index.es.js";
|
|
17
|
-
import { default as v } from "./
|
|
18
|
-
import { default as E } from "./
|
|
19
|
-
import { default as J } from "./
|
|
20
|
-
import { default as L } from "./
|
|
17
|
+
import { default as v } from "./Switch/index.es.js";
|
|
18
|
+
import { default as E } from "./Table/index.es.js";
|
|
19
|
+
import { default as J } from "./Tabs/index.es.js";
|
|
20
|
+
import { default as L } from "./Tooltip/index.es.js";
|
|
21
|
+
import { default as O } from "./Typography/index.es.js";
|
|
21
22
|
/* empty css */
|
|
22
23
|
export {
|
|
23
24
|
a as Accordion,
|
|
@@ -26,18 +27,19 @@ export {
|
|
|
26
27
|
d as Button,
|
|
27
28
|
m as ButtonGroup,
|
|
28
29
|
n as Card,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
c as Drawer,
|
|
31
|
+
S as Form,
|
|
32
|
+
g as InputGroup,
|
|
33
|
+
h as Menu,
|
|
34
|
+
w as Modal,
|
|
35
|
+
G as Portal,
|
|
36
|
+
P as Progress,
|
|
36
37
|
C as Skeleton,
|
|
37
38
|
F as Spinner,
|
|
38
39
|
j as Stack,
|
|
39
|
-
v as
|
|
40
|
-
E as
|
|
41
|
-
J as
|
|
42
|
-
L as
|
|
40
|
+
v as Switch,
|
|
41
|
+
E as Table,
|
|
42
|
+
J as Tabs,
|
|
43
|
+
L as Tooltip,
|
|
44
|
+
O as Typography
|
|
43
45
|
};
|