@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
@@ -1,150 +0,0 @@
1
- import {
2
- AlertCircle,
3
- CheckCircle2,
4
- Info,
5
- Loader2,
6
- X,
7
- XCircle,
8
- } from 'lucide-react'
9
- import { useEffect, useState } from 'react'
10
- import { cn } from '../../lib/utils.ts'
11
-
12
- // --- TYPES ---
13
- type ToastType = 'success' | 'error' | 'warning' | 'info' | 'loading'
14
-
15
- export type ToastProps = {
16
- id?: string
17
- title: string
18
- description?: string
19
- type?: ToastType
20
- duration?: number
21
- position?:
22
- | 'top-right'
23
- | 'top-left'
24
- | 'bottom-right'
25
- | 'bottom-left'
26
- | 'top-center'
27
- | 'bottom-center'
28
- onClose?: (id: string) => void
29
- action?: {
30
- label: string
31
- onClick: () => void
32
- }
33
- }
34
-
35
- // --- MAIN TOAST COMPONENT ---
36
- export function Toast({
37
- id = Math.random().toString(36),
38
- title,
39
- description,
40
- type = 'info',
41
- duration = 5000,
42
- position = 'top-right',
43
- onClose,
44
- action,
45
- }: ToastProps) {
46
- const [isVisible, setIsVisible] = useState(false)
47
- const [isLeaving, setIsLeaving] = useState(false)
48
-
49
- useEffect(() => {
50
- const showTimer = setTimeout(() => setIsVisible(true), 100)
51
- if (duration !== Infinity) {
52
- const closeTimer = setTimeout(() => handleClose(), duration)
53
- return () => {
54
- clearTimeout(showTimer)
55
- clearTimeout(closeTimer)
56
- }
57
- }
58
- return () => clearTimeout(showTimer)
59
- }, [duration])
60
-
61
- const handleClose = () => {
62
- setIsLeaving(true)
63
- setTimeout(() => {
64
- setIsVisible(false)
65
- onClose?.(id)
66
- }, 300)
67
- }
68
-
69
- const handleAction = () => {
70
- action?.onClick()
71
- handleClose()
72
- }
73
-
74
- const icons = {
75
- success: <CheckCircle2 className='w-5 h-5' />,
76
- error: <XCircle className='w-5 h-5' />,
77
- warning: <AlertCircle className='w-5 h-5' />,
78
- info: <Info className='w-5 h-5' />,
79
- loading: <Loader2 className='w-5 h-5 animate-spin' />,
80
- }
81
-
82
- const variantClasses = {
83
- success: 'bg-success-50 border-success-200 text-success-800',
84
- error: 'bg-error-50 border-error-200 text-error-800',
85
- warning: 'bg-secondary-50 border-secondary-200 text-secondary-800',
86
- info: 'bg-info-50 border-info-200 text-info-800',
87
- loading: 'bg-gray-50 border-gray-200 text-gray-800',
88
- }
89
-
90
- const iconColors = {
91
- success: 'text-success-600',
92
- error: 'text-error-600',
93
- warning: 'text-secondary-600',
94
- info: 'text-info-600',
95
- loading: 'text-gray-600',
96
- }
97
-
98
- const positionClasses = {
99
- 'top-right': 'top-4 right-4',
100
- 'top-left': 'top-4 left-4',
101
- 'bottom-right': 'bottom-4 right-4',
102
- 'bottom-left': 'bottom-4 left-4',
103
- 'top-center': 'top-4 left-1/2 -translate-x-1/2',
104
- 'bottom-center': 'bottom-4 left-1/2 -translate-x-1/2',
105
- }
106
-
107
- if (!isVisible) return null
108
-
109
- return (
110
- <div
111
- className={cn(
112
- 'fixed z-50 transform transition-all duration-300',
113
- positionClasses[position],
114
- isLeaving ? 'opacity-0 scale-95' : 'opacity-100 scale-100',
115
- position.includes('top') && !isLeaving && 'animate-slide-down',
116
- position.includes('bottom') && !isLeaving && 'animate-slide-up'
117
- )}
118
- >
119
- <div
120
- className={cn(
121
- 'flex items-start gap-3 p-4 rounded-lg border shadow-lg max-w-sm',
122
- 'backdrop-blur-sm bg-white/95',
123
- variantClasses[type]
124
- )}
125
- >
126
- <div className={cn('flex-shrink-0 mt-0.5', iconColors[type])}>
127
- {icons[type]}
128
- </div>
129
- <div className='flex-1 min-w-0'>
130
- <h4 className='font-semibold text-sm mb-1'>{title}</h4>
131
- {description && <p className='text-sm opacity-90'>{description}</p>}
132
- {action && (
133
- <button
134
- onClick={handleAction}
135
- className='mt-2 text-sm font-medium underline underline-offset-2 hover:no-underline'
136
- >
137
- {action.label}
138
- </button>
139
- )}
140
- </div>
141
- <button
142
- onClick={handleClose}
143
- className='flex-shrink-0 p-1 rounded-full hover:bg-black/5 transition-colors'
144
- >
145
- <X className='w-4 h-4' />
146
- </button>
147
- </div>
148
- </div>
149
- )
150
- }
@@ -1,19 +0,0 @@
1
- import { Toast, type ToastProps } from './Toast.tsx'
2
-
3
- export function ToastContainer({
4
- toasts,
5
- onRemove,
6
- position = 'top-right',
7
- }: {
8
- toasts: ToastProps[]
9
- onRemove: (id: string) => void
10
- position?: ToastProps['position']
11
- }) {
12
- return (
13
- <>
14
- {toasts.map(t => (
15
- <Toast key={t.id} {...t} onClose={onRemove} position={position} />
16
- ))}
17
- </>
18
- )
19
- }
@@ -1,58 +0,0 @@
1
- import React from 'react'
2
- import { cn } from '../../lib/utils.ts'
3
-
4
- type TooltipProps = {
5
- content: React.ReactNode
6
- children: React.ReactNode
7
- position?: 'top' | 'bottom' | 'left' | 'right'
8
- delay?: number
9
- className?: string
10
- }
11
-
12
- export default function Tooltip({
13
- content,
14
- children,
15
- position = 'top',
16
- delay = 200,
17
- className,
18
- }: TooltipProps) {
19
- const positionClasses = {
20
- top: 'bottom-full left-1/2 -translate-x-1/2 mb-2',
21
- bottom: 'top-full left-1/2 -translate-x-1/2 mt-2',
22
- left: 'right-full top-1/2 -translate-y-1/2 mr-2',
23
- right: 'left-full top-1/2 -translate-y-1/2 ml-2',
24
- }
25
-
26
- const arrowClasses = {
27
- top: 'left-1/2 -translate-x-1/2 top-full',
28
- bottom: 'left-1/2 -translate-x-1/2 bottom-full',
29
- left: 'top-1/2 -translate-y-1/2 left-full',
30
- right: 'top-1/2 -translate-y-1/2 right-full',
31
- }
32
-
33
- return (
34
- <div className='relative inline-block group'>
35
- {children}
36
-
37
- <div
38
- className={cn(
39
- 'absolute z-50 whitespace-nowrap rounded-md bg-gray-800 text-white text-xs px-2 py-1 shadow-md dark:bg-gray-900',
40
- 'transition-all opacity-0 scale-95 group-hover:opacity-100 group-hover:scale-100',
41
- 'group-hover:delay-200 duration-200 ease-out',
42
- positionClasses[position],
43
- className
44
- )}
45
- style={{ transitionDelay: `${delay}ms` }}
46
- >
47
- {content}
48
-
49
- <span
50
- className={cn(
51
- 'absolute w-2 h-2 bg-gray-800 dark:bg-gray-900 rotate-45',
52
- arrowClasses[position]
53
- )}
54
- />
55
- </div>
56
- </div>
57
- )
58
- }
@@ -1,36 +0,0 @@
1
- @import './tailwind-config.css';
2
-
3
- * {
4
- box-sizing: border-box;
5
- }
6
-
7
- html,
8
- body {
9
- font-family: system-ui, Avenir, sans-serif;
10
- -webkit-font-smoothing: antialiased;
11
- -moz-osx-font-smoothing: grayscale;
12
- box-sizing: border-box;
13
- }
14
-
15
- button {
16
- cursor: pointer;
17
- }
18
-
19
- a {
20
- text-decoration: none;
21
- color: inherit;
22
- }
23
-
24
- ul,
25
- ol {
26
- list-style: none;
27
- padding: 0;
28
- }
29
-
30
- input,
31
- textarea,
32
- button,
33
- select {
34
- font: inherit;
35
- outline: none;
36
- }
@@ -1,294 +0,0 @@
1
- @import 'tailwindcss';
2
-
3
- @variant dark (&:where(.dark, .dark *));
4
-
5
- @theme {
6
- /* Main colors */
7
- --color-secondary-base: #d4af37;
8
- --color-secondary-50: #faf6ea;
9
- --color-secondary-100: #f5edd5;
10
- --color-secondary-200: #fdebd0;
11
- --color-secondary-300: #e1c981;
12
- --color-secondary-400: #d7b757;
13
- --color-secondary-500: #d4af37;
14
- --color-secondary-600: #b8951e;
15
- --color-secondary-700: #8a7016;
16
- --color-secondary-800: #5c4b0f;
17
- --color-secondary-900: #2e2607;
18
-
19
- /* Green colors */
20
- --color-accent-base: #00a651;
21
- --color-accent-50: #e6f7ee;
22
- --color-accent-100: #ccefdd;
23
- --color-accent-200: #99dfbb;
24
- --color-accent-300: #66cf99;
25
- --color-accent-400: #33bf77;
26
- --color-accent-500: #00a651;
27
- --color-accent-600: #008541;
28
- --color-accent-700: #006431;
29
- --color-accent-800: #004320;
30
- --color-accent-900: #002110;
31
-
32
- /* Error colors */
33
- --color-error-50: #fef2f2;
34
- --color-error-100: #fee2e2;
35
- --color-error-200: #fecaca;
36
- --color-error-300: #fca5a5;
37
- --color-error-400: #f87171;
38
- --color-error-500: #ef4444;
39
- --color-error-600: #dc2626;
40
- --color-error-700: #b91c1c;
41
- --color-error-800: #991b1b;
42
- --color-error-900: #7f1d1d;
43
-
44
- /* Success colors */
45
- --color-success-50: #f0fdf4;
46
- --color-success-100: #dcfce7;
47
- --color-success-200: #bbf7d0;
48
- --color-success-300: #86efac;
49
- --color-success-400: #4ade80;
50
- --color-success-500: #22c55e;
51
- --color-success-600: #16a34a;
52
- --color-success-700: #15803d;
53
- --color-success-800: #166534;
54
- --color-success-900: #14532d;
55
-
56
- /* Info colors */
57
- --color-info-50: #eff6ff;
58
- --color-info-100: #dbeafe;
59
- --color-info-200: #bfdbfe;
60
- --color-info-300: #93c5fd;
61
- --color-info-400: #60a5fa;
62
- --color-info-500: #3b82f6;
63
- --color-info-600: #2563eb;
64
- --color-info-700: #1d4ed8;
65
- --color-info-800: #1e40af;
66
- --color-info-900: #1e3a8a;
67
-
68
- /* Sarlavhalar */
69
- --text-display-2xl: 72px;
70
- --text-display-2xl--line-height: 90px;
71
- --text-display-2xl--font-weight: 700;
72
- --text-display-2xl--letter-spacing: -0.02em;
73
-
74
- --text-display-xl: 60px;
75
- --text-display-xl--line-height: 72px;
76
- --text-display-xl--font-weight: 700;
77
- --text-display-xl--letter-spacing: -0.02em;
78
-
79
- --text-display-lg: 48px;
80
- --text-display-lg--line-height: 60px;
81
- --text-display-lg--font-weight: 700;
82
- --text-display-lg--letter-spacing: -0.01em;
83
-
84
- --text-display-md: 36px;
85
- --text-display-md--line-height: 44px;
86
- --text-display-md--font-weight: 700;
87
- --text-display-md--letter-spacing: -0.01em;
88
-
89
- --text-display-sm: 30px;
90
- --text-display-sm--line-height: 38px;
91
- --text-display-sm--font-weight: 700;
92
-
93
- --text-H1: 48px;
94
- --text-H1--line-height: 60px;
95
- --text-H1--font-weight: 700;
96
- --text-H1--letter-spacing: -0.01em;
97
-
98
- --text-H2: 40px;
99
- --text-H2--line-height: 50px;
100
- --text-H2--font-weight: 700;
101
- --text-H2--letter-spacing: -0.01em;
102
-
103
- --text-H3: 32px;
104
- --text-H3--line-height: 40px;
105
- --text-H3--font-weight: 700;
106
-
107
- --text-H4: 24px;
108
- --text-H4--line-height: 32px;
109
- --text-H4--font-weight: 700;
110
-
111
- --text-H5: 20px;
112
- --text-H5--line-height: 28px;
113
- --text-H5--font-weight: 600;
114
-
115
- --text-H6: 18px;
116
- --text-H6--line-height: 26px;
117
- --text-H6--font-weight: 600;
118
-
119
- /* Animatsiyalar */
120
- --animate-fade-in: fadeIn 0.5s ease-in-out;
121
- --animate-fade-out: fadeOut 0.5s ease-in-out;
122
- --animate-slide-up: slideUp 0.5s ease-out;
123
- --animate-slide-down: slideDown 0.5s ease-out;
124
- --animate-slide-left: slideLeft 0.5s ease-out;
125
- --animate-slide-right: slideRight 0.5s ease-out;
126
- --animate-scale-up: scaleUp 0.3s ease-out;
127
- --animate-scale-down: scaleDown 0.3s ease-out;
128
- --animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
129
- --animate-spin: spin 0.3s linear infinite;
130
- }
131
-
132
- /* Animatsiya keyframes */
133
- @keyframes fadeIn {
134
- from {
135
- opacity: 0;
136
- }
137
- to {
138
- opacity: 1;
139
- }
140
- }
141
-
142
- @keyframes fadeOut {
143
- from {
144
- opacity: 1;
145
- }
146
- to {
147
- opacity: 0;
148
- }
149
- }
150
-
151
- @keyframes slideUp {
152
- from {
153
- transform: translateY(20px);
154
- opacity: 0;
155
- }
156
- to {
157
- transform: translateY(0);
158
- opacity: 1;
159
- }
160
- }
161
-
162
- @keyframes slideDown {
163
- from {
164
- transform: translateY(-20px);
165
- opacity: 0;
166
- }
167
- to {
168
- transform: translateY(0);
169
- opacity: 1;
170
- }
171
- }
172
-
173
- @keyframes slideLeft {
174
- from {
175
- transform: translateX(20px);
176
- opacity: 0;
177
- }
178
- to {
179
- transform: translateX(0);
180
- opacity: 1;
181
- }
182
- }
183
-
184
- @keyframes slideRight {
185
- from {
186
- transform: translateX(-20px);
187
- opacity: 0;
188
- }
189
- to {
190
- transform: translateX(0);
191
- opacity: 1;
192
- }
193
- }
194
-
195
- @keyframes scaleUp {
196
- from {
197
- transform: scale(0.95);
198
- opacity: 0;
199
- }
200
- to {
201
- transform: scale(1);
202
- opacity: 1;
203
- }
204
- }
205
-
206
- @keyframes scaleDown {
207
- from {
208
- transform: scale(1.05);
209
- opacity: 0;
210
- }
211
- to {
212
- transform: scale(1);
213
- opacity: 1;
214
- }
215
- }
216
-
217
- @keyframes pulse {
218
- 0%,
219
- 100% {
220
- opacity: 1;
221
- }
222
- 50% {
223
- opacity: 0.5;
224
- }
225
- }
226
-
227
- @keyframes spin {
228
- from {
229
- transform: rotate(0deg);
230
- }
231
- to {
232
- transform: rotate(360deg);
233
- }
234
- }
235
-
236
- @keyframes smooth-shimmer {
237
- 0% {
238
- transform: translateX(-100%);
239
- }
240
- 100% {
241
- transform: translateX(100%);
242
- }
243
- }
244
-
245
- @keyframes float {
246
- 0%, 100% {
247
- transform: translateY(0);
248
- }
249
- 50% {
250
- transform: translateY(-6px);
251
- }
252
- }
253
-
254
- @keyframes fadeUp {
255
- from {
256
- opacity: 0;
257
- transform: translateY(8px);
258
- }
259
- to {
260
- opacity: 1;
261
- transform: translateY(0);
262
- }
263
- }
264
-
265
-
266
- .shimmer-mask {
267
- background: linear-gradient(
268
- 90deg,
269
- transparent 0%,
270
- rgba(255, 255, 255, 0.35) 50%,
271
- transparent 100%
272
- );
273
- animation: smooth-shimmer 1.8s ease-in-out infinite;
274
- will-change: transform;
275
- }
276
-
277
- /* Modal Fade In / Out */
278
- .modal-fade-in {
279
- animation: fadeIn 0.3s ease-in-out forwards;
280
- }
281
-
282
- .modal-fade-out {
283
- animation: fadeOut 0.3s ease-in-out forwards;
284
- }
285
-
286
- /* Modal Scale */
287
- .modal-scale-in {
288
- animation: scaleUp 0.3s ease-out forwards;
289
- }
290
-
291
- /* Close icon aylanish animatsiyasi */
292
- .rotate-icon {
293
- animation: spin 0.3s ease-in-out;
294
- }