@mci-ui/mci-ui 0.0.7 → 0.0.9

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/index.d.cts DELETED
@@ -1,188 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import React$1 from 'react';
3
-
4
- type BreadcrumbItem = {
5
- label: string;
6
- href?: string;
7
- onClick?: () => void;
8
- };
9
- type BreadcrumbProps = {
10
- items: BreadcrumbItem[];
11
- className?: string;
12
- separatorIcon?: React$1.ReactNode;
13
- };
14
- declare function Breadcrumb({ items, className, separatorIcon, }: BreadcrumbProps): react_jsx_runtime.JSX.Element;
15
-
16
- type ButtonProps = {
17
- text?: string;
18
- icon?: React$1.ReactNode;
19
- iconPosition?: 'left' | 'right';
20
- size?: 'sm' | 'md' | 'lg';
21
- variant?: 'primary' | 'secondary' | 'accent';
22
- loading?: boolean;
23
- disabled?: boolean;
24
- onClick?: () => void;
25
- className?: string;
26
- };
27
- declare function Button({ text, icon, iconPosition, size, variant, loading, disabled, onClick, className, }: ButtonProps): react_jsx_runtime.JSX.Element;
28
-
29
- type CollapseProps = {
30
- title: string;
31
- children: React$1.ReactNode;
32
- defaultOpen?: boolean;
33
- icon?: React$1.ReactNode;
34
- variant?: 'primary' | 'secondary' | 'accent';
35
- className?: string;
36
- titleClassName?: string;
37
- contentClassName?: string;
38
- };
39
- declare function Collapse({ title, children, defaultOpen, icon, variant, className, titleClassName, contentClassName, }: CollapseProps): react_jsx_runtime.JSX.Element;
40
-
41
- type InputProps = {
42
- label?: string;
43
- placeholder?: string;
44
- type?: 'text' | 'email' | 'password' | 'number' | 'tel';
45
- icon?: React$1.ReactNode;
46
- iconPosition?: 'left' | 'right';
47
- size?: 'sm' | 'md' | 'lg';
48
- error?: string;
49
- success?: string;
50
- disabled?: boolean;
51
- required?: boolean;
52
- value?: string;
53
- onChange?: (e: React$1.ChangeEvent<HTMLInputElement>) => void;
54
- onFocus?: () => void;
55
- onBlur?: () => void;
56
- className?: string;
57
- };
58
- declare function InputMain({ label, placeholder, type, icon, iconPosition, size, error, success, disabled, required, value, onChange, onFocus, onBlur, className, }: InputProps): react_jsx_runtime.JSX.Element;
59
-
60
- type MciTableColumn<T> = {
61
- key: keyof T;
62
- title: string;
63
- sortable?: boolean;
64
- align?: 'left' | 'center' | 'right';
65
- width?: string | number;
66
- render?: (value: T[keyof T], row: T) => React$1.ReactNode;
67
- };
68
-
69
- interface MciTableProps<T extends Record<string, unknown>> {
70
- columns: MciTableColumn<T>[];
71
- data: T[];
72
- loading?: boolean;
73
- variant?: 'clean' | 'elevated' | 'bordered';
74
- skeletonRows?: number;
75
- actions?: React.ReactNode;
76
- noDataText?: string;
77
- }
78
- declare function MciTable<T extends Record<string, unknown>>({ columns, data, loading, variant, skeletonRows, actions, noDataText, }: MciTableProps<T>): react_jsx_runtime.JSX.Element;
79
-
80
- interface ModalProps {
81
- show: boolean;
82
- setShow: (show: boolean) => void;
83
- title?: string;
84
- Header?: React$1.ReactNode;
85
- Body?: React$1.ReactNode;
86
- footer?: React$1.ReactNode;
87
- }
88
- declare function Modal({ show, setShow, title, Header, Body, footer, }: ModalProps): react_jsx_runtime.JSX.Element;
89
-
90
- interface PaginationProps {
91
- totalItems: number;
92
- currentPage: number;
93
- perPage: number;
94
- onPageChange: (page: number) => void;
95
- onPerPageChange?: (value: number) => void;
96
- siblingCount?: number;
97
- perPageOptions?: number[];
98
- showPerPage?: boolean;
99
- }
100
- declare function Pagination({ totalItems, currentPage, perPage, onPageChange, onPerPageChange, siblingCount, perPageOptions, showPerPage, }: PaginationProps): react_jsx_runtime.JSX.Element;
101
-
102
- type SkeletonProps = {
103
- className?: string;
104
- variant?: 'default' | 'rounded' | 'circle';
105
- width?: string | number;
106
- height?: string | number;
107
- };
108
- declare function Skeleton({ className, variant, width, height, }: SkeletonProps): react_jsx_runtime.JSX.Element;
109
-
110
- type Tab = {
111
- id: string;
112
- label: string;
113
- icon?: React$1.ReactNode;
114
- content: React$1.ReactNode;
115
- disabled?: boolean;
116
- };
117
- type TabsProps = {
118
- tabs: Tab[];
119
- defaultTab?: string;
120
- position?: 'top' | 'bottom' | 'left' | 'right';
121
- variant?: 'primary' | 'secondary' | 'accent';
122
- className?: string;
123
- onChange?: (tabId: string | number) => void;
124
- };
125
- declare function Tabs({ tabs, defaultTab, position, variant, className, onChange, }: TabsProps): react_jsx_runtime.JSX.Element;
126
- type TabPanelProps = {
127
- children: React$1.ReactNode;
128
- className?: string;
129
- };
130
- declare function TabPanel({ children, className }: TabPanelProps): react_jsx_runtime.JSX.Element;
131
-
132
- type TagProps = {
133
- children: React$1.ReactNode;
134
- variant?: 'default' | 'secondary' | 'success' | 'error' | 'info' | 'accent';
135
- size?: 'sm' | 'md' | 'lg';
136
- icon?: React$1.ReactNode;
137
- iconPosition?: 'left' | 'right';
138
- rounded?: boolean;
139
- closable?: boolean;
140
- onClose?: () => void;
141
- className?: string;
142
- };
143
- declare function Tag({ children, variant, size, icon, iconPosition, closable, onClose, className, }: TagProps): react_jsx_runtime.JSX.Element;
144
-
145
- type TextareaProps = {
146
- label?: string;
147
- placeholder?: string;
148
- value?: string;
149
- onChange?: (value: string) => void;
150
- required?: boolean;
151
- disabled?: boolean;
152
- error?: string;
153
- className?: string;
154
- rows?: number;
155
- };
156
- declare function Textarea({ label, placeholder, value, onChange, required, disabled, error, className, rows, }: TextareaProps): react_jsx_runtime.JSX.Element;
157
-
158
- type ToastType = 'success' | 'error' | 'warning' | 'info' | 'loading';
159
- type ToastProps = {
160
- id?: string;
161
- title: string;
162
- description?: string;
163
- type?: ToastType;
164
- duration?: number;
165
- position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'top-center' | 'bottom-center';
166
- onClose?: (id: string) => void;
167
- action?: {
168
- label: string;
169
- onClick: () => void;
170
- };
171
- };
172
-
173
- declare function ToastContainer({ toasts, onRemove, position, }: {
174
- toasts: ToastProps[];
175
- onRemove: (id: string) => void;
176
- position?: ToastProps['position'];
177
- }): react_jsx_runtime.JSX.Element;
178
-
179
- type TooltipProps = {
180
- content: React$1.ReactNode;
181
- children: React$1.ReactNode;
182
- position?: 'top' | 'bottom' | 'left' | 'right';
183
- delay?: number;
184
- className?: string;
185
- };
186
- declare function Tooltip({ content, children, position, delay, className, }: TooltipProps): react_jsx_runtime.JSX.Element;
187
-
188
- export { Breadcrumb, Button, Collapse, InputMain, MciTable, Modal, Pagination, Skeleton, TabPanel, Tabs, Tag, Textarea, ToastContainer, Tooltip };
package/dist/index.d.ts DELETED
@@ -1,188 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import React$1 from 'react';
3
-
4
- type BreadcrumbItem = {
5
- label: string;
6
- href?: string;
7
- onClick?: () => void;
8
- };
9
- type BreadcrumbProps = {
10
- items: BreadcrumbItem[];
11
- className?: string;
12
- separatorIcon?: React$1.ReactNode;
13
- };
14
- declare function Breadcrumb({ items, className, separatorIcon, }: BreadcrumbProps): react_jsx_runtime.JSX.Element;
15
-
16
- type ButtonProps = {
17
- text?: string;
18
- icon?: React$1.ReactNode;
19
- iconPosition?: 'left' | 'right';
20
- size?: 'sm' | 'md' | 'lg';
21
- variant?: 'primary' | 'secondary' | 'accent';
22
- loading?: boolean;
23
- disabled?: boolean;
24
- onClick?: () => void;
25
- className?: string;
26
- };
27
- declare function Button({ text, icon, iconPosition, size, variant, loading, disabled, onClick, className, }: ButtonProps): react_jsx_runtime.JSX.Element;
28
-
29
- type CollapseProps = {
30
- title: string;
31
- children: React$1.ReactNode;
32
- defaultOpen?: boolean;
33
- icon?: React$1.ReactNode;
34
- variant?: 'primary' | 'secondary' | 'accent';
35
- className?: string;
36
- titleClassName?: string;
37
- contentClassName?: string;
38
- };
39
- declare function Collapse({ title, children, defaultOpen, icon, variant, className, titleClassName, contentClassName, }: CollapseProps): react_jsx_runtime.JSX.Element;
40
-
41
- type InputProps = {
42
- label?: string;
43
- placeholder?: string;
44
- type?: 'text' | 'email' | 'password' | 'number' | 'tel';
45
- icon?: React$1.ReactNode;
46
- iconPosition?: 'left' | 'right';
47
- size?: 'sm' | 'md' | 'lg';
48
- error?: string;
49
- success?: string;
50
- disabled?: boolean;
51
- required?: boolean;
52
- value?: string;
53
- onChange?: (e: React$1.ChangeEvent<HTMLInputElement>) => void;
54
- onFocus?: () => void;
55
- onBlur?: () => void;
56
- className?: string;
57
- };
58
- declare function InputMain({ label, placeholder, type, icon, iconPosition, size, error, success, disabled, required, value, onChange, onFocus, onBlur, className, }: InputProps): react_jsx_runtime.JSX.Element;
59
-
60
- type MciTableColumn<T> = {
61
- key: keyof T;
62
- title: string;
63
- sortable?: boolean;
64
- align?: 'left' | 'center' | 'right';
65
- width?: string | number;
66
- render?: (value: T[keyof T], row: T) => React$1.ReactNode;
67
- };
68
-
69
- interface MciTableProps<T extends Record<string, unknown>> {
70
- columns: MciTableColumn<T>[];
71
- data: T[];
72
- loading?: boolean;
73
- variant?: 'clean' | 'elevated' | 'bordered';
74
- skeletonRows?: number;
75
- actions?: React.ReactNode;
76
- noDataText?: string;
77
- }
78
- declare function MciTable<T extends Record<string, unknown>>({ columns, data, loading, variant, skeletonRows, actions, noDataText, }: MciTableProps<T>): react_jsx_runtime.JSX.Element;
79
-
80
- interface ModalProps {
81
- show: boolean;
82
- setShow: (show: boolean) => void;
83
- title?: string;
84
- Header?: React$1.ReactNode;
85
- Body?: React$1.ReactNode;
86
- footer?: React$1.ReactNode;
87
- }
88
- declare function Modal({ show, setShow, title, Header, Body, footer, }: ModalProps): react_jsx_runtime.JSX.Element;
89
-
90
- interface PaginationProps {
91
- totalItems: number;
92
- currentPage: number;
93
- perPage: number;
94
- onPageChange: (page: number) => void;
95
- onPerPageChange?: (value: number) => void;
96
- siblingCount?: number;
97
- perPageOptions?: number[];
98
- showPerPage?: boolean;
99
- }
100
- declare function Pagination({ totalItems, currentPage, perPage, onPageChange, onPerPageChange, siblingCount, perPageOptions, showPerPage, }: PaginationProps): react_jsx_runtime.JSX.Element;
101
-
102
- type SkeletonProps = {
103
- className?: string;
104
- variant?: 'default' | 'rounded' | 'circle';
105
- width?: string | number;
106
- height?: string | number;
107
- };
108
- declare function Skeleton({ className, variant, width, height, }: SkeletonProps): react_jsx_runtime.JSX.Element;
109
-
110
- type Tab = {
111
- id: string;
112
- label: string;
113
- icon?: React$1.ReactNode;
114
- content: React$1.ReactNode;
115
- disabled?: boolean;
116
- };
117
- type TabsProps = {
118
- tabs: Tab[];
119
- defaultTab?: string;
120
- position?: 'top' | 'bottom' | 'left' | 'right';
121
- variant?: 'primary' | 'secondary' | 'accent';
122
- className?: string;
123
- onChange?: (tabId: string | number) => void;
124
- };
125
- declare function Tabs({ tabs, defaultTab, position, variant, className, onChange, }: TabsProps): react_jsx_runtime.JSX.Element;
126
- type TabPanelProps = {
127
- children: React$1.ReactNode;
128
- className?: string;
129
- };
130
- declare function TabPanel({ children, className }: TabPanelProps): react_jsx_runtime.JSX.Element;
131
-
132
- type TagProps = {
133
- children: React$1.ReactNode;
134
- variant?: 'default' | 'secondary' | 'success' | 'error' | 'info' | 'accent';
135
- size?: 'sm' | 'md' | 'lg';
136
- icon?: React$1.ReactNode;
137
- iconPosition?: 'left' | 'right';
138
- rounded?: boolean;
139
- closable?: boolean;
140
- onClose?: () => void;
141
- className?: string;
142
- };
143
- declare function Tag({ children, variant, size, icon, iconPosition, closable, onClose, className, }: TagProps): react_jsx_runtime.JSX.Element;
144
-
145
- type TextareaProps = {
146
- label?: string;
147
- placeholder?: string;
148
- value?: string;
149
- onChange?: (value: string) => void;
150
- required?: boolean;
151
- disabled?: boolean;
152
- error?: string;
153
- className?: string;
154
- rows?: number;
155
- };
156
- declare function Textarea({ label, placeholder, value, onChange, required, disabled, error, className, rows, }: TextareaProps): react_jsx_runtime.JSX.Element;
157
-
158
- type ToastType = 'success' | 'error' | 'warning' | 'info' | 'loading';
159
- type ToastProps = {
160
- id?: string;
161
- title: string;
162
- description?: string;
163
- type?: ToastType;
164
- duration?: number;
165
- position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'top-center' | 'bottom-center';
166
- onClose?: (id: string) => void;
167
- action?: {
168
- label: string;
169
- onClick: () => void;
170
- };
171
- };
172
-
173
- declare function ToastContainer({ toasts, onRemove, position, }: {
174
- toasts: ToastProps[];
175
- onRemove: (id: string) => void;
176
- position?: ToastProps['position'];
177
- }): react_jsx_runtime.JSX.Element;
178
-
179
- type TooltipProps = {
180
- content: React$1.ReactNode;
181
- children: React$1.ReactNode;
182
- position?: 'top' | 'bottom' | 'left' | 'right';
183
- delay?: number;
184
- className?: string;
185
- };
186
- declare function Tooltip({ content, children, position, delay, className, }: TooltipProps): react_jsx_runtime.JSX.Element;
187
-
188
- export { Breadcrumb, Button, Collapse, InputMain, MciTable, Modal, Pagination, Skeleton, TabPanel, Tabs, Tag, Textarea, ToastContainer, Tooltip };
package/dist/index.js DELETED
@@ -1,43 +0,0 @@
1
- import{ChevronRight as Me}from"lucide-react";import{clsx as Re}from"clsx";import{twMerge as Pe}from"tailwind-merge";function e(...a){return Pe(Re(a))}function G(a){return{handleEscape:o=>{o.key==="Escape"&&a()}}}function J(a,r){return{handleClick:t=>{a.current&&!a.current.contains(t.target)&&r()}}}import{jsx as L,jsxs as Ee}from"react/jsx-runtime";function Q({items:a,className:r,separatorIcon:o=L(Me,{className:"w-4 h-4 text-gray-400 dark:text-gray-500"})}){return L("nav",{className:e("flex items-center space-x-2 text-sm font-medium text-gray-600 dark:text-gray-300",r),"aria-label":"Breadcrumb",children:a.map((t,l)=>{let s=l===a.length-1;return Ee("div",{className:"flex items-center",children:[t.href?L("a",{href:t.href,onClick:t.onClick,className:e("hover:text-primary-600 dark:hover:text-primary-400 transition-colors",s&&"text-primary-600 dark:text-primary-400"),children:t.label}):L("span",{className:e(s?"text-primary-600 dark:text-primary-400":"text-gray-500 dark:text-gray-400"),children:t.label}),!s&&L("span",{className:"mx-2 flex items-center",children:o})]},l)})})}import{Loader as z}from"lucide-react";import{jsx as I,jsxs as Ie}from"react/jsx-runtime";function Y({text:a,icon:r,iconPosition:o="left",size:t="md",variant:l="accent",loading:s=!1,disabled:c=!1,onClick:i,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 Ie("button",{onClick:i,disabled:c||s,className:e("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",l==="primary"&&"focus:ring-secondary-500",l==="secondary"&&"focus:ring-secondary-400",l==="accent"&&"focus:ring-accent-500",{primary:`
2
- bg-secondary-500
3
- hover:bg-secondary-600
4
- active:bg-secondary-700
5
- hover:shadow-lg
6
- hover:shadow-secondary-500/30
7
- active:scale-[0.98]
8
- text-white
9
- `,secondary:`
10
- bg-secondary-50
11
- hover:bg-secondary-100
12
- active:bg-secondary-200
13
- hover:shadow-md
14
- hover:shadow-secondary-500/10
15
- active:scale-[0.98]
16
- text-secondary-700
17
- border border-secondary-200
18
- hover:border-secondary-300
19
- `,accent:`
20
- bg-accent-500
21
- hover:bg-accent-600
22
- active:bg-accent-700
23
- hover:shadow-lg
24
- hover:shadow-accent-500/30
25
- active:scale-[0.98]
26
- text-white
27
- `}[l],x[t],d),children:[r&&o==="left"&&I("span",{className:"flex items-center justify-center transition-transform duration-300 ease-in-out group-hover:scale-110",children:s?I(z,{className:"animate-spin",size:20}):r}),a&&I("span",{className:"transition-all duration-300",children:a}),r&&o==="right"&&I("span",{className:"flex items-center justify-center transition-transform duration-300 ease-in-out group-hover:scale-110",children:s?I(z,{className:"animate-spin",size:20}):r}),s&&I(z,{className:"animate-spin",size:20})]})}import{ChevronDownIcon as Se}from"lucide-react";import{useEffect as _e,useRef as Le,useState as Z}from"react";import{jsx as A,jsxs as O}from"react/jsx-runtime";function ee({title:a,children:r,defaultOpen:o=!1,icon:t,variant:l="primary",className:s,titleClassName:c,contentClassName:i}){let[d,x]=Z(o),[b,v]=Z(0),g=Le(null);_e(()=>{g.current&&v(d?g.current.scrollHeight:0)},[d]);let n={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"}}[l];return O("div",{className:e("border rounded-lg overflow-hidden",s),children:[O("button",{onClick:()=>x(!d),className:e("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",n.title),children:[O("div",{className:"flex items-center gap-3",children:[t&&A("span",{className:"flex-shrink-0",children:t}),A("span",{className:e("font-medium text-left",c),children:a})]}),A(Se,{className:e("w-5 h-5 transition-transform duration-300 flex-shrink-0",d&&"rotate-180")})]}),A("div",{className:e("transition-all duration-300 ease-out overflow-hidden",n.content),style:{height:`${b}px`},children:A("div",{ref:g,className:e("p-4",i),children:r})})]})}import{Eye as Ae,EyeOff as Fe}from"lucide-react";import{useMemo as te,useState as H}from"react";import{jsx as C,jsxs as $}from"react/jsx-runtime";function ae({label:a,placeholder:r,type:o="text",icon:t,iconPosition:l="left",size:s="md",error:c,success:i,disabled:d=!1,required:x=!1,value:b,onChange:v,onFocus:g,onBlur:u,className:n}){let[m,p]=H(!1),[h,f]=H(""),[N,T]=H(!1),[P,E]=H(!1),D=b??h,U=!!D||P,q=o==="password",he=()=>{p(!0),g==null||g()},Ne=()=>{p(!1),u==null||u()},we=M=>{b===void 0&&f(M.target.value),v==null||v(M)},ke=()=>T(M=>!M),k=te(()=>({sm:{input:"h-[38px] text-sm",padding:t?l==="left"?"pl-10 pr-3":"pl-3 pr-10":"px-3",icon:"w-4 h-4",iconWrapper:l==="left"?"left-3":"right-3",labelFont:"text-xs"},md:{input:"h-[48px] text-base",padding:t?l==="left"?"pl-12 pr-4":"pl-4 pr-12":"px-4",icon:"w-5 h-5",iconWrapper:l==="left"?"left-3.5":"right-3.5",labelFont:"text-sm"},lg:{input:"h-[56px] text-lg",padding:t?l==="left"?"pl-14 pr-5":"pl-5 pr-14":"px-5",icon:"w-6 h-6",iconWrapper:l==="left"?"left-4":"right-4",labelFont:"text-base"}}),[t,l]),Te=te(()=>c?"border-error-500 focus:border-error-600 focus:ring-error-500/20":i?"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,i]),Ce=M=>{M.animationName==="onAutoFillStart"?E(!0):M.animationName==="onAutoFillCancel"&&E(!1)};return $("div",{className:e("w-full",n),children:[$("div",{className:"relative flex items-center",children:[C("input",{type:q&&N?"text":o,value:D,onChange:we,onFocus:he,onBlur:Ne,onAnimationStart:Ce,disabled:d,placeholder:a?"":r,required:x,className:e("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]",k[s].input,k[s].padding,Te),autoComplete:"on"}),a&&$("label",{className:e("absolute pointer-events-none transition-all duration-300 ease-in-out font-medium",t&&l==="left"&&!U&&!m?k[s].padding:"left-4",m||U?e("top-0 -translate-y-1/2 bg-white px-2",k[s].labelFont,c?"text-error-600":i?"text-success-600":"text-accent-600"):e("top-1/2 -translate-y-1/2 text-gray-500",k[s].input.includes("38")&&"text-sm",k[s].input.includes("48")&&"text-base",k[s].input.includes("56")&&"text-lg")),children:[a,x&&C("span",{className:"text-error-500 ml-1",children:"*"})]}),t&&C("div",{className:e("absolute top-1/2 -translate-y-1/2 flex items-center transition-all duration-300",k[s].iconWrapper,c?"text-error-500":i?"text-success-500":m?"text-accent-500":"text-gray-400"),children:C("span",{className:e(k[s].icon,"mr-2"),children:t})}),q&&C("button",{type:"button",onClick:ke,className:e("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:N?C(Fe,{className:e(k[s].icon)}):C(Ae,{className:e(k[s].icon)})})]}),c&&C("p",{className:"mt-1.5 text-sm text-error-600 flex items-center gap-1 animate-[slideDown_0.3s_ease-out]",children:c}),i&&!c&&C("p",{className:"mt-1.5 text-sm text-success-600 flex items-center gap-1 animate-[slideDown_0.3s_ease-out]",children:i}),C("style",{children:`
28
- input {
29
- animation-name: onAutoFillCancel;
30
- }
31
- input:-webkit-autofill {
32
- animation-name: onAutoFillStart;
33
- }
34
- @keyframes onAutoFillStart {}
35
- @keyframes onAutoFillCancel {}
36
- `})]})}import{ArrowUpDown as Be,Box as De,ChevronDown as He,ChevronUp as Ve}from"lucide-react";import{useMemo as ze,useState as Oe}from"react";import{jsx as re}from"react/jsx-runtime";function V({className:a,variant:r="default",width:o="100%",height:t="1rem"}){return re("div",{className:e("relative overflow-hidden bg-secondary-200 dark:bg-secondary-800","rounded-sm",r==="circle"&&"rounded-full",r==="rounded"&&"rounded-md",a),style:{width:typeof o=="number"?`${o}px`:o,height:typeof t=="number"?`${t}px`:t},children:re("div",{className:"absolute inset-0 shimmer-mask"})})}import{jsx as y,jsxs as F}from"react/jsx-runtime";function oe({columns:a,data:r,loading:o=!1,variant:t="clean",skeletonRows:l=5,actions:s,noDataText:c}){let[i,d]=Oe(null),x=ze(()=>!i||!i.direction?r:[...r].sort((n,m)=>{let p=n[i.key],h=m[i.key];return p<h?i.direction==="asc"?-1:1:p>h?i.direction==="asc"?1:-1:0}),[r,i]),b=n=>{n.sortable&&d(m=>!m||m.key!==n.key?{key:n.key,direction:"asc"}:m.direction==="asc"?{key:n.key,direction:"desc"}:m.direction==="desc"?{key:n.key,direction:null}:null)},v=n=>n.sortable?!i||i.key!==n.key||!i.direction?y(Be,{size:15,className:"opacity-40"}):i.direction==="asc"?y(Ve,{size:15}):y(He,{size:15}):null,g=e("w-full border-separate border-spacing-0 transition-all duration-300",t==="clean"&&"bg-white",t==="elevated"&&"bg-white shadow-lg",t==="bordered"&&"border border-secondary-200 rounded-lg"),u=n=>e("bg-secondary-50 text-secondary-800 text-sm font-semibold py-3 px-4 select-none","border-b border-secondary-200 transition-colors",n.align==="center"&&"text-center",n.align==="right"&&"text-right",n.sortable&&"cursor-pointer hover:bg-secondary-100/70");return F("div",{className:"w-full space-y-3",children:[s&&y("div",{className:"flex justify-between items-center mb-2",children:s}),y("div",{className:"w-full overflow-x-auto rounded-lg",children:F("table",{className:g,children:[y("thead",{children:y("tr",{children:a.map((n,m)=>y("th",{onClick:()=>b(n),className:e(u(n),m===0&&"rounded-tl-lg",m===a.length-1&&"rounded-tr-lg"),style:{width:n.width},children:F("div",{className:"flex items-center justify-between gap-2",children:[y("span",{className:"truncate",children:n.title}),v(n)]})},String(n.key)))})}),y("tbody",{children:o?Array.from({length:l}).map((n,m)=>y("tr",{children:a.map((p,h)=>y("td",{className:"px-4 py-3",children:y(V,{height:18,variant:"rounded"})},h))},m)):x.map((n,m)=>y("tr",{className:e("border-b border-secondary-100 transition-all duration-200"),children:a.map((p,h)=>y("td",{className:e("px-4 py-3 text-sm text-gray-800",p.align==="center"&&"text-center",p.align==="right"&&"text-right"),children:p.render?p.render(n[p.key],n):String(n[p.key])},h))},m))})]})}),!o&&x.length===0&&F("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:[F("div",{className:"relative",children:[y(De,{size:64,className:"mb-3 text-secondary-400 dark:text-secondary-500 opacity-80 animate-[float_2.5s_ease-in-out_infinite]"}),y("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]"})]}),y("p",{className:"text-sm font-medium animate-[fadeUp_0.6s_ease-out]",children:c})]})]})}import{X as $e}from"lucide-react";import{useEffect as se,useRef as je}from"react";import{jsx as S,jsxs as ne}from"react/jsx-runtime";function ie({show:a,setShow:r,title:o,Header:t,Body:l,footer:s}){let c=je(null),{handleEscape:i}=G(()=>r(!1));se(()=>(a?(document.addEventListener("keydown",i),document.body.style.overflow="hidden"):document.body.style.overflow="unset",()=>document.removeEventListener("keydown",i)),[a,i]);let{handleClick:d}=J(c,()=>r(!1));return se(()=>(a&&document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)),[a,d]),S("div",{className:e("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",a?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none"),children:ne("div",{ref:c,className:e("relative w-full max-w-lg rounded-[7px] shadow-xl bg-secondary-50 text-gray-800","transform transition-all duration-500 ease-out",a?"opacity-100 scale-100":"opacity-0 scale-90"),children:[(t||o)&&ne("div",{className:"flex items-center justify-between px-6 py-4 border-b border-secondary-300",children:[t||S("h2",{className:"text-xl font-semibold text-gray-800",children:o}),S("button",{onClick:()=>r(!1),className:"text-gray-800 hover:text-secondary-300 active:animate-spin transition",children:S($e,{className:"w-5 h-5"})})]}),l&&S("div",{className:"px-6 py-4 max-h-96 overflow-y-auto scrollbar-thin scrollbar-thumb-gray-300",children:l}),s&&S("div",{className:"flex items-center justify-end gap-3 px-6 py-4 border-t border-secondary-300",children:s})]})})}import{ChevronLeft as We,ChevronRight as Xe}from"lucide-react";import{jsx as R,jsxs as j}from"react/jsx-runtime";function le({totalItems:a,currentPage:r,perPage:o,onPageChange:t,onPerPageChange:l,siblingCount:s=1,perPageOptions:c=[10,20,30],showPerPage:i=!0}){let d=Math.ceil(a/o),b=(()=>{let u=s*2+5;if(d<=u)return Array.from({length:d},(N,T)=>T+1);let n=Math.max(r-s,2),m=Math.min(r+s,d-1),p=n>2,h=m<d-1,f=[1];p&&f.push("...");for(let N=n;N<=m;N++)f.push(N);return h&&f.push("..."),f.push(d),f})(),v=()=>{r>1&&t(r-1)},g=()=>{r<d&&t(r+1)};return j("div",{className:"w-full flex flex-col md:flex-row md:justify-between md:items-center gap-4 py-4",children:[i&&l&&R("div",{className:"flex justify-center md:justify-start w-full md:w-auto",children:R("select",{value:o,onChange:u=>l(Number(u.target.value)),className:`border rounded-lg px-3 py-2 text-sm bg-white
37
- hover:border-secondary-500
38
- focus:outline-none focus:ring-2 focus:ring-secondary-500
39
- transition-all duration-200`,children:c.map(u=>j("option",{value:u,children:[u," / page"]},u))})}),j("div",{className:"flex items-center justify-center md:justify-end w-full",children:[R("button",{onClick:v,disabled:r===1,className:`flex items-center justify-center rounded-xl border px-3 py-2 transition-all duration-200
40
- ${r===1?"opacity-40 cursor-not-allowed":"hover:bg-secondary-100 hover:text-secondary-700"}`,children:R(We,{size:18})}),R("div",{className:"flex items-center gap-1 mx-2",children:b.map((u,n)=>R("button",{onClick:()=>typeof u=="number"&&t(u),disabled:u==="...",className:`min-w-[40px] rounded-xl border px-3 py-2 text-sm font-medium transition-all duration-200
41
- ${u===r?"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},n))}),R("button",{onClick:g,disabled:r===d,className:`flex items-center justify-center rounded-xl border px-3 py-2 transition-all duration-200
42
- ${r===d?"opacity-40 cursor-not-allowed":"hover:bg-secondary-100 hover:text-secondary-700"}`,children:R(Xe,{size:18})})]})]})}import{useEffect as Ke,useRef as Ue,useState as ce}from"react";import{jsx as _,jsxs as W}from"react/jsx-runtime";function de({tabs:a,defaultTab:r,position:o="top",variant:t="primary",className:l,onChange:s}){var p,h;let[c,i]=ce(r||((p=a[0])==null?void 0:p.id)),[d,x]=ce({}),b=Ue([]);Ke(()=>{let f=a.findIndex(T=>T.id===c),N=b.current[f];if(N){let{offsetLeft:T,offsetTop:P,offsetWidth:E,offsetHeight:D}=N;x({left:T,top:P,width:E,height:D,transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"})}},[c,o,a]);let v={top:"flex-col",bottom:"flex-col-reverse",left:"flex-row",right:"flex-row-reverse"},g={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"},n={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 W("div",{className:e("flex w-full",v[o],l),children:[W("div",{className:e("flex relative bg-gray-50 dark:bg-gray-900 rounded-lg p-1",g[o],m?"min-w-48":"w-full"),children:[_("div",{className:e("absolute rounded-md transition-all duration-300 ease-out",n[t].bg,m?"w-full":"h-full"),style:d}),a.map((f,N)=>{let T=c===f.id,P=n[t];return W("button",{ref:E=>{b.current[N]=E},onClick:()=>{f.disabled||(i(f.id),s==null||s(f.id))},disabled:f.disabled,className:e("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",T?[P.active,"font-semibold"]:[P.inactive,"hover:bg-white/50 dark:hover:bg-gray-800/50"],f.disabled&&P.disabled,m?"w-full justify-start":"flex-1"),children:[f.icon&&_("span",{className:e("flex-shrink-0 transition-transform duration-200",T&&"scale-110"),children:f.icon}),_("span",{className:"relative z-10",children:f.label})]},f.id)})]}),_("div",{className:e("flex-1 overflow-hidden",u[o]),children:_("div",{className:"animate-fade-in",children:(h=a.find(f=>f.id===c))==null?void 0:h.content},c)})]})}function qe({children:a,className:r}){return _("div",{className:e("p-6 rounded-lg bg-white dark:bg-gray-800 shadow-sm border border-gray-200 dark:border-gray-700",r),children:a})}import{X as Ge}from"lucide-react";import{jsx as B,jsxs as Ye}from"react/jsx-runtime";var Je={sm:"text-xs px-2 py-0.5",md:"text-sm px-3 py-1",lg:"text-base px-4 py-1.5"},X={sm:"w-3 h-3",md:"w-4 h-4",lg:"w-5 h-5"},Qe={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 me({children:a,variant:r="default",size:o="md",icon:t,iconPosition:l="left",closable:s=!1,onClose:c,className:i}){return Ye("span",{className:e("inline-flex items-center font-medium animate-[fadeIn_0.3s_ease-out] rounded-[7px]",Je[o],Qe[r],t&&"gap-1.5",i),children:[t&&l==="left"&&B("span",{className:`flex items-center ${e(X[o])}`,children:t}),B("span",{children:a}),t&&l==="right"&&B("span",{className:`flex items-center ${e(X[o])}`,children:t}),s&&B("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:B(Ge,{className:e(X[o])})})]})}import{useState as Ze}from"react";import{jsx as K,jsxs as ue}from"react/jsx-runtime";function fe({label:a,placeholder:r,value:o="",onChange:t,required:l=!1,disabled:s=!1,error:c,className:i,rows:d=4}){let[x,b]=Ze(!1),v=x||o.length>0;return ue("div",{className:"relative w-full",children:[a&&ue("label",{className:e("absolute left-3 top-2 text-gray-500 dark:text-gray-400 transition-all duration-200 pointer-events-none",v?"text-xs -translate-y-3 bg-white dark:bg-gray-900 px-1":"text-sm translate-y-0"),children:[a,l&&K("span",{className:"text-error-500 ml-0.5",children:"*"})]}),K("textarea",{rows:d,placeholder:a?void 0:r,value:o,onChange:g=>t==null?void 0:t(g.target.value),onFocus:()=>b(!0),onBlur:()=>b(!1),disabled:s,className:e("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",a&&"pt-5",i)}),c&&K("p",{className:"mt-1 text-sm text-error-500",children:c})]})}import{AlertCircle as et,CheckCircle2 as tt,Info as at,Loader2 as rt,X as ot,XCircle as st}from"lucide-react";import{useEffect as nt,useState as pe}from"react";import{jsx as w,jsxs as be}from"react/jsx-runtime";function ge({id:a=Math.random().toString(36),title:r,description:o,type:t="info",duration:l=5e3,position:s="top-right",onClose:c,action:i}){let[d,x]=pe(!1),[b,v]=pe(!1);nt(()=>{let f=setTimeout(()=>x(!0),100);if(l!==1/0){let N=setTimeout(()=>g(),l);return()=>{clearTimeout(f),clearTimeout(N)}}return()=>clearTimeout(f)},[l]);let g=()=>{v(!0),setTimeout(()=>{x(!1),c==null||c(a)},300)},u=()=>{i==null||i.onClick(),g()},n={success:w(tt,{className:"w-5 h-5"}),error:w(st,{className:"w-5 h-5"}),warning:w(et,{className:"w-5 h-5"}),info:w(at,{className:"w-5 h-5"}),loading:w(rt,{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"},p={success:"text-success-600",error:"text-error-600",warning:"text-secondary-600",info:"text-info-600",loading:"text-gray-600"},h={"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?w("div",{className:e("fixed z-50 transform transition-all duration-300",h[s],b?"opacity-0 scale-95":"opacity-100 scale-100",s.includes("top")&&!b&&"animate-slide-down",s.includes("bottom")&&!b&&"animate-slide-up"),children:be("div",{className:e("flex items-start gap-3 p-4 rounded-lg border shadow-lg max-w-sm","backdrop-blur-sm bg-white/95",m[t]),children:[w("div",{className:e("flex-shrink-0 mt-0.5",p[t]),children:n[t]}),be("div",{className:"flex-1 min-w-0",children:[w("h4",{className:"font-semibold text-sm mb-1",children:r}),o&&w("p",{className:"text-sm opacity-90",children:o}),i&&w("button",{onClick:u,className:"mt-2 text-sm font-medium underline underline-offset-2 hover:no-underline",children:i.label})]}),w("button",{onClick:g,className:"flex-shrink-0 p-1 rounded-full hover:bg-black/5 transition-colors",children:w(ot,{className:"w-4 h-4"})})]})}):null}import{Fragment as lt,jsx as ye}from"react/jsx-runtime";function it({toasts:a,onRemove:r,position:o="top-right"}){return ye(lt,{children:a.map(t=>ye(ge,{...t,onClose:r,position:o},t.id))})}import{jsx as ct,jsxs as xe}from"react/jsx-runtime";function ve({content:a,children:r,position:o="top",delay:t=200,className:l}){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 xe("div",{className:"relative inline-block group",children:[r,xe("div",{className:e("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],l),style:{transitionDelay:`${t}ms`},children:[a,ct("span",{className:e("absolute w-2 h-2 bg-gray-800 dark:bg-gray-900 rotate-45",c[o])})]})]})}export{Q as Breadcrumb,Y as Button,ee as Collapse,ae as InputMain,oe as MciTable,ie as Modal,le as Pagination,V as Skeleton,qe as TabPanel,de as Tabs,me as Tag,fe as Textarea,it as ToastContainer,ve as Tooltip};
43
- //# sourceMappingURL=index.js.map