@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.
- package/global.css +3 -3
- package/lib/global.css +1 -1
- package/lib/module/assets/icons/Image.png +0 -0
- package/lib/module/components/DataDisplay/Avatar/Avatar.js +1 -1
- package/lib/module/components/DataDisplay/Avatar/Avatar.js.map +1 -1
- package/lib/module/components/DataDisplay/Banner/Banner.figma.js +17 -3
- package/lib/module/components/DataDisplay/Banner/Banner.figma.js.map +1 -1
- package/lib/module/components/DataDisplay/Banner/Banner.js +138 -34
- package/lib/module/components/DataDisplay/Banner/Banner.js.map +1 -1
- package/lib/module/components/DataDisplay/CalendarItem/CalendarItem.js +2 -2
- package/lib/module/components/DataDisplay/CalendarItem/CalendarItem.js.map +1 -1
- package/lib/module/components/DataDisplay/Card/Card.figma.js +11 -4
- package/lib/module/components/DataDisplay/Card/Card.figma.js.map +1 -1
- package/lib/module/components/DataDisplay/Card/Card.js +119 -65
- package/lib/module/components/DataDisplay/Card/Card.js.map +1 -1
- package/lib/module/components/DataDisplay/ChatBubble/ChatBubble.figma.js +54 -0
- package/lib/module/components/DataDisplay/ChatBubble/ChatBubble.figma.js.map +1 -0
- package/lib/module/components/DataDisplay/ChatBubble/ChatBubble.js +318 -0
- package/lib/module/components/DataDisplay/ChatBubble/ChatBubble.js.map +1 -0
- package/lib/module/components/DataDisplay/ChatBubble/index.js +4 -0
- package/lib/module/components/DataDisplay/ChatBubble/index.js.map +1 -0
- package/lib/module/components/DataDisplay/FeedCard/AttachmentDetails.js +69 -0
- package/lib/module/components/DataDisplay/FeedCard/AttachmentDetails.js.map +1 -0
- package/lib/module/components/DataDisplay/FeedCard/FeedCard.figma.js +19 -17
- package/lib/module/components/DataDisplay/FeedCard/FeedCard.figma.js.map +1 -1
- package/lib/module/components/DataDisplay/FeedCard/FeedCard.js +30 -19
- package/lib/module/components/DataDisplay/FeedCard/FeedCard.js.map +1 -1
- package/lib/module/components/DataDisplay/Greeting/Greeting.figma.js +5 -5
- package/lib/module/components/DataDisplay/Greeting/Greeting.figma.js.map +1 -1
- package/lib/module/components/DataDisplay/Greeting/Greeting.js +46 -70
- package/lib/module/components/DataDisplay/Greeting/Greeting.js.map +1 -1
- package/lib/module/components/DataDisplay/ProfileCard/ProfileCard.figma.js +16 -0
- package/lib/module/components/DataDisplay/ProfileCard/ProfileCard.figma.js.map +1 -0
- package/lib/module/components/DataDisplay/ProfileCard/ProfileCard.js +111 -0
- package/lib/module/components/DataDisplay/ProfileCard/ProfileCard.js.map +1 -0
- package/lib/module/components/DataDisplay/ProfileCard/index.js +4 -0
- package/lib/module/components/DataDisplay/ProfileCard/index.js.map +1 -0
- package/lib/module/components/Input/Button/Button.js +11 -9
- package/lib/module/components/Input/Button/Button.js.map +1 -1
- package/lib/module/components/Navigation/Appbar/AppBar.figma.js +18 -6
- package/lib/module/components/Navigation/Appbar/AppBar.figma.js.map +1 -1
- package/lib/module/components/Navigation/Appbar/AppBar.js +36 -9
- package/lib/module/components/Navigation/Appbar/AppBar.js.map +1 -1
- package/lib/module/components/Navigation/Popover/Popover.js +1 -1
- package/lib/module/components/Navigation/Popover/Popover.js.map +1 -1
- package/lib/module/components/ui/index.js +2 -0
- package/lib/module/components/ui/index.js.map +1 -1
- package/lib/module/lib/theme.js +2 -2
- package/lib/module/patterns/pattern-components/AccountPattern/AccountPattern.figma.js +196 -0
- package/lib/module/patterns/pattern-components/AccountPattern/AccountPattern.figma.js.map +1 -0
- package/lib/module/patterns/pattern-components/AccountPattern/AccountPattern.js +255 -0
- package/lib/module/patterns/pattern-components/AccountPattern/AccountPattern.js.map +1 -0
- package/lib/module/patterns/pattern-components/AccountPattern/index.js +4 -0
- package/lib/module/patterns/pattern-components/AccountPattern/index.js.map +1 -0
- package/lib/module/patterns/pattern-components/CalendarPattern/CalendarPattern.figma.js +1 -1
- package/lib/module/patterns/pattern-components/CardListPattern/CardListPattern.js +2 -4
- package/lib/module/patterns/pattern-components/CardListPattern/CardListPattern.js.map +1 -1
- package/lib/module/patterns/pattern-components/FeedPattern/FeedPattern.figma.js +144 -0
- package/lib/module/patterns/pattern-components/FeedPattern/FeedPattern.figma.js.map +1 -0
- package/lib/module/patterns/pattern-components/FeedPattern/FeedPattern.js +213 -0
- package/lib/module/patterns/pattern-components/FeedPattern/FeedPattern.js.map +1 -0
- package/lib/module/patterns/pattern-components/FeedPattern/index.js +4 -0
- package/lib/module/patterns/pattern-components/FeedPattern/index.js.map +1 -0
- package/lib/module/patterns/pattern-components/HomeFacultyPattern/HomeFacultyPattern.figma.js +70 -0
- package/lib/module/patterns/pattern-components/HomeFacultyPattern/HomeFacultyPattern.figma.js.map +1 -0
- package/lib/module/patterns/pattern-components/HomeFacultyPattern/HomeFacultyPattern.js +260 -0
- package/lib/module/patterns/pattern-components/HomeFacultyPattern/HomeFacultyPattern.js.map +1 -0
- package/lib/module/patterns/pattern-components/HomeFacultyPattern/index.js +4 -0
- package/lib/module/patterns/pattern-components/HomeFacultyPattern/index.js.map +1 -0
- package/lib/module/patterns/pattern-components/HomeParentPattern/HomeParentPattern.figma.js +82 -0
- package/lib/module/patterns/pattern-components/HomeParentPattern/HomeParentPattern.figma.js.map +1 -0
- package/lib/module/patterns/pattern-components/HomeParentPattern/HomeParentPattern.js +256 -0
- package/lib/module/patterns/pattern-components/HomeParentPattern/HomeParentPattern.js.map +1 -0
- package/lib/module/patterns/pattern-components/HomeParentPattern/index.js +4 -0
- package/lib/module/patterns/pattern-components/HomeParentPattern/index.js.map +1 -0
- package/lib/module/patterns/pattern-components/HomeStudentPattern/HomeStudentPattern.figma.js +73 -0
- package/lib/module/patterns/pattern-components/HomeStudentPattern/HomeStudentPattern.figma.js.map +1 -0
- package/lib/module/patterns/pattern-components/HomeStudentPattern/HomeStudentPattern.js +283 -0
- package/lib/module/patterns/pattern-components/HomeStudentPattern/HomeStudentPattern.js.map +1 -0
- package/lib/module/patterns/pattern-components/HomeStudentPattern/index.js +4 -0
- package/lib/module/patterns/pattern-components/HomeStudentPattern/index.js.map +1 -0
- package/lib/module/patterns/pattern-components/index.js +5 -0
- package/lib/module/patterns/pattern-components/index.js.map +1 -1
- package/package.json +27 -1
- package/src/assets/icons/Image.png +0 -0
- package/src/components/DataDisplay/Avatar/Avatar.tsx +24 -21
- package/src/components/DataDisplay/Banner/Banner.figma.tsx +18 -3
- package/src/components/DataDisplay/Banner/Banner.tsx +153 -26
- package/src/components/DataDisplay/CalendarItem/CalendarItem.tsx +2 -2
- package/src/components/DataDisplay/Card/Card.figma.tsx +7 -3
- package/src/components/DataDisplay/Card/Card.tsx +152 -101
- package/src/components/DataDisplay/ChatBubble/ChatBubble.figma.tsx +54 -0
- package/src/components/DataDisplay/ChatBubble/ChatBubble.tsx +404 -0
- package/src/components/DataDisplay/ChatBubble/index.ts +8 -0
- package/src/components/DataDisplay/FeedCard/AttachmentDetails.tsx +96 -0
- package/src/components/DataDisplay/FeedCard/FeedCard.figma.tsx +17 -15
- package/src/components/DataDisplay/FeedCard/FeedCard.tsx +66 -35
- package/src/components/DataDisplay/Greeting/Greeting.figma.tsx +5 -5
- package/src/components/DataDisplay/Greeting/Greeting.tsx +58 -96
- package/src/components/DataDisplay/ProfileCard/ProfileCard.figma.tsx +17 -0
- package/src/components/DataDisplay/ProfileCard/ProfileCard.tsx +173 -0
- package/src/components/DataDisplay/ProfileCard/index.ts +1 -0
- package/src/components/Input/Button/Button.tsx +18 -10
- package/src/components/Navigation/Appbar/AppBar.figma.tsx +18 -6
- package/src/components/Navigation/Appbar/AppBar.tsx +58 -13
- package/src/components/Navigation/Popover/Popover.tsx +3 -3
- package/src/components/ui/index.ts +2 -0
- package/src/lib/theme.ts +2 -2
- package/src/patterns/pattern-components/AccountPattern/AccountPattern.figma.tsx +193 -0
- package/src/patterns/pattern-components/AccountPattern/AccountPattern.tsx +301 -0
- package/src/patterns/pattern-components/AccountPattern/index.ts +1 -0
- package/src/patterns/pattern-components/CalendarPattern/CalendarPattern.figma.tsx +1 -1
- package/src/patterns/pattern-components/CardListPattern/CardListPattern.tsx +4 -9
- package/src/patterns/pattern-components/FeedPattern/FeedPattern.figma.tsx +146 -0
- package/src/patterns/pattern-components/FeedPattern/FeedPattern.tsx +264 -0
- package/src/patterns/pattern-components/FeedPattern/index.ts +2 -0
- package/src/patterns/pattern-components/HomeFacultyPattern/HomeFacultyPattern.figma.tsx +66 -0
- package/src/patterns/pattern-components/HomeFacultyPattern/HomeFacultyPattern.tsx +326 -0
- package/src/patterns/pattern-components/HomeFacultyPattern/index.ts +2 -0
- package/src/patterns/pattern-components/HomeParentPattern/HomeParentPattern.figma.tsx +75 -0
- package/src/patterns/pattern-components/HomeParentPattern/HomeParentPattern.tsx +328 -0
- package/src/patterns/pattern-components/HomeParentPattern/index.ts +2 -0
- package/src/patterns/pattern-components/HomeStudentPattern/HomeStudentPattern.figma.tsx +66 -0
- package/src/patterns/pattern-components/HomeStudentPattern/HomeStudentPattern.tsx +355 -0
- package/src/patterns/pattern-components/HomeStudentPattern/index.ts +2 -0
- package/src/patterns/pattern-components/index.ts +5 -0
|
@@ -32,76 +32,113 @@ const Image = cssInterop(RNImage, { className: 'style' });
|
|
|
32
32
|
* --------------------------------------------------- */
|
|
33
33
|
|
|
34
34
|
export const CardVariants = {
|
|
35
|
-
|
|
36
|
-
tone: ['default', 'subtle'] as const,
|
|
35
|
+
size: ['sm', 'lg'] as const,
|
|
37
36
|
} as const;
|
|
38
37
|
|
|
39
|
-
type
|
|
40
|
-
type CardTone = (typeof CardVariants.tone)[number];
|
|
38
|
+
type CardSize = (typeof CardVariants.size)[number];
|
|
41
39
|
|
|
42
|
-
const rootVariants = cva('
|
|
40
|
+
const rootVariants = cva('overflow-hidden rounded-2xl border border-border', {
|
|
43
41
|
variants: {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
size: {
|
|
43
|
+
sm: 'w-48',
|
|
44
|
+
lg: 'w-full',
|
|
47
45
|
},
|
|
48
46
|
},
|
|
49
47
|
defaultVariants: {
|
|
50
|
-
|
|
48
|
+
size: 'lg',
|
|
51
49
|
},
|
|
52
50
|
});
|
|
53
51
|
|
|
54
|
-
|
|
52
|
+
// Apply surface colors via inline styles
|
|
53
|
+
const cardStyle = (style?: any) => ({
|
|
54
|
+
...style,
|
|
55
|
+
backgroundColor: 'var(--colors-surface-default, white)',
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
const mediaWrapVariants = cva('bg-muted overflow-hidden rounded-lg', {
|
|
55
59
|
variants: {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
60
|
+
size: {
|
|
61
|
+
sm: 'h-24 w-full',
|
|
62
|
+
lg: 'w-full h-56',
|
|
59
63
|
},
|
|
60
64
|
},
|
|
61
65
|
defaultVariants: {
|
|
62
|
-
|
|
66
|
+
size: 'lg',
|
|
63
67
|
},
|
|
64
68
|
});
|
|
65
69
|
|
|
66
|
-
|
|
70
|
+
// Media container wrapper to add padding (using spacing-md = 12px)
|
|
71
|
+
const mediaContainerVariants = cva('', {
|
|
67
72
|
variants: {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
73
|
+
size: {
|
|
74
|
+
sm: 'p-3 pb-2',
|
|
75
|
+
lg: 'p-3 pb-0',
|
|
71
76
|
},
|
|
72
77
|
},
|
|
73
78
|
defaultVariants: {
|
|
74
|
-
|
|
79
|
+
size: 'lg',
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
const contentWrapVariants = cva('flex flex-col', {
|
|
84
|
+
variants: {
|
|
85
|
+
size: {
|
|
86
|
+
sm: 'w-full px-4 py-4 gap-2',
|
|
87
|
+
lg: 'w-full px-4 py-4 gap-4',
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
defaultVariants: {
|
|
91
|
+
size: 'lg',
|
|
75
92
|
},
|
|
76
93
|
});
|
|
77
94
|
|
|
78
95
|
const headerRowVariants = cva('w-full flex-row items-center', {
|
|
79
96
|
variants: {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
97
|
+
size: {
|
|
98
|
+
sm: 'gap-2',
|
|
99
|
+
lg: 'gap-3',
|
|
83
100
|
},
|
|
84
101
|
},
|
|
85
102
|
defaultVariants: {
|
|
86
|
-
|
|
103
|
+
size: 'lg',
|
|
87
104
|
},
|
|
88
105
|
});
|
|
89
106
|
|
|
90
107
|
const titleColumnVariants = cva('flex-1 flex-col', {
|
|
91
108
|
variants: {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
109
|
+
size: {
|
|
110
|
+
sm: 'gap-0.5',
|
|
111
|
+
lg: 'gap-1',
|
|
95
112
|
},
|
|
96
113
|
},
|
|
97
114
|
defaultVariants: {
|
|
98
|
-
|
|
115
|
+
size: 'lg',
|
|
99
116
|
},
|
|
100
117
|
});
|
|
101
118
|
|
|
102
|
-
const titleVariants = cva('text-base font-semibold text-foreground'
|
|
119
|
+
const titleVariants = cva('text-base font-semibold text-foreground', {
|
|
120
|
+
variants: {
|
|
121
|
+
size: {
|
|
122
|
+
sm: 'text-sm',
|
|
123
|
+
lg: 'text-base',
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
defaultVariants: {
|
|
127
|
+
size: 'lg',
|
|
128
|
+
},
|
|
129
|
+
});
|
|
103
130
|
const subtitleVariants = cva('text-xs font-medium text-muted-foreground');
|
|
104
|
-
const bodyVariants = cva('text-sm font-medium text-foreground'
|
|
131
|
+
const bodyVariants = cva('text-sm font-medium text-foreground', {
|
|
132
|
+
variants: {
|
|
133
|
+
size: {
|
|
134
|
+
sm: 'text-xs',
|
|
135
|
+
lg: 'text-sm',
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
defaultVariants: {
|
|
139
|
+
size: 'lg',
|
|
140
|
+
},
|
|
141
|
+
});
|
|
105
142
|
|
|
106
143
|
const badgesRowVariants = cva('flex-row items-center gap-2');
|
|
107
144
|
const footerRowVariants = cva('w-full flex-row items-center justify-between');
|
|
@@ -109,16 +146,16 @@ const leftButtonsVariants = cva('flex-row items-center gap-2');
|
|
|
109
146
|
const rightButtonsVariants = cva('flex-row items-center gap-2');
|
|
110
147
|
|
|
111
148
|
const overflowBtnVariants = cva(
|
|
112
|
-
'absolute right-4 top-4 items-center justify-center rounded-lg border bg-muted',
|
|
149
|
+
'absolute right-4 top-4 items-center justify-center rounded-lg border border-border bg-muted',
|
|
113
150
|
{
|
|
114
151
|
variants: {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
152
|
+
size: {
|
|
153
|
+
sm: 'w-8 h-8',
|
|
154
|
+
lg: 'w-10 h-10',
|
|
118
155
|
},
|
|
119
156
|
},
|
|
120
157
|
defaultVariants: {
|
|
121
|
-
|
|
158
|
+
size: 'lg',
|
|
122
159
|
},
|
|
123
160
|
}
|
|
124
161
|
);
|
|
@@ -127,14 +164,9 @@ const overflowBtnVariants = cva(
|
|
|
127
164
|
* Helpers
|
|
128
165
|
* --------------------------------------------------- */
|
|
129
166
|
|
|
130
|
-
function
|
|
131
|
-
const s = String(v ?? '
|
|
132
|
-
return s === '
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
function normalizeTone(v: any): CardTone {
|
|
136
|
-
const s = String(v ?? 'default').toLowerCase();
|
|
137
|
-
return s === 'subtle' ? 'subtle' : 'default';
|
|
167
|
+
function normalizeSize(v: any): CardSize {
|
|
168
|
+
const s = String(v ?? 'lg').toLowerCase();
|
|
169
|
+
return s === 'sm' ? 'sm' : 'lg';
|
|
138
170
|
}
|
|
139
171
|
|
|
140
172
|
/* -----------------------------------------------------
|
|
@@ -194,7 +226,7 @@ export type CardProps = Omit<
|
|
|
194
226
|
VariantProps<typeof contentWrapVariants> &
|
|
195
227
|
VariantProps<typeof mediaWrapVariants> &
|
|
196
228
|
VariantProps<typeof overflowBtnVariants>,
|
|
197
|
-
'
|
|
229
|
+
'tone'
|
|
198
230
|
> & {
|
|
199
231
|
title?: string;
|
|
200
232
|
subtitle?: string;
|
|
@@ -217,8 +249,7 @@ export type CardProps = Omit<
|
|
|
217
249
|
avatarInitials?: string;
|
|
218
250
|
|
|
219
251
|
/** variants */
|
|
220
|
-
|
|
221
|
-
tone?: CardTone | 'Default' | 'Subtle';
|
|
252
|
+
size?: CardSize | 'Sm' | 'Lg';
|
|
222
253
|
|
|
223
254
|
/** optional badge labels */
|
|
224
255
|
badge1Text?: string;
|
|
@@ -265,8 +296,7 @@ export function Card(props: CardProps) {
|
|
|
265
296
|
leadingChecked,
|
|
266
297
|
avatarInitials,
|
|
267
298
|
|
|
268
|
-
|
|
269
|
-
tone,
|
|
299
|
+
size = 'lg',
|
|
270
300
|
|
|
271
301
|
badge1Text = 'Badge 1',
|
|
272
302
|
badge2Text = 'Badge 2',
|
|
@@ -282,43 +312,44 @@ export function Card(props: CardProps) {
|
|
|
282
312
|
testID,
|
|
283
313
|
} = props;
|
|
284
314
|
|
|
285
|
-
const
|
|
286
|
-
const tn = normalizeTone(tone);
|
|
315
|
+
const sz = normalizeSize(size);
|
|
287
316
|
|
|
288
317
|
return (
|
|
289
318
|
<View
|
|
290
319
|
testID={testID ?? 'card'}
|
|
291
|
-
className={cn(rootVariants({
|
|
292
|
-
style={style}
|
|
320
|
+
className={cn(rootVariants({ size: sz }))}
|
|
321
|
+
style={cardStyle(style)}
|
|
293
322
|
>
|
|
294
323
|
{showMedia ? (
|
|
295
|
-
<View
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
324
|
+
<View className={cn(mediaContainerVariants({ size: sz }))}>
|
|
325
|
+
<View
|
|
326
|
+
testID="card-media-wrap"
|
|
327
|
+
className={cn(mediaWrapVariants({ size: sz }))}
|
|
328
|
+
>
|
|
329
|
+
{image ? (
|
|
330
|
+
<Image
|
|
331
|
+
testID="card-media"
|
|
332
|
+
source={image}
|
|
333
|
+
resizeMode="cover"
|
|
334
|
+
className="w-full h-full"
|
|
335
|
+
/>
|
|
336
|
+
) : (
|
|
337
|
+
<View
|
|
338
|
+
testID="card-media-placeholder"
|
|
339
|
+
className="w-full h-full bg-muted"
|
|
340
|
+
/>
|
|
341
|
+
)}
|
|
342
|
+
</View>
|
|
312
343
|
</View>
|
|
313
344
|
) : null}
|
|
314
345
|
|
|
315
346
|
<View
|
|
316
347
|
testID="card-content"
|
|
317
|
-
className={cn(contentWrapVariants({
|
|
348
|
+
className={cn(contentWrapVariants({ size: sz }))}
|
|
318
349
|
>
|
|
319
350
|
<View
|
|
320
351
|
testID="card-header"
|
|
321
|
-
className={cn(headerRowVariants({
|
|
352
|
+
className={cn(headerRowVariants({ size: sz }))}
|
|
322
353
|
>
|
|
323
354
|
{showLeading ? (
|
|
324
355
|
<View testID="card-leading" className="items-center justify-center">
|
|
@@ -332,12 +363,12 @@ export function Card(props: CardProps) {
|
|
|
332
363
|
|
|
333
364
|
<View
|
|
334
365
|
testID="card-title-column"
|
|
335
|
-
className={cn(titleColumnVariants({
|
|
366
|
+
className={cn(titleColumnVariants({ size: sz }))}
|
|
336
367
|
>
|
|
337
368
|
<RNText
|
|
338
369
|
testID="card-title"
|
|
339
370
|
numberOfLines={1}
|
|
340
|
-
className={cn(titleVariants())}
|
|
371
|
+
className={cn(titleVariants({ size: sz }))}
|
|
341
372
|
>
|
|
342
373
|
{title}
|
|
343
374
|
</RNText>
|
|
@@ -357,7 +388,7 @@ export function Card(props: CardProps) {
|
|
|
357
388
|
<RNText
|
|
358
389
|
testID="card-body"
|
|
359
390
|
numberOfLines={2}
|
|
360
|
-
className={cn(bodyVariants())}
|
|
391
|
+
className={cn(bodyVariants({ size: sz }))}
|
|
361
392
|
>
|
|
362
393
|
{body}
|
|
363
394
|
</RNText>
|
|
@@ -385,33 +416,53 @@ export function Card(props: CardProps) {
|
|
|
385
416
|
|
|
386
417
|
{showFooterActions ? (
|
|
387
418
|
<View testID="card-footer" className={cn(footerRowVariants())}>
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
<Button
|
|
393
|
-
testID="card-primary-action"
|
|
394
|
-
disabled={false}
|
|
395
|
-
size="default"
|
|
396
|
-
variant="default"
|
|
397
|
-
showLeftIcon={false}
|
|
398
|
-
showRightIcon={false}
|
|
399
|
-
onPress={onPrimaryActionPress}
|
|
419
|
+
{sz === 'lg' && (
|
|
420
|
+
<View
|
|
421
|
+
testID="card-footer-left"
|
|
422
|
+
className={cn(leftButtonsVariants())}
|
|
400
423
|
>
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
424
|
+
<Button
|
|
425
|
+
testID="card-primary-action"
|
|
426
|
+
disabled={false}
|
|
427
|
+
size="default"
|
|
428
|
+
variant="default"
|
|
429
|
+
showLeftIcon={false}
|
|
430
|
+
showRightIcon={false}
|
|
431
|
+
onPress={onPrimaryActionPress}
|
|
432
|
+
>
|
|
433
|
+
{primaryActionText}
|
|
434
|
+
</Button>
|
|
435
|
+
<Button
|
|
436
|
+
testID="card-secondary-action"
|
|
437
|
+
disabled={false}
|
|
438
|
+
size="default"
|
|
439
|
+
variant="secondary"
|
|
440
|
+
showLeftIcon={false}
|
|
441
|
+
showRightIcon={false}
|
|
442
|
+
onPress={onSecondaryActionPress}
|
|
443
|
+
>
|
|
444
|
+
{secondaryActionText}
|
|
445
|
+
</Button>
|
|
446
|
+
</View>
|
|
447
|
+
)}
|
|
448
|
+
{sz === 'sm' && (
|
|
449
|
+
<View
|
|
450
|
+
testID="card-footer-left"
|
|
451
|
+
className={cn(leftButtonsVariants())}
|
|
411
452
|
>
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
453
|
+
<Button
|
|
454
|
+
testID="card-primary-action"
|
|
455
|
+
disabled={false}
|
|
456
|
+
size="default"
|
|
457
|
+
variant="default"
|
|
458
|
+
showLeftIcon={false}
|
|
459
|
+
showRightIcon={false}
|
|
460
|
+
onPress={onPrimaryActionPress}
|
|
461
|
+
>
|
|
462
|
+
{primaryActionText}
|
|
463
|
+
</Button>
|
|
464
|
+
</View>
|
|
465
|
+
)}
|
|
415
466
|
|
|
416
467
|
<View
|
|
417
468
|
testID="card-footer-right"
|
|
@@ -430,16 +481,16 @@ export function Card(props: CardProps) {
|
|
|
430
481
|
) : null}
|
|
431
482
|
</View>
|
|
432
483
|
|
|
433
|
-
{showOverflowMenu
|
|
484
|
+
{showOverflowMenu && sz === 'lg' && (
|
|
434
485
|
<Pressable
|
|
435
486
|
testID="card-overflow"
|
|
436
487
|
onPress={onOverflowPress}
|
|
437
|
-
className={cn(overflowBtnVariants({
|
|
488
|
+
className={cn(overflowBtnVariants({ size: sz }))}
|
|
438
489
|
hitSlop={8}
|
|
439
490
|
>
|
|
440
491
|
<MoreHorizontal size={18} color="hsl(var(--foreground))" />
|
|
441
492
|
</Pressable>
|
|
442
|
-
)
|
|
493
|
+
)}
|
|
443
494
|
</View>
|
|
444
495
|
);
|
|
445
496
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import figma from '@figma/code-connect';
|
|
2
|
+
import { ChatBubble } from './ChatBubble';
|
|
3
|
+
|
|
4
|
+
const FIGMA_URL =
|
|
5
|
+
'https://www.figma.com/design/66WaqopqU3WXgwVtyQuTUf/React-Native-Blueprint-Library?node-id=306-9226';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* ChatBubble - Message bubble component for chat interfaces
|
|
9
|
+
*
|
|
10
|
+
* Use cases:
|
|
11
|
+
* - Chat applications and messaging interfaces
|
|
12
|
+
* - Message threads and conversations
|
|
13
|
+
* - AI assistant responses
|
|
14
|
+
* - User message display
|
|
15
|
+
*
|
|
16
|
+
* Features:
|
|
17
|
+
* - Three variants: incoming default, outgoing default, and AI message
|
|
18
|
+
* - User avatars for message identification
|
|
19
|
+
* - Message metadata (timestamp, edited status)
|
|
20
|
+
* - Quoted reply support for context
|
|
21
|
+
* - Message attachments (images, links)
|
|
22
|
+
* - Reaction badges
|
|
23
|
+
* - AI-specific actions (copy, like, dislike, regenerate)
|
|
24
|
+
* - Fully customizable appearance and behavior
|
|
25
|
+
*
|
|
26
|
+
* Customization:
|
|
27
|
+
* - Show/hide individual sections
|
|
28
|
+
* - Customize message content and user info
|
|
29
|
+
* - Add attachments and reactions
|
|
30
|
+
* - Configure action callbacks
|
|
31
|
+
* - Customize styling per variant
|
|
32
|
+
*/
|
|
33
|
+
figma.connect(ChatBubble, FIGMA_URL, {
|
|
34
|
+
example: () => (
|
|
35
|
+
<ChatBubble
|
|
36
|
+
type="incoming"
|
|
37
|
+
variant="default"
|
|
38
|
+
message="This is the Message bubble content. This will have truncated content and we can fix the width as 300px."
|
|
39
|
+
userName="User Name"
|
|
40
|
+
timestamp="09:10 PM"
|
|
41
|
+
showUser={true}
|
|
42
|
+
showMessage={true}
|
|
43
|
+
showEditedIndication={true}
|
|
44
|
+
showQuotedReply={true}
|
|
45
|
+
quotedMessage={{
|
|
46
|
+
author: 'John Doe',
|
|
47
|
+
text: 'This is a quoted reply section',
|
|
48
|
+
}}
|
|
49
|
+
showMessageAttachment={true}
|
|
50
|
+
showReactions={true}
|
|
51
|
+
reactions={['👍', '❤️']}
|
|
52
|
+
/>
|
|
53
|
+
),
|
|
54
|
+
});
|