@@ -27,10 +27,13 @@ page =
28button :: Nut
28button :: Nut
29button = L.componentDoc "nativeButton" "Yoga.React.Native.MacOS.Button (nativeButton)"
29button = L.componentDoc "nativeButton" "Yoga.React.Native.MacOS.Button (nativeButton)"
30+ """status /\ setStatus <- useState' "Ready"
30− """nativeButton
32+nativeButton
31− { title: "Click me"
33+ { title: "Say Hello"
32 , bezelStyle: T.push
34 , bezelStyle: T.push
33− , onPress: doSomething
35+ , primary: true
36+ , onPress: setStatus "Hello from PureScript!"
35 [ propsTable
38 [ propsTable
36 [ { name: "title", type_: "String", description: "Button label text (mutually exclusive with sfSymbol)" }
39 [ { name: "title", type_: "String", description: "Button label text (mutually exclusive with sfSymbol)" }
@@ -45,8 +48,10 @@ button = L.componentDoc "nativeButton" "Yoga.React.Native.MacOS.Button (nativeBu
46switch :: Nut
49switch :: Nut
47switch = L.componentDoc "nativeSwitch" "Yoga.React.Native.MacOS.Switch (nativeSwitch)"
50switch = L.componentDoc "nativeSwitch" "Yoga.React.Native.MacOS.Switch (nativeSwitch)"
51+ """on /\ setOn <- useState' false
48− """nativeSwitch
53+nativeSwitch
50 , onChange: setOn
55 , onChange: setOn
52 [ propsTable
57 [ propsTable
@@ -57,10 +62,13 @@ switch = L.componentDoc "nativeSwitch" "Yoga.React.Native.MacOS.Switch (nativeSw
58slider :: Nut
63slider :: Nut
59slider = L.componentDoc "nativeSlider" "Yoga.React.Native.MacOS.Slider (nativeSlider)"
64slider = L.componentDoc "nativeSlider" "Yoga.React.Native.MacOS.Slider (nativeSlider)"
60− """nativeSlider
65+ """value /\ setValue <- useState' 50.0
62 , minValue: 0.0
69 , minValue: 0.0
63 , maxValue: 100.0
70 , maxValue: 100.0
71+ , numberOfTickMarks: 11
64 , onChange: setValue
72 , onChange: setValue
66 [ propsTable
74 [ propsTable
@@ -75,10 +83,12 @@ slider = L.componentDoc "nativeSlider" "Yoga.React.Native.MacOS.Slider (nativeSl
76stepper :: Nut
84stepper :: Nut
77stepper = L.componentDoc "nativeStepper" "Yoga.React.Native.MacOS.Stepper (nativeStepper)"
85stepper = L.componentDoc "nativeStepper" "Yoga.React.Native.MacOS.Stepper (nativeStepper)"
78− """nativeStepper
86+ """value /\ setValue <- useState' 5.0
80 , minValue: 0.0
90 , minValue: 0.0
81− , maxValue: 10.0
91+ , maxValue: 50.0
82 , increment: 1.0
92 , increment: 1.0
83 , onChange: setValue
93 , onChange: setValue
@@ -93,10 +103,13 @@ stepper = L.componentDoc "nativeStepper" "Yoga.React.Native.MacOS.Stepper (nativ
94checkbox :: Nut
104checkbox :: Nut
95checkbox = L.componentDoc "nativeCheckbox" "Yoga.React.Native.MacOS.Checkbox (nativeCheckbox)"
105checkbox = L.componentDoc "nativeCheckbox" "Yoga.React.Native.MacOS.Checkbox (nativeCheckbox)"
106+ """a /\ setA <- useState' true
96− """nativeCheckbox
108+nativeCheckbox
97− { title: "Enable notifications"
110+ , title: "Enable notifications"
98− , checked: true
111+ , enabled: true
99− , onChange: setChecked
112+ , onChange: setA
101 [ propsTable
114 [ propsTable
102 [ { name: "title", type_: "String", description: "Label text" }
115 [ { name: "title", type_: "String", description: "Label text" }
@@ -108,10 +121,19 @@ checkbox = L.componentDoc "nativeCheckbox" "Yoga.React.Native.MacOS.Checkbox (na
109radioButton :: Nut
122radioButton :: Nut
110radioButton = L.componentDoc "nativeRadioButton" "Yoga.React.Native.MacOS.RadioButton (nativeRadioButton)"
123radioButton = L.componentDoc "nativeRadioButton" "Yoga.React.Native.MacOS.RadioButton (nativeRadioButton)"
124+ """choice /\ setChoice <- useState' "option1"
111− """nativeRadioButton
126+nativeRadioButton
127+ { selected: choice == "option1"
112− { title: "Option A"
128+ , title: "Small"
130+ , onChange: \_ -> setChoice "option1"
113− , selected: true
133+ { selected: choice == "option2"
114− , onChange: \_ -> setChoice "optionA"
136+ , onChange: \_ -> setChoice "option2"
116 [ propsTable
138 [ propsTable
117 [ { name: "title", type_: "String", description: "Label text" }
139 [ { name: "title", type_: "String", description: "Label text" }
@@ -123,11 +145,12 @@ radioButton = L.componentDoc "nativeRadioButton" "Yoga.React.Native.MacOS.RadioB
124segmented :: Nut
146segmented :: Nut
125segmented = L.componentDoc "nativeSegmented" "Yoga.React.Native.MacOS.Segmented (nativeSegmented)"
147segmented = L.componentDoc "nativeSegmented" "Yoga.React.Native.MacOS.Segmented (nativeSegmented)"
148+ """mapType /\ setMapType <- useState' 0
126− """nativeSegmented
150+nativeSegmented
127− { labels: ["One", "Two", "Three"]
151+ { labels: [ "Standard", "Satellite", "Hybrid" ]
128− , sfSymbols: ["1.circle", "2.circle", "3.circle"]
129− , selectedIndex: 0
152+ , selectedIndex: mapType
130− , onChange: setIndex
153+ , onChange: setMapType
132 [ propsTable
155 [ propsTable
133 [ { name: "labels", type_: "Array String", description: "Segment labels" }
156 [ { name: "labels", type_: "Array String", description: "Segment labels" }
@@ -139,10 +162,16 @@ segmented = L.componentDoc "nativeSegmented" "Yoga.React.Native.MacOS.Segmented
140popUp :: Nut
163popUp :: Nut
141popUp = L.componentDoc "nativePopUp" "Yoga.React.Native.MacOS.PopUp (nativePopUp)"
164popUp = L.componentDoc "nativePopUp" "Yoga.React.Native.MacOS.PopUp (nativePopUp)"
142− """nativePopUp
165+ """idx /\ setIdx <- useState' 0
166+title /\ setTitle <- useState' "Small"
143− { items: ["Small", "Medium", "Large"]
167+let items = [ "Small", "Medium", "Large", "Extra Large" ]
144− , selectedIndex: 1
171+ , selectedIndex: idx
145− , onChange: setIndex
172+ , onChange: \i -> do
174+ setTitle (fromMaybe "" (items !! i))
147 [ propsTable
176 [ propsTable
148 [ { name: "items", type_: "Array String", description: "Menu items" }
177 [ { name: "items", type_: "Array String", description: "Menu items" }
@@ -153,12 +182,17 @@ popUp = L.componentDoc "nativePopUp" "Yoga.React.Native.MacOS.PopUp (nativePopUp
154comboBox :: Nut
183comboBox :: Nut
155comboBox = L.componentDoc "nativeComboBox" "Yoga.React.Native.MacOS.ComboBox (nativeComboBox)"
184comboBox = L.componentDoc "nativeComboBox" "Yoga.React.Native.MacOS.ComboBox (nativeComboBox)"
185+ """txt /\ setTxt <- useState' ""
186+result /\ setResult <- useState' ""
156− """nativeComboBox
188+nativeComboBox
157− { items: ["Apple", "Banana", "Cherry"]
189+ { items: [ "Apple", "Banana", "Cherry", "Date", "Elderberry", "Fig", "Grape" ]
158− , text: "Apple"
190+ , text: txt
159− , placeholder: "Choose a fruit..."
191+ , placeholder: "Type a fruit..."
160− , onChangeText: setText
192+ , onChangeText: setTxt
161− , onSelectItem: setText
193+ , onSelectItem: \t -> do
195+ setResult ("Selected: " <> t)
163 [ propsTable
197 [ propsTable
164 [ { name: "items", type_: "Array String", description: "Autocomplete suggestions" }
198 [ { name: "items", type_: "Array String", description: "Autocomplete suggestions" }
@@ -171,11 +205,14 @@ comboBox = L.componentDoc "nativeComboBox" "Yoga.React.Native.MacOS.ComboBox (na
172searchField :: Nut
206searchField :: Nut
173searchField = L.componentDoc "nativeSearchField" "Yoga.React.Native.MacOS.SearchField (nativeSearchField)"
207searchField = L.componentDoc "nativeSearchField" "Yoga.React.Native.MacOS.SearchField (nativeSearchField)"
208+ """query /\ setQuery <- useState' ""
209+result /\ setResult <- useState' ""
174− """nativeSearchField
211+nativeSearchField
175− { placeholder: "Search..."
213+ , placeholder: "Search..."
177− , onChangeText: setText
214+ , onChangeText: setQuery
178− , onSearch: \q -> search q
215+ , onSearch: \t -> setResult ("Searched: " <> t)
180 [ propsTable
217 [ propsTable
181 [ { name: "text", type_: "String", description: "Current search text" }
218 [ { name: "text", type_: "String", description: "Current search text" }
@@ -187,8 +224,10 @@ searchField = L.componentDoc "nativeSearchField" "Yoga.React.Native.MacOS.Search
188tokenField :: Nut
225tokenField :: Nut
189tokenField = L.componentDoc "nativeTokenField" "Yoga.React.Native.MacOS.TokenField (nativeTokenField)"
226tokenField = L.componentDoc "nativeTokenField" "Yoga.React.Native.MacOS.TokenField (nativeTokenField)"
190− """nativeTokenField
227+ """tokens /\ setTokens <- useState' [ "PureScript", "React", "macOS" ]
191− { tokens: ["tag1", "tag2"]
228+
192 , placeholder: "Add tags..."
231 , placeholder: "Add tags..."
193 , onChangeTokens: setTokens
232 , onChangeTokens: setTokens
@@ -201,9 +240,11 @@ tokenField = L.componentDoc "nativeTokenField" "Yoga.React.Native.MacOS.TokenFie
202datePicker :: Nut
241datePicker :: Nut
203datePicker = L.componentDoc "nativeDatePicker" "Yoga.React.Native.MacOS.DatePicker (nativeDatePicker)"
242datePicker = L.componentDoc "nativeDatePicker" "Yoga.React.Native.MacOS.DatePicker (nativeDatePicker)"
243+ """dateText /\ setDateText <- useState' ""
204− """nativeDatePicker
245+nativeDatePicker
205− { graphical: true
246+ { graphical: false
206− , onChange: setDate
247+ , onChange: setDateText
208 [ propsTable
249 [ propsTable
209 [ { name: "graphical", type_: "Boolean", description: "Show graphical calendar picker" }
250 [ { name: "graphical", type_: "Boolean", description: "Show graphical calendar picker" }
@@ -213,8 +254,10 @@ datePicker = L.componentDoc "nativeDatePicker" "Yoga.React.Native.MacOS.DatePick
214colorWell :: Nut
255colorWell :: Nut
215colorWell = L.componentDoc "nativeColorWell" "Yoga.React.Native.MacOS.ColorWell (nativeColorWell)"
256colorWell = L.componentDoc "nativeColorWell" "Yoga.React.Native.MacOS.ColorWell (nativeColorWell)"
257+ """color /\ setColor <- useState' "#FF6600"
216− """nativeColorWell
259+nativeColorWell
217− { color: "#ff0000"
260+ { color
218 , minimal: true
261 , minimal: true
219 , onChange: setColor
262 , onChange: setColor