@xhub-short/ui 0.1.0-beta.8 → 1.0.0-beta.18

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 (75) hide show
  1. package/dist/CommentSheet.css-DuBy01rU.d.ts +219 -0
  2. package/dist/VideoSlotPlayIndicator-DPs8Xt5C.d.ts +51 -0
  3. package/dist/chunk-3OB3OVYR.js +349 -0
  4. package/dist/chunk-4RIMQOBR.js +58 -0
  5. package/dist/chunk-5MKYDI4X.js +1 -0
  6. package/dist/chunk-5Y43HNRG.js +296 -0
  7. package/dist/chunk-7WXAQHJI.js +350 -0
  8. package/dist/chunk-BADA7OLG.js +564 -0
  9. package/dist/chunk-BEJAJFV6.js +191 -0
  10. package/dist/chunk-BNI7CYRI.js +334 -0
  11. package/dist/{chunk-UPCVSGWH.js → chunk-CAWE42LH.js} +5 -2
  12. package/dist/chunk-DGKMO3AE.js +717 -0
  13. package/dist/chunk-DR7KR7OT.js +103 -0
  14. package/dist/chunk-GSNIZ6DF.js +605 -0
  15. package/dist/chunk-HXQPEZRG.js +105 -0
  16. package/dist/chunk-IC2KUU4V.js +1264 -0
  17. package/dist/chunk-IWSBYOSS.js +91 -0
  18. package/dist/chunk-MFJS65C5.js +368 -0
  19. package/dist/{chunk-CXPNPSF7.js → chunk-NJXIYSDZ.js} +12 -1
  20. package/dist/{chunk-NRQXKZO3.js → chunk-OM4L7RE5.js} +12 -2
  21. package/dist/chunk-QCRRF76W.js +75 -0
  22. package/dist/chunk-QUEJHA24.js +508 -0
  23. package/dist/chunk-UYBQTE4M.js +337 -0
  24. package/dist/chunk-VJ744W5N.js +603 -0
  25. package/dist/chunk-VXW7AOGM.js +285 -0
  26. package/dist/{chunk-OQ7P5XC7.js → chunk-YB7AXTX7.js} +1 -1
  27. package/dist/components/ActionBar/index.d.ts +7 -2
  28. package/dist/components/ActionBar/index.js +1 -1
  29. package/dist/components/AdvanceMenu/index.d.ts +80 -0
  30. package/dist/components/AdvanceMenu/index.js +1 -0
  31. package/dist/components/ArticleSlot/index.d.ts +213 -0
  32. package/dist/components/ArticleSlot/index.js +1 -0
  33. package/dist/components/AuthorInfo/index.js +1 -1
  34. package/dist/components/BottomSheet/index.d.ts +87 -0
  35. package/dist/components/BottomSheet/index.js +1 -0
  36. package/dist/components/CleanModeOverlay/index.d.ts +60 -0
  37. package/dist/components/CleanModeOverlay/index.js +1 -0
  38. package/dist/components/CommentSheet/index.d.ts +155 -3
  39. package/dist/components/CommentSheet/index.js +1 -1
  40. package/dist/components/DetailView/index.d.ts +314 -0
  41. package/dist/components/DetailView/index.js +1 -0
  42. package/dist/components/ErrorBoundary/index.js +1 -1
  43. package/dist/components/{VideoFeed → Feed}/index.d.ts +64 -45
  44. package/dist/components/Feed/index.js +1 -0
  45. package/dist/components/ImageCarousel/index.d.ts +50 -0
  46. package/dist/components/ImageCarousel/index.js +1 -0
  47. package/dist/components/Playlist/index.d.ts +117 -0
  48. package/dist/components/Playlist/index.js +1 -0
  49. package/dist/components/ProgressBar/index.js +1 -1
  50. package/dist/components/QualityPicker/index.d.ts +35 -0
  51. package/dist/components/QualityPicker/index.js +1 -0
  52. package/dist/components/ReportSheet/index.d.ts +74 -0
  53. package/dist/components/ReportSheet/index.js +1 -0
  54. package/dist/components/Skeleton/index.js +1 -1
  55. package/dist/components/SpeedPicker/index.d.ts +32 -0
  56. package/dist/components/SpeedPicker/index.js +1 -0
  57. package/dist/components/VideoInfo/index.d.ts +7 -3
  58. package/dist/components/VideoInfo/index.js +1 -1
  59. package/dist/components/VideoPlayer/index.js +1 -1
  60. package/dist/components/VideoSlot/index.d.ts +31 -68
  61. package/dist/components/VideoSlot/index.js +2 -1
  62. package/dist/components/VirtualSlider/index.js +1 -1
  63. package/dist/index.d.ts +74 -11
  64. package/dist/index.js +39 -15
  65. package/package.json +8 -4
  66. package/dist/CommentSheet.css-BD6XbpU2.d.ts +0 -207
  67. package/dist/chunk-EBAMBI3O.js +0 -571
  68. package/dist/chunk-K3CETRCY.js +0 -737
  69. package/dist/chunk-PGHLVKXS.js +0 -148
  70. package/dist/chunk-QF7O26KZ.js +0 -357
  71. package/dist/chunk-RKS7YA7Z.js +0 -562
  72. package/dist/chunk-T4RQWGRY.js +0 -1519
  73. package/dist/chunk-UXNIXHII.js +0 -2040
  74. package/dist/chunk-YWAPI7JO.js +0 -204
  75. package/dist/components/VideoFeed/index.js +0 -1
@@ -0,0 +1,717 @@
1
+ import { injectComponentCSS } from './chunk-CAWE42LH.js';
2
+ import { BottomSheetHeadless } from './chunk-UYBQTE4M.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
+ onGestureLock
527
+ }) {
528
+ const [step, setStep] = useState("select");
529
+ const [state, setState] = useState("form");
530
+ const [selectedReason, setSelectedReason] = useState(null);
531
+ const [description, setDescription] = useState("");
532
+ const [error, setError] = useState(null);
533
+ useEffect(() => {
534
+ injectReportSheetCSS();
535
+ }, []);
536
+ useEffect(() => {
537
+ if (isOpen) {
538
+ if (alreadyReported) {
539
+ setState("success");
540
+ setStep("select");
541
+ } else {
542
+ setStep("select");
543
+ setState("form");
544
+ }
545
+ setSelectedReason(null);
546
+ setDescription("");
547
+ setError(null);
548
+ }
549
+ }, [isOpen, alreadyReported]);
550
+ const handleDone = useCallback(() => {
551
+ onClose();
552
+ }, [onClose]);
553
+ const handleReasonSelect = useCallback((reason) => {
554
+ setSelectedReason(reason);
555
+ setStep("detail");
556
+ setError(null);
557
+ }, []);
558
+ const handleBack = useCallback(() => {
559
+ setStep("select");
560
+ setError(null);
561
+ }, []);
562
+ const handleDescriptionChange = useCallback(
563
+ (e) => {
564
+ const value = e.target.value;
565
+ if (value.length <= maxLength) {
566
+ setDescription(value);
567
+ }
568
+ },
569
+ [maxLength]
570
+ );
571
+ const handleSubmit = useCallback(async () => {
572
+ if (!selectedReason) return;
573
+ setState("loading");
574
+ setError(null);
575
+ try {
576
+ await onSubmit(selectedReason.id, description || void 0);
577
+ setState("success");
578
+ } catch (err) {
579
+ setState("error");
580
+ setError(err instanceof Error ? err.message : errorMessage);
581
+ }
582
+ }, [selectedReason, description, onSubmit, errorMessage]);
583
+ const handleClose = useCallback(() => {
584
+ if (state === "loading") return;
585
+ onClose();
586
+ }, [state, onClose]);
587
+ 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: [
588
+ /* @__PURE__ */ jsx("div", { className: "sv-report-skeleton-text" }),
589
+ /* @__PURE__ */ jsx("div", { className: "sv-report-skeleton-icon" })
590
+ ] }) }, i)) });
591
+ const renderSelectStep = () => /* @__PURE__ */ jsxs(Fragment, { children: [
592
+ /* @__PURE__ */ jsxs("div", { className: "sv-report-header", children: [
593
+ /* @__PURE__ */ jsx("h2", { className: "sv-report-title", children: selectTitle }),
594
+ /* @__PURE__ */ jsx("button", { type: "button", className: "sv-report-close", onClick: handleClose, "aria-label": "Close", children: /* @__PURE__ */ jsx(CloseIcon, {}) })
595
+ ] }),
596
+ /* @__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(
597
+ "button",
598
+ {
599
+ type: "button",
600
+ className: "sv-report-reason-item",
601
+ onClick: () => handleReasonSelect(reason),
602
+ children: [
603
+ /* @__PURE__ */ jsx("span", { className: "sv-report-reason-label", children: reason.label }),
604
+ /* @__PURE__ */ jsx(ChevronRightIcon, {})
605
+ ]
606
+ }
607
+ ) }, reason.id)) }) })
608
+ ] });
609
+ const renderDetailStep = () => /* @__PURE__ */ jsxs(Fragment, { children: [
610
+ /* @__PURE__ */ jsxs("div", { className: "sv-report-header", children: [
611
+ /* @__PURE__ */ jsx("button", { type: "button", className: "sv-report-back", onClick: handleBack, "aria-label": "Back", children: /* @__PURE__ */ jsx(BackIcon, {}) }),
612
+ /* @__PURE__ */ jsx("h2", { className: "sv-report-title", children: title }),
613
+ /* @__PURE__ */ jsx("button", { type: "button", className: "sv-report-close", onClick: handleClose, "aria-label": "Close", children: /* @__PURE__ */ jsx(CloseIcon, {}) })
614
+ ] }),
615
+ /* @__PURE__ */ jsxs("div", { className: "sv-report-content sv-report-content--detail", children: [
616
+ /* @__PURE__ */ jsx("h3", { className: "sv-report-reason-title", children: selectedReason?.label }),
617
+ selectedReason?.description && /* @__PURE__ */ jsx("p", { className: "sv-report-reason-description", children: selectedReason.description }),
618
+ error && /* @__PURE__ */ jsx("div", { className: "sv-report-error-message", role: "alert", children: error }),
619
+ /* @__PURE__ */ jsxs("div", { className: "sv-report-input-section", children: [
620
+ /* @__PURE__ */ jsx(
621
+ "textarea",
622
+ {
623
+ id: "report-description",
624
+ className: "sv-report-textarea",
625
+ value: description,
626
+ onChange: handleDescriptionChange,
627
+ placeholder: inputPlaceholder,
628
+ maxLength
629
+ }
630
+ ),
631
+ /* @__PURE__ */ jsxs("div", { className: "sv-report-char-count", "data-over": description.length >= maxLength, children: [
632
+ description.length,
633
+ "/",
634
+ maxLength
635
+ ] })
636
+ ] })
637
+ ] }),
638
+ /* @__PURE__ */ jsx("div", { className: "sv-report-footer sv-report-footer--single", children: /* @__PURE__ */ jsx(
639
+ "button",
640
+ {
641
+ type: "button",
642
+ className: "sv-report-button sv-report-button-submit",
643
+ onClick: handleSubmit,
644
+ children: submitText
645
+ }
646
+ ) })
647
+ ] });
648
+ const renderLoading = () => /* @__PURE__ */ jsxs("div", { className: "sv-report-loading", children: [
649
+ /* @__PURE__ */ jsx("div", { className: "sv-report-spinner" }),
650
+ /* @__PURE__ */ jsx("span", { children: loadingText })
651
+ ] });
652
+ const renderSuccess = () => /* @__PURE__ */ jsxs(Fragment, { children: [
653
+ /* @__PURE__ */ jsxs("div", { className: "sv-report-success", children: [
654
+ /* @__PURE__ */ jsx("div", { className: "sv-report-success-icon", children: successIcon ?? /* @__PURE__ */ jsx(CheckIcon, {}) }),
655
+ /* @__PURE__ */ jsx("h3", { className: "sv-report-success-title", children: successTitle }),
656
+ /* @__PURE__ */ jsx("p", { className: "sv-report-success-message", children: successMessage })
657
+ ] }),
658
+ /* @__PURE__ */ jsx("div", { className: "sv-report-footer sv-report-footer--single", children: /* @__PURE__ */ jsx(
659
+ "button",
660
+ {
661
+ type: "button",
662
+ className: "sv-report-button sv-report-button-submit",
663
+ onClick: handleDone,
664
+ children: doneText
665
+ }
666
+ ) })
667
+ ] });
668
+ const renderError = () => /* @__PURE__ */ jsxs(Fragment, { children: [
669
+ /* @__PURE__ */ jsxs("div", { className: "sv-report-header", children: [
670
+ /* @__PURE__ */ jsx("button", { type: "button", className: "sv-report-back", onClick: handleBack, "aria-label": "Back", children: /* @__PURE__ */ jsx(BackIcon, {}) }),
671
+ /* @__PURE__ */ jsx("h2", { className: "sv-report-title", children: title }),
672
+ /* @__PURE__ */ jsx("button", { type: "button", className: "sv-report-close", onClick: handleClose, "aria-label": "Close", children: /* @__PURE__ */ jsx(CloseIcon, {}) })
673
+ ] }),
674
+ /* @__PURE__ */ jsxs("div", { className: "sv-report-content sv-report-content--detail", children: [
675
+ /* @__PURE__ */ jsx("h3", { className: "sv-report-reason-title", children: selectedReason?.label }),
676
+ /* @__PURE__ */ jsx("div", { className: "sv-report-error-message", role: "alert", children: error || errorMessage }),
677
+ /* @__PURE__ */ jsx("p", { className: "sv-report-reason-description", children: errorDescription })
678
+ ] }),
679
+ /* @__PURE__ */ jsx("div", { className: "sv-report-footer sv-report-footer--single", children: /* @__PURE__ */ jsx(
680
+ "button",
681
+ {
682
+ type: "button",
683
+ className: "sv-report-button sv-report-button-submit",
684
+ onClick: handleSubmit,
685
+ children: "Try Again"
686
+ }
687
+ ) })
688
+ ] });
689
+ const renderContent = () => {
690
+ if (state === "loading") return renderLoading();
691
+ if (state === "success") return renderSuccess();
692
+ if (state === "error") return renderError();
693
+ if (step === "select") return renderSelectStep();
694
+ return renderDetailStep();
695
+ };
696
+ return /* @__PURE__ */ jsx(
697
+ BottomSheetHeadless,
698
+ {
699
+ isOpen,
700
+ onClose: handleClose,
701
+ height: "auto",
702
+ className: clsx("sv-report-sheet", className),
703
+ closeOnBackdropClick: state !== "loading",
704
+ closeOnEscape: state !== "loading",
705
+ showDragHandle: false,
706
+ ariaLabel: "Report content",
707
+ dragHandleSelector: ".sv-report-header",
708
+ scrollContainerSelector: ".sv-report-content",
709
+ onGestureLock,
710
+ children: renderContent()
711
+ }
712
+ );
713
+ }
714
+ var ReportSheetHeadless = memo(ReportSheetHeadlessComponent);
715
+ ReportSheetHeadless.displayName = "ReportSheetHeadless";
716
+
717
+ export { REPORT_SHEET_CSS, ReportSheetHeadless, injectReportSheetCSS };