@appgram/react 0.1.0
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/LICENSE +21 -0
- package/dist/chunk-3UBJGXCO.js +6368 -0
- package/dist/chunk-3UBJGXCO.js.map +1 -0
- package/dist/chunk-75P634IK.js +758 -0
- package/dist/chunk-75P634IK.js.map +1 -0
- package/dist/chunk-AIDLOCVJ.mjs +6341 -0
- package/dist/chunk-AIDLOCVJ.mjs.map +1 -0
- package/dist/chunk-KPIKYXAN.mjs +47 -0
- package/dist/chunk-KPIKYXAN.mjs.map +1 -0
- package/dist/chunk-N6PJDQCU.mjs +741 -0
- package/dist/chunk-N6PJDQCU.mjs.map +1 -0
- package/dist/chunk-ZJZ3A2S3.js +49 -0
- package/dist/chunk-ZJZ3A2S3.js.map +1 -0
- package/dist/components/index.d.mts +1283 -0
- package/dist/components/index.d.ts +1283 -0
- package/dist/components/index.js +85 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/index.mjs +4 -0
- package/dist/components/index.mjs.map +1 -0
- package/dist/hooks/index.d.mts +572 -0
- package/dist/hooks/index.d.ts +572 -0
- package/dist/hooks/index.js +53 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/index.mjs +4 -0
- package/dist/hooks/index.mjs.map +1 -0
- package/dist/index.d.mts +399 -0
- package/dist/index.d.ts +399 -0
- package/dist/index.js +783 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +645 -0
- package/dist/index.mjs.map +1 -0
- package/dist/useVote-CLhkwtLT.d.mts +420 -0
- package/dist/useVote-CLhkwtLT.d.ts +420 -0
- package/package.json +82 -0
- package/tailwind-preset.js +48 -0
|
@@ -0,0 +1,1283 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { U as UseVoteOptions, b as Wish, W as WishFilters, c as Comment, p as RoadmapColumn$1, q as RoadmapItem, d as Release, f as HelpFlow, g as HelpArticle, h as SupportRequest } from '../useVote-CLhkwtLT.mjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* VoteButton Component
|
|
6
|
+
*
|
|
7
|
+
* A button for voting on wishes with animated feedback.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
interface VoteButtonProps extends Omit<UseVoteOptions, 'onVoteChange'> {
|
|
11
|
+
/**
|
|
12
|
+
* Size variant
|
|
13
|
+
* @default 'md'
|
|
14
|
+
*/
|
|
15
|
+
size?: 'sm' | 'md' | 'lg';
|
|
16
|
+
/**
|
|
17
|
+
* Show vote count
|
|
18
|
+
* @default true
|
|
19
|
+
*/
|
|
20
|
+
showCount?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Custom class name
|
|
23
|
+
*/
|
|
24
|
+
className?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Callback when vote state changes
|
|
27
|
+
*/
|
|
28
|
+
onVoteChange?: (hasVoted: boolean, voteCount: number) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Custom render function for the button content
|
|
31
|
+
*/
|
|
32
|
+
renderContent?: (props: {
|
|
33
|
+
hasVoted: boolean;
|
|
34
|
+
voteCount: number;
|
|
35
|
+
isLoading: boolean;
|
|
36
|
+
}) => React.ReactNode;
|
|
37
|
+
}
|
|
38
|
+
declare function VoteButton({ wishId, initialVoteCount, initialHasVoted, voterEmail, onVoteChange, size, showCount, className, renderContent, }: VoteButtonProps): React.ReactElement;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* WishCard Component
|
|
42
|
+
*
|
|
43
|
+
* Modern glassmorphism card with animations and theming.
|
|
44
|
+
* Adapted from FeedbackModern variant.
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
interface WishCardProps {
|
|
48
|
+
/**
|
|
49
|
+
* The wish data
|
|
50
|
+
*/
|
|
51
|
+
wish: Wish;
|
|
52
|
+
/**
|
|
53
|
+
* Click handler for the card
|
|
54
|
+
*/
|
|
55
|
+
onClick?: () => void;
|
|
56
|
+
/**
|
|
57
|
+
* Vote handler
|
|
58
|
+
*/
|
|
59
|
+
onVote?: (wishId: string, hasVoted: boolean, voteCount: number) => void;
|
|
60
|
+
/**
|
|
61
|
+
* Comment click handler
|
|
62
|
+
*/
|
|
63
|
+
onCommentClick?: () => void;
|
|
64
|
+
/**
|
|
65
|
+
* Override hasVoted state (for optimistic updates)
|
|
66
|
+
*/
|
|
67
|
+
hasVoted?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Override vote count (for optimistic updates)
|
|
70
|
+
*/
|
|
71
|
+
voteCount?: number;
|
|
72
|
+
/**
|
|
73
|
+
* Loading state for vote
|
|
74
|
+
*/
|
|
75
|
+
isVoting?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Custom class name
|
|
78
|
+
*/
|
|
79
|
+
className?: string;
|
|
80
|
+
/**
|
|
81
|
+
* Custom render function for the vote button
|
|
82
|
+
*/
|
|
83
|
+
renderVoteButton?: (props: {
|
|
84
|
+
wishId: string;
|
|
85
|
+
voteCount: number;
|
|
86
|
+
hasVoted: boolean;
|
|
87
|
+
isLoading: boolean;
|
|
88
|
+
onVote: () => void;
|
|
89
|
+
}) => React.ReactNode;
|
|
90
|
+
/**
|
|
91
|
+
* Show status badge
|
|
92
|
+
* @default true
|
|
93
|
+
*/
|
|
94
|
+
showStatus?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Show category badge
|
|
97
|
+
* @default true
|
|
98
|
+
*/
|
|
99
|
+
showCategory?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Show comment count
|
|
102
|
+
* @default true
|
|
103
|
+
*/
|
|
104
|
+
showCommentCount?: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Show author
|
|
107
|
+
* @default true
|
|
108
|
+
*/
|
|
109
|
+
showAuthor?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Animation delay index (for staggered animations)
|
|
112
|
+
*/
|
|
113
|
+
animationIndex?: number;
|
|
114
|
+
}
|
|
115
|
+
declare function WishCard({ wish, onClick, onVote, onCommentClick, hasVoted, voteCount, isVoting, className, renderVoteButton, showStatus, showCategory, showCommentCount, showAuthor, animationIndex, }: WishCardProps): React.ReactElement;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* WishList Component
|
|
119
|
+
*
|
|
120
|
+
* Modern glassmorphism list with animations for displaying and voting on feature requests.
|
|
121
|
+
* Adapted from FeedbackModern variant.
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* ```tsx
|
|
125
|
+
* import { WishList } from '@appgram/react'
|
|
126
|
+
*
|
|
127
|
+
* <WishList
|
|
128
|
+
* heading="Feature Requests"
|
|
129
|
+
* description="Vote for features you'd like to see"
|
|
130
|
+
* showSearch
|
|
131
|
+
* variant="cards"
|
|
132
|
+
* onWishClick={(wish) => console.log('Clicked:', wish.title)}
|
|
133
|
+
* onAddWish={() => setShowForm(true)}
|
|
134
|
+
* />
|
|
135
|
+
* ```
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* ```tsx
|
|
139
|
+
* // Compact variant for sidebar
|
|
140
|
+
* <WishList
|
|
141
|
+
* variant="compact"
|
|
142
|
+
* filters={{ status: 'pending' }}
|
|
143
|
+
* showSearch
|
|
144
|
+
* />
|
|
145
|
+
* ```
|
|
146
|
+
*/
|
|
147
|
+
|
|
148
|
+
interface WishListProps {
|
|
149
|
+
/**
|
|
150
|
+
* Layout variant
|
|
151
|
+
* @default 'cards'
|
|
152
|
+
*/
|
|
153
|
+
variant?: 'cards' | 'compact' | 'masonry';
|
|
154
|
+
/**
|
|
155
|
+
* Initial filters
|
|
156
|
+
*/
|
|
157
|
+
filters?: WishFilters;
|
|
158
|
+
/**
|
|
159
|
+
* Auto-refresh interval in milliseconds
|
|
160
|
+
* @default 0
|
|
161
|
+
*/
|
|
162
|
+
refreshInterval?: number;
|
|
163
|
+
/**
|
|
164
|
+
* Click handler for a wish
|
|
165
|
+
*/
|
|
166
|
+
onWishClick?: (wish: Wish) => void;
|
|
167
|
+
/**
|
|
168
|
+
* Handler for adding a new wish
|
|
169
|
+
*/
|
|
170
|
+
onAddWish?: () => void;
|
|
171
|
+
/**
|
|
172
|
+
* Custom render function for individual wish cards
|
|
173
|
+
*/
|
|
174
|
+
renderWish?: (wish: Wish, index: number) => React.ReactNode;
|
|
175
|
+
/**
|
|
176
|
+
* Custom render function for loading state
|
|
177
|
+
*/
|
|
178
|
+
renderLoading?: () => React.ReactNode;
|
|
179
|
+
/**
|
|
180
|
+
* Custom render function for empty state
|
|
181
|
+
*/
|
|
182
|
+
renderEmpty?: () => React.ReactNode;
|
|
183
|
+
/**
|
|
184
|
+
* Custom render function for error state
|
|
185
|
+
*/
|
|
186
|
+
renderError?: (error: string, retry: () => void) => React.ReactNode;
|
|
187
|
+
/**
|
|
188
|
+
* Page heading
|
|
189
|
+
*/
|
|
190
|
+
heading?: string;
|
|
191
|
+
/**
|
|
192
|
+
* Page description
|
|
193
|
+
*/
|
|
194
|
+
description?: string;
|
|
195
|
+
/**
|
|
196
|
+
* Heading alignment
|
|
197
|
+
* @default 'left'
|
|
198
|
+
*/
|
|
199
|
+
headingAlignment?: 'left' | 'center' | 'right';
|
|
200
|
+
/**
|
|
201
|
+
* Show search input
|
|
202
|
+
* @default false
|
|
203
|
+
*/
|
|
204
|
+
showSearch?: boolean;
|
|
205
|
+
/**
|
|
206
|
+
* Custom class name
|
|
207
|
+
*/
|
|
208
|
+
className?: string;
|
|
209
|
+
}
|
|
210
|
+
declare function WishList({ variant, filters: initialFilters, refreshInterval, onWishClick, onAddWish, renderWish, renderLoading, renderEmpty, renderError, heading, description, headingAlignment, showSearch, className, }: WishListProps): React.ReactElement;
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* WishDetail Component
|
|
214
|
+
*
|
|
215
|
+
* Sheet/modal for displaying wish details with voting and comments.
|
|
216
|
+
* Adapted from PublicWishDetail.
|
|
217
|
+
*/
|
|
218
|
+
|
|
219
|
+
interface WishDetailProps {
|
|
220
|
+
/**
|
|
221
|
+
* The wish to display
|
|
222
|
+
*/
|
|
223
|
+
wish: Wish | null;
|
|
224
|
+
/**
|
|
225
|
+
* Whether the detail view is open
|
|
226
|
+
*/
|
|
227
|
+
open: boolean;
|
|
228
|
+
/**
|
|
229
|
+
* Callback when open state changes
|
|
230
|
+
*/
|
|
231
|
+
onOpenChange: (open: boolean) => void;
|
|
232
|
+
/**
|
|
233
|
+
* Callback when vote is toggled
|
|
234
|
+
*/
|
|
235
|
+
onVote?: (wishId: string) => void;
|
|
236
|
+
/**
|
|
237
|
+
* Callback when a comment is added
|
|
238
|
+
*/
|
|
239
|
+
onCommentAdded?: (comment: Comment) => void;
|
|
240
|
+
/**
|
|
241
|
+
* Custom class name
|
|
242
|
+
*/
|
|
243
|
+
className?: string;
|
|
244
|
+
}
|
|
245
|
+
declare function WishDetail({ wish, open, onOpenChange, onVote, onCommentAdded, className, }: WishDetailProps): React.ReactElement | null;
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* SubmitWishForm Component
|
|
249
|
+
*
|
|
250
|
+
* Sheet/modal for submitting new feature requests.
|
|
251
|
+
* Adapted from FeatureRequestForm.
|
|
252
|
+
*/
|
|
253
|
+
|
|
254
|
+
interface SubmitWishFormProps {
|
|
255
|
+
/**
|
|
256
|
+
* Whether the form is open
|
|
257
|
+
*/
|
|
258
|
+
open: boolean;
|
|
259
|
+
/**
|
|
260
|
+
* Callback when open state changes
|
|
261
|
+
*/
|
|
262
|
+
onOpenChange: (open: boolean) => void;
|
|
263
|
+
/**
|
|
264
|
+
* Callback when wish is successfully submitted
|
|
265
|
+
*/
|
|
266
|
+
onSuccess?: (wish: Wish) => void;
|
|
267
|
+
/**
|
|
268
|
+
* Callback when submission fails
|
|
269
|
+
*/
|
|
270
|
+
onError?: (error: string) => void;
|
|
271
|
+
/**
|
|
272
|
+
* Form title
|
|
273
|
+
* @default 'Submit a Feature Request'
|
|
274
|
+
*/
|
|
275
|
+
title?: string;
|
|
276
|
+
/**
|
|
277
|
+
* Form description
|
|
278
|
+
*/
|
|
279
|
+
description?: string;
|
|
280
|
+
/**
|
|
281
|
+
* Submit button text
|
|
282
|
+
* @default 'Submit Feature Request'
|
|
283
|
+
*/
|
|
284
|
+
submitButtonText?: string;
|
|
285
|
+
/**
|
|
286
|
+
* Custom class name
|
|
287
|
+
*/
|
|
288
|
+
className?: string;
|
|
289
|
+
}
|
|
290
|
+
declare function SubmitWishForm({ open, onOpenChange, onSuccess, onError, title, description, submitButtonText, className, }: SubmitWishFormProps): React.ReactElement;
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* RoadmapColumn Component
|
|
294
|
+
*
|
|
295
|
+
* A single column in the roadmap board.
|
|
296
|
+
*/
|
|
297
|
+
|
|
298
|
+
interface RoadmapColumnProps {
|
|
299
|
+
/**
|
|
300
|
+
* The column data
|
|
301
|
+
*/
|
|
302
|
+
column: RoadmapColumn$1;
|
|
303
|
+
/**
|
|
304
|
+
* Click handler for items
|
|
305
|
+
*/
|
|
306
|
+
onItemClick?: (item: RoadmapItem) => void;
|
|
307
|
+
/**
|
|
308
|
+
* Show vote counts on items
|
|
309
|
+
* @default true
|
|
310
|
+
*/
|
|
311
|
+
showVoteCounts?: boolean;
|
|
312
|
+
/**
|
|
313
|
+
* Custom render function for items
|
|
314
|
+
*/
|
|
315
|
+
renderItem?: (item: RoadmapItem) => React.ReactNode;
|
|
316
|
+
/**
|
|
317
|
+
* Custom class name
|
|
318
|
+
*/
|
|
319
|
+
className?: string;
|
|
320
|
+
}
|
|
321
|
+
declare function RoadmapColumn({ column, onItemClick, showVoteCounts, renderItem, className, }: RoadmapColumnProps): React.ReactElement;
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* RoadmapBoard Component
|
|
325
|
+
*
|
|
326
|
+
* Modern glassmorphism kanban board with animations for displaying product roadmap.
|
|
327
|
+
* Adapted from RoadmapModern variant.
|
|
328
|
+
*
|
|
329
|
+
* @example
|
|
330
|
+
* ```tsx
|
|
331
|
+
* import { RoadmapBoard } from '@appgram/react'
|
|
332
|
+
*
|
|
333
|
+
* <RoadmapBoard
|
|
334
|
+
* heading="Product Roadmap"
|
|
335
|
+
* description="See what's coming next"
|
|
336
|
+
* variant="kanban"
|
|
337
|
+
* showVoteCounts
|
|
338
|
+
* onItemClick={(item) => openWishDetail(item.id)}
|
|
339
|
+
* />
|
|
340
|
+
* ```
|
|
341
|
+
*
|
|
342
|
+
* @example
|
|
343
|
+
* ```tsx
|
|
344
|
+
* // Timeline view for chronological display
|
|
345
|
+
* <RoadmapBoard
|
|
346
|
+
* variant="timeline"
|
|
347
|
+
* heading="Coming Soon"
|
|
348
|
+
* developersNote="Subject to change"
|
|
349
|
+
* />
|
|
350
|
+
* ```
|
|
351
|
+
*/
|
|
352
|
+
|
|
353
|
+
interface RoadmapBoardProps {
|
|
354
|
+
/**
|
|
355
|
+
* Layout variant
|
|
356
|
+
* @default 'kanban'
|
|
357
|
+
*/
|
|
358
|
+
variant?: 'kanban' | 'list' | 'timeline';
|
|
359
|
+
/**
|
|
360
|
+
* Page heading
|
|
361
|
+
*/
|
|
362
|
+
heading?: string;
|
|
363
|
+
/**
|
|
364
|
+
* Page description
|
|
365
|
+
*/
|
|
366
|
+
description?: string;
|
|
367
|
+
/**
|
|
368
|
+
* Developer's note
|
|
369
|
+
*/
|
|
370
|
+
developersNote?: string;
|
|
371
|
+
/**
|
|
372
|
+
* Heading alignment
|
|
373
|
+
* @default 'left'
|
|
374
|
+
*/
|
|
375
|
+
headingAlignment?: 'left' | 'center' | 'right';
|
|
376
|
+
/**
|
|
377
|
+
* Click handler for items
|
|
378
|
+
*/
|
|
379
|
+
onItemClick?: (item: RoadmapItem) => void;
|
|
380
|
+
/**
|
|
381
|
+
* Show vote counts on items
|
|
382
|
+
* @default true
|
|
383
|
+
*/
|
|
384
|
+
showVoteCounts?: boolean;
|
|
385
|
+
/**
|
|
386
|
+
* Show comment counts
|
|
387
|
+
* @default true
|
|
388
|
+
*/
|
|
389
|
+
showComments?: boolean;
|
|
390
|
+
/**
|
|
391
|
+
* Custom render function for columns
|
|
392
|
+
*/
|
|
393
|
+
renderColumn?: (column: RoadmapColumn$1) => React.ReactNode;
|
|
394
|
+
/**
|
|
395
|
+
* Custom render function for items
|
|
396
|
+
*/
|
|
397
|
+
renderItem?: (item: RoadmapItem) => React.ReactNode;
|
|
398
|
+
/**
|
|
399
|
+
* Custom render function for loading state
|
|
400
|
+
*/
|
|
401
|
+
renderLoading?: () => React.ReactNode;
|
|
402
|
+
/**
|
|
403
|
+
* Custom render function for empty state
|
|
404
|
+
*/
|
|
405
|
+
renderEmpty?: () => React.ReactNode;
|
|
406
|
+
/**
|
|
407
|
+
* Custom render function for error state
|
|
408
|
+
*/
|
|
409
|
+
renderError?: (error: string, retry: () => void) => React.ReactNode;
|
|
410
|
+
/**
|
|
411
|
+
* Auto-refresh interval in milliseconds
|
|
412
|
+
* @default 0
|
|
413
|
+
*/
|
|
414
|
+
refreshInterval?: number;
|
|
415
|
+
/**
|
|
416
|
+
* Custom class name
|
|
417
|
+
*/
|
|
418
|
+
className?: string;
|
|
419
|
+
}
|
|
420
|
+
declare function RoadmapBoard({ variant: _variant, heading, description, developersNote, headingAlignment, onItemClick, showVoteCounts, showComments, renderColumn, renderItem: _renderItem, renderLoading, renderEmpty, renderError, refreshInterval, className, }: RoadmapBoardProps): React.ReactElement;
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* ReleaseCard Component
|
|
424
|
+
*
|
|
425
|
+
* A card component for displaying a single release/changelog entry.
|
|
426
|
+
*/
|
|
427
|
+
|
|
428
|
+
interface ReleaseCardProps {
|
|
429
|
+
/**
|
|
430
|
+
* The release data
|
|
431
|
+
*/
|
|
432
|
+
release: Release;
|
|
433
|
+
/**
|
|
434
|
+
* Click handler
|
|
435
|
+
*/
|
|
436
|
+
onClick?: () => void;
|
|
437
|
+
/**
|
|
438
|
+
* Show cover image
|
|
439
|
+
* @default true
|
|
440
|
+
*/
|
|
441
|
+
showCoverImage?: boolean;
|
|
442
|
+
/**
|
|
443
|
+
* Show labels
|
|
444
|
+
* @default true
|
|
445
|
+
*/
|
|
446
|
+
showLabels?: boolean;
|
|
447
|
+
/**
|
|
448
|
+
* Show date
|
|
449
|
+
* @default true
|
|
450
|
+
*/
|
|
451
|
+
showDate?: boolean;
|
|
452
|
+
/**
|
|
453
|
+
* Custom class name
|
|
454
|
+
*/
|
|
455
|
+
className?: string;
|
|
456
|
+
}
|
|
457
|
+
declare function ReleaseCard({ release, onClick, showCoverImage, showLabels, showDate, className, }: ReleaseCardProps): React.ReactElement;
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* ReleaseList Component
|
|
461
|
+
*
|
|
462
|
+
* Modern changelog with animations.
|
|
463
|
+
* Adapted from ReleasesModern variant.
|
|
464
|
+
*/
|
|
465
|
+
|
|
466
|
+
interface ReleaseListProps {
|
|
467
|
+
/**
|
|
468
|
+
* Layout variant
|
|
469
|
+
* @default 'timeline'
|
|
470
|
+
*/
|
|
471
|
+
variant?: 'timeline' | 'cards' | 'compact';
|
|
472
|
+
/**
|
|
473
|
+
* Page heading
|
|
474
|
+
*/
|
|
475
|
+
heading?: string;
|
|
476
|
+
/**
|
|
477
|
+
* Page description
|
|
478
|
+
*/
|
|
479
|
+
description?: string;
|
|
480
|
+
/**
|
|
481
|
+
* Heading alignment
|
|
482
|
+
* @default 'left'
|
|
483
|
+
*/
|
|
484
|
+
headingAlignment?: 'left' | 'center' | 'right';
|
|
485
|
+
/**
|
|
486
|
+
* Maximum number of releases to show
|
|
487
|
+
* @default 50
|
|
488
|
+
*/
|
|
489
|
+
limit?: number;
|
|
490
|
+
/**
|
|
491
|
+
* Click handler for releases
|
|
492
|
+
*/
|
|
493
|
+
onReleaseClick?: (release: Release) => void;
|
|
494
|
+
/**
|
|
495
|
+
* Custom render function for releases
|
|
496
|
+
*/
|
|
497
|
+
renderRelease?: (release: Release, index: number) => React.ReactNode;
|
|
498
|
+
/**
|
|
499
|
+
* Custom render function for loading state
|
|
500
|
+
*/
|
|
501
|
+
renderLoading?: () => React.ReactNode;
|
|
502
|
+
/**
|
|
503
|
+
* Custom render function for empty state
|
|
504
|
+
*/
|
|
505
|
+
renderEmpty?: () => React.ReactNode;
|
|
506
|
+
/**
|
|
507
|
+
* Custom render function for error state
|
|
508
|
+
*/
|
|
509
|
+
renderError?: (error: string, retry: () => void) => React.ReactNode;
|
|
510
|
+
/**
|
|
511
|
+
* Custom class name
|
|
512
|
+
*/
|
|
513
|
+
className?: string;
|
|
514
|
+
}
|
|
515
|
+
declare function ReleaseList({ variant: _variant, heading, description, headingAlignment, limit, onReleaseClick, renderRelease, renderLoading, renderEmpty, renderError, className, }: ReleaseListProps): React.ReactElement;
|
|
516
|
+
|
|
517
|
+
/**
|
|
518
|
+
* ReleaseDetail Component
|
|
519
|
+
*
|
|
520
|
+
* Displays a single release's full content with glassmorphism styling.
|
|
521
|
+
*/
|
|
522
|
+
|
|
523
|
+
interface ReleaseDetailProps {
|
|
524
|
+
/**
|
|
525
|
+
* The release to display (either pass release object or releaseSlug)
|
|
526
|
+
*/
|
|
527
|
+
release?: Release;
|
|
528
|
+
/**
|
|
529
|
+
* Release slug to fetch (alternative to passing release object)
|
|
530
|
+
*/
|
|
531
|
+
releaseSlug?: string;
|
|
532
|
+
/**
|
|
533
|
+
* Back button click handler
|
|
534
|
+
*/
|
|
535
|
+
onBack?: () => void;
|
|
536
|
+
/**
|
|
537
|
+
* Show back button
|
|
538
|
+
* @default true
|
|
539
|
+
*/
|
|
540
|
+
showBackButton?: boolean;
|
|
541
|
+
/**
|
|
542
|
+
* Custom render function for loading state
|
|
543
|
+
*/
|
|
544
|
+
renderLoading?: () => React.ReactNode;
|
|
545
|
+
/**
|
|
546
|
+
* Custom render function for error state
|
|
547
|
+
*/
|
|
548
|
+
renderError?: (error: string, retry: () => void) => React.ReactNode;
|
|
549
|
+
/**
|
|
550
|
+
* Custom class name
|
|
551
|
+
*/
|
|
552
|
+
className?: string;
|
|
553
|
+
}
|
|
554
|
+
declare function ReleaseDetail({ release: providedRelease, releaseSlug, onBack, showBackButton, renderLoading, renderError, className, }: ReleaseDetailProps): React.ReactElement | null;
|
|
555
|
+
|
|
556
|
+
/**
|
|
557
|
+
* Releases Component
|
|
558
|
+
*
|
|
559
|
+
* Complete releases/changelog with navigation between list and detail views.
|
|
560
|
+
* Handles all state management internally for a seamless user experience.
|
|
561
|
+
*
|
|
562
|
+
* @example
|
|
563
|
+
* ```tsx
|
|
564
|
+
* import { Releases } from '@appgram/react'
|
|
565
|
+
*
|
|
566
|
+
* <Releases
|
|
567
|
+
* heading="What's New"
|
|
568
|
+
* description="See the latest features and improvements"
|
|
569
|
+
* variant="timeline"
|
|
570
|
+
* limit={10}
|
|
571
|
+
* />
|
|
572
|
+
* ```
|
|
573
|
+
*
|
|
574
|
+
* @example
|
|
575
|
+
* ```tsx
|
|
576
|
+
* // Cards variant for a grid layout
|
|
577
|
+
* <Releases
|
|
578
|
+
* heading="Release Notes"
|
|
579
|
+
* variant="cards"
|
|
580
|
+
* onReleaseClick={(release) => router.push(`/releases/${release.id}`)}
|
|
581
|
+
* />
|
|
582
|
+
* ```
|
|
583
|
+
*/
|
|
584
|
+
|
|
585
|
+
interface ReleasesProps {
|
|
586
|
+
/**
|
|
587
|
+
* Page heading
|
|
588
|
+
*/
|
|
589
|
+
heading?: string;
|
|
590
|
+
/**
|
|
591
|
+
* Page description
|
|
592
|
+
*/
|
|
593
|
+
description?: string;
|
|
594
|
+
/**
|
|
595
|
+
* Heading alignment
|
|
596
|
+
* @default 'left'
|
|
597
|
+
*/
|
|
598
|
+
headingAlignment?: 'left' | 'center' | 'right';
|
|
599
|
+
/**
|
|
600
|
+
* Maximum number of releases to show
|
|
601
|
+
* @default 50
|
|
602
|
+
*/
|
|
603
|
+
limit?: number;
|
|
604
|
+
/**
|
|
605
|
+
* Layout variant for list
|
|
606
|
+
* @default 'timeline'
|
|
607
|
+
*/
|
|
608
|
+
variant?: 'timeline' | 'cards' | 'compact';
|
|
609
|
+
/**
|
|
610
|
+
* External callback when release is clicked (for custom routing)
|
|
611
|
+
* If not provided, internal navigation is used
|
|
612
|
+
*/
|
|
613
|
+
onReleaseClick?: (release: Release) => void;
|
|
614
|
+
/**
|
|
615
|
+
* Use external routing instead of internal state management
|
|
616
|
+
* Set to true if you want to handle navigation yourself via onReleaseClick
|
|
617
|
+
* @default false
|
|
618
|
+
*/
|
|
619
|
+
useExternalRouting?: boolean;
|
|
620
|
+
/**
|
|
621
|
+
* Custom render function for loading state
|
|
622
|
+
*/
|
|
623
|
+
renderLoading?: () => React.ReactNode;
|
|
624
|
+
/**
|
|
625
|
+
* Custom render function for empty state
|
|
626
|
+
*/
|
|
627
|
+
renderEmpty?: () => React.ReactNode;
|
|
628
|
+
/**
|
|
629
|
+
* Custom render function for error state
|
|
630
|
+
*/
|
|
631
|
+
renderError?: (error: string, retry: () => void) => React.ReactNode;
|
|
632
|
+
/**
|
|
633
|
+
* Custom class name
|
|
634
|
+
*/
|
|
635
|
+
className?: string;
|
|
636
|
+
}
|
|
637
|
+
declare function Releases({ heading, description, headingAlignment, limit, variant, onReleaseClick: externalReleaseClick, useExternalRouting, renderLoading, renderEmpty, renderError, className, }: ReleasesProps): React.ReactElement;
|
|
638
|
+
|
|
639
|
+
/**
|
|
640
|
+
* WhatsNewPopup Component
|
|
641
|
+
*
|
|
642
|
+
* Small popup at bottom of screen showing latest release features
|
|
643
|
+
* with media carousel for images and videos.
|
|
644
|
+
*/
|
|
645
|
+
|
|
646
|
+
interface WhatsNewPopupProps {
|
|
647
|
+
/**
|
|
648
|
+
* Whether the popup is open
|
|
649
|
+
*/
|
|
650
|
+
open?: boolean;
|
|
651
|
+
/**
|
|
652
|
+
* Callback when open state changes
|
|
653
|
+
*/
|
|
654
|
+
onOpenChange?: (open: boolean) => void;
|
|
655
|
+
/**
|
|
656
|
+
* Auto-show popup on mount if there's a new release
|
|
657
|
+
* Uses localStorage to track seen releases
|
|
658
|
+
* @default true
|
|
659
|
+
*/
|
|
660
|
+
autoShow?: boolean;
|
|
661
|
+
/**
|
|
662
|
+
* localStorage key for tracking seen releases
|
|
663
|
+
* @default 'appgram-seen-release'
|
|
664
|
+
*/
|
|
665
|
+
storageKey?: string;
|
|
666
|
+
/**
|
|
667
|
+
* Maximum number of items to show
|
|
668
|
+
* @default 5
|
|
669
|
+
*/
|
|
670
|
+
maxItems?: number;
|
|
671
|
+
/**
|
|
672
|
+
* Show only specific item types
|
|
673
|
+
*/
|
|
674
|
+
showTypes?: ('feature' | 'improvement' | 'bugfix' | 'other')[];
|
|
675
|
+
/**
|
|
676
|
+
* Title for the popup
|
|
677
|
+
* @default "What's New"
|
|
678
|
+
*/
|
|
679
|
+
title?: string;
|
|
680
|
+
/**
|
|
681
|
+
* Click handler for "View All" button
|
|
682
|
+
*/
|
|
683
|
+
onViewAll?: () => void;
|
|
684
|
+
/**
|
|
685
|
+
* Position of the popup
|
|
686
|
+
* @default 'bottom-right'
|
|
687
|
+
*/
|
|
688
|
+
position?: 'bottom-right' | 'bottom-left' | 'bottom-center';
|
|
689
|
+
/**
|
|
690
|
+
* Show media carousel
|
|
691
|
+
* @default true
|
|
692
|
+
*/
|
|
693
|
+
showMedia?: boolean;
|
|
694
|
+
/**
|
|
695
|
+
* Auto-play carousel interval in ms (0 to disable)
|
|
696
|
+
* @default 5000
|
|
697
|
+
*/
|
|
698
|
+
autoPlayInterval?: number;
|
|
699
|
+
/**
|
|
700
|
+
* Custom class name
|
|
701
|
+
*/
|
|
702
|
+
className?: string;
|
|
703
|
+
}
|
|
704
|
+
declare function WhatsNewPopup({ open: controlledOpen, onOpenChange, autoShow, storageKey, maxItems, showTypes, title, onViewAll, position, showMedia, autoPlayInterval, className, }: WhatsNewPopupProps): React.ReactElement | null;
|
|
705
|
+
|
|
706
|
+
/**
|
|
707
|
+
* HelpCollections Component
|
|
708
|
+
*
|
|
709
|
+
* Modern help center with glassmorphism style, quick actions, and grid layout.
|
|
710
|
+
* Adapted from HelpCenterGlass variant.
|
|
711
|
+
*/
|
|
712
|
+
|
|
713
|
+
interface QuickAction {
|
|
714
|
+
label: string;
|
|
715
|
+
icon?: React.ComponentType<{
|
|
716
|
+
className?: string;
|
|
717
|
+
}>;
|
|
718
|
+
onClick: () => void;
|
|
719
|
+
}
|
|
720
|
+
interface HelpCollectionsProps {
|
|
721
|
+
/**
|
|
722
|
+
* Page heading
|
|
723
|
+
*/
|
|
724
|
+
heading?: string;
|
|
725
|
+
/**
|
|
726
|
+
* Page description
|
|
727
|
+
*/
|
|
728
|
+
description?: string;
|
|
729
|
+
/**
|
|
730
|
+
* Heading alignment
|
|
731
|
+
* @default 'center'
|
|
732
|
+
*/
|
|
733
|
+
headingAlignment?: 'left' | 'center' | 'right';
|
|
734
|
+
/**
|
|
735
|
+
* Click handler for flows
|
|
736
|
+
*/
|
|
737
|
+
onFlowClick?: (flow: HelpFlow) => void;
|
|
738
|
+
/**
|
|
739
|
+
* Click handler for articles
|
|
740
|
+
*/
|
|
741
|
+
onArticleClick?: (article: HelpArticle, flow: HelpFlow) => void;
|
|
742
|
+
/**
|
|
743
|
+
* Featured articles to display
|
|
744
|
+
*/
|
|
745
|
+
featuredArticles?: HelpArticle[];
|
|
746
|
+
/**
|
|
747
|
+
* Show search input
|
|
748
|
+
* @default true
|
|
749
|
+
*/
|
|
750
|
+
showSearch?: boolean;
|
|
751
|
+
/**
|
|
752
|
+
* Quick action buttons to display
|
|
753
|
+
*/
|
|
754
|
+
quickActions?: QuickAction[];
|
|
755
|
+
/**
|
|
756
|
+
* Show contact support footer
|
|
757
|
+
* @default true
|
|
758
|
+
*/
|
|
759
|
+
showFooter?: boolean;
|
|
760
|
+
/**
|
|
761
|
+
* Contact support URL
|
|
762
|
+
*/
|
|
763
|
+
contactSupportUrl?: string;
|
|
764
|
+
/**
|
|
765
|
+
* Live chat handler
|
|
766
|
+
*/
|
|
767
|
+
onLiveChatClick?: () => void;
|
|
768
|
+
/**
|
|
769
|
+
* Layout variant
|
|
770
|
+
* @default 'grid'
|
|
771
|
+
*/
|
|
772
|
+
variant?: 'grid' | 'list';
|
|
773
|
+
/**
|
|
774
|
+
* Custom render function for flows
|
|
775
|
+
*/
|
|
776
|
+
renderFlow?: (flow: HelpFlow) => React.ReactNode;
|
|
777
|
+
/**
|
|
778
|
+
* Custom render function for loading state
|
|
779
|
+
*/
|
|
780
|
+
renderLoading?: () => React.ReactNode;
|
|
781
|
+
/**
|
|
782
|
+
* Custom render function for empty state
|
|
783
|
+
*/
|
|
784
|
+
renderEmpty?: () => React.ReactNode;
|
|
785
|
+
/**
|
|
786
|
+
* Custom render function for error state
|
|
787
|
+
*/
|
|
788
|
+
renderError?: (error: string, retry: () => void) => React.ReactNode;
|
|
789
|
+
/**
|
|
790
|
+
* Custom class name
|
|
791
|
+
*/
|
|
792
|
+
className?: string;
|
|
793
|
+
}
|
|
794
|
+
declare function HelpCollections({ heading, description, headingAlignment, onFlowClick, onArticleClick, featuredArticles, showSearch, quickActions, showFooter, contactSupportUrl, onLiveChatClick, variant, renderFlow, renderLoading, renderEmpty, renderError, className, }: HelpCollectionsProps): React.ReactElement;
|
|
795
|
+
|
|
796
|
+
/**
|
|
797
|
+
* HelpArticles Component
|
|
798
|
+
*
|
|
799
|
+
* Displays articles within a selected help flow with glassmorphism styling.
|
|
800
|
+
*/
|
|
801
|
+
|
|
802
|
+
interface HelpArticlesProps {
|
|
803
|
+
/**
|
|
804
|
+
* The flow to display articles for (either pass flow object or flowSlug)
|
|
805
|
+
*/
|
|
806
|
+
flow?: HelpFlow;
|
|
807
|
+
/**
|
|
808
|
+
* Flow slug to fetch (alternative to passing flow object)
|
|
809
|
+
*/
|
|
810
|
+
flowSlug?: string;
|
|
811
|
+
/**
|
|
812
|
+
* Click handler for articles
|
|
813
|
+
*/
|
|
814
|
+
onArticleClick?: (article: HelpArticle) => void;
|
|
815
|
+
/**
|
|
816
|
+
* Back button click handler
|
|
817
|
+
*/
|
|
818
|
+
onBack?: () => void;
|
|
819
|
+
/**
|
|
820
|
+
* Show search input
|
|
821
|
+
* @default true
|
|
822
|
+
*/
|
|
823
|
+
showSearch?: boolean;
|
|
824
|
+
/**
|
|
825
|
+
* Show back button
|
|
826
|
+
* @default true
|
|
827
|
+
*/
|
|
828
|
+
showBackButton?: boolean;
|
|
829
|
+
/**
|
|
830
|
+
* Custom render function for loading state
|
|
831
|
+
*/
|
|
832
|
+
renderLoading?: () => React.ReactNode;
|
|
833
|
+
/**
|
|
834
|
+
* Custom render function for empty state
|
|
835
|
+
*/
|
|
836
|
+
renderEmpty?: () => React.ReactNode;
|
|
837
|
+
/**
|
|
838
|
+
* Custom render function for error state
|
|
839
|
+
*/
|
|
840
|
+
renderError?: (error: string, retry: () => void) => React.ReactNode;
|
|
841
|
+
/**
|
|
842
|
+
* Custom class name
|
|
843
|
+
*/
|
|
844
|
+
className?: string;
|
|
845
|
+
}
|
|
846
|
+
declare function HelpArticles({ flow: providedFlow, flowSlug, onArticleClick, onBack, showSearch, showBackButton, renderLoading, renderEmpty, renderError, className, }: HelpArticlesProps): React.ReactElement | null;
|
|
847
|
+
|
|
848
|
+
/**
|
|
849
|
+
* HelpArticleDetail Component
|
|
850
|
+
*
|
|
851
|
+
* Displays a single help article's content with glassmorphism styling.
|
|
852
|
+
*/
|
|
853
|
+
|
|
854
|
+
interface HelpArticleDetailProps {
|
|
855
|
+
/**
|
|
856
|
+
* The article to display (either pass article object or articleSlug + flowId)
|
|
857
|
+
*/
|
|
858
|
+
article?: HelpArticle;
|
|
859
|
+
/**
|
|
860
|
+
* Article slug to fetch (alternative to passing article object)
|
|
861
|
+
*/
|
|
862
|
+
articleSlug?: string;
|
|
863
|
+
/**
|
|
864
|
+
* Flow ID for fetching article (required if using articleSlug)
|
|
865
|
+
*/
|
|
866
|
+
flowId?: string;
|
|
867
|
+
/**
|
|
868
|
+
* The parent flow (for context)
|
|
869
|
+
*/
|
|
870
|
+
flow?: HelpFlow;
|
|
871
|
+
/**
|
|
872
|
+
* Back button click handler
|
|
873
|
+
*/
|
|
874
|
+
onBack?: () => void;
|
|
875
|
+
/**
|
|
876
|
+
* Show back button
|
|
877
|
+
* @default true
|
|
878
|
+
*/
|
|
879
|
+
showBackButton?: boolean;
|
|
880
|
+
/**
|
|
881
|
+
* Show article metadata (date, type)
|
|
882
|
+
* @default true
|
|
883
|
+
*/
|
|
884
|
+
showMetadata?: boolean;
|
|
885
|
+
/**
|
|
886
|
+
* Custom render function for loading state
|
|
887
|
+
*/
|
|
888
|
+
renderLoading?: () => React.ReactNode;
|
|
889
|
+
/**
|
|
890
|
+
* Custom render function for error state
|
|
891
|
+
*/
|
|
892
|
+
renderError?: (error: string, retry: () => void) => React.ReactNode;
|
|
893
|
+
/**
|
|
894
|
+
* Custom class name
|
|
895
|
+
*/
|
|
896
|
+
className?: string;
|
|
897
|
+
}
|
|
898
|
+
declare function HelpArticleDetail({ article: providedArticle, articleSlug, flowId, flow, onBack, showBackButton, showMetadata, renderLoading, renderError, className, }: HelpArticleDetailProps): React.ReactElement | null;
|
|
899
|
+
|
|
900
|
+
/**
|
|
901
|
+
* HelpCenter Component
|
|
902
|
+
*
|
|
903
|
+
* Complete help center with navigation between collections, articles, and article detail.
|
|
904
|
+
* Handles all state management internally for a seamless user experience.
|
|
905
|
+
*
|
|
906
|
+
* @example
|
|
907
|
+
* ```tsx
|
|
908
|
+
* import { HelpCenter } from '@appgram/react'
|
|
909
|
+
*
|
|
910
|
+
* <HelpCenter
|
|
911
|
+
* heading="Help Center"
|
|
912
|
+
* description="How can we help you today?"
|
|
913
|
+
* showSearch
|
|
914
|
+
* showFooter
|
|
915
|
+
* quickActions={[
|
|
916
|
+
* { label: 'Submit Ticket', onClick: () => router.push('/support') },
|
|
917
|
+
* { label: 'Live Chat', onClick: () => openChat() },
|
|
918
|
+
* ]}
|
|
919
|
+
* />
|
|
920
|
+
* ```
|
|
921
|
+
*
|
|
922
|
+
* @example
|
|
923
|
+
* ```tsx
|
|
924
|
+
* // Grid variant with featured articles
|
|
925
|
+
* <HelpCenter
|
|
926
|
+
* variant="grid"
|
|
927
|
+
* featuredArticles={topArticles}
|
|
928
|
+
* onLiveChatClick={() => window.Intercom?.('show')}
|
|
929
|
+
* />
|
|
930
|
+
* ```
|
|
931
|
+
*/
|
|
932
|
+
|
|
933
|
+
interface HelpCenterProps {
|
|
934
|
+
/**
|
|
935
|
+
* Page heading
|
|
936
|
+
*/
|
|
937
|
+
heading?: string;
|
|
938
|
+
/**
|
|
939
|
+
* Page description
|
|
940
|
+
*/
|
|
941
|
+
description?: string;
|
|
942
|
+
/**
|
|
943
|
+
* Heading alignment
|
|
944
|
+
* @default 'center'
|
|
945
|
+
*/
|
|
946
|
+
headingAlignment?: 'left' | 'center' | 'right';
|
|
947
|
+
/**
|
|
948
|
+
* Featured articles to display on the main view
|
|
949
|
+
*/
|
|
950
|
+
featuredArticles?: HelpArticle[];
|
|
951
|
+
/**
|
|
952
|
+
* Show search input
|
|
953
|
+
* @default true
|
|
954
|
+
*/
|
|
955
|
+
showSearch?: boolean;
|
|
956
|
+
/**
|
|
957
|
+
* Quick action buttons to display
|
|
958
|
+
*/
|
|
959
|
+
quickActions?: QuickAction[];
|
|
960
|
+
/**
|
|
961
|
+
* Show contact support footer
|
|
962
|
+
* @default true
|
|
963
|
+
*/
|
|
964
|
+
showFooter?: boolean;
|
|
965
|
+
/**
|
|
966
|
+
* Contact support URL
|
|
967
|
+
*/
|
|
968
|
+
contactSupportUrl?: string;
|
|
969
|
+
/**
|
|
970
|
+
* Live chat handler
|
|
971
|
+
*/
|
|
972
|
+
onLiveChatClick?: () => void;
|
|
973
|
+
/**
|
|
974
|
+
* Layout variant for collections
|
|
975
|
+
* @default 'grid'
|
|
976
|
+
*/
|
|
977
|
+
variant?: 'grid' | 'list';
|
|
978
|
+
/**
|
|
979
|
+
* External callback when flow is clicked (for custom routing)
|
|
980
|
+
* If not provided, internal navigation is used
|
|
981
|
+
*/
|
|
982
|
+
onFlowClick?: (flow: HelpFlow) => void;
|
|
983
|
+
/**
|
|
984
|
+
* External callback when article is clicked (for custom routing)
|
|
985
|
+
* If not provided, internal navigation is used
|
|
986
|
+
*/
|
|
987
|
+
onArticleClick?: (article: HelpArticle, flow: HelpFlow | null) => void;
|
|
988
|
+
/**
|
|
989
|
+
* Use external routing instead of internal state management
|
|
990
|
+
* Set to true if you want to handle navigation yourself via onFlowClick/onArticleClick
|
|
991
|
+
* @default false
|
|
992
|
+
*/
|
|
993
|
+
useExternalRouting?: boolean;
|
|
994
|
+
/**
|
|
995
|
+
* Custom render function for loading state
|
|
996
|
+
*/
|
|
997
|
+
renderLoading?: () => React.ReactNode;
|
|
998
|
+
/**
|
|
999
|
+
* Custom render function for empty state
|
|
1000
|
+
*/
|
|
1001
|
+
renderEmpty?: () => React.ReactNode;
|
|
1002
|
+
/**
|
|
1003
|
+
* Custom render function for error state
|
|
1004
|
+
*/
|
|
1005
|
+
renderError?: (error: string, retry: () => void) => React.ReactNode;
|
|
1006
|
+
/**
|
|
1007
|
+
* Custom class name
|
|
1008
|
+
*/
|
|
1009
|
+
className?: string;
|
|
1010
|
+
}
|
|
1011
|
+
declare function HelpCenter({ heading, description, headingAlignment, featuredArticles, showSearch, quickActions, showFooter, contactSupportUrl, onLiveChatClick, variant, onFlowClick: externalFlowClick, onArticleClick: externalArticleClick, useExternalRouting, renderLoading, renderEmpty, renderError, className, }: HelpCenterProps): React.ReactElement;
|
|
1012
|
+
|
|
1013
|
+
/**
|
|
1014
|
+
* SupportForm Component
|
|
1015
|
+
*
|
|
1016
|
+
* Modern support form with animations for submitting and tracking support tickets.
|
|
1017
|
+
* Adapted from SupportModern variant.
|
|
1018
|
+
*
|
|
1019
|
+
* @example
|
|
1020
|
+
* ```tsx
|
|
1021
|
+
* import { SupportForm } from '@appgram/react'
|
|
1022
|
+
*
|
|
1023
|
+
* <SupportForm
|
|
1024
|
+
* heading="Contact Support"
|
|
1025
|
+
* description="We're here to help"
|
|
1026
|
+
* showCategory
|
|
1027
|
+
* showName
|
|
1028
|
+
* showAttachments
|
|
1029
|
+
* onSubmitSuccess={(ticket) => console.log('Created:', ticket.id)}
|
|
1030
|
+
* onSubmitError={(error) => toast.error(error)}
|
|
1031
|
+
* />
|
|
1032
|
+
* ```
|
|
1033
|
+
*
|
|
1034
|
+
* @example
|
|
1035
|
+
* ```tsx
|
|
1036
|
+
* // With status check enabled
|
|
1037
|
+
* <SupportForm
|
|
1038
|
+
* heading="Get Help"
|
|
1039
|
+
* showCheckStatus
|
|
1040
|
+
* checkTitle="Check Your Tickets"
|
|
1041
|
+
* checkDescription="Enter your email to find existing tickets"
|
|
1042
|
+
* onCheckStatus={(email) => sendMagicLink(email)}
|
|
1043
|
+
* />
|
|
1044
|
+
* ```
|
|
1045
|
+
*/
|
|
1046
|
+
|
|
1047
|
+
interface SupportFormProps {
|
|
1048
|
+
/**
|
|
1049
|
+
* Page heading
|
|
1050
|
+
*/
|
|
1051
|
+
heading?: string;
|
|
1052
|
+
/**
|
|
1053
|
+
* Page description
|
|
1054
|
+
*/
|
|
1055
|
+
description?: string;
|
|
1056
|
+
/**
|
|
1057
|
+
* Heading alignment
|
|
1058
|
+
* @default 'left'
|
|
1059
|
+
*/
|
|
1060
|
+
headingAlignment?: 'left' | 'center' | 'right';
|
|
1061
|
+
/**
|
|
1062
|
+
* Submit section title
|
|
1063
|
+
*/
|
|
1064
|
+
submitTitle?: string;
|
|
1065
|
+
/**
|
|
1066
|
+
* Submit section description
|
|
1067
|
+
*/
|
|
1068
|
+
submitDescription?: string;
|
|
1069
|
+
/**
|
|
1070
|
+
* Check status section title
|
|
1071
|
+
*/
|
|
1072
|
+
checkTitle?: string;
|
|
1073
|
+
/**
|
|
1074
|
+
* Check status section description
|
|
1075
|
+
*/
|
|
1076
|
+
checkDescription?: string;
|
|
1077
|
+
/**
|
|
1078
|
+
* Callback when ticket is successfully submitted
|
|
1079
|
+
*/
|
|
1080
|
+
onSubmitSuccess?: (ticket: SupportRequest) => void;
|
|
1081
|
+
/**
|
|
1082
|
+
* Callback when submission fails
|
|
1083
|
+
*/
|
|
1084
|
+
onSubmitError?: (error: string) => void;
|
|
1085
|
+
/**
|
|
1086
|
+
* Callback when checking status (optional - uses magic link by default)
|
|
1087
|
+
*/
|
|
1088
|
+
onCheckStatus?: (email: string) => void;
|
|
1089
|
+
/**
|
|
1090
|
+
* Callback when a ticket is clicked
|
|
1091
|
+
*/
|
|
1092
|
+
onTicketClick?: (ticket: SupportRequest) => void;
|
|
1093
|
+
/**
|
|
1094
|
+
* Show category selector
|
|
1095
|
+
* @default true
|
|
1096
|
+
*/
|
|
1097
|
+
showCategory?: boolean;
|
|
1098
|
+
/**
|
|
1099
|
+
* Show name field
|
|
1100
|
+
* @default true
|
|
1101
|
+
*/
|
|
1102
|
+
showName?: boolean;
|
|
1103
|
+
/**
|
|
1104
|
+
* Show check status tab
|
|
1105
|
+
* @default true
|
|
1106
|
+
*/
|
|
1107
|
+
showCheckStatus?: boolean;
|
|
1108
|
+
/**
|
|
1109
|
+
* Show file attachments
|
|
1110
|
+
* @default true
|
|
1111
|
+
*/
|
|
1112
|
+
showAttachments?: boolean;
|
|
1113
|
+
/**
|
|
1114
|
+
* Submit button text
|
|
1115
|
+
* @default 'Send Request'
|
|
1116
|
+
*/
|
|
1117
|
+
submitButtonText?: string;
|
|
1118
|
+
/**
|
|
1119
|
+
* Access token for viewing tickets (from magic link)
|
|
1120
|
+
*/
|
|
1121
|
+
accessToken?: string;
|
|
1122
|
+
/**
|
|
1123
|
+
* Custom class name
|
|
1124
|
+
*/
|
|
1125
|
+
className?: string;
|
|
1126
|
+
}
|
|
1127
|
+
declare function SupportForm({ heading, description, headingAlignment, submitTitle, submitDescription, checkTitle, checkDescription, onSubmitSuccess, onSubmitError, onCheckStatus, onTicketClick, showCategory, showName, showCheckStatus, showAttachments, submitButtonText, accessToken, className, }: SupportFormProps): React.ReactElement;
|
|
1128
|
+
|
|
1129
|
+
/**
|
|
1130
|
+
* StatusBoard Component
|
|
1131
|
+
*
|
|
1132
|
+
* Modern system status page with service health indicators and incident tracking.
|
|
1133
|
+
* Adapted from StatusModern variant.
|
|
1134
|
+
*
|
|
1135
|
+
* @example
|
|
1136
|
+
* ```tsx
|
|
1137
|
+
* import { StatusBoard } from '@appgram/react'
|
|
1138
|
+
*
|
|
1139
|
+
* <StatusBoard
|
|
1140
|
+
* heading="System Status"
|
|
1141
|
+
* description="Current operational status of all services"
|
|
1142
|
+
* status={statusData}
|
|
1143
|
+
* onIncidentClick={(incident) => openIncidentDetail(incident.id)}
|
|
1144
|
+
* />
|
|
1145
|
+
* ```
|
|
1146
|
+
*
|
|
1147
|
+
* @example
|
|
1148
|
+
* ```tsx
|
|
1149
|
+
* // With custom component rendering
|
|
1150
|
+
* <StatusBoard
|
|
1151
|
+
* status={statusData}
|
|
1152
|
+
* renderComponent={(component) => (
|
|
1153
|
+
* <div className="custom-card">
|
|
1154
|
+
* <Icon name={component.status} />
|
|
1155
|
+
* <span>{component.name}</span>
|
|
1156
|
+
* </div>
|
|
1157
|
+
* )}
|
|
1158
|
+
* />
|
|
1159
|
+
* ```
|
|
1160
|
+
*/
|
|
1161
|
+
|
|
1162
|
+
type OverallStatus = 'operational' | 'degraded' | 'partial_outage' | 'major_outage';
|
|
1163
|
+
type ComponentStatus = 'operational' | 'degraded' | 'partial_outage' | 'major_outage';
|
|
1164
|
+
type IncidentStatus = 'investigating' | 'identified' | 'monitoring' | 'resolved';
|
|
1165
|
+
type IncidentImpact = 'minor' | 'major' | 'critical';
|
|
1166
|
+
interface StatusComponent {
|
|
1167
|
+
id: string;
|
|
1168
|
+
name: string;
|
|
1169
|
+
description?: string;
|
|
1170
|
+
status: ComponentStatus;
|
|
1171
|
+
group?: string;
|
|
1172
|
+
}
|
|
1173
|
+
interface IncidentUpdate {
|
|
1174
|
+
id: string;
|
|
1175
|
+
message: string;
|
|
1176
|
+
status: IncidentStatus;
|
|
1177
|
+
created_at: string;
|
|
1178
|
+
}
|
|
1179
|
+
interface StatusIncident {
|
|
1180
|
+
id: string;
|
|
1181
|
+
title: string;
|
|
1182
|
+
status: IncidentStatus;
|
|
1183
|
+
impact: IncidentImpact;
|
|
1184
|
+
created_at: string;
|
|
1185
|
+
resolved_at?: string | null;
|
|
1186
|
+
updates: IncidentUpdate[];
|
|
1187
|
+
affected_components?: string[];
|
|
1188
|
+
}
|
|
1189
|
+
interface StatusData {
|
|
1190
|
+
overall_status: OverallStatus;
|
|
1191
|
+
components: StatusComponent[];
|
|
1192
|
+
incidents: StatusIncident[];
|
|
1193
|
+
last_updated?: string;
|
|
1194
|
+
}
|
|
1195
|
+
interface StatusBoardProps {
|
|
1196
|
+
/**
|
|
1197
|
+
* Status data to display
|
|
1198
|
+
*/
|
|
1199
|
+
status: StatusData;
|
|
1200
|
+
/**
|
|
1201
|
+
* Page heading
|
|
1202
|
+
*/
|
|
1203
|
+
heading?: string;
|
|
1204
|
+
/**
|
|
1205
|
+
* Page description
|
|
1206
|
+
*/
|
|
1207
|
+
description?: string;
|
|
1208
|
+
/**
|
|
1209
|
+
* Heading alignment
|
|
1210
|
+
* @default 'left'
|
|
1211
|
+
*/
|
|
1212
|
+
headingAlignment?: 'left' | 'center' | 'right';
|
|
1213
|
+
/**
|
|
1214
|
+
* Show component descriptions
|
|
1215
|
+
* @default true
|
|
1216
|
+
*/
|
|
1217
|
+
showComponentDescriptions?: boolean;
|
|
1218
|
+
/**
|
|
1219
|
+
* Show incident history
|
|
1220
|
+
* @default true
|
|
1221
|
+
*/
|
|
1222
|
+
showIncidentHistory?: boolean;
|
|
1223
|
+
/**
|
|
1224
|
+
* Max number of past incidents to show
|
|
1225
|
+
* @default 5
|
|
1226
|
+
*/
|
|
1227
|
+
maxPastIncidents?: number;
|
|
1228
|
+
/**
|
|
1229
|
+
* Click handler for incidents
|
|
1230
|
+
*/
|
|
1231
|
+
onIncidentClick?: (incident: StatusIncident) => void;
|
|
1232
|
+
/**
|
|
1233
|
+
* Custom render for overall status
|
|
1234
|
+
*/
|
|
1235
|
+
renderOverallStatus?: (status: OverallStatus) => React.ReactNode;
|
|
1236
|
+
/**
|
|
1237
|
+
* Custom render for component
|
|
1238
|
+
*/
|
|
1239
|
+
renderComponent?: (component: StatusComponent) => React.ReactNode;
|
|
1240
|
+
/**
|
|
1241
|
+
* Custom render for incident
|
|
1242
|
+
*/
|
|
1243
|
+
renderIncident?: (incident: StatusIncident) => React.ReactNode;
|
|
1244
|
+
/**
|
|
1245
|
+
* Custom class name
|
|
1246
|
+
*/
|
|
1247
|
+
className?: string;
|
|
1248
|
+
}
|
|
1249
|
+
declare function StatusBoard({ status, heading, description, headingAlignment, showComponentDescriptions, showIncidentHistory, maxPastIncidents, onIncidentClick, renderOverallStatus, renderComponent, renderIncident, className, }: StatusBoardProps): React.ReactElement;
|
|
1250
|
+
|
|
1251
|
+
/**
|
|
1252
|
+
* StatusIncidentDetail Component
|
|
1253
|
+
*
|
|
1254
|
+
* Displays a single incident's full details with timeline of updates.
|
|
1255
|
+
*/
|
|
1256
|
+
|
|
1257
|
+
interface StatusIncidentDetailProps {
|
|
1258
|
+
/**
|
|
1259
|
+
* The incident to display
|
|
1260
|
+
*/
|
|
1261
|
+
incident: StatusIncident;
|
|
1262
|
+
/**
|
|
1263
|
+
* Back button click handler
|
|
1264
|
+
*/
|
|
1265
|
+
onBack?: () => void;
|
|
1266
|
+
/**
|
|
1267
|
+
* Show back button
|
|
1268
|
+
* @default true
|
|
1269
|
+
*/
|
|
1270
|
+
showBackButton?: boolean;
|
|
1271
|
+
/**
|
|
1272
|
+
* Show affected components
|
|
1273
|
+
* @default true
|
|
1274
|
+
*/
|
|
1275
|
+
showAffectedComponents?: boolean;
|
|
1276
|
+
/**
|
|
1277
|
+
* Custom class name
|
|
1278
|
+
*/
|
|
1279
|
+
className?: string;
|
|
1280
|
+
}
|
|
1281
|
+
declare function StatusIncidentDetail({ incident, onBack, showBackButton, showAffectedComponents, className, }: StatusIncidentDetailProps): React.ReactElement;
|
|
1282
|
+
|
|
1283
|
+
export { type ComponentStatus, HelpArticleDetail, type HelpArticleDetailProps, HelpArticles, type HelpArticlesProps, HelpCenter, type HelpCenterProps, HelpCollections, type HelpCollectionsProps, type IncidentImpact, type IncidentStatus, type IncidentUpdate, type OverallStatus, type QuickAction, ReleaseCard, type ReleaseCardProps, ReleaseDetail, type ReleaseDetailProps, ReleaseList, type ReleaseListProps, Releases, type ReleasesProps, RoadmapBoard, type RoadmapBoardProps, RoadmapColumn, type RoadmapColumnProps, StatusBoard, type StatusBoardProps, type StatusComponent, type StatusData, type StatusIncident, StatusIncidentDetail, type StatusIncidentDetailProps, SubmitWishForm, type SubmitWishFormProps, SupportForm, type SupportFormProps, VoteButton, type VoteButtonProps, WhatsNewPopup, type WhatsNewPopupProps, WishCard, type WishCardProps, WishDetail, type WishDetailProps, WishList, type WishListProps };
|