chordia-ui 3.2.6 → 3.2.8

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.
@@ -116,23 +116,22 @@ export default function Sidebar({
116
116
  flexShrink: 0,
117
117
  }}
118
118
  >
119
- {/* Header slot */}
120
- {header && !collapsed && (
121
- <div style={{ padding: "16px 16px 8px", flexShrink: 0, width: "100%" }}>
122
- {header}
123
- </div>
124
- )}
125
-
126
- {/* Collapse toggle */}
119
+ {/* Header + Collapse toggle in one row */}
127
120
  <div
128
121
  style={{
129
122
  display: "flex",
130
- justifyContent: collapsed ? "center" : "flex-end",
131
- padding: collapsed ? "12px 0" : "8px 0 0",
123
+ alignItems: "center",
124
+ justifyContent: collapsed ? "center" : "space-between",
125
+ padding: collapsed ? "12px 0" : "12px 0 0",
132
126
  flexShrink: 0,
133
127
  width: "100%",
134
128
  }}
135
129
  >
130
+ {header && !collapsed && (
131
+ <div style={{ flexShrink: 0 }}>
132
+ {header}
133
+ </div>
134
+ )}
136
135
  <button
137
136
  onClick={toggleCollapse}
138
137
  title={collapsed ? "Expand sidebar" : "Collapse sidebar"}
@@ -148,6 +147,7 @@ export default function Sidebar({
148
147
  color: "rgba(255, 255, 255, 0.5)",
149
148
  cursor: "pointer",
150
149
  transition: "background 0.15s ease, color 0.15s ease",
150
+ flexShrink: 0,
151
151
  }}
152
152
  onMouseEnter={(e) => {
153
153
  e.currentTarget.style.background = "rgba(255, 255, 255, 0.08)";
@@ -250,9 +250,12 @@ function SidebarItem({ item, active, onNavigate, collapsed }) {
250
250
  borderBottom: "none",
251
251
  borderLeft: "none",
252
252
  background: active ? "var(--Background-MonoPressed, #323232)" : "transparent",
253
- color: active ? "#00A66E" : "var(--Content-TertiaryInverse, #B2AEA8)",
254
- fontWeight: active ? 550 : 400,
255
- fontSize: "var(--text-sm)",
253
+ color: active ? "var(--Brand-400, #33B88B)" : "var(--Content-TertiaryInverse, #B2AEA8)",
254
+ fontWeight: 500,
255
+ fontSize: "12px",
256
+ fontStyle: "normal",
257
+ lineHeight: "120%",
258
+ textTransform: "uppercase",
256
259
  fontFamily: "var(--font-sans)",
257
260
  cursor: "pointer",
258
261
  textAlign: "left",
@@ -262,7 +265,7 @@ function SidebarItem({ item, active, onNavigate, collapsed }) {
262
265
  onMouseEnter={(e) => {
263
266
  if (!active) {
264
267
  e.currentTarget.style.background = "var(--Background-MonoPressed, #323232)";
265
- e.currentTarget.style.color = "#00A66E";
268
+ e.currentTarget.style.color = "var(--Brand-400, #33B88B)";
266
269
  }
267
270
  }}
268
271
  onMouseLeave={(e) => {
@@ -317,7 +320,7 @@ function SidebarGroup({ item, activeId, expanded, onToggle, onNavigate, collapse
317
320
  borderRadius: "4px",
318
321
  border: "none",
319
322
  background: hasActiveChild ? "var(--Background-MonoPressed, #323232)" : "transparent",
320
- color: hasActiveChild ? "#00A66E" : "var(--Content-TertiaryInverse, #B2AEA8)",
323
+ color: hasActiveChild ? "var(--Brand-400, #33B88B)" : "var(--Content-TertiaryInverse, #B2AEA8)",
321
324
  cursor: "pointer",
322
325
  marginBottom: 2,
323
326
  transition: "background 0.15s ease",
@@ -325,7 +328,7 @@ function SidebarGroup({ item, activeId, expanded, onToggle, onNavigate, collapse
325
328
  onMouseEnter={(e) => {
326
329
  if (!hasActiveChild) {
327
330
  e.currentTarget.style.background = "var(--Background-MonoPressed, #323232)";
328
- e.currentTarget.style.color = "#00A66E";
331
+ e.currentTarget.style.color = "var(--Brand-400, #33B88B)";
329
332
  }
330
333
  }}
331
334
  onMouseLeave={(e) => {
@@ -357,9 +360,12 @@ function SidebarGroup({ item, activeId, expanded, onToggle, onNavigate, collapse
357
360
  borderRadius: "4px",
358
361
  border: "none",
359
362
  background: "transparent",
360
- color: hasActiveChild ? "#00A66E" : "var(--Content-TertiaryInverse, #B2AEA8)",
361
- fontWeight: hasActiveChild ? 550 : 400,
362
- fontSize: "var(--text-sm)",
363
+ color: hasActiveChild ? "var(--Brand-400, #33B88B)" : "var(--Content-TertiaryInverse, #B2AEA8)",
364
+ fontWeight: 700,
365
+ fontSize: "12px",
366
+ fontStyle: "normal",
367
+ lineHeight: "120%",
368
+ textTransform: "uppercase",
363
369
  fontFamily: "var(--font-sans)",
364
370
  cursor: "pointer",
365
371
  textAlign: "left",
@@ -367,12 +373,12 @@ function SidebarGroup({ item, activeId, expanded, onToggle, onNavigate, collapse
367
373
  }}
368
374
  onMouseEnter={(e) => {
369
375
  e.currentTarget.style.background = "var(--Background-MonoPressed, #323232)";
370
- e.currentTarget.style.color = "#00A66E";
376
+ e.currentTarget.style.color = "var(--Brand-400, #33B88B)";
371
377
  }}
372
378
  onMouseLeave={(e) => {
373
379
  e.currentTarget.style.background = "transparent";
374
380
  if (!hasActiveChild) e.currentTarget.style.color = "var(--Content-TertiaryInverse, #B2AEA8)";
375
- else e.currentTarget.style.color = "#00A66E";
381
+ else e.currentTarget.style.color = "var(--Brand-400, #33B88B)";
376
382
  }}
377
383
  >
378
384
  <Icon
@@ -1,5 +1,5 @@
1
1
  import { useState, useRef } from 'react';
2
- import { CloudUpload } from 'lucide-react';
2
+ import { CloudUpload, X } from 'lucide-react';
3
3
 
4
4
  const FF = 'var(--font-sans)';
5
5
 
@@ -107,9 +107,17 @@ const dropzoneHintStyle = {
107
107
 
108
108
  // ─── Component ───
109
109
 
110
- const UploadInteraction = ({ onFileSelect }) => {
110
+ const UploadInteraction = ({
111
+ onFileSelect,
112
+ showUploadQueuedMessage = false,
113
+ uploadSummary = { successCount: 0, failedCount: 0, primaryFailureReason: '' },
114
+ }) => {
111
115
  const [dragOver, setDragOver] = useState(false);
116
+ const [isStatusDismissed, setIsStatusDismissed] = useState(false);
112
117
  const fileInputRef = useRef(null);
118
+ const successCount = uploadSummary?.successCount || 0;
119
+ const failedCount = uploadSummary?.failedCount || 0;
120
+ const primaryFailureReason = uploadSummary?.primaryFailureReason || '';
113
121
 
114
122
  const handleDragOver = (e) => {
115
123
  e.preventDefault();
@@ -123,6 +131,7 @@ const UploadInteraction = ({ onFileSelect }) => {
123
131
  const handleDrop = (e) => {
124
132
  e.preventDefault();
125
133
  setDragOver(false);
134
+ setIsStatusDismissed(false);
126
135
  const files = e.dataTransfer?.files;
127
136
  if (files?.length) {
128
137
  onFileSelect?.(files);
@@ -136,6 +145,7 @@ const UploadInteraction = ({ onFileSelect }) => {
136
145
  const handleFileChange = (e) => {
137
146
  const files = e.target.files;
138
147
  if (files?.length) {
148
+ setIsStatusDismissed(false);
139
149
  onFileSelect?.(files);
140
150
  }
141
151
  e.target.value = '';
@@ -179,6 +189,49 @@ const UploadInteraction = ({ onFileSelect }) => {
179
189
  </button>
180
190
  <p style={dropzoneHintStyle}>Supports: MP3, WAV, WMA, MP4, and WEBM</p>
181
191
  </div>
192
+
193
+ {showUploadQueuedMessage && !isStatusDismissed && (
194
+ <div
195
+ style={{
196
+ marginTop: 16,
197
+ borderRadius: 10,
198
+ border: '1px solid var(--border)',
199
+ background: 'var(--grey-light)',
200
+ padding: 'var(--spacing-2) var(--spacing-3)',
201
+ }}>
202
+ <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 12 }}>
203
+ <p style={{ fontSize: 15, fontWeight: 600, fontFamily: FF, color: 'var(--grey-strong)' }}>Upload status</p>
204
+ <button
205
+ type="button"
206
+ style={{
207
+ display: 'flex',
208
+ alignItems: 'center', justifyContent: 'center', width: 20, height: 20, borderRadius: 10, background: 'var(--grey-light)', cursor: 'pointer',
209
+ border: 'none',
210
+ outline: 'none',
211
+ padding: 0,
212
+ margin: 0,
213
+ }}
214
+ onClick={() => setIsStatusDismissed(true)}
215
+ >
216
+ <X size={14} color="var(--grey-strong)" />
217
+ </button>
218
+ </div>
219
+ <p style={{ fontSize: 13, fontWeight: 400, fontFamily: FF, color: 'var(--grey-strong)', marginTop: 8 }}>
220
+ {failedCount > 0 && successCount > 0
221
+ ? `${successCount} file${successCount > 1 ? 's are' : ' is'} successfully uploaded and ${failedCount} file${failedCount > 1 ? 's are' : ' is'} failed.`
222
+ : failedCount > 0
223
+ ? `${failedCount} file${failedCount > 1 ? 's' : ''} failed to upload.`
224
+ : successCount > 1
225
+ ? `${successCount} files are queued for evaluation.`
226
+ : 'Your file is queued for evaluation.'}
227
+ </p>
228
+ <p className="mt-1 text-xs text-gray-600">
229
+ {failedCount > 0
230
+ ? `Failed because ${primaryFailureReason || 'of a validation issue'}.`
231
+ : 'You can continue using the app while upload runs in the background. Results will appear in the project history once ready.'}
232
+ </p>
233
+ </div>
234
+ )}
182
235
  </div>
183
236
  );
184
237
  };
@@ -194,6 +194,7 @@
194
194
  --grey-absent: #D9D9D9;
195
195
  --grey-muted: #BDBDBD;
196
196
  --grey-strong: var(--color-text);
197
+ --grey-light: #e9e8e8a1;
197
198
 
198
199
  /* ============================================
199
200
  FOCUS / WARM SURFACES