@designa8/vibedesign-v6 2.2.5 → 2.3.0
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/README.md +1 -1
- package/dist/index.cjs +2403 -2060
- package/dist/index.js +2366 -2023
- package/dist/styles.css +17 -15
- package/package.json +6 -1
- package/src/atoms/AgentActivityPanel/AgentActivityPanel.tsx +348 -0
- package/src/atoms/AgentActivityPanel/index.ts +8 -0
- package/src/atoms/AgentActivityPanel/preview.tsx +107 -0
- package/src/atoms/HomePageTemplate/HomePageTemplate.tsx +59 -16
- package/src/atoms/HomePageTemplate/preview.tsx +42 -19
- package/src/atoms/Icon/icons.data.ts +3 -0
- package/src/atoms/MarketingNavbar/MarketingNavbar.tsx +44 -23
- package/src/atoms/MarketingNavbar/preview.tsx +30 -6
- package/src/atoms/PromptInputBar/PromptInputBar.tsx +107 -31
- package/src/index.ts +1 -0
- package/dist/fonts/plusjakartasans/PlusJakartaSans-Italic[wght].ttf +0 -0
- package/dist/fonts/plusjakartasans/PlusJakartaSans[wght].ttf +0 -0
|
@@ -42,6 +42,9 @@ export interface PromptInputBarProps {
|
|
|
42
42
|
/**
|
|
43
43
|
* Called when "Upload file" is chosen in the + menu.
|
|
44
44
|
* When onFilesSelected is also provided, onFilesSelected takes priority.
|
|
45
|
+
* When NEITHER is provided the bar cannot accept files, so the "Upload
|
|
46
|
+
* file" row is not rendered at all and the + menu opens straight onto the
|
|
47
|
+
* model list (a dead upload row is never shown).
|
|
45
48
|
*/
|
|
46
49
|
onAttach?: () => void;
|
|
47
50
|
/**
|
|
@@ -224,12 +227,20 @@ export const PromptInputBar = React.forwardRef<
|
|
|
224
227
|
},
|
|
225
228
|
ref,
|
|
226
229
|
) => {
|
|
230
|
+
/* Whether this bar can actually take a file. When it cannot, the
|
|
231
|
+
"Upload file" row is not rendered — a menu option that silently does
|
|
232
|
+
nothing is worse than no option at all. The + menu then opens straight
|
|
233
|
+
onto the model list, so its first row is a real selection. */
|
|
234
|
+
const hasUploadPath = Boolean(onFilesSelected || onAttach);
|
|
235
|
+
|
|
227
236
|
const uid = React.useId();
|
|
228
237
|
const [internalValue, setInternalValue] = React.useState("");
|
|
229
238
|
const [internalImages, setInternalImages] = React.useState<PastedImage[]>([]);
|
|
230
239
|
const [modeOpen, setModeOpen] = React.useState(false);
|
|
231
240
|
const [menuOpen, setMenuOpen] = React.useState(false);
|
|
232
|
-
const [menuView, setMenuView] = React.useState<"root" | "models">(
|
|
241
|
+
const [menuView, setMenuView] = React.useState<"root" | "models">(
|
|
242
|
+
hasUploadPath ? "root" : "models",
|
|
243
|
+
);
|
|
233
244
|
const [internalSuggestDesigns, setInternalSuggestDesigns] = React.useState(false);
|
|
234
245
|
const [internalRecording, setInternalRecording] = React.useState(false);
|
|
235
246
|
const [seconds, setSeconds] = React.useState(0);
|
|
@@ -253,8 +264,8 @@ export const PromptInputBar = React.forwardRef<
|
|
|
253
264
|
|
|
254
265
|
const closeMenu = React.useCallback(() => {
|
|
255
266
|
setMenuOpen(false);
|
|
256
|
-
setMenuView("root");
|
|
257
|
-
}, []);
|
|
267
|
+
setMenuView(hasUploadPath ? "root" : "models");
|
|
268
|
+
}, [hasUploadPath]);
|
|
258
269
|
|
|
259
270
|
useClickOutside(modeRef, React.useCallback(() => setModeOpen(false), []), modeOpen);
|
|
260
271
|
useClickOutside(menuWrapRef, closeMenu, menuOpen);
|
|
@@ -465,7 +476,7 @@ export const PromptInputBar = React.forwardRef<
|
|
|
465
476
|
return;
|
|
466
477
|
}
|
|
467
478
|
if (e.key === "ArrowLeft" || e.key === "Backspace") {
|
|
468
|
-
if (menuView === "models") {
|
|
479
|
+
if (menuView === "models" && hasUploadPath) {
|
|
469
480
|
e.preventDefault();
|
|
470
481
|
setMenuView("root");
|
|
471
482
|
}
|
|
@@ -484,7 +495,7 @@ export const PromptInputBar = React.forwardRef<
|
|
|
484
495
|
const next = idx === -1 ? 0 : (idx + delta + items.length) % items.length;
|
|
485
496
|
items[next]?.focus();
|
|
486
497
|
}
|
|
487
|
-
if (e.key === "ArrowRight" && menuView === "root" && hasModels) {
|
|
498
|
+
if (e.key === "ArrowRight" && menuView === "root" && hasModels && hasUploadPath) {
|
|
488
499
|
const el = document.activeElement as HTMLElement | null;
|
|
489
500
|
if (el?.dataset.menuItem === "models") {
|
|
490
501
|
e.preventDefault();
|
|
@@ -649,23 +660,25 @@ export const PromptInputBar = React.forwardRef<
|
|
|
649
660
|
inert={menuView !== "root"}
|
|
650
661
|
className={`${VIEW} ${menuView === "root" ? "" : "-translate-x-2"}`}
|
|
651
662
|
>
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
<
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
<span className="
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
663
|
+
{hasUploadPath && (
|
|
664
|
+
<button
|
|
665
|
+
type="button"
|
|
666
|
+
role="menuitem"
|
|
667
|
+
data-menu-item="upload"
|
|
668
|
+
onClick={handleUploadClick}
|
|
669
|
+
className={ROW}
|
|
670
|
+
>
|
|
671
|
+
<span className="flex size-9 flex-shrink-0 items-center justify-center rounded-md bg-surface-soft text-ink">
|
|
672
|
+
<Icon name="upload" size={18} />
|
|
673
|
+
</span>
|
|
674
|
+
<span className="flex min-w-0 flex-1 flex-col">
|
|
675
|
+
<span className="text-body-md text-ink">Upload file</span>
|
|
676
|
+
<span className="text-caption text-muted">Images, PDFs and docs</span>
|
|
677
|
+
</span>
|
|
678
|
+
</button>
|
|
679
|
+
)}
|
|
680
|
+
|
|
681
|
+
{hasModels && hasUploadPath && (
|
|
669
682
|
<>
|
|
670
683
|
<div role="separator" className="mx-sm my-xs h-px bg-hairline-soft" />
|
|
671
684
|
<button
|
|
@@ -694,6 +707,67 @@ export const PromptInputBar = React.forwardRef<
|
|
|
694
707
|
</button>
|
|
695
708
|
</>
|
|
696
709
|
)}
|
|
710
|
+
|
|
711
|
+
{/* No upload path: the root view IS the model list, so the
|
|
712
|
+
first row the menu offers is a real selection. */}
|
|
713
|
+
{hasModels && !hasUploadPath && (
|
|
714
|
+
<div role="group" aria-label="Model" className="flex flex-col">
|
|
715
|
+
{models?.map((m, i) => {
|
|
716
|
+
const isAvailable = m.available !== false;
|
|
717
|
+
const isSelected = isAvailable && m.id === currentModel?.id;
|
|
718
|
+
return (
|
|
719
|
+
<React.Fragment key={m.id}>
|
|
720
|
+
{i > 0 && (
|
|
721
|
+
<div role="separator" className="mx-sm h-px bg-hairline-soft" />
|
|
722
|
+
)}
|
|
723
|
+
<button
|
|
724
|
+
type="button"
|
|
725
|
+
role="menuitemradio"
|
|
726
|
+
aria-checked={isSelected}
|
|
727
|
+
aria-disabled={!isAvailable}
|
|
728
|
+
data-menu-item="model"
|
|
729
|
+
onClick={() => handleModelSelect(m)}
|
|
730
|
+
className={[
|
|
731
|
+
ROW,
|
|
732
|
+
"py-sm",
|
|
733
|
+
isSelected ? "bg-primary-soft hover:bg-primary-soft" : "",
|
|
734
|
+
!isAvailable ? "opacity-60" : "",
|
|
735
|
+
].join(" ")}
|
|
736
|
+
>
|
|
737
|
+
<span className="flex min-w-0 flex-1 flex-col">
|
|
738
|
+
<span className="flex items-center gap-sm">
|
|
739
|
+
<span
|
|
740
|
+
className={`text-body-md ${isAvailable ? "text-ink" : "text-muted"}`}
|
|
741
|
+
>
|
|
742
|
+
{m.name}
|
|
743
|
+
</span>
|
|
744
|
+
{m.tier && (
|
|
745
|
+
<span className="rounded-full bg-surface-soft px-sm py-xxs text-caption text-body">
|
|
746
|
+
{m.tier}
|
|
747
|
+
</span>
|
|
748
|
+
)}
|
|
749
|
+
</span>
|
|
750
|
+
{m.description && isAvailable && (
|
|
751
|
+
<span className="text-caption text-muted">{m.description}</span>
|
|
752
|
+
)}
|
|
753
|
+
{!isAvailable && (
|
|
754
|
+
<span className="text-caption text-muted-soft">Unavailable</span>
|
|
755
|
+
)}
|
|
756
|
+
</span>
|
|
757
|
+
{isSelected && (
|
|
758
|
+
<Icon
|
|
759
|
+
name="check-checkmark"
|
|
760
|
+
size={18}
|
|
761
|
+
strokeWidth={2.25}
|
|
762
|
+
className="flex-shrink-0 text-primary"
|
|
763
|
+
/>
|
|
764
|
+
)}
|
|
765
|
+
</button>
|
|
766
|
+
</React.Fragment>
|
|
767
|
+
);
|
|
768
|
+
})}
|
|
769
|
+
</div>
|
|
770
|
+
)}
|
|
697
771
|
</div>
|
|
698
772
|
|
|
699
773
|
{/* Model view (drill-in) */}
|
|
@@ -706,15 +780,17 @@ export const PromptInputBar = React.forwardRef<
|
|
|
706
780
|
className={`${VIEW} ${menuView === "models" ? "" : "translate-x-2"}`}
|
|
707
781
|
>
|
|
708
782
|
<div className="flex items-center gap-sm px-xs pb-xs pt-xs">
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
783
|
+
{hasUploadPath && (
|
|
784
|
+
<button
|
|
785
|
+
type="button"
|
|
786
|
+
data-menu-item="back"
|
|
787
|
+
onClick={() => setMenuView("root")}
|
|
788
|
+
aria-label="Back"
|
|
789
|
+
className={`flex size-9 flex-shrink-0 items-center justify-center rounded-full border border-hairline bg-surface-soft text-ink hover:bg-surface-strong ${PRESS} ${FOCUS}`}
|
|
790
|
+
>
|
|
791
|
+
<Icon name="arrow-left" size={16} />
|
|
792
|
+
</button>
|
|
793
|
+
)}
|
|
718
794
|
<span className="text-body-md text-ink">Model</span>
|
|
719
795
|
</div>
|
|
720
796
|
|
package/src/index.ts
CHANGED
|
Binary file
|
|
Binary file
|