@@ -47,7 +47,7 @@ switch :: Nut
4747switch = L.componentDoc "nativeSwitch" "Yoga.React.Native.MacOS.Switch (nativeSwitch)"
4848 """nativeSwitch
4949 { on: true
50− , onChange: handler (syntheticEvent >>> \e -> ...)
50+ , onChange: E.onBool "on" setOn
5151 }"""
5252 [ propsTable
5353 [ { name: "on", type_: "Boolean", description: "Current on/off state" }
@@ -61,7 +61,7 @@ slider = L.componentDoc "nativeSlider" "Yoga.React.Native.MacOS.Slider (nativeSl
6161 { value: 50.0
6262 , minValue: 0.0
6363 , maxValue: 100.0
64− , onChange: handler (syntheticEvent >>> \e -> ...)
64+ , onChange: E.onNumber "value" setValue
6565 }"""
6666 [ propsTable
6767 [ { name: "value", type_: "Number", description: "Current value" }
@@ -80,7 +80,7 @@ stepper = L.componentDoc "nativeStepper" "Yoga.React.Native.MacOS.Stepper (nativ
8080 , minValue: 0.0
8181 , maxValue: 10.0
8282 , increment: 1.0
83− , onChange: handler (syntheticEvent >>> \e -> ...)
83+ , onChange: E.onNumber "value" setValue
8484 }"""
8585 [ propsTable
8686 [ { name: "value", type_: "Number", description: "Current value" }
@@ -96,7 +96,7 @@ checkbox = L.componentDoc "nativeCheckbox" "Yoga.React.Native.MacOS.Checkbox (na
9696 """nativeCheckbox
9797 { title: "Enable notifications"
9898 , checked: true
99− , onChange: handler (syntheticEvent >>> \e -> ...)
99+ , onChange: E.onBool "checked" setChecked
100100 }"""
101101 [ propsTable
102102 [ { name: "title", type_: "String", description: "Label text" }
@@ -111,7 +111,7 @@ radioButton = L.componentDoc "nativeRadioButton" "Yoga.React.Native.MacOS.RadioB
111111 """nativeRadioButton
112112 { title: "Option A"
113113 , selected: true
114− , onChange: handler (syntheticEvent >>> \e -> ...)
114+ , onChange: E.onBool "selected" setSelected
115115 }"""
116116 [ propsTable
117117 [ { name: "title", type_: "String", description: "Label text" }
@@ -127,7 +127,7 @@ segmented = L.componentDoc "nativeSegmented" "Yoga.React.Native.MacOS.Segmented
127127 { labels: ["One", "Two", "Three"]
128128 , sfSymbols: ["1.circle", "2.circle", "3.circle"]
129129 , selectedIndex: 0
130− , onChange: handler (syntheticEvent >>> \e -> ...)
130+ , onChange: E.onInt "selectedIndex" setIndex
131131 }"""
132132 [ propsTable
133133 [ { name: "labels", type_: "Array String", description: "Segment labels" }
@@ -142,7 +142,7 @@ popUp = L.componentDoc "nativePopUp" "Yoga.React.Native.MacOS.PopUp (nativePopUp
142142 """nativePopUp
143143 { items: ["Small", "Medium", "Large"]
144144 , selectedIndex: 1
145− , onChange: handler (syntheticEvent >>> \e -> ...)
145+ , onChange: E.onInt "selectedIndex" setIndex
146146 }"""
147147 [ propsTable
148148 [ { name: "items", type_: "Array String", description: "Menu items" }
@@ -157,8 +157,8 @@ comboBox = L.componentDoc "nativeComboBox" "Yoga.React.Native.MacOS.ComboBox (na
157157 { items: ["Apple", "Banana", "Cherry"]
158158 , text: "Apple"
159159 , placeholder: "Choose a fruit..."
160− , onChangeText: handler (syntheticEvent >>> \e -> ...)
161− , onSelectItem: handler (syntheticEvent >>> \e -> ...)
160+ , onChangeText: E.onString "text" setText
161+ , onSelectItem: E.onString "text" setText
162162 }"""
163163 [ propsTable
164164 [ { name: "items", type_: "Array String", description: "Autocomplete suggestions" }
@@ -174,8 +174,8 @@ searchField = L.componentDoc "nativeSearchField" "Yoga.React.Native.MacOS.Search
174174 """nativeSearchField
175175 { placeholder: "Search..."
176176 , text: ""
177− , onChangeText: handler (syntheticEvent >>> \e -> ...)
178− , onSearch: handler (syntheticEvent >>> \e -> ...)
177+ , onChangeText: E.onString "text" setText
178+ , onSearch: E.onString "text" \q -> search q
179179 }"""
180180 [ propsTable
181181 [ { name: "text", type_: "String", description: "Current search text" }
@@ -190,7 +190,7 @@ tokenField = L.componentDoc "nativeTokenField" "Yoga.React.Native.MacOS.TokenFie
190190 """nativeTokenField
191191 { tokens: ["tag1", "tag2"]
192192 , placeholder: "Add tags..."
193− , onChangeTokens: handler (syntheticEvent >>> \e -> ...)
193+ , onChangeTokens: E.onStrings "tokens" setTokens
194194 }"""
195195 [ propsTable
196196 [ { name: "tokens", type_: "Array String", description: "Current tokens" }
@@ -203,7 +203,7 @@ datePicker :: Nut
203203datePicker = L.componentDoc "nativeDatePicker" "Yoga.React.Native.MacOS.DatePicker (nativeDatePicker)"
204204 """nativeDatePicker
205205 { graphical: true
206− , onChange: handler (syntheticEvent >>> \e -> ...)
206+ , onChange: E.onString "date" setDate
207207 }"""
208208 [ propsTable
209209 [ { name: "graphical", type_: "Boolean", description: "Show graphical calendar picker" }
@@ -216,7 +216,7 @@ colorWell = L.componentDoc "nativeColorWell" "Yoga.React.Native.MacOS.ColorWell
216216 """nativeColorWell
217217 { color: "#ff0000"
218218 , minimal: true
219− , onChange: handler (syntheticEvent >>> \e -> ...)
219+ , onChange: E.onString "color" setColor
220220 }"""
221221 [ propsTable
222222 [ { name: "color", type_: "String", description: "Current color hex value" }