|
| 1 | +import React from 'react' |
| 2 | +import type { Meta, StoryObj } from '@storybook/react' |
| 3 | +import { action } from '@storybook/addon-actions' |
| 4 | +import { LandingMenu } from './LandingMenu' |
| 5 | + |
| 6 | +const meta: Meta<typeof LandingMenu> = { |
| 7 | + title: 'Foundary/LandingMenu', |
| 8 | + component: LandingMenu, |
| 9 | + parameters: { |
| 10 | + layout: 'fullscreen', |
| 11 | + docs: { |
| 12 | + description: { |
| 13 | + component: |
| 14 | + 'A post-login landing menu component that allows users to choose their workspace. ' + |
| 15 | + 'Features customizable workspace choices with support for internal URLs, external URLs, and custom callbacks. ' + |
| 16 | + 'Includes smooth animations, hover effects, and configurable branding.' |
| 17 | + } |
| 18 | + } |
| 19 | + }, |
| 20 | + argTypes: { |
| 21 | + className: { |
| 22 | + control: 'text', |
| 23 | + description: 'Additional CSS classes for the landing menu container' |
| 24 | + }, |
| 25 | + welcomeTitle: { |
| 26 | + control: 'text', |
| 27 | + description: 'Welcome title text' |
| 28 | + }, |
| 29 | + welcomeSubtitle: { |
| 30 | + control: 'text', |
| 31 | + description: 'Welcome subtitle text' |
| 32 | + }, |
| 33 | + logoSrc: { |
| 34 | + control: 'text', |
| 35 | + description: 'Logo source URL' |
| 36 | + }, |
| 37 | + logoAlt: { |
| 38 | + control: 'text', |
| 39 | + description: 'Logo alt text' |
| 40 | + }, |
| 41 | + workspaceChoices: { |
| 42 | + control: 'object', |
| 43 | + description: 'Array of workspace choice options' |
| 44 | + } |
| 45 | + }, |
| 46 | + tags: ['autodocs'] |
| 47 | +} |
| 48 | + |
| 49 | +export default meta |
| 50 | +type Story = StoryObj<typeof LandingMenu> |
| 51 | + |
| 52 | +/** |
| 53 | + * Default landing menu with Ava and team collaboration options |
| 54 | + */ |
| 55 | +export const Default: Story = { |
| 56 | + args: {}, |
| 57 | + parameters: { |
| 58 | + docs: { |
| 59 | + description: { |
| 60 | + story: 'The default landing menu with Ava (digital assistant) and team collaboration options.' |
| 61 | + } |
| 62 | + } |
| 63 | + } |
| 64 | +} |
| 65 | + |
| 66 | +/** |
| 67 | + * Custom branding example |
| 68 | + */ |
| 69 | +export const CustomBranding: Story = { |
| 70 | + args: { |
| 71 | + welcomeTitle: "Welcome to Acme Corp", |
| 72 | + welcomeSubtitle: "Select your preferred working mode", |
| 73 | + logoAlt: "Acme Corporation Logo" |
| 74 | + }, |
| 75 | + parameters: { |
| 76 | + docs: { |
| 77 | + description: { |
| 78 | + story: 'Example showing customized branding and messaging for different organizations.' |
| 79 | + } |
| 80 | + } |
| 81 | + } |
| 82 | +} |
| 83 | + |
| 84 | +/** |
| 85 | + * Custom workspace choices with different options |
| 86 | + */ |
| 87 | +export const CustomWorkspaceChoices: Story = { |
| 88 | + args: { |
| 89 | + workspaceChoices: [ |
| 90 | + { |
| 91 | + id: 'analytics', |
| 92 | + title: 'Analytics Dashboard', |
| 93 | + description: 'View reports, metrics, and business intelligence data.', |
| 94 | + icon: React.createElement('div', { className: 'h-12 w-12 bg-green-500 rounded-lg flex items-center justify-center text-white font-bold text-xl' }, 'A'), |
| 95 | + color: 'text-green-600', |
| 96 | + gradient: 'from-green-500 to-teal-600', |
| 97 | + url: '/dashboard/analytics' |
| 98 | + }, |
| 99 | + { |
| 100 | + id: 'admin', |
| 101 | + title: 'Admin Panel', |
| 102 | + description: 'Manage users, settings, and system configuration.', |
| 103 | + icon: React.createElement('div', { className: 'h-12 w-12 bg-red-500 rounded-lg flex items-center justify-center text-white font-bold text-xl' }, 'S'), |
| 104 | + color: 'text-red-600', |
| 105 | + gradient: 'from-red-500 to-pink-600', |
| 106 | + url: '/admin' |
| 107 | + }, |
| 108 | + { |
| 109 | + id: 'external', |
| 110 | + title: 'External Tool', |
| 111 | + description: 'Launch external application in new tab.', |
| 112 | + icon: React.createElement('div', { className: 'h-12 w-12 bg-blue-500 rounded-lg flex items-center justify-center text-white font-bold text-xl' }, 'E'), |
| 113 | + color: 'text-blue-600', |
| 114 | + gradient: 'from-blue-500 to-indigo-600', |
| 115 | + url: 'https://example.com' |
| 116 | + }, |
| 117 | + { |
| 118 | + id: 'custom', |
| 119 | + title: 'Custom Action', |
| 120 | + description: 'Execute custom callback function.', |
| 121 | + icon: React.createElement('div', { className: 'h-12 w-12 bg-purple-500 rounded-lg flex items-center justify-center text-white font-bold text-xl' }, 'C'), |
| 122 | + color: 'text-purple-600', |
| 123 | + gradient: 'from-purple-500 to-violet-600', |
| 124 | + onClick: () => action('Custom workspace action executed')() |
| 125 | + } |
| 126 | + ] |
| 127 | + }, |
| 128 | + parameters: { |
| 129 | + docs: { |
| 130 | + description: { |
| 131 | + story: |
| 132 | + 'Example showing custom workspace choices with different navigation options: ' + |
| 133 | + 'internal URLs, external URLs, and custom callback functions.' |
| 134 | + } |
| 135 | + } |
| 136 | + } |
| 137 | +} |
| 138 | + |
| 139 | +/** |
| 140 | + * Three workspace options layout |
| 141 | + */ |
| 142 | +export const ThreeOptions: Story = { |
| 143 | + args: { |
| 144 | + workspaceChoices: [ |
| 145 | + { |
| 146 | + id: 'dashboard', |
| 147 | + title: 'Dashboard', |
| 148 | + description: 'Overview of your key metrics and activities.', |
| 149 | + icon: React.createElement('div', { className: 'h-12 w-12 bg-blue-500 rounded-lg flex items-center justify-center text-white font-bold text-xl' }, 'D'), |
| 150 | + color: 'text-blue-600', |
| 151 | + gradient: 'from-blue-500 to-cyan-600', |
| 152 | + url: '/dashboard' |
| 153 | + }, |
| 154 | + { |
| 155 | + id: 'projects', |
| 156 | + title: 'Projects', |
| 157 | + description: 'Manage and collaborate on your projects.', |
| 158 | + icon: React.createElement('div', { className: 'h-12 w-12 bg-green-500 rounded-lg flex items-center justify-center text-white font-bold text-xl' }, 'P'), |
| 159 | + color: 'text-green-600', |
| 160 | + gradient: 'from-green-500 to-emerald-600', |
| 161 | + url: '/projects' |
| 162 | + }, |
| 163 | + { |
| 164 | + id: 'settings', |
| 165 | + title: 'Settings', |
| 166 | + description: 'Configure your account and preferences.', |
| 167 | + icon: React.createElement('div', { className: 'h-12 w-12 bg-purple-500 rounded-lg flex items-center justify-center text-white font-bold text-xl' }, 'S'), |
| 168 | + color: 'text-purple-600', |
| 169 | + gradient: 'from-purple-500 to-violet-600', |
| 170 | + url: '/settings' |
| 171 | + } |
| 172 | + ] |
| 173 | + }, |
| 174 | + parameters: { |
| 175 | + docs: { |
| 176 | + description: { |
| 177 | + story: 'Example with three workspace options to show how the layout adapts.' |
| 178 | + } |
| 179 | + } |
| 180 | + } |
| 181 | +} |
| 182 | + |
| 183 | +/** |
| 184 | + * Custom styling example |
| 185 | + */ |
| 186 | +export const CustomStyling: Story = { |
| 187 | + args: { |
| 188 | + className: 'bg-gradient-to-br from-indigo-50 to-cyan-50', |
| 189 | + welcomeTitle: "Choose Your Path", |
| 190 | + welcomeSubtitle: "Select the workspace that fits your workflow" |
| 191 | + }, |
| 192 | + parameters: { |
| 193 | + docs: { |
| 194 | + description: { |
| 195 | + story: 'Example showing custom background styling and messaging.' |
| 196 | + } |
| 197 | + } |
| 198 | + } |
| 199 | +} |
0 commit comments