@colisweb/rescript-toolkit 2.71.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/.yarn/cache/@colisweb-restorative-npm-1.0.0-5eac899f0c-6e80ecc641.zip +0 -0
  2. package/.yarn/cache/@rescript-react-npm-0.11.0-687f8fa3b5-c399d114f7.zip +0 -0
  3. package/.yarn/cache/{rescript-npm-10.0.1-c064c63c72-59ae153c7f.zip → rescript-npm-10.1.2-eb312a329e-e70ae09da1.zip} +0 -0
  4. package/.yarn/install-state.gz +0 -0
  5. package/bsconfig.json +2 -2
  6. package/locale/fr.json +5 -0
  7. package/package.json +4 -5
  8. package/playground/PlaygroundApp.res +12 -0
  9. package/playground/PlaygroundBindings.res +106 -0
  10. package/playground/PlaygroundHooks.res +4 -4
  11. package/playground/PlaygroundRouter.res +18 -0
  12. package/playground/bindings/Playground_Bindings_Reach.res +143 -0
  13. package/playground/components/Playground_Form.res +56 -3
  14. package/playground/components/Playground_Modal.res +20 -5
  15. package/playground/components/Playground_Select.res +14 -4
  16. package/playground/hooks/{Playground_Clipboard.res → Playground_Hooks_Clipboard.res} +1 -1
  17. package/playground/hooks/{Playground_Disclosure.res → Playground_Hooks_Disclosure.res} +1 -1
  18. package/playground/hooks/{Playground_LazyLoad.res → Playground_Hooks_LazyLoad.res} +1 -1
  19. package/playground/hooks/{Playground_MediaQueries.res → Playground_Hooks_MediaQueries.res} +1 -1
  20. package/src/decoders/Toolkit__Decoders.res +1 -1
  21. package/src/form/Reform.res +8 -36
  22. package/src/form/Toolkit__Form.res +114 -55
  23. package/src/form/Toolkit__FormValidationFunctions.res +13 -0
  24. package/src/hooks/Toolkit__Hooks.res +1 -1
  25. package/src/intl/Toolkit__Intl.res +1 -1
  26. package/src/intl/Toolkit__Intl.resi +1 -1
  27. package/src/logger/Toolkit__NativeLogger.res +1 -1
  28. package/src/router/Toolkit__Router.res +0 -6
  29. package/src/ui/Toolkit__Ui.res +0 -2
  30. package/src/ui/Toolkit__Ui_Dropdown.res +13 -7
  31. package/src/ui/Toolkit__Ui_Dropdown.resi +2 -0
  32. package/src/ui/Toolkit__Ui_Layout.res +1 -6
  33. package/src/ui/Toolkit__Ui_MultiSelect.res +10 -4
  34. package/src/ui/Toolkit__Ui_MultiSelect.resi +5 -1
  35. package/src/ui/Toolkit__Ui_NativeDatePicker.res +2 -2
  36. package/src/ui/Toolkit__Ui_Select.res +22 -5
  37. package/src/ui/Toolkit__Ui_Select.resi +13 -2
  38. package/src/ui/Toolkit__Ui_SelectPolyvariant.res +45 -0
  39. package/src/ui/Toolkit__Ui_Table.res +11 -6
  40. package/src/ui/Toolkit__Ui_TextInput.res +2 -2
  41. package/src/ui/Toolkit__Ui_WeekDateFilter.res +16 -16
  42. package/src/utils/Toolkit__Utils_UnitMeasure.res +4 -4
  43. package/src/vendors/{BsCopyToClipboard.res → CopyToClipboard.res} +0 -0
  44. package/src/vendors/{BsDateFns.res → DateFns.res} +0 -0
  45. package/src/vendors/{BsJsCookie.res → JsCookie.res} +0 -0
  46. package/src/vendors/{BsReactDayPicker.res → ReactDayPicker.res} +0 -1
  47. package/src/vendors/{BsReactGoogleMaps.res → ReactGoogleMaps.res} +0 -0
  48. package/src/vendors/ReactIcons.res +5 -0
  49. package/src/vendors/{BsReactSelect.res → ReactSelect.res} +58 -58
  50. package/src/vendors/{BsSentryReactNative.res → SentryReactNative.res} +0 -0
  51. package/src/vendors/reach-ui/ReachUi_Accordion.res +12 -14
  52. package/src/vendors/reach-ui/ReachUi_AlertDialog.res +8 -34
  53. package/src/vendors/reach-ui/ReachUi_Dialog.res +7 -10
  54. package/src/vendors/reach-ui/ReachUi_Listbox.res +8 -9
  55. package/src/vendors/reach-ui/ReachUi_MenuButton.res +7 -30
  56. package/src/vendors/reach-ui/ReachUi_Popover.res +0 -6
  57. package/src/vendors/reach-ui/ReachUi_Tabs.res +18 -27
  58. package/.yarn/cache/@colisweb-restorative-npm-0.5.1-2ffe068813-cd8332a7eb.zip +0 -0
  59. package/.yarn/cache/@rescript-react-npm-0.10.3-26bd5d697f-8561282f78.zip +0 -0
  60. package/.yarn/cache/compute-scroll-into-view-npm-1.0.16-a8a68c1929-4334db6397.zip +0 -0
  61. package/.yarn/cache/downshift-npm-5.2.5-14bb33ffd8-498b4764a8.zip +0 -0
  62. package/src/mock/MockOverlay.resi +0 -4
  63. package/src/ui/Toolkit__Ui_Listbox.res +0 -123
  64. package/src/ui/Toolkit__Ui_ListboxInput.res +0 -673
  65. package/src/vendors/BsAnalytics.res +0 -34
  66. package/src/vendors/BsDownshift.res +0 -596
@@ -27,12 +27,17 @@ module Pagination = {
27
27
  <div className="w-20">
28
28
  <Toolkit__Ui_Select
29
29
  value={table.state.pageSize->Int.toString}
30
- onChange={value => table.setPageSize(value)}
31
- options={[25, 50, 100]->Array.map(pageSize => (
32
- pageSize->Int.toString,
33
- pageSize->Int.toString,
34
- true,
35
- ))}
30
+ onChange={value => {
31
+ value
32
+ ->Int.fromString
33
+ ->Option.forEach(pageSize => {
34
+ table.setPageSize(pageSize)
35
+ })
36
+ }}
37
+ options={[25, 50, 100]->Array.map((pageSize): Toolkit__Ui_Select.selectOption => {
38
+ label: pageSize->Int.toString,
39
+ value: pageSize->Int.toString,
40
+ })}
36
41
  />
37
42
  </div>
38
43
  </div>
@@ -22,10 +22,10 @@ let make = React.forwardRef((
22
22
  ~isInvalid: option<bool>=?,
23
23
  ~className: string="",
24
24
  ~style: option<ReactDOM.style>=?,
25
- ref_,
25
+ ref,
26
26
  ) =>
27
27
  <input
28
- ref=?{ref_->Js.Nullable.toOption->Option.map(ReactDOM.Ref.domRef)}
28
+ ref=?{ref->Js.Nullable.toOption->Option.map(ReactDOM.Ref.domRef)}
29
29
  className={cx([
30
30
  className,
31
31
  "appearance-none outline-none transition duration-150 ease-in-out block w-full bg-white text-gray-800 border rounded py-2 px-4 leading-tight focus:z30 relative disabled:bg-gray-200 disabled:text-gray-700",
@@ -49,11 +49,11 @@ let make = (~initialStart=?, ~selectedDay=?, ~children: state => React.element)
49
49
  UpdateWithSideEffects(
50
50
  {
51
51
  timeslot: {
52
- start: state.timeslot.start->BsDateFns.subDays(timeSlotLength)->BsDateFns.startOfDay,
53
- end_: state.timeslot.start->BsDateFns.subDays(1),
52
+ start: state.timeslot.start->DateFns.subDays(timeSlotLength)->DateFns.startOfDay,
53
+ end_: state.timeslot.start->DateFns.subDays(1),
54
54
  },
55
55
  selectedDay: state.selectedDay->Option.map(_ =>
56
- state.timeslot.start->BsDateFns.subDays(timeSlotLength)->BsDateFns.startOfDay
56
+ state.timeslot.start->DateFns.subDays(timeSlotLength)->DateFns.startOfDay
57
57
  ),
58
58
  },
59
59
  ({state}) => {
@@ -65,7 +65,7 @@ let make = (~initialStart=?, ~selectedDay=?, ~children: state => React.element)
65
65
  }->queryParams_encode,
66
66
  {
67
67
  addQueryPrefix: true,
68
- serializeDate: d => d->BsDateFns.formatWithPattern("yyyy-MM-dd"),
68
+ serializeDate: d => d->DateFns.formatWithPattern("yyyy-MM-dd"),
69
69
  },
70
70
  ),
71
71
  )
@@ -76,11 +76,11 @@ let make = (~initialStart=?, ~selectedDay=?, ~children: state => React.element)
76
76
  UpdateWithSideEffects(
77
77
  {
78
78
  timeslot: {
79
- start: state.timeslot.end_->BsDateFns.addDays(1),
80
- end_: state.timeslot.end_->BsDateFns.addDays(timeSlotLength),
79
+ start: state.timeslot.end_->DateFns.addDays(1),
80
+ end_: state.timeslot.end_->DateFns.addDays(timeSlotLength),
81
81
  },
82
82
  selectedDay: state.selectedDay->Option.map(_ =>
83
- state.timeslot.end_->BsDateFns.addDays(1)
83
+ state.timeslot.end_->DateFns.addDays(1)
84
84
  ),
85
85
  },
86
86
  ({state}) => {
@@ -92,7 +92,7 @@ let make = (~initialStart=?, ~selectedDay=?, ~children: state => React.element)
92
92
  }->queryParams_encode,
93
93
  {
94
94
  addQueryPrefix: true,
95
- serializeDate: d => d->BsDateFns.formatWithPattern("yyyy-MM-dd"),
95
+ serializeDate: d => d->DateFns.formatWithPattern("yyyy-MM-dd"),
96
96
  },
97
97
  ),
98
98
  )
@@ -111,7 +111,7 @@ let make = (~initialStart=?, ~selectedDay=?, ~children: state => React.element)
111
111
  }->queryParams_encode,
112
112
  {
113
113
  addQueryPrefix: true,
114
- serializeDate: d => d->BsDateFns.formatWithPattern("yyyy-MM-dd"),
114
+ serializeDate: d => d->DateFns.formatWithPattern("yyyy-MM-dd"),
115
115
  },
116
116
  ),
117
117
  )
@@ -122,11 +122,11 @@ let make = (~initialStart=?, ~selectedDay=?, ~children: state => React.element)
122
122
  () => {
123
123
  let defaultTimeslot: Toolkit__Decoders.DatetimeTimeSlot.t = {
124
124
  let today = Js.Date.make()
125
- let timeSlotStart = isSm ? BsDateFns.startOfWeek(today, {weekStartsOn: 1}) : today
125
+ let timeSlotStart = isSm ? DateFns.startOfWeek(today, {weekStartsOn: 1}) : today
126
126
 
127
127
  let timeSlotEnd = isSm
128
- ? BsDateFns.endOfWeek(today, {weekStartsOn: 1})
129
- : today->BsDateFns.addDays(2)
128
+ ? DateFns.endOfWeek(today, {weekStartsOn: 1})
129
+ : today->DateFns.addDays(2)
130
130
  {
131
131
  start: timeSlotStart,
132
132
  end_: timeSlotEnd,
@@ -136,7 +136,7 @@ let make = (~initialStart=?, ~selectedDay=?, ~children: state => React.element)
136
136
  {
137
137
  timeslot: initialStart->Option.mapWithDefault(defaultTimeslot, start => {
138
138
  start,
139
- end_: start->BsDateFns.addDays(timeSlotLength - 1),
139
+ end_: start->DateFns.addDays(timeSlotLength - 1),
140
140
  }),
141
141
  selectedDay: selectedDay->Option.isSome
142
142
  ? selectedDay
@@ -158,15 +158,15 @@ let make = (~initialStart=?, ~selectedDay=?, ~children: state => React.element)
158
158
  icon={<ReactIcons.MdKeyboardArrowLeft size=30 />}
159
159
  />
160
160
  <div className="flex items-center mx-2">
161
- {BsDateFns.eachDayOfInterval({
161
+ {DateFns.eachDayOfInterval({
162
162
  start: timeslot.start,
163
163
  end_: timeslot.end_,
164
164
  })
165
165
  ->Array.mapWithIndex((i, day) => {
166
166
  let isSelected =
167
- selectedDay->Option.mapWithDefault(false, sDay => BsDateFns.isSameDay(sDay, day))
167
+ selectedDay->Option.mapWithDefault(false, sDay => DateFns.isSameDay(sDay, day))
168
168
  <React.Fragment key={`${i->Int.toString}-day`}>
169
- {i == 0 || day->BsDateFns.isFirstDayOfMonth
169
+ {i == 0 || day->DateFns.isFirstDayOfMonth
170
170
  ? <p className="text-xs text-neutral-600 uppercase">
171
171
  <FormattedDate value=day month=#short />
172
172
  </p>
@@ -91,15 +91,15 @@ module Time = {
91
91
 
92
92
  let duration = switch value {
93
93
  | #min(v) =>
94
- BsDateFns.intervalToDuration(
94
+ DateFns.intervalToDuration(
95
95
  ~interval={
96
96
  start: _initialDate,
97
- end_: _initialDate->BsDateFns.addMinutes(v),
97
+ end_: _initialDate->DateFns.addMinutes(v),
98
98
  },
99
99
  )
100
100
  | #h(v) =>
101
- BsDateFns.intervalToDuration(
102
- ~interval={start: _initialDate, end_: _initialDate->BsDateFns.addHours(v)},
101
+ DateFns.intervalToDuration(
102
+ ~interval={start: _initialDate, end_: _initialDate->DateFns.addHours(v)},
103
103
  )
104
104
  }
105
105
 
File without changes
File without changes
@@ -71,7 +71,6 @@ module ReactDayPicker = {
71
71
  ~months: 'a=?,
72
72
  ~showOutsideDays: bool=?,
73
73
  ~dayPickerProps: dayPickerProps=?,
74
- ~formatDate: Js.Date.t => string=?,
75
74
  ~ref: ReactDOM.Ref.t=?,
76
75
  ) => React.element = "DayPickerInput"
77
76
  }
@@ -6028,3 +6028,8 @@ module BsPalette = {
6028
6028
  external make: (~size: int=?, ~color: string=?, ~className: string=?) => React.element =
6029
6029
  "BsPalette"
6030
6030
  }
6031
+ module VscFolderLibrary = {
6032
+ @module("react-icons/vsc") @react.component
6033
+ external make: (~size: int=?, ~color: string=?, ~className: string=?) => React.element =
6034
+ "VscFolderLibrary"
6035
+ }
@@ -13,18 +13,18 @@ type optionMessageCb = {inputValue: string}
13
13
  module ReactSelect = {
14
14
  @module("react-select") @react.component
15
15
  external make: (
16
- ~defaultMenuIsOpen: option<bool>=?,
16
+ ~defaultMenuIsOpen: bool=?,
17
17
  ~name: string,
18
- ~autoFocus: option<bool>=?,
19
- ~isMulti: option<bool>=?,
20
- ~isDisabled: option<bool>=?,
21
- ~isLoading: option<bool>=?,
22
- ~isSearchable: option<bool>=?,
23
- ~placeholder: option<string>=?,
24
- ~className: option<string>=?,
25
- ~classNamePrefix: option<string>=?,
26
- ~value: option<labelOption<'value>>=?,
27
- ~defaultValue: option<'value>=?,
18
+ ~autoFocus: bool=?,
19
+ ~isMulti: bool=?,
20
+ ~isDisabled: bool=?,
21
+ ~isLoading: bool=?,
22
+ ~isSearchable: bool=?,
23
+ ~placeholder: string=?,
24
+ ~className: string=?,
25
+ ~classNamePrefix: string=?,
26
+ ~value: labelOption<'value>=?,
27
+ ~defaultValue: 'value=?,
28
28
  ~onChange: labelOption<'value> => unit,
29
29
  ~options: array<labelOption<'value>>,
30
30
  ~noOptionsMessage: option<optionMessage => Js.Nullable.t<string>>=?,
@@ -36,33 +36,33 @@ module ReactSelectMultiple = {
36
36
  @module("react-select") @react.component
37
37
  external make: (
38
38
  ~name: string,
39
- ~defaultMenuIsOpen: option<bool>=?,
40
- ~autoFocus: option<bool>=?,
41
- ~isMulti: option<bool>=?,
42
- ~isDisabled: option<bool>=?,
43
- ~isLoading: option<bool>=?,
44
- ~isSearchable: option<bool>=?,
45
- ~placeholder: option<string>=?,
46
- ~className: option<string>=?,
47
- ~classNamePrefix: option<string>=?,
39
+ ~defaultMenuIsOpen: bool=?,
40
+ ~autoFocus: bool=?,
41
+ ~isMulti: bool=?,
42
+ ~isDisabled: bool=?,
43
+ ~isLoading: bool=?,
44
+ ~isSearchable: bool=?,
45
+ ~placeholder: string=?,
46
+ ~className: string=?,
47
+ ~classNamePrefix: string=?,
48
48
  ~defaultValue: array<labelOption<'value>>=?,
49
49
  ~onChange: array<labelOption<'value>> => unit,
50
50
  ~options: array<labelOption<'value>>,
51
- ~noOptionsMessage: option<optionMessage => Js.Nullable.t<string>>=?,
51
+ ~noOptionsMessage: optionMessage => Js.Nullable.t<string>=?,
52
52
  ) => React.element = "default"
53
53
  }
54
54
 
55
55
  @react.component
56
56
  let make = (
57
57
  ~name: string,
58
- ~autoFocus: option<bool>=?,
59
- ~isSearchable: option<bool>=?,
60
- ~defaultMenuIsOpen: option<bool>=?,
61
- ~isDisabled: option<bool>=?,
62
- ~isLoading: option<bool>=?,
63
- ~placeholder: option<string>=?,
64
- ~className: option<string>=?,
65
- ~classNamePrefix: option<string>=?,
58
+ ~autoFocus: bool=?,
59
+ ~isSearchable: bool=?,
60
+ ~defaultMenuIsOpen: bool=?,
61
+ ~isDisabled: bool=?,
62
+ ~isLoading: bool=?,
63
+ ~placeholder: string=?,
64
+ ~className: string=?,
65
+ ~classNamePrefix: string=?,
66
66
  ~defaultValue: array<labelOption<'value>>,
67
67
  ~onChange: array<labelOption<'value>> => unit,
68
68
  ~options: array<labelOption<'value>>,
@@ -90,20 +90,20 @@ module ReactAsyncSelect = {
90
90
  @module("react-select/async") @react.component
91
91
  external make: (
92
92
  ~name: string,
93
- ~autoFocus: option<bool>=?,
94
- ~isMulti: option<bool>=?,
95
- ~isDisabled: option<bool>=?,
96
- ~isLoading: option<bool>=?,
97
- ~isSearchable: option<bool>=?,
98
- ~placeholder: option<string>=?,
93
+ ~autoFocus: bool=?,
94
+ ~isMulti: bool=?,
95
+ ~isDisabled: bool=?,
96
+ ~isLoading: bool=?,
97
+ ~isSearchable: bool=?,
98
+ ~placeholder: string=?,
99
99
  ~noOptionsMessage: optionMessageCb => string=?,
100
100
  ~loadingMessage: optionMessageCb => string=?,
101
- ~className: option<string>=?,
102
- ~classNamePrefix: option<string>=?,
103
- ~value: option<labelOption<'value>>=?,
101
+ ~className: string=?,
102
+ ~classNamePrefix: string=?,
103
+ ~value: labelOption<'value>=?,
104
104
  ~defaultValue: option<'value>=?,
105
105
  ~onChange: labelOption<'value> => unit,
106
- ~cacheOptions: option<bool>=?,
106
+ ~cacheOptions: bool=?,
107
107
  ~defaultOptions: option<array<labelOption<'value>>>=?,
108
108
  ~loadOptions: string => Promise.Js.t<array<labelOption<'value>>, string>,
109
109
  ) => React.element = "default"
@@ -113,20 +113,20 @@ module ReactAsyncSelectMultiple = {
113
113
  @module("react-select/async") @react.component
114
114
  external make: (
115
115
  ~name: string,
116
- ~autoFocus: option<bool>=?,
117
- ~isMulti: option<bool>=?,
118
- ~isDisabled: option<bool>=?,
119
- ~isLoading: option<bool>=?,
120
- ~isSearchable: option<bool>=?,
121
- ~placeholder: option<string>=?,
116
+ ~autoFocus: bool=?,
117
+ ~isMulti: bool=?,
118
+ ~isDisabled: bool=?,
119
+ ~isLoading: bool=?,
120
+ ~isSearchable: bool=?,
121
+ ~placeholder: string=?,
122
122
  ~noOptionsMessage: optionMessageCb => string=?,
123
123
  ~loadingMessage: optionMessageCb => string=?,
124
- ~className: option<string>=?,
125
- ~classNamePrefix: option<string>=?,
124
+ ~className: string=?,
125
+ ~classNamePrefix: string=?,
126
126
  ~value: option<array<labelOption<'value>>>=?,
127
127
  ~defaultValue: option<'value>=?,
128
128
  ~onChange: array<labelOption<'value>> => unit,
129
- ~cacheOptions: option<bool>=?,
129
+ ~cacheOptions: bool=?,
130
130
  ~defaultOptions: option<array<labelOption<'value>>>=?,
131
131
  ~loadOptions: string => Promise.Js.t<array<labelOption<'value>>, string>,
132
132
  ) => React.element = "default"
@@ -144,18 +144,18 @@ module ReactSelectMultipleCreateInput = {
144
144
  external make: (
145
145
  ~components: components,
146
146
  ~inputValue: string,
147
- ~isClearable: option<bool>=?,
148
- ~isMulti: option<bool>=?,
149
- ~menuIsOpen: option<bool>=?,
147
+ ~isClearable: bool=?,
148
+ ~isMulti: bool=?,
149
+ ~menuIsOpen: bool=?,
150
150
  ~onChange: array<labelOption<'a>> => unit,
151
151
  ~onInputChange: string => unit,
152
152
  ~onKeyDown: ReactEvent.Keyboard.t => unit,
153
- ~placeholder: option<string>=?,
153
+ ~placeholder: string=?,
154
154
  ~value: array<labelOption<'a>>,
155
- ~isDisabled: option<bool>=?,
156
- ~isLoading: option<bool>=?,
157
- ~className: option<string>=?,
158
- ~id: option<string>=?,
155
+ ~isDisabled: bool=?,
156
+ ~isLoading: bool=?,
157
+ ~className: string=?,
158
+ ~id: string=?,
159
159
  ) => React.element = "default"
160
160
  }
161
161
 
@@ -167,8 +167,8 @@ module ReactSelectMultipleCreateInput = {
167
167
  ~placeholder="",
168
168
  ~isDisabled=false,
169
169
  ~isLoading=false,
170
- ~className: option<string>=?,
171
- ~id: option<string>=?,
170
+ ~className: string=?,
171
+ ~id: string=?,
172
172
  ) => {
173
173
  let (inputValue, onInputChange) = React.useState(() => "")
174
174
  let onInputChange = v => onInputChange(_ => v)
@@ -4,24 +4,23 @@ module Accordion = {
4
4
  @module("@reach/accordion") @react.component
5
5
  external make: (
6
6
  ~children: React.element,
7
- ~index: option<int>=?,
8
- ~defaultIndex: option<int>=?,
9
- ~collapsible: option<bool>=?,
10
- ~multiple: option<bool>=?,
11
- ~readOnly: option<bool>=?,
12
- ~onChange: option<int => unit>=?,
13
- ~readOnly: option<bool>=?,
7
+ ~index: int=?,
8
+ ~defaultIndex: int=?,
9
+ ~collapsible: bool=?,
10
+ ~multiple: bool=?,
11
+ ~readOnly: bool=?,
12
+ ~onChange: int => unit=?,
14
13
  ) => React.element = "Accordion"
15
14
  }
16
15
 
17
16
  module AccordionItem = {
18
17
  @module("@reach/accordion") @react.component
19
- external make: (~children: React.element, ~_as: option<as_>=?) => React.element = "AccordionItem"
18
+ external make: (~children: React.element, ~_as: as_=?) => React.element = "AccordionItem"
20
19
  }
21
20
 
22
21
  module AccordionPanel = {
23
22
  @module("@reach/accordion") @react.component
24
- external make: (~children: React.element, ~_as: option<as_>=?) => React.element = "AccordionPanel"
23
+ external make: (~children: React.element, ~_as: as_=?) => React.element = "AccordionPanel"
25
24
  }
26
25
  module AccordionButton = {
27
26
  @module("@reach/accordion") @react.component
@@ -36,11 +35,10 @@ module ControlledAccordionMultiple = {
36
35
  @module("@reach/accordion") @react.component
37
36
  external make: (
38
37
  ~children: React.element,
39
- ~index: option<array<int>>=?,
40
- ~defaultIndex: option<int>=?,
41
- ~readOnly: option<bool>=?,
42
- ~onChange: option<int => unit>=?,
43
- ~readOnly: option<bool>=?,
38
+ ~index: array<int>=?,
39
+ ~defaultIndex: int=?,
40
+ ~readOnly: bool=?,
41
+ ~onChange: int => unit=?,
44
42
  ) => React.element = "Accordion"
45
43
  }
46
44
 
@@ -1,43 +1,17 @@
1
1
  module AlertDialog = {
2
2
  type props<'a> = {
3
- "isOpen": bool,
4
- "onDismiss": unit => unit,
5
- "leastDestructiveRef": React.ref<'a>,
6
- "aria-label": option<string>,
7
- "aria-labelledby": option<string>,
8
- "style": // "allowPinchZoom": option(bool),
9
- option<ReactDOM.Style.t>,
10
- "className": option<string>,
11
- "children": React.element,
3
+ isOpen: bool,
4
+ onDismiss: unit => unit,
5
+ leastDestructiveRef: React.ref<'a>,
6
+ ariaLabel?: string,
7
+ ariaLabelledby?: string,
8
+ style?: ReactDOM.Style.t,
9
+ className?: string,
10
+ children: React.element,
12
11
  }
13
12
 
14
13
  @module("@reach/alert-dialog")
15
14
  external make: React.component<props<'a>> = "AlertDialog"
16
-
17
- let makeProps = (
18
- ~isOpen: bool,
19
- ~onDismiss: unit => unit,
20
- ~leastDestructiveRef: React.ref<'a>,
21
- ~ariaLabel: option<string>=?,
22
- ~ariaLabelledby: option<string>=?,
23
- // Disable allowPinchZoom for now since it causes an annoying react dom warning
24
- // ~allowPinchZoom: option(bool)=?,
25
- ~style: option<ReactDOM.Style.t>=?,
26
- ~className: option<string>=?,
27
- ~children: React.element,
28
- (),
29
- ) =>
30
- {
31
- "isOpen": isOpen,
32
- "onDismiss": onDismiss,
33
- "leastDestructiveRef": leastDestructiveRef,
34
- "aria-label": ariaLabel,
35
- "aria-labelledby": ariaLabelledby,
36
- "style": style,
37
- "className": className,
38
- // "allowPinchZoom": allowPinchZoom,
39
- "children": children,
40
- }
41
15
  }
42
16
 
43
17
  module AlertDialogLabel = {
@@ -1,13 +1,12 @@
1
1
  module Dialog = {
2
2
  type props = {
3
- "isOpen": bool,
4
- "onDismiss": unit => unit,
5
- "aria-label": option<string>,
6
- "aria-labelledby": option<string>,
7
- "style": // "allowPinchZoom": option(bool),
8
- option<ReactDOM.Style.t>,
9
- "className": option<string>,
10
- "children": React.element,
3
+ isOpen: bool,
4
+ onDismiss: unit => unit,
5
+ ariaLabel?: string,
6
+ ariaLabelledby?: string,
7
+ style?: ReactDOM.Style.t,
8
+ className: string,
9
+ children: React.element,
11
10
  }
12
11
 
13
12
  @module("@reach/dialog")
@@ -18,8 +17,6 @@ module Dialog = {
18
17
  ~onDismiss: unit => unit,
19
18
  ~ariaLabel: option<string>=?,
20
19
  ~ariaLabelledby: option<string>=?,
21
- // Disable allowPinchZoom for now since it causes an annoying react dom warning
22
- // ~allowPinchZoom: option(bool)=?,
23
20
  ~style: option<ReactDOM.Style.t>=?,
24
21
  ~className: option<string>=?,
25
22
  ~children: React.element,
@@ -168,15 +168,14 @@ module ListboxList = {
168
168
 
169
169
  module ListboxOption = {
170
170
  type props = {
171
- "value": option<string>,
172
- "label": option<string>,
173
- "disabled": option<bool>,
174
- "onMouseUp": option<ReactEvent.Mouse.t => unit>,
175
- "onKeyDown": option<ReactEvent.Keyboard.t => unit>,
176
- "as": option<as_>,
177
- "style": option<ReactDOM.Style.t>,
178
- "className": option<string>,
179
- "children": React.element,
171
+ value?: string,
172
+ label?: string,
173
+ disabled?: bool,
174
+ onMouseUp?: ReactEvent.Mouse.t => unit,
175
+ onKeyDown?: ReactEvent.Keyboard.t => unit,
176
+ style?: ReactDOM.Style.t,
177
+ className?: string,
178
+ children: React.element,
180
179
  }
181
180
 
182
181
  @module("@reach/listbox")
@@ -48,38 +48,15 @@ module MenuItems = {
48
48
  }
49
49
 
50
50
  module MenuItem = {
51
- type props = {
52
- "onSelect": unit => unit,
53
- "onMouseUp": option<ReactEvent.Mouse.t => unit>,
54
- "onKeyDown": option<ReactEvent.Keyboard.t => unit>,
55
- "as": option<as_>,
56
- "style": option<ReactDOM.Style.t>,
57
- "className": option<string>,
58
- "children": React.element,
59
- }
60
-
61
- @module("@reach/menu-button")
62
- external make: React.component<props> = "MenuItem"
63
-
64
- let makeProps = (
51
+ @module("@reach/menu-button") @react.component
52
+ external make: (
65
53
  ~onSelect: unit => unit,
66
- ~onMouseUp: option<ReactEvent.Mouse.t => unit>=?,
67
- ~onKeyDown: option<ReactEvent.Keyboard.t => unit>=?,
68
- ~as_: option<as_>=?,
69
- ~style: option<ReactDOM.Style.t>=?,
70
- ~className: option<string>=?,
54
+ ~onMouseUp: ReactEvent.Mouse.t => unit=?,
55
+ ~onKeyDown: ReactEvent.Keyboard.t => unit=?,
56
+ ~style: ReactDOM.Style.t=?,
57
+ ~className: string=?,
71
58
  ~children: React.element,
72
- (),
73
- ) =>
74
- {
75
- "onSelect": onSelect,
76
- "onMouseUp": onMouseUp,
77
- "onKeyDown": onKeyDown,
78
- "as": as_,
79
- "style": style,
80
- "className": className,
81
- "children": children,
82
- }
59
+ ) => React.element = "MenuItem"
83
60
  }
84
61
 
85
62
  module MenuLink = {
@@ -6,9 +6,3 @@ external make: (
6
6
  ~className: string=?,
7
7
  ~children: React.element,
8
8
  ) => React.element = "default"
9
-
10
- @module("@reach/popover") @react.component
11
- external positionDefault: 'position = "positionDefault"
12
-
13
- @module("@reach/popover") @react.component
14
- external positionMatchWidth: 'position = "positionMatchWidth"