@flamingo-stack/openframe-frontend-core 0.0.327-snapshot.20260626171732 → 0.0.327
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-DCIB6AK3.cjs → chunk-27IO7V3P.cjs} +9 -9
- package/dist/{chunk-DCIB6AK3.cjs.map → chunk-27IO7V3P.cjs.map} +1 -1
- package/dist/{chunk-PZKEQNNK.cjs → chunk-3AXH7BDM.cjs} +29 -29
- package/dist/{chunk-PZKEQNNK.cjs.map → chunk-3AXH7BDM.cjs.map} +1 -1
- package/dist/{chunk-Z2TB777W.js → chunk-3UVR2JIB.js} +3 -3
- package/dist/{chunk-TAIMKJE6.js → chunk-46GJFN4V.js} +5 -5
- package/dist/{chunk-UZTGDV6N.js → chunk-4MD2TPFY.js} +2 -2
- package/dist/{chunk-5W6MKTGR.cjs → chunk-4ZHA24HS.cjs} +40 -40
- package/dist/{chunk-5W6MKTGR.cjs.map → chunk-4ZHA24HS.cjs.map} +1 -1
- package/dist/{chunk-B3YEMD6H.js → chunk-5WDRXBM3.js} +3 -3
- package/dist/{chunk-KS3NQFKW.js → chunk-62O2VTR2.js} +2 -2
- package/dist/{chunk-6SGZOIOQ.cjs → chunk-7FY2OM5W.cjs} +39 -39
- package/dist/{chunk-6SGZOIOQ.cjs.map → chunk-7FY2OM5W.cjs.map} +1 -1
- package/dist/{chunk-SWGXCGQ3.js → chunk-7KZJV4MP.js} +2 -2
- package/dist/{chunk-65VXW6GZ.js → chunk-A6NBGRGZ.js} +2 -2
- package/dist/{chunk-TAKXDI7B.cjs → chunk-BWWUHOE3.cjs} +73 -73
- package/dist/{chunk-TAKXDI7B.cjs.map → chunk-BWWUHOE3.cjs.map} +1 -1
- package/dist/{chunk-M43DVC6A.cjs → chunk-CRHOAKG5.cjs} +70 -70
- package/dist/{chunk-M43DVC6A.cjs.map → chunk-CRHOAKG5.cjs.map} +1 -1
- package/dist/{chunk-22VBCVLJ.js → chunk-CWXO6VCD.js} +3948 -4142
- package/dist/chunk-CWXO6VCD.js.map +1 -0
- package/dist/{chunk-SD36MNVP.cjs → chunk-GABTFTDE.cjs} +624 -818
- package/dist/chunk-GABTFTDE.cjs.map +1 -0
- package/dist/{chunk-CCG4DARM.cjs → chunk-GXRWE7NB.cjs} +2 -2
- package/dist/{chunk-CCG4DARM.cjs.map → chunk-GXRWE7NB.cjs.map} +1 -1
- package/dist/{chunk-7OZROCY7.cjs → chunk-HQ6BILVP.cjs} +31 -31
- package/dist/{chunk-7OZROCY7.cjs.map → chunk-HQ6BILVP.cjs.map} +1 -1
- package/dist/{chunk-OQPMYUZX.cjs → chunk-I4OFXYJR.cjs} +19 -19
- package/dist/{chunk-OQPMYUZX.cjs.map → chunk-I4OFXYJR.cjs.map} +1 -1
- package/dist/{chunk-F4WJ6G64.js → chunk-IDMM6DVL.js} +4 -4
- package/dist/{chunk-YV4PUSAJ.js → chunk-J4HHXHMC.js} +6 -6
- package/dist/{chunk-SY37FQHF.cjs → chunk-K5HBVPJ5.cjs} +3 -3
- package/dist/{chunk-SY37FQHF.cjs.map → chunk-K5HBVPJ5.cjs.map} +1 -1
- package/dist/{chunk-SC543SO2.js → chunk-LESTX5DM.js} +3 -3
- package/dist/{chunk-RVSR3M7Y.js → chunk-MJUYWNQB.js} +3 -3
- package/dist/{chunk-7FDLIPBP.cjs → chunk-MWAEG3XK.cjs} +12 -12
- package/dist/{chunk-7FDLIPBP.cjs.map → chunk-MWAEG3XK.cjs.map} +1 -1
- package/dist/{chunk-Z6WEY45X.cjs → chunk-NROSNR5J.cjs} +15 -15
- package/dist/{chunk-Z6WEY45X.cjs.map → chunk-NROSNR5J.cjs.map} +1 -1
- package/dist/{chunk-LM2P7UWU.cjs → chunk-PGFQ6WQR.cjs} +13 -13
- package/dist/{chunk-LM2P7UWU.cjs.map → chunk-PGFQ6WQR.cjs.map} +1 -1
- package/dist/{chunk-XGEF6MVM.js → chunk-QF4XERYJ.js} +2 -2
- package/dist/{chunk-P4XUTN2Z.js → chunk-U7GDY7Y3.js} +5 -5
- package/dist/{chunk-Y6AD3GJG.js → chunk-UHHJIHUZ.js} +6 -6
- package/dist/{chunk-WVIBC2M5.cjs → chunk-XDNQJQGP.cjs} +5 -5
- package/dist/{chunk-WVIBC2M5.cjs.map → chunk-XDNQJQGP.cjs.map} +1 -1
- package/dist/components/case-studies/index.cjs +10 -10
- package/dist/components/case-studies/index.js +4 -4
- package/dist/components/chat/index.cjs +4 -4
- package/dist/components/chat/index.js +3 -3
- package/dist/components/contact/index.cjs +5 -5
- package/dist/components/contact/index.js +4 -4
- package/dist/components/docs/index.cjs +7 -7
- package/dist/components/docs/index.js +6 -6
- package/dist/components/embeds/index.cjs +5 -5
- package/dist/components/embeds/index.js +4 -4
- package/dist/components/faq/index.cjs +6 -6
- package/dist/components/faq/index.js +5 -5
- package/dist/components/features/index.cjs +4 -4
- package/dist/components/features/index.js +3 -3
- package/dist/components/help-center-pages/index.cjs +23 -23
- package/dist/components/help-center-pages/index.js +14 -14
- package/dist/components/icons-v2-generated/index.cjs +2 -2
- package/dist/components/icons-v2-generated/index.js +1 -1
- package/dist/components/index.cjs +125 -127
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +12 -14
- package/dist/components/index.js.map +1 -1
- package/dist/components/navigation/index.cjs +4 -4
- package/dist/components/navigation/index.js +3 -3
- package/dist/components/onboarding-guides/index.cjs +8 -8
- package/dist/components/onboarding-guides/index.js +7 -7
- package/dist/components/related-content/index.cjs +6 -6
- package/dist/components/related-content/index.js +5 -5
- package/dist/components/tickets/index.cjs +7 -7
- package/dist/components/tickets/index.js +6 -6
- package/dist/components/ui/autocomplete.d.ts +0 -5
- package/dist/components/ui/autocomplete.d.ts.map +1 -1
- package/dist/components/ui/file-upload.d.ts +1 -3
- package/dist/components/ui/file-upload.d.ts.map +1 -1
- package/dist/components/ui/index.cjs +4 -6
- package/dist/components/ui/index.cjs.map +1 -1
- package/dist/components/ui/index.d.ts +0 -1
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +3 -5
- package/dist/hooks/index.cjs +3 -3
- package/dist/hooks/index.js +2 -2
- package/dist/index.cjs +4 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -5
- package/package.json +1 -1
- package/src/components/ui/autocomplete.tsx +18 -50
- package/src/components/ui/file-upload.tsx +76 -74
- package/src/components/ui/index.ts +0 -1
- package/dist/chunk-22VBCVLJ.js.map +0 -1
- package/dist/chunk-SD36MNVP.cjs.map +0 -1
- package/dist/components/ui/tag-select-dropdown.d.ts +0 -36
- package/dist/components/ui/tag-select-dropdown.d.ts.map +0 -1
- package/src/components/ui/tag-select-dropdown.tsx +0 -220
- /package/dist/{chunk-Z2TB777W.js.map → chunk-3UVR2JIB.js.map} +0 -0
- /package/dist/{chunk-TAIMKJE6.js.map → chunk-46GJFN4V.js.map} +0 -0
- /package/dist/{chunk-UZTGDV6N.js.map → chunk-4MD2TPFY.js.map} +0 -0
- /package/dist/{chunk-B3YEMD6H.js.map → chunk-5WDRXBM3.js.map} +0 -0
- /package/dist/{chunk-KS3NQFKW.js.map → chunk-62O2VTR2.js.map} +0 -0
- /package/dist/{chunk-SWGXCGQ3.js.map → chunk-7KZJV4MP.js.map} +0 -0
- /package/dist/{chunk-65VXW6GZ.js.map → chunk-A6NBGRGZ.js.map} +0 -0
- /package/dist/{chunk-F4WJ6G64.js.map → chunk-IDMM6DVL.js.map} +0 -0
- /package/dist/{chunk-YV4PUSAJ.js.map → chunk-J4HHXHMC.js.map} +0 -0
- /package/dist/{chunk-SC543SO2.js.map → chunk-LESTX5DM.js.map} +0 -0
- /package/dist/{chunk-RVSR3M7Y.js.map → chunk-MJUYWNQB.js.map} +0 -0
- /package/dist/{chunk-XGEF6MVM.js.map → chunk-QF4XERYJ.js.map} +0 -0
- /package/dist/{chunk-P4XUTN2Z.js.map → chunk-U7GDY7Y3.js.map} +0 -0
- /package/dist/{chunk-Y6AD3GJG.js.map → chunk-UHHJIHUZ.js.map} +0 -0
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
3
|
import * as React from "react"
|
|
4
|
-
import { Loader2 } from "lucide-react"
|
|
4
|
+
import { Loader2, X } from "lucide-react"
|
|
5
5
|
import { ImagePlusIcon } from "../icons-v2-generated/audio-and-visual/image-plus-icon"
|
|
6
|
-
import { Download02Icon } from "../icons-v2-generated/interface/download-02-icon"
|
|
7
|
-
import { TrashIcon } from "../icons-v2-generated/interface/trash-icon"
|
|
8
|
-
import { FileIcon } from "../icons-v2-generated/documents/file-icon"
|
|
9
6
|
import { cn } from "../../utils/cn"
|
|
10
7
|
import { FieldWrapper } from "./field-wrapper"
|
|
11
8
|
|
|
@@ -36,8 +33,6 @@ export interface FileUploadProps {
|
|
|
36
33
|
managedFiles?: ManagedFileEntry[]
|
|
37
34
|
/** Callback to remove a managed file by its id. Required when `managedFiles` is provided. */
|
|
38
35
|
onRemoveManagedFile?: (id: string) => void
|
|
39
|
-
/** When provided, an uploaded managed file shows a download action that calls this with its id. */
|
|
40
|
-
onDownloadManagedFile?: (id: string) => void
|
|
41
36
|
/** Accepted MIME types (e.g., "image/*", ".pdf,.doc") */
|
|
42
37
|
accept?: string
|
|
43
38
|
/** Maximum file size in bytes. Default: 10MB */
|
|
@@ -108,7 +103,6 @@ export function FileUpload({
|
|
|
108
103
|
onChange,
|
|
109
104
|
managedFiles,
|
|
110
105
|
onRemoveManagedFile,
|
|
111
|
-
onDownloadManagedFile,
|
|
112
106
|
accept = "*/*",
|
|
113
107
|
maxSize = 10 * 1024 * 1024,
|
|
114
108
|
maxFiles = 10,
|
|
@@ -289,9 +283,8 @@ export function FileUpload({
|
|
|
289
283
|
|
|
290
284
|
const displayError = error || validationError || undefined
|
|
291
285
|
const hasFiles = isManaged ? managedFiles.length > 0 : files.length > 0
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
const showDropzone = multiple || !hasFiles
|
|
286
|
+
const fileCount = currentCount
|
|
287
|
+
const canAddMore = multiple && fileCount < maxFiles
|
|
295
288
|
|
|
296
289
|
return (
|
|
297
290
|
<FieldWrapper label={fieldLabel} error={displayError} className={className}>
|
|
@@ -305,14 +298,42 @@ export function FileUpload({
|
|
|
305
298
|
disabled={disabled}
|
|
306
299
|
/>
|
|
307
300
|
|
|
308
|
-
{/*
|
|
309
|
-
|
|
310
|
-
|
|
301
|
+
{/* Primary dropzone */}
|
|
302
|
+
{!hasFiles && (
|
|
303
|
+
<button
|
|
304
|
+
type="button"
|
|
305
|
+
onDragEnter={handleDrag}
|
|
306
|
+
onDragLeave={handleDrag}
|
|
307
|
+
onDragOver={handleDrag}
|
|
308
|
+
onDrop={handleDrop}
|
|
309
|
+
onClick={openDialog}
|
|
310
|
+
disabled={disabled}
|
|
311
|
+
className={cn(
|
|
312
|
+
"flex w-full items-center gap-2 p-3 rounded-[6px] border border-dashed cursor-pointer text-left",
|
|
313
|
+
"transition-colors duration-200",
|
|
314
|
+
"bg-ods-card border-ods-border",
|
|
315
|
+
dragActive && "border-ods-accent bg-ods-accent/5",
|
|
316
|
+
!dragActive && "hover:border-ods-accent/30",
|
|
317
|
+
disabled && "opacity-50 cursor-not-allowed hover:border-ods-border",
|
|
318
|
+
)}
|
|
319
|
+
>
|
|
320
|
+
<div className="flex items-center p-3 rounded-full bg-ods-card border border-ods-border shrink-0">
|
|
321
|
+
{icon || <ImagePlusIcon className="size-6 text-ods-text-primary" />}
|
|
322
|
+
</div>
|
|
323
|
+
<div className="flex flex-1 flex-col font-['DM_Sans'] font-medium min-w-0">
|
|
324
|
+
<span className="text-heading-4 text-ods-text-primary">{label}</span>
|
|
325
|
+
<span className="text-heading-5 text-ods-text-secondary">{description}</span>
|
|
326
|
+
</div>
|
|
327
|
+
</button>
|
|
328
|
+
)}
|
|
329
|
+
|
|
330
|
+
{/* File list */}
|
|
331
|
+
{hasFiles && (
|
|
332
|
+
<div className="flex flex-col gap-2">
|
|
311
333
|
<div
|
|
312
334
|
className={cn(
|
|
313
|
-
"flex flex-col rounded-[6px]
|
|
314
|
-
|
|
315
|
-
dragActive && "border-ods-accent",
|
|
335
|
+
"flex flex-col gap-2 rounded-[6px] transition-colors duration-200",
|
|
336
|
+
dragActive && "bg-ods-accent/5",
|
|
316
337
|
)}
|
|
317
338
|
style={maxListHeight ? { maxHeight: typeof maxListHeight === "number" ? `${maxListHeight}px` : maxListHeight, overflowY: "auto" } : undefined}
|
|
318
339
|
>
|
|
@@ -321,52 +342,39 @@ export function FileUpload({
|
|
|
321
342
|
<div
|
|
322
343
|
key={entry.id}
|
|
323
344
|
className={cn(
|
|
324
|
-
"flex items-center gap-
|
|
325
|
-
entry.status === "error"
|
|
345
|
+
"flex items-center gap-3 p-3 rounded-[6px] bg-ods-card border",
|
|
346
|
+
entry.status === "error" ? "border-[var(--ods-attention-red-error)]/40" : "border-ods-border",
|
|
326
347
|
)}
|
|
327
348
|
>
|
|
328
|
-
<div className="flex items-center justify-center size-10 rounded-[6px] border border-ods-border bg-ods-card shrink-0">
|
|
329
|
-
<FileIcon className="size-6 text-ods-text-secondary" />
|
|
330
|
-
</div>
|
|
331
349
|
<div className="flex-1 min-w-0">
|
|
332
|
-
<p className="text-heading-
|
|
350
|
+
<p className="text-heading-5 font-medium text-ods-text-primary truncate" title={entry.fileName}>
|
|
333
351
|
{entry.fileName}
|
|
334
352
|
</p>
|
|
335
|
-
<div className="flex items-center gap-
|
|
336
|
-
<span className="text-heading-
|
|
353
|
+
<div className="flex items-center gap-2">
|
|
354
|
+
<span className="text-heading-6 text-ods-text-secondary">
|
|
337
355
|
{formatFileSize(entry.fileSize)}
|
|
338
356
|
</span>
|
|
339
357
|
{entry.status === "uploading" && (
|
|
340
|
-
<span className="flex items-center gap-
|
|
358
|
+
<span className="flex items-center gap-1 text-heading-6 text-ods-text-secondary">
|
|
341
359
|
<Loader2 className="size-3 animate-spin" />
|
|
342
360
|
Uploading...
|
|
343
361
|
</span>
|
|
344
362
|
)}
|
|
345
363
|
{entry.status === "error" && (
|
|
346
|
-
<span className="text-heading-
|
|
364
|
+
<span className="text-heading-6 text-[var(--ods-attention-red-error)]">
|
|
347
365
|
{entry.error || "Upload failed"}
|
|
348
366
|
</span>
|
|
349
367
|
)}
|
|
350
368
|
</div>
|
|
351
369
|
</div>
|
|
352
|
-
{onDownloadManagedFile && entry.status === "uploaded" && (
|
|
353
|
-
<button
|
|
354
|
-
type="button"
|
|
355
|
-
onClick={() => onDownloadManagedFile(entry.id)}
|
|
356
|
-
className="shrink-0 text-ods-text-secondary hover:text-ods-text-primary transition-colors"
|
|
357
|
-
aria-label={`Download ${entry.fileName}`}
|
|
358
|
-
>
|
|
359
|
-
<Download02Icon className="size-6" />
|
|
360
|
-
</button>
|
|
361
|
-
)}
|
|
362
370
|
{!disabled && (
|
|
363
371
|
<button
|
|
364
372
|
type="button"
|
|
365
373
|
onClick={() => onRemoveManagedFile?.(entry.id)}
|
|
366
|
-
className="shrink-0
|
|
374
|
+
className="shrink-0 p-1 rounded hover:bg-ods-bg transition-colors"
|
|
367
375
|
aria-label={`Remove ${entry.fileName}`}
|
|
368
376
|
>
|
|
369
|
-
<
|
|
377
|
+
<X className="size-4 text-ods-text-secondary" />
|
|
370
378
|
</button>
|
|
371
379
|
)}
|
|
372
380
|
</div>
|
|
@@ -374,16 +382,13 @@ export function FileUpload({
|
|
|
374
382
|
: files.map((file, index) => (
|
|
375
383
|
<div
|
|
376
384
|
key={`${file.name}-${index}`}
|
|
377
|
-
className="flex items-center gap-
|
|
385
|
+
className="flex items-center gap-3 p-3 rounded-[6px] bg-ods-card border border-ods-border"
|
|
378
386
|
>
|
|
379
|
-
<div className="flex items-center justify-center size-10 rounded-[6px] border border-ods-border bg-ods-card shrink-0">
|
|
380
|
-
<FileIcon className="size-6 text-ods-text-secondary" />
|
|
381
|
-
</div>
|
|
382
387
|
<div className="flex-1 min-w-0">
|
|
383
|
-
<p className="text-heading-
|
|
388
|
+
<p className="text-heading-5 font-medium text-ods-text-primary truncate" title={file.name}>
|
|
384
389
|
{file.name}
|
|
385
390
|
</p>
|
|
386
|
-
<p className="text-heading-
|
|
391
|
+
<p className="text-heading-6 text-ods-text-secondary">
|
|
387
392
|
{formatFileSize(file.size)}
|
|
388
393
|
</p>
|
|
389
394
|
</div>
|
|
@@ -391,46 +396,43 @@ export function FileUpload({
|
|
|
391
396
|
<button
|
|
392
397
|
type="button"
|
|
393
398
|
onClick={() => handleRemoveFile(index)}
|
|
394
|
-
className="shrink-0
|
|
399
|
+
className="shrink-0 p-1 rounded hover:bg-ods-bg transition-colors"
|
|
395
400
|
aria-label={`Remove ${file.name}`}
|
|
396
401
|
>
|
|
397
|
-
<
|
|
402
|
+
<X className="size-4 text-ods-text-secondary" />
|
|
398
403
|
</button>
|
|
399
404
|
)}
|
|
400
405
|
</div>
|
|
401
406
|
))
|
|
402
407
|
}
|
|
403
408
|
</div>
|
|
404
|
-
)}
|
|
405
409
|
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
410
|
+
{/* Add more button */}
|
|
411
|
+
{canAddMore && (
|
|
412
|
+
<button
|
|
413
|
+
type="button"
|
|
414
|
+
onClick={openDialog}
|
|
415
|
+
onDragEnter={handleDrag}
|
|
416
|
+
onDragLeave={handleDrag}
|
|
417
|
+
onDragOver={handleDrag}
|
|
418
|
+
onDrop={handleDrop}
|
|
419
|
+
disabled={disabled}
|
|
420
|
+
className={cn(
|
|
421
|
+
"flex items-center justify-center gap-2 p-3 rounded-[6px]",
|
|
422
|
+
"border border-dashed",
|
|
423
|
+
"text-heading-5 font-medium",
|
|
424
|
+
"transition-colors duration-200",
|
|
425
|
+
dragActive
|
|
426
|
+
? "border-ods-accent bg-ods-accent/5 text-ods-text-primary"
|
|
427
|
+
: "border-ods-border text-ods-text-secondary hover:border-ods-accent/30 hover:text-ods-text-primary",
|
|
428
|
+
disabled && "opacity-50 cursor-not-allowed",
|
|
429
|
+
)}
|
|
430
|
+
>
|
|
431
|
+
Add more files
|
|
432
|
+
</button>
|
|
422
433
|
)}
|
|
423
|
-
>
|
|
424
|
-
|
|
425
|
-
{icon || <ImagePlusIcon className="size-6 text-ods-text-primary" />}
|
|
426
|
-
</div>
|
|
427
|
-
<div className="flex flex-1 flex-col font-['DM_Sans'] font-medium min-w-0">
|
|
428
|
-
<span className="text-heading-4 text-ods-text-primary">{label}</span>
|
|
429
|
-
<span className="text-heading-5 text-ods-text-secondary">{description}</span>
|
|
430
|
-
</div>
|
|
431
|
-
</button>
|
|
432
|
-
)}
|
|
433
|
-
</div>
|
|
434
|
+
</div>
|
|
435
|
+
)}
|
|
434
436
|
</FieldWrapper>
|
|
435
437
|
)
|
|
436
438
|
}
|