diff --git a/apps/api/src/app/api/github/install/route.ts b/apps/api/src/app/api/github/install/route.ts index 72702337273..da8b04b4b6f 100644 --- a/apps/api/src/app/api/github/install/route.ts +++ b/apps/api/src/app/api/github/install/route.ts @@ -8,7 +8,9 @@ export async function GET(request: Request) { if (member instanceof Response) return member; if (!(await organizationSyncsNow(member.organizationId))) { - return Response.redirect(`${env.NEXT_PUBLIC_WEB_URL}/settings/billing`); + return Response.redirect( + `${env.NEXT_PUBLIC_WEB_URL}/integrations?pro=github`, + ); } if (!env.GH_APP_ID) { diff --git a/apps/api/src/app/api/integrations/linear/connect/route.ts b/apps/api/src/app/api/integrations/linear/connect/route.ts index 797a8f66ef4..1e063c47ec0 100644 --- a/apps/api/src/app/api/integrations/linear/connect/route.ts +++ b/apps/api/src/app/api/integrations/linear/connect/route.ts @@ -8,7 +8,9 @@ export async function GET(request: Request) { if (member instanceof Response) return member; if (!(await organizationSyncsNow(member.organizationId))) { - return Response.redirect(`${env.NEXT_PUBLIC_WEB_URL}/settings/billing`); + return Response.redirect( + `${env.NEXT_PUBLIC_WEB_URL}/integrations?pro=linear`, + ); } return beginOAuthFlow({ diff --git a/apps/desktop/src/renderer/components/Paywall/Paywall.tsx b/apps/desktop/src/renderer/components/Paywall/Paywall.tsx index 88e15461233..f8435a18efe 100644 --- a/apps/desktop/src/renderer/components/Paywall/Paywall.tsx +++ b/apps/desktop/src/renderer/components/Paywall/Paywall.tsx @@ -1,13 +1,12 @@ -import { Trans } from "@lingui/react/macro"; -import { Button } from "@superset/ui/button"; -import { Dialog, DialogContent } from "@superset/ui/dialog"; +import { + PRO_FEATURES, + ProFeaturesDialog, +} from "@superset/ui/pro-features-dialog"; import { useNavigate } from "@tanstack/react-router"; import { useEffect, useRef, useState } from "react"; import { track } from "renderer/lib/analytics"; -import { FeaturePreview } from "./components/FeaturePreview"; -import { FeatureSidebar } from "./components/FeatureSidebar"; import type { GatedFeature } from "./constants"; -import { FEATURE_ID_MAP, PRO_FEATURES } from "./constants"; +import { FEATURE_ID_MAP } from "./constants"; type PaywallOptions = { feature: GatedFeature; @@ -122,30 +121,14 @@ export const Paywall = () => { }; return ( - - -
- - -
- -
- - -
-
-
+ ); }; diff --git a/apps/desktop/src/renderer/components/Paywall/constants.ts b/apps/desktop/src/renderer/components/Paywall/constants.ts index 4106b3689fb..6c25172bb68 100644 --- a/apps/desktop/src/renderer/components/Paywall/constants.ts +++ b/apps/desktop/src/renderer/components/Paywall/constants.ts @@ -1,15 +1,3 @@ -import type { MessageDescriptor } from "@lingui/core"; -import { msg } from "@lingui/core/macro"; -import type { IconType } from "react-icons"; -import { FaSlack } from "react-icons/fa"; -import { - HiDevicePhoneMobile, - HiOutlineClipboardDocumentList, - HiOutlineClock, - HiOutlineSignal, - HiUsers, -} from "react-icons/hi2"; - export const GATED_FEATURES = { INVITE_MEMBERS: "invite-members", TASKS: "tasks", @@ -20,97 +8,6 @@ export const GATED_FEATURES = { export type GatedFeature = (typeof GATED_FEATURES)[keyof typeof GATED_FEATURES]; -export interface ProFeature { - id: string; - title: MessageDescriptor; - description: MessageDescriptor; - icon: IconType; - iconColor: string; - gradientColors: readonly [string, string, string, string]; - comingSoon?: boolean; -} - -export const PRO_FEATURES: ProFeature[] = [ - { - id: "remote-access", - title: msg({ - message: "Remote Access", - }), - description: msg({ - message: - "Reach this Mac from anywhere via the Superset relay, or spin up cloud workspaces. Connect from any client.", - }), - icon: HiOutlineSignal, - iconColor: "text-pink-500", - gradientColors: ["#be185d", "#9d174d", "#831843", "#1a1a2e"], - }, - { - id: "automations", - title: msg({ - message: "Automations", - }), - description: msg({ - message: - "Put recurring work on a schedule or an event. Agents run on their own and land in a workspace for you to review.", - }), - icon: HiOutlineClock, - iconColor: "text-amber-500", - gradientColors: ["#b45309", "#92400e", "#78350f", "#1a1a2e"], - }, - { - id: "team-collaboration", - title: msg({ - message: "Team Collaboration", - }), - description: msg({ - message: - "Invite your team to shared workspaces. See real-time updates, sync configurations, and manage team access across agents.", - }), - icon: HiUsers, - iconColor: "text-blue-500", - gradientColors: ["#1e40af", "#1e3a8a", "#172554", "#1a1a2e"], - }, - { - id: "tasks", - title: msg({ - message: "Tasks", - }), - description: msg({ - message: - "Track and manage tasks synced from Linear. Stay on top of your work without leaving Superset.", - }), - icon: HiOutlineClipboardDocumentList, - iconColor: "text-emerald-500", - gradientColors: ["#047857", "#065f46", "#064e3b", "#1a1a2e"], - }, - { - id: "slack-integration", - title: msg({ - message: "Slack Integration", - }), - description: msg({ - message: - "Turn Slack conversations into tasks, run agents from your workspace, and keep teammates in the loop where work starts.", - }), - icon: FaSlack, - iconColor: "text-violet-500", - gradientColors: ["#7c3aed", "#4f46e5", "#0f766e", "#1a1a2e"], - }, - { - id: "mobile-app", - title: msg({ - message: "Mobile App", - }), - description: msg({ - message: - "Monitor workspaces and manage tasks on the go. Continue conversations from anywhere.", - }), - icon: HiDevicePhoneMobile, - iconColor: "text-red-500", - gradientColors: ["#7f1d1d", "#991b1b", "#450a0a", "#1a1a2e"], - }, -]; - // Map gated feature IDs to the feature to highlight in the paywall dialog export const FEATURE_ID_MAP: Record = { [GATED_FEATURES.INVITE_MEMBERS]: "team-collaboration", diff --git a/apps/desktop/src/renderer/routes/_authenticated/settings/integrations/components/IntegrationsSettings/IntegrationsSettings.tsx b/apps/desktop/src/renderer/routes/_authenticated/settings/integrations/components/IntegrationsSettings/IntegrationsSettings.tsx index 7d50a762fa8..1984eaf347a 100644 --- a/apps/desktop/src/renderer/routes/_authenticated/settings/integrations/components/IntegrationsSettings/IntegrationsSettings.tsx +++ b/apps/desktop/src/renderer/routes/_authenticated/settings/integrations/components/IntegrationsSettings/IntegrationsSettings.tsx @@ -4,6 +4,7 @@ import { type IntegrationProvider, offeredIntegrations, } from "@superset/shared/integrations"; +import { Badge } from "@superset/ui/badge"; import { Button } from "@superset/ui/button"; import { Skeleton } from "@superset/ui/skeleton"; import { useFeatureFlagPayload } from "posthog-js/react"; @@ -12,6 +13,11 @@ import { BsMicrosoftTeams } from "react-icons/bs"; import { FaGithub, FaGoogle, FaSlack } from "react-icons/fa"; import { HiOutlineArrowTopRightOnSquare } from "react-icons/hi2"; import { SiLinear, SiNotion, SiSentry } from "react-icons/si"; +import { + GATED_FEATURES, + type GatedFeature, + usePaywall, +} from "renderer/components/Paywall"; import { env } from "renderer/env.renderer"; import { useActiveOrganizationId } from "renderer/hooks/useActiveOrganizationId"; import { apiTrpcClient } from "renderer/lib/api-trpc-client"; @@ -47,6 +53,11 @@ const INTEGRATION_ICONS: Record = { google: , }; +const PRO_GATED: Partial> = { + linear: GATED_FEATURES.TASKS, + github: GATED_FEATURES.REMOTE_ACCESS, +}; + interface ProviderState { isConnected: boolean; connectedOrgName?: string | null; @@ -61,6 +72,7 @@ export function IntegrationsSettings({ // window against the other one's organization. const activeOrganizationId = useActiveOrganizationId(); const searchQuery = useSettingsSearchQuery(); + const { gateFeature, hasAccess, isReady: planReady } = usePaywall(); const enabledTriggerKinds = useFeatureFlagPayload( FEATURE_FLAGS.AUTOMATION_EVENT_TRIGGERS, @@ -212,6 +224,8 @@ export function IntegrationsSettings({ const itemId = integrationSettingItemId(integration.provider); if (!isItemVisible(itemId, visibleItems)) return null; const state = providerStates[integration.provider]; + const gate = PRO_GATED[integration.provider]; + const openWeb = () => handleOpenWeb(integration.webPath); return ( handleOpenWeb(integration.webPath)} + showProBadge={!!gate && planReady && !hasAccess(gate)} + onManage={gate ? () => gateFeature(gate, openWeb) : openWeb} /> ); })} @@ -245,6 +260,7 @@ interface IntegrationRowProps { isConnected: boolean; connectedOrgName?: string | null; isLoading?: boolean; + showProBadge?: boolean; onManage: () => void; } @@ -255,6 +271,7 @@ function IntegrationRow({ isConnected, connectedOrgName, isLoading, + showProBadge = false, onManage, }: IntegrationRowProps) { const status = isLoading ? ( @@ -289,7 +306,14 @@ function IntegrationRow({ {icon}
-
{name}
+
+ {name} + {showProBadge && ( + + PRO + + )} +
{description}
diff --git a/apps/web/src/app/(app)/(page)/integrations/components/IntegrationCard/IntegrationCard.tsx b/apps/web/src/app/(app)/(page)/integrations/components/IntegrationCard/IntegrationCard.tsx index ccdcd6ca58b..929e2b05773 100644 --- a/apps/web/src/app/(app)/(page)/integrations/components/IntegrationCard/IntegrationCard.tsx +++ b/apps/web/src/app/(app)/(page)/integrations/components/IntegrationCard/IntegrationCard.tsx @@ -13,6 +13,7 @@ export interface IntegrationCardProps { icon: ReactNode; accentColor: string; disabled?: boolean; + onClick?: () => void; } export function IntegrationCard({ @@ -23,6 +24,7 @@ export function IntegrationCard({ icon, accentColor, disabled = false, + onClick, }: IntegrationCardProps) { const cardRef = useRef(null); const [mousePosition, setMousePosition] = useState({ x: 0, y: 0 }); @@ -107,5 +109,13 @@ export function IntegrationCard({ return card; } + if (onClick) { + return ( + + ); + } + return {card}; } diff --git a/apps/web/src/app/(app)/(page)/integrations/components/ProFeaturesPaywall/ProFeaturesPaywall.tsx b/apps/web/src/app/(app)/(page)/integrations/components/ProFeaturesPaywall/ProFeaturesPaywall.tsx new file mode 100644 index 00000000000..86f6a9e6a1f --- /dev/null +++ b/apps/web/src/app/(app)/(page)/integrations/components/ProFeaturesPaywall/ProFeaturesPaywall.tsx @@ -0,0 +1,75 @@ +"use client"; + +import { + PRO_FEATURES, + ProFeaturesDialog, +} from "@superset/ui/pro-features-dialog"; +import { useRouter } from "next/navigation"; +import posthog from "posthog-js"; +import { useEffect, useRef, useState } from "react"; + +interface ProFeaturesPaywallProps { + featureId: string | null; + triggerSource: string | null; + onClose: () => void; +} + +export function ProFeaturesPaywall({ + featureId, + triggerSource, + onClose, +}: ProFeaturesPaywallProps) { + const router = useRouter(); + const [selectedFeatureId, setSelectedFeatureId] = useState( + featureId ?? PRO_FEATURES[0]?.id ?? "", + ); + const openedAt = useRef(0); + const viewed = useRef(new Set()); + + useEffect(() => { + if (!featureId) return; + setSelectedFeatureId(featureId); + openedAt.current = Date.now(); + viewed.current = new Set([featureId]); + posthog.capture("paywall_opened", { + trigger_source: triggerSource, + feature_id: featureId, + }); + }, [featureId, triggerSource]); + + const summary = () => ({ + trigger_source: triggerSource, + feature_id: selectedFeatureId, + features_viewed_count: viewed.current.size, + time_spent_ms: Date.now() - openedAt.current, + }); + + return ( + { + if (open) return; + posthog.capture("paywall_cancelled", summary()); + onClose(); + }} + selectedFeatureId={selectedFeatureId} + highlightedFeatureId={featureId ?? selectedFeatureId} + onSelectFeature={(id) => { + if (id !== selectedFeatureId) { + posthog.capture("paywall_feature_clicked", { + trigger_source: triggerSource, + feature_id: id, + previous_feature_id: selectedFeatureId, + }); + viewed.current.add(id); + } + setSelectedFeatureId(id); + }} + onUpgrade={() => { + posthog.capture("paywall_upgrade_clicked", summary()); + onClose(); + router.push("/settings/billing"); + }} + /> + ); +} diff --git a/apps/web/src/app/(app)/(page)/integrations/components/ProFeaturesPaywall/index.ts b/apps/web/src/app/(app)/(page)/integrations/components/ProFeaturesPaywall/index.ts new file mode 100644 index 00000000000..9ab2fd4e60a --- /dev/null +++ b/apps/web/src/app/(app)/(page)/integrations/components/ProFeaturesPaywall/index.ts @@ -0,0 +1 @@ +export { ProFeaturesPaywall } from "./ProFeaturesPaywall"; diff --git a/apps/web/src/app/(app)/(page)/integrations/github/page.tsx b/apps/web/src/app/(app)/(page)/integrations/github/page.tsx index d0899bd64a0..561783b8662 100644 --- a/apps/web/src/app/(app)/(page)/integrations/github/page.tsx +++ b/apps/web/src/app/(app)/(page)/integrations/github/page.tsx @@ -9,6 +9,7 @@ import { } from "@superset/ui/card"; import { ArrowLeft, CheckCircle2 } from "lucide-react"; import Link from "next/link"; +import { redirect } from "next/navigation"; import { FaGithub } from "react-icons/fa"; import { initServerI18n } from "@/lib/i18n-server"; import { api } from "@/trpc/server"; @@ -95,6 +96,14 @@ export default async function GitHubIntegrationPage() { ); } + if ( + !(await trpc.integration.syncAllowed.query({ + organizationId: organization.id, + })) + ) { + redirect("/integrations?pro=github"); + } + const installation = await trpc.integration.github.getInstallation.query({ organizationId: organization.id, }); diff --git a/apps/web/src/app/(app)/(page)/integrations/linear/page.tsx b/apps/web/src/app/(app)/(page)/integrations/linear/page.tsx index 72bb57affba..84a92a653ea 100644 --- a/apps/web/src/app/(app)/(page)/integrations/linear/page.tsx +++ b/apps/web/src/app/(app)/(page)/integrations/linear/page.tsx @@ -9,6 +9,7 @@ import { } from "@superset/ui/card"; import { AlertTriangle, ArrowLeft, CheckCircle2 } from "lucide-react"; import Link from "next/link"; +import { redirect } from "next/navigation"; import { SiLinear } from "react-icons/si"; import { initServerI18n } from "@/lib/i18n-server"; import { api } from "@/trpc/server"; @@ -88,6 +89,14 @@ export default async function LinearIntegrationPage() { ); } + if ( + !(await trpc.integration.syncAllowed.query({ + organizationId: organization.id, + })) + ) { + redirect("/integrations?pro=linear"); + } + const connection = await trpc.integration.linear.getConnection.query({ organizationId: organization.id, }); diff --git a/apps/web/src/app/(app)/(page)/integrations/page.tsx b/apps/web/src/app/(app)/(page)/integrations/page.tsx index e440737ecc2..2afa368865c 100644 --- a/apps/web/src/app/(app)/(page)/integrations/page.tsx +++ b/apps/web/src/app/(app)/(page)/integrations/page.tsx @@ -6,12 +6,15 @@ import { type IntegrationProvider, offeredIntegrations, } from "@superset/shared/integrations"; +import { useQuery } from "@tanstack/react-query"; import { useFeatureFlagPayload } from "posthog-js/react"; -import type { ReactNode } from "react"; +import { type ReactNode, useEffect, useState } from "react"; import { BsMicrosoftTeams } from "react-icons/bs"; import { FaGithub, FaGoogle, FaSlack } from "react-icons/fa"; import { SiLinear, SiNotion, SiSentry } from "react-icons/si"; +import { useTRPC } from "@/trpc/react"; import { IntegrationCard } from "./components/IntegrationCard"; +import { ProFeaturesPaywall } from "./components/ProFeaturesPaywall"; const CARD_STYLES: Record< IntegrationProvider, @@ -29,7 +32,39 @@ const CARD_STYLES: Record< google: { accentColor: "#4285F4", icon: }, }; +const PRO_FEATURE: Partial> = { + linear: "tasks", + github: "remote-access", +}; + +function isProGated(value: string | null): value is IntegrationProvider { + return value !== null && value in PRO_FEATURE; +} + export default function IntegrationsPage() { + const trpc = useTRPC(); + const { data: organization } = useQuery( + trpc.user.myOrganization.queryOptions(), + ); + const { data: syncAllowed } = useQuery({ + ...trpc.integration.syncAllowed.queryOptions({ + organizationId: organization?.id ?? "", + }), + enabled: !!organization, + }); + const [paywallFor, setPaywallFor] = useState( + null, + ); + + // The Linear and GitHub pages and connect routes send a free organization + // here with ?pro=. + useEffect(() => { + const pro = new URLSearchParams(window.location.search).get("pro"); + if (!isProGated(pro)) return; + setPaywallFor(pro); + window.history.replaceState({}, "", "/integrations"); + }, []); + // Before the flag resolves this is the standalone set, which is what // everyone outside the flag sees anyway; the trigger-only providers join // once the payload arrives. @@ -57,10 +92,21 @@ export default function IntegrationsPage() { description={integration.description()} category={integration.category()} {...CARD_STYLES[integration.provider]} + onClick={ + syncAllowed === false && integration.provider in PRO_FEATURE + ? () => setPaywallFor(integration.provider) + : undefined + } /> ))}
+ + setPaywallFor(null)} + /> ); } diff --git a/bun.lock b/bun.lock index c956cf0e5d4..180267fc28f 100644 --- a/bun.lock +++ b/bun.lock @@ -1290,6 +1290,7 @@ "@hookform/resolvers": "5.2.2", "@lingui/core": "6.6.0", "@lingui/react": "6.6.0", + "@paper-design/shaders-react": "0.0.77", "@radix-ui/react-accordion": "1.2.12", "@radix-ui/react-alert-dialog": "1.1.15", "@radix-ui/react-aspect-ratio": "1.1.8", diff --git a/packages/cli/src/commands/integrations/github/connect/command.ts b/packages/cli/src/commands/integrations/github/connect/command.ts index b4d4072cbbf..38fc8cdf19d 100644 --- a/packages/cli/src/commands/integrations/github/connect/command.ts +++ b/packages/cli/src/commands/integrations/github/connect/command.ts @@ -28,6 +28,13 @@ export default command({ }; } + if (!(await ctx.api.integration.syncAllowed.query({ organizationId }))) { + throw new CLIError( + "GitHub sync requires the Pro plan", + "Upgrade at https://superset.sh/pricing, or in the app under Settings → Billing.", + ); + } + const url = `${getApiUrl()}/api/github/install?organizationId=${organizationId}`; const opened = canReachDesktop() && diff --git a/packages/ui/package.json b/packages/ui/package.json index 78bee49870b..4d50b5b64d4 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -23,7 +23,8 @@ "./icons/browser-icons/*": "./src/assets/icons/browser-icons/*.svg", "./atoms/*": "./src/atoms/*/index.ts", "./*": "./src/components/ui/*.tsx", - "./app-store-qr": "./src/components/AppStoreQr/index.ts" + "./app-store-qr": "./src/components/AppStoreQr/index.ts", + "./pro-features-dialog": "./src/components/ProFeaturesDialog/index.ts" }, "scripts": { "clean": "git clean -xdf .cache .turbo dist node_modules", @@ -36,6 +37,7 @@ "@hookform/resolvers": "5.2.2", "@lingui/core": "6.6.0", "@lingui/react": "6.6.0", + "@paper-design/shaders-react": "0.0.77", "@radix-ui/react-accordion": "1.2.12", "@radix-ui/react-alert-dialog": "1.1.15", "@radix-ui/react-aspect-ratio": "1.1.8", diff --git a/packages/ui/src/components/ProFeaturesDialog/ProFeaturesDialog.tsx b/packages/ui/src/components/ProFeaturesDialog/ProFeaturesDialog.tsx new file mode 100644 index 00000000000..869dbf3a68f --- /dev/null +++ b/packages/ui/src/components/ProFeaturesDialog/ProFeaturesDialog.tsx @@ -0,0 +1,56 @@ +import { Trans } from "@lingui/react/macro"; +import { Button } from "../ui/button"; +import { Dialog, DialogContent } from "../ui/dialog"; +import { FeaturePreview } from "./components/FeaturePreview"; +import { FeatureSidebar } from "./components/FeatureSidebar"; +import { PRO_FEATURES } from "./constants"; + +interface ProFeaturesDialogProps { + open: boolean; + onOpenChange: (open: boolean) => void; + selectedFeatureId: string; + highlightedFeatureId: string; + onSelectFeature: (featureId: string) => void; + onUpgrade: () => void; +} + +export function ProFeaturesDialog({ + open, + onOpenChange, + selectedFeatureId, + highlightedFeatureId, + onSelectFeature, + onUpgrade, +}: ProFeaturesDialogProps) { + const selectedFeature = + PRO_FEATURES.find((f) => f.id === selectedFeatureId) ?? PRO_FEATURES[0]; + if (!selectedFeature) return null; + + return ( + + +
+ + +
+ +
+ + +
+
+
+ ); +} diff --git a/apps/desktop/src/renderer/components/Paywall/components/FeaturePreview/FeaturePreview.tsx b/packages/ui/src/components/ProFeaturesDialog/components/FeaturePreview/FeaturePreview.tsx similarity index 97% rename from apps/desktop/src/renderer/components/Paywall/components/FeaturePreview/FeaturePreview.tsx rename to packages/ui/src/components/ProFeaturesDialog/components/FeaturePreview/FeaturePreview.tsx index fafbc5a7b57..31adaa3e8e2 100644 --- a/apps/desktop/src/renderer/components/Paywall/components/FeaturePreview/FeaturePreview.tsx +++ b/packages/ui/src/components/ProFeaturesDialog/components/FeaturePreview/FeaturePreview.tsx @@ -1,8 +1,8 @@ import { Trans, useLingui } from "@lingui/react/macro"; import { COMPANY } from "@superset/shared/constants"; -import { Badge } from "@superset/ui/badge"; -import { cn } from "@superset/ui/utils"; import type { ComponentType } from "react"; +import { cn } from "../../../../lib/utils"; +import { Badge } from "../../../ui/badge"; import type { ProFeature } from "../../constants"; import { PRO_FEATURES } from "../../constants"; import { AutomationsDemo } from "./components/AutomationsDemo"; diff --git a/apps/desktop/src/renderer/components/Paywall/components/FeaturePreview/components/AutomationsDemo/AutomationsDemo.tsx b/packages/ui/src/components/ProFeaturesDialog/components/FeaturePreview/components/AutomationsDemo/AutomationsDemo.tsx similarity index 100% rename from apps/desktop/src/renderer/components/Paywall/components/FeaturePreview/components/AutomationsDemo/AutomationsDemo.tsx rename to packages/ui/src/components/ProFeaturesDialog/components/FeaturePreview/components/AutomationsDemo/AutomationsDemo.tsx diff --git a/apps/desktop/src/renderer/components/Paywall/components/FeaturePreview/components/AutomationsDemo/index.ts b/packages/ui/src/components/ProFeaturesDialog/components/FeaturePreview/components/AutomationsDemo/index.ts similarity index 100% rename from apps/desktop/src/renderer/components/Paywall/components/FeaturePreview/components/AutomationsDemo/index.ts rename to packages/ui/src/components/ProFeaturesDialog/components/FeaturePreview/components/AutomationsDemo/index.ts diff --git a/apps/desktop/src/renderer/components/Paywall/components/FeaturePreview/components/DitheredBackground/DitheredBackground.tsx b/packages/ui/src/components/ProFeaturesDialog/components/FeaturePreview/components/DitheredBackground/DitheredBackground.tsx similarity index 100% rename from apps/desktop/src/renderer/components/Paywall/components/FeaturePreview/components/DitheredBackground/DitheredBackground.tsx rename to packages/ui/src/components/ProFeaturesDialog/components/FeaturePreview/components/DitheredBackground/DitheredBackground.tsx diff --git a/apps/desktop/src/renderer/components/Paywall/components/FeaturePreview/components/DitheredBackground/index.ts b/packages/ui/src/components/ProFeaturesDialog/components/FeaturePreview/components/DitheredBackground/index.ts similarity index 100% rename from apps/desktop/src/renderer/components/Paywall/components/FeaturePreview/components/DitheredBackground/index.ts rename to packages/ui/src/components/ProFeaturesDialog/components/FeaturePreview/components/DitheredBackground/index.ts diff --git a/apps/desktop/src/renderer/components/Paywall/components/FeaturePreview/components/MobileAppDemo/MobileAppDemo.tsx b/packages/ui/src/components/ProFeaturesDialog/components/FeaturePreview/components/MobileAppDemo/MobileAppDemo.tsx similarity index 100% rename from apps/desktop/src/renderer/components/Paywall/components/FeaturePreview/components/MobileAppDemo/MobileAppDemo.tsx rename to packages/ui/src/components/ProFeaturesDialog/components/FeaturePreview/components/MobileAppDemo/MobileAppDemo.tsx diff --git a/apps/desktop/src/renderer/components/Paywall/components/FeaturePreview/components/MobileAppDemo/index.ts b/packages/ui/src/components/ProFeaturesDialog/components/FeaturePreview/components/MobileAppDemo/index.ts similarity index 100% rename from apps/desktop/src/renderer/components/Paywall/components/FeaturePreview/components/MobileAppDemo/index.ts rename to packages/ui/src/components/ProFeaturesDialog/components/FeaturePreview/components/MobileAppDemo/index.ts diff --git a/apps/desktop/src/renderer/components/Paywall/components/FeaturePreview/components/RemoteAccessDemo/RemoteAccessDemo.tsx b/packages/ui/src/components/ProFeaturesDialog/components/FeaturePreview/components/RemoteAccessDemo/RemoteAccessDemo.tsx similarity index 100% rename from apps/desktop/src/renderer/components/Paywall/components/FeaturePreview/components/RemoteAccessDemo/RemoteAccessDemo.tsx rename to packages/ui/src/components/ProFeaturesDialog/components/FeaturePreview/components/RemoteAccessDemo/RemoteAccessDemo.tsx diff --git a/apps/desktop/src/renderer/components/Paywall/components/FeaturePreview/components/RemoteAccessDemo/index.ts b/packages/ui/src/components/ProFeaturesDialog/components/FeaturePreview/components/RemoteAccessDemo/index.ts similarity index 100% rename from apps/desktop/src/renderer/components/Paywall/components/FeaturePreview/components/RemoteAccessDemo/index.ts rename to packages/ui/src/components/ProFeaturesDialog/components/FeaturePreview/components/RemoteAccessDemo/index.ts diff --git a/apps/desktop/src/renderer/components/Paywall/components/FeaturePreview/components/SlackIntegrationDemo/SlackIntegrationDemo.tsx b/packages/ui/src/components/ProFeaturesDialog/components/FeaturePreview/components/SlackIntegrationDemo/SlackIntegrationDemo.tsx similarity index 100% rename from apps/desktop/src/renderer/components/Paywall/components/FeaturePreview/components/SlackIntegrationDemo/SlackIntegrationDemo.tsx rename to packages/ui/src/components/ProFeaturesDialog/components/FeaturePreview/components/SlackIntegrationDemo/SlackIntegrationDemo.tsx diff --git a/apps/desktop/src/renderer/components/Paywall/components/FeaturePreview/components/SlackIntegrationDemo/index.ts b/packages/ui/src/components/ProFeaturesDialog/components/FeaturePreview/components/SlackIntegrationDemo/index.ts similarity index 100% rename from apps/desktop/src/renderer/components/Paywall/components/FeaturePreview/components/SlackIntegrationDemo/index.ts rename to packages/ui/src/components/ProFeaturesDialog/components/FeaturePreview/components/SlackIntegrationDemo/index.ts diff --git a/apps/desktop/src/renderer/components/Paywall/components/FeaturePreview/components/TasksDemo/TasksDemo.tsx b/packages/ui/src/components/ProFeaturesDialog/components/FeaturePreview/components/TasksDemo/TasksDemo.tsx similarity index 100% rename from apps/desktop/src/renderer/components/Paywall/components/FeaturePreview/components/TasksDemo/TasksDemo.tsx rename to packages/ui/src/components/ProFeaturesDialog/components/FeaturePreview/components/TasksDemo/TasksDemo.tsx diff --git a/apps/desktop/src/renderer/components/Paywall/components/FeaturePreview/components/TasksDemo/index.ts b/packages/ui/src/components/ProFeaturesDialog/components/FeaturePreview/components/TasksDemo/index.ts similarity index 100% rename from apps/desktop/src/renderer/components/Paywall/components/FeaturePreview/components/TasksDemo/index.ts rename to packages/ui/src/components/ProFeaturesDialog/components/FeaturePreview/components/TasksDemo/index.ts diff --git a/apps/desktop/src/renderer/components/Paywall/components/FeaturePreview/components/TeamCollaborationDemo/TeamCollaborationDemo.tsx b/packages/ui/src/components/ProFeaturesDialog/components/FeaturePreview/components/TeamCollaborationDemo/TeamCollaborationDemo.tsx similarity index 100% rename from apps/desktop/src/renderer/components/Paywall/components/FeaturePreview/components/TeamCollaborationDemo/TeamCollaborationDemo.tsx rename to packages/ui/src/components/ProFeaturesDialog/components/FeaturePreview/components/TeamCollaborationDemo/TeamCollaborationDemo.tsx diff --git a/apps/desktop/src/renderer/components/Paywall/components/FeaturePreview/components/TeamCollaborationDemo/index.ts b/packages/ui/src/components/ProFeaturesDialog/components/FeaturePreview/components/TeamCollaborationDemo/index.ts similarity index 100% rename from apps/desktop/src/renderer/components/Paywall/components/FeaturePreview/components/TeamCollaborationDemo/index.ts rename to packages/ui/src/components/ProFeaturesDialog/components/FeaturePreview/components/TeamCollaborationDemo/index.ts diff --git a/apps/desktop/src/renderer/components/Paywall/components/FeaturePreview/index.ts b/packages/ui/src/components/ProFeaturesDialog/components/FeaturePreview/index.ts similarity index 100% rename from apps/desktop/src/renderer/components/Paywall/components/FeaturePreview/index.ts rename to packages/ui/src/components/ProFeaturesDialog/components/FeaturePreview/index.ts diff --git a/apps/desktop/src/renderer/components/Paywall/components/FeatureSidebar/FeatureSidebar.tsx b/packages/ui/src/components/ProFeaturesDialog/components/FeatureSidebar/FeatureSidebar.tsx similarity index 90% rename from apps/desktop/src/renderer/components/Paywall/components/FeatureSidebar/FeatureSidebar.tsx rename to packages/ui/src/components/ProFeaturesDialog/components/FeatureSidebar/FeatureSidebar.tsx index 43453cc116b..a87d3b25d5c 100644 --- a/apps/desktop/src/renderer/components/Paywall/components/FeatureSidebar/FeatureSidebar.tsx +++ b/packages/ui/src/components/ProFeaturesDialog/components/FeatureSidebar/FeatureSidebar.tsx @@ -1,6 +1,7 @@ import { Trans, useLingui } from "@lingui/react/macro"; -import { cn } from "@superset/ui/utils"; import { useMemo } from "react"; +import { cn } from "../../../../lib/utils"; +import { DialogTitle } from "../../../ui/dialog"; import type { ProFeature } from "../../constants"; import { PRO_FEATURES } from "../../constants"; @@ -30,9 +31,11 @@ export function FeatureSidebar({ return (
-

- Pro Features -

+ +

+ Pro Features +

+
diff --git a/apps/desktop/src/renderer/components/Paywall/components/FeatureSidebar/index.ts b/packages/ui/src/components/ProFeaturesDialog/components/FeatureSidebar/index.ts similarity index 100% rename from apps/desktop/src/renderer/components/Paywall/components/FeatureSidebar/index.ts rename to packages/ui/src/components/ProFeaturesDialog/components/FeatureSidebar/index.ts diff --git a/packages/ui/src/components/ProFeaturesDialog/constants.ts b/packages/ui/src/components/ProFeaturesDialog/constants.ts new file mode 100644 index 00000000000..62ee7c0df35 --- /dev/null +++ b/packages/ui/src/components/ProFeaturesDialog/constants.ts @@ -0,0 +1,102 @@ +import type { MessageDescriptor } from "@lingui/core"; +import { msg } from "@lingui/core/macro"; +import type { IconType } from "react-icons"; +import { FaSlack } from "react-icons/fa"; +import { + HiDevicePhoneMobile, + HiOutlineClipboardDocumentList, + HiOutlineClock, + HiOutlineSignal, + HiUsers, +} from "react-icons/hi2"; + +export interface ProFeature { + id: string; + title: MessageDescriptor; + description: MessageDescriptor; + icon: IconType; + iconColor: string; + gradientColors: readonly [string, string, string, string]; + comingSoon?: boolean; +} + +export const PRO_FEATURES: ProFeature[] = [ + { + id: "remote-access", + title: msg({ + message: "Remote Access", + }), + description: msg({ + message: + "Reach this Mac from anywhere via the Superset relay, or spin up cloud workspaces. Connect from any client.", + }), + icon: HiOutlineSignal, + iconColor: "text-pink-500", + gradientColors: ["#be185d", "#9d174d", "#831843", "#1a1a2e"], + }, + { + id: "automations", + title: msg({ + message: "Automations", + }), + description: msg({ + message: + "Put recurring work on a schedule or an event. Agents run on their own and land in a workspace for you to review.", + }), + icon: HiOutlineClock, + iconColor: "text-amber-500", + gradientColors: ["#b45309", "#92400e", "#78350f", "#1a1a2e"], + }, + { + id: "team-collaboration", + title: msg({ + message: "Team Collaboration", + }), + description: msg({ + message: + "Invite your team to shared workspaces. See real-time updates, sync configurations, and manage team access across agents.", + }), + icon: HiUsers, + iconColor: "text-blue-500", + gradientColors: ["#1e40af", "#1e3a8a", "#172554", "#1a1a2e"], + }, + { + id: "tasks", + title: msg({ + message: "Tasks", + }), + description: msg({ + message: + "Track and manage tasks synced from Linear. Stay on top of your work without leaving Superset.", + }), + icon: HiOutlineClipboardDocumentList, + iconColor: "text-emerald-500", + gradientColors: ["#047857", "#065f46", "#064e3b", "#1a1a2e"], + }, + { + id: "slack-integration", + title: msg({ + message: "Slack Integration", + }), + description: msg({ + message: + "Turn Slack conversations into tasks, run agents from your workspace, and keep teammates in the loop where work starts.", + }), + icon: FaSlack, + iconColor: "text-violet-500", + gradientColors: ["#7c3aed", "#4f46e5", "#0f766e", "#1a1a2e"], + }, + { + id: "mobile-app", + title: msg({ + message: "Mobile App", + }), + description: msg({ + message: + "Monitor workspaces and manage tasks on the go. Continue conversations from anywhere.", + }), + icon: HiDevicePhoneMobile, + iconColor: "text-red-500", + gradientColors: ["#7f1d1d", "#991b1b", "#450a0a", "#1a1a2e"], + }, +]; diff --git a/packages/ui/src/components/ProFeaturesDialog/index.ts b/packages/ui/src/components/ProFeaturesDialog/index.ts new file mode 100644 index 00000000000..b224c13daf7 --- /dev/null +++ b/packages/ui/src/components/ProFeaturesDialog/index.ts @@ -0,0 +1,2 @@ +export { PRO_FEATURES, type ProFeature } from "./constants"; +export { ProFeaturesDialog } from "./ProFeaturesDialog";