@mci-ui/mci-ui 0.0.6 → 0.0.7
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/README.md +3 -71
- package/dist/index.cjs +7 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -8
- package/dist/index.js.map +1 -1
- package/package.json +10 -3
- package/src/index.ts +13 -32
- package/src/styles/index.css +293 -1
- package/dist/index.css +0 -36
- package/dist/tailwind-config.css +0 -294
- package/src/styles/tailwind-config.css +0 -294
package/README.md
CHANGED
|
@@ -1,73 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
## O'rnatish
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Currently, two official plugins are available:
|
|
6
|
-
|
|
7
|
-
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh
|
|
8
|
-
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
|
9
|
-
|
|
10
|
-
## React Compiler
|
|
11
|
-
|
|
12
|
-
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
|
|
13
|
-
|
|
14
|
-
## Expanding the ESLint configuration
|
|
15
|
-
|
|
16
|
-
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
|
|
17
|
-
|
|
18
|
-
```js
|
|
19
|
-
export default defineConfig([
|
|
20
|
-
globalIgnores(['dist']),
|
|
21
|
-
{
|
|
22
|
-
files: ['**/*.{ts,tsx}'],
|
|
23
|
-
extends: [
|
|
24
|
-
// Other configs...
|
|
25
|
-
|
|
26
|
-
// Remove tseslint.configs.recommended and replace with this
|
|
27
|
-
tseslint.configs.recommendedTypeChecked,
|
|
28
|
-
// Alternatively, use this for stricter rules
|
|
29
|
-
tseslint.configs.strictTypeChecked,
|
|
30
|
-
// Optionally, add this for stylistic rules
|
|
31
|
-
tseslint.configs.stylisticTypeChecked,
|
|
32
|
-
|
|
33
|
-
// Other configs...
|
|
34
|
-
],
|
|
35
|
-
languageOptions: {
|
|
36
|
-
parserOptions: {
|
|
37
|
-
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
38
|
-
tsconfigRootDir: import.meta.dirname,
|
|
39
|
-
},
|
|
40
|
-
// other options...
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
])
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
|
|
47
|
-
|
|
48
|
-
```js
|
|
49
|
-
// eslint.config.js
|
|
50
|
-
import reactX from 'eslint-plugin-react-x'
|
|
51
|
-
import reactDom from 'eslint-plugin-react-dom'
|
|
52
|
-
|
|
53
|
-
export default defineConfig([
|
|
54
|
-
globalIgnores(['dist']),
|
|
55
|
-
{
|
|
56
|
-
files: ['**/*.{ts,tsx}'],
|
|
57
|
-
extends: [
|
|
58
|
-
// Other configs...
|
|
59
|
-
// Enable lint rules for React
|
|
60
|
-
reactX.configs['recommended-typescript'],
|
|
61
|
-
// Enable lint rules for React DOM
|
|
62
|
-
reactDom.configs.recommended,
|
|
63
|
-
],
|
|
64
|
-
languageOptions: {
|
|
65
|
-
parserOptions: {
|
|
66
|
-
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
67
|
-
tsconfigRootDir: import.meta.dirname,
|
|
68
|
-
},
|
|
69
|
-
// other options...
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
])
|
|
3
|
+
```bash
|
|
4
|
+
npm install @mci-ui/mci-ui
|
|
73
5
|
```
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
"use strict";var Y=Object.defineProperty;var
|
|
2
|
-
`);var he=require("lucide-react");var be=require("clsx"),ge=require("tailwind-merge");function o(...t){return(0,ge.twMerge)((0,be.clsx)(t))}function ye(t){return{handleEscape:a=>{a.key==="Escape"&&t()}}}function xe(t,r){return{handleClick:e=>{t.current&&!t.current.contains(e.target)&&r()}}}var _=require("react/jsx-runtime");function ee({items:t,className:r,separatorIcon:a=(0,_.jsx)(he.ChevronRight,{className:"w-4 h-4 text-gray-400 dark:text-gray-500"})}){return(0,_.jsx)("nav",{className:o("flex items-center space-x-2 text-sm font-medium text-gray-600 dark:text-gray-300",r),"aria-label":"Breadcrumb",children:t.map((e,n)=>{let s=n===t.length-1;return(0,_.jsxs)("div",{className:"flex items-center",children:[e.href?(0,_.jsx)("a",{href:e.href,onClick:e.onClick,className:o("hover:text-primary-600 dark:hover:text-primary-400 transition-colors",s&&"text-primary-600 dark:text-primary-400"),children:e.label}):(0,_.jsx)("span",{className:o(s?"text-primary-600 dark:text-primary-400":"text-gray-500 dark:text-gray-400"),children:e.label}),!s&&(0,_.jsx)("span",{className:"mx-2 flex items-center",children:a})]},n)})})}var q=require("lucide-react");var S=require("react/jsx-runtime");function te({text:t,icon:r,iconPosition:a="left",size:e="md",variant:n="accent",loading:s=!1,disabled:c=!1,onClick:l,className:d}){let x={sm:"h-[38px] px-3 text-sm gap-2",md:"h-[48px] px-4 text-base gap-2.5",lg:"h-[56px] px-5 text-lg gap-3"};return(0,S.jsxs)("button",{onClick:l,disabled:c||s,className:o("inline-flex items-center justify-center rounded-[7px] font-medium","transition-all duration-300 ease-in-out","transform hover:-translate-y-0.5","disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:translate-y-0 disabled:hover:shadow-none","focus:outline-none focus:ring-2 focus:ring-offset-2",n==="primary"&&"focus:ring-secondary-500",n==="secondary"&&"focus:ring-secondary-400",n==="accent"&&"focus:ring-accent-500",{primary:`
|
|
1
|
+
"use strict";var Y=Object.defineProperty;var _e=Object.getOwnPropertyDescriptor;var Le=Object.getOwnPropertyNames;var Ae=Object.prototype.hasOwnProperty;var Fe=(e,t)=>{for(var o in t)Y(e,o,{get:t[o],enumerable:!0})},Be=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Le(t))!Ae.call(e,n)&&n!==o&&Y(e,n,{get:()=>t[n],enumerable:!(a=_e(t,n))||a.enumerable});return e};var De=e=>Be(Y({},"__esModule",{value:!0}),e);var ze={};Fe(ze,{Breadcrumb:()=>Z,Button:()=>ee,Collapse:()=>te,InputMain:()=>ae,MciTable:()=>oe,Modal:()=>se,Pagination:()=>ne,Skeleton:()=>$,TabPanel:()=>Ne,Tabs:()=>ie,Tag:()=>ce,Textarea:()=>de,ToastContainer:()=>Ce,Tooltip:()=>me});module.exports=De(ze);var xe=require("lucide-react");var pe=require("clsx"),be=require("tailwind-merge");function r(...e){return(0,be.twMerge)((0,pe.clsx)(e))}function ge(e){return{handleEscape:o=>{o.key==="Escape"&&e()}}}function ye(e,t){return{handleClick:a=>{e.current&&!e.current.contains(a.target)&&t()}}}var _=require("react/jsx-runtime");function Z({items:e,className:t,separatorIcon:o=(0,_.jsx)(xe.ChevronRight,{className:"w-4 h-4 text-gray-400 dark:text-gray-500"})}){return(0,_.jsx)("nav",{className:r("flex items-center space-x-2 text-sm font-medium text-gray-600 dark:text-gray-300",t),"aria-label":"Breadcrumb",children:e.map((a,n)=>{let s=n===e.length-1;return(0,_.jsxs)("div",{className:"flex items-center",children:[a.href?(0,_.jsx)("a",{href:a.href,onClick:a.onClick,className:r("hover:text-primary-600 dark:hover:text-primary-400 transition-colors",s&&"text-primary-600 dark:text-primary-400"),children:a.label}):(0,_.jsx)("span",{className:r(s?"text-primary-600 dark:text-primary-400":"text-gray-500 dark:text-gray-400"),children:a.label}),!s&&(0,_.jsx)("span",{className:"mx-2 flex items-center",children:o})]},n)})})}var q=require("lucide-react");var S=require("react/jsx-runtime");function ee({text:e,icon:t,iconPosition:o="left",size:a="md",variant:n="accent",loading:s=!1,disabled:c=!1,onClick:l,className:d}){let x={sm:"h-[38px] px-3 text-sm gap-2",md:"h-[48px] px-4 text-base gap-2.5",lg:"h-[56px] px-5 text-lg gap-3"};return(0,S.jsxs)("button",{onClick:l,disabled:c||s,className:r("inline-flex items-center justify-center rounded-[7px] font-medium","transition-all duration-300 ease-in-out","transform hover:-translate-y-0.5","disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:translate-y-0 disabled:hover:shadow-none","focus:outline-none focus:ring-2 focus:ring-offset-2",n==="primary"&&"focus:ring-secondary-500",n==="secondary"&&"focus:ring-secondary-400",n==="accent"&&"focus:ring-accent-500",{primary:`
|
|
3
2
|
bg-secondary-500
|
|
4
3
|
hover:bg-secondary-600
|
|
5
4
|
active:bg-secondary-700
|
|
@@ -25,7 +24,7 @@
|
|
|
25
24
|
hover:shadow-accent-500/30
|
|
26
25
|
active:scale-[0.98]
|
|
27
26
|
text-white
|
|
28
|
-
`}[n],x[
|
|
27
|
+
`}[n],x[a],d),children:[t&&o==="left"&&(0,S.jsx)("span",{className:"flex items-center justify-center transition-transform duration-300 ease-in-out group-hover:scale-110",children:s?(0,S.jsx)(q.Loader,{className:"animate-spin",size:20}):t}),e&&(0,S.jsx)("span",{className:"transition-all duration-300",children:e}),t&&o==="right"&&(0,S.jsx)("span",{className:"flex items-center justify-center transition-transform duration-300 ease-in-out group-hover:scale-110",children:s?(0,S.jsx)(q.Loader,{className:"animate-spin",size:20}):t}),s&&(0,S.jsx)(q.Loader,{className:"animate-spin",size:20})]})}var ve=require("lucide-react"),H=require("react");var E=require("react/jsx-runtime");function te({title:e,children:t,defaultOpen:o=!1,icon:a,variant:n="primary",className:s,titleClassName:c,contentClassName:l}){let[d,x]=(0,H.useState)(o),[g,h]=(0,H.useState)(0),y=(0,H.useRef)(null);(0,H.useEffect)(()=>{y.current&&h(d?y.current.scrollHeight:0)},[d]);let i={primary:{title:"bg-secondary-50 hover:bg-secondary-100 border-secondary-200 text-secondary-800",content:"bg-secondary-25 border-secondary-100"},secondary:{title:"bg-accent-50 hover:bg-accent-100 border-accent-200 text-accent-800",content:"bg-accent-25 border-accent-100"},accent:{title:"bg-gray-50 hover:bg-gray-100 border-gray-200 text-gray-800",content:"bg-gray-25 border-gray-100"}}[n];return(0,E.jsxs)("div",{className:r("border rounded-lg overflow-hidden",s),children:[(0,E.jsxs)("button",{onClick:()=>x(!d),className:r("w-full flex items-center justify-between p-4 transition-all duration-300","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-blue-500","border-b",i.title),children:[(0,E.jsxs)("div",{className:"flex items-center gap-3",children:[a&&(0,E.jsx)("span",{className:"flex-shrink-0",children:a}),(0,E.jsx)("span",{className:r("font-medium text-left",c),children:e})]}),(0,E.jsx)(ve.ChevronDownIcon,{className:r("w-5 h-5 transition-transform duration-300 flex-shrink-0",d&&"rotate-180")})]}),(0,E.jsx)("div",{className:r("transition-all duration-300 ease-out overflow-hidden",i.content),style:{height:`${g}px`},children:(0,E.jsx)("div",{ref:y,className:r("p-4",l),children:t})})]})}var G=require("lucide-react"),L=require("react");var w=require("react/jsx-runtime");function ae({label:e,placeholder:t,type:o="text",icon:a,iconPosition:n="left",size:s="md",error:c,success:l,disabled:d=!1,required:x=!1,value:g,onChange:h,onFocus:y,onBlur:u,className:i}){let[m,b]=(0,L.useState)(!1),[N,f]=(0,L.useState)(""),[k,M]=(0,L.useState)(!1),[B,O]=(0,L.useState)(!1),U=g??N,ue=!!U||B,fe=o==="password",Re=()=>{b(!0),y==null||y()},Pe=()=>{b(!1),u==null||u()},Me=D=>{g===void 0&&f(D.target.value),h==null||h(D)},Ee=()=>M(D=>!D),R=(0,L.useMemo)(()=>({sm:{input:"h-[38px] text-sm",padding:a?n==="left"?"pl-10 pr-3":"pl-3 pr-10":"px-3",icon:"w-4 h-4",iconWrapper:n==="left"?"left-3":"right-3",labelFont:"text-xs"},md:{input:"h-[48px] text-base",padding:a?n==="left"?"pl-12 pr-4":"pl-4 pr-12":"px-4",icon:"w-5 h-5",iconWrapper:n==="left"?"left-3.5":"right-3.5",labelFont:"text-sm"},lg:{input:"h-[56px] text-lg",padding:a?n==="left"?"pl-14 pr-5":"pl-5 pr-14":"px-5",icon:"w-6 h-6",iconWrapper:n==="left"?"left-4":"right-4",labelFont:"text-base"}}),[a,n]),Ie=(0,L.useMemo)(()=>c?"border-error-500 focus:border-error-600 focus:ring-error-500/20":l?"border-success-500 focus:border-success-600 focus:ring-success-500/20":"border-gray-300 hover:border-gray-400 focus:border-accent-500 focus:ring-accent-500/20",[c,l]),Se=D=>{D.animationName==="onAutoFillStart"?O(!0):D.animationName==="onAutoFillCancel"&&O(!1)};return(0,w.jsxs)("div",{className:r("w-full",i),children:[(0,w.jsxs)("div",{className:"relative flex items-center",children:[(0,w.jsx)("input",{type:fe&&k?"text":o,value:U,onChange:Me,onFocus:Re,onBlur:Pe,onAnimationStart:Se,disabled:d,placeholder:e?"":t,required:x,className:r("w-full rounded-[7px] border bg-white font-medium outline-none transition-all duration-300 ease-in-out","focus:ring-4 disabled:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-60 autofill:shadow-[inset_0_0_0px_1000px_white]",R[s].input,R[s].padding,Ie),autoComplete:"on"}),e&&(0,w.jsxs)("label",{className:r("absolute pointer-events-none transition-all duration-300 ease-in-out font-medium",a&&n==="left"&&!ue&&!m?R[s].padding:"left-4",m||ue?r("top-0 -translate-y-1/2 bg-white px-2",R[s].labelFont,c?"text-error-600":l?"text-success-600":"text-accent-600"):r("top-1/2 -translate-y-1/2 text-gray-500",R[s].input.includes("38")&&"text-sm",R[s].input.includes("48")&&"text-base",R[s].input.includes("56")&&"text-lg")),children:[e,x&&(0,w.jsx)("span",{className:"text-error-500 ml-1",children:"*"})]}),a&&(0,w.jsx)("div",{className:r("absolute top-1/2 -translate-y-1/2 flex items-center transition-all duration-300",R[s].iconWrapper,c?"text-error-500":l?"text-success-500":m?"text-accent-500":"text-gray-400"),children:(0,w.jsx)("span",{className:r(R[s].icon,"mr-2"),children:a})}),fe&&(0,w.jsx)("button",{type:"button",onClick:Ee,className:r("absolute top-1/2 -translate-y-1/2 flex items-center justify-center text-gray-400 hover:text-gray-600 transition-all","right-3"),children:k?(0,w.jsx)(G.EyeOff,{className:r(R[s].icon)}):(0,w.jsx)(G.Eye,{className:r(R[s].icon)})})]}),c&&(0,w.jsx)("p",{className:"mt-1.5 text-sm text-error-600 flex items-center gap-1 animate-[slideDown_0.3s_ease-out]",children:c}),l&&!c&&(0,w.jsx)("p",{className:"mt-1.5 text-sm text-success-600 flex items-center gap-1 animate-[slideDown_0.3s_ease-out]",children:l}),(0,w.jsx)("style",{children:`
|
|
29
28
|
input {
|
|
30
29
|
animation-name: onAutoFillCancel;
|
|
31
30
|
}
|
|
@@ -34,11 +33,11 @@
|
|
|
34
33
|
}
|
|
35
34
|
@keyframes onAutoFillStart {}
|
|
36
35
|
@keyframes onAutoFillCancel {}
|
|
37
|
-
`})]})}var A=require("lucide-react"),J=require("react");var
|
|
36
|
+
`})]})}var A=require("lucide-react"),J=require("react");var re=require("react/jsx-runtime");function $({className:e,variant:t="default",width:o="100%",height:a="1rem"}){return(0,re.jsx)("div",{className:r("relative overflow-hidden bg-secondary-200 dark:bg-secondary-800","rounded-sm",t==="circle"&&"rounded-full",t==="rounded"&&"rounded-md",e),style:{width:typeof o=="number"?`${o}px`:o,height:typeof a=="number"?`${a}px`:a},children:(0,re.jsx)("div",{className:"absolute inset-0 shimmer-mask"})})}var p=require("react/jsx-runtime");function oe({columns:e,data:t,loading:o=!1,variant:a="clean",skeletonRows:n=5,actions:s,noDataText:c}){let[l,d]=(0,J.useState)(null),x=(0,J.useMemo)(()=>!l||!l.direction?t:[...t].sort((i,m)=>{let b=i[l.key],N=m[l.key];return b<N?l.direction==="asc"?-1:1:b>N?l.direction==="asc"?1:-1:0}),[t,l]),g=i=>{i.sortable&&d(m=>!m||m.key!==i.key?{key:i.key,direction:"asc"}:m.direction==="asc"?{key:i.key,direction:"desc"}:m.direction==="desc"?{key:i.key,direction:null}:null)},h=i=>i.sortable?!l||l.key!==i.key||!l.direction?(0,p.jsx)(A.ArrowUpDown,{size:15,className:"opacity-40"}):l.direction==="asc"?(0,p.jsx)(A.ChevronUp,{size:15}):(0,p.jsx)(A.ChevronDown,{size:15}):null,y=r("w-full border-separate border-spacing-0 transition-all duration-300",a==="clean"&&"bg-white",a==="elevated"&&"bg-white shadow-lg",a==="bordered"&&"border border-secondary-200 rounded-lg"),u=i=>r("bg-secondary-50 text-secondary-800 text-sm font-semibold py-3 px-4 select-none","border-b border-secondary-200 transition-colors",i.align==="center"&&"text-center",i.align==="right"&&"text-right",i.sortable&&"cursor-pointer hover:bg-secondary-100/70");return(0,p.jsxs)("div",{className:"w-full space-y-3",children:[s&&(0,p.jsx)("div",{className:"flex justify-between items-center mb-2",children:s}),(0,p.jsx)("div",{className:"w-full overflow-x-auto rounded-lg",children:(0,p.jsxs)("table",{className:y,children:[(0,p.jsx)("thead",{children:(0,p.jsx)("tr",{children:e.map((i,m)=>(0,p.jsx)("th",{onClick:()=>g(i),className:r(u(i),m===0&&"rounded-tl-lg",m===e.length-1&&"rounded-tr-lg"),style:{width:i.width},children:(0,p.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,p.jsx)("span",{className:"truncate",children:i.title}),h(i)]})},String(i.key)))})}),(0,p.jsx)("tbody",{children:o?Array.from({length:n}).map((i,m)=>(0,p.jsx)("tr",{children:e.map((b,N)=>(0,p.jsx)("td",{className:"px-4 py-3",children:(0,p.jsx)($,{height:18,variant:"rounded"})},N))},m)):x.map((i,m)=>(0,p.jsx)("tr",{className:r("border-b border-secondary-100 transition-all duration-200"),children:e.map((b,N)=>(0,p.jsx)("td",{className:r("px-4 py-3 text-sm text-gray-800",b.align==="center"&&"text-center",b.align==="right"&&"text-right"),children:b.render?b.render(i[b.key],i):String(i[b.key])},N))},m))})]})}),!o&&x.length===0&&(0,p.jsxs)("div",{className:"flex flex-col items-center justify-center py-10 text-gray-500 dark:text-gray-400 animate-[fadeIn_0.4s_ease-in-out]",children:[(0,p.jsxs)("div",{className:"relative",children:[(0,p.jsx)(A.Box,{size:64,className:"mb-3 text-secondary-400 dark:text-secondary-500 opacity-80 animate-[float_2.5s_ease-in-out_infinite]"}),(0,p.jsx)("div",{className:"absolute inset-0 blur-2xl bg-secondary-200/20 dark:bg-secondary-700/20 rounded-full scale-75 animate-[pulse_3s_ease-in-out_infinite]"})]}),(0,p.jsx)("p",{className:"text-sm font-medium animate-[fadeUp_0.6s_ease-out]",children:c})]})]})}var he=require("lucide-react"),j=require("react");var I=require("react/jsx-runtime");function se({show:e,setShow:t,title:o,Header:a,Body:n,footer:s}){let c=(0,j.useRef)(null),{handleEscape:l}=ge(()=>t(!1));(0,j.useEffect)(()=>(e?(document.addEventListener("keydown",l),document.body.style.overflow="hidden"):document.body.style.overflow="unset",()=>document.removeEventListener("keydown",l)),[e,l]);let{handleClick:d}=ye(c,()=>t(!1));return(0,j.useEffect)(()=>(e&&document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)),[e,d]),(0,I.jsx)("div",{className:r("fixed inset-0 z-50 flex items-center justify-center p-4 bg-secondary-100/50 backdrop-blur-sm transition-all duration-500 ease-in-out",e?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none"),children:(0,I.jsxs)("div",{ref:c,className:r("relative w-full max-w-lg rounded-[7px] shadow-xl bg-secondary-50 text-gray-800","transform transition-all duration-500 ease-out",e?"opacity-100 scale-100":"opacity-0 scale-90"),children:[(a||o)&&(0,I.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-secondary-300",children:[a||(0,I.jsx)("h2",{className:"text-xl font-semibold text-gray-800",children:o}),(0,I.jsx)("button",{onClick:()=>t(!1),className:"text-gray-800 hover:text-secondary-300 active:animate-spin transition",children:(0,I.jsx)(he.X,{className:"w-5 h-5"})})]}),n&&(0,I.jsx)("div",{className:"px-6 py-4 max-h-96 overflow-y-auto scrollbar-thin scrollbar-thumb-gray-300",children:n}),s&&(0,I.jsx)("div",{className:"flex items-center justify-end gap-3 px-6 py-4 border-t border-secondary-300",children:s})]})})}var Q=require("lucide-react"),T=require("react/jsx-runtime");function ne({totalItems:e,currentPage:t,perPage:o,onPageChange:a,onPerPageChange:n,siblingCount:s=1,perPageOptions:c=[10,20,30],showPerPage:l=!0}){let d=Math.ceil(e/o),g=(()=>{let u=s*2+5;if(d<=u)return Array.from({length:d},(k,M)=>M+1);let i=Math.max(t-s,2),m=Math.min(t+s,d-1),b=i>2,N=m<d-1,f=[1];b&&f.push("...");for(let k=i;k<=m;k++)f.push(k);return N&&f.push("..."),f.push(d),f})(),h=()=>{t>1&&a(t-1)},y=()=>{t<d&&a(t+1)};return(0,T.jsxs)("div",{className:"w-full flex flex-col md:flex-row md:justify-between md:items-center gap-4 py-4",children:[l&&n&&(0,T.jsx)("div",{className:"flex justify-center md:justify-start w-full md:w-auto",children:(0,T.jsx)("select",{value:o,onChange:u=>n(Number(u.target.value)),className:`border rounded-lg px-3 py-2 text-sm bg-white
|
|
38
37
|
hover:border-secondary-500
|
|
39
38
|
focus:outline-none focus:ring-2 focus:ring-secondary-500
|
|
40
|
-
transition-all duration-200`,children:c.map(u=>(0,T.jsxs)("option",{value:u,children:[u," / page"]},u))})}),(0,T.jsxs)("div",{className:"flex items-center justify-center md:justify-end w-full",children:[(0,T.jsx)("button",{onClick:
|
|
41
|
-
${
|
|
42
|
-
${u===
|
|
43
|
-
${
|
|
39
|
+
transition-all duration-200`,children:c.map(u=>(0,T.jsxs)("option",{value:u,children:[u," / page"]},u))})}),(0,T.jsxs)("div",{className:"flex items-center justify-center md:justify-end w-full",children:[(0,T.jsx)("button",{onClick:h,disabled:t===1,className:`flex items-center justify-center rounded-xl border px-3 py-2 transition-all duration-200
|
|
40
|
+
${t===1?"opacity-40 cursor-not-allowed":"hover:bg-secondary-100 hover:text-secondary-700"}`,children:(0,T.jsx)(Q.ChevronLeft,{size:18})}),(0,T.jsx)("div",{className:"flex items-center gap-1 mx-2",children:g.map((u,i)=>(0,T.jsx)("button",{onClick:()=>typeof u=="number"&&a(u),disabled:u==="...",className:`min-w-[40px] rounded-xl border px-3 py-2 text-sm font-medium transition-all duration-200
|
|
41
|
+
${u===t?"bg-secondary-500 text-white shadow-md":u==="..."?"cursor-default border-none text-gray-400":"bg-white text-secondary-700 hover:bg-secondary-100"}`,children:u},i))}),(0,T.jsx)("button",{onClick:y,disabled:t===d,className:`flex items-center justify-center rounded-xl border px-3 py-2 transition-all duration-200
|
|
42
|
+
${t===d?"opacity-40 cursor-not-allowed":"hover:bg-secondary-100 hover:text-secondary-700"}`,children:(0,T.jsx)(Q.ChevronRight,{size:18})})]})]})}var V=require("react");var P=require("react/jsx-runtime");function ie({tabs:e,defaultTab:t,position:o="top",variant:a="primary",className:n,onChange:s}){var b,N;let[c,l]=(0,V.useState)(t||((b=e[0])==null?void 0:b.id)),[d,x]=(0,V.useState)({}),g=(0,V.useRef)([]);(0,V.useEffect)(()=>{let f=e.findIndex(M=>M.id===c),k=g.current[f];if(k){let{offsetLeft:M,offsetTop:B,offsetWidth:O,offsetHeight:U}=k;x({left:M,top:B,width:O,height:U,transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"})}},[c,o,e]);let h={top:"flex-col",bottom:"flex-col-reverse",left:"flex-row",right:"flex-row-reverse"},y={top:"flex-row",bottom:"flex-row",left:"flex-col",right:"flex-col"},u={top:"mt-6",bottom:"mb-6",left:"ml-6",right:"mr-6"},i={primary:{active:"text-secondary-600",inactive:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300",disabled:"text-gray-300 dark:text-gray-600 cursor-not-allowed",bg:"bg-secondary-100 dark:bg-secondary-900"},secondary:{active:"text-accent-600",inactive:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300",disabled:"text-gray-300 dark:text-gray-600 cursor-not-allowed",bg:"bg-accent-100 dark:bg-accent-900"},accent:{active:"text-gray-800 dark:text-gray-200",inactive:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300",disabled:"text-gray-300 dark:text-gray-600 cursor-not-allowed",bg:"bg-gray-100 dark:bg-gray-800"}},m=o==="left"||o==="right";return(0,P.jsxs)("div",{className:r("flex w-full",h[o],n),children:[(0,P.jsxs)("div",{className:r("flex relative bg-gray-50 dark:bg-gray-900 rounded-lg p-1",y[o],m?"min-w-48":"w-full"),children:[(0,P.jsx)("div",{className:r("absolute rounded-md transition-all duration-300 ease-out",i[a].bg,m?"w-full":"h-full"),style:d}),e.map((f,k)=>{let M=c===f.id,B=i[a];return(0,P.jsxs)("button",{ref:O=>{g.current[k]=O},onClick:()=>{f.disabled||(l(f.id),s==null||s(f.id))},disabled:f.disabled,className:r("relative flex items-center justify-center gap-2 px-4 py-3 font-medium","text-sm whitespace-nowrap transition-all duration-200 z-10","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-blue-500","rounded-md",M?[B.active,"font-semibold"]:[B.inactive,"hover:bg-white/50 dark:hover:bg-gray-800/50"],f.disabled&&B.disabled,m?"w-full justify-start":"flex-1"),children:[f.icon&&(0,P.jsx)("span",{className:r("flex-shrink-0 transition-transform duration-200",M&&"scale-110"),children:f.icon}),(0,P.jsx)("span",{className:"relative z-10",children:f.label})]},f.id)})]}),(0,P.jsx)("div",{className:r("flex-1 overflow-hidden",u[o]),children:(0,P.jsx)("div",{className:"animate-fade-in",children:(N=e.find(f=>f.id===c))==null?void 0:N.content},c)})]})}function Ne({children:e,className:t}){return(0,P.jsx)("div",{className:r("p-6 rounded-lg bg-white dark:bg-gray-800 shadow-sm border border-gray-200 dark:border-gray-700",t),children:e})}var we=require("lucide-react");var F=require("react/jsx-runtime"),He={sm:"text-xs px-2 py-0.5",md:"text-sm px-3 py-1",lg:"text-base px-4 py-1.5"},le={sm:"w-3 h-3",md:"w-4 h-4",lg:"w-5 h-5"},Ve={default:"bg-gray-100 text-gray-800 border border-gray-200 dark:bg-gray-800 dark:text-gray-100 dark:border-gray-700",secondary:"bg-secondary-100 text-secondary-800 border border-secondary-200 dark:bg-secondary-800 dark:text-secondary-50 dark:border-secondary-700",success:"bg-success-100 text-success-800 border border-success-200 dark:bg-success-800 dark:text-success-50 dark:border-success-700",error:"bg-error-100 text-error-800 border border-error-200 dark:bg-error-800 dark:text-error-50 dark:border-error-700",info:"bg-info-100 text-info-800 border border-info-200 dark:bg-info-800 dark:text-info-50 dark:border-info-700",accent:"bg-accent-100 text-accent-800 border border-accent-200 dark:bg-accent-800 dark:text-accent-50 dark:border-accent-700"};function ce({children:e,variant:t="default",size:o="md",icon:a,iconPosition:n="left",closable:s=!1,onClose:c,className:l}){return(0,F.jsxs)("span",{className:r("inline-flex items-center font-medium animate-[fadeIn_0.3s_ease-out] rounded-[7px]",He[o],Ve[t],a&&"gap-1.5",l),children:[a&&n==="left"&&(0,F.jsx)("span",{className:`flex items-center ${r(le[o])}`,children:a}),(0,F.jsx)("span",{children:e}),a&&n==="right"&&(0,F.jsx)("span",{className:`flex items-center ${r(le[o])}`,children:a}),s&&(0,F.jsx)("button",{type:"button",onClick:c,className:"ml-1 rounded-full p-0.5 hover:bg-black/10 dark:hover:bg-white/10 transition-colors",children:(0,F.jsx)(we.X,{className:r(le[o])})})]})}var ke=require("react");var z=require("react/jsx-runtime");function de({label:e,placeholder:t,value:o="",onChange:a,required:n=!1,disabled:s=!1,error:c,className:l,rows:d=4}){let[x,g]=(0,ke.useState)(!1),h=x||o.length>0;return(0,z.jsxs)("div",{className:"relative w-full",children:[e&&(0,z.jsxs)("label",{className:r("absolute left-3 top-2 text-gray-500 dark:text-gray-400 transition-all duration-200 pointer-events-none",h?"text-xs -translate-y-3 bg-white dark:bg-gray-900 px-1":"text-sm translate-y-0"),children:[e,n&&(0,z.jsx)("span",{className:"text-error-500 ml-0.5",children:"*"})]}),(0,z.jsx)("textarea",{rows:d,placeholder:e?void 0:t,value:o,onChange:y=>a==null?void 0:a(y.target.value),onFocus:()=>g(!0),onBlur:()=>g(!1),disabled:s,className:r("w-full rounded-md border border-gray-300 dark:border-gray-700 bg-transparent text-gray-900 dark:text-gray-100 px-3 py-2 outline-none transition-all resize-none","focus:border-primary-500 focus:ring-1 focus:ring-primary-500",s&&"opacity-50 cursor-not-allowed",c&&"border-error-500 focus:ring-error-500 focus:border-error-500",e&&"pt-5",l)}),c&&(0,z.jsx)("p",{className:"mt-1 text-sm text-error-500",children:c})]})}var C=require("lucide-react"),W=require("react");var v=require("react/jsx-runtime");function Te({id:e=Math.random().toString(36),title:t,description:o,type:a="info",duration:n=5e3,position:s="top-right",onClose:c,action:l}){let[d,x]=(0,W.useState)(!1),[g,h]=(0,W.useState)(!1);(0,W.useEffect)(()=>{let f=setTimeout(()=>x(!0),100);if(n!==1/0){let k=setTimeout(()=>y(),n);return()=>{clearTimeout(f),clearTimeout(k)}}return()=>clearTimeout(f)},[n]);let y=()=>{h(!0),setTimeout(()=>{x(!1),c==null||c(e)},300)},u=()=>{l==null||l.onClick(),y()},i={success:(0,v.jsx)(C.CheckCircle2,{className:"w-5 h-5"}),error:(0,v.jsx)(C.XCircle,{className:"w-5 h-5"}),warning:(0,v.jsx)(C.AlertCircle,{className:"w-5 h-5"}),info:(0,v.jsx)(C.Info,{className:"w-5 h-5"}),loading:(0,v.jsx)(C.Loader2,{className:"w-5 h-5 animate-spin"})},m={success:"bg-success-50 border-success-200 text-success-800",error:"bg-error-50 border-error-200 text-error-800",warning:"bg-secondary-50 border-secondary-200 text-secondary-800",info:"bg-info-50 border-info-200 text-info-800",loading:"bg-gray-50 border-gray-200 text-gray-800"},b={success:"text-success-600",error:"text-error-600",warning:"text-secondary-600",info:"text-info-600",loading:"text-gray-600"},N={"top-right":"top-4 right-4","top-left":"top-4 left-4","bottom-right":"bottom-4 right-4","bottom-left":"bottom-4 left-4","top-center":"top-4 left-1/2 -translate-x-1/2","bottom-center":"bottom-4 left-1/2 -translate-x-1/2"};return d?(0,v.jsx)("div",{className:r("fixed z-50 transform transition-all duration-300",N[s],g?"opacity-0 scale-95":"opacity-100 scale-100",s.includes("top")&&!g&&"animate-slide-down",s.includes("bottom")&&!g&&"animate-slide-up"),children:(0,v.jsxs)("div",{className:r("flex items-start gap-3 p-4 rounded-lg border shadow-lg max-w-sm","backdrop-blur-sm bg-white/95",m[a]),children:[(0,v.jsx)("div",{className:r("flex-shrink-0 mt-0.5",b[a]),children:i[a]}),(0,v.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,v.jsx)("h4",{className:"font-semibold text-sm mb-1",children:t}),o&&(0,v.jsx)("p",{className:"text-sm opacity-90",children:o}),l&&(0,v.jsx)("button",{onClick:u,className:"mt-2 text-sm font-medium underline underline-offset-2 hover:no-underline",children:l.label})]}),(0,v.jsx)("button",{onClick:y,className:"flex-shrink-0 p-1 rounded-full hover:bg-black/5 transition-colors",children:(0,v.jsx)(C.X,{className:"w-4 h-4"})})]})}):null}var X=require("react/jsx-runtime");function Ce({toasts:e,onRemove:t,position:o="top-right"}){return(0,X.jsx)(X.Fragment,{children:e.map(a=>(0,X.jsx)(Te,{...a,onClose:t,position:o},a.id))})}var K=require("react/jsx-runtime");function me({content:e,children:t,position:o="top",delay:a=200,className:n}){let s={top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2",right:"left-full top-1/2 -translate-y-1/2 ml-2"},c={top:"left-1/2 -translate-x-1/2 top-full",bottom:"left-1/2 -translate-x-1/2 bottom-full",left:"top-1/2 -translate-y-1/2 left-full",right:"top-1/2 -translate-y-1/2 right-full"};return(0,K.jsxs)("div",{className:"relative inline-block group",children:[t,(0,K.jsxs)("div",{className:r("absolute z-50 whitespace-nowrap rounded-md bg-gray-800 text-white text-xs px-2 py-1 shadow-md dark:bg-gray-900","transition-all opacity-0 scale-95 group-hover:opacity-100 group-hover:scale-100","group-hover:delay-200 duration-200 ease-out",s[o],n),style:{transitionDelay:`${a}ms`},children:[e,(0,K.jsx)("span",{className:r("absolute w-2 h-2 bg-gray-800 dark:bg-gray-900 rotate-45",c[o])})]})]})}0&&(module.exports={Breadcrumb,Button,Collapse,InputMain,MciTable,Modal,Pagination,Skeleton,TabPanel,Tabs,Tag,Textarea,ToastContainer,Tooltip});
|
|
44
43
|
//# sourceMappingURL=index.cjs.map
|