@campxdev/react-native-blueprint 0.1.20 → 0.1.24

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 (126) hide show
  1. package/global.css +3 -3
  2. package/lib/global.css +1 -1
  3. package/lib/module/assets/icons/Image.png +0 -0
  4. package/lib/module/components/DataDisplay/Avatar/Avatar.js +1 -1
  5. package/lib/module/components/DataDisplay/Avatar/Avatar.js.map +1 -1
  6. package/lib/module/components/DataDisplay/Banner/Banner.figma.js +17 -3
  7. package/lib/module/components/DataDisplay/Banner/Banner.figma.js.map +1 -1
  8. package/lib/module/components/DataDisplay/Banner/Banner.js +138 -34
  9. package/lib/module/components/DataDisplay/Banner/Banner.js.map +1 -1
  10. package/lib/module/components/DataDisplay/CalendarItem/CalendarItem.js +2 -2
  11. package/lib/module/components/DataDisplay/CalendarItem/CalendarItem.js.map +1 -1
  12. package/lib/module/components/DataDisplay/Card/Card.figma.js +11 -4
  13. package/lib/module/components/DataDisplay/Card/Card.figma.js.map +1 -1
  14. package/lib/module/components/DataDisplay/Card/Card.js +119 -65
  15. package/lib/module/components/DataDisplay/Card/Card.js.map +1 -1
  16. package/lib/module/components/DataDisplay/ChatBubble/ChatBubble.figma.js +54 -0
  17. package/lib/module/components/DataDisplay/ChatBubble/ChatBubble.figma.js.map +1 -0
  18. package/lib/module/components/DataDisplay/ChatBubble/ChatBubble.js +318 -0
  19. package/lib/module/components/DataDisplay/ChatBubble/ChatBubble.js.map +1 -0
  20. package/lib/module/components/DataDisplay/ChatBubble/index.js +4 -0
  21. package/lib/module/components/DataDisplay/ChatBubble/index.js.map +1 -0
  22. package/lib/module/components/DataDisplay/FeedCard/AttachmentDetails.js +69 -0
  23. package/lib/module/components/DataDisplay/FeedCard/AttachmentDetails.js.map +1 -0
  24. package/lib/module/components/DataDisplay/FeedCard/FeedCard.figma.js +19 -17
  25. package/lib/module/components/DataDisplay/FeedCard/FeedCard.figma.js.map +1 -1
  26. package/lib/module/components/DataDisplay/FeedCard/FeedCard.js +30 -19
  27. package/lib/module/components/DataDisplay/FeedCard/FeedCard.js.map +1 -1
  28. package/lib/module/components/DataDisplay/Greeting/Greeting.figma.js +5 -5
  29. package/lib/module/components/DataDisplay/Greeting/Greeting.figma.js.map +1 -1
  30. package/lib/module/components/DataDisplay/Greeting/Greeting.js +46 -70
  31. package/lib/module/components/DataDisplay/Greeting/Greeting.js.map +1 -1
  32. package/lib/module/components/DataDisplay/ProfileCard/ProfileCard.figma.js +16 -0
  33. package/lib/module/components/DataDisplay/ProfileCard/ProfileCard.figma.js.map +1 -0
  34. package/lib/module/components/DataDisplay/ProfileCard/ProfileCard.js +111 -0
  35. package/lib/module/components/DataDisplay/ProfileCard/ProfileCard.js.map +1 -0
  36. package/lib/module/components/DataDisplay/ProfileCard/index.js +4 -0
  37. package/lib/module/components/DataDisplay/ProfileCard/index.js.map +1 -0
  38. package/lib/module/components/Input/Button/Button.js +11 -9
  39. package/lib/module/components/Input/Button/Button.js.map +1 -1
  40. package/lib/module/components/Navigation/Appbar/AppBar.figma.js +18 -6
  41. package/lib/module/components/Navigation/Appbar/AppBar.figma.js.map +1 -1
  42. package/lib/module/components/Navigation/Appbar/AppBar.js +36 -9
  43. package/lib/module/components/Navigation/Appbar/AppBar.js.map +1 -1
  44. package/lib/module/components/Navigation/Popover/Popover.js +1 -1
  45. package/lib/module/components/Navigation/Popover/Popover.js.map +1 -1
  46. package/lib/module/components/ui/index.js +2 -0
  47. package/lib/module/components/ui/index.js.map +1 -1
  48. package/lib/module/lib/theme.js +2 -2
  49. package/lib/module/patterns/pattern-components/AccountPattern/AccountPattern.figma.js +196 -0
  50. package/lib/module/patterns/pattern-components/AccountPattern/AccountPattern.figma.js.map +1 -0
  51. package/lib/module/patterns/pattern-components/AccountPattern/AccountPattern.js +255 -0
  52. package/lib/module/patterns/pattern-components/AccountPattern/AccountPattern.js.map +1 -0
  53. package/lib/module/patterns/pattern-components/AccountPattern/index.js +4 -0
  54. package/lib/module/patterns/pattern-components/AccountPattern/index.js.map +1 -0
  55. package/lib/module/patterns/pattern-components/CalendarPattern/CalendarPattern.figma.js +1 -1
  56. package/lib/module/patterns/pattern-components/CardListPattern/CardListPattern.js +2 -4
  57. package/lib/module/patterns/pattern-components/CardListPattern/CardListPattern.js.map +1 -1
  58. package/lib/module/patterns/pattern-components/FeedPattern/FeedPattern.figma.js +144 -0
  59. package/lib/module/patterns/pattern-components/FeedPattern/FeedPattern.figma.js.map +1 -0
  60. package/lib/module/patterns/pattern-components/FeedPattern/FeedPattern.js +213 -0
  61. package/lib/module/patterns/pattern-components/FeedPattern/FeedPattern.js.map +1 -0
  62. package/lib/module/patterns/pattern-components/FeedPattern/index.js +4 -0
  63. package/lib/module/patterns/pattern-components/FeedPattern/index.js.map +1 -0
  64. package/lib/module/patterns/pattern-components/HomeFacultyPattern/HomeFacultyPattern.figma.js +70 -0
  65. package/lib/module/patterns/pattern-components/HomeFacultyPattern/HomeFacultyPattern.figma.js.map +1 -0
  66. package/lib/module/patterns/pattern-components/HomeFacultyPattern/HomeFacultyPattern.js +260 -0
  67. package/lib/module/patterns/pattern-components/HomeFacultyPattern/HomeFacultyPattern.js.map +1 -0
  68. package/lib/module/patterns/pattern-components/HomeFacultyPattern/index.js +4 -0
  69. package/lib/module/patterns/pattern-components/HomeFacultyPattern/index.js.map +1 -0
  70. package/lib/module/patterns/pattern-components/HomeParentPattern/HomeParentPattern.figma.js +82 -0
  71. package/lib/module/patterns/pattern-components/HomeParentPattern/HomeParentPattern.figma.js.map +1 -0
  72. package/lib/module/patterns/pattern-components/HomeParentPattern/HomeParentPattern.js +256 -0
  73. package/lib/module/patterns/pattern-components/HomeParentPattern/HomeParentPattern.js.map +1 -0
  74. package/lib/module/patterns/pattern-components/HomeParentPattern/index.js +4 -0
  75. package/lib/module/patterns/pattern-components/HomeParentPattern/index.js.map +1 -0
  76. package/lib/module/patterns/pattern-components/HomeStudentPattern/HomeStudentPattern.figma.js +73 -0
  77. package/lib/module/patterns/pattern-components/HomeStudentPattern/HomeStudentPattern.figma.js.map +1 -0
  78. package/lib/module/patterns/pattern-components/HomeStudentPattern/HomeStudentPattern.js +283 -0
  79. package/lib/module/patterns/pattern-components/HomeStudentPattern/HomeStudentPattern.js.map +1 -0
  80. package/lib/module/patterns/pattern-components/HomeStudentPattern/index.js +4 -0
  81. package/lib/module/patterns/pattern-components/HomeStudentPattern/index.js.map +1 -0
  82. package/lib/module/patterns/pattern-components/index.js +5 -0
  83. package/lib/module/patterns/pattern-components/index.js.map +1 -1
  84. package/package.json +27 -1
  85. package/src/assets/icons/Image.png +0 -0
  86. package/src/components/DataDisplay/Avatar/Avatar.tsx +24 -21
  87. package/src/components/DataDisplay/Banner/Banner.figma.tsx +18 -3
  88. package/src/components/DataDisplay/Banner/Banner.tsx +153 -26
  89. package/src/components/DataDisplay/CalendarItem/CalendarItem.tsx +2 -2
  90. package/src/components/DataDisplay/Card/Card.figma.tsx +7 -3
  91. package/src/components/DataDisplay/Card/Card.tsx +152 -101
  92. package/src/components/DataDisplay/ChatBubble/ChatBubble.figma.tsx +54 -0
  93. package/src/components/DataDisplay/ChatBubble/ChatBubble.tsx +404 -0
  94. package/src/components/DataDisplay/ChatBubble/index.ts +8 -0
  95. package/src/components/DataDisplay/FeedCard/AttachmentDetails.tsx +96 -0
  96. package/src/components/DataDisplay/FeedCard/FeedCard.figma.tsx +17 -15
  97. package/src/components/DataDisplay/FeedCard/FeedCard.tsx +66 -35
  98. package/src/components/DataDisplay/Greeting/Greeting.figma.tsx +5 -5
  99. package/src/components/DataDisplay/Greeting/Greeting.tsx +58 -96
  100. package/src/components/DataDisplay/ProfileCard/ProfileCard.figma.tsx +17 -0
  101. package/src/components/DataDisplay/ProfileCard/ProfileCard.tsx +173 -0
  102. package/src/components/DataDisplay/ProfileCard/index.ts +1 -0
  103. package/src/components/Input/Button/Button.tsx +18 -10
  104. package/src/components/Navigation/Appbar/AppBar.figma.tsx +18 -6
  105. package/src/components/Navigation/Appbar/AppBar.tsx +58 -13
  106. package/src/components/Navigation/Popover/Popover.tsx +3 -3
  107. package/src/components/ui/index.ts +2 -0
  108. package/src/lib/theme.ts +2 -2
  109. package/src/patterns/pattern-components/AccountPattern/AccountPattern.figma.tsx +193 -0
  110. package/src/patterns/pattern-components/AccountPattern/AccountPattern.tsx +301 -0
  111. package/src/patterns/pattern-components/AccountPattern/index.ts +1 -0
  112. package/src/patterns/pattern-components/CalendarPattern/CalendarPattern.figma.tsx +1 -1
  113. package/src/patterns/pattern-components/CardListPattern/CardListPattern.tsx +4 -9
  114. package/src/patterns/pattern-components/FeedPattern/FeedPattern.figma.tsx +146 -0
  115. package/src/patterns/pattern-components/FeedPattern/FeedPattern.tsx +264 -0
  116. package/src/patterns/pattern-components/FeedPattern/index.ts +2 -0
  117. package/src/patterns/pattern-components/HomeFacultyPattern/HomeFacultyPattern.figma.tsx +66 -0
  118. package/src/patterns/pattern-components/HomeFacultyPattern/HomeFacultyPattern.tsx +326 -0
  119. package/src/patterns/pattern-components/HomeFacultyPattern/index.ts +2 -0
  120. package/src/patterns/pattern-components/HomeParentPattern/HomeParentPattern.figma.tsx +75 -0
  121. package/src/patterns/pattern-components/HomeParentPattern/HomeParentPattern.tsx +328 -0
  122. package/src/patterns/pattern-components/HomeParentPattern/index.ts +2 -0
  123. package/src/patterns/pattern-components/HomeStudentPattern/HomeStudentPattern.figma.tsx +66 -0
  124. package/src/patterns/pattern-components/HomeStudentPattern/HomeStudentPattern.tsx +355 -0
  125. package/src/patterns/pattern-components/HomeStudentPattern/index.ts +2 -0
  126. package/src/patterns/pattern-components/index.ts +5 -0
@@ -2,15 +2,14 @@
2
2
  import React from 'react';
3
3
  import { View as RNView, Pressable as RNPressable } from 'react-native';
4
4
  import { cssInterop } from 'nativewind';
5
- import { LinearGradient } from 'expo-linear-gradient';
5
+ import { cva } from 'class-variance-authority';
6
6
  import { Plus } from 'lucide-react-native';
7
+ import { cn } from '../../../lib/utils';
7
8
  import { Text } from '../../Input/Text/Text';
8
9
  import { Badge } from '../Badge/Badge';
9
- import { Icon } from '../../ui/Icon';
10
10
 
11
11
  cssInterop(RNView, { className: 'style' });
12
12
  cssInterop(RNPressable, { className: 'style' });
13
- cssInterop(LinearGradient, { className: 'style' });
14
13
 
15
14
  const View = RNView as React.ComponentType<
16
15
  React.ComponentProps<typeof RNView> & { className?: string }
@@ -19,6 +18,96 @@ const Pressable = RNPressable as React.ComponentType<
19
18
  React.ComponentProps<typeof RNPressable> & { className?: string }
20
19
  >;
21
20
 
21
+ // ============================================================================
22
+ // VARIANTS
23
+ // ============================================================================
24
+
25
+ export const BannerVariants = {
26
+ style: ['solid', 'outline', 'subtle'] as const,
27
+ } as const;
28
+
29
+ type BannerStyle = (typeof BannerVariants.style)[number];
30
+
31
+ const bannerVariants = cva(
32
+ 'w-full flex-row items-center justify-between gap-4 rounded-lg p-4',
33
+ {
34
+ variants: {
35
+ style: {
36
+ solid: 'bg-highlight-highlight-purple',
37
+ outline: 'border border-border-default bg-surface-default',
38
+ subtle:
39
+ 'border border-highlight-highlight-purple bg-highlight-highlight-purple-muted',
40
+ },
41
+ },
42
+ defaultVariants: {
43
+ style: 'solid',
44
+ },
45
+ }
46
+ );
47
+
48
+ const titleVariants = cva('font-semibold text-base', {
49
+ variants: {
50
+ style: {
51
+ solid: 'text-base-white',
52
+ outline: 'text-text-primary',
53
+ subtle: 'text-text-primary',
54
+ },
55
+ },
56
+ defaultVariants: {
57
+ style: 'solid',
58
+ },
59
+ });
60
+
61
+ const subtitleVariants = cva('font-medium text-xs opacity-70', {
62
+ variants: {
63
+ style: {
64
+ solid: 'text-base-white',
65
+ outline: 'text-text-primary',
66
+ subtle: 'text-text-primary',
67
+ },
68
+ },
69
+ defaultVariants: {
70
+ style: 'solid',
71
+ },
72
+ });
73
+
74
+ const actionItemVariants = cva('font-medium text-xs', {
75
+ variants: {
76
+ style: {
77
+ solid: 'text-base-white',
78
+ outline: 'text-text-primary',
79
+ subtle: 'text-text-primary',
80
+ },
81
+ },
82
+ defaultVariants: {
83
+ style: 'solid',
84
+ },
85
+ });
86
+
87
+ const dotVariants = cva('h-1 w-1 rounded-full', {
88
+ variants: {
89
+ style: {
90
+ solid: 'bg-base-white',
91
+ outline: 'bg-text-primary',
92
+ subtle: 'bg-text-primary',
93
+ },
94
+ },
95
+ defaultVariants: {
96
+ style: 'solid',
97
+ },
98
+ });
99
+
100
+ // ============================================================================
101
+ // HELPER
102
+ // ============================================================================
103
+
104
+ function normalizeStyle(v: any): BannerStyle {
105
+ const s = String(v ?? 'solid').toLowerCase();
106
+ return (
107
+ ['solid', 'outline', 'subtle'].includes(s) ? s : 'solid'
108
+ ) as BannerStyle;
109
+ }
110
+
22
111
  // ============================================================================
23
112
  // TYPES
24
113
  // ============================================================================
@@ -27,10 +116,20 @@ export interface BannerProps {
27
116
  title?: string;
28
117
  subtitle?: string;
29
118
  showBadge?: boolean;
119
+ badgeVariant?: string;
120
+ badgeSize?: string;
121
+ badgeShowLeftIcon?: boolean;
122
+ badgeShowRightIcon?: boolean;
30
123
  badgeText?: string;
124
+ actionItem1?: string;
125
+ actionItem2?: string;
126
+ moreLabel?: string;
31
127
  showActionItems?: boolean;
32
- actionItems?: string[];
128
+ showActionItem2?: boolean;
129
+ showMoreLabel?: boolean;
33
130
  showTrailing?: boolean;
131
+ trailingIcon?: React.ReactNode;
132
+ style?: BannerStyle | 'Solid' | 'Outline' | 'Subtle';
34
133
  onTrailingPress?: () => void;
35
134
  testID?: string;
36
135
  }
@@ -43,49 +142,77 @@ function Banner({
43
142
  title = 'Banner Title',
44
143
  subtitle = 'Subtitle of the banner goes here',
45
144
  showBadge = true,
145
+ badgeVariant = 'secondary',
146
+ badgeSize = 'sm',
147
+ badgeShowLeftIcon = false,
148
+ badgeShowRightIcon = false,
46
149
  badgeText = 'Badge',
150
+ actionItem1 = 'Action Item',
151
+ actionItem2 = 'Action Item',
152
+ moreLabel = '+ N Items',
47
153
  showActionItems = true,
48
- actionItems = ['Action Item', 'Action Item', 'Action Item'],
154
+ showActionItem2 = true,
155
+ showMoreLabel = true,
49
156
  showTrailing = true,
157
+ trailingIcon,
158
+ style = 'solid',
50
159
  onTrailingPress,
51
160
  testID,
52
161
  }: BannerProps) {
162
+ const st = normalizeStyle(style);
163
+ const defaultTrailingIcon = (
164
+ <Plus
165
+ size={16}
166
+ color={st === 'solid' ? 'white' : 'hsl(var(--foreground))'}
167
+ />
168
+ );
169
+
53
170
  return (
54
- <LinearGradient
55
- testID={testID}
56
- colors={['#573dab', '#573dab33']}
57
- start={{ x: 0, y: 0 }}
58
- end={{ x: 1, y: 1 }}
59
- className="w-full max-w-[400px] flex-row items-center justify-between gap-4 rounded-lg p-4"
60
- >
171
+ <View testID={testID} className={cn(bannerVariants({ style: st }))}>
61
172
  {/* Main Content */}
62
173
  <View className="flex-1 flex-col gap-5">
63
174
  {/* Header with Title and Badge */}
64
175
  <View className="flex-col gap-1">
65
176
  <View className="flex-row items-center gap-2">
66
- <Text className="font-semibold text-base text-white">{title}</Text>
177
+ <Text className={cn(titleVariants({ style: st }))}>{title}</Text>
67
178
  {showBadge && (
68
- <Badge variant="default" size="sm">
179
+ <Badge
180
+ variant={badgeVariant}
181
+ size={badgeSize}
182
+ showLeftIcon={badgeShowLeftIcon}
183
+ showRightIcon={badgeShowRightIcon}
184
+ >
69
185
  <Text>{badgeText}</Text>
70
186
  </Badge>
71
187
  )}
72
188
  </View>
73
- <Text className="font-medium text-xs text-white opacity-70">
189
+ <Text className={cn(subtitleVariants({ style: st }))}>
74
190
  {subtitle}
75
191
  </Text>
76
192
  </View>
77
193
 
78
194
  {/* Action Items */}
79
- {showActionItems && actionItems && actionItems.length > 0 && (
195
+ {showActionItems && (
80
196
  <View className="flex-row items-center gap-3">
81
- {actionItems.map((item, index) => (
82
- <React.Fragment key={index}>
83
- {index > 0 && (
84
- <View className="h-1 w-1 rounded-full bg-white" />
85
- )}
86
- <Text className="font-medium text-xs text-white">{item}</Text>
87
- </React.Fragment>
88
- ))}
197
+ <Text className={cn(actionItemVariants({ style: st }))}>
198
+ {actionItem1}
199
+ </Text>
200
+ {showActionItem2 && (
201
+ <>
202
+ <View className={cn(dotVariants({ style: st }))} />
203
+ <Text className={cn(actionItemVariants({ style: st }))}>
204
+ {actionItem2}
205
+ </Text>
206
+ </>
207
+ )}
208
+ {showMoreLabel && (
209
+ <>
210
+ <View className={cn(dotVariants({ style: st }))} />
211
+ <Text className={cn(actionItemVariants({ style: st }))}>
212
+ {moreLabel}
213
+ </Text>
214
+ </>
215
+ )}
89
216
  </View>
90
217
  )}
91
218
  </View>
@@ -97,10 +224,10 @@ function Banner({
97
224
  hitSlop={12}
98
225
  className="flex-row items-center justify-center"
99
226
  >
100
- <Icon as={Plus} size={16} color="white" />
227
+ {trailingIcon || defaultTrailingIcon}
101
228
  </Pressable>
102
229
  )}
103
- </LinearGradient>
230
+ </View>
104
231
  );
105
232
  }
106
233
 
@@ -1,11 +1,11 @@
1
1
  // @ts-nocheck
2
- import { cssInterop } from 'nativewind';
3
2
  import * as React from 'react';
4
3
  import { View, type StyleProp, type ViewStyle } from 'react-native';
4
+ import { cssInterop } from 'nativewind';
5
5
 
6
- import { cn } from '../../../lib/utils';
7
6
  import { Badge, type BadgeProps } from '../../DataDisplay/Badge/Badge';
8
7
  import { Text } from '../../Input/Text/Text';
8
+ import { cn } from '../../../lib/utils';
9
9
 
10
10
  cssInterop(View, { className: 'style' });
11
11
 
@@ -2,30 +2,34 @@ import figma from '@figma/code-connect';
2
2
  import { Card } from './Card';
3
3
 
4
4
  const FIGMA_URL =
5
- 'https://www.figma.com/design/66WaqopqU3WXgwVtyQuTUf/React-Native-Blueprint-Library?node-id=111-406';
5
+ 'https://www.figma.com/design/66WaqopqU3WXgwVtyQuTUf/React-Native-Blueprint-Library?node-id=371-4790';
6
6
 
7
7
  figma.connect(Card, FIGMA_URL, {
8
8
  props: {
9
+ size: figma.enum('size', { lg: 'lg', sm: 'sm' }),
9
10
  showMedia: figma.boolean('Show Media'),
10
- showHeader: figma.boolean('Show Header'),
11
11
  title: figma.string('Title'),
12
12
  showSubtitle: figma.boolean('Show Subtitle'),
13
13
  subtitle: figma.string('Subtitle'),
14
- showBody: figma.boolean('Show Body'),
15
14
  showLeading: figma.boolean('Show Leading'),
16
15
  showFooterActions: figma.boolean('Show FooterActions'),
17
16
  showBadges: figma.boolean('Show Badges'),
17
+ showBody: figma.boolean('Show Body'),
18
+ showOverflowMenu: figma.boolean('Show CardOptions'),
18
19
  },
19
20
 
20
21
  example: (props) => (
21
22
  <Card
23
+ size={props.size}
22
24
  showMedia={props.showMedia}
23
25
  showSubtitle={props.showSubtitle}
24
26
  showBadges={props.showBadges}
25
27
  showFooterActions={props.showFooterActions}
26
28
  showLeading={props.showLeading}
29
+ showOverflowMenu={props.showOverflowMenu}
27
30
  title={props.title}
28
31
  subtitle={props.subtitle}
32
+ body="The card may contain body content which can be truncated to 1-2 lines."
29
33
  avatarInitials="AB"
30
34
  badge1Text="Badge 1"
31
35
  badge2Text="Badge 2"