@designa8/vibedesign-v6 1.20.20 → 2.1.1
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/fonts/plusjakartasans/PlusJakartaSans-Italic[wght].ttf +0 -0
- package/dist/fonts/plusjakartasans/PlusJakartaSans[wght].ttf +0 -0
- package/dist/index.cjs +12027 -4942
- package/dist/index.js +12089 -5004
- package/dist/styles.css +1393 -97
- package/package.json +116 -1
- package/src/atoms/AgentQuestionCard/AgentQuestionCard.tsx +567 -0
- package/src/atoms/AgentQuestionCard/index.ts +6 -0
- package/src/atoms/AgentQuestionCard/preview.tsx +199 -0
- package/src/atoms/AppLayout/AppLayout.tsx +85 -22
- package/src/atoms/AppLayout/preview.tsx +4 -0
- package/src/atoms/AppSidebar/AppSidebar.tsx +222 -137
- package/src/atoms/AppSidebar/preview.tsx +61 -8
- package/src/atoms/AppSidebarMobile/AppSidebarMobile.tsx +241 -169
- package/src/atoms/AppSidebarMobile/preview.tsx +59 -89
- package/src/atoms/AuthLogin/AuthLogin.tsx +86 -49
- package/src/atoms/AuthLogin/preview.tsx +16 -0
- package/src/atoms/AuthSignUp/AuthSignUp.tsx +206 -126
- package/src/atoms/AuthSignUp/preview.tsx +10 -0
- package/src/atoms/BottomSheet/BottomSheet.tsx +199 -0
- package/src/atoms/BottomSheet/index.ts +2 -0
- package/src/atoms/BottomSheet/preview.tsx +50 -0
- package/src/atoms/Button/Button.tsx +19 -3
- package/src/atoms/Button/preview.tsx +2 -1
- package/src/atoms/ChatHistorySidebar/ChatHistorySidebar.tsx +160 -84
- package/src/atoms/ChatHistorySidebar/preview.tsx +81 -42
- package/src/atoms/ChatScreen/ChatScreen.tsx +298 -33
- package/src/atoms/ChatScreen/preview.tsx +54 -90
- package/src/atoms/Chip/Chip.tsx +81 -33
- package/src/atoms/Chip/preview.tsx +39 -21
- package/src/atoms/CodeEditor/CodeEditor.tsx +10 -4
- package/src/atoms/ComponentActionsSheet/ComponentActionsSheet.tsx +165 -0
- package/src/atoms/ComponentActionsSheet/index.ts +7 -0
- package/src/atoms/ComponentActionsSheet/preview.tsx +67 -0
- package/src/atoms/ComponentCard/ComponentCard.tsx +17 -35
- package/src/atoms/ComponentCard/preview.tsx +9 -9
- package/src/atoms/DesignSystemLoader/DesignSystemLoader.tsx +153 -0
- package/src/atoms/DesignSystemLoader/index.ts +2 -0
- package/src/atoms/DesignSystemLoader/preview.tsx +19 -0
- package/src/atoms/DesignSystemShowcase/DesignSystemShowcase.tsx +410 -0
- package/src/atoms/DesignSystemShowcase/index.ts +6 -0
- package/src/atoms/DesignSystemShowcase/preview.tsx +22 -0
- package/src/atoms/DesignTokensPanel/DesignTokensPanel.data.ts +254 -0
- package/src/atoms/DesignTokensPanel/DesignTokensPanel.tsx +946 -0
- package/src/atoms/DesignTokensPanel/index.ts +9 -0
- package/src/atoms/DesignTokensPanel/preview.tsx +39 -0
- package/src/atoms/ExpandableMessage/ExpandableMessage.tsx +239 -0
- package/src/atoms/ExpandableMessage/fix-link-note.txt +3 -0
- package/src/atoms/ExpandableMessage/index.ts +2 -0
- package/src/atoms/ExpandableMessage/markdown.tsx +310 -0
- package/src/atoms/ExpandableMessage/preview.tsx +83 -0
- package/src/atoms/FilterTabBar/FilterTabBar.tsx +2 -2
- package/src/atoms/FontCombobox/FontCombobox.tsx +655 -0
- package/src/atoms/FontCombobox/index.ts +6 -0
- package/src/atoms/FontCombobox/preview.tsx +111 -0
- package/src/atoms/HomePageTemplate/HomePageTemplate.tsx +894 -96
- package/src/atoms/HomePageTemplate/preview.tsx +4 -0
- package/src/atoms/Icon/Icon.tsx +17 -11
- package/src/atoms/Icon/icons.data.ts +34 -0
- package/src/atoms/Input/Input.tsx +37 -21
- package/src/atoms/LandingHero/LandingHero.tsx +545 -0
- package/src/atoms/LandingHero/index.ts +6 -0
- package/src/atoms/LandingHero/preview.tsx +88 -0
- package/src/atoms/MarketingFooter/MarketingFooter.tsx +215 -0
- package/src/atoms/MarketingFooter/index.ts +7 -0
- package/src/atoms/MarketingFooter/preview.tsx +28 -0
- package/src/atoms/MarketingNavbar/MarketingNavbar.tsx +451 -0
- package/src/atoms/MarketingNavbar/index.ts +7 -0
- package/src/atoms/MarketingNavbar/preview.tsx +109 -0
- package/src/atoms/MobileActionsDrawer/MobileActionsDrawer.tsx +548 -0
- package/src/atoms/MobileActionsDrawer/index.ts +9 -0
- package/src/atoms/MobileActionsDrawer/preview.tsx +109 -0
- package/src/atoms/Modal/Modal.tsx +77 -28
- package/src/atoms/PreviewDock/PreviewDock.tsx +119 -0
- package/src/atoms/PreviewDock/index.ts +2 -0
- package/src/atoms/PreviewDock/preview.tsx +30 -0
- package/src/atoms/PreviewToolbar/PreviewToolbar.tsx +47 -30
- package/src/atoms/PricingCard/PricingCard.tsx +15 -4
- package/src/atoms/PricingPageTemplate/PricingPageTemplate.tsx +109 -89
- package/src/atoms/ProjectSettingsModal/ProjectSettingsModal.tsx +314 -0
- package/src/atoms/ProjectSettingsModal/index.ts +2 -0
- package/src/atoms/ProjectSettingsModal/preview.tsx +130 -0
- package/src/atoms/ProjectSettingsModal/switch.snippet.txt +8 -0
- package/src/atoms/PromptInputBar/PromptInputBar.tsx +750 -302
- package/src/atoms/PromptInputBar/preview.tsx +64 -64
- package/src/atoms/SettingsPageTemplate/SettingsPageTemplate.tsx +272 -0
- package/src/atoms/SettingsPageTemplate/index.ts +2 -0
- package/src/atoms/SettingsPageTemplate/preview.tsx +29 -0
- package/src/atoms/SidebarUpgradeBanner/SidebarUpgradeBanner.tsx +178 -0
- package/src/atoms/SidebarUpgradeBanner/index.ts +2 -0
- package/src/atoms/SidebarUpgradeBanner/preview.tsx +47 -0
- package/src/atoms/SkeletonChip/SkeletonChip.tsx +198 -0
- package/src/atoms/SkeletonChip/index.ts +2 -0
- package/src/atoms/SkeletonChip/preview.tsx +44 -0
- package/src/atoms/TemplateHeader/TemplateHeader.tsx +129 -0
- package/src/atoms/TemplateHeader/index.ts +2 -0
- package/src/atoms/TemplateHeader/preview.tsx +39 -0
- package/src/atoms/TemplateHero/TemplateHero.tsx +286 -0
- package/src/atoms/TemplateHero/index.ts +2 -0
- package/src/atoms/TemplateHero/preview.tsx +32 -0
- package/src/atoms/TemplateSummary/TemplateSummary.tsx +85 -0
- package/src/atoms/TemplateSummary/index.ts +2 -0
- package/src/atoms/TemplateSummary/preview.tsx +10 -0
- package/src/atoms/Toast/Toast.tsx +178 -0
- package/src/atoms/Toast/index.ts +2 -0
- package/src/atoms/Toast/preview.tsx +100 -0
- package/src/atoms/TopNavbar/TopNavbar.tsx +145 -67
- package/src/atoms/TopNavbar/preview.tsx +13 -7
- package/src/atoms/TopupModal/TopupModal.tsx +94 -0
- package/src/atoms/TopupModal/index.ts +2 -0
- package/src/atoms/TopupModal/preview.tsx +22 -0
- package/src/atoms/UpgradeCard/UpgradeCard.tsx +124 -43
- package/src/atoms/UpgradeCard/index.ts +1 -1
- package/src/atoms/UpgradeCard/preview.tsx +7 -14
- package/src/atoms/UpgradeModal/UpgradeModal.tsx +192 -0
- package/src/atoms/UpgradeModal/index.ts +2 -0
- package/src/atoms/UpgradeModal/preview.tsx +41 -0
- package/src/index.ts +23 -0
- package/src/tokens.css +45 -7
- package/dist/fonts/inter/Inter-Italic[opsz,wght].ttf +0 -0
- package/dist/fonts/inter/Inter[opsz,wght].ttf +0 -0
|
@@ -1,65 +1,146 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { Icon } from "../Icon";
|
|
2
3
|
|
|
3
|
-
export interface
|
|
4
|
-
/**
|
|
5
|
-
|
|
4
|
+
export interface UpgradeCardCredits {
|
|
5
|
+
/** Credits remaining */
|
|
6
|
+
remaining: number;
|
|
7
|
+
/** Total credits in the current period */
|
|
8
|
+
total: number;
|
|
9
|
+
/** Helper line under the meter, e.g. "Resets in 12 days". Overridden by the low / empty helper copy. */
|
|
10
|
+
helper?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface UpgradeCardProps
|
|
14
|
+
extends Omit<React.ComponentPropsWithoutRef<"button">, "title"> {
|
|
6
15
|
/** Bold headline text */
|
|
7
16
|
title?: string;
|
|
8
17
|
/** Muted supporting text beneath the title */
|
|
9
18
|
subtitle?: string;
|
|
19
|
+
/** Icon rendered inside the tinted badge */
|
|
20
|
+
iconName?: string;
|
|
21
|
+
/** When provided, renders the credits-left block under the header row */
|
|
22
|
+
credits?: UpgradeCardCredits;
|
|
23
|
+
/** Fraction of total at or below which the meter switches to the warning recipe. Default 0.1 */
|
|
24
|
+
lowThreshold?: number;
|
|
10
25
|
}
|
|
11
26
|
|
|
12
|
-
|
|
27
|
+
const fmt = new Intl.NumberFormat("en-US");
|
|
28
|
+
|
|
29
|
+
export const UpgradeCard = React.forwardRef<HTMLButtonElement, UpgradeCardProps>(
|
|
13
30
|
(
|
|
14
31
|
{
|
|
15
|
-
eyebrow = "Card – Upgrade",
|
|
16
32
|
title = "Upgrade to Pro",
|
|
17
|
-
subtitle = "Unlock
|
|
33
|
+
subtitle = "Unlock premium features",
|
|
34
|
+
iconName = "crown-lucide-outline-premium-badge",
|
|
35
|
+
credits,
|
|
36
|
+
lowThreshold = 0.1,
|
|
18
37
|
className,
|
|
19
38
|
...rest
|
|
20
39
|
},
|
|
21
40
|
ref,
|
|
22
|
-
) =>
|
|
23
|
-
|
|
24
|
-
ref={ref}
|
|
25
|
-
className={["w-full", className].filter(Boolean).join(" ")}
|
|
26
|
-
{...rest}
|
|
27
|
-
>
|
|
28
|
-
{eyebrow && (
|
|
29
|
-
<p className="text-caption text-muted mb-md">{eyebrow}</p>
|
|
30
|
-
)}
|
|
31
|
-
<div className="rounded-xl bg-surface shadow-card px-md py-sm flex items-center justify-between gap-sm">
|
|
32
|
-
{/* Text block */}
|
|
33
|
-
<div className="flex flex-col gap-xxs min-w-0">
|
|
34
|
-
<span className="text-body-sm font-weight-heading-sm text-ink truncate">
|
|
35
|
-
{title}
|
|
36
|
-
</span>
|
|
37
|
-
<span className="text-caption text-muted truncate">{subtitle}</span>
|
|
38
|
-
</div>
|
|
41
|
+
) => {
|
|
42
|
+
const titleId = React.useId();
|
|
39
43
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
44
|
+
let status: "ok" | "low" | "empty" = "ok";
|
|
45
|
+
let pct = 0;
|
|
46
|
+
if (credits) {
|
|
47
|
+
const total = Math.max(credits.total, 1);
|
|
48
|
+
const remaining = Math.min(Math.max(credits.remaining, 0), total);
|
|
49
|
+
pct = (remaining / total) * 100;
|
|
50
|
+
status = remaining === 0 ? "empty" : remaining / total <= lowThreshold ? "low" : "ok";
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const accentText =
|
|
54
|
+
status === "empty"
|
|
55
|
+
? "text-semantic-error"
|
|
56
|
+
: status === "low"
|
|
57
|
+
? "text-semantic-warning-accent"
|
|
58
|
+
: "text-primary";
|
|
59
|
+
const fillBg =
|
|
60
|
+
status === "empty"
|
|
61
|
+
? "bg-semantic-error"
|
|
62
|
+
: status === "low"
|
|
63
|
+
? "bg-semantic-warning-accent"
|
|
64
|
+
: "bg-primary";
|
|
65
|
+
const trackBg = status === "empty" ? "bg-semantic-error-soft" : "bg-surface-strong";
|
|
66
|
+
const label =
|
|
67
|
+
status === "empty" ? "Out of credits" : status === "low" ? "Credits running low" : "Credits left";
|
|
68
|
+
const helper =
|
|
69
|
+
status === "ok" ? credits?.helper : "Upgrade to keep building";
|
|
70
|
+
|
|
71
|
+
return (
|
|
72
|
+
<button
|
|
73
|
+
ref={ref}
|
|
74
|
+
type="button"
|
|
75
|
+
aria-labelledby={titleId}
|
|
76
|
+
className={[
|
|
77
|
+
"group flex w-full cursor-pointer flex-col rounded-xl border border-hairline bg-surface p-sm text-left shadow-card",
|
|
78
|
+
"transition duration-150 ease-out hover:bg-surface-soft active:scale-[0.98]",
|
|
79
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-blue",
|
|
80
|
+
"disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-surface",
|
|
81
|
+
className,
|
|
82
|
+
]
|
|
83
|
+
.filter(Boolean)
|
|
84
|
+
.join(" ")}
|
|
85
|
+
{...rest}
|
|
86
|
+
>
|
|
87
|
+
{/* Header row */}
|
|
88
|
+
<span className="flex w-full items-center gap-sm">
|
|
89
|
+
<span
|
|
54
90
|
aria-hidden="true"
|
|
55
|
-
|
|
91
|
+
className="flex size-9 shrink-0 items-center justify-center rounded-full bg-primary-soft"
|
|
56
92
|
>
|
|
57
|
-
<
|
|
58
|
-
</
|
|
93
|
+
<Icon name={iconName} className="size-5 text-primary" aria-hidden="true" />
|
|
94
|
+
</span>
|
|
95
|
+
<span className="flex min-w-0 flex-1 flex-col">
|
|
96
|
+
<span id={titleId} className="truncate text-body-sm text-ink">
|
|
97
|
+
{title}
|
|
98
|
+
</span>
|
|
99
|
+
<span className="truncate text-caption text-muted">{subtitle}</span>
|
|
100
|
+
</span>
|
|
101
|
+
<Icon
|
|
102
|
+
name="chevron-right"
|
|
103
|
+
aria-hidden="true"
|
|
104
|
+
className="size-4 shrink-0 text-muted transition duration-150 ease-out group-hover:translate-x-0.5 group-hover:text-ink"
|
|
105
|
+
/>
|
|
59
106
|
</span>
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
107
|
+
|
|
108
|
+
{/* Credits block — meter first, then the status + count row, then the helper line */}
|
|
109
|
+
{credits && (
|
|
110
|
+
<span className="mt-base flex w-full flex-col border-t border-hairline-soft pt-base">
|
|
111
|
+
<span
|
|
112
|
+
role="progressbar"
|
|
113
|
+
aria-label="Credits left"
|
|
114
|
+
aria-valuemin={0}
|
|
115
|
+
aria-valuemax={credits.total}
|
|
116
|
+
aria-valuenow={Math.max(credits.remaining, 0)}
|
|
117
|
+
className={`block h-sm w-full overflow-hidden rounded-full ${trackBg}`}
|
|
118
|
+
>
|
|
119
|
+
<span
|
|
120
|
+
className={`block h-full rounded-full transition-[width] duration-300 ease-out ${fillBg}`}
|
|
121
|
+
style={{ width: `${pct}%` }}
|
|
122
|
+
/>
|
|
123
|
+
</span>
|
|
124
|
+
|
|
125
|
+
<span className="mt-sm flex items-center justify-between gap-sm">
|
|
126
|
+
<span className="flex items-center gap-sm">
|
|
127
|
+
<Icon name="sparkle" aria-hidden="true" className={`size-4 ${accentText}`} />
|
|
128
|
+
<span className="text-caption text-muted">{label}</span>
|
|
129
|
+
</span>
|
|
130
|
+
<span className="tabular-nums text-caption">
|
|
131
|
+
<span className={status === "ok" ? "text-ink" : accentText}>
|
|
132
|
+
{fmt.format(Math.max(credits.remaining, 0))}
|
|
133
|
+
</span>
|
|
134
|
+
<span className="text-muted"> / {fmt.format(credits.total)}</span>
|
|
135
|
+
</span>
|
|
136
|
+
</span>
|
|
137
|
+
|
|
138
|
+
{helper && <span className="mt-sm text-body-sm text-muted">{helper}</span>}
|
|
139
|
+
</span>
|
|
140
|
+
)}
|
|
141
|
+
</button>
|
|
142
|
+
);
|
|
143
|
+
},
|
|
63
144
|
);
|
|
64
145
|
|
|
65
146
|
UpgradeCard.displayName = "UpgradeCard";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { UpgradeCard } from "./UpgradeCard";
|
|
2
|
-
export type { UpgradeCardProps } from "./UpgradeCard";
|
|
2
|
+
export type { UpgradeCardProps, UpgradeCardCredits } from "./UpgradeCard";
|
|
@@ -2,24 +2,17 @@ import React from "react";
|
|
|
2
2
|
import { UpgradeCard } from "./UpgradeCard";
|
|
3
3
|
|
|
4
4
|
export default function UpgradeCardPreview() {
|
|
5
|
+
// Clicking the first card spends 80 credits so you can watch it go low, then empty, then reset.
|
|
6
|
+
const [remaining, setRemaining] = React.useState(320);
|
|
7
|
+
|
|
5
8
|
return (
|
|
6
9
|
<div className="w-full max-w-3xl mx-auto p-lg space-y-lg">
|
|
7
|
-
{/* Default — matches the reference */}
|
|
8
|
-
<UpgradeCard />
|
|
9
|
-
|
|
10
|
-
{/* Custom copy variant */}
|
|
11
10
|
<UpgradeCard
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
subtitle="Collaborate with up to 10 members"
|
|
15
|
-
/>
|
|
16
|
-
|
|
17
|
-
{/* No eyebrow variant */}
|
|
18
|
-
<UpgradeCard
|
|
19
|
-
eyebrow={undefined}
|
|
20
|
-
title="Go unlimited"
|
|
21
|
-
subtitle="Remove all usage limits"
|
|
11
|
+
credits={{ remaining, total: 1000, helper: "Resets in 12 days" }}
|
|
12
|
+
onClick={() => setRemaining((r) => (r <= 0 ? 320 : Math.max(r - 80, 0)))}
|
|
22
13
|
/>
|
|
14
|
+
<UpgradeCard credits={{ remaining: 40, total: 1000 }} />
|
|
15
|
+
<UpgradeCard />
|
|
23
16
|
</div>
|
|
24
17
|
);
|
|
25
18
|
}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Modal } from "../Modal";
|
|
3
|
+
import { PricingCard } from "../PricingCard";
|
|
4
|
+
import { Typography } from "../Typography";
|
|
5
|
+
|
|
6
|
+
export type UpgradeModalReason =
|
|
7
|
+
| "publish"
|
|
8
|
+
| "chat"
|
|
9
|
+
| "versions"
|
|
10
|
+
| "credits"
|
|
11
|
+
| "generic";
|
|
12
|
+
|
|
13
|
+
export interface UpgradeModalPlan {
|
|
14
|
+
id: string;
|
|
15
|
+
planName: string;
|
|
16
|
+
description: string;
|
|
17
|
+
/** Single monthly price string, e.g. "$29". */
|
|
18
|
+
price: string;
|
|
19
|
+
priceUnit?: string;
|
|
20
|
+
priceNote?: string;
|
|
21
|
+
features: string[];
|
|
22
|
+
ctaLabel: string;
|
|
23
|
+
ctaCaption?: string;
|
|
24
|
+
highlighted?: boolean;
|
|
25
|
+
/** When true, the card uses the disabled treatment and never calls onSelectPlan. */
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
/** Custom badge label for a highlighted plan. When omitted, PricingCard's default badge is used. */
|
|
28
|
+
highlightLabel?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface UpgradeModalProps {
|
|
32
|
+
/** Controls whether the modal is visible */
|
|
33
|
+
isOpen: boolean;
|
|
34
|
+
/** Called when the user clicks the backdrop or the close button */
|
|
35
|
+
onClose: () => void;
|
|
36
|
+
/** What triggered the upgrade prompt — drives the default title/subtitle */
|
|
37
|
+
reason?: UpgradeModalReason;
|
|
38
|
+
/** Overrides the reason-based default title */
|
|
39
|
+
title?: string;
|
|
40
|
+
/** Overrides the reason-based default subtitle */
|
|
41
|
+
subtitle?: string;
|
|
42
|
+
/** Plans to render — defaults to the standard Free / Starter / Pro / Studio lineup */
|
|
43
|
+
plans?: UpgradeModalPlan[];
|
|
44
|
+
/** Called with the plan id when a card's CTA is clicked (never for disabled plans) */
|
|
45
|
+
onSelectPlan?: (planId: string) => void;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const PAID_FEATURES: string[] = [
|
|
49
|
+
"npm package with managed versioning",
|
|
50
|
+
"DESIGN.md with agent-to-agent component requests, component fixes, and token updates",
|
|
51
|
+
"Chat-driven building and editing of the design system",
|
|
52
|
+
"suggest_design visual proposals from a stronger model",
|
|
53
|
+
];
|
|
54
|
+
|
|
55
|
+
const DEFAULT_PLANS: UpgradeModalPlan[] = [
|
|
56
|
+
{
|
|
57
|
+
id: "free",
|
|
58
|
+
planName: "Free",
|
|
59
|
+
description: "For trying things out",
|
|
60
|
+
price: "$0",
|
|
61
|
+
priceUnit: "/ month",
|
|
62
|
+
priceNote: "500 credits / month",
|
|
63
|
+
features: [
|
|
64
|
+
"500 credits every month",
|
|
65
|
+
"Haiku 4.5 only",
|
|
66
|
+
"Build and edit components in chat",
|
|
67
|
+
],
|
|
68
|
+
ctaLabel: "Get started",
|
|
69
|
+
ctaCaption: "No credit card required",
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
id: "starter",
|
|
73
|
+
planName: "Starter",
|
|
74
|
+
description: "Enough credits to edit a design system you already have.",
|
|
75
|
+
price: "$9",
|
|
76
|
+
priceUnit: "/ month",
|
|
77
|
+
priceNote: "900 credits / month",
|
|
78
|
+
features: PAID_FEATURES,
|
|
79
|
+
ctaLabel: "Start Starter",
|
|
80
|
+
ctaCaption: "Cancel anytime",
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
id: "pro",
|
|
84
|
+
planName: "Pro",
|
|
85
|
+
description: "Headroom for new components and visual proposals.",
|
|
86
|
+
price: "$19",
|
|
87
|
+
priceUnit: "/ month",
|
|
88
|
+
priceNote: "1,900 credits / month",
|
|
89
|
+
features: PAID_FEATURES,
|
|
90
|
+
ctaLabel: "Start Pro",
|
|
91
|
+
ctaCaption: "Cancel anytime",
|
|
92
|
+
highlighted: true,
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
id: "studio",
|
|
96
|
+
planName: "Studio",
|
|
97
|
+
description: "For teams iterating on several kits.",
|
|
98
|
+
price: "$49",
|
|
99
|
+
priceUnit: "/ month",
|
|
100
|
+
priceNote: "4,900 credits / month",
|
|
101
|
+
features: PAID_FEATURES,
|
|
102
|
+
ctaLabel: "Start Studio",
|
|
103
|
+
ctaCaption: "Cancel anytime",
|
|
104
|
+
},
|
|
105
|
+
];
|
|
106
|
+
|
|
107
|
+
const REASON_COPY: Record<UpgradeModalReason, { title: string; subtitle: string }> = {
|
|
108
|
+
publish: {
|
|
109
|
+
title: "Publish on a paid plan",
|
|
110
|
+
subtitle:
|
|
111
|
+
"Publishing a versioned npm package requires an active subscription. Pick a plan below to publish and keep every future update in sync.",
|
|
112
|
+
},
|
|
113
|
+
chat: {
|
|
114
|
+
title: "Keep building with more credits",
|
|
115
|
+
subtitle:
|
|
116
|
+
"You're out of credits for chat-driven building. Upgrade to a paid plan for more monthly credits and access to a stronger model.",
|
|
117
|
+
},
|
|
118
|
+
versions: {
|
|
119
|
+
title: "Version history is on a paid plan",
|
|
120
|
+
subtitle:
|
|
121
|
+
"Tracking and restoring past component versions requires an active subscription. Pick a plan below to unlock full version history.",
|
|
122
|
+
},
|
|
123
|
+
credits: {
|
|
124
|
+
title: "You are out of credits",
|
|
125
|
+
subtitle:
|
|
126
|
+
"You've used all of your credits for this billing cycle. Upgrade to a paid plan for more monthly credits and no interruptions.",
|
|
127
|
+
},
|
|
128
|
+
generic: {
|
|
129
|
+
title: "Upgrade your plan",
|
|
130
|
+
subtitle: "Pick a plan below to unlock more credits and the full feature set.",
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
export const UpgradeModal = React.forwardRef<HTMLDivElement, UpgradeModalProps>(
|
|
135
|
+
(
|
|
136
|
+
{
|
|
137
|
+
isOpen,
|
|
138
|
+
onClose,
|
|
139
|
+
reason = "generic",
|
|
140
|
+
title,
|
|
141
|
+
subtitle,
|
|
142
|
+
plans = DEFAULT_PLANS,
|
|
143
|
+
onSelectPlan,
|
|
144
|
+
},
|
|
145
|
+
ref,
|
|
146
|
+
) => {
|
|
147
|
+
const copy = REASON_COPY[reason] ?? REASON_COPY.generic;
|
|
148
|
+
const resolvedTitle = title ?? copy.title;
|
|
149
|
+
const resolvedSubtitle = subtitle ?? copy.subtitle;
|
|
150
|
+
const gridClassName =
|
|
151
|
+
plans.length === 3
|
|
152
|
+
? "grid w-full grid-cols-1 sm:grid-cols-3 items-stretch gap-lg"
|
|
153
|
+
: "grid w-full grid-cols-1 sm:grid-cols-4 items-stretch gap-lg";
|
|
154
|
+
|
|
155
|
+
return (
|
|
156
|
+
<Modal ref={ref} isOpen={isOpen} onClose={onClose} title={resolvedTitle} size="2xl">
|
|
157
|
+
<div
|
|
158
|
+
data-state={isOpen ? "open" : "closed"}
|
|
159
|
+
className="flex w-full flex-col gap-lg rounded-lg transition duration-200 ease-out data-[state=open]:translate-y-0 data-[state=open]:opacity-100 data-[state=closed]:translate-y-2 data-[state=closed]:opacity-0"
|
|
160
|
+
>
|
|
161
|
+
<Typography role="body-md" color="muted">
|
|
162
|
+
{resolvedSubtitle}
|
|
163
|
+
</Typography>
|
|
164
|
+
|
|
165
|
+
<div className={gridClassName}>
|
|
166
|
+
{plans.map((plan) => (
|
|
167
|
+
<PricingCard
|
|
168
|
+
key={plan.id}
|
|
169
|
+
planName={plan.planName}
|
|
170
|
+
description={plan.description}
|
|
171
|
+
price={plan.price}
|
|
172
|
+
priceUnit={plan.priceUnit}
|
|
173
|
+
priceNote={plan.priceNote}
|
|
174
|
+
features={plan.features}
|
|
175
|
+
ctaLabel={plan.ctaLabel}
|
|
176
|
+
ctaCaption={plan.ctaCaption}
|
|
177
|
+
highlighted={plan.highlighted}
|
|
178
|
+
highlightLabel={plan.highlightLabel}
|
|
179
|
+
disabled={plan.disabled}
|
|
180
|
+
onCtaClick={
|
|
181
|
+
plan.disabled ? undefined : () => onSelectPlan?.(plan.id)
|
|
182
|
+
}
|
|
183
|
+
/>
|
|
184
|
+
))}
|
|
185
|
+
</div>
|
|
186
|
+
</div>
|
|
187
|
+
</Modal>
|
|
188
|
+
);
|
|
189
|
+
},
|
|
190
|
+
);
|
|
191
|
+
|
|
192
|
+
UpgradeModal.displayName = "UpgradeModal";
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { UpgradeModal, type UpgradeModalReason } from "./UpgradeModal";
|
|
3
|
+
import { Button } from "../Button";
|
|
4
|
+
|
|
5
|
+
const REASONS: UpgradeModalReason[] = ["publish", "chat", "versions", "credits", "generic"];
|
|
6
|
+
|
|
7
|
+
export default function UpgradeModalPreview() {
|
|
8
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
9
|
+
const [reason, setReason] = useState<UpgradeModalReason>("publish");
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<div className="w-full max-w-3xl mx-auto p-lg space-y-md">
|
|
13
|
+
<div className="flex flex-wrap items-center gap-sm">
|
|
14
|
+
{REASONS.map((r) => (
|
|
15
|
+
<Button
|
|
16
|
+
key={r}
|
|
17
|
+
size="sm"
|
|
18
|
+
variant={reason === r ? "primary" : "secondary"}
|
|
19
|
+
onClick={() => {
|
|
20
|
+
setReason(r);
|
|
21
|
+
setIsOpen(true);
|
|
22
|
+
}}
|
|
23
|
+
>
|
|
24
|
+
{r}
|
|
25
|
+
</Button>
|
|
26
|
+
))}
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<UpgradeModal
|
|
30
|
+
isOpen={isOpen}
|
|
31
|
+
onClose={() => setIsOpen(false)}
|
|
32
|
+
reason={reason}
|
|
33
|
+
onSelectPlan={(planId) => {
|
|
34
|
+
// eslint-disable-next-line no-console
|
|
35
|
+
console.log("selected plan", planId);
|
|
36
|
+
setIsOpen(false);
|
|
37
|
+
}}
|
|
38
|
+
/>
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import "../dist/styles.css";
|
|
2
2
|
|
|
3
|
+
export * from "./atoms/AgentQuestionCard";
|
|
3
4
|
export * from "./atoms/AppLayout";
|
|
4
5
|
export * from "./atoms/AppSidebar";
|
|
5
6
|
export * from "./atoms/AppSidebarMobile";
|
|
@@ -7,30 +8,52 @@ export * from "./atoms/AuthLogin";
|
|
|
7
8
|
export * from "./atoms/AuthScreen";
|
|
8
9
|
export * from "./atoms/AuthSignUp";
|
|
9
10
|
export * from "./atoms/BillingToggle";
|
|
11
|
+
export * from "./atoms/BottomSheet";
|
|
10
12
|
export * from "./atoms/Button";
|
|
11
13
|
export * from "./atoms/ChatHistorySidebar";
|
|
12
14
|
export * from "./atoms/ChatScreen";
|
|
13
15
|
export * from "./atoms/Checkbox";
|
|
14
16
|
export * from "./atoms/Chip";
|
|
15
17
|
export * from "./atoms/CodeEditor";
|
|
18
|
+
export * from "./atoms/ComponentActionsSheet";
|
|
16
19
|
export * from "./atoms/ComponentCard";
|
|
20
|
+
export * from "./atoms/DesignSystemLoader";
|
|
21
|
+
export * from "./atoms/DesignSystemShowcase";
|
|
22
|
+
export * from "./atoms/DesignTokensPanel";
|
|
17
23
|
export * from "./atoms/Dropdown";
|
|
24
|
+
export * from "./atoms/ExpandableMessage";
|
|
18
25
|
export * from "./atoms/ExportDesignMdModal";
|
|
19
26
|
export * from "./atoms/FaqAccordionItem";
|
|
20
27
|
export * from "./atoms/FilterTabBar";
|
|
28
|
+
export * from "./atoms/FontCombobox";
|
|
21
29
|
export * from "./atoms/HomePageTemplate";
|
|
22
30
|
export * from "./atoms/Icon";
|
|
23
31
|
export * from "./atoms/Input";
|
|
32
|
+
export * from "./atoms/LandingHero";
|
|
33
|
+
export * from "./atoms/MarketingFooter";
|
|
34
|
+
export * from "./atoms/MarketingNavbar";
|
|
24
35
|
export * from "./atoms/Menu";
|
|
36
|
+
export * from "./atoms/MobileActionsDrawer";
|
|
25
37
|
export * from "./atoms/Modal";
|
|
26
38
|
export * from "./atoms/NavItem";
|
|
39
|
+
export * from "./atoms/PreviewDock";
|
|
27
40
|
export * from "./atoms/PreviewToolbar";
|
|
28
41
|
export * from "./atoms/PricingCard";
|
|
29
42
|
export * from "./atoms/PricingPageTemplate";
|
|
43
|
+
export * from "./atoms/ProjectSettingsModal";
|
|
30
44
|
export * from "./atoms/PromptInputBar";
|
|
31
45
|
export * from "./atoms/PublishModal";
|
|
46
|
+
export * from "./atoms/SettingsPageTemplate";
|
|
47
|
+
export * from "./atoms/SidebarUpgradeBanner";
|
|
48
|
+
export * from "./atoms/SkeletonChip";
|
|
32
49
|
export * from "./atoms/StatusBar";
|
|
50
|
+
export * from "./atoms/TemplateHeader";
|
|
51
|
+
export * from "./atoms/TemplateHero";
|
|
52
|
+
export * from "./atoms/TemplateSummary";
|
|
53
|
+
export * from "./atoms/Toast";
|
|
33
54
|
export * from "./atoms/TopNavbar";
|
|
55
|
+
export * from "./atoms/TopupModal";
|
|
34
56
|
export * from "./atoms/Typography";
|
|
35
57
|
export * from "./atoms/UpgradeCard";
|
|
58
|
+
export * from "./atoms/UpgradeModal";
|
|
36
59
|
export * from "./atoms/WorkspaceMenu";
|
package/src/tokens.css
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
@custom-variant dark (&:where([data-theme="dark"], [data-theme="dark"] *));
|
|
4
4
|
|
|
5
5
|
@theme {
|
|
6
|
-
--color-primary: #
|
|
6
|
+
--color-primary: #0A0A0A;
|
|
7
7
|
--color-on-primary: #FFFFFF;
|
|
8
|
-
--color-primary-hover: #
|
|
9
|
-
--color-primary-active: #
|
|
8
|
+
--color-primary-hover: #2E2E2E;
|
|
9
|
+
--color-primary-active: #1F1F1F;
|
|
10
10
|
--color-primary-disabled: #B8B4EC;
|
|
11
11
|
--color-primary-focus: #6B63D6;
|
|
12
12
|
--color-canvas: #FFFFFF;
|
|
@@ -58,7 +58,25 @@
|
|
|
58
58
|
--color-syntax-tag: #800000;
|
|
59
59
|
--color-syntax-property: #001080;
|
|
60
60
|
--color-primary-soft: #EAE8FB;
|
|
61
|
-
--
|
|
61
|
+
--color-contrast-dark: #1A1A2E;
|
|
62
|
+
--color-contrast-light: #FFFFFF;
|
|
63
|
+
--color-focus-blue: var(--color-primary);
|
|
64
|
+
--color-demo-warm-accent: #D9774A;
|
|
65
|
+
--color-demo-warm-soft: #F3E9DC;
|
|
66
|
+
--color-demo-warm-ink: #2B2622;
|
|
67
|
+
--color-demo-warm-canvas: #FFFBF6;
|
|
68
|
+
--color-demo-bold-accent: #8B7CF6;
|
|
69
|
+
--color-demo-bold-soft: #2A2650;
|
|
70
|
+
--color-demo-bold-ink: #F5F5FA;
|
|
71
|
+
--color-demo-bold-canvas: #14141F;
|
|
72
|
+
--color-demo-pastel-accent: #EC6FA6;
|
|
73
|
+
--color-demo-pastel-soft: #FBE3F0;
|
|
74
|
+
--color-demo-pastel-ink: #3D2B4A;
|
|
75
|
+
--color-demo-pastel-canvas: #FFF6FB;
|
|
76
|
+
--color-primary-text: #5A52C8;
|
|
77
|
+
--color-semantic-success-accent: #0D9488;
|
|
78
|
+
--color-semantic-warning-accent: #F97316;
|
|
79
|
+
--font-body: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
|
|
62
80
|
--font-heading: var(--font-body);
|
|
63
81
|
--font-display-lg: var(--font-body);
|
|
64
82
|
--text-display-lg: 48px;
|
|
@@ -102,8 +120,8 @@
|
|
|
102
120
|
--text-body-lg--letter-spacing: 0;
|
|
103
121
|
--font-body-md: var(--font-body);
|
|
104
122
|
--text-body-md: 16px;
|
|
105
|
-
--font-weight-body-md:
|
|
106
|
-
--text-body-md--font-weight:
|
|
123
|
+
--font-weight-body-md: 500;
|
|
124
|
+
--text-body-md--font-weight: 500;
|
|
107
125
|
--leading-body-md: 1.5;
|
|
108
126
|
--text-body-md--line-height: 1.5;
|
|
109
127
|
--tracking-body-md: 0;
|
|
@@ -124,6 +142,14 @@
|
|
|
124
142
|
--text-caption--line-height: 1.4;
|
|
125
143
|
--tracking-caption: 0;
|
|
126
144
|
--text-caption--letter-spacing: 0;
|
|
145
|
+
--font-display-xl: var(--font-body);
|
|
146
|
+
--text-display-xl: 56px;
|
|
147
|
+
--font-weight-display-xl: 700;
|
|
148
|
+
--text-display-xl--font-weight: 700;
|
|
149
|
+
--leading-display-xl: 1.08;
|
|
150
|
+
--text-display-xl--line-height: 1.08;
|
|
151
|
+
--tracking-display-xl: -1px;
|
|
152
|
+
--text-display-xl--letter-spacing: -1px;
|
|
127
153
|
--radius-none: 0px;
|
|
128
154
|
--radius-xs: 4px;
|
|
129
155
|
--radius-sm: 8px;
|
|
@@ -150,6 +176,11 @@
|
|
|
150
176
|
--opacity-disabled: 0.45;
|
|
151
177
|
--opacity-overlay: 0.6;
|
|
152
178
|
--opacity-ghost: 0.08;
|
|
179
|
+
--z-dropdown: 1000;
|
|
180
|
+
--z-sticky: 1100;
|
|
181
|
+
--z-modal: 1200;
|
|
182
|
+
--z-toast: 1300;
|
|
183
|
+
--z-tooltip: 1400;
|
|
153
184
|
--grid-columns: 12;
|
|
154
185
|
}
|
|
155
186
|
|
|
@@ -186,7 +217,7 @@
|
|
|
186
217
|
--color-hairline: #2E2E3D;
|
|
187
218
|
--color-hairline-soft: #242432;
|
|
188
219
|
--color-hairline-strong: #3C3C50;
|
|
189
|
-
--color-primary-disabled: #
|
|
220
|
+
--color-primary-disabled: #57576B;
|
|
190
221
|
--color-semantic-success-soft: #123321;
|
|
191
222
|
--color-semantic-warning-soft: #3A2A0A;
|
|
192
223
|
--color-semantic-error-soft: #3A1414;
|
|
@@ -200,4 +231,11 @@
|
|
|
200
231
|
--color-syntax-tag: #569CD6;
|
|
201
232
|
--color-syntax-property: #9CDCFE;
|
|
202
233
|
--color-primary-soft: #2A2650;
|
|
234
|
+
--color-primary-text: #9B8FF8;
|
|
235
|
+
--color-semantic-success-accent: #2DD4BF;
|
|
236
|
+
--color-primary: #F2F2F8;
|
|
237
|
+
--color-on-primary: #0B0B12;
|
|
238
|
+
--color-primary-hover: #FFFFFF;
|
|
239
|
+
--color-primary-active: #D8D8E6;
|
|
240
|
+
--color-primary-focus: #9B8FF8;
|
|
203
241
|
}
|
|
Binary file
|
|
Binary file
|