reaxify 0.0.75 → 0.0.77
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/axios/AxiosProvider.cjs.js +1 -1
- package/dist/axios/AxiosProvider.es.js +14 -14
- package/dist/components/Accordion/index.cjs.js +1 -1
- package/dist/components/Accordion/index.d.ts +14 -7
- package/dist/components/Accordion/index.es.js +80 -70
- package/dist/components/Badge/index.cjs.js +1 -1
- package/dist/components/Badge/index.es.js +3 -3
- package/dist/components/Button/index.cjs.js +1 -1
- package/dist/components/Button/index.es.js +27 -27
- package/dist/components/ButtonGroup/index.cjs.js +1 -1
- package/dist/components/ButtonGroup/index.es.js +22 -22
- package/dist/components/Card/index.cjs.js +1 -1
- package/dist/components/Card/index.es.js +29 -29
- package/dist/components/Drawer/index.cjs.js +1 -1
- package/dist/components/Drawer/index.es.js +33 -33
- package/dist/components/InputGroup/index.cjs.js +1 -1
- package/dist/components/InputGroup/index.es.js +26 -26
- package/dist/components/Menu/index.cjs.js +1 -1
- package/dist/components/Menu/index.es.js +77 -77
- package/dist/components/Modal/index.cjs.js +1 -1
- package/dist/components/Modal/index.es.js +39 -39
- package/dist/components/Progress/index.cjs.js +1 -1
- package/dist/components/Progress/index.es.js +18 -18
- package/dist/components/Skeleton/index.cjs.js +1 -1
- package/dist/components/Skeleton/index.es.js +5 -5
- package/dist/components/Spacer/index.cjs.js +1 -1
- package/dist/components/Spacer/index.es.js +5 -5
- package/dist/components/Spinner/index.cjs.js +1 -1
- package/dist/components/Spinner/index.es.js +11 -11
- package/dist/components/Stack/index.cjs.js +1 -1
- package/dist/components/Stack/index.es.js +11 -11
- package/dist/components/Switch/index.cjs.js +1 -1
- package/dist/components/Switch/index.es.js +33 -33
- package/dist/components/Table/index.cjs.js +1 -1
- package/dist/components/Table/index.es.js +25 -25
- package/dist/components/Tabs/index.cjs.js +1 -1
- package/dist/components/Tabs/index.es.js +30 -30
- package/dist/components/Tooltip/index.cjs.js +1 -1
- package/dist/components/Tooltip/index.es.js +47 -47
- package/dist/components/Typography/index.cjs.js +1 -1
- package/dist/components/Typography/index.es.js +8 -8
- package/dist/helpers/index.cjs.js +1 -1
- package/dist/helpers/index.d.ts +0 -2
- package/dist/helpers/index.es.js +24 -28
- package/dist/hooks/index.cjs.js +1 -1
- package/dist/hooks/index.d.ts +0 -3
- package/dist/hooks/index.es.js +16 -22
- package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.cjs.js +1 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.es.js +1 -1
- package/dist/providers/ThemeProvider.cjs.js +1 -1
- package/dist/providers/ThemeProvider.es.js +4 -4
- package/dist/reaxify.css +1 -1
- package/package.json +15 -10
- package/dist/_virtual/jsx-runtime.cjs.js +0 -1
- package/dist/_virtual/jsx-runtime.cjs2.js +0 -1
- package/dist/_virtual/jsx-runtime.es.js +0 -6
- package/dist/_virtual/jsx-runtime.es2.js +0 -5
- package/dist/_virtual/react-jsx-runtime.development.cjs.js +0 -1
- package/dist/_virtual/react-jsx-runtime.development.es.js +0 -5
- package/dist/_virtual/react-jsx-runtime.production.cjs.js +0 -1
- package/dist/_virtual/react-jsx-runtime.production.es.js +0 -5
- package/dist/helpers/getByPath.cjs.js +0 -1
- package/dist/helpers/getByPath.d.ts +0 -1
- package/dist/helpers/getByPath.es.js +0 -7
- package/dist/helpers/matrixArray.cjs.js +0 -1
- package/dist/helpers/matrixArray.d.ts +0 -1
- package/dist/helpers/matrixArray.es.js +0 -11
- package/dist/hooks/useAutoFill.cjs.js +0 -1
- package/dist/hooks/useAutoFill.d.ts +0 -4
- package/dist/hooks/useAutoFill.es.js +0 -27
- package/dist/hooks/useMouse.cjs.js +0 -1
- package/dist/hooks/useMouse.d.ts +0 -1
- package/dist/hooks/useMouse.es.js +0 -19
- package/dist/hooks/useOutsideClick.cjs.js +0 -1
- package/dist/hooks/useOutsideClick.d.ts +0 -4
- package/dist/hooks/useOutsideClick.es.js +0 -18
- package/dist/node_modules/react/cjs/react-jsx-runtime.development.cjs.js +0 -14
- package/dist/node_modules/react/cjs/react-jsx-runtime.development.es.js +0 -248
- package/dist/node_modules/react/cjs/react-jsx-runtime.production.cjs.js +0 -9
- package/dist/node_modules/react/cjs/react-jsx-runtime.production.es.js +0 -36
- package/dist/node_modules/react/jsx-runtime.cjs.js +0 -1
- package/dist/node_modules/react/jsx-runtime.es.js +0 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("react/jsx-runtime"),f=require("react"),e=f.createContext({config:{},cancelDuplicatedRequests:!1,cancelOnUnmount:!1,beforeRequest:[],afterResponse:[],afterError:[],beforeRetry:[],retry:null});function x({config:t={},cancelDuplicatedRequests:r=!1,cancelOnUnmount:o=!1,beforeRetry:n=[],beforeRequest:s=[],afterResponse:u=[],afterError:l=[],retry:a=null,children:i}){return c.jsx(e.Provider,{value:{config:t,cancelDuplicatedRequests:r,cancelOnUnmount:o,beforeRequest:s,afterResponse:u,afterError:l,beforeRetry:n,retry:a},children:i})}exports.AxiosContext=e;exports.default=x;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { createContext as
|
|
4
|
-
const
|
|
2
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as c } from "react";
|
|
4
|
+
const i = c({
|
|
5
5
|
config: {},
|
|
6
6
|
cancelDuplicatedRequests: !1,
|
|
7
7
|
cancelOnUnmount: !1,
|
|
@@ -16,30 +16,30 @@ function p({
|
|
|
16
16
|
cancelDuplicatedRequests: r = !1,
|
|
17
17
|
cancelOnUnmount: t = !1,
|
|
18
18
|
beforeRetry: o = [],
|
|
19
|
-
beforeRequest:
|
|
20
|
-
afterResponse:
|
|
21
|
-
afterError:
|
|
22
|
-
retry:
|
|
19
|
+
beforeRequest: n = [],
|
|
20
|
+
afterResponse: s = [],
|
|
21
|
+
afterError: l = [],
|
|
22
|
+
retry: a = null,
|
|
23
23
|
children: f
|
|
24
24
|
}) {
|
|
25
|
-
return /* @__PURE__ */ u
|
|
26
|
-
|
|
25
|
+
return /* @__PURE__ */ u(
|
|
26
|
+
i.Provider,
|
|
27
27
|
{
|
|
28
28
|
value: {
|
|
29
29
|
config: e,
|
|
30
30
|
cancelDuplicatedRequests: r,
|
|
31
31
|
cancelOnUnmount: t,
|
|
32
|
-
beforeRequest:
|
|
33
|
-
afterResponse:
|
|
34
|
-
afterError:
|
|
32
|
+
beforeRequest: n,
|
|
33
|
+
afterResponse: s,
|
|
34
|
+
afterError: l,
|
|
35
35
|
beforeRetry: o,
|
|
36
|
-
retry:
|
|
36
|
+
retry: a
|
|
37
37
|
},
|
|
38
38
|
children: f
|
|
39
39
|
}
|
|
40
40
|
);
|
|
41
41
|
}
|
|
42
42
|
export {
|
|
43
|
-
|
|
43
|
+
i as AxiosContext,
|
|
44
44
|
p as default
|
|
45
45
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";const
|
|
1
|
+
"use client";"use strict";const u=require("react/jsx-runtime"),x=require("../../hooks/useClasses.cjs.js"),a=require("react"),C=require("../../node_modules/react-animate-height/dist/esm/index.cjs.js"),m=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js"),b=require("../../helpers/randomID.cjs.js"),p=require("../../node_modules/iconsax-react/dist/esm/ArrowDown2.cjs.js"),A=a.createContext({activeKey:null,handleChange:()=>{},variant:"single"}),f=a.createContext({active:!1,eventKey:null});function l({variant:n="single",activeKey:t=null,onChange:e=()=>{},children:o}){const r=s=>{if(n==="single")e(t===s?null:s);else{const c=Array.isArray(t)?t:[],d=c.includes(s)?c.filter(i=>i!==s):[...c,s];e(d)}};return u.jsx(A.Provider,{value:{activeKey:t,handleChange:r,variant:n},children:o})}function w({as:n,eventKey:t=null,className:e,children:o,...r}){const s=x(v=>v.accordion.item.base),{activeKey:c}=a.useContext(A),g=n||"div",d=a.useMemo(()=>b(),[]),i=t||d,h=a.useMemo(()=>Array.isArray(c)?c.includes(i):c===i,[c,i]);return u.jsx(g,{className:m.twMerge("block w-full border border-[#e8eaee] rounded",s,e),...r,children:u.jsx(f.Provider,{value:{eventKey:i,active:h},children:o})})}function j({type:n="button",className:t,children:e,onClick:o,...r}){const s=x(i=>i.accordion.toggle.base),{eventKey:c}=a.useContext(f),{handleChange:g}=a.useContext(A),d=i=>{c&&g(c),o==null||o(i)};return u.jsx("button",{type:n,className:m.twMerge("w-full flex items-center text-start text-base px-5 py-4 rounded-t cursor-pointer",s,t),onClick:d,...r,children:e})}function y({className:n,...t}){const e=x(r=>r.accordion.icon),{active:o}=a.useContext(f);return u.jsx(p,{color:"currentColor",className:m.twMerge("size-5 transition-transform",e==null?void 0:e.base,o?"-rotate-180":"rotate-0",o?e==null?void 0:e.active:e==null?void 0:e.inactive,n),...t})}function q({duration:n=300,children:t}){const{active:e}=a.useContext(f);return u.jsx(C,{duration:n,height:e?"auto":0,className:"w-full",animationStateClasses:{animating:"",animatingUp:"",animatingDown:"",static:"",animatingToHeightZero:"",animatingToHeightAuto:"",animatingToHeightSpecific:"",staticHeightZero:"",staticHeightAuto:"",staticHeightSpecific:""},children:t})}function I({className:n,children:t,...e}){const o=x(r=>r.accordion.body.base);return u.jsx("div",{className:m.twMerge("w-full block px-5 py-4 rounded-b",o,n),...e,children:t})}l.Item=w;l.Toggle=j;l.Icon=y;l.Collapse=q;l.Body=I;module.exports=l;
|
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
import { ChildrenProps, ComponentPropsWithAs } from '../../types';
|
|
2
2
|
import { ComponentProps, Dispatch, ElementType } from 'react';
|
|
3
3
|
type EventKey = string;
|
|
4
|
-
type
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
type AccordionSingleProps<T extends EventKey> = {
|
|
5
|
+
variant?: "single";
|
|
6
|
+
activeKey?: T | null;
|
|
7
|
+
onChange?: Dispatch<T | null>;
|
|
8
|
+
} & ChildrenProps;
|
|
9
|
+
type AccordionMultipleProps<T extends EventKey> = {
|
|
10
|
+
variant: "multiple";
|
|
11
|
+
activeKey?: T[];
|
|
12
|
+
onChange?: Dispatch<T[]>;
|
|
13
|
+
} & ChildrenProps;
|
|
14
|
+
type AccordionProps<T extends EventKey> = AccordionSingleProps<T> | AccordionMultipleProps<T>;
|
|
8
15
|
type AccordionItemProps = {
|
|
9
|
-
eventKey?:
|
|
16
|
+
eventKey?: EventKey | null;
|
|
10
17
|
};
|
|
11
18
|
type AccordionCollapseProps = {
|
|
12
19
|
duration?: number;
|
|
13
20
|
} & ChildrenProps;
|
|
14
|
-
declare function Accordion<T extends EventKey
|
|
21
|
+
declare function Accordion<T extends EventKey>({ variant, activeKey, onChange, children, }: AccordionProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
15
22
|
declare namespace Accordion {
|
|
16
23
|
var Item: typeof AccordionItem;
|
|
17
24
|
var Toggle: typeof AccordionToggle;
|
|
@@ -19,7 +26,7 @@ declare namespace Accordion {
|
|
|
19
26
|
var Collapse: typeof AccordionCollapse;
|
|
20
27
|
var Body: typeof AccordionBody;
|
|
21
28
|
}
|
|
22
|
-
declare function AccordionItem<E extends ElementType = "div">({ as, eventKey: initEventKey, className, children, ...props }: ComponentPropsWithAs<E, AccordionItemProps>): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
declare function AccordionItem<E extends ElementType = "div", T extends EventKey = string>({ as, eventKey: initEventKey, className, children, ...props }: ComponentPropsWithAs<E, AccordionItemProps>): import("react/jsx-runtime").JSX.Element;
|
|
23
30
|
declare function AccordionToggle({ type, className, children, onClick, ...props }: ComponentProps<"button">): import("react/jsx-runtime").JSX.Element;
|
|
24
31
|
declare function AccordionIcon({ className, ...props }: Omit<ComponentProps<"svg">, "ref" | "children">): import("react/jsx-runtime").JSX.Element;
|
|
25
32
|
declare function AccordionCollapse({ duration, children, }: AccordionCollapseProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,102 +1,112 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { twMerge as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
const
|
|
2
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
3
|
+
import f from "../../hooks/useClasses.es.js";
|
|
4
|
+
import { createContext as v, useContext as u, useMemo as h } from "react";
|
|
5
|
+
import C from "../../node_modules/react-animate-height/dist/esm/index.es.js";
|
|
6
|
+
import { twMerge as g } from "../../node_modules/tailwind-merge/dist/bundle-mjs.es.js";
|
|
7
|
+
import w from "../../helpers/randomID.es.js";
|
|
8
|
+
import y from "../../node_modules/iconsax-react/dist/esm/ArrowDown2.es.js";
|
|
9
|
+
const p = v({
|
|
10
10
|
activeKey: null,
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
11
|
+
handleChange: () => {
|
|
12
|
+
},
|
|
13
|
+
variant: "single"
|
|
14
|
+
}), A = v({
|
|
14
15
|
active: !1,
|
|
15
16
|
eventKey: null
|
|
16
17
|
});
|
|
17
|
-
function
|
|
18
|
+
function d({
|
|
19
|
+
variant: e = "single",
|
|
18
20
|
activeKey: o = null,
|
|
19
|
-
onChange:
|
|
21
|
+
onChange: t = () => {
|
|
20
22
|
},
|
|
21
|
-
children:
|
|
23
|
+
children: n
|
|
22
24
|
}) {
|
|
23
|
-
|
|
25
|
+
const c = (a) => {
|
|
26
|
+
if (e === "single")
|
|
27
|
+
t(o === a ? null : a);
|
|
28
|
+
else {
|
|
29
|
+
const i = Array.isArray(o) ? o : [], l = i.includes(a) ? i.filter((r) => r !== a) : [...i, a];
|
|
30
|
+
t(l);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
return /* @__PURE__ */ s(p.Provider, { value: { activeKey: o, handleChange: c, variant: e }, children: n });
|
|
24
34
|
}
|
|
25
|
-
function
|
|
26
|
-
as:
|
|
27
|
-
eventKey:
|
|
35
|
+
function H({
|
|
36
|
+
as: e,
|
|
37
|
+
eventKey: o = null,
|
|
28
38
|
className: t,
|
|
29
39
|
children: n,
|
|
30
|
-
...
|
|
40
|
+
...c
|
|
31
41
|
}) {
|
|
32
|
-
const
|
|
33
|
-
return /* @__PURE__ */
|
|
34
|
-
|
|
42
|
+
const a = f((x) => x.accordion.item.base), { activeKey: i } = u(p), m = e || "div", l = h(() => w(), []), r = o || l, b = h(() => Array.isArray(i) ? i.includes(r) : i === r, [i, r]);
|
|
43
|
+
return /* @__PURE__ */ s(
|
|
44
|
+
m,
|
|
35
45
|
{
|
|
36
|
-
className:
|
|
46
|
+
className: g(
|
|
37
47
|
"block w-full border border-[#e8eaee] rounded",
|
|
38
|
-
|
|
48
|
+
a,
|
|
39
49
|
t
|
|
40
50
|
),
|
|
41
|
-
...
|
|
42
|
-
children: /* @__PURE__ */
|
|
51
|
+
...c,
|
|
52
|
+
children: /* @__PURE__ */ s(A.Provider, { value: { eventKey: r, active: b }, children: n })
|
|
43
53
|
}
|
|
44
54
|
);
|
|
45
55
|
}
|
|
46
|
-
function
|
|
47
|
-
type:
|
|
48
|
-
className:
|
|
56
|
+
function I({
|
|
57
|
+
type: e = "button",
|
|
58
|
+
className: o,
|
|
49
59
|
children: t,
|
|
50
60
|
onClick: n,
|
|
51
|
-
...
|
|
61
|
+
...c
|
|
52
62
|
}) {
|
|
53
|
-
const
|
|
54
|
-
|
|
63
|
+
const a = f((r) => r.accordion.toggle.base), { eventKey: i } = u(A), { handleChange: m } = u(p), l = (r) => {
|
|
64
|
+
i && m(i), n == null || n(r);
|
|
55
65
|
};
|
|
56
|
-
return /* @__PURE__ */
|
|
66
|
+
return /* @__PURE__ */ s(
|
|
57
67
|
"button",
|
|
58
68
|
{
|
|
59
|
-
type:
|
|
60
|
-
className:
|
|
69
|
+
type: e,
|
|
70
|
+
className: g(
|
|
61
71
|
"w-full flex items-center text-start text-base px-5 py-4 rounded-t cursor-pointer",
|
|
62
|
-
|
|
63
|
-
|
|
72
|
+
a,
|
|
73
|
+
o
|
|
64
74
|
),
|
|
65
|
-
onClick:
|
|
66
|
-
...
|
|
75
|
+
onClick: l,
|
|
76
|
+
...c,
|
|
67
77
|
children: t
|
|
68
78
|
}
|
|
69
79
|
);
|
|
70
80
|
}
|
|
71
|
-
function
|
|
72
|
-
className:
|
|
73
|
-
...
|
|
81
|
+
function N({
|
|
82
|
+
className: e,
|
|
83
|
+
...o
|
|
74
84
|
}) {
|
|
75
|
-
const t =
|
|
76
|
-
return /* @__PURE__ */
|
|
77
|
-
|
|
85
|
+
const t = f((c) => c.accordion.icon), { active: n } = u(A);
|
|
86
|
+
return /* @__PURE__ */ s(
|
|
87
|
+
y,
|
|
78
88
|
{
|
|
79
89
|
color: "currentColor",
|
|
80
|
-
className:
|
|
90
|
+
className: g(
|
|
81
91
|
"size-5 transition-transform",
|
|
82
92
|
t == null ? void 0 : t.base,
|
|
83
93
|
n ? "-rotate-180" : "rotate-0",
|
|
84
94
|
n ? t == null ? void 0 : t.active : t == null ? void 0 : t.inactive,
|
|
85
|
-
|
|
95
|
+
e
|
|
86
96
|
),
|
|
87
|
-
...
|
|
97
|
+
...o
|
|
88
98
|
}
|
|
89
99
|
);
|
|
90
100
|
}
|
|
91
|
-
function
|
|
92
|
-
duration:
|
|
93
|
-
children:
|
|
101
|
+
function T({
|
|
102
|
+
duration: e = 300,
|
|
103
|
+
children: o
|
|
94
104
|
}) {
|
|
95
|
-
const { active: t } =
|
|
96
|
-
return /* @__PURE__ */
|
|
97
|
-
|
|
105
|
+
const { active: t } = u(A);
|
|
106
|
+
return /* @__PURE__ */ s(
|
|
107
|
+
C,
|
|
98
108
|
{
|
|
99
|
-
duration:
|
|
109
|
+
duration: e,
|
|
100
110
|
height: t ? "auto" : 0,
|
|
101
111
|
className: "w-full",
|
|
102
112
|
animationStateClasses: {
|
|
@@ -111,34 +121,34 @@ function K({
|
|
|
111
121
|
staticHeightAuto: "",
|
|
112
122
|
staticHeightSpecific: ""
|
|
113
123
|
},
|
|
114
|
-
children:
|
|
124
|
+
children: o
|
|
115
125
|
}
|
|
116
126
|
);
|
|
117
127
|
}
|
|
118
|
-
function
|
|
119
|
-
className:
|
|
120
|
-
children:
|
|
128
|
+
function D({
|
|
129
|
+
className: e,
|
|
130
|
+
children: o,
|
|
121
131
|
...t
|
|
122
132
|
}) {
|
|
123
|
-
const n =
|
|
124
|
-
return /* @__PURE__ */
|
|
133
|
+
const n = f((c) => c.accordion.body.base);
|
|
134
|
+
return /* @__PURE__ */ s(
|
|
125
135
|
"div",
|
|
126
136
|
{
|
|
127
|
-
className:
|
|
137
|
+
className: g(
|
|
128
138
|
"w-full block px-5 py-4 rounded-b",
|
|
129
139
|
n,
|
|
130
|
-
|
|
140
|
+
e
|
|
131
141
|
),
|
|
132
142
|
...t,
|
|
133
|
-
children:
|
|
143
|
+
children: o
|
|
134
144
|
}
|
|
135
145
|
);
|
|
136
146
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
147
|
+
d.Item = H;
|
|
148
|
+
d.Toggle = I;
|
|
149
|
+
d.Icon = N;
|
|
150
|
+
d.Collapse = T;
|
|
151
|
+
d.Body = D;
|
|
142
152
|
export {
|
|
143
|
-
|
|
153
|
+
d as default
|
|
144
154
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";const w=require("
|
|
1
|
+
"use client";"use strict";const w=require("react/jsx-runtime"),a=require("../../helpers/cn.cjs.js"),h=require("../../hooks/useClasses.cjs.js"),u=require("react"),k=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js");function q({as:x,variant:i="solid",color:n=null,size:s="md",className:c,children:l,...p}){const e=h(r=>r.badge),m=x||"span",f=u.useMemo(()=>{var t,b,g;if(!n)return"border-transparent";const r={primary:{solid:"bg-primary text-white border-primary",outline:"bg-transparent text-primary border-primary",soft:"bg-primary/10 text-primary border-primary/10"},secondary:{solid:"bg-secondary text-white border-secondary",outline:"bg-transparent text-secondary border-secondary",soft:"bg-secondary/10 text-secondary border-secondary/10"},success:{solid:"bg-success text-white border-success",outline:"bg-transparent text-success border-success",soft:"bg-success/10 text-success border-success/10"},info:{solid:"bg-info text-white border-info",outline:"bg-transparent text-info border-info",soft:"bg-info/10 text-info border-info/10"},warning:{solid:"bg-warning text-white border-warning",outline:"bg-transparent text-warning border-warning",soft:"bg-warning/10 text-warning border-warning/10"},danger:{solid:"bg-danger text-white border-danger",outline:"bg-transparent text-danger border-danger",soft:"bg-danger/10 text-danger border-danger/10"},dark:{solid:"bg-dark text-white border-dark",outline:"bg-transparent text-dark border-dark",soft:"bg-dark/10 text-dark border-dark/10"},light:{solid:"bg-light text-dark border-light",outline:"bg-transparent text-dark border-light",soft:"bg-light/10 text-dark border-light/10"}},o=(t=r==null?void 0:r[n])==null?void 0:t[i],d=(g=(b=e==null?void 0:e.color)==null?void 0:b[n])==null?void 0:g[i];return[o,d]},[n,i,e==null?void 0:e.color]),y=u.useMemo(()=>{var o,d,t;if(!s)return null;const r={sm:a("text-xs py-0.5 px-1.5",(o=e==null?void 0:e.size)==null?void 0:o.sm),md:a("text-sm py-[0.1875rem] px-2",(d=e==null?void 0:e.size)==null?void 0:d.md),lg:a("text-base py-1 px-3",(t=e==null?void 0:e.size)==null?void 0:t.lg)};return r==null?void 0:r[s]},[s,e==null?void 0:e.size]);return w.jsx(m,{className:k.twMerge("inline-flex border border-[#e8eaee] items-center text-center font-medium align-middle whitespace-nowrap rounded",e==null?void 0:e.base,f,y,c),...p,children:l})}module.exports=q;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { jsx as w } from "react/jsx-runtime";
|
|
3
3
|
import s from "../../helpers/cn.es.js";
|
|
4
|
-
import { useMemo as x } from "react";
|
|
5
4
|
import h from "../../hooks/useClasses.es.js";
|
|
5
|
+
import { useMemo as x } from "react";
|
|
6
6
|
import { twMerge as k } from "../../node_modules/tailwind-merge/dist/bundle-mjs.es.js";
|
|
7
7
|
function B({
|
|
8
8
|
as: p,
|
|
@@ -69,7 +69,7 @@ function B({
|
|
|
69
69
|
};
|
|
70
70
|
return e == null ? void 0 : e[a];
|
|
71
71
|
}, [a, r == null ? void 0 : r.size]);
|
|
72
|
-
return /* @__PURE__ */ w
|
|
72
|
+
return /* @__PURE__ */ w(
|
|
73
73
|
c,
|
|
74
74
|
{
|
|
75
75
|
className: k(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";const
|
|
1
|
+
"use client";"use strict";const l=require("react/jsx-runtime"),r=require("react"),f=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js"),m=require("../../helpers/cn.cjs.js"),H=require("../../hooks/useClasses.cjs.js"),I=require("../../hooks/useCreateRipple.cjs.js"),J=require("../ButtonGroup/index.cjs.js"),K=require("../Drawer/index.cjs.js"),L=require("../Modal/index.cjs.js"),O=require("../Spinner/index.cjs.js");function Q({as:w,variant:y,color:u,size:h,loading:C,stopPropagation:v=!1,preventDefault:q=!1,closeModal:k=!1,closeDrawer:M=!1,className:j,onClick:b,children:z,disabled:R,...N}){const t=H(e=>e.button),n=r.useContext(J.ButtonGroupContext),D=r.useContext(L.ModalContext),$=r.useContext(K.DrawerContext),B=I(),G=w||"button",c=y??n.variant??"solid",i=r.useMemo(()=>u!==void 0?u:n.color!==void 0?n.color:"primary",[u,n.color]),a=h??n.size??"md",d=C??n.loading??!1,s=r.useMemo(()=>{var p,x,g;if(!i)return"border-transparent";const e={primary:{solid:"bg-primary text-white border-primary",outline:"bg-transparent text-primary border-primary",text:"bg-transparent text-primary border-transparent"},secondary:{solid:"bg-secondary text-white border-secondary",outline:"bg-transparent text-secondary border-secondary",text:"bg-transparent text-secondary border-transparent"},success:{solid:"bg-success text-white border-success",outline:"bg-transparent text-success border-success",text:"bg-transparent text-success border-transparent"},info:{solid:"bg-info text-white border-info",outline:"bg-transparent text-info border-info",text:"bg-transparent text-info border-transparent"},warning:{solid:"bg-warning text-white border-warning",outline:"bg-transparent text-warning border-warning",text:"bg-transparent text-warning border-transparent"},danger:{solid:"bg-danger text-white border-danger",outline:"bg-transparent text-danger border-danger",text:"bg-transparent text-danger border-transparent"},dark:{solid:"bg-dark text-white border-dark",outline:"bg-transparent text-dark border-dark",text:"bg-transparent text-dark border-transparent"},light:{solid:"bg-light text-dark border-light",outline:"bg-transparent text-dark border-light",text:"bg-transparent text-dark border-transparent"}},o=(x=(p=t==null?void 0:t.color)==null?void 0:p[i])==null?void 0:x[c],F=(g=e==null?void 0:e[i])==null?void 0:g[c];return f.twMerge(F,o)},[i,c,t==null?void 0:t.color]),P=r.useMemo(()=>s==null?void 0:s.split(" ").find(e=>e.startsWith("text-")),[s]),W=r.useMemo(()=>{var o;if(!a)return null;const e={sm:"text-base py-1 px-3.5",md:"text-base py-1.5 px-4",lg:"text-lg py-2 px-6"};return[e==null?void 0:e[a],(o=t==null?void 0:t.size)==null?void 0:o[a]]},[a,t==null?void 0:t.size]),A=r.useMemo(()=>{var e,o;return d?m("disabled:opacity-100 disabled:cursor-wait disabled:text-transparent",(e=t==null?void 0:t.loading)==null?void 0:e.active):m("disabled:opacity-75 disabled:cursor-not-allowed",(o=t==null?void 0:t.loading)==null?void 0:o.inactive)},[d,t==null?void 0:t.loading]),E=e=>{B(e),k&&D.onClose(),M&&$.onClose(),v&&e.stopPropagation(),q&&e.preventDefault(),b==null||b(e)};return l.jsxs(G,{className:f.twMerge("relative inline-block no-underline whitespace-nowrap font-medium text-center rounded border border-[#e8eaee] cursor-pointer transition-[box-shadow,opacity,color,background-color,border-color]",t==null?void 0:t.base,s,W,A,n.buttonClasses,j),onClick:E,disabled:R||d,...N,children:[z,d&&l.jsx("span",{className:"absolute inset-0 size-full flex items-center justify-center bg-transparent p-2",children:l.jsx(O,{size:a,color:null,className:P})}),l.jsx("span",{className:"ripple-group absolute size-full inset-0 overflow-hidden rounded-[inherit] pointer-events-none"})]})}module.exports=Q;
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { useContext as
|
|
2
|
+
import { jsxs as I, jsx as u } from "react/jsx-runtime";
|
|
3
|
+
import { useContext as c, useMemo as i } from "react";
|
|
4
4
|
import { twMerge as f } from "../../node_modules/tailwind-merge/dist/bundle-mjs.es.js";
|
|
5
5
|
import w from "../../helpers/cn.es.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { ButtonGroupContext as
|
|
9
|
-
import { DrawerContext as
|
|
10
|
-
import { ModalContext as
|
|
11
|
-
import
|
|
12
|
-
function
|
|
6
|
+
import J from "../../hooks/useClasses.es.js";
|
|
7
|
+
import K from "../../hooks/useCreateRipple.es.js";
|
|
8
|
+
import { ButtonGroupContext as L } from "../ButtonGroup/index.es.js";
|
|
9
|
+
import { DrawerContext as O } from "../Drawer/index.es.js";
|
|
10
|
+
import { ModalContext as Q } from "../Modal/index.es.js";
|
|
11
|
+
import T from "../Spinner/index.es.js";
|
|
12
|
+
function nt({
|
|
13
13
|
as: y,
|
|
14
14
|
variant: h,
|
|
15
|
-
color:
|
|
15
|
+
color: l,
|
|
16
16
|
size: v,
|
|
17
17
|
loading: C,
|
|
18
18
|
stopPropagation: k = !1,
|
|
19
|
-
preventDefault:
|
|
20
|
-
closeModal:
|
|
19
|
+
preventDefault: z = !1,
|
|
20
|
+
closeModal: N = !1,
|
|
21
21
|
closeDrawer: R = !1,
|
|
22
|
-
className:
|
|
23
|
-
onClick:
|
|
22
|
+
className: j,
|
|
23
|
+
onClick: p,
|
|
24
24
|
children: D,
|
|
25
25
|
disabled: M,
|
|
26
26
|
...B
|
|
27
27
|
}) {
|
|
28
|
-
const t =
|
|
29
|
-
var
|
|
28
|
+
const t = J((r) => r.button), e = c(L), G = c(Q), P = c(O), S = K(), W = y || "button", b = h ?? e.variant ?? "solid", s = i(() => l !== void 0 ? l : e.color !== void 0 ? e.color : "primary", [l, e.color]), o = v ?? e.size ?? "md", d = C ?? e.loading ?? !1, a = i(() => {
|
|
29
|
+
var g, x, m;
|
|
30
30
|
if (!s) return "border-transparent";
|
|
31
31
|
const r = {
|
|
32
32
|
primary: {
|
|
@@ -69,9 +69,9 @@ function et({
|
|
|
69
69
|
outline: "bg-transparent text-dark border-light",
|
|
70
70
|
text: "bg-transparent text-dark border-transparent"
|
|
71
71
|
}
|
|
72
|
-
}, n = (
|
|
72
|
+
}, n = (x = (g = t == null ? void 0 : t.color) == null ? void 0 : g[s]) == null ? void 0 : x[b], H = (m = r == null ? void 0 : r[s]) == null ? void 0 : m[b];
|
|
73
73
|
return f(H, n);
|
|
74
|
-
}, [s,
|
|
74
|
+
}, [s, b, t == null ? void 0 : t.color]), q = i(() => a == null ? void 0 : a.split(" ").find((r) => r.startsWith("text-")), [a]), A = i(() => {
|
|
75
75
|
var n;
|
|
76
76
|
if (!o) return null;
|
|
77
77
|
const r = {
|
|
@@ -80,7 +80,7 @@ function et({
|
|
|
80
80
|
lg: "text-lg py-2 px-6"
|
|
81
81
|
};
|
|
82
82
|
return [r == null ? void 0 : r[o], (n = t == null ? void 0 : t.size) == null ? void 0 : n[o]];
|
|
83
|
-
}, [o, t == null ? void 0 : t.size]),
|
|
83
|
+
}, [o, t == null ? void 0 : t.size]), E = i(() => {
|
|
84
84
|
var r, n;
|
|
85
85
|
return d ? w(
|
|
86
86
|
"disabled:opacity-100 disabled:cursor-wait disabled:text-transparent",
|
|
@@ -90,10 +90,10 @@ function et({
|
|
|
90
90
|
(n = t == null ? void 0 : t.loading) == null ? void 0 : n.inactive
|
|
91
91
|
);
|
|
92
92
|
}, [d, t == null ? void 0 : t.loading]), F = (r) => {
|
|
93
|
-
|
|
93
|
+
S(r), N && G.onClose(), R && P.onClose(), k && r.stopPropagation(), z && r.preventDefault(), p == null || p(r);
|
|
94
94
|
};
|
|
95
|
-
return /* @__PURE__ */
|
|
96
|
-
|
|
95
|
+
return /* @__PURE__ */ I(
|
|
96
|
+
W,
|
|
97
97
|
{
|
|
98
98
|
className: f(
|
|
99
99
|
"relative inline-block no-underline whitespace-nowrap font-medium text-center rounded border border-[#e8eaee] cursor-pointer transition-[box-shadow,opacity,color,background-color,border-color]",
|
|
@@ -104,22 +104,22 @@ function et({
|
|
|
104
104
|
// color ? "ring-2 ring-offset-2 ring-transparent" : null,
|
|
105
105
|
t == null ? void 0 : t.base,
|
|
106
106
|
a,
|
|
107
|
-
q,
|
|
108
107
|
A,
|
|
108
|
+
E,
|
|
109
109
|
e.buttonClasses,
|
|
110
|
-
|
|
110
|
+
j
|
|
111
111
|
),
|
|
112
112
|
onClick: F,
|
|
113
113
|
disabled: M || d,
|
|
114
114
|
...B,
|
|
115
115
|
children: [
|
|
116
116
|
D,
|
|
117
|
-
d && /* @__PURE__ */
|
|
118
|
-
/* @__PURE__ */
|
|
117
|
+
d && /* @__PURE__ */ u("span", { className: "absolute inset-0 size-full flex items-center justify-center bg-transparent p-2", children: /* @__PURE__ */ u(T, { size: o, color: null, className: q }) }),
|
|
118
|
+
/* @__PURE__ */ u("span", { className: "ripple-group absolute size-full inset-0 overflow-hidden rounded-[inherit] pointer-events-none" })
|
|
119
119
|
]
|
|
120
120
|
}
|
|
121
121
|
);
|
|
122
122
|
}
|
|
123
123
|
export {
|
|
124
|
-
|
|
124
|
+
nt as default
|
|
125
125
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("react/jsx-runtime"),M=require("../../helpers/cn.cjs.js"),h=require("../../hooks/useClasses.cjs.js"),r=require("react"),G=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js"),R=require("../Tabs/index.cjs.js"),c=r.createContext({});function g({as:d,variant:l,color:a,size:f,loading:x,orientation:e="horizontal",className:b,children:p,...C}){const m=d||"div",t=h(o=>o.buttonGroup),{buttonGroupClasses:v}=r.useContext(R.TabsContext),j=r.useMemo(()=>{var n;return[{horizontal:"flex-row",vertical:"flex-col"}[e],(n=t==null?void 0:t.orientation)==null?void 0:n[e]]},[e,t==null?void 0:t.orientation]),q=r.useMemo(()=>{var u,s;const o={horizontal:"rounded-none first-of-type:rounded-s last-of-type:rounded-e",vertical:"rounded-none first-of-type:rounded-t last-of-type:rounded-b"},n=(s=(u=t==null?void 0:t.button)==null?void 0:u.orientation)==null?void 0:s[e],y=o[e];return M(y,n)},[e,t==null?void 0:t.button]);return i.jsx(m,{className:G.twMerge("w-fit flex items-stretch justify-center",t==null?void 0:t.base,j,v,b),...C,children:i.jsx(c.Provider,{value:{variant:l,color:a,size:f,loading:x,buttonClasses:q},children:p})})}exports.ButtonGroupContext=c;exports.default=g;
|
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import z from "
|
|
6
|
-
import { twMerge as
|
|
7
|
-
import { TabsContext as
|
|
8
|
-
const
|
|
9
|
-
function
|
|
2
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
3
|
+
import G from "../../helpers/cn.es.js";
|
|
4
|
+
import w from "../../hooks/useClasses.es.js";
|
|
5
|
+
import { createContext as z, useContext as j, useMemo as s } from "react";
|
|
6
|
+
import { twMerge as B } from "../../node_modules/tailwind-merge/dist/bundle-mjs.es.js";
|
|
7
|
+
import { TabsContext as M } from "../Tabs/index.es.js";
|
|
8
|
+
const R = z({});
|
|
9
|
+
function A({
|
|
10
10
|
as: f,
|
|
11
|
-
variant:
|
|
12
|
-
color:
|
|
13
|
-
size:
|
|
11
|
+
variant: d,
|
|
12
|
+
color: m,
|
|
13
|
+
size: p,
|
|
14
14
|
loading: a,
|
|
15
15
|
orientation: o = "horizontal",
|
|
16
16
|
className: l,
|
|
17
17
|
children: c,
|
|
18
18
|
...x
|
|
19
19
|
}) {
|
|
20
|
-
const C = f || "div", t =
|
|
20
|
+
const C = f || "div", t = w((n) => n.buttonGroup), { buttonGroupClasses: b } = j(M), h = s(() => {
|
|
21
21
|
var e;
|
|
22
22
|
return [{
|
|
23
23
|
horizontal: "flex-row",
|
|
24
24
|
vertical: "flex-col"
|
|
25
25
|
}[o], (e = t == null ? void 0 : t.orientation) == null ? void 0 : e[o]];
|
|
26
|
-
}, [o, t == null ? void 0 : t.orientation]),
|
|
26
|
+
}, [o, t == null ? void 0 : t.orientation]), v = s(() => {
|
|
27
27
|
var r, u;
|
|
28
28
|
const n = {
|
|
29
29
|
horizontal: "rounded-none first-of-type:rounded-s last-of-type:rounded-e",
|
|
30
30
|
vertical: "rounded-none first-of-type:rounded-t last-of-type:rounded-b"
|
|
31
|
-
}, e = (u = (r = t == null ? void 0 : t.button) == null ? void 0 : r.orientation) == null ? void 0 : u[o],
|
|
32
|
-
return y
|
|
31
|
+
}, e = (u = (r = t == null ? void 0 : t.button) == null ? void 0 : r.orientation) == null ? void 0 : u[o], y = n[o];
|
|
32
|
+
return G(y, e);
|
|
33
33
|
}, [o, t == null ? void 0 : t.button]);
|
|
34
|
-
return /* @__PURE__ */ i
|
|
34
|
+
return /* @__PURE__ */ i(
|
|
35
35
|
C,
|
|
36
36
|
{
|
|
37
|
-
className:
|
|
37
|
+
className: B(
|
|
38
38
|
"w-fit flex items-stretch justify-center",
|
|
39
39
|
t == null ? void 0 : t.base,
|
|
40
40
|
h,
|
|
@@ -42,10 +42,10 @@ function q({
|
|
|
42
42
|
l
|
|
43
43
|
),
|
|
44
44
|
...x,
|
|
45
|
-
children: /* @__PURE__ */ i
|
|
46
|
-
|
|
45
|
+
children: /* @__PURE__ */ i(
|
|
46
|
+
R.Provider,
|
|
47
47
|
{
|
|
48
|
-
value: { variant:
|
|
48
|
+
value: { variant: d, color: m, size: p, loading: a, buttonClasses: v },
|
|
49
49
|
children: c
|
|
50
50
|
}
|
|
51
51
|
)
|
|
@@ -53,6 +53,6 @@ function q({
|
|
|
53
53
|
);
|
|
54
54
|
}
|
|
55
55
|
export {
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
R as ButtonGroupContext,
|
|
57
|
+
A as default
|
|
58
58
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";const
|
|
1
|
+
"use client";"use strict";const t=require("react/jsx-runtime"),c=require("../../hooks/useClasses.cjs.js");require("react");const d=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js");function n({as:e,className:s,children:r,...a}){const o=c(l=>l.card.base),u=e||"div";return t.jsx(u,{className:d.twMerge("block w-full bg-white rounded shadow",o,s),...a,children:r})}function i({className:e,children:s,...r}){const a=c(o=>o.card.header.base);return t.jsx("div",{className:d.twMerge("w-full border-b border-[#e8eaee] p-4",a,e),...r,children:s})}function b({className:e,children:s,...r}){const a=c(o=>o.card.body.base);return t.jsx("div",{className:d.twMerge("w-full p-4",a,e),...r,children:s})}function w({className:e,children:s,...r}){const a=c(o=>o.card.footer.base);return t.jsx("div",{className:d.twMerge("w-full border-t border-[#e8eaee] p-4",a,e),...r,children:s})}n.Header=i;n.Body=b;n.Footer=w;module.exports=n;
|