@@ -5,7 +5,8 @@ import Prelude
55import Data.Maybe (Maybe (..))
66import Data.Monoid (guard )
77import Data.Nullable (notNull , null )
8- import Lumi.Components.Button (button , secondary )
8+ import Lumi.Components.Button as Button
9+ import Lumi.Components.Button (ButtonState (..), button , secondary )
910import Lumi.Components.Column (column_ )
1011import Lumi.Components.Modal (dialog , errorModal , modal )
1112import Lumi.Components.Size (Size (..))
@@ -53,7 +54,7 @@ docs = unit # make component
5354 , onRequestClose: self.setState _ { modalId = Nothing }
5455 , onActionButtonClick: notNull $ self.setState \state -> state { clicks = state.clicks + 1 }
5556 , actionButtonTitle: " Add clicks"
56- , actionButtonDisabled: false
57+ , actionButtonState: Button.Enabled
5758 , size: Small
5859 , title: " Modal title -- Small"
5960 , variant: " "
@@ -78,7 +79,29 @@ docs = unit # make component
7879 , onRequestClose: self.setState _ { modalId = Nothing }
7980 , onActionButtonClick: notNull $ self.setState \state -> state { clicks = state.clicks + 1 }
8081 , actionButtonTitle: " Add clicks"
81- , actionButtonDisabled: true
82+ , actionButtonState: Button.Disabled
83+ , size: Medium
84+ , title: " Modal title -- Medium"
85+ , variant: " "
86+ , internalBorders: false
87+ , children:
88+ body_ " Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam pretium nec tellus ornare tincidunt. Phasellus ultrices porta finibus. In id mollis diam. Praesent efficitur lectus quis odio convallis placerat. Suspendisse metus tortor, faucibus nec imperdiet quis, iaculis id risus. Pellentesque a auctor turpis, a lacinia nulla. Pellentesque malesuada suscipit ante, sed convallis est pharetra eu. In sed enim nec lacus dignissim malesuada. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In metus arcu, efficitur et magna a, fermentum lacinia nulla. Mauris ligula erat, posuere sed diam a, sodales vestibulum ante."
89+ }
90+
91+ , example $
92+ button secondary
93+ { onPress = capture_ $ self.setState _ { modalId = Just MediumModal }
94+ , title = " Open modal, medium, action button loading"
95+ }
96+
97+ , guard (self.state.modalId == Just MediumModal ) $
98+ modal
99+ { modalOpen: true
100+ , closeButton: true
101+ , onRequestClose: self.setState _ { modalId = Nothing }
102+ , onActionButtonClick: notNull $ self.setState \state -> state { clicks = state.clicks + 1 }
103+ , actionButtonTitle: " "
104+ , actionButtonState: Button.Loading
82105 , size: Medium
83106 , title: " Modal title -- Medium"
84107 , variant: " "
@@ -100,7 +123,7 @@ docs = unit # make component
100123 , onRequestClose: self.setState _ { modalId = Nothing }
101124 , onActionButtonClick: notNull $ self.setState \state -> state { clicks = state.clicks + 1 }
102125 , actionButtonTitle: " Add clicks"
103- , actionButtonDisabled: false
126+ , actionButtonState: Button.Enabled
104127 , size: Large
105128 , title: " Modal title -- Large"
106129 , variant: " "
@@ -129,7 +152,7 @@ docs = unit # make component
129152 , onRequestClose: self.setState _ { modalId = Nothing }
130153 , onActionButtonClick: notNull $ self.setState \state -> state { clicks = state.clicks + 1 }
131154 , actionButtonTitle: " Add clicks"
132- , actionButtonDisabled: false
155+ , actionButtonState: Button.Enabled
133156 , size: ExtraLarge
134157 , title: " Modal title -- Extra Large"
135158 , variant: " "
@@ -175,7 +198,7 @@ docs = unit # make component
175198 , onRequestClose: self.setState _ { modalId = Nothing }
176199 , onActionButtonClick: notNull $ self.setState \state -> state { clicks = state.clicks + 1 }
177200 , actionButtonTitle: " Add clicks"
178- , actionButtonDisabled: false
201+ , actionButtonState: Button.Enabled
179202 , size: Small
180203 , title: " Modal title -- Small"
181204 , variant: " "
@@ -200,7 +223,7 @@ docs = unit # make component
200223 , onRequestClose: self.setState _ { modalId = Nothing }
201224 , onActionButtonClick: notNull $ self.setState \state -> state { clicks = state.clicks + 1 }
202225 , actionButtonTitle: " Add clicks"
203- , actionButtonDisabled: false
226+ , actionButtonState: Button.Enabled
204227 , size: Large
205228 , title: " Modal title -- Internall scrolling content"
206229 , variant: " internal-scrolling"
0 commit comments