@moontra/moonui-pro 2.20.1 → 2.20.3

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 (162) hide show
  1. package/dist/index.d.ts +691 -261
  2. package/dist/index.mjs +7418 -4934
  3. package/package.json +11 -5
  4. package/plugin/index.d.ts +86 -0
  5. package/plugin/index.js +308 -0
  6. package/scripts/postbuild.js +27 -0
  7. package/scripts/postinstall.js +176 -23
  8. package/src/__tests__/use-intersection-observer.test.tsx +0 -216
  9. package/src/__tests__/use-local-storage.test.tsx +0 -174
  10. package/src/__tests__/use-pro-access.test.tsx +0 -183
  11. package/src/components/advanced-chart/advanced-chart.test.tsx +0 -281
  12. package/src/components/advanced-chart/index.tsx +0 -1242
  13. package/src/components/advanced-forms/index.tsx +0 -426
  14. package/src/components/animated-button/index.tsx +0 -385
  15. package/src/components/calendar/event-dialog.tsx +0 -372
  16. package/src/components/calendar/index.tsx +0 -1073
  17. package/src/components/calendar-pro/index.tsx +0 -1697
  18. package/src/components/color-picker/index.tsx +0 -432
  19. package/src/components/credit-card-input/index.tsx +0 -406
  20. package/src/components/dashboard/dashboard-grid.tsx +0 -462
  21. package/src/components/dashboard/demo.tsx +0 -425
  22. package/src/components/dashboard/index.tsx +0 -1046
  23. package/src/components/dashboard/time-range-picker.tsx +0 -336
  24. package/src/components/dashboard/types.ts +0 -222
  25. package/src/components/dashboard/widgets/activity-feed.tsx +0 -344
  26. package/src/components/dashboard/widgets/chart-widget.tsx +0 -418
  27. package/src/components/dashboard/widgets/metric-card.tsx +0 -343
  28. package/src/components/data-table/data-table-bulk-actions.tsx +0 -204
  29. package/src/components/data-table/data-table-column-toggle.tsx +0 -169
  30. package/src/components/data-table/data-table-export.ts +0 -156
  31. package/src/components/data-table/data-table-filter-drawer.tsx +0 -448
  32. package/src/components/data-table/data-table.test.tsx +0 -187
  33. package/src/components/data-table/index.tsx +0 -845
  34. package/src/components/draggable-list/index.tsx +0 -100
  35. package/src/components/enhanced/badge.tsx +0 -191
  36. package/src/components/enhanced/button.tsx +0 -362
  37. package/src/components/enhanced/card.tsx +0 -266
  38. package/src/components/enhanced/dialog.tsx +0 -246
  39. package/src/components/enhanced/index.ts +0 -4
  40. package/src/components/error-boundary/index.tsx +0 -109
  41. package/src/components/file-upload/file-upload.test.tsx +0 -243
  42. package/src/components/file-upload/index.tsx +0 -1660
  43. package/src/components/floating-action-button/index.tsx +0 -206
  44. package/src/components/form-wizard/form-wizard-context.tsx +0 -307
  45. package/src/components/form-wizard/form-wizard-navigation.tsx +0 -118
  46. package/src/components/form-wizard/form-wizard-progress.tsx +0 -298
  47. package/src/components/form-wizard/form-wizard-step.tsx +0 -111
  48. package/src/components/form-wizard/index.tsx +0 -102
  49. package/src/components/form-wizard/types.ts +0 -76
  50. package/src/components/gesture-drawer/index.tsx +0 -551
  51. package/src/components/github-stars/github-api.ts +0 -426
  52. package/src/components/github-stars/hooks.ts +0 -516
  53. package/src/components/github-stars/index.tsx +0 -375
  54. package/src/components/github-stars/types.ts +0 -148
  55. package/src/components/github-stars/variants.tsx +0 -513
  56. package/src/components/health-check/index.tsx +0 -439
  57. package/src/components/hover-card-3d/index.tsx +0 -530
  58. package/src/components/index.ts +0 -128
  59. package/src/components/internal/index.ts +0 -78
  60. package/src/components/kanban/add-card-modal.tsx +0 -502
  61. package/src/components/kanban/card-detail-modal.tsx +0 -761
  62. package/src/components/kanban/index.ts +0 -13
  63. package/src/components/kanban/kanban.tsx +0 -1684
  64. package/src/components/kanban/types.ts +0 -168
  65. package/src/components/lazy-component/index.tsx +0 -823
  66. package/src/components/license-error/index.tsx +0 -29
  67. package/src/components/magnetic-button/index.tsx +0 -167
  68. package/src/components/memory-efficient-data/index.tsx +0 -1016
  69. package/src/components/moonui-quiz-form/index.tsx +0 -817
  70. package/src/components/optimized-image/index.tsx +0 -425
  71. package/src/components/performance-debugger/index.tsx +0 -589
  72. package/src/components/performance-monitor/index.tsx +0 -794
  73. package/src/components/phone-number-input/index.tsx +0 -338
  74. package/src/components/pinch-zoom/index.tsx +0 -566
  75. package/src/components/quiz-form/index.tsx +0 -479
  76. package/src/components/rich-text-editor/index-old-backup.tsx +0 -437
  77. package/src/components/rich-text-editor/index.tsx +0 -2324
  78. package/src/components/rich-text-editor/slash-commands-extension.ts +0 -220
  79. package/src/components/rich-text-editor/slash-commands.css +0 -35
  80. package/src/components/rich-text-editor/table-styles.css +0 -65
  81. package/src/components/sidebar/index.tsx +0 -865
  82. package/src/components/spotlight-card/index.tsx +0 -191
  83. package/src/components/swipeable-card/index.tsx +0 -100
  84. package/src/components/timeline/index.tsx +0 -1148
  85. package/src/components/ui/accordion.tsx +0 -73
  86. package/src/components/ui/alert-dialog.tsx +0 -141
  87. package/src/components/ui/alert.tsx +0 -141
  88. package/src/components/ui/aspect-ratio.tsx +0 -245
  89. package/src/components/ui/avatar.tsx +0 -153
  90. package/src/components/ui/badge.tsx +0 -228
  91. package/src/components/ui/breadcrumb.tsx +0 -214
  92. package/src/components/ui/button.tsx +0 -222
  93. package/src/components/ui/calendar.tsx +0 -387
  94. package/src/components/ui/card.tsx +0 -214
  95. package/src/components/ui/checkbox.tsx +0 -259
  96. package/src/components/ui/collapsible.tsx +0 -135
  97. package/src/components/ui/color-picker.tsx +0 -97
  98. package/src/components/ui/command.tsx +0 -225
  99. package/src/components/ui/dialog.tsx +0 -334
  100. package/src/components/ui/dropdown-menu.tsx +0 -218
  101. package/src/components/ui/gesture-drawer.tsx +0 -11
  102. package/src/components/ui/hover-card.tsx +0 -29
  103. package/src/components/ui/index.ts +0 -190
  104. package/src/components/ui/input.tsx +0 -222
  105. package/src/components/ui/label.tsx +0 -29
  106. package/src/components/ui/lightbox.tsx +0 -606
  107. package/src/components/ui/magnetic-button.tsx +0 -129
  108. package/src/components/ui/media-gallery.tsx +0 -612
  109. package/src/components/ui/pagination.tsx +0 -123
  110. package/src/components/ui/popover.tsx +0 -185
  111. package/src/components/ui/progress.tsx +0 -30
  112. package/src/components/ui/radio-group.tsx +0 -257
  113. package/src/components/ui/scroll-area.tsx +0 -47
  114. package/src/components/ui/select.tsx +0 -374
  115. package/src/components/ui/separator.tsx +0 -145
  116. package/src/components/ui/sheet.tsx +0 -139
  117. package/src/components/ui/skeleton.tsx +0 -20
  118. package/src/components/ui/slider.tsx +0 -354
  119. package/src/components/ui/spotlight-card.tsx +0 -119
  120. package/src/components/ui/switch.tsx +0 -86
  121. package/src/components/ui/table.tsx +0 -329
  122. package/src/components/ui/tabs.tsx +0 -198
  123. package/src/components/ui/textarea.tsx +0 -28
  124. package/src/components/ui/toast.tsx +0 -317
  125. package/src/components/ui/toggle.tsx +0 -119
  126. package/src/components/ui/tooltip.tsx +0 -151
  127. package/src/components/virtual-list/index.tsx +0 -668
  128. package/src/hooks/use-chart.ts +0 -205
  129. package/src/hooks/use-data-table.ts +0 -182
  130. package/src/hooks/use-docs-pro-access.ts +0 -13
  131. package/src/hooks/use-license-check.ts +0 -65
  132. package/src/hooks/use-subscription.ts +0 -19
  133. package/src/hooks/use-toast.ts +0 -15
  134. package/src/index.ts +0 -14
  135. package/src/lib/ai-providers.ts +0 -377
  136. package/src/lib/component-metadata.ts +0 -18
  137. package/src/lib/micro-interactions.ts +0 -255
  138. package/src/lib/paddle.ts +0 -17
  139. package/src/lib/utils.ts +0 -6
  140. package/src/patterns/login-form/index.tsx +0 -276
  141. package/src/patterns/login-form/types.ts +0 -67
  142. package/src/setupTests.ts +0 -41
  143. package/src/styles/advanced-chart.css +0 -239
  144. package/src/styles/calendar.css +0 -35
  145. package/src/styles/design-system.css +0 -363
  146. package/src/styles/index.css +0 -85
  147. package/src/styles/tailwind.css +0 -7
  148. package/src/styles/tokens.css +0 -455
  149. package/src/types/moonui.d.ts +0 -22
  150. package/src/types/next-auth.d.ts +0 -21
  151. package/src/use-intersection-observer.tsx +0 -154
  152. package/src/use-local-storage.tsx +0 -71
  153. package/src/use-paddle.ts +0 -138
  154. package/src/use-performance-optimizer.ts +0 -389
  155. package/src/use-pro-access.ts +0 -141
  156. package/src/use-scroll-animation.ts +0 -219
  157. package/src/use-subscription.ts +0 -37
  158. package/src/use-toast.ts +0 -32
  159. package/src/utils/chart-helpers.ts +0 -357
  160. package/src/utils/cn.ts +0 -6
  161. package/src/utils/data-processing.ts +0 -151
  162. package/src/utils/license-validator.tsx +0 -183
@@ -1,338 +0,0 @@
1
- "use client"
2
-
3
- import React, { useState, useRef, useEffect } from "react"
4
- import { cn } from "../../lib/utils"
5
- import { Input } from "../ui/input"
6
- import { Label } from "../ui/label"
7
- import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../ui/select"
8
- import { Phone, Globe, Check, X } from "lucide-react"
9
- import { motion, AnimatePresence } from "framer-motion"
10
-
11
- // Ülke kodları ve bayrakları
12
- const countries = [
13
- { code: 'US', name: 'United States', dialCode: '+1', flag: '🇺🇸', format: '(xxx) xxx-xxxx' },
14
- { code: 'GB', name: 'United Kingdom', dialCode: '+44', flag: '🇬🇧', format: 'xxxx xxxxxx' },
15
- { code: 'TR', name: 'Turkey', dialCode: '+90', flag: '🇹🇷', format: '(xxx) xxx xx xx' },
16
- { code: 'DE', name: 'Germany', dialCode: '+49', flag: '🇩🇪', format: 'xxx xxxxxxxx' },
17
- { code: 'FR', name: 'France', dialCode: '+33', flag: '🇫🇷', format: 'x xx xx xx xx' },
18
- { code: 'IT', name: 'Italy', dialCode: '+39', flag: '🇮🇹', format: 'xxx xxxxxxx' },
19
- { code: 'ES', name: 'Spain', dialCode: '+34', flag: '🇪🇸', format: 'xxx xxx xxx' },
20
- { code: 'CN', name: 'China', dialCode: '+86', flag: '🇨🇳', format: 'xxx xxxx xxxx' },
21
- { code: 'JP', name: 'Japan', dialCode: '+81', flag: '🇯🇵', format: 'xx xxxx xxxx' },
22
- { code: 'KR', name: 'South Korea', dialCode: '+82', flag: '🇰🇷', format: 'xx xxxx xxxx' },
23
- { code: 'IN', name: 'India', dialCode: '+91', flag: '🇮🇳', format: 'xxxxx xxxxx' },
24
- { code: 'BR', name: 'Brazil', dialCode: '+55', flag: '🇧🇷', format: '(xx) xxxxx-xxxx' },
25
- { code: 'MX', name: 'Mexico', dialCode: '+52', flag: '🇲🇽', format: 'xxx xxx xxxx' },
26
- { code: 'CA', name: 'Canada', dialCode: '+1', flag: '🇨🇦', format: '(xxx) xxx-xxxx' },
27
- { code: 'AU', name: 'Australia', dialCode: '+61', flag: '🇦🇺', format: 'xxx xxx xxx' },
28
- { code: 'RU', name: 'Russia', dialCode: '+7', flag: '🇷🇺', format: '(xxx) xxx-xx-xx' },
29
- { code: 'NL', name: 'Netherlands', dialCode: '+31', flag: '🇳🇱', format: 'x xxxxxxxx' },
30
- { code: 'SE', name: 'Sweden', dialCode: '+46', flag: '🇸🇪', format: 'xx xxx xx xx' },
31
- { code: 'NO', name: 'Norway', dialCode: '+47', flag: '🇳🇴', format: 'xxx xx xxx' },
32
- { code: 'FI', name: 'Finland', dialCode: '+358', flag: '🇫🇮', format: 'xx xxxxxxx' }
33
- ]
34
-
35
- export interface PhoneNumberInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'value'> {
36
- value?: {
37
- country: string
38
- number: string
39
- }
40
- onChange?: (value: { country: string; number: string; fullNumber: string; isValid: boolean }) => void
41
- defaultCountry?: string
42
- countries?: typeof countries
43
- showFlags?: boolean
44
- showDialCode?: boolean
45
- autoFormat?: boolean
46
- validateOnChange?: boolean
47
- showValidationIcon?: boolean
48
- label?: string
49
- error?: string
50
- helperText?: string
51
- required?: boolean
52
- className?: string
53
- inputClassName?: string
54
- selectClassName?: string
55
- labelClassName?: string
56
- errorClassName?: string
57
- allowInternationalFormat?: boolean
58
- }
59
-
60
- // Telefon numarası formatlama
61
- function formatPhoneNumber(number: string, format: string): string {
62
- if (!number || !format) return ''
63
- const cleaned = number.replace(/\D/g, '')
64
- let formatted = ''
65
- let digitIndex = 0
66
-
67
- for (let i = 0; i < format.length && digitIndex < cleaned.length; i++) {
68
- if (format[i] === 'x') {
69
- formatted += cleaned[digitIndex]
70
- digitIndex++
71
- } else {
72
- formatted += format[i]
73
- }
74
- }
75
-
76
- return formatted
77
- }
78
-
79
- // Telefon numarası doğrulama
80
- function validatePhoneNumber(number: string, countryCode: string): boolean {
81
- if (!number || !countryCode) return false
82
- const cleaned = number.replace(/\D/g, '')
83
- const country = countries.find(c => c.code === countryCode)
84
-
85
- if (!country) return false
86
-
87
- // Format'taki x sayısını say
88
- const expectedLength = country.format.split('').filter(c => c === 'x').length
89
-
90
- return cleaned.length === expectedLength
91
- }
92
-
93
- // Uluslararası format dönüştürme
94
- function toInternationalFormat(countryCode: string, phoneNumber: string): string {
95
- if (!countryCode || !phoneNumber) return ''
96
- const country = countries.find(c => c.code === countryCode)
97
- if (!country) return phoneNumber
98
-
99
- const cleaned = phoneNumber.replace(/\D/g, '')
100
- return `${country.dialCode}${cleaned}`
101
- }
102
-
103
- export const MoonUIPhoneNumberInputPro = React.forwardRef<HTMLDivElement, PhoneNumberInputProps>(({
104
- value = { country: 'US', number: '' },
105
- onChange,
106
- defaultCountry = 'US',
107
- countries: customCountries,
108
- showFlags = true,
109
- showDialCode = true,
110
- autoFormat = true,
111
- validateOnChange = true,
112
- showValidationIcon = true,
113
- label,
114
- error,
115
- helperText,
116
- required,
117
- className,
118
- inputClassName,
119
- selectClassName,
120
- labelClassName,
121
- errorClassName,
122
- disabled,
123
- allowInternationalFormat = true,
124
- ...props
125
- }, ref) => {
126
- const [isValid, setIsValid] = useState(false)
127
- const [isFocused, setIsFocused] = useState(false)
128
- const inputRef = useRef<HTMLInputElement>(null)
129
-
130
- const countryList = customCountries || countries
131
- const selectedCountry = countryList.find(c => c.code === value.country) || countryList[0]
132
-
133
- // Doğrulama
134
- useEffect(() => {
135
- if (validateOnChange && value.number) {
136
- const valid = validatePhoneNumber(value.number, value.country)
137
- setIsValid(valid)
138
- }
139
- }, [value, validateOnChange])
140
-
141
- const handleCountryChange = (countryCode: string) => {
142
- const fullNumber = allowInternationalFormat
143
- ? toInternationalFormat(countryCode, value.number)
144
- : value.number
145
-
146
- onChange?.({
147
- country: countryCode,
148
- number: value.number,
149
- fullNumber,
150
- isValid: validatePhoneNumber(value.number, countryCode)
151
- })
152
- }
153
-
154
- const handleNumberChange = (e: React.ChangeEvent<HTMLInputElement>) => {
155
- let newValue = e.target.value
156
-
157
- if (autoFormat) {
158
- // Sadece sayıları al
159
- const cleaned = newValue.replace(/\D/g, '')
160
- // Format uygula
161
- newValue = formatPhoneNumber(cleaned, selectedCountry.format)
162
- }
163
-
164
- const valid = validatePhoneNumber(newValue, value.country)
165
- const fullNumber = allowInternationalFormat
166
- ? toInternationalFormat(value.country, newValue)
167
- : newValue
168
-
169
- onChange?.({
170
- country: value.country,
171
- number: newValue,
172
- fullNumber,
173
- isValid: valid
174
- })
175
- }
176
-
177
- const handlePaste = (e: React.ClipboardEvent<HTMLInputElement>) => {
178
- if (!autoFormat) return
179
-
180
- e.preventDefault()
181
- const pastedText = e.clipboardData.getData('text')
182
- const cleaned = pastedText.replace(/\D/g, '')
183
- const formatted = formatPhoneNumber(cleaned, selectedCountry.format)
184
-
185
- const valid = validatePhoneNumber(formatted, value.country)
186
- const fullNumber = allowInternationalFormat
187
- ? toInternationalFormat(value.country, formatted)
188
- : formatted
189
-
190
- onChange?.({
191
- country: value.country,
192
- number: formatted,
193
- fullNumber,
194
- isValid: valid
195
- })
196
- }
197
-
198
- return (
199
- <div ref={ref} className={cn("space-y-2", className)} {...props}>
200
- {label && (
201
- <Label htmlFor="phone-number" className={labelClassName}>
202
- {label}
203
- {required && <span className="text-destructive ml-1">*</span>}
204
- </Label>
205
- )}
206
-
207
- <div className="flex gap-2">
208
- {/* Ülke Seçici */}
209
- <Select
210
- value={value.country}
211
- onValueChange={handleCountryChange}
212
- disabled={disabled}
213
- >
214
- <SelectTrigger
215
- className={cn(
216
- "w-[140px]",
217
- error && "border-destructive",
218
- selectClassName
219
- )}
220
- >
221
- <SelectValue>
222
- <div className="flex items-center gap-2">
223
- {showFlags && <span className="text-lg">{selectedCountry.flag}</span>}
224
- {showDialCode && <span className="text-sm">{selectedCountry.dialCode}</span>}
225
- {!showFlags && !showDialCode && <span className="text-sm">{selectedCountry.code}</span>}
226
- </div>
227
- </SelectValue>
228
- </SelectTrigger>
229
- <SelectContent>
230
- {countryList.map((country) => (
231
- <SelectItem key={country.code} value={country.code}>
232
- <div className="flex items-center gap-2">
233
- {showFlags && <span className="text-lg">{country.flag}</span>}
234
- <span className="text-sm">{country.name}</span>
235
- {showDialCode && <span className="text-muted-foreground text-sm">{country.dialCode}</span>}
236
- </div>
237
- </SelectItem>
238
- ))}
239
- </SelectContent>
240
- </Select>
241
-
242
- {/* Telefon Numarası Input */}
243
- <div className="relative flex-1">
244
- <Input
245
- ref={inputRef}
246
- id="phone-number"
247
- type="tel"
248
- value={value.number}
249
- onChange={handleNumberChange}
250
- onPaste={handlePaste}
251
- onFocus={() => setIsFocused(true)}
252
- onBlur={() => setIsFocused(false)}
253
- placeholder={selectedCountry?.format?.replace(/x/g, '•') || 'Enter phone number'}
254
- className={cn(
255
- "pr-10",
256
- error && "border-destructive",
257
- inputClassName
258
- )}
259
- disabled={disabled}
260
- />
261
-
262
- {/* Doğrulama İkonu */}
263
- {showValidationIcon && value.number && (
264
- <div className="absolute right-3 top-1/2 -translate-y-1/2">
265
- <AnimatePresence mode="wait">
266
- {isValid ? (
267
- <motion.div
268
- key="valid"
269
- initial={{ scale: 0, opacity: 0 }}
270
- animate={{ scale: 1, opacity: 1 }}
271
- exit={{ scale: 0, opacity: 0 }}
272
- transition={{ duration: 0.2 }}
273
- >
274
- <Check className="w-4 h-4 text-green-500" />
275
- </motion.div>
276
- ) : (
277
- <motion.div
278
- key="invalid"
279
- initial={{ scale: 0, opacity: 0 }}
280
- animate={{ scale: 1, opacity: 1 }}
281
- exit={{ scale: 0, opacity: 0 }}
282
- transition={{ duration: 0.2 }}
283
- >
284
- <X className="w-4 h-4 text-destructive" />
285
- </motion.div>
286
- )}
287
- </AnimatePresence>
288
- </div>
289
- )}
290
- </div>
291
- </div>
292
-
293
- {/* Helper Text veya Error */}
294
- {(error || helperText) && (
295
- <AnimatePresence mode="wait">
296
- {error ? (
297
- <motion.p
298
- key="error"
299
- initial={{ opacity: 0, height: 0 }}
300
- animate={{ opacity: 1, height: 'auto' }}
301
- exit={{ opacity: 0, height: 0 }}
302
- className={cn("text-sm text-destructive", errorClassName)}
303
- >
304
- {error}
305
- </motion.p>
306
- ) : (
307
- <motion.p
308
- key="helper"
309
- initial={{ opacity: 0, height: 0 }}
310
- animate={{ opacity: 1, height: 'auto' }}
311
- exit={{ opacity: 0, height: 0 }}
312
- className="text-sm text-muted-foreground"
313
- >
314
- {helperText}
315
- </motion.p>
316
- )}
317
- </AnimatePresence>
318
- )}
319
-
320
- {/* Uluslararası Format Gösterimi */}
321
- {allowInternationalFormat && value.number && isValid && (
322
- <motion.div
323
- initial={{ opacity: 0, y: -10 }}
324
- animate={{ opacity: 1, y: 0 }}
325
- className="flex items-center gap-2 text-sm text-muted-foreground"
326
- >
327
- <Globe className="w-4 h-4" />
328
- <span>International: {toInternationalFormat(value.country, value.number)}</span>
329
- </motion.div>
330
- )}
331
- </div>
332
- )
333
- })
334
-
335
- MoonUIPhoneNumberInputPro.displayName = "MoonUIPhoneNumberInputPro"
336
-
337
- // Ülke listesini de export edelim
338
- export { countries as phoneCountries }