@istmx/ui 0.1.11 → 0.1.13

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 (55) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +533 -463
  3. package/bin/istmx.mjs +481 -314
  4. package/package.json +27 -27
  5. package/registry/accordion.tsx +186 -0
  6. package/registry/ai-chat-block/ai-chat-block.tsx +456 -460
  7. package/registry/ai-chat-block/ai-chat-input.tsx +694 -694
  8. package/registry/ai-chat-block/attachment.tsx +466 -466
  9. package/registry/ai-chat-block/chat-code-block.tsx +50 -50
  10. package/registry/ai-chat-block/chat-composer.tsx +51 -51
  11. package/registry/ai-chat-block/chat-logo.tsx +18 -18
  12. package/registry/ai-chat-block/chat-message.tsx +161 -161
  13. package/registry/ai-chat-block/chat-sidebar.tsx +273 -273
  14. package/registry/ai-chat-block/chat-user-avatar.tsx +9 -9
  15. package/registry/ai-chat-block/code-highlighter.tsx +342 -357
  16. package/registry/ai-chat-block/default-attachments.tsx +42 -42
  17. package/registry/ai-chat-block/index.ts +30 -30
  18. package/registry/ai-chat-block/message-content.tsx +287 -287
  19. package/registry/ai-chat-block/message-list.tsx +93 -93
  20. package/registry/ai-chat-block/send-button.tsx +102 -102
  21. package/registry/ai-chat-block/types.ts +70 -71
  22. package/registry/ai-chat-block/utils.ts +6 -6
  23. package/registry/ai-chat-block/voice-button.tsx +66 -66
  24. package/registry/alert-dialog.tsx +229 -0
  25. package/registry/alert.tsx +188 -0
  26. package/registry/animated-text.tsx +228 -225
  27. package/registry/aspect-ratio.tsx +32 -0
  28. package/registry/avatar-group.tsx +66 -0
  29. package/registry/avatar.tsx +121 -0
  30. package/registry/badge.tsx +52 -0
  31. package/registry/bento-grid.tsx +438 -433
  32. package/registry/button.tsx +156 -237
  33. package/registry/carousel.tsx +184 -0
  34. package/registry/dock-navigation.tsx +200 -198
  35. package/registry/drift-canvas.tsx +383 -0
  36. package/registry/drift-wall.tsx +361 -0
  37. package/registry/flex-carousel.tsx +1430 -0
  38. package/registry/guided-gallery.tsx +1506 -0
  39. package/registry/image-accordion.tsx +306 -302
  40. package/registry/image-trail.tsx +126 -121
  41. package/registry/infinite-image-canvas.tsx +268 -263
  42. package/registry/input-otp.tsx +332 -0
  43. package/registry/list-card.tsx +130 -0
  44. package/registry/mobile-menu-dock.tsx +216 -211
  45. package/registry/morph-slider.tsx +756 -0
  46. package/registry/pixel-cat.tsx +972 -1020
  47. package/registry/scroll-canvas-cards.tsx +643 -0
  48. package/registry/scroll-parallax-hero.tsx +566 -565
  49. package/registry/scroll-story-cards.tsx +443 -438
  50. package/registry/slider.tsx +163 -0
  51. package/registry/spotlight-grid.tsx +226 -0
  52. package/registry/streaming-text.tsx +269 -278
  53. package/registry/text-reveal.tsx +311 -307
  54. package/registry/user-avatar.tsx +99 -0
  55. package/registry/utils.ts +6 -6
@@ -0,0 +1,99 @@
1
+ 'use client'
2
+
3
+ import * as React from 'react'
4
+ import { motion } from 'motion/react'
5
+ import { IconUser } from '@tabler/icons-react'
6
+ import { cn } from '@/lib/utils'
7
+
8
+ export interface UserAvatarProps extends React.HTMLAttributes<HTMLDivElement> {
9
+ src?: string | null
10
+ alt?: string
11
+ IsAnimate?: boolean
12
+ isAnimate?: boolean
13
+ size?: 'sm' | 'md' | 'lg'
14
+ children?: React.ReactNode
15
+ }
16
+
17
+ const sizeClasses = {
18
+ sm: 'h-8 w-8 rounded-lg',
19
+ md: 'h-9 w-9 rounded-xl',
20
+ lg: 'h-12 w-12 rounded-2xl',
21
+ }
22
+
23
+ const iconSizes = {
24
+ sm: 'h-3.5 w-3.5',
25
+ md: 'h-4 w-4',
26
+ lg: 'h-6 w-6',
27
+ }
28
+
29
+ export const UserAvatar = React.forwardRef<HTMLDivElement, UserAvatarProps>(
30
+ (
31
+ {
32
+ src,
33
+ alt = 'User profile',
34
+ IsAnimate,
35
+ isAnimate = true,
36
+ size = 'md',
37
+ children,
38
+ className,
39
+ ...props
40
+ },
41
+ ref
42
+ ) => {
43
+ const shouldAnimate = IsAnimate !== undefined ? IsAnimate : isAnimate
44
+ const [imageError, setImageError] = React.useState(false)
45
+
46
+ React.useEffect(() => {
47
+ setImageError(false)
48
+ }, [src])
49
+
50
+ const containerClasses = cn(
51
+ 'relative inline-flex items-center justify-center overflow-hidden border-2',
52
+ 'border-[var(--button-border)] bg-[linear-gradient(to_bottom,var(--button-surface-top),var(--button-surface-bottom))]',
53
+ 'shadow-[inset_0_0_0_1px_var(--effect-white-full)] hover:border-[var(--button-border-hover)]',
54
+ 'text-foreground transition-[border-color,filter] duration-150 shrink-0 cursor-pointer',
55
+ sizeClasses[size],
56
+ className
57
+ )
58
+
59
+ const content = (
60
+ <>
61
+ {children ? (
62
+ children
63
+ ) : src && !imageError ? (
64
+ <img
65
+ src={src}
66
+ alt={alt}
67
+ onError={() => setImageError(true)}
68
+ className="h-full w-full object-cover"
69
+ />
70
+ ) : (
71
+ <IconUser className={cn(iconSizes[size], 'stroke-[1.8] text-foreground')} />
72
+ )}
73
+ </>
74
+ )
75
+
76
+ if (shouldAnimate) {
77
+ return (
78
+ <motion.div
79
+ ref={ref}
80
+ whileHover={{ y: -1 }}
81
+ whileTap={{ y: 1, scale: 0.94 }}
82
+ transition={{ type: 'spring', stiffness: 600, damping: 25 }}
83
+ className={containerClasses}
84
+ {...(props as any)}
85
+ >
86
+ {content}
87
+ </motion.div>
88
+ )
89
+ }
90
+
91
+ return (
92
+ <div ref={ref} className={containerClasses} {...props}>
93
+ {content}
94
+ </div>
95
+ )
96
+ }
97
+ )
98
+
99
+ UserAvatar.displayName = 'UserAvatar'
package/registry/utils.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { clsx, type ClassValue } from 'clsx'
2
- import { twMerge } from 'tailwind-merge'
3
-
4
- export function cn(...inputs: ClassValue[]) {
5
- return twMerge(clsx(inputs))
6
- }
1
+ import { clsx, type ClassValue } from 'clsx'
2
+ import { twMerge } from 'tailwind-merge'
3
+
4
+ export function cn(...inputs: ClassValue[]) {
5
+ return twMerge(clsx(inputs))
6
+ }