chordia-ui 3.2.2 → 3.2.4

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 (39) hide show
  1. package/README.md +61 -0
  2. package/dist/IntegrationCard.cjs.js +2 -0
  3. package/dist/IntegrationCard.cjs.js.map +1 -0
  4. package/dist/IntegrationCard.es.js +217 -0
  5. package/dist/IntegrationCard.es.js.map +1 -0
  6. package/dist/UploadInteraction.cjs.js +2 -0
  7. package/dist/UploadInteraction.cjs.js.map +1 -0
  8. package/dist/UploadInteraction.es.js +379 -0
  9. package/dist/UploadInteraction.es.js.map +1 -0
  10. package/dist/components/layout.cjs.js +2 -2
  11. package/dist/components/layout.cjs.js.map +1 -1
  12. package/dist/components/layout.es.js +202 -411
  13. package/dist/components/layout.es.js.map +1 -1
  14. package/dist/components/onboarding.cjs.js +2 -0
  15. package/dist/components/onboarding.cjs.js.map +1 -0
  16. package/dist/components/onboarding.es.js +712 -0
  17. package/dist/components/onboarding.es.js.map +1 -0
  18. package/dist/index.cjs.js +1 -1
  19. package/dist/index.cjs2.js +2 -2
  20. package/dist/index.cjs2.js.map +1 -1
  21. package/dist/index.es.js +49 -41
  22. package/dist/index.es.js.map +1 -1
  23. package/dist/index.es2.js +869 -811
  24. package/dist/index.es2.js.map +1 -1
  25. package/dist/pages/interactionDetails.cjs.js +1 -1
  26. package/dist/pages/interactionDetails.cjs.js.map +1 -1
  27. package/dist/pages/interactionDetails.es.js +16 -15
  28. package/dist/pages/interactionDetails.es.js.map +1 -1
  29. package/dist/style.css +1 -1
  30. package/package.json +5 -1
  31. package/src/components/index.js +3 -0
  32. package/src/components/login/LoginPage.jsx +107 -5
  33. package/src/components/onboarding/AddTeammates.jsx +278 -0
  34. package/src/components/onboarding/ConnectData.jsx +89 -0
  35. package/src/components/onboarding/GettingStarted.jsx +524 -0
  36. package/src/components/onboarding/UploadEvaluate.jsx +255 -0
  37. package/src/components/onboarding/UploadInteraction.jsx +186 -0
  38. package/src/components/onboarding/index.js +5 -0
  39. package/src/tokens/colors.css +13 -0
@@ -0,0 +1,524 @@
1
+ import { useState } from 'react';
2
+ import { MessageSquare, Database, Users, BookOpen, SlidersHorizontal, Briefcase } from 'lucide-react';
3
+ import UploadInteraction from './UploadInteraction';
4
+ import ConnectData from './ConnectData';
5
+ import AddTeammates from './AddTeammates';
6
+
7
+ const FF = 'var(--font-sans)';
8
+
9
+ // ─── Steps Configuration ───
10
+
11
+ const DEFAULT_STEPS = [
12
+ { id: 'workspace', label: 'Workspace Name', description: 'Give your project a title.', icon: Briefcase },
13
+ { id: 'interaction', label: 'Add Interaction', description: 'Connect data to see patterns.', icon: MessageSquare },
14
+ { id: 'connect', label: 'Connect Data', description: 'Link your platform for auto-evaluation.', icon: Database },
15
+ { id: 'invite', label: 'Invite Team', description: 'Add members to collaborate.', icon: Users },
16
+ { id: 'concepts', label: 'Learn Concepts', description: 'Explore conditions and evidence.', icon: BookOpen },
17
+ { id: 'scope', label: 'Define Scope', description: 'Customize evaluation signals.', icon: SlidersHorizontal },
18
+ ];
19
+
20
+ // ─── Styles ───
21
+
22
+ const pageStyle = {
23
+ fontFamily: FF,
24
+ background: 'var(--grey-white)',
25
+ minHeight: '100vh',
26
+ boxSizing: 'border-box',
27
+ };
28
+
29
+ const headerStyle = {
30
+ padding: '24px 48px',
31
+ borderBottom: '1px solid var(--border)',
32
+ background: 'var(--grey-white)',
33
+ };
34
+
35
+ const headerTopRow = {
36
+ display: 'flex',
37
+ alignItems: 'center',
38
+ justifyContent: 'space-between',
39
+ marginBottom: 8,
40
+ };
41
+
42
+ const titleStyle = {
43
+ fontSize: 24,
44
+ fontWeight: 600,
45
+ fontStyle: 'normal',
46
+ fontFamily: FF,
47
+ color: 'var(--grey-strong)',
48
+ margin: 0,
49
+ lineHeight: 'normal',
50
+ };
51
+
52
+ const subtitleStyle = {
53
+ fontSize: 14,
54
+ fontWeight: 400,
55
+ lineHeight: '140%',
56
+ color: 'var(--text-muted)',
57
+ margin: '4px 0 0',
58
+ fontFamily: FF,
59
+ };
60
+
61
+ const headerActions = {
62
+ display: 'flex',
63
+ alignItems: 'center',
64
+ gap: 12,
65
+ };
66
+
67
+ const remindBtnStyle = {
68
+ display: 'flex',
69
+ height: 36,
70
+ padding: '0 16px',
71
+ justifyContent: 'center',
72
+ alignItems: 'center',
73
+ borderRadius: 10,
74
+ background: 'transparent',
75
+ border: '1px solid var(--border-strong)',
76
+ fontSize: 14,
77
+ fontWeight: 500,
78
+ fontFamily: FF,
79
+ color: 'var(--text-base)',
80
+ cursor: 'pointer',
81
+ transition: 'var(--transition-fast)',
82
+ outline: 'none',
83
+ };
84
+
85
+ const saveBtnStyle = {
86
+ display: 'flex',
87
+ height: 36,
88
+ padding: '0 20px',
89
+ justifyContent: 'center',
90
+ alignItems: 'center',
91
+ borderRadius: 10,
92
+ background: 'var(--grey-strong)',
93
+ fontSize: 14,
94
+ fontWeight: 600,
95
+ fontFamily: FF,
96
+ color: 'var(--grey-white)',
97
+ border: 'none',
98
+ cursor: 'pointer',
99
+ transition: 'var(--transition-fast)',
100
+ outline: 'none',
101
+ };
102
+
103
+ const progressBarBg = {
104
+ width: '100%',
105
+ height: 6,
106
+ borderRadius: 3,
107
+ background: 'var(--border)',
108
+ overflow: 'hidden',
109
+ marginTop: 12,
110
+ };
111
+
112
+ const progressBarFill = (pct) => ({
113
+ width: `${pct}%`,
114
+ height: '100%',
115
+ borderRadius: 3,
116
+ background: 'var(--color-green)',
117
+ transition: 'width 0.4s ease-out',
118
+ });
119
+
120
+ const bodyStyle = {
121
+ display: 'flex',
122
+ flex: 1,
123
+ minHeight: 'calc(100vh - 140px)',
124
+ };
125
+
126
+ // ─── Sidebar Styles ───
127
+
128
+ const sidebarStyle = {
129
+ width: 312,
130
+ minWidth: 312,
131
+ borderRight: '1px solid var(--border)',
132
+ padding: '24px 24px',
133
+ background: 'var(--grey-white)',
134
+ boxSizing: 'border-box',
135
+ };
136
+
137
+ const stepsCountStyle = {
138
+ fontSize: 13,
139
+ fontWeight: 500,
140
+ color: 'var(--text-muted)',
141
+ fontFamily: FF,
142
+ margin: '0 0 12px',
143
+ };
144
+
145
+ const stepsListStyle = {
146
+ display: 'flex',
147
+ width: 264,
148
+ flexDirection: 'column',
149
+ alignItems: 'flex-start',
150
+ gap: 8,
151
+ alignSelf: 'stretch',
152
+ };
153
+
154
+ const stepItemStyle = (isActive) => ({
155
+ display: 'flex',
156
+ alignItems: 'center',
157
+ gap: 4,
158
+ padding: '8px 4px',
159
+ cursor: 'pointer',
160
+ transition: 'var(--transition-fast)',
161
+ background: isActive ? 'var(--hover-warm)' : 'var(--grey-white)',
162
+ borderRadius: 8,
163
+ alignSelf: 'stretch',
164
+ });
165
+
166
+ const stepIconWrap = {
167
+ width: 40,
168
+ height: 40,
169
+ flexShrink: 0,
170
+ display: 'flex',
171
+ alignItems: 'center',
172
+ justifyContent: 'center',
173
+ };
174
+
175
+ const stepLabelStyle = {
176
+ fontSize: 14,
177
+ fontWeight: 600,
178
+ fontStyle: 'normal',
179
+ color: 'var(--grey-strong)',
180
+ fontFamily: FF,
181
+ margin: 0,
182
+ lineHeight: '120%',
183
+ };
184
+
185
+ const stepDescStyle = {
186
+ fontSize: 12,
187
+ fontWeight: 400,
188
+ color: 'var(--text-muted)',
189
+ fontFamily: FF,
190
+ margin: '2px 0 0',
191
+ lineHeight: 1.3,
192
+ };
193
+
194
+ // ─── Content Styles ───
195
+
196
+ const contentStyle = {
197
+ flex: 1,
198
+ padding: '40px 48px',
199
+ background: 'var(--grey-white)',
200
+ boxSizing: 'border-box',
201
+ };
202
+
203
+ const sectionTitleStyle = {
204
+ fontSize: 20,
205
+ fontWeight: 600,
206
+ fontStyle: 'normal',
207
+ fontFamily: FF,
208
+ color: 'var(--grey-strong)',
209
+ margin: 0,
210
+ lineHeight: 'normal',
211
+ };
212
+
213
+ const sectionSubtitleStyle = {
214
+ fontSize: 13,
215
+ fontWeight: 400,
216
+ fontStyle: 'normal',
217
+ color: 'var(--color-text-secondary)',
218
+ fontFamily: FF,
219
+ margin: '4px 0 0',
220
+ lineHeight: '140%',
221
+ };
222
+
223
+ const fieldLabelStyle = {
224
+ fontSize: 16,
225
+ fontWeight: 600,
226
+ fontStyle: 'normal',
227
+ color: 'var(--grey-strong)',
228
+ fontFamily: FF,
229
+ lineHeight: 'normal',
230
+ margin: 0,
231
+ display: 'block',
232
+ };
233
+
234
+ const inputStyle = {
235
+ width: '100%',
236
+ height: 44,
237
+ padding: '0 14px',
238
+ borderRadius: 6,
239
+ border: '1px solid var(--color-input-border)',
240
+ fontSize: 16,
241
+ fontWeight: 400,
242
+ fontStyle: 'normal',
243
+ lineHeight: 'normal',
244
+ fontFamily: FF,
245
+ color: 'var(--color-text-secondary)',
246
+ background: 'var(--grey-white)',
247
+ boxSizing: 'border-box',
248
+ outline: 'none',
249
+ transition: 'var(--transition-fast)',
250
+ };
251
+
252
+ const textareaWrapStyle = {
253
+ position: 'relative',
254
+ marginTop: 8,
255
+ };
256
+
257
+ const textareaStyle = {
258
+ width: '100%',
259
+ minHeight: 160,
260
+ padding: '12px 14px 28px 14px',
261
+ borderRadius: 6,
262
+ border: '1px solid var(--color-input-border)',
263
+ fontSize: 16,
264
+ fontWeight: 400,
265
+ fontStyle: 'normal',
266
+ lineHeight: 'normal',
267
+ fontFamily: FF,
268
+ color: 'var(--color-text-secondary)',
269
+ background: 'var(--grey-white)',
270
+ boxSizing: 'border-box',
271
+ outline: 'none',
272
+ resize: 'vertical',
273
+ lineHeight: '140%',
274
+ transition: 'var(--transition-fast)',
275
+ };
276
+
277
+ const charCountStyle = {
278
+ position: 'absolute',
279
+ bottom: 10,
280
+ right: 14,
281
+ fontSize: 12,
282
+ fontWeight: 400,
283
+ color: 'var(--text-faint)',
284
+ fontFamily: FF,
285
+ margin: 0,
286
+ pointerEvents: 'none',
287
+ };
288
+
289
+ // ─── Step Indicator Icons ───
290
+
291
+ function CompletedIcon() {
292
+ return (
293
+ <div
294
+ style={{
295
+ width: 24,
296
+ height: 24,
297
+ borderRadius: 6,
298
+ background: 'var(--grey-strong)',
299
+ display: 'flex',
300
+ alignItems: 'center',
301
+ justifyContent: 'center',
302
+ flexShrink: 0,
303
+ }}
304
+ >
305
+ <svg width="14" height="14" viewBox="0 0 14 14" fill="none">
306
+ <path d="M2.5 7.5L5.5 10.5L11.5 4" stroke="var(--grey-white)" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" />
307
+ </svg>
308
+ </div>
309
+ );
310
+ }
311
+
312
+ function IncompleteIcon() {
313
+ return (
314
+ <div
315
+ style={{
316
+ width: 24,
317
+ height: 24,
318
+ borderRadius: '50%',
319
+ border: '2px solid var(--grey-muted)',
320
+ background: 'transparent',
321
+ display: 'flex',
322
+ alignItems: 'center',
323
+ justifyContent: 'center',
324
+ flexShrink: 0,
325
+ gap: 2,
326
+ boxSizing: 'border-box',
327
+ }}
328
+ >
329
+ <span style={{ width: 3, height: 3, borderRadius: '50%', background: 'var(--grey-muted)' }} />
330
+ <span style={{ width: 3, height: 3, borderRadius: '50%', background: 'var(--grey-muted)' }} />
331
+ <span style={{ width: 3, height: 3, borderRadius: '50%', background: 'var(--grey-muted)' }} />
332
+ </div>
333
+ );
334
+ }
335
+
336
+ // ─── Step Item Component ───
337
+
338
+ function StepItem({ step, isCompleted, isActive, onClick }) {
339
+ const [hovered, setHovered] = useState(false);
340
+
341
+ return (
342
+ <div
343
+ style={{
344
+ ...stepItemStyle(isActive),
345
+ ...(hovered && !isActive ? { background: 'var(--hover-warm-subtle)' } : {}),
346
+ }}
347
+ onClick={onClick}
348
+ onMouseEnter={() => setHovered(true)}
349
+ onMouseLeave={() => setHovered(false)}
350
+ >
351
+ <div style={stepIconWrap}>
352
+ {isCompleted ? <CompletedIcon /> : <IncompleteIcon />}
353
+ </div>
354
+ <div>
355
+ <p style={stepLabelStyle}>{step.label}</p>
356
+ <p style={stepDescStyle}>{step.description}</p>
357
+ </div>
358
+ </div>
359
+ );
360
+ }
361
+
362
+ // ─── Workspace Name Step Content ───
363
+
364
+ function WorkspaceNameContent({ workspaceName, setWorkspaceName, description, setDescription, maxDescLength }) {
365
+ const [nameFocused, setNameFocused] = useState(false);
366
+ const [descFocused, setDescFocused] = useState(false);
367
+
368
+ return (
369
+ <div>
370
+ <h2 style={sectionTitleStyle}>Name of your workspace</h2>
371
+ <p style={sectionSubtitleStyle}>Tell us about the project or company you're organizing here.</p>
372
+
373
+ <div style={{ marginTop: 28 }}>
374
+ <label style={fieldLabelStyle}>Workspace Name</label>
375
+ <input
376
+ type="text"
377
+ placeholder="e.g. Acme Marketing"
378
+ value={workspaceName}
379
+ onChange={(e) => setWorkspaceName(e.target.value)}
380
+ onFocus={() => setNameFocused(true)}
381
+ onBlur={() => setNameFocused(false)}
382
+ style={{
383
+ ...inputStyle,
384
+ marginTop: 8,
385
+ borderColor: nameFocused ? 'var(--color-green)' : 'var(--color-input-border)',
386
+ boxShadow: nameFocused ? '0 0 0 3px var(--color-green-ring)' : 'none',
387
+ }}
388
+ />
389
+ </div>
390
+
391
+ <div style={{ marginTop: 24 }}>
392
+ <label style={fieldLabelStyle}>Description</label>
393
+ <div style={textareaWrapStyle}>
394
+ <textarea
395
+ placeholder="what's the goal of this workspace?"
396
+ value={description}
397
+ onChange={(e) => {
398
+ if (e.target.value.length <= maxDescLength) {
399
+ setDescription(e.target.value);
400
+ }
401
+ }}
402
+ onFocus={() => setDescFocused(true)}
403
+ onBlur={() => setDescFocused(false)}
404
+ style={{
405
+ ...textareaStyle,
406
+ borderColor: descFocused ? 'var(--color-green)' : 'var(--color-input-border)',
407
+ boxShadow: descFocused ? '0 0 0 3px var(--color-green-ring)' : 'none',
408
+ }}
409
+ />
410
+ <span style={charCountStyle}>{description.length}/{maxDescLength}</span>
411
+ </div>
412
+ </div>
413
+ </div>
414
+ );
415
+ }
416
+
417
+ // ─── Main Component ───
418
+
419
+ const GettingStarted = ({
420
+ steps = DEFAULT_STEPS,
421
+ completedSteps = ['workspace', 'invite'],
422
+ initialActiveStep = 'workspace',
423
+ onSaveNext,
424
+ onRemindLater,
425
+ onStepChange,
426
+ }) => {
427
+ const [activeStepId, setActiveStepId] = useState(initialActiveStep);
428
+ const [workspaceName, setWorkspaceName] = useState('');
429
+ const [description, setDescription] = useState('');
430
+ const maxDescLength = 1000;
431
+
432
+ const completedCount = completedSteps.length;
433
+ const totalCount = steps.length;
434
+ const progressPct = (completedCount / totalCount) * 100;
435
+
436
+ const handleStepClick = (stepId) => {
437
+ setActiveStepId(stepId);
438
+ onStepChange?.(stepId);
439
+ };
440
+
441
+ const handleSaveNext = () => {
442
+ onSaveNext?.({ stepId: activeStepId, workspaceName, description });
443
+ };
444
+
445
+ return (
446
+ <div style={pageStyle}>
447
+ {/* Header */}
448
+ <div style={headerStyle}>
449
+ <div style={headerTopRow}>
450
+ <div>
451
+ <h1 style={titleStyle}>Getting started with Chordia</h1>
452
+ <p style={subtitleStyle}>Complete these steps to get the most out of Chordia.</p>
453
+ </div>
454
+ <div style={headerActions}>
455
+ <button
456
+ style={remindBtnStyle}
457
+ onClick={onRemindLater}
458
+ onMouseEnter={(e) => { e.currentTarget.style.background = 'var(--hover-warm-subtle)'; }}
459
+ onMouseLeave={(e) => { e.currentTarget.style.background = 'transparent'; }}
460
+ >
461
+ Remind me Later
462
+ </button>
463
+ <button
464
+ style={saveBtnStyle}
465
+ onClick={handleSaveNext}
466
+ onMouseEnter={(e) => { e.currentTarget.style.opacity = '0.85'; }}
467
+ onMouseLeave={(e) => { e.currentTarget.style.opacity = '1'; }}
468
+ >
469
+ Save &amp; Next
470
+ </button>
471
+ </div>
472
+ </div>
473
+ <div style={progressBarBg}>
474
+ <div style={progressBarFill(progressPct)} />
475
+ </div>
476
+ </div>
477
+
478
+ {/* Body */}
479
+ <div style={bodyStyle}>
480
+ {/* Sidebar */}
481
+ <div style={sidebarStyle}>
482
+ <p style={stepsCountStyle}>
483
+ {completedCount} of {totalCount} steps completed
484
+ </p>
485
+ <div style={stepsListStyle}>
486
+ {steps.map((step) => (
487
+ <StepItem
488
+ key={step.id}
489
+ step={step}
490
+ isCompleted={completedSteps.includes(step.id)}
491
+ isActive={activeStepId === step.id}
492
+ onClick={() => handleStepClick(step.id)}
493
+ />
494
+ ))}
495
+ </div>
496
+ </div>
497
+
498
+ {/* Content */}
499
+ <div style={contentStyle}>
500
+ {activeStepId === 'workspace' && (
501
+ <WorkspaceNameContent
502
+ workspaceName={workspaceName}
503
+ setWorkspaceName={setWorkspaceName}
504
+ description={description}
505
+ setDescription={setDescription}
506
+ maxDescLength={maxDescLength}
507
+ />
508
+ )}
509
+ {activeStepId === 'interaction' && (
510
+ <UploadInteraction />
511
+ )}
512
+ {activeStepId === 'connect' && (
513
+ <ConnectData />
514
+ )}
515
+ {activeStepId === 'invite' && (
516
+ <AddTeammates />
517
+ )}
518
+ </div>
519
+ </div>
520
+ </div>
521
+ );
522
+ };
523
+
524
+ export default GettingStarted;