@xhub-short/ui 0.1.0-beta.1 → 0.1.0-beta.11

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 (76) hide show
  1. package/dist/CommentSheet.css-DyEc3Sro.d.ts +217 -0
  2. package/dist/VideoSlotPlayIndicator-DPs8Xt5C.d.ts +51 -0
  3. package/dist/chunk-3OB3OVYR.js +349 -0
  4. package/dist/{chunk-WKX2WBVO.js → chunk-3XPJHUYL.js} +1 -39
  5. package/dist/chunk-4RIMQOBR.js +58 -0
  6. package/dist/chunk-4TUBNA2X.js +180 -0
  7. package/dist/{chunk-4YDIRPIN.js → chunk-ANCP53F3.js} +3 -3
  8. package/dist/{chunk-UXMA4KJZ.js → chunk-CAWE42LH.js} +5 -3
  9. package/dist/{chunk-ANGBSV7L.js → chunk-CIIZ3IHV.js} +10 -5
  10. package/dist/chunk-DR7KR7OT.js +103 -0
  11. package/dist/chunk-DXLCQ4FH.js +102 -0
  12. package/dist/chunk-EDWS2IPH.js +1 -0
  13. package/dist/chunk-FR7UQSZP.js +570 -0
  14. package/dist/chunk-IWSBYOSS.js +91 -0
  15. package/dist/chunk-JEY6R4KJ.js +334 -0
  16. package/dist/chunk-KMJ3PQ7M.js +1262 -0
  17. package/dist/chunk-MFJS65C5.js +368 -0
  18. package/dist/{chunk-HW4LXTFT.js → chunk-OM4L7RE5.js} +18 -6
  19. package/dist/chunk-PBIH2F2Q.js +344 -0
  20. package/dist/chunk-PJ4NMVMY.js +326 -0
  21. package/dist/chunk-Q6MG7AVG.js +531 -0
  22. package/dist/chunk-QCKVF2DR.js +713 -0
  23. package/dist/chunk-QCRRF76W.js +75 -0
  24. package/dist/chunk-QUEJHA24.js +508 -0
  25. package/dist/chunk-VXW7AOGM.js +285 -0
  26. package/dist/chunk-YB7AXTX7.js +430 -0
  27. package/dist/chunk-ZGWSJ6Z5.js +601 -0
  28. package/dist/components/ActionBar/index.js +1 -1
  29. package/dist/components/AdvanceMenu/index.d.ts +78 -0
  30. package/dist/components/AdvanceMenu/index.js +1 -0
  31. package/dist/components/AuthorInfo/index.d.ts +5 -1
  32. package/dist/components/AuthorInfo/index.js +1 -1
  33. package/dist/components/BottomSheet/index.d.ts +82 -0
  34. package/dist/components/BottomSheet/index.js +1 -0
  35. package/dist/components/CleanModeOverlay/index.d.ts +60 -0
  36. package/dist/components/CleanModeOverlay/index.js +1 -0
  37. package/dist/components/CommentSheet/index.d.ts +164 -0
  38. package/dist/components/CommentSheet/index.js +1 -0
  39. package/dist/components/DetailView/index.d.ts +311 -0
  40. package/dist/components/DetailView/index.js +1 -0
  41. package/dist/components/ErrorBoundary/index.js +1 -1
  42. package/dist/components/ImageCarousel/index.d.ts +50 -0
  43. package/dist/components/ImageCarousel/index.js +1 -0
  44. package/dist/components/ImagePostSlot/index.d.ts +207 -0
  45. package/dist/components/ImagePostSlot/index.js +1 -0
  46. package/dist/components/ProgressBar/index.d.ts +30 -2
  47. package/dist/components/ProgressBar/index.js +1 -1
  48. package/dist/components/QualityPicker/index.d.ts +35 -0
  49. package/dist/components/QualityPicker/index.js +1 -0
  50. package/dist/components/ReportSheet/index.d.ts +68 -0
  51. package/dist/components/ReportSheet/index.js +1 -0
  52. package/dist/components/Skeleton/index.js +1 -1
  53. package/dist/components/SpeedPicker/index.d.ts +32 -0
  54. package/dist/components/SpeedPicker/index.js +1 -0
  55. package/dist/components/VideoFeed/index.d.ts +12 -1
  56. package/dist/components/VideoFeed/index.js +1 -1
  57. package/dist/components/VideoInfo/index.d.ts +4 -2
  58. package/dist/components/VideoInfo/index.js +1 -1
  59. package/dist/components/VideoPlayer/index.d.ts +14 -41
  60. package/dist/components/VideoPlayer/index.js +1 -1
  61. package/dist/components/VideoSlot/index.d.ts +84 -65
  62. package/dist/components/VideoSlot/index.js +2 -1
  63. package/dist/components/VirtualSlider/index.d.ts +339 -0
  64. package/dist/components/VirtualSlider/index.js +1 -0
  65. package/dist/components/icons/index.js +1 -1
  66. package/dist/index.d.ts +107 -95
  67. package/dist/index.js +84 -27
  68. package/package.json +51 -7
  69. package/dist/chunk-2PTMP65P.js +0 -738
  70. package/dist/chunk-4MN72OZH.js +0 -148
  71. package/dist/chunk-DHQJBXQW.js +0 -562
  72. package/dist/chunk-SSJDO24Q.js +0 -204
  73. package/dist/chunk-XAOEHLOX.js +0 -1326
  74. package/dist/chunk-YW23IBKF.js +0 -530
  75. package/dist/chunk-ZZDQKP4R.js +0 -418
  76. package/dist/use-gesture-react.esm-3SV4QLEJ.js +0 -1893
@@ -0,0 +1,713 @@
1
+ import { BottomSheetHeadless } from './chunk-PJ4NMVMY.js';
2
+ import { injectComponentCSS } from './chunk-CAWE42LH.js';
3
+ import { clsx } from 'clsx';
4
+ import { memo, useState, useEffect, useCallback } from 'react';
5
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
6
+
7
+ // src/components/ReportSheet/ReportSheet.css.ts
8
+ var REPORT_SHEET_CSS = (
9
+ /* css */
10
+ `
11
+ /* \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
12
+ CSS VARIABLES
13
+ \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 */
14
+
15
+ .sv-report-sheet {
16
+ /* Colors */
17
+ --sv-report-bg: #1a1a1a;
18
+ --sv-report-text: rgba(255, 255, 255, 0.95);
19
+ --sv-report-text-muted: rgba(255, 255, 255, 0.6);
20
+ --sv-report-border: rgba(255, 255, 255, 0.1);
21
+ --sv-report-error: #ef4444;
22
+ --sv-report-success: #22c55e;
23
+ --sv-report-primary: #3b82f6;
24
+ --sv-report-item-hover: rgba(255, 255, 255, 0.05);
25
+
26
+ /* Spacing */
27
+ --sv-report-padding: 16px;
28
+ --sv-report-gap: 12px;
29
+ --sv-report-radius: 8px;
30
+
31
+ /* Override BottomSheet */
32
+ --sv-sheet-bg: var(--sv-report-bg);
33
+ }
34
+
35
+ /* \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
36
+ HEADER
37
+ \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 */
38
+
39
+ .sv-report-header {
40
+ display: flex;
41
+ align-items: center;
42
+ justify-content: space-between;
43
+ gap: 12px;
44
+ padding: var(--sv-report-padding);
45
+ border-bottom: 1px solid var(--sv-report-border);
46
+ min-height: 56px;
47
+ }
48
+
49
+ .sv-report-title {
50
+ flex: 1;
51
+ font-size: 17px;
52
+ font-weight: 600;
53
+ color: var(--sv-report-text);
54
+ margin: 0;
55
+ text-align: center;
56
+ }
57
+
58
+ /* When back button is present, title should still be centered */
59
+ .sv-report-header .sv-report-back + .sv-report-title {
60
+ margin-left: -32px; /* Compensate for back button */
61
+ }
62
+
63
+ .sv-report-close,
64
+ .sv-report-back {
65
+ display: flex;
66
+ align-items: center;
67
+ justify-content: center;
68
+ width: 32px;
69
+ height: 32px;
70
+ padding: 0;
71
+ flex-shrink: 0;
72
+
73
+ background: transparent;
74
+ border: none;
75
+ border-radius: 50%;
76
+
77
+ color: var(--sv-report-text-muted);
78
+ cursor: pointer;
79
+ transition: background 150ms ease, color 150ms ease;
80
+ }
81
+
82
+ .sv-report-close:hover,
83
+ .sv-report-back:hover {
84
+ background: var(--sv-report-item-hover);
85
+ color: var(--sv-report-text);
86
+ }
87
+
88
+ /* \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
89
+ CONTENT
90
+ \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 */
91
+
92
+ .sv-report-content {
93
+ padding: 0;
94
+ max-height: 50vh;
95
+ overflow-y: auto;
96
+ -webkit-overflow-scrolling: touch;
97
+ }
98
+
99
+ .sv-report-content--detail {
100
+ padding: var(--sv-report-padding);
101
+ }
102
+
103
+ /* \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
104
+ STEP 1: REASON LIST
105
+ \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 */
106
+
107
+ .sv-report-reasons {
108
+ display: flex;
109
+ flex-direction: column;
110
+ margin: 0;
111
+ padding: 0;
112
+ list-style: none;
113
+ }
114
+
115
+ .sv-report-reason-item {
116
+ display: flex;
117
+ align-items: center;
118
+ justify-content: space-between;
119
+ gap: 12px;
120
+ width: 100%;
121
+ padding: 16px var(--sv-report-padding);
122
+
123
+ background: transparent;
124
+ border: none;
125
+ border-bottom: 1px solid var(--sv-report-border);
126
+
127
+ color: var(--sv-report-text);
128
+ font-size: 15px;
129
+ text-align: left;
130
+
131
+ cursor: pointer;
132
+ transition: background 150ms ease;
133
+ }
134
+
135
+ .sv-report-reason-item:last-child {
136
+ border-bottom: none;
137
+ }
138
+
139
+ .sv-report-reason-item:hover {
140
+ background: var(--sv-report-item-hover);
141
+ }
142
+
143
+ .sv-report-reason-item:active {
144
+ background: rgba(255, 255, 255, 0.08);
145
+ }
146
+
147
+ .sv-report-reason-item .sv-report-reason-label {
148
+ flex: 1;
149
+ }
150
+
151
+ .sv-report-reason-item svg {
152
+ flex-shrink: 0;
153
+ color: var(--sv-report-text-muted);
154
+ }
155
+
156
+ /* \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
157
+ SKELETON LOADING
158
+ \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 */
159
+
160
+ .sv-report-reasons--loading {
161
+ pointer-events: none;
162
+ }
163
+
164
+ .sv-report-reason-skeleton {
165
+ display: flex;
166
+ align-items: center;
167
+ justify-content: space-between;
168
+ gap: 12px;
169
+ padding: 16px var(--sv-report-padding);
170
+ border-bottom: 1px solid var(--sv-report-border);
171
+ }
172
+
173
+ .sv-report-reason-skeleton:last-child {
174
+ border-bottom: none;
175
+ }
176
+
177
+ .sv-report-skeleton-text {
178
+ flex: 1;
179
+ height: 16px;
180
+ max-width: 200px;
181
+ background: linear-gradient(
182
+ 90deg,
183
+ rgba(255, 255, 255, 0.06) 25%,
184
+ rgba(255, 255, 255, 0.12) 50%,
185
+ rgba(255, 255, 255, 0.06) 75%
186
+ );
187
+ background-size: 200% 100%;
188
+ border-radius: 4px;
189
+ animation: sv-report-skeleton-shimmer 1.5s infinite;
190
+ }
191
+
192
+ .sv-report-skeleton-icon {
193
+ width: 20px;
194
+ height: 20px;
195
+ background: rgba(255, 255, 255, 0.06);
196
+ border-radius: 4px;
197
+ }
198
+
199
+ @keyframes sv-report-skeleton-shimmer {
200
+ 0% { background-position: 200% 0; }
201
+ 100% { background-position: -200% 0; }
202
+ }
203
+
204
+ /* \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
205
+ STEP 2: REASON DETAIL
206
+ \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 */
207
+
208
+ .sv-report-reason-title {
209
+ margin: 0 0 var(--sv-report-gap);
210
+ font-size: 16px;
211
+ font-weight: 600;
212
+ color: var(--sv-report-text);
213
+ }
214
+
215
+ .sv-report-reason-description {
216
+ margin: 0 0 var(--sv-report-gap);
217
+ padding: 12px 16px;
218
+
219
+ background: rgba(255, 255, 255, 0.05);
220
+ border-radius: var(--sv-report-radius);
221
+
222
+ font-size: 14px;
223
+ color: var(--sv-report-text-muted);
224
+ line-height: 1.5;
225
+ }
226
+
227
+ /* \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
228
+ TEXT INPUT
229
+ \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 */
230
+
231
+ .sv-report-input-section {
232
+ margin-top: var(--sv-report-gap);
233
+ }
234
+
235
+ .sv-report-textarea {
236
+ width: 100%;
237
+ min-height: 120px;
238
+ padding: 12px;
239
+
240
+ background: rgba(255, 255, 255, 0.05);
241
+ border: 1px solid var(--sv-report-border);
242
+ border-radius: var(--sv-report-radius);
243
+
244
+ color: var(--sv-report-text);
245
+ font-size: 14px;
246
+ font-family: inherit;
247
+ line-height: 1.5;
248
+ resize: vertical;
249
+
250
+ transition: border-color 150ms ease;
251
+ }
252
+
253
+ .sv-report-textarea::placeholder {
254
+ color: var(--sv-report-text-muted);
255
+ }
256
+
257
+ .sv-report-textarea:focus {
258
+ outline: none;
259
+ border-color: var(--sv-report-primary);
260
+ }
261
+
262
+ .sv-report-char-count {
263
+ margin-top: 4px;
264
+ font-size: 12px;
265
+ color: var(--sv-report-text-muted);
266
+ text-align: right;
267
+ }
268
+
269
+ .sv-report-char-count[data-over="true"] {
270
+ color: var(--sv-report-error);
271
+ }
272
+
273
+ /* \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
274
+ FOOTER
275
+ \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 */
276
+
277
+ .sv-report-footer {
278
+ display: flex;
279
+ gap: 12px;
280
+ padding: var(--sv-report-padding);
281
+ border-top: 1px solid var(--sv-report-border);
282
+ }
283
+
284
+ .sv-report-footer--single {
285
+ /* Single button layout */
286
+ }
287
+
288
+ .sv-report-button {
289
+ flex: 1;
290
+ padding: 14px 20px;
291
+
292
+ border: none;
293
+ border-radius: var(--sv-report-radius);
294
+
295
+ font-size: 15px;
296
+ font-weight: 600;
297
+
298
+ cursor: pointer;
299
+ transition: background 150ms ease, opacity 150ms ease;
300
+ }
301
+
302
+ .sv-report-button-submit {
303
+ background: var(--sv-report-primary);
304
+ color: white;
305
+ }
306
+
307
+ .sv-report-button-submit:hover:not(:disabled) {
308
+ background: #2563eb;
309
+ }
310
+
311
+ .sv-report-button-submit:active:not(:disabled) {
312
+ background: #1d4ed8;
313
+ }
314
+
315
+ .sv-report-button-submit:disabled {
316
+ opacity: 0.5;
317
+ cursor: not-allowed;
318
+ }
319
+
320
+ /* \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
321
+ LOADING & SUCCESS STATES
322
+ \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 */
323
+
324
+ .sv-report-loading {
325
+ display: flex;
326
+ align-items: center;
327
+ justify-content: center;
328
+ gap: 12px;
329
+ padding: 48px 24px;
330
+ color: var(--sv-report-text-muted);
331
+ }
332
+
333
+ .sv-report-spinner {
334
+ width: 24px;
335
+ height: 24px;
336
+ border: 2px solid var(--sv-report-border);
337
+ border-top-color: var(--sv-report-primary);
338
+ border-radius: 50%;
339
+ animation: sv-report-spin 0.8s linear infinite;
340
+ }
341
+
342
+ @keyframes sv-report-spin {
343
+ to { transform: rotate(360deg); }
344
+ }
345
+
346
+ .sv-report-success {
347
+ display: flex;
348
+ flex-direction: column;
349
+ align-items: center;
350
+ justify-content: center;
351
+ gap: 16px;
352
+ padding: 48px 24px;
353
+ text-align: center;
354
+ }
355
+
356
+ .sv-report-success-icon {
357
+ width: 48px;
358
+ height: 48px;
359
+ color: var(--sv-report-success);
360
+ }
361
+
362
+ .sv-report-success-title {
363
+ margin: 0;
364
+ font-size: 18px;
365
+ font-weight: 600;
366
+ color: var(--sv-report-text);
367
+ }
368
+
369
+ .sv-report-success-message {
370
+ margin: 0;
371
+ font-size: 14px;
372
+ color: var(--sv-report-text-muted);
373
+ }
374
+
375
+ /* \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
376
+ ERROR STATE
377
+ \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 */
378
+
379
+ .sv-report-error-message {
380
+ display: flex;
381
+ align-items: center;
382
+ gap: 8px;
383
+ padding: 12px;
384
+ margin-bottom: var(--sv-report-gap);
385
+
386
+ background: rgba(239, 68, 68, 0.1);
387
+ border-radius: var(--sv-report-radius);
388
+
389
+ color: var(--sv-report-error);
390
+ font-size: 14px;
391
+ }
392
+ `
393
+ );
394
+ function injectReportSheetCSS() {
395
+ injectComponentCSS("report-sheet", REPORT_SHEET_CSS, { layered: false });
396
+ }
397
+ if (typeof document !== "undefined") {
398
+ injectReportSheetCSS();
399
+ }
400
+ var DEFAULT_MAX_LENGTH = 500;
401
+ var DEFAULT_REASONS = [
402
+ {
403
+ id: "spam",
404
+ label: "Spam",
405
+ description: "Repetitive posts, fake engagement, or misleading content."
406
+ },
407
+ {
408
+ id: "inappropriate",
409
+ label: "Inappropriate content",
410
+ description: "Nudity, sexual content, or content not suitable for all audiences."
411
+ },
412
+ {
413
+ id: "violence",
414
+ label: "Violence or dangerous activities",
415
+ description: "Graphic violence, threats, or promotion of dangerous behavior."
416
+ },
417
+ {
418
+ id: "harassment",
419
+ label: "Harassment or bullying",
420
+ description: "Targeting individuals with abuse, threats, or unwanted behavior."
421
+ },
422
+ {
423
+ id: "misinformation",
424
+ label: "Misinformation",
425
+ description: "False or misleading information that could cause harm."
426
+ },
427
+ {
428
+ id: "copyright",
429
+ label: "Copyright violation",
430
+ description: "Content that infringes on intellectual property rights."
431
+ },
432
+ {
433
+ id: "other",
434
+ label: "Other",
435
+ description: "Other issues not covered by the categories above."
436
+ }
437
+ ];
438
+ function CloseIcon() {
439
+ return /* @__PURE__ */ jsxs(
440
+ "svg",
441
+ {
442
+ "aria-hidden": "true",
443
+ width: "20",
444
+ height: "20",
445
+ viewBox: "0 0 24 24",
446
+ fill: "none",
447
+ stroke: "currentColor",
448
+ strokeWidth: "2",
449
+ children: [
450
+ /* @__PURE__ */ jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
451
+ /* @__PURE__ */ jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
452
+ ]
453
+ }
454
+ );
455
+ }
456
+ function BackIcon() {
457
+ return /* @__PURE__ */ jsx(
458
+ "svg",
459
+ {
460
+ "aria-hidden": "true",
461
+ width: "20",
462
+ height: "20",
463
+ viewBox: "0 0 24 24",
464
+ fill: "none",
465
+ stroke: "currentColor",
466
+ strokeWidth: "2",
467
+ children: /* @__PURE__ */ jsx("polyline", { points: "15 18 9 12 15 6" })
468
+ }
469
+ );
470
+ }
471
+ function ChevronRightIcon() {
472
+ return /* @__PURE__ */ jsx(
473
+ "svg",
474
+ {
475
+ "aria-hidden": "true",
476
+ width: "20",
477
+ height: "20",
478
+ viewBox: "0 0 24 24",
479
+ fill: "none",
480
+ stroke: "currentColor",
481
+ strokeWidth: "2",
482
+ children: /* @__PURE__ */ jsx("polyline", { points: "9 18 15 12 9 6" })
483
+ }
484
+ );
485
+ }
486
+ function CheckIcon() {
487
+ return /* @__PURE__ */ jsxs(
488
+ "svg",
489
+ {
490
+ "aria-hidden": "true",
491
+ width: "48",
492
+ height: "48",
493
+ viewBox: "0 0 24 24",
494
+ fill: "none",
495
+ stroke: "currentColor",
496
+ strokeWidth: "2",
497
+ children: [
498
+ /* @__PURE__ */ jsx("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }),
499
+ /* @__PURE__ */ jsx("polyline", { points: "22 4 12 14.01 9 11.01" })
500
+ ]
501
+ }
502
+ );
503
+ }
504
+ function ReportSheetHeadlessComponent({
505
+ isOpen,
506
+ onClose,
507
+ onSubmit,
508
+ reasons = DEFAULT_REASONS,
509
+ isLoadingReasons = false,
510
+ maxLength = DEFAULT_MAX_LENGTH,
511
+ alreadyReported = false,
512
+ // Labels
513
+ selectTitle = "Please select a reason",
514
+ title = "Report",
515
+ inputPlaceholder = "Tell us more about the issue (optional)...",
516
+ submitText = "Submit Report",
517
+ loadingText = "Submitting...",
518
+ successTitle = "Report Submitted",
519
+ successMessage = "Thank you for helping keep our community safe.",
520
+ doneText = "Done",
521
+ errorMessage = "Failed to submit report. Please try again.",
522
+ errorDescription = "Please try again or contact support if the problem persists.",
523
+ // Customization
524
+ successIcon,
525
+ className
526
+ }) {
527
+ const [step, setStep] = useState("select");
528
+ const [state, setState] = useState("form");
529
+ const [selectedReason, setSelectedReason] = useState(null);
530
+ const [description, setDescription] = useState("");
531
+ const [error, setError] = useState(null);
532
+ useEffect(() => {
533
+ injectReportSheetCSS();
534
+ }, []);
535
+ useEffect(() => {
536
+ if (isOpen) {
537
+ if (alreadyReported) {
538
+ setState("success");
539
+ setStep("select");
540
+ } else {
541
+ setStep("select");
542
+ setState("form");
543
+ }
544
+ setSelectedReason(null);
545
+ setDescription("");
546
+ setError(null);
547
+ }
548
+ }, [isOpen, alreadyReported]);
549
+ const handleDone = useCallback(() => {
550
+ onClose();
551
+ }, [onClose]);
552
+ const handleReasonSelect = useCallback((reason) => {
553
+ setSelectedReason(reason);
554
+ setStep("detail");
555
+ setError(null);
556
+ }, []);
557
+ const handleBack = useCallback(() => {
558
+ setStep("select");
559
+ setError(null);
560
+ }, []);
561
+ const handleDescriptionChange = useCallback(
562
+ (e) => {
563
+ const value = e.target.value;
564
+ if (value.length <= maxLength) {
565
+ setDescription(value);
566
+ }
567
+ },
568
+ [maxLength]
569
+ );
570
+ const handleSubmit = useCallback(async () => {
571
+ if (!selectedReason) return;
572
+ setState("loading");
573
+ setError(null);
574
+ try {
575
+ await onSubmit(selectedReason.id, description || void 0);
576
+ setState("success");
577
+ } catch (err) {
578
+ setState("error");
579
+ setError(err instanceof Error ? err.message : errorMessage);
580
+ }
581
+ }, [selectedReason, description, onSubmit, errorMessage]);
582
+ const handleClose = useCallback(() => {
583
+ if (state === "loading") return;
584
+ onClose();
585
+ }, [state, onClose]);
586
+ const renderReasonSkeleton = () => /* @__PURE__ */ jsx("ul", { className: "sv-report-reasons sv-report-reasons--loading", "aria-busy": "true", children: [1, 2, 3, 4, 5].map((i) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs("div", { className: "sv-report-reason-skeleton", children: [
587
+ /* @__PURE__ */ jsx("div", { className: "sv-report-skeleton-text" }),
588
+ /* @__PURE__ */ jsx("div", { className: "sv-report-skeleton-icon" })
589
+ ] }) }, i)) });
590
+ const renderSelectStep = () => /* @__PURE__ */ jsxs(Fragment, { children: [
591
+ /* @__PURE__ */ jsxs("div", { className: "sv-report-header", children: [
592
+ /* @__PURE__ */ jsx("h2", { className: "sv-report-title", children: selectTitle }),
593
+ /* @__PURE__ */ jsx("button", { type: "button", className: "sv-report-close", onClick: handleClose, "aria-label": "Close", children: /* @__PURE__ */ jsx(CloseIcon, {}) })
594
+ ] }),
595
+ /* @__PURE__ */ jsx("div", { className: "sv-report-content", children: isLoadingReasons ? renderReasonSkeleton() : /* @__PURE__ */ jsx("ul", { className: "sv-report-reasons", "aria-label": "Report reasons", children: reasons.map((reason) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
596
+ "button",
597
+ {
598
+ type: "button",
599
+ className: "sv-report-reason-item",
600
+ onClick: () => handleReasonSelect(reason),
601
+ children: [
602
+ /* @__PURE__ */ jsx("span", { className: "sv-report-reason-label", children: reason.label }),
603
+ /* @__PURE__ */ jsx(ChevronRightIcon, {})
604
+ ]
605
+ }
606
+ ) }, reason.id)) }) })
607
+ ] });
608
+ const renderDetailStep = () => /* @__PURE__ */ jsxs(Fragment, { children: [
609
+ /* @__PURE__ */ jsxs("div", { className: "sv-report-header", children: [
610
+ /* @__PURE__ */ jsx("button", { type: "button", className: "sv-report-back", onClick: handleBack, "aria-label": "Back", children: /* @__PURE__ */ jsx(BackIcon, {}) }),
611
+ /* @__PURE__ */ jsx("h2", { className: "sv-report-title", children: title }),
612
+ /* @__PURE__ */ jsx("button", { type: "button", className: "sv-report-close", onClick: handleClose, "aria-label": "Close", children: /* @__PURE__ */ jsx(CloseIcon, {}) })
613
+ ] }),
614
+ /* @__PURE__ */ jsxs("div", { className: "sv-report-content sv-report-content--detail", children: [
615
+ /* @__PURE__ */ jsx("h3", { className: "sv-report-reason-title", children: selectedReason?.label }),
616
+ selectedReason?.description && /* @__PURE__ */ jsx("p", { className: "sv-report-reason-description", children: selectedReason.description }),
617
+ error && /* @__PURE__ */ jsx("div", { className: "sv-report-error-message", role: "alert", children: error }),
618
+ /* @__PURE__ */ jsxs("div", { className: "sv-report-input-section", children: [
619
+ /* @__PURE__ */ jsx(
620
+ "textarea",
621
+ {
622
+ id: "report-description",
623
+ className: "sv-report-textarea",
624
+ value: description,
625
+ onChange: handleDescriptionChange,
626
+ placeholder: inputPlaceholder,
627
+ maxLength
628
+ }
629
+ ),
630
+ /* @__PURE__ */ jsxs("div", { className: "sv-report-char-count", "data-over": description.length >= maxLength, children: [
631
+ description.length,
632
+ "/",
633
+ maxLength
634
+ ] })
635
+ ] })
636
+ ] }),
637
+ /* @__PURE__ */ jsx("div", { className: "sv-report-footer sv-report-footer--single", children: /* @__PURE__ */ jsx(
638
+ "button",
639
+ {
640
+ type: "button",
641
+ className: "sv-report-button sv-report-button-submit",
642
+ onClick: handleSubmit,
643
+ children: submitText
644
+ }
645
+ ) })
646
+ ] });
647
+ const renderLoading = () => /* @__PURE__ */ jsxs("div", { className: "sv-report-loading", children: [
648
+ /* @__PURE__ */ jsx("div", { className: "sv-report-spinner" }),
649
+ /* @__PURE__ */ jsx("span", { children: loadingText })
650
+ ] });
651
+ const renderSuccess = () => /* @__PURE__ */ jsxs(Fragment, { children: [
652
+ /* @__PURE__ */ jsxs("div", { className: "sv-report-success", children: [
653
+ /* @__PURE__ */ jsx("div", { className: "sv-report-success-icon", children: successIcon ?? /* @__PURE__ */ jsx(CheckIcon, {}) }),
654
+ /* @__PURE__ */ jsx("h3", { className: "sv-report-success-title", children: successTitle }),
655
+ /* @__PURE__ */ jsx("p", { className: "sv-report-success-message", children: successMessage })
656
+ ] }),
657
+ /* @__PURE__ */ jsx("div", { className: "sv-report-footer sv-report-footer--single", children: /* @__PURE__ */ jsx(
658
+ "button",
659
+ {
660
+ type: "button",
661
+ className: "sv-report-button sv-report-button-submit",
662
+ onClick: handleDone,
663
+ children: doneText
664
+ }
665
+ ) })
666
+ ] });
667
+ const renderError = () => /* @__PURE__ */ jsxs(Fragment, { children: [
668
+ /* @__PURE__ */ jsxs("div", { className: "sv-report-header", children: [
669
+ /* @__PURE__ */ jsx("button", { type: "button", className: "sv-report-back", onClick: handleBack, "aria-label": "Back", children: /* @__PURE__ */ jsx(BackIcon, {}) }),
670
+ /* @__PURE__ */ jsx("h2", { className: "sv-report-title", children: title }),
671
+ /* @__PURE__ */ jsx("button", { type: "button", className: "sv-report-close", onClick: handleClose, "aria-label": "Close", children: /* @__PURE__ */ jsx(CloseIcon, {}) })
672
+ ] }),
673
+ /* @__PURE__ */ jsxs("div", { className: "sv-report-content sv-report-content--detail", children: [
674
+ /* @__PURE__ */ jsx("h3", { className: "sv-report-reason-title", children: selectedReason?.label }),
675
+ /* @__PURE__ */ jsx("div", { className: "sv-report-error-message", role: "alert", children: error || errorMessage }),
676
+ /* @__PURE__ */ jsx("p", { className: "sv-report-reason-description", children: errorDescription })
677
+ ] }),
678
+ /* @__PURE__ */ jsx("div", { className: "sv-report-footer sv-report-footer--single", children: /* @__PURE__ */ jsx(
679
+ "button",
680
+ {
681
+ type: "button",
682
+ className: "sv-report-button sv-report-button-submit",
683
+ onClick: handleSubmit,
684
+ children: "Try Again"
685
+ }
686
+ ) })
687
+ ] });
688
+ const renderContent = () => {
689
+ if (state === "loading") return renderLoading();
690
+ if (state === "success") return renderSuccess();
691
+ if (state === "error") return renderError();
692
+ if (step === "select") return renderSelectStep();
693
+ return renderDetailStep();
694
+ };
695
+ return /* @__PURE__ */ jsx(
696
+ BottomSheetHeadless,
697
+ {
698
+ isOpen,
699
+ onClose: handleClose,
700
+ height: "auto",
701
+ className: clsx("sv-report-sheet", className),
702
+ closeOnBackdropClick: state !== "loading",
703
+ closeOnEscape: state !== "loading",
704
+ showDragHandle: false,
705
+ ariaLabel: "Report content",
706
+ children: renderContent()
707
+ }
708
+ );
709
+ }
710
+ var ReportSheetHeadless = memo(ReportSheetHeadlessComponent);
711
+ ReportSheetHeadless.displayName = "ReportSheetHeadless";
712
+
713
+ export { REPORT_SHEET_CSS, ReportSheetHeadless, injectReportSheetCSS };