1
1
import React from "react" ;
2
- import { StoryFn } from "@storybook/react" ;
3
2
import Flyout from "../Flyout" ;
4
3
import ProductTile from "../ProductTile" ;
5
4
import FeaturedLink from "../FeaturedLink" ;
@@ -11,8 +10,6 @@ export default {
11
10
tags : [ "autodocs" ] ,
12
11
} ;
13
12
14
- const Template : StoryFn = ( args ) => < div className = "h-[450px]" > < Flyout { ...args } /> </ div > ;
15
-
16
13
const platforms = [
17
14
"Infrastructure" ,
18
15
"Integrations" ,
@@ -28,7 +25,6 @@ const ProductsGrid = () => {
28
25
< div className = "grid grid-cols-2" >
29
26
{ Object . keys ( products ) . map ( ( product ) => (
30
27
< ProductTile
31
- className = "bg-neutral-000"
32
28
name = { product as ProductName }
33
29
key = { product }
34
30
selected = { selectedProduct === product }
@@ -49,11 +45,13 @@ const Panels = ({
49
45
< div className = "flex flex-row gap-x-24" >
50
46
< div className = "flex-6" > { panelLeft } </ div >
51
47
< div className = "flex-4 pt-12" >
52
- < p className = "ui-text-overline2 text-neutral-700 pb-6" > platform</ p >
48
+ < p className = "ui-text-overline2 text-neutral-700 dark:text-neutral-600 pb-6" >
49
+ platform
50
+ </ p >
53
51
{ platforms . map ( ( item ) => (
54
52
< li className = "list-none py-6" key = { item } >
55
53
< a
56
- className = "ui-text-menu3 text-neutral-1000"
54
+ className = "ui-text-menu3 text-neutral-1000 dark:text-neutral-300 "
57
55
href = { `/platform/${ item . toLowerCase ( ) } ` }
58
56
>
59
57
{ item }
@@ -65,63 +63,95 @@ const Panels = ({
65
63
) ;
66
64
67
65
const DefaultPanelLeft = ( { title, desc } : { title : string ; desc : string } ) => (
68
- < div className = "bg-neutral-100 w-full p-24" >
69
- < h4 className = "ui-text-h4" > { title } </ h4 >
70
- < p className = "ui-text-p3 text-neutral-800 mt-8" > { desc } </ p >
66
+ < div className = "bg-neutral-100 dark:bg-neutral-1200 w-full p-24" >
67
+ < h4 className = "ui-text-h4 text-neutral-1300 dark:text-neutral-000" >
68
+ { title }
69
+ </ h4 >
70
+ < p className = "ui-text-p3 text-neutral-800 dark:text-neutral-500 mt-8" >
71
+ { desc }
72
+ </ p >
71
73
< FeaturedLink
72
74
url = ""
73
- additionalCSS = "text-neutral-1300"
75
+ additionalCSS = "text-neutral-1300 dark:text-neutral-000 "
74
76
iconColor = "text-orange-600"
75
77
>
76
78
Learn more
77
79
</ FeaturedLink >
78
80
</ div >
79
81
) ;
80
82
81
- const panelStyling = "w-full sm:w-[816px] bg-neutral-000" ;
83
+ const panelStyling = "w-full sm:w-[816px] bg-neutral-000 dark:bg-neutral-1300 " ;
82
84
83
- export const Default = Template . bind ( { } ) ;
84
- Default . args = {
85
- menuItems : [
86
- { label : "Home" , content : null , link : "" } ,
87
- {
88
- label : "Products" ,
89
- content : < Panels panelLeft = { < ProductsGrid /> } platforms = { platforms } /> ,
90
- panelStyling : panelStyling ,
91
- } ,
92
- {
93
- label : "Solutions" ,
94
- content : (
95
- < Panels
96
- panelLeft = {
97
- < DefaultPanelLeft
98
- title = "Fan engagement"
99
- desc = " Capture the attention of millions of fans during live events."
100
- />
101
- }
102
- platforms = { platforms }
103
- />
104
- ) ,
105
- panelStyling : panelStyling ,
106
- } ,
107
- {
108
- label : "Company" ,
109
- content : (
110
- < Panels
111
- panelLeft = {
112
- < DefaultPanelLeft
113
- title = "Leading the realtime revolution"
114
- desc = "Hear from our founders about Ably’s ambitious plans to become the world’s definitive realtime platform."
115
- />
116
- }
117
- platforms = { platforms }
118
- />
119
- ) ,
120
- panelStyling : panelStyling ,
85
+ const menuItems = [
86
+ { label : "Home" , content : null , link : "" } ,
87
+ {
88
+ label : "Products" ,
89
+ content : < Panels panelLeft = { < ProductsGrid /> } platforms = { platforms } /> ,
90
+ panelStyling : panelStyling ,
91
+ } ,
92
+ {
93
+ label : "Solutions" ,
94
+ content : (
95
+ < Panels
96
+ panelLeft = {
97
+ < DefaultPanelLeft
98
+ title = "Fan engagement"
99
+ desc = " Capture the attention of millions of fans during live events."
100
+ />
101
+ }
102
+ platforms = { platforms }
103
+ />
104
+ ) ,
105
+ panelStyling : panelStyling ,
106
+ } ,
107
+ {
108
+ label : "Company" ,
109
+ content : (
110
+ < Panels
111
+ panelLeft = {
112
+ < DefaultPanelLeft
113
+ title = "Leading the realtime revolution"
114
+ desc = "Hear from our founders about Ably’s ambitious plans to become the world’s definitive realtime platform."
115
+ />
116
+ }
117
+ platforms = { platforms }
118
+ />
119
+ ) ,
120
+ panelStyling : panelStyling ,
121
+ } ,
122
+ { label : "Pricing" , content : null , link : "/pricing" } ,
123
+ { label : "Docs" , content : null , link : "/docs" } ,
124
+ ] ;
125
+
126
+ const flyOutDefaultArgs = {
127
+ menuItems : menuItems ,
128
+ className : "justify-center" ,
129
+ flyOutClassName : "flex w-full justify-center" ,
130
+ viewPortClassName :
131
+ "ui-shadow-lg-medium border border-neutral-000 dark:border-neutral-1300 rounded-2xl mt-8" ,
132
+ hasAnimation : true ,
133
+ } ;
134
+
135
+ export const Default = {
136
+ render : ( ) => (
137
+ < div className = "h-[450px]" >
138
+ < Flyout { ...flyOutDefaultArgs } />
139
+ </ div >
140
+ ) ,
141
+ } ;
142
+
143
+ export const StandardContainer = {
144
+ render : ( ) => (
145
+ < div className = "ui-standard-container h-[450px] bg-neutral-000" >
146
+ < Flyout { ...flyOutDefaultArgs } />
147
+ </ div >
148
+ ) ,
149
+ parameters : {
150
+ docs : {
151
+ description : {
152
+ story :
153
+ "The Flyout component is positioned within a standard container and Animation is enabled" ,
154
+ } ,
121
155
} ,
122
- { label : "Pricing" , content : null , link : "/pricing" } ,
123
- { label : "Docs" , content : null , link : "/docs" } ,
124
- ] ,
125
- navMenuStyling : "justify-center" ,
126
- flyOutStyling : "justify-center" ,
156
+ } ,
127
157
} ;
0 commit comments