Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/ui/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const config: StorybookConfig = {
reactPlugin(),
babel({ plugins: ["@lingui/babel-plugin-lingui-macro"] }),
];
viteConfig.define = { ...viteConfig.define, "process.env": {} };
return viteConfig;
},
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import type { Meta, StoryObj } from "@storybook/react-vite";
import { useState } from "react";
import { PRO_FEATURES } from "./constants";
import { ProFeaturesDialog } from "./ProFeaturesDialog";

const meta = {
title: "Pro features dialog",
component: ProFeaturesDialog,
args: {
open: true,
onOpenChange: () => {},
selectedFeatureId: "remote-access",
highlightedFeatureId: "remote-access",
onSelectFeature: () => {},
onUpgrade: () => {},
},
render: (args) => {
const [selectedFeatureId, setSelectedFeatureId] = useState(
args.selectedFeatureId,
);
return (
<ProFeaturesDialog
{...args}
selectedFeatureId={selectedFeatureId}
onSelectFeature={setSelectedFeatureId}
/>
);
},
} satisfies Meta<typeof ProFeaturesDialog>;

export default meta;
type Story = StoryObj<typeof meta>;

export const RemoteAccess: Story = {};
export const MobileApp: Story = {
args: {
selectedFeatureId: "mobile-app",
highlightedFeatureId: PRO_FEATURES[0]?.id ?? "mobile-app",
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ export function ProFeaturesDialog({
return (
<Dialog open={open} onOpenChange={onOpenChange}>
<DialogContent
className="!w-[744px] !max-w-[744px] p-0 gap-0 overflow-hidden !rounded-none"
className="flex max-h-[calc(100dvh-2rem)] !w-[744px] !max-w-[calc(100%-2rem)] flex-col gap-0 overflow-hidden !rounded-none p-0"
showCloseButton={false}
aria-describedby={undefined}
>
<div className="flex">
<div className="flex min-h-0 flex-col overflow-y-auto md:flex-row">
<FeatureSidebar
selectedFeatureId={selectedFeature.id}
highlightedFeatureId={highlightedFeatureId}
Expand All @@ -42,7 +42,7 @@ export function ProFeaturesDialog({
<FeaturePreview selectedFeature={selectedFeature} />
</div>

<div className="box-border flex items-center justify-between border-t bg-background px-5 py-4">
<div className="box-border flex shrink-0 items-center justify-between border-t bg-background px-5 py-4">
<Button variant="outline" onClick={() => onOpenChange(false)}>
<Trans>Cancel</Trans>
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ export function FeaturePreview({ selectedFeature }: FeaturePreviewProps) {
const DemoComponent = DEMO_COMPONENTS[selectedFeature.id];

return (
<div className="flex w-[495px] flex-col">
<div className="relative h-[346px] overflow-hidden bg-[#0a0a0f]">
<div className="flex w-full min-w-0 flex-col md:w-auto md:flex-1">
<div className="relative h-[346px] shrink-0 overflow-hidden bg-[#0a0a0f]">
{PRO_FEATURES.map((proFeature) => (
<div
key={`gradient-${proFeature.id}`}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const AUTOMATIONS = [
export function AutomationsDemo() {
return (
<div className="w-full h-full flex items-center justify-center">
<div className="w-[300px] bg-card/90 backdrop-blur-sm rounded-lg border border-border shadow-2xl overflow-hidden">
<div className="w-[300px] max-w-[calc(100%-2rem)] bg-card/90 backdrop-blur-sm rounded-lg border border-border shadow-2xl overflow-hidden">
<div className="flex items-center justify-between px-4 py-3 bg-muted/80 border-b border-border/50">
<div className="flex items-center gap-2">
<div className="flex gap-1.5">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function MobileAppDemo() {
return (
<div className="relative w-full h-full overflow-hidden">
{/* Phone frame - large and cropped at bottom */}
<div className="absolute right-12 top-10 w-[340px] h-[700px] bg-black rounded-[50px] border-[8px] border-neutral-700 shadow-2xl overflow-hidden">
<div className="absolute top-10 left-1/2 -translate-x-1/2 w-[340px] md:right-12 md:left-auto md:translate-x-0 h-[700px] bg-black rounded-[50px] border-[8px] border-neutral-700 shadow-2xl overflow-hidden">
{/* Dynamic Island */}
<div className="absolute top-2 left-1/2 -translate-x-1/2 w-28 h-8 bg-black rounded-full z-10" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { HiOutlineComputerDesktop, HiOutlineSignal } from "react-icons/hi2";
export function RemoteAccessDemo() {
return (
<div className="w-full h-full flex items-center justify-center">
<div className="w-[300px] bg-card/90 backdrop-blur-sm rounded-lg border border-border shadow-2xl overflow-hidden">
<div className="w-[300px] max-w-[calc(100%-2rem)] bg-card/90 backdrop-blur-sm rounded-lg border border-border shadow-2xl overflow-hidden">
<div className="flex items-center justify-between px-4 py-3 bg-muted/80 border-b border-border/50">
<div className="flex items-center gap-2">
<div className="flex gap-1.5">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const MESSAGES = [
export function SlackIntegrationDemo() {
return (
<div className="flex h-full w-full items-center justify-center">
<div className="w-[300px] overflow-hidden rounded-lg border border-border bg-card/90 shadow-2xl backdrop-blur-sm">
<div className="w-[300px] max-w-[calc(100%-2rem)] overflow-hidden rounded-lg border border-border bg-card/90 shadow-2xl backdrop-blur-sm">
<div className="flex items-center justify-between border-border/50 border-b bg-muted/80 px-4 py-3">
<div className="flex items-center gap-2">
<FaSlack className="size-4 text-violet-400" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function SpinnerIcon({ className }: { className?: string }) {
export function TasksDemo() {
return (
<div className="w-full h-full flex items-center justify-center">
<div className="w-[300px] bg-card/90 backdrop-blur-sm rounded-lg border border-border shadow-2xl overflow-hidden">
<div className="w-[300px] max-w-[calc(100%-2rem)] bg-card/90 backdrop-blur-sm rounded-lg border border-border shadow-2xl overflow-hidden">
{/* Header */}
<div className="flex items-center justify-between px-4 py-3 bg-muted/80 border-b border-border/50">
<div className="flex items-center gap-2">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const ACTIVITY = [
export function TeamCollaborationDemo() {
return (
<div className="w-full h-full flex items-center justify-center">
<div className="w-[300px] bg-card/90 backdrop-blur-sm rounded-lg border border-border shadow-2xl overflow-hidden">
<div className="w-[300px] max-w-[calc(100%-2rem)] bg-card/90 backdrop-blur-sm rounded-lg border border-border shadow-2xl overflow-hidden">
{/* Header */}
<div className="flex items-center justify-between px-4 py-3 bg-muted/80 border-b border-border/50">
<div className="flex items-center gap-2">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ export function FeatureSidebar({
}, [highlightedFeatureId]);

return (
<div className="flex w-[249px] shrink-0 flex-col border-r bg-card">
<div className="px-5 pt-5 pb-2.5">
<div className="flex w-full shrink-0 flex-col border-b bg-card md:w-[249px] md:border-r md:border-b-0">
<div className="px-5 pt-5 md:pb-2.5">
<DialogTitle asChild>
<h1 className="mb-0 text-lg font-bold text-foreground">
<Trans>Pro Features</Trans>
</h1>
</DialogTitle>
</div>

<div className="flex flex-col gap-2 py-2.5">
<div className="flex gap-1 overflow-x-auto px-3 py-2.5 md:flex-col md:gap-2 md:overflow-visible md:px-0">
{orderedFeatures.map((proFeature) => (
<FeatureButton
key={proFeature.id}
Expand All @@ -65,9 +65,15 @@ function FeatureButton({ feature, isSelected, onSelect }: FeatureButtonProps) {
return (
<button
type="button"
onClick={onSelect}
onClick={(event) => {
event.currentTarget.scrollIntoView({
block: "nearest",
inline: "nearest",
});
onSelect();
}}
className={cn(
"group flex h-14 w-full items-center gap-3 px-5 py-2.5 transition-all duration-200 ease-out",
"group flex h-10 shrink-0 items-center gap-2 whitespace-nowrap px-3 py-2.5 transition-all duration-200 ease-out md:h-14 md:w-full md:gap-3 md:px-5",
"cursor-pointer text-left",
isSelected
? "bg-muted text-foreground"
Expand Down
Loading