@mci-ui/mci-ui 0.0.6 → 0.0.8

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.
Files changed (38) hide show
  1. package/README.md +3 -71
  2. package/dist/index.css +1 -36
  3. package/dist/index.es.js +4254 -0
  4. package/dist/index.es.js.map +1 -0
  5. package/dist/index.umd.js +160 -0
  6. package/dist/index.umd.js.map +1 -0
  7. package/dist/types/index.d.ts +205 -0
  8. package/dist/vite.svg +1 -0
  9. package/package.json +16 -12
  10. package/dist/index.cjs +0 -44
  11. package/dist/index.cjs.map +0 -1
  12. package/dist/index.d.cts +0 -188
  13. package/dist/index.d.ts +0 -188
  14. package/dist/index.js +0 -44
  15. package/dist/index.js.map +0 -1
  16. package/dist/tailwind-config.css +0 -294
  17. package/src/App.tsx +0 -5
  18. package/src/index.ts +0 -32
  19. package/src/main.tsx +0 -10
  20. package/src/shared/hooks/toast.ts +0 -32
  21. package/src/shared/lib/utils.ts +0 -37
  22. package/src/shared/types/MciTableType.ts +0 -10
  23. package/src/shared/ui/breadcrumb/Breadcrumb.tsx +0 -68
  24. package/src/shared/ui/button/Button.tsx +0 -105
  25. package/src/shared/ui/collapse/Collapse.tsx +0 -98
  26. package/src/shared/ui/inputMain/InputMain.tsx +0 -241
  27. package/src/shared/ui/mciTable/MciTable.tsx +0 -166
  28. package/src/shared/ui/modal/Modal.tsx +0 -92
  29. package/src/shared/ui/pagination/Pagination.tsx +0 -141
  30. package/src/shared/ui/skeleton/Skeleton.tsx +0 -33
  31. package/src/shared/ui/tabs/Tabs.tsx +0 -192
  32. package/src/shared/ui/tag/Tag.tsx +0 -92
  33. package/src/shared/ui/textarea/Textarea.tsx +0 -72
  34. package/src/shared/ui/toast/Toast.tsx +0 -150
  35. package/src/shared/ui/toast/ToastContainer.tsx +0 -19
  36. package/src/shared/ui/tooltip/Tooltip.tsx +0 -58
  37. package/src/styles/index.css +0 -36
  38. package/src/styles/tailwind-config.css +0 -294
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,44 +0,0 @@
1
- function V(t,{insertAt:o}={}){if(!t||typeof document>"u")return;let a=document.head||document.getElementsByTagName("head")[0],e=document.createElement("style");e.type="text/css",o==="top"&&a.firstChild?a.insertBefore(e,a.firstChild):a.appendChild(e),e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}V(`@import"./tailwind-config.css";*{box-sizing:border-box}html,body{font-family:system-ui,Avenir,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;box-sizing:border-box}button{cursor:pointer}a{text-decoration:none;color:inherit}ul,ol{list-style:none;padding:0}input,textarea,button,select{font:inherit;outline:none}
2
- `);import{ChevronRight as Me}from"lucide-react";import{clsx as Pe}from"clsx";import{twMerge as Ee}from"tailwind-merge";function r(...t){return Ee(Pe(t))}function J(t){return{handleEscape:a=>{a.key==="Escape"&&t()}}}function Q(t,o){return{handleClick:e=>{t.current&&!t.current.contains(e.target)&&o()}}}import{jsx as L,jsxs as Ie}from"react/jsx-runtime";function Y({items:t,className:o,separatorIcon:a=L(Me,{className:"w-4 h-4 text-gray-400 dark:text-gray-500"})}){return L("nav",{className:r("flex items-center space-x-2 text-sm font-medium text-gray-600 dark:text-gray-300",o),"aria-label":"Breadcrumb",children:t.map((e,l)=>{let s=l===t.length-1;return Ie("div",{className:"flex items-center",children:[e.href?L("a",{href:e.href,onClick:e.onClick,className:r("hover:text-primary-600 dark:hover:text-primary-400 transition-colors",s&&"text-primary-600 dark:text-primary-400"),children:e.label}):L("span",{className:r(s?"text-primary-600 dark:text-primary-400":"text-gray-500 dark:text-gray-400"),children:e.label}),!s&&L("span",{className:"mx-2 flex items-center",children:a})]},l)})})}import{Loader as j}from"lucide-react";import{jsx as I,jsxs as Se}from"react/jsx-runtime";function Z({text:t,icon:o,iconPosition:a="left",size:e="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 Se("button",{onClick:i,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",l==="primary"&&"focus:ring-secondary-500",l==="secondary"&&"focus:ring-secondary-400",l==="accent"&&"focus:ring-accent-500",{primary:`
3
- bg-secondary-500
4
- hover:bg-secondary-600
5
- active:bg-secondary-700
6
- hover:shadow-lg
7
- hover:shadow-secondary-500/30
8
- active:scale-[0.98]
9
- text-white
10
- `,secondary:`
11
- bg-secondary-50
12
- hover:bg-secondary-100
13
- active:bg-secondary-200
14
- hover:shadow-md
15
- hover:shadow-secondary-500/10
16
- active:scale-[0.98]
17
- text-secondary-700
18
- border border-secondary-200
19
- hover:border-secondary-300
20
- `,accent:`
21
- bg-accent-500
22
- hover:bg-accent-600
23
- active:bg-accent-700
24
- hover:shadow-lg
25
- hover:shadow-accent-500/30
26
- active:scale-[0.98]
27
- text-white
28
- `}[l],x[e],d),children:[o&&a==="left"&&I("span",{className:"flex items-center justify-center transition-transform duration-300 ease-in-out group-hover:scale-110",children:s?I(j,{className:"animate-spin",size:20}):o}),t&&I("span",{className:"transition-all duration-300",children:t}),o&&a==="right"&&I("span",{className:"flex items-center justify-center transition-transform duration-300 ease-in-out group-hover:scale-110",children:s?I(j,{className:"animate-spin",size:20}):o}),s&&I(j,{className:"animate-spin",size:20})]})}import{ChevronDownIcon as _e}from"lucide-react";import{useEffect as Le,useRef as Ae,useState as ee}from"react";import{jsx as A,jsxs as O}from"react/jsx-runtime";function te({title:t,children:o,defaultOpen:a=!1,icon:e,variant:l="primary",className:s,titleClassName:c,contentClassName:i}){let[d,x]=ee(a),[b,h]=ee(0),g=Ae(null);Le(()=>{g.current&&h(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:r("border rounded-lg overflow-hidden",s),children:[O("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",n.title),children:[O("div",{className:"flex items-center gap-3",children:[e&&A("span",{className:"flex-shrink-0",children:e}),A("span",{className:r("font-medium text-left",c),children:t})]}),A(_e,{className:r("w-5 h-5 transition-transform duration-300 flex-shrink-0",d&&"rotate-180")})]}),A("div",{className:r("transition-all duration-300 ease-out overflow-hidden",n.content),style:{height:`${b}px`},children:A("div",{ref:g,className:r("p-4",i),children:o})})]})}import{Eye as Fe,EyeOff as Be}from"lucide-react";import{useMemo as re,useState as D}from"react";import{jsx as C,jsxs as $}from"react/jsx-runtime";function ae({label:t,placeholder:o,type:a="text",icon:e,iconPosition:l="left",size:s="md",error:c,success:i,disabled:d=!1,required:x=!1,value:b,onChange:h,onFocus:g,onBlur:u,className:n}){let[m,p]=D(!1),[v,f]=D(""),[N,T]=D(!1),[P,M]=D(!1),z=b??v,q=!!z||P,G=a==="password",Ne=()=>{p(!0),g==null||g()},we=()=>{p(!1),u==null||u()},ke=E=>{b===void 0&&f(E.target.value),h==null||h(E)},Te=()=>T(E=>!E),k=re(()=>({sm:{input:"h-[38px] text-sm",padding:e?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:e?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:e?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"}}),[e,l]),Ce=re(()=>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]),Re=E=>{E.animationName==="onAutoFillStart"?M(!0):E.animationName==="onAutoFillCancel"&&M(!1)};return $("div",{className:r("w-full",n),children:[$("div",{className:"relative flex items-center",children:[C("input",{type:G&&N?"text":a,value:z,onChange:ke,onFocus:Ne,onBlur:we,onAnimationStart:Re,disabled:d,placeholder:t?"":o,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]",k[s].input,k[s].padding,Ce),autoComplete:"on"}),t&&$("label",{className:r("absolute pointer-events-none transition-all duration-300 ease-in-out font-medium",e&&l==="left"&&!q&&!m?k[s].padding:"left-4",m||q?r("top-0 -translate-y-1/2 bg-white px-2",k[s].labelFont,c?"text-error-600":i?"text-success-600":"text-accent-600"):r("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:[t,x&&C("span",{className:"text-error-500 ml-1",children:"*"})]}),e&&C("div",{className:r("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:r(k[s].icon,"mr-2"),children:e})}),G&&C("button",{type:"button",onClick:Te,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:N?C(Be,{className:r(k[s].icon)}):C(Fe,{className:r(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:`
29
- input {
30
- animation-name: onAutoFillCancel;
31
- }
32
- input:-webkit-autofill {
33
- animation-name: onAutoFillStart;
34
- }
35
- @keyframes onAutoFillStart {}
36
- @keyframes onAutoFillCancel {}
37
- `})]})}import{ArrowUpDown as ze,Box as De,ChevronDown as He,ChevronUp as Ve}from"lucide-react";import{useMemo as je,useState as Oe}from"react";import{jsx as oe}from"react/jsx-runtime";function H({className:t,variant:o="default",width:a="100%",height:e="1rem"}){return oe("div",{className:r("relative overflow-hidden bg-secondary-200 dark:bg-secondary-800","rounded-sm",o==="circle"&&"rounded-full",o==="rounded"&&"rounded-md",t),style:{width:typeof a=="number"?`${a}px`:a,height:typeof e=="number"?`${e}px`:e},children:oe("div",{className:"absolute inset-0 shimmer-mask"})})}import{jsx as y,jsxs as F}from"react/jsx-runtime";function se({columns:t,data:o,loading:a=!1,variant:e="clean",skeletonRows:l=5,actions:s,noDataText:c}){let[i,d]=Oe(null),x=je(()=>!i||!i.direction?o:[...o].sort((n,m)=>{let p=n[i.key],v=m[i.key];return p<v?i.direction==="asc"?-1:1:p>v?i.direction==="asc"?1:-1:0}),[o,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)},h=n=>n.sortable?!i||i.key!==n.key||!i.direction?y(ze,{size:15,className:"opacity-40"}):i.direction==="asc"?y(Ve,{size:15}):y(He,{size:15}):null,g=r("w-full border-separate border-spacing-0 transition-all duration-300",e==="clean"&&"bg-white",e==="elevated"&&"bg-white shadow-lg",e==="bordered"&&"border border-secondary-200 rounded-lg"),u=n=>r("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:t.map((n,m)=>y("th",{onClick:()=>b(n),className:r(u(n),m===0&&"rounded-tl-lg",m===t.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}),h(n)]})},String(n.key)))})}),y("tbody",{children:a?Array.from({length:l}).map((n,m)=>y("tr",{children:t.map((p,v)=>y("td",{className:"px-4 py-3",children:y(H,{height:18,variant:"rounded"})},v))},m)):x.map((n,m)=>y("tr",{className:r("border-b border-secondary-100 transition-all duration-200"),children:t.map((p,v)=>y("td",{className:r("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])},v))},m))})]})}),!a&&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 ne,useRef as We}from"react";import{jsx as S,jsxs as ie}from"react/jsx-runtime";function le({show:t,setShow:o,title:a,Header:e,Body:l,footer:s}){let c=We(null),{handleEscape:i}=J(()=>o(!1));ne(()=>(t?(document.addEventListener("keydown",i),document.body.style.overflow="hidden"):document.body.style.overflow="unset",()=>document.removeEventListener("keydown",i)),[t,i]);let{handleClick:d}=Q(c,()=>o(!1));return ne(()=>(t&&document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)),[t,d]),S("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",t?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none"),children:ie("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",t?"opacity-100 scale-100":"opacity-0 scale-90"),children:[(e||a)&&ie("div",{className:"flex items-center justify-between px-6 py-4 border-b border-secondary-300",children:[e||S("h2",{className:"text-xl font-semibold text-gray-800",children:a}),S("button",{onClick:()=>o(!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 Xe,ChevronRight as Ke}from"lucide-react";import{jsx as R,jsxs as W}from"react/jsx-runtime";function ce({totalItems:t,currentPage:o,perPage:a,onPageChange:e,onPerPageChange:l,siblingCount:s=1,perPageOptions:c=[10,20,30],showPerPage:i=!0}){let d=Math.ceil(t/a),b=(()=>{let u=s*2+5;if(d<=u)return Array.from({length:d},(N,T)=>T+1);let n=Math.max(o-s,2),m=Math.min(o+s,d-1),p=n>2,v=m<d-1,f=[1];p&&f.push("...");for(let N=n;N<=m;N++)f.push(N);return v&&f.push("..."),f.push(d),f})(),h=()=>{o>1&&e(o-1)},g=()=>{o<d&&e(o+1)};return W("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:a,onChange:u=>l(Number(u.target.value)),className:`border rounded-lg px-3 py-2 text-sm bg-white
38
- hover:border-secondary-500
39
- focus:outline-none focus:ring-2 focus:ring-secondary-500
40
- transition-all duration-200`,children:c.map(u=>W("option",{value:u,children:[u," / page"]},u))})}),W("div",{className:"flex items-center justify-center md:justify-end w-full",children:[R("button",{onClick:h,disabled:o===1,className:`flex items-center justify-center rounded-xl border px-3 py-2 transition-all duration-200
41
- ${o===1?"opacity-40 cursor-not-allowed":"hover:bg-secondary-100 hover:text-secondary-700"}`,children:R(Xe,{size:18})}),R("div",{className:"flex items-center gap-1 mx-2",children:b.map((u,n)=>R("button",{onClick:()=>typeof u=="number"&&e(u),disabled:u==="...",className:`min-w-[40px] rounded-xl border px-3 py-2 text-sm font-medium transition-all duration-200
42
- ${u===o?"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:o===d,className:`flex items-center justify-center rounded-xl border px-3 py-2 transition-all duration-200
43
- ${o===d?"opacity-40 cursor-not-allowed":"hover:bg-secondary-100 hover:text-secondary-700"}`,children:R(Ke,{size:18})})]})]})}import{useEffect as Ue,useRef as qe,useState as de}from"react";import{jsx as _,jsxs as X}from"react/jsx-runtime";function me({tabs:t,defaultTab:o,position:a="top",variant:e="primary",className:l,onChange:s}){var p,v;let[c,i]=de(o||((p=t[0])==null?void 0:p.id)),[d,x]=de({}),b=qe([]);Ue(()=>{let f=t.findIndex(T=>T.id===c),N=b.current[f];if(N){let{offsetLeft:T,offsetTop:P,offsetWidth:M,offsetHeight:z}=N;x({left:T,top:P,width:M,height:z,transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"})}},[c,a,t]);let h={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=a==="left"||a==="right";return X("div",{className:r("flex w-full",h[a],l),children:[X("div",{className:r("flex relative bg-gray-50 dark:bg-gray-900 rounded-lg p-1",g[a],m?"min-w-48":"w-full"),children:[_("div",{className:r("absolute rounded-md transition-all duration-300 ease-out",n[e].bg,m?"w-full":"h-full"),style:d}),t.map((f,N)=>{let T=c===f.id,P=n[e];return X("button",{ref:M=>{b.current[N]=M},onClick:()=>{f.disabled||(i(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",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:r("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:r("flex-1 overflow-hidden",u[a]),children:_("div",{className:"animate-fade-in",children:(v=t.find(f=>f.id===c))==null?void 0:v.content},c)})]})}function Ge({children:t,className:o}){return _("div",{className:r("p-6 rounded-lg bg-white dark:bg-gray-800 shadow-sm border border-gray-200 dark:border-gray-700",o),children:t})}import{X as Je}from"lucide-react";import{jsx as B,jsxs as Ze}from"react/jsx-runtime";var Qe={sm:"text-xs px-2 py-0.5",md:"text-sm px-3 py-1",lg:"text-base px-4 py-1.5"},K={sm:"w-3 h-3",md:"w-4 h-4",lg:"w-5 h-5"},Ye={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 ue({children:t,variant:o="default",size:a="md",icon:e,iconPosition:l="left",closable:s=!1,onClose:c,className:i}){return Ze("span",{className:r("inline-flex items-center font-medium animate-[fadeIn_0.3s_ease-out] rounded-[7px]",Qe[a],Ye[o],e&&"gap-1.5",i),children:[e&&l==="left"&&B("span",{className:`flex items-center ${r(K[a])}`,children:e}),B("span",{children:t}),e&&l==="right"&&B("span",{className:`flex items-center ${r(K[a])}`,children:e}),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(Je,{className:r(K[a])})})]})}import{useState as et}from"react";import{jsx as U,jsxs as fe}from"react/jsx-runtime";function pe({label:t,placeholder:o,value:a="",onChange:e,required:l=!1,disabled:s=!1,error:c,className:i,rows:d=4}){let[x,b]=et(!1),h=x||a.length>0;return fe("div",{className:"relative w-full",children:[t&&fe("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:[t,l&&U("span",{className:"text-error-500 ml-0.5",children:"*"})]}),U("textarea",{rows:d,placeholder:t?void 0:o,value:a,onChange:g=>e==null?void 0:e(g.target.value),onFocus:()=>b(!0),onBlur:()=>b(!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",t&&"pt-5",i)}),c&&U("p",{className:"mt-1 text-sm text-error-500",children:c})]})}import{AlertCircle as tt,CheckCircle2 as rt,Info as at,Loader2 as ot,X as st,XCircle as nt}from"lucide-react";import{useEffect as it,useState as be}from"react";import{jsx as w,jsxs as ge}from"react/jsx-runtime";function ye({id:t=Math.random().toString(36),title:o,description:a,type:e="info",duration:l=5e3,position:s="top-right",onClose:c,action:i}){let[d,x]=be(!1),[b,h]=be(!1);it(()=>{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=()=>{h(!0),setTimeout(()=>{x(!1),c==null||c(t)},300)},u=()=>{i==null||i.onClick(),g()},n={success:w(rt,{className:"w-5 h-5"}),error:w(nt,{className:"w-5 h-5"}),warning:w(tt,{className:"w-5 h-5"}),info:w(at,{className:"w-5 h-5"}),loading:w(ot,{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"},v={"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:r("fixed z-50 transform transition-all duration-300",v[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:ge("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[e]),children:[w("div",{className:r("flex-shrink-0 mt-0.5",p[e]),children:n[e]}),ge("div",{className:"flex-1 min-w-0",children:[w("h4",{className:"font-semibold text-sm mb-1",children:o}),a&&w("p",{className:"text-sm opacity-90",children:a}),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(st,{className:"w-4 h-4"})})]})}):null}import{Fragment as ct,jsx as xe}from"react/jsx-runtime";function lt({toasts:t,onRemove:o,position:a="top-right"}){return xe(ct,{children:t.map(e=>xe(ye,{...e,onClose:o,position:a},e.id))})}import{jsx as dt,jsxs as he}from"react/jsx-runtime";function ve({content:t,children:o,position:a="top",delay:e=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 he("div",{className:"relative inline-block group",children:[o,he("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[a],l),style:{transitionDelay:`${e}ms`},children:[t,dt("span",{className:r("absolute w-2 h-2 bg-gray-800 dark:bg-gray-900 rotate-45",c[a])})]})]})}export{Y as Breadcrumb,Z as Button,te as Collapse,ae as InputMain,se as MciTable,le as Modal,ce as Pagination,H as Skeleton,Ge as TabPanel,me as Tabs,ue as Tag,pe as Textarea,lt as ToastContainer,ve as Tooltip};
44
- //# sourceMappingURL=index.js.map