The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
finalize onboarding plans, reuse components
Steven Tey6d9546fde712
diff --git a/apps/web/app/app.dub.co/(onboarding)/onboarding/(steps)/plan/page.tsx b/apps/web/app/app.dub.co/(onboarding)/onboarding/(steps)/plan/page.tsxindex e8552efa79..97173bee07 100644--- a/apps/web/app/app.dub.co/(onboarding)/onboarding/(steps)/plan/page.tsx+++ b/apps/web/app/app.dub.co/(onboarding)/onboarding/(steps)/plan/page.tsx@@ -10,17 +10,27 @@ export default function Plan() {className="max-w-screen-lg"><PlanSelector />- <div className="mx-auto mt-8 flex w-fit justify-center gap-4">+ <div className="mx-auto mt-8 flex w-fit flex-col items-center justify-center gap-6 text-sm md:flex-row"><ahref="https://dub.co/enterprise"target="_blank"- className="btext-center text-sm text-neutral-500 transition-colors hover:text-neutral-700"+ className="flex items-center text-gray-500 underline-offset-4 transition-colors hover:text-gray-800 hover:underline">- Looking for enterprise?+ Looking for enterprise? ↗</a>- <LaterButton next="finish">+ <LaterButton+ next="finish"+ className="underline-offset-4 hover:underline"+ >Start for free, pick a plan later</LaterButton>+ <a+ href="https://dub.co/pricing"+ target="_blank"+ className="flex items-center text-gray-500 underline-offset-4 transition-colors hover:text-gray-800 hover:underline"+ >+ Compare all plans ↗+ </a></div></StepPage>);diff --git a/apps/web/app/app.dub.co/(onboarding)/onboarding/(steps)/plan/plan-selector.tsx b/apps/web/app/app.dub.co/(onboarding)/onboarding/(steps)/plan/plan-selector.tsxindex ca526fa4fd..598f98ab9f 100644--- a/apps/web/app/app.dub.co/(onboarding)/onboarding/(steps)/plan/plan-selector.tsx+++ b/apps/web/app/app.dub.co/(onboarding)/onboarding/(steps)/plan/plan-selector.tsx@@ -70,7 +70,7 @@ function PlanCard({<div className="flex flex-col rounded-lg border border-neutral-200 bg-white p-6"><div className="flex items-center gap-2"><h2 className="text-lg font-medium text-neutral-900">{name}</h2>- {name === "Pro" && <Badge variant="blue">Most popular</Badge>}+ {name === "Business" && <Badge variant="blue">Most popular</Badge>}</div><div className="mt-2 text-3xl font-medium text-neutral-900"><NumberFlowdiff --git a/apps/web/ui/workspaces/plan-features.tsx b/apps/web/ui/workspaces/plan-features.tsxindex 9e4af789c2..22b81cbe44 100644--- a/apps/web/ui/workspaces/plan-features.tsx+++ b/apps/web/ui/workspaces/plan-features.tsx@@ -1,7 +1,12 @@-import { SimpleTooltipContent, Tooltip } from "@dub/ui";+import {+ AdvancedLinkFeaturesTooltip,+ Check,+ PLAN_FEATURE_ICONS,+ SimpleTooltipContent,+ Tooltip,+} from "@dub/ui";import { cn, SELF_SERVE_PAID_PLANS, STAGGER_CHILD_VARIANTS } from "@dub/utils";import { motion } from "framer-motion";-import { CheckCircleFill } from "../shared/icons";export function PlanFeatures({plan,@@ -37,33 +42,42 @@ export function PlanFeatures({{selectedPlan.featureTitle}</motion.div>)}- {selectedPlan.features.map(({ text, footnote }, i) => (- <motion.div- key={i}- variants={STAGGER_CHILD_VARIANTS}- className="flex items-center space-x-2 text-sm text-neutral-500"- >- <CheckCircleFill className="h-5 w-5 text-green-500" />+ {selectedPlan.features?.map(({ id, text, tooltip }, i) => {+ const Icon =+ id && PLAN_FEATURE_ICONS[id] ? PLAN_FEATURE_ICONS[id] : Check;- {footnote ? (- <Tooltip- content={- typeof footnote === "string" ? (- footnote- ) : (- <SimpleTooltipContent {...footnote} />- )- }- >- <p className="cursor-help text-neutral-600 underline decoration-dotted underline-offset-2">- {text}- </p>- </Tooltip>- ) : (- <p className="text-neutral-600">{text}</p>- )}- </motion.div>- ))}+ return (+ <motion.div+ key={i}+ variants={STAGGER_CHILD_VARIANTS}+ className="flex items-center space-x-2 text-sm text-neutral-500"+ >+ <Icon className="size-4" />++ {tooltip ? (+ <Tooltip+ content={+ typeof tooltip === "string" ? (+ tooltip === "ADVANCED_LINK_FEATURES" ? (+ <AdvancedLinkFeaturesTooltip />+ ) : (+ tooltip+ )+ ) : (+ <SimpleTooltipContent {...tooltip} />+ )+ }+ >+ <p className="cursor-help text-neutral-600 underline decoration-dotted underline-offset-2">+ {text}+ </p>+ </Tooltip>+ ) : (+ <p className="text-neutral-600">{text}</p>+ )}+ </motion.div>+ );+ })}</motion.div>);}diff --git a/packages/ui/package.json b/packages/ui/package.jsonindex 297eeb6379..8f851ada8c 100644--- a/packages/ui/package.json+++ b/packages/ui/package.json@@ -1,7 +1,7 @@{"name": "@dub/ui","description": "UI components for Dub.co",- "version": "0.2.26",+ "version": "0.2.27","sideEffects": false,"main": "./dist/index.js","module": "./dist/index.mjs",diff --git a/packages/ui/src/icons/index.tsx b/packages/ui/src/icons/index.tsxindex 6b8e35aee1..cf6e526a3e 100644--- a/packages/ui/src/icons/index.tsx+++ b/packages/ui/src/icons/index.tsx@@ -66,4 +66,7 @@ export * from "./payout-platforms";// Nucleo iconsexport * from "./nucleo";+// Feature icons for pricing table+export * from "./plan-feature-icons";+export type Icon = LucideIcon | ComponentType<SVGProps<SVGSVGElement>>;diff --git a/packages/ui/src/icons/plan-feature-icons.tsx b/packages/ui/src/icons/plan-feature-icons.tsxnew file mode 100644index 0000000000..055fcd7071--- /dev/null+++ b/packages/ui/src/icons/plan-feature-icons.tsx@@ -0,0 +1,57 @@+import {+ Bolt,+ Calendar6,+ ChartLine,+ ConnectedDots4,+ CreditCard,+ CursorRays,+ Flask,+ Folder,+ Gear3,+ Gift,+ Globe,+ Hyperlink,+ InvoiceDollar,+ License,+ MarketingTarget,+ PaperPlane,+ PercentageArrowDown,+ ShieldKeyhole,+ Sparkle3,+ SquareLayoutGrid5,+ UserCrown,+ Users2,+ UsersSettings,+ Versions2,+ Webhook,+} from "./nucleo";+import { Slack } from "./slack";++export const PLAN_FEATURE_ICONS = {+ clicks: CursorRays,+ links: Hyperlink,+ retention: Calendar6,+ sales: InvoiceDollar,+ domains: Globe,+ users: Users2,+ analytics: ChartLine,+ ai: Sparkle3,+ advanced: Gear3,+ folders: Folder,+ dotlink: Gift,+ deeplinks: MarketingTarget,+ events: Bolt,+ webhooks: Webhook,+ partners: ConnectedDots4,+ payouts: CreditCard,+ roles: UsersSettings,+ slack: Slack,+ tests: Flask,+ whitelabel: SquareLayoutGrid5,+ email: PaperPlane,+ volume: PercentageArrowDown,+ sso: ShieldKeyhole,+ sla: License,+ logs: Versions2,+ success: UserCrown,+};diff --git a/packages/ui/src/index.tsx b/packages/ui/src/index.tsxindex 07859babc5..9e61a28e15 100644--- a/packages/ui/src/index.tsx+++ b/packages/ui/src/index.tsx@@ -63,6 +63,7 @@ export * from "./link-preview";export * from "./popup";export * from "./progress-bar";export * from "./tab-select";+export * from "./tooltip-advanced-link-features";// logosexport * from "./composite-logo";diff --git a/packages/ui/src/tooltip-advanced-link-features.tsx b/packages/ui/src/tooltip-advanced-link-features.tsxnew file mode 100644index 0000000000..e75500cd25--- /dev/null+++ b/packages/ui/src/tooltip-advanced-link-features.tsx@@ -0,0 +1,52 @@+import { Earth, Incognito, InputPasswordPointer, Timer2, Views } from "./icons";++const advancedLinkFeatures = [+ {+ icon: Views,+ text: "Custom link previews",+ href: "https://dub.co/help/article/custom-link-previews",+ },+ {+ icon: Earth,+ text: "Geo/device targeting",+ href: "https://dub.co/help/article/geo-targeting",+ },+ {+ icon: InputPasswordPointer,+ text: "Password protection",+ href: "https://dub.co/help/article/password-protected-links",+ },+ {+ icon: Timer2,+ text: "Link expiration",+ href: "https://dub.co/help/article/link-expiration",+ },+ {+ icon: Incognito,+ text: "Link cloaking",+ href: "https://dub.co/help/article/link-cloaking",+ },+];++export function AdvancedLinkFeaturesTooltip() {+ return (+ <div className="p-3">+ <span className="block text-sm font-semibold text-neutral-600">+ Advanced link features+ </span>+ <div className="mt-2 flex flex-col gap-2.5 text-xs text-neutral-600">+ {advancedLinkFeatures.map(({ text, icon: Icon, href }) => (+ <a+ key={text}+ href={href}+ target="_blank"+ className="flex items-center gap-2.5 underline decoration-dotted underline-offset-2"+ >+ <Icon className="size-3.5 shrink-0" />+ {text}+ </a>+ ))}+ </div>+ </div>+ );+}diff --git a/packages/utils/package.json b/packages/utils/package.jsonindex 4c9c1dbc46..2a6910c347 100644--- a/packages/utils/package.json+++ b/packages/utils/package.json@@ -1,7 +1,7 @@{"name": "@dub/utils","description": "Utility functions and constants for Dub.co",- "version": "0.1.23",+ "version": "0.1.24","sideEffects": false,"main": "./dist/index.mjs","module": "./dist/index.mjs",diff --git a/packages/utils/src/constants/index.ts b/packages/utils/src/constants/index.tsindex 32538af99a..58ec881f7e 100644--- a/packages/utils/src/constants/index.ts+++ b/packages/utils/src/constants/index.ts@@ -12,7 +12,7 @@ export * from "./localhost";export * from "./main";export * from "./middleware";export * from "./misc";-export * from "./plan-compare";+export * from "./plan-features";export * from "./pricing";export * from "./regions";export * from "./saml";diff --git a/packages/utils/src/constants/plan-compare.tsx b/packages/utils/src/constants/plan-features.tsxsimilarity index 99%rename from packages/utils/src/constants/plan-compare.tsxrename to packages/utils/src/constants/plan-features.tsxindex 645bbd21b2..bbf08ba2e8 100644--- a/packages/utils/src/constants/plan-compare.tsx+++ b/packages/utils/src/constants/plan-features.tsx@@ -231,7 +231,7 @@ export const PLAN_COMPARE_FEATURES: {<strong>{plan.name === "Enterprise"? "Unlimited"- : `${nFormatter(plan.limits.sales)}`}+ : `$${nFormatter(plan.limits.sales)}`}</strong>{" "}tracked sales{plan.name === "Enterprise" ? "" : "/mo"}diff --git a/packages/utils/src/constants/pricing.tsx b/packages/utils/src/constants/pricing.tsxindex 832d2f3aa0..3d3a5f8390 100644--- a/packages/utils/src/constants/pricing.tsx+++ b/packages/utils/src/constants/pricing.tsx@@ -3,7 +3,7 @@ import { INFINITY_NUMBER } from "./misc";export type PlanFeature = {id?: string;text: string;- footnote?: {+ tooltip?: {title: string;cta: string;href: string;@@ -30,45 +30,6 @@ export const PLANS = [api: 60,retention: "30-day",},- cta: {- text: "Start for free",- shorText: "Get started",- href: "https://app.dub.co/register",- color:- "bg-white hover:bg-neutral-50 border border-neutral-200 hover:ring-neutral-100 text-neutral-800",- },- featureTitle: "What's included:",- features: [- {- id: "clicks",- text: "1K tracked clicks/mo",- },- { id: "links", text: "25 new links/mo" },- { id: "retention", text: "30-day analytics retention" },- { id: "domains", text: "3 domains" },- { id: "user", text: "1 user" },- {- id: "analytics",- text: "Advanced analytics",- footnote: {- title:- "Get location (country, city, continent), device (type, browser, OS), and referer data on your clicks.",- cta: "Learn more.",- href: "https://dub.co/analytics",- },- },- { id: "ai", text: "10 AI credits/mo" },- { id: "basic-support", text: "Basic support" },- {- id: "api",- text: "API Access",- footnote: {- title: "Programatically manage your links using our REST API.",- cta: "Learn more.",- href: "https://dub.co/docs/api-reference/introduction",- },- },- ] as PlanFeature[],},{name: "Pro",@@ -102,39 +63,52 @@ export const PLANS = [api: 600,retention: "1-year",},+ featureTitle: "Everything in Free, plus:",features: [{ id: "clicks", text: "50K tracked clicks/mo" },- { id: "links", text: "1,000 new links/mo" },+ { id: "links", text: "1K new links/mo" },{ id: "retention", text: "1-year analytics retention" },{ id: "domains", text: "10 domains" },{ id: "users", text: "3 users" },{- id: "link-features",+ id: "advanced",text: "Advanced link features",- footnote:- "Custom social media cards, password-protected links, link expiration, link cloaking, device targeting, geo targeting etc.",+ tooltip: "ADVANCED_LINK_FEATURES",},{id: "ai",text: "Unlimited AI credits",- footnote: {+ tooltip: {title:"Subject to fair use policy – you will be notified if you exceed the limit, which are high enough for frequent usage.",cta: "Learn more.",href: "https://dub.co/blog/introducing-dub-ai",},},- { id: "priority-support", text: "Priority support" },{id: "dotlink",- text: "Free custom domain",- footnote: {+ text: "Free .link domain",+ tooltip: {title:"All our paid plans come with a free .link custom domain, which helps improve click-through rates.",cta: "Learn more.",href: "https://dub.co/help/article/free-dot-link-domain",},},+ {+ id: "folders",+ text: "Link folders",+ },+ {+ id: "deeplinks",+ text: "Deep links",+ tooltip: {+ title:+ "Redirect users to a specific page within your mobile application using deep links.",+ cta: "Learn more.",+ href: "https://dub.co//help/article/custom-domain-deep-links",+ },+ },] as PlanFeature[],},{@@ -180,24 +154,20 @@ export const PLANS = [id: "links",text: "10K new links/mo",},+ {+ id: "retention",+ text: "3-year analytics retention",+ },{id: "sales",text: "$25K tracked sales/mo",- footnote: {+ tooltip: {title:"Use Dub Conversions to track how your link clicks are converting to signups and sales. Limits are based on the total sale amount tracked within a given month.",cta: "Learn more.",href: "https://d.to/conversions",},},- {- id: "retention",- text: "3-year analytics retention",- },- {- id: "domains",- text: "100 domains",- },{id: "users",text: "10 users",@@ -205,23 +175,45 @@ export const PLANS = [{id: "events",text: "Real-time events stream",- footnote: {+ tooltip: {title:"Get more data on your link clicks and QR code scans with a detailed, real-time stream of events in your workspace",cta: "Learn more.",- href: "https://d.to/events",+ href: "https://dub.co/help/article/real-time-events-stream",+ },+ },+ {+ id: "partners",+ text: "Partner management",+ tooltip: {+ title: "Use Dub Partners to manage and pay out your affiliates.",+ cta: "Learn more.",+ href: "https://dub.co/partners",+ },+ },+ {+ id: "payouts",+ text: "1-click global payouts",+ tooltip: {+ title: "Send payouts to 180+ countries in 1-click.",+ cta: "Learn more.",+ href: "https://dub.co/help/article/partner-payouts",},},{id: "webhooks",- text: "Real-time webhooks",- footnote: {+ text: "Event webhooks",+ tooltip: {title:- "Use webhooks to connect Dub with your data stack and workflows – with native integrations for Segment, Zapier, Slack, and more.",+ "Get real-time notifications when a link is clicked or a QR code is scanned using webhooks.",cta: "Learn more.",- href: "https://d.to/webhooks",+ href: "https://dub.co/docs/concepts/webhooks/introduction",},},+ {+ id: "tests",+ text: "A/B testing",+ },] as PlanFeature[],},{@@ -259,10 +251,14 @@ export const PLANS = [id: "links",text: "50K new links/mo",},+ {+ id: "retention",+ text: "5-year analytics retention",+ },{id: "sales",text: "$100K tracked sales/mo",- footnote: {+ tooltip: {title:"Use Dub Conversions to track how your link clicks are converting to signups and sales. Limits are based on the total sale amount tracked within a given month.",cta: "Learn more.",@@ -270,16 +266,33 @@ export const PLANS = [},},{- id: "retention",- text: "5-year analytics retention",+ id: "users",+ text: "20 users",},{- id: "domains",- text: "250 domains",+ id: "roles",+ text: "Folders RBAC",},{- id: "users",- text: "20 users",+ id: "whitelabel",+ text: "White-labeling support",+ },+ {+ id: "volume",+ text: "Lower payout fees",+ tooltip: {+ title: "Lower fees associated with Partner payouts.",+ cta: "Learn more.",+ href: "https://dub.co/help/article/partner-payouts",+ },+ },+ {+ id: "email",+ text: "Branded email domains",+ },+ {+ id: "slack",+ text: "Priority Slack support",},] as PlanFeature[],},