@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
|
@@ -26,14 +26,23 @@ const SuggestionChip: React.FC<SuggestionChipProps> = ({ label, onClick }) => (
|
|
|
26
26
|
);
|
|
27
27
|
|
|
28
28
|
/* ─── Default model list ─────────────────────────────────────────────────── */
|
|
29
|
+
/*
|
|
30
|
+
* Ordered strongest → lightest, which is also how the model menu reads. The
|
|
31
|
+
* default selection (see DEFAULT_SELECTED_MODEL_ID) sits in the middle of the
|
|
32
|
+
* list, so the first row of the menu is a model that is genuinely NOT the
|
|
33
|
+
* current one — picking it visibly moves the check mark and updates the
|
|
34
|
+
* reported model instead of re-selecting what was already selected.
|
|
35
|
+
*/
|
|
29
36
|
const DEFAULT_MODELS: PromptInputBarModel[] = [
|
|
37
|
+
{ id: "claude-opus", name: "Claude Opus 4", tier: "Pro" },
|
|
30
38
|
{ id: "claude-sonnet", name: "Claude Sonnet 4.6" },
|
|
31
39
|
{ id: "claude-haiku", name: "Claude Haiku 3.5", tier: "Fast" },
|
|
32
|
-
{ id: "claude-opus", name: "Claude Opus 4", tier: "Pro" },
|
|
33
40
|
];
|
|
34
41
|
|
|
35
42
|
const DEFAULT_SELECTED_MODEL_ID = "claude-sonnet";
|
|
36
43
|
|
|
44
|
+
const DEFAULT_MODE: PromptMode = "Build";
|
|
45
|
+
|
|
37
46
|
/* ─── Default prompt placeholder ─────────────────────────────────────────── */
|
|
38
47
|
const DEFAULT_PLACEHOLDER = "Describe an atom or design token to create...";
|
|
39
48
|
|
|
@@ -548,9 +557,16 @@ export interface HomePageTemplateProps {
|
|
|
548
557
|
* "Describe an atom or design token to create...".
|
|
549
558
|
*/
|
|
550
559
|
placeholder?: string;
|
|
551
|
-
/**
|
|
560
|
+
/**
|
|
561
|
+
* Controlled build mode shown in the prompt bar. When omitted the template
|
|
562
|
+
* manages the mode itself, so picking Chat or Design in the mode list
|
|
563
|
+
* updates the trigger immediately.
|
|
564
|
+
*/
|
|
552
565
|
mode?: PromptMode;
|
|
553
|
-
/**
|
|
566
|
+
/**
|
|
567
|
+
* Called when mode changes. Fired in addition to the internal mode update
|
|
568
|
+
* when `mode` is omitted (uncontrolled).
|
|
569
|
+
*/
|
|
554
570
|
onModeChange?: (mode: PromptMode) => void;
|
|
555
571
|
/** Called when the send button is clicked */
|
|
556
572
|
onSend?: (value: string) => void;
|
|
@@ -627,12 +643,15 @@ export interface HomePageTemplateProps {
|
|
|
627
643
|
*/
|
|
628
644
|
models?: PromptInputBarModel[];
|
|
629
645
|
/**
|
|
630
|
-
*
|
|
631
|
-
*
|
|
646
|
+
* Controlled selected model id forwarded to PromptInputBar. When omitted
|
|
647
|
+
* the template manages the selection itself, so picking a model in the
|
|
648
|
+
* prompt bar's model list updates the current model immediately.
|
|
632
649
|
*/
|
|
633
650
|
selectedModelId?: string;
|
|
634
651
|
/**
|
|
635
|
-
* Called when the user picks a different model in PromptInputBar.
|
|
652
|
+
* Called when the user picks a different model in PromptInputBar. Fired in
|
|
653
|
+
* addition to the internal selection update when `selectedModelId` is
|
|
654
|
+
* omitted (uncontrolled).
|
|
636
655
|
*/
|
|
637
656
|
onModelChange?: (modelId: string) => void;
|
|
638
657
|
/**
|
|
@@ -855,7 +874,7 @@ export const HomePageTemplate = React.forwardRef<HTMLDivElement, HomePageTemplat
|
|
|
855
874
|
promptValue,
|
|
856
875
|
onPromptChange,
|
|
857
876
|
placeholder = DEFAULT_PLACEHOLDER,
|
|
858
|
-
mode
|
|
877
|
+
mode: modeProp,
|
|
859
878
|
onModeChange,
|
|
860
879
|
onSend,
|
|
861
880
|
suggestions = DEFAULT_SUGGESTIONS,
|
|
@@ -874,7 +893,7 @@ export const HomePageTemplate = React.forwardRef<HTMLDivElement, HomePageTemplat
|
|
|
874
893
|
upgradeSubtitle,
|
|
875
894
|
upgradeCredits,
|
|
876
895
|
models,
|
|
877
|
-
selectedModelId,
|
|
896
|
+
selectedModelId: selectedModelIdProp,
|
|
878
897
|
onModelChange,
|
|
879
898
|
onUnavailableModelClick,
|
|
880
899
|
onMic,
|
|
@@ -902,6 +921,8 @@ export const HomePageTemplate = React.forwardRef<HTMLDivElement, HomePageTemplat
|
|
|
902
921
|
) => {
|
|
903
922
|
const [internalPrompt, setInternalPrompt] = React.useState("");
|
|
904
923
|
const [internalActiveId, setInternalActiveId] = React.useState("home");
|
|
924
|
+
const [internalMode, setInternalMode] = React.useState<PromptMode>(DEFAULT_MODE);
|
|
925
|
+
const [internalModelId, setInternalModelId] = React.useState(DEFAULT_SELECTED_MODEL_ID);
|
|
905
926
|
|
|
906
927
|
// When activeIdProp is provided it controls the active entry; otherwise use internal state.
|
|
907
928
|
const resolvedActiveId = activeIdProp !== undefined ? activeIdProp : internalActiveId;
|
|
@@ -911,9 +932,13 @@ export const HomePageTemplate = React.forwardRef<HTMLDivElement, HomePageTemplat
|
|
|
911
932
|
|
|
912
933
|
const textValue = promptValue !== undefined ? promptValue : internalPrompt;
|
|
913
934
|
|
|
914
|
-
// Resolve model list
|
|
935
|
+
// Resolve model list, selected model id and mode, falling back to the
|
|
936
|
+
// internally-tracked values so picking a model or a mode updates what the
|
|
937
|
+
// prompt bar shows even when the consumer passes no handler.
|
|
915
938
|
const resolvedModels = models !== undefined ? models : DEFAULT_MODELS;
|
|
916
|
-
const resolvedSelectedModelId =
|
|
939
|
+
const resolvedSelectedModelId =
|
|
940
|
+
selectedModelIdProp !== undefined ? selectedModelIdProp : internalModelId;
|
|
941
|
+
const resolvedMode = modeProp !== undefined ? modeProp : internalMode;
|
|
917
942
|
|
|
918
943
|
// The mesh-blob composition renders whenever animatedBackground is on; under
|
|
919
944
|
// prefers-reduced-motion the same composition stays but the CSS above freezes
|
|
@@ -930,6 +955,16 @@ export const HomePageTemplate = React.forwardRef<HTMLDivElement, HomePageTemplat
|
|
|
930
955
|
if (promptValue === undefined) setInternalPrompt("");
|
|
931
956
|
};
|
|
932
957
|
|
|
958
|
+
const handleModeChange = (next: PromptMode) => {
|
|
959
|
+
if (modeProp === undefined) setInternalMode(next);
|
|
960
|
+
onModeChange?.(next);
|
|
961
|
+
};
|
|
962
|
+
|
|
963
|
+
const handleModelChange = (modelId: string) => {
|
|
964
|
+
if (selectedModelIdProp === undefined) setInternalModelId(modelId);
|
|
965
|
+
onModelChange?.(modelId);
|
|
966
|
+
};
|
|
967
|
+
|
|
933
968
|
// Composes the prompt from a suggestion label and WRITES it into the
|
|
934
969
|
// prompt input — it never calls onSend. Used by both the "wrap" chip row
|
|
935
970
|
// and the marquee rows. The label's casing is always preserved as-is;
|
|
@@ -978,7 +1013,14 @@ export const HomePageTemplate = React.forwardRef<HTMLDivElement, HomePageTemplat
|
|
|
978
1013
|
>
|
|
979
1014
|
<style>{HOME_TEMPLATE_STYLES}</style>
|
|
980
1015
|
|
|
981
|
-
{/* ── Desktop sidebar — hidden on mobile ──
|
|
1016
|
+
{/* ── Desktop sidebar — hidden on mobile ──
|
|
1017
|
+
NOTE: `onInboxClick` is intentionally NOT passed. AppSidebar only
|
|
1018
|
+
renders its inbox button (and the permanent red notification dot
|
|
1019
|
+
that ships with it) when a click handler is supplied, and this
|
|
1020
|
+
screen has no inbox to open and no notifications to report. With
|
|
1021
|
+
the prop omitted neither the button nor the dot is rendered, and
|
|
1022
|
+
no replacement control is added. The avatar and the dark-mode
|
|
1023
|
+
toggle are unaffected. ── */}
|
|
982
1024
|
<div className="hidden md:flex flex-shrink-0" style={{ height: "100%" }}>
|
|
983
1025
|
<AppSidebar
|
|
984
1026
|
workspaceName={userName}
|
|
@@ -989,7 +1031,6 @@ export const HomePageTemplate = React.forwardRef<HTMLDivElement, HomePageTemplat
|
|
|
989
1031
|
onSubSelect={onSubSelect}
|
|
990
1032
|
userInitials={userInitials}
|
|
991
1033
|
userEmail={userEmail}
|
|
992
|
-
onInboxClick={() => {}}
|
|
993
1034
|
darkMode={darkMode}
|
|
994
1035
|
onDarkModeToggle={onDarkModeToggle}
|
|
995
1036
|
onLogout={onLogout}
|
|
@@ -1021,7 +1062,9 @@ export const HomePageTemplate = React.forwardRef<HTMLDivElement, HomePageTemplat
|
|
|
1021
1062
|
)}
|
|
1022
1063
|
|
|
1023
1064
|
{/* ── Mobile top bar — AppSidebarMobile IS the whole bar (brand left,
|
|
1024
|
-
menu button right, menu expands downward). Visible only below md.
|
|
1065
|
+
menu button right, menu expands downward). Visible only below md.
|
|
1066
|
+
`onInboxClick` is likewise omitted so the drawer footer shows no
|
|
1067
|
+
inbox button and no notification dot. ── */}
|
|
1025
1068
|
<AppSidebarMobile
|
|
1026
1069
|
className="md:hidden relative z-10"
|
|
1027
1070
|
brandName="Atoms"
|
|
@@ -1120,8 +1163,8 @@ export const HomePageTemplate = React.forwardRef<HTMLDivElement, HomePageTemplat
|
|
|
1120
1163
|
placeholder={placeholder}
|
|
1121
1164
|
value={textValue}
|
|
1122
1165
|
onChange={handleChange}
|
|
1123
|
-
mode={
|
|
1124
|
-
onModeChange={
|
|
1166
|
+
mode={resolvedMode}
|
|
1167
|
+
onModeChange={handleModeChange}
|
|
1125
1168
|
onSend={handleSend}
|
|
1126
1169
|
onMic={onMic}
|
|
1127
1170
|
recording={recording}
|
|
@@ -1131,7 +1174,7 @@ export const HomePageTemplate = React.forwardRef<HTMLDivElement, HomePageTemplat
|
|
|
1131
1174
|
onRecordingCancel={onRecordingCancel}
|
|
1132
1175
|
models={resolvedModels}
|
|
1133
1176
|
selectedModelId={resolvedSelectedModelId}
|
|
1134
|
-
onModelChange={
|
|
1177
|
+
onModelChange={handleModelChange}
|
|
1135
1178
|
onUnavailableModelClick={onUnavailableModelClick}
|
|
1136
1179
|
showModeSelector={showModeSelector}
|
|
1137
1180
|
suggestDesigns={suggestDesigns}
|
|
@@ -1,29 +1,52 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { HomePageTemplate } from "./HomePageTemplate";
|
|
3
|
+
import type { NavEntry } from "../AppSidebar";
|
|
4
|
+
import { Icon } from "../Icon";
|
|
5
|
+
|
|
6
|
+
/* A flat nav set for the demo: Home + All projects, so the canvas stays focused
|
|
7
|
+
* on the hero and prompt bar rather than a long project tree. */
|
|
8
|
+
const DEMO_NAV: NavEntry[] = [
|
|
9
|
+
{ id: "home", label: "Home", icon: <Icon name="home" className="size-[18px]" /> },
|
|
10
|
+
{ id: "projects", label: "All projects", icon: <Icon name="folder" className="size-[18px]" /> },
|
|
11
|
+
];
|
|
3
12
|
|
|
4
13
|
export default function Preview() {
|
|
5
14
|
const [darkMode, setDarkMode] = React.useState(false);
|
|
15
|
+
const [prompt, setPrompt] = React.useState("");
|
|
16
|
+
const [lastSent, setLastSent] = React.useState<string | null>(null);
|
|
6
17
|
|
|
7
18
|
return (
|
|
8
|
-
<div className="w-full
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
<div className="w-full max-w-6xl mx-auto p-lg space-y-md">
|
|
20
|
+
<div
|
|
21
|
+
className="w-full rounded-xl border border-hairline overflow-hidden bg-canvas"
|
|
22
|
+
style={{ height: "640px" }}
|
|
23
|
+
>
|
|
24
|
+
<HomePageTemplate
|
|
25
|
+
userName="Hello Designer"
|
|
26
|
+
userInitials="N"
|
|
27
|
+
navEntries={DEMO_NAV}
|
|
28
|
+
suggestions={[
|
|
29
|
+
"Primary button atom",
|
|
30
|
+
"Brand color palette",
|
|
31
|
+
"Type scale",
|
|
32
|
+
"Card molecule",
|
|
33
|
+
"Navbar organism",
|
|
34
|
+
"Settings template",
|
|
35
|
+
]}
|
|
36
|
+
suggestionsVariant="marquee"
|
|
37
|
+
animatedBackground={true}
|
|
38
|
+
darkMode={darkMode}
|
|
39
|
+
onDarkModeToggle={() => setDarkMode((d) => !d)}
|
|
40
|
+
promptValue={prompt}
|
|
41
|
+
onPromptChange={setPrompt}
|
|
42
|
+
onSend={(value) => setLastSent(value)}
|
|
43
|
+
style={{ width: "100%", height: "100%" }}
|
|
44
|
+
/>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<p className="text-body-sm text-muted">
|
|
48
|
+
{lastSent ? `Sent: ${lastSent}` : "Pick a suggestion chip, change the mode, or send a prompt."}
|
|
49
|
+
</p>
|
|
27
50
|
</div>
|
|
28
51
|
);
|
|
29
52
|
}
|
|
@@ -97,6 +97,9 @@ export const ICON_REGISTRY = {
|
|
|
97
97
|
"landmark": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M10 18v-7" }, { tag: "path", d: "M11.12 2.198a2 2 0 0 1 1.76.006l7.866 3.847c.476.233.31.949-.22.949H3.474c-.53 0-.695-.716-.22-.949z" }, { tag: "path", d: "M14 18v-7" }, { tag: "path", d: "M18 18v-7" }, { tag: "path", d: "M3 22h18" }, { tag: "path", d: "M6 18v-7" }] },
|
|
98
98
|
"circle-user": { viewBox: "0 0 24 24", nodes: [{ tag: "circle", cx: "12", cy: "12", r: "10" }, { tag: "circle", cx: "12", cy: "10", r: "3" }, { tag: "path", d: "M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662" }] },
|
|
99
99
|
"pencil": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z" }, { tag: "path", d: "m15 5 4 4" }] },
|
|
100
|
+
"circle-dot": { viewBox: "0 0 24 24", nodes: [{ tag: "circle", cx: "12", cy: "12", r: "10" }, { tag: "circle", cx: "12", cy: "12", r: "1" }] },
|
|
101
|
+
"bot": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M12 8V4H8" }, { tag: "rect", width: "16", height: "12", x: "4", y: "8", rx: "2" }, { tag: "path", d: "M2 14h2" }, { tag: "path", d: "M20 14h2" }, { tag: "path", d: "M15 13v2" }, { tag: "path", d: "M9 13v2" }] },
|
|
102
|
+
"x": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M18 6 6 18" }, { tag: "path", d: "m6 6 12 12" }] },
|
|
100
103
|
} as const;
|
|
101
104
|
|
|
102
105
|
export type IconName = keyof typeof ICON_REGISTRY;
|
|
@@ -32,6 +32,11 @@ export interface MarketingNavbarProps
|
|
|
32
32
|
brandName?: string;
|
|
33
33
|
/** Optional logo image. When omitted a gradient atom mark is rendered. */
|
|
34
34
|
logoSrc?: string;
|
|
35
|
+
/**
|
|
36
|
+
* When false the brand mark is omitted entirely — no logo image, no gradient
|
|
37
|
+
* atom mark, and no empty logo box. Only the brand name text is rendered.
|
|
38
|
+
*/
|
|
39
|
+
showLogo?: boolean;
|
|
35
40
|
brandHref?: string;
|
|
36
41
|
links?: MarketingNavLink[];
|
|
37
42
|
/** Secondary auth action (e.g. "Log in"). Hidden when null. */
|
|
@@ -78,13 +83,14 @@ const DEFAULT_PRIMARY: MarketingNavAction = { label: "Start free" };
|
|
|
78
83
|
const linkFocus =
|
|
79
84
|
"cursor-pointer transition duration-150 ease-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-blue";
|
|
80
85
|
|
|
81
|
-
const itemClass = `flex w-full items-center gap-sm rounded-sm px-sm py-sm text-left text-body-sm text-ink transition duration-150 ease-out hover:bg-surface-soft active:
|
|
86
|
+
const itemClass = `flex w-full items-center justify-start gap-sm rounded-sm px-sm py-sm text-left text-body-sm text-ink transition duration-150 ease-out hover:bg-surface-soft active:bg-surface-strong ${linkFocus}`;
|
|
82
87
|
|
|
83
88
|
export const MarketingNavbar = React.forwardRef<HTMLElement, MarketingNavbarProps>(
|
|
84
89
|
(
|
|
85
90
|
{
|
|
86
91
|
brandName = "Atoms Design",
|
|
87
92
|
logoSrc,
|
|
93
|
+
showLogo = true,
|
|
88
94
|
brandHref = "/",
|
|
89
95
|
links = DEFAULT_LINKS,
|
|
90
96
|
secondaryAction = DEFAULT_SECONDARY,
|
|
@@ -176,15 +182,15 @@ export const MarketingNavbar = React.forwardRef<HTMLElement, MarketingNavbarProp
|
|
|
176
182
|
|
|
177
183
|
const renderAction = (
|
|
178
184
|
a: MarketingNavAction,
|
|
179
|
-
|
|
185
|
+
actionVariant: "primary" | "ghost",
|
|
180
186
|
full = false,
|
|
181
187
|
) => (
|
|
182
188
|
<Button
|
|
183
|
-
variant={
|
|
189
|
+
variant={actionVariant}
|
|
184
190
|
size="md"
|
|
185
191
|
onClick={() => runAction(a)}
|
|
186
192
|
className={`shrink-0 whitespace-nowrap !rounded-full ${full ? "w-full" : ""} ${
|
|
187
|
-
floating &&
|
|
193
|
+
floating && actionVariant === "ghost" ? "!text-ink" : ""
|
|
188
194
|
}`}
|
|
189
195
|
>
|
|
190
196
|
{a.label}
|
|
@@ -219,22 +225,28 @@ export const MarketingNavbar = React.forwardRef<HTMLElement, MarketingNavbarProp
|
|
|
219
225
|
|
|
220
226
|
const accountRows = (
|
|
221
227
|
<div className="flex flex-col gap-xxs">
|
|
222
|
-
<
|
|
228
|
+
<Button
|
|
223
229
|
type="button"
|
|
230
|
+
variant="bare"
|
|
231
|
+
size="auto"
|
|
232
|
+
pushEffect={false}
|
|
224
233
|
onClick={() => pickAccountAction(account?.onSettings)}
|
|
225
234
|
className={itemClass}
|
|
226
235
|
>
|
|
227
236
|
<Icon name="settings-gear" className="size-4 shrink-0 text-muted" />
|
|
228
|
-
<span className="flex-1 truncate">{settingsLabel}</span>
|
|
229
|
-
</
|
|
230
|
-
<
|
|
237
|
+
<span className="flex-1 truncate font-weight-body-sm">{settingsLabel}</span>
|
|
238
|
+
</Button>
|
|
239
|
+
<Button
|
|
231
240
|
type="button"
|
|
241
|
+
variant="bare"
|
|
242
|
+
size="auto"
|
|
243
|
+
pushEffect={false}
|
|
232
244
|
onClick={() => pickAccountAction(account?.onLogout)}
|
|
233
245
|
className={itemClass}
|
|
234
246
|
>
|
|
235
247
|
<Icon name="logout-sign-out" className="size-4 shrink-0 text-muted" />
|
|
236
|
-
<span className="flex-1 truncate">{logoutLabel}</span>
|
|
237
|
-
</
|
|
248
|
+
<span className="flex-1 truncate font-weight-body-sm">{logoutLabel}</span>
|
|
249
|
+
</Button>
|
|
238
250
|
</div>
|
|
239
251
|
);
|
|
240
252
|
|
|
@@ -285,13 +297,18 @@ export const MarketingNavbar = React.forwardRef<HTMLElement, MarketingNavbarProp
|
|
|
285
297
|
href={brandHref}
|
|
286
298
|
className={`flex shrink-0 items-center gap-sm rounded-sm text-ink no-underline active:scale-[0.98] ${linkFocus}`}
|
|
287
299
|
>
|
|
288
|
-
{
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
300
|
+
{showLogo &&
|
|
301
|
+
(logoSrc ? (
|
|
302
|
+
<img
|
|
303
|
+
src={logoSrc}
|
|
304
|
+
alt=""
|
|
305
|
+
className="h-8 w-8 rounded-sm object-cover"
|
|
306
|
+
/>
|
|
307
|
+
) : (
|
|
308
|
+
<span className="flex h-8 w-8 items-center justify-center rounded-sm bg-linear-to-br from-logo-violet via-logo-pink to-logo-orange text-on-primary">
|
|
309
|
+
<Icon name="atom" size={18} />
|
|
310
|
+
</span>
|
|
311
|
+
))}
|
|
295
312
|
<span
|
|
296
313
|
className={`whitespace-nowrap text-body-md text-ink ${floating ? "font-weight-body-md" : ""}`}
|
|
297
314
|
>
|
|
@@ -321,9 +338,11 @@ export const MarketingNavbar = React.forwardRef<HTMLElement, MarketingNavbarProp
|
|
|
321
338
|
{secondaryAction && renderAction(secondaryAction, "ghost")}
|
|
322
339
|
{primaryAction && renderAction(primaryAction, "primary")}
|
|
323
340
|
{account && (
|
|
324
|
-
<
|
|
341
|
+
<Button
|
|
325
342
|
ref={accountBtnRef}
|
|
326
343
|
type="button"
|
|
344
|
+
variant="bare"
|
|
345
|
+
size="auto"
|
|
327
346
|
aria-expanded={accountOpen}
|
|
328
347
|
aria-controls={accountPanelId}
|
|
329
348
|
aria-label={`Account: ${account.email}`}
|
|
@@ -331,11 +350,11 @@ export const MarketingNavbar = React.forwardRef<HTMLElement, MarketingNavbarProp
|
|
|
331
350
|
setOpen(false);
|
|
332
351
|
setAccountOpen((v) => !v);
|
|
333
352
|
}}
|
|
334
|
-
className={`flex items-center gap-xs rounded-full border border-hairline-soft bg-surface/60 py-xxs pl-xxs pr-xs text-ink transition duration-150 ease-out hover:bg-surface-soft active:scale-[0.98] ${linkFocus}`}
|
|
353
|
+
className={`flex items-center justify-start gap-xs rounded-full border border-hairline-soft bg-surface/60 py-xxs pl-xxs pr-xs text-ink transition duration-150 ease-out hover:bg-surface-soft active:scale-[0.98] ${linkFocus}`}
|
|
335
354
|
>
|
|
336
355
|
{avatar()}
|
|
337
356
|
{showAccountEmail && (
|
|
338
|
-
<span className="hidden min-w-0 max-w-56 truncate whitespace-nowrap text-caption text-body xl:block">
|
|
357
|
+
<span className="hidden min-w-0 max-w-56 truncate whitespace-nowrap text-caption text-body font-weight-body-sm xl:block">
|
|
339
358
|
{account.email}
|
|
340
359
|
</span>
|
|
341
360
|
)}
|
|
@@ -345,12 +364,14 @@ export const MarketingNavbar = React.forwardRef<HTMLElement, MarketingNavbarProp
|
|
|
345
364
|
accountOpen ? "rotate-180" : "rotate-0"
|
|
346
365
|
}`}
|
|
347
366
|
/>
|
|
348
|
-
</
|
|
367
|
+
</Button>
|
|
349
368
|
)}
|
|
350
369
|
</div>
|
|
351
370
|
|
|
352
|
-
<
|
|
371
|
+
<Button
|
|
353
372
|
type="button"
|
|
373
|
+
variant="bare"
|
|
374
|
+
size="auto"
|
|
354
375
|
className={`flex h-10 w-10 shrink-0 items-center justify-center rounded-full text-ink hover:bg-surface-soft active:scale-[0.98] md:hidden ${linkFocus}`}
|
|
355
376
|
aria-label={open ? "Close menu" : "Open menu"}
|
|
356
377
|
aria-expanded={open}
|
|
@@ -361,7 +382,7 @@ export const MarketingNavbar = React.forwardRef<HTMLElement, MarketingNavbarProp
|
|
|
361
382
|
}}
|
|
362
383
|
>
|
|
363
384
|
<Icon name={open ? "close" : "hamburger-menu"} size={20} />
|
|
364
|
-
</
|
|
385
|
+
</Button>
|
|
365
386
|
</div>
|
|
366
387
|
|
|
367
388
|
<div
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { Button } from "../Button";
|
|
2
3
|
import { MarketingNavbar } from "./MarketingNavbar";
|
|
3
4
|
|
|
4
5
|
export default function Preview() {
|
|
@@ -58,13 +59,15 @@ export default function Preview() {
|
|
|
58
59
|
<p className="text-caption text-muted">
|
|
59
60
|
Signed in — avatar button with the email, plus settings and log out
|
|
60
61
|
</p>
|
|
61
|
-
<
|
|
62
|
+
<Button
|
|
62
63
|
type="button"
|
|
64
|
+
variant="bare"
|
|
65
|
+
size="auto"
|
|
63
66
|
onClick={() => setSignedIn((v) => !v)}
|
|
64
|
-
className="
|
|
67
|
+
className="rounded-full border border-hairline px-sm py-xs text-caption text-ink transition duration-150 ease-out hover:bg-surface-soft active:scale-[0.98] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-blue"
|
|
65
68
|
>
|
|
66
69
|
{signedIn ? "Sign out" : "Sign in"}
|
|
67
|
-
</
|
|
70
|
+
</Button>
|
|
68
71
|
</div>
|
|
69
72
|
|
|
70
73
|
<div className="rounded-lg border border-hairline">
|
|
@@ -93,17 +96,38 @@ export default function Preview() {
|
|
|
93
96
|
{account.email}
|
|
94
97
|
</p>
|
|
95
98
|
</div>
|
|
96
|
-
<
|
|
99
|
+
<Button
|
|
97
100
|
type="button"
|
|
101
|
+
variant="bare"
|
|
102
|
+
size="auto"
|
|
98
103
|
onClick={() => setSettingsOpen(false)}
|
|
99
|
-
className="
|
|
104
|
+
className="rounded-full px-sm py-xs text-caption text-muted transition duration-150 ease-out hover:bg-surface-soft active:scale-[0.98] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-blue"
|
|
100
105
|
>
|
|
101
106
|
Close
|
|
102
|
-
</
|
|
107
|
+
</Button>
|
|
103
108
|
</div>
|
|
104
109
|
</div>
|
|
105
110
|
)}
|
|
106
111
|
</section>
|
|
112
|
+
|
|
113
|
+
<section className="space-y-sm">
|
|
114
|
+
<p className="text-caption text-muted">
|
|
115
|
+
Wordmark only — showLogo=false drops the mark entirely, no empty box
|
|
116
|
+
</p>
|
|
117
|
+
<div className="overflow-hidden rounded-lg border border-hairline">
|
|
118
|
+
<MarketingNavbar
|
|
119
|
+
sticky={false}
|
|
120
|
+
showLogo={false}
|
|
121
|
+
account={null}
|
|
122
|
+
links={[
|
|
123
|
+
{ label: "Product", href: "#product" },
|
|
124
|
+
{ label: "Changelog", href: "#changelog" },
|
|
125
|
+
{ label: "Pricing", href: "/pricing" },
|
|
126
|
+
]}
|
|
127
|
+
onLinkClick={(_, e) => e.preventDefault()}
|
|
128
|
+
/>
|
|
129
|
+
</div>
|
|
130
|
+
</section>
|
|
107
131
|
</div>
|
|
108
132
|
);
|
|
109
133
|
}
|