@colisweb/rescript-toolkit 5.15.5 → 5.16.1
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.
- package/package.json +6 -1
- package/src/form/Reform.res +3 -1
- package/src/form/Toolkit__Form.res +7 -6
- package/src/hooks/Toolkit__Hooks.res +1 -1
- package/src/ui/Toolkit__Ui.res +3 -0
- package/src/ui/Toolkit__Ui_DropdownMenu.res +93 -0
- package/src/ui/Toolkit__Ui_Popover.res +57 -0
- package/src/ui/Toolkit__Ui_ScrollArea.res +14 -0
- package/src/ui/Toolkit__Ui_Snackbar.res +36 -38
- package/src/ui/Toolkit__Ui_Snackbar.resi +1 -1
- package/src/ui/Toolkit__Ui_Tag.res +9 -7
- package/src/ui/Toolkit__Ui_Tooltip.res +63 -84
- package/src/ui/radix.css +371 -0
- package/src/ui/styles.css +1 -0
- package/src/vendors/Radix.res +469 -0
- package/src/ui/Toolkit__Ui_Tooltip.resi +0 -17
|
@@ -0,0 +1,469 @@
|
|
|
1
|
+
module Tooltip = {
|
|
2
|
+
type state =
|
|
3
|
+
| @as("closed") Closed
|
|
4
|
+
| @as("delayed-open") DelayedOpen
|
|
5
|
+
| @as("instant-open") InstantOpen
|
|
6
|
+
type side =
|
|
7
|
+
| @as("top") Top
|
|
8
|
+
| @as("right") Right
|
|
9
|
+
| @as("bottom") Bottom
|
|
10
|
+
| @as("left") Left
|
|
11
|
+
type align =
|
|
12
|
+
| @as("start") Start
|
|
13
|
+
| @as("center") Center
|
|
14
|
+
| @as("end") End
|
|
15
|
+
|
|
16
|
+
module Provider = {
|
|
17
|
+
type props = {
|
|
18
|
+
delayDuration?: int,
|
|
19
|
+
skipDelayDuration?: int,
|
|
20
|
+
disableHoverableContent?: bool,
|
|
21
|
+
children: React.element,
|
|
22
|
+
}
|
|
23
|
+
@module("@radix-ui/react-tooltip")
|
|
24
|
+
external make: React.component<props> = "Provider"
|
|
25
|
+
}
|
|
26
|
+
module Root = {
|
|
27
|
+
type props = {
|
|
28
|
+
delayDuration?: int,
|
|
29
|
+
defaultOption?: bool,
|
|
30
|
+
defaultOpen?: bool,
|
|
31
|
+
@as("open") open_?: bool,
|
|
32
|
+
disableHoverableContent?: bool,
|
|
33
|
+
onOpenChange?: bool => unit,
|
|
34
|
+
children: React.element,
|
|
35
|
+
}
|
|
36
|
+
@module("@radix-ui/react-tooltip")
|
|
37
|
+
external make: React.component<props> = "Root"
|
|
38
|
+
}
|
|
39
|
+
module Trigger = {
|
|
40
|
+
type props = {
|
|
41
|
+
asChild?: bool,
|
|
42
|
+
@as("data-state") dataState?: state,
|
|
43
|
+
children: React.element,
|
|
44
|
+
}
|
|
45
|
+
@module("@radix-ui/react-tooltip")
|
|
46
|
+
external make: React.component<props> = "Trigger"
|
|
47
|
+
}
|
|
48
|
+
module Portal = {
|
|
49
|
+
type props = {forceMount?: bool, children: React.element}
|
|
50
|
+
@module("@radix-ui/react-tooltip")
|
|
51
|
+
external make: React.component<props> = "Portal"
|
|
52
|
+
}
|
|
53
|
+
module Arrow = {
|
|
54
|
+
type props = {className?: string, asChild?: bool, width?: int, height?: int}
|
|
55
|
+
@module("@radix-ui/react-tooltip")
|
|
56
|
+
external make: React.component<props> = "Arrow"
|
|
57
|
+
}
|
|
58
|
+
module Content = {
|
|
59
|
+
type props = {
|
|
60
|
+
className?: string,
|
|
61
|
+
asChild?: bool,
|
|
62
|
+
forceMount?: bool,
|
|
63
|
+
arialLabel?: string,
|
|
64
|
+
onEscapeKeyDown?: ReactEvent.Keyboard.t => unit,
|
|
65
|
+
onPointerDownOutside?: ReactEvent.Keyboard.t => unit,
|
|
66
|
+
side?: side,
|
|
67
|
+
sideOffset?: int,
|
|
68
|
+
align?: align,
|
|
69
|
+
alignOffset?: int,
|
|
70
|
+
avoidCollisions?: bool,
|
|
71
|
+
sticky?: bool,
|
|
72
|
+
hideWhenDetached?: bool,
|
|
73
|
+
children?: React.element,
|
|
74
|
+
}
|
|
75
|
+
@module("@radix-ui/react-tooltip")
|
|
76
|
+
external make: React.component<props> = "Content"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
module Popover = {
|
|
81
|
+
module Root = {
|
|
82
|
+
type options = {
|
|
83
|
+
defaultOpen?: bool,
|
|
84
|
+
open_?: bool,
|
|
85
|
+
onOpenChange?: bool => unit,
|
|
86
|
+
modal?: bool,
|
|
87
|
+
}
|
|
88
|
+
type props = {
|
|
89
|
+
...options,
|
|
90
|
+
children: React.element,
|
|
91
|
+
}
|
|
92
|
+
@module("@radix-ui/react-popover")
|
|
93
|
+
external make: React.component<props> = "Root"
|
|
94
|
+
}
|
|
95
|
+
module Trigger = {
|
|
96
|
+
type props = {children: React.element, asChild?: bool}
|
|
97
|
+
@module("@radix-ui/react-popover")
|
|
98
|
+
external make: React.component<props> = "Trigger"
|
|
99
|
+
}
|
|
100
|
+
module Anchor = {
|
|
101
|
+
@module("@radix-ui/react-popover") @react.component
|
|
102
|
+
external make: (~children: React.element) => React.element = "Anchor"
|
|
103
|
+
}
|
|
104
|
+
module Portal = {
|
|
105
|
+
@module("@radix-ui/react-popover") @react.component
|
|
106
|
+
external make: (~children: React.element) => React.element = "Portal"
|
|
107
|
+
}
|
|
108
|
+
module Content = {
|
|
109
|
+
type align =
|
|
110
|
+
| @as("center") Center
|
|
111
|
+
| @as("start") Start
|
|
112
|
+
| @as("end") End
|
|
113
|
+
|
|
114
|
+
type side =
|
|
115
|
+
| @as("top") Top
|
|
116
|
+
| @as("right") Right
|
|
117
|
+
| @as("bottom") Bottom
|
|
118
|
+
| @as("left") Left
|
|
119
|
+
|
|
120
|
+
type options = {
|
|
121
|
+
className?: string,
|
|
122
|
+
align?: align,
|
|
123
|
+
side?: side,
|
|
124
|
+
arrowPadding?: int,
|
|
125
|
+
sideOffset?: int,
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
type props = {
|
|
129
|
+
...options,
|
|
130
|
+
children: React.element,
|
|
131
|
+
}
|
|
132
|
+
@module("@radix-ui/react-popover")
|
|
133
|
+
external make: React.component<props> = "Content"
|
|
134
|
+
}
|
|
135
|
+
module Close = {
|
|
136
|
+
type props = {className?: string, children?: React.element}
|
|
137
|
+
@module("@radix-ui/react-popover")
|
|
138
|
+
external make: React.component<props> = "Close"
|
|
139
|
+
}
|
|
140
|
+
module Arrow = {
|
|
141
|
+
type props = {className?: string}
|
|
142
|
+
@module("@radix-ui/react-popover")
|
|
143
|
+
external make: React.component<props> = "Arrow"
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
module DropdownMenu = {
|
|
148
|
+
module Root = {
|
|
149
|
+
type options = {
|
|
150
|
+
defaultOpen?: bool,
|
|
151
|
+
open_?: bool,
|
|
152
|
+
onOpenChange?: bool => unit,
|
|
153
|
+
modal?: bool,
|
|
154
|
+
}
|
|
155
|
+
type props = {
|
|
156
|
+
...options,
|
|
157
|
+
children: React.element,
|
|
158
|
+
}
|
|
159
|
+
@module("@radix-ui/react-dropdown-menu")
|
|
160
|
+
external make: React.component<props> = "Root"
|
|
161
|
+
}
|
|
162
|
+
module Trigger = {
|
|
163
|
+
type options = {asChild?: bool}
|
|
164
|
+
type props = {...options, children: React.element}
|
|
165
|
+
@module("@radix-ui/react-dropdown-menu")
|
|
166
|
+
external make: React.component<props> = "Trigger"
|
|
167
|
+
}
|
|
168
|
+
module ItemIndicator = {
|
|
169
|
+
type props = {children: React.element, className?: string, asChild?: bool}
|
|
170
|
+
@module("@radix-ui/react-dropdown-menu")
|
|
171
|
+
external make: React.component<props> = "ItemIndicator"
|
|
172
|
+
}
|
|
173
|
+
module Group = {
|
|
174
|
+
type props = {children: React.element, asChild?: bool}
|
|
175
|
+
@module("@radix-ui/react-dropdown-menu")
|
|
176
|
+
external make: React.component<props> = "Group"
|
|
177
|
+
}
|
|
178
|
+
module RadioGroup = {
|
|
179
|
+
type props = {
|
|
180
|
+
children: React.element,
|
|
181
|
+
asChild?: bool,
|
|
182
|
+
value?: string,
|
|
183
|
+
onValueChange?: string => unit,
|
|
184
|
+
}
|
|
185
|
+
@module("@radix-ui/react-dropdown-menu")
|
|
186
|
+
external make: React.component<props> = "RadioGroup"
|
|
187
|
+
}
|
|
188
|
+
module RadioItem = {
|
|
189
|
+
type options = {
|
|
190
|
+
className?: string,
|
|
191
|
+
value?: string,
|
|
192
|
+
checked?: bool,
|
|
193
|
+
disabled?: bool,
|
|
194
|
+
textValue?: bool,
|
|
195
|
+
asChild?: bool,
|
|
196
|
+
onSelect?: ReactEvent.Mouse.t => unit,
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
type props = {
|
|
200
|
+
...options,
|
|
201
|
+
children: React.element,
|
|
202
|
+
}
|
|
203
|
+
@module("@radix-ui/react-dropdown-menu")
|
|
204
|
+
external make: React.component<props> = "RadioItem"
|
|
205
|
+
}
|
|
206
|
+
module Label = {
|
|
207
|
+
type props = {children: React.element, className?: string, asChild?: bool}
|
|
208
|
+
@module("@radix-ui/react-dropdown-menu")
|
|
209
|
+
external make: React.component<props> = "Label"
|
|
210
|
+
}
|
|
211
|
+
module Portal = {
|
|
212
|
+
@module("@radix-ui/react-dropdown-menu") @react.component
|
|
213
|
+
external make: (~children: React.element) => React.element = "Portal"
|
|
214
|
+
}
|
|
215
|
+
module Content = {
|
|
216
|
+
type align =
|
|
217
|
+
| @as("center") Center
|
|
218
|
+
| @as("start") Start
|
|
219
|
+
| @as("end") End
|
|
220
|
+
|
|
221
|
+
type side =
|
|
222
|
+
| @as("top") Top
|
|
223
|
+
| @as("right") Right
|
|
224
|
+
| @as("bottom") Bottom
|
|
225
|
+
| @as("left") Left
|
|
226
|
+
|
|
227
|
+
type options = {
|
|
228
|
+
className?: string,
|
|
229
|
+
align?: align,
|
|
230
|
+
side?: side,
|
|
231
|
+
arrowPadding?: int,
|
|
232
|
+
sideOffset?: int,
|
|
233
|
+
asChild?: bool,
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
type props = {
|
|
237
|
+
...options,
|
|
238
|
+
children: React.element,
|
|
239
|
+
}
|
|
240
|
+
@module("@radix-ui/react-dropdown-menu")
|
|
241
|
+
external make: React.component<props> = "Content"
|
|
242
|
+
}
|
|
243
|
+
module Sub = {
|
|
244
|
+
type options = {
|
|
245
|
+
className?: string,
|
|
246
|
+
defaultOpen?: bool,
|
|
247
|
+
@as("open") open_?: bool,
|
|
248
|
+
onOpenChange?: bool => unit,
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
type props = {
|
|
252
|
+
...options,
|
|
253
|
+
children: React.element,
|
|
254
|
+
}
|
|
255
|
+
@module("@radix-ui/react-dropdown-menu")
|
|
256
|
+
external make: React.component<props> = "Sub"
|
|
257
|
+
}
|
|
258
|
+
module CheckboxItem = {
|
|
259
|
+
type options = {
|
|
260
|
+
className?: string,
|
|
261
|
+
checked?: bool,
|
|
262
|
+
disabled?: bool,
|
|
263
|
+
textValue?: bool,
|
|
264
|
+
onCheckedChange?: bool => unit,
|
|
265
|
+
onSelect?: ReactEvent.Mouse.t => unit,
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
type props = {
|
|
269
|
+
...options,
|
|
270
|
+
children: React.element,
|
|
271
|
+
}
|
|
272
|
+
@module("@radix-ui/react-dropdown-menu")
|
|
273
|
+
external make: React.component<props> = "CheckboxItem"
|
|
274
|
+
}
|
|
275
|
+
module Item = {
|
|
276
|
+
type options = {
|
|
277
|
+
className?: string,
|
|
278
|
+
textValue?: string,
|
|
279
|
+
asChild?: bool,
|
|
280
|
+
disabled?: bool,
|
|
281
|
+
onSelect?: ReactEvent.Mouse.t => unit,
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
type props = {
|
|
285
|
+
...options,
|
|
286
|
+
children: React.element,
|
|
287
|
+
}
|
|
288
|
+
@module("@radix-ui/react-dropdown-menu")
|
|
289
|
+
external make: React.component<props> = "Item"
|
|
290
|
+
}
|
|
291
|
+
module SubTrigger = {
|
|
292
|
+
type options = {
|
|
293
|
+
className?: string,
|
|
294
|
+
textValue?: string,
|
|
295
|
+
asChild?: bool,
|
|
296
|
+
disabled?: bool,
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
type props = {
|
|
300
|
+
...options,
|
|
301
|
+
children: React.element,
|
|
302
|
+
}
|
|
303
|
+
@module("@radix-ui/react-dropdown-menu")
|
|
304
|
+
external make: React.component<props> = "SubTrigger"
|
|
305
|
+
}
|
|
306
|
+
module SubContent = {
|
|
307
|
+
type options = {
|
|
308
|
+
className?: string,
|
|
309
|
+
arrowPadding?: int,
|
|
310
|
+
sideOffset?: int,
|
|
311
|
+
alignOffset?: int,
|
|
312
|
+
asChild?: bool,
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
type props = {
|
|
316
|
+
...options,
|
|
317
|
+
children: React.element,
|
|
318
|
+
}
|
|
319
|
+
@module("@radix-ui/react-dropdown-menu")
|
|
320
|
+
external make: React.component<props> = "SubContent"
|
|
321
|
+
}
|
|
322
|
+
module Arrow = {
|
|
323
|
+
type props = {className?: string}
|
|
324
|
+
@module("@radix-ui/react-dropdown-menu")
|
|
325
|
+
external make: React.component<props> = "Arrow"
|
|
326
|
+
}
|
|
327
|
+
module Separator = {
|
|
328
|
+
type props = {className?: string}
|
|
329
|
+
@module("@radix-ui/react-dropdown-menu")
|
|
330
|
+
external make: React.component<props> = "Separator"
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
module ScrollArea = {
|
|
334
|
+
type type_ =
|
|
335
|
+
| @as("auto") Auto
|
|
336
|
+
| @as("always") Always
|
|
337
|
+
| @as("hover") Hover
|
|
338
|
+
| @as("scroll") Scroll
|
|
339
|
+
|
|
340
|
+
module Root = {
|
|
341
|
+
type options = {
|
|
342
|
+
asChild?: bool,
|
|
343
|
+
@as("type") type_?: type_,
|
|
344
|
+
scrollHideDelay?: int,
|
|
345
|
+
className?: string,
|
|
346
|
+
}
|
|
347
|
+
type props = {
|
|
348
|
+
...options,
|
|
349
|
+
children: React.element,
|
|
350
|
+
}
|
|
351
|
+
@module("@radix-ui/react-scroll-area")
|
|
352
|
+
external make: React.component<props> = "Root"
|
|
353
|
+
}
|
|
354
|
+
module Viewport = {
|
|
355
|
+
type props = {asChild?: string, className?: string, children: React.element}
|
|
356
|
+
@module("@radix-ui/react-scroll-area")
|
|
357
|
+
external make: React.component<props> = "Viewport"
|
|
358
|
+
}
|
|
359
|
+
module Thumb = {
|
|
360
|
+
type props = {asChild?: string, className?: string}
|
|
361
|
+
@module("@radix-ui/react-scroll-area")
|
|
362
|
+
external make: React.component<props> = "Thumb"
|
|
363
|
+
}
|
|
364
|
+
module Corner = {
|
|
365
|
+
type props = {asChild?: string, className?: string}
|
|
366
|
+
@module("@radix-ui/react-scroll-area")
|
|
367
|
+
external make: React.component<props> = "Corner"
|
|
368
|
+
}
|
|
369
|
+
module Scrollbar = {
|
|
370
|
+
type orientation =
|
|
371
|
+
| @as("vertical") Vertical
|
|
372
|
+
| @as("horizontal") Horizontal
|
|
373
|
+
type props = {
|
|
374
|
+
asChild?: string,
|
|
375
|
+
orientation?: orientation,
|
|
376
|
+
className?: string,
|
|
377
|
+
children: React.element,
|
|
378
|
+
}
|
|
379
|
+
@module("@radix-ui/react-scroll-area")
|
|
380
|
+
external make: React.component<props> = "Scrollbar"
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
module Toast = {
|
|
385
|
+
module Provider = {
|
|
386
|
+
type swipeDirection =
|
|
387
|
+
| @as("right") Right
|
|
388
|
+
| @as("left") Left
|
|
389
|
+
| @as("up") Up
|
|
390
|
+
| @as("Down") Down
|
|
391
|
+
|
|
392
|
+
type props = {
|
|
393
|
+
duration?: int,
|
|
394
|
+
swipeThreshold?: int,
|
|
395
|
+
label?: string,
|
|
396
|
+
swipeDirection?: swipeDirection,
|
|
397
|
+
className?: string,
|
|
398
|
+
children: React.element,
|
|
399
|
+
}
|
|
400
|
+
@module("@radix-ui/react-toast")
|
|
401
|
+
external make: React.component<props> = "Provider"
|
|
402
|
+
}
|
|
403
|
+
module Viewport = {
|
|
404
|
+
type props = {
|
|
405
|
+
asChild?: string,
|
|
406
|
+
hotkey?: array<string>,
|
|
407
|
+
className?: string,
|
|
408
|
+
label?: string,
|
|
409
|
+
}
|
|
410
|
+
@module("@radix-ui/react-toast")
|
|
411
|
+
external make: React.component<props> = "Viewport"
|
|
412
|
+
}
|
|
413
|
+
module Root = {
|
|
414
|
+
type props = {
|
|
415
|
+
asChild?: string,
|
|
416
|
+
defaultOpen?: bool,
|
|
417
|
+
@as("open") open_?: bool,
|
|
418
|
+
onOpenChange?: bool => unit,
|
|
419
|
+
onPause?: unit => unit,
|
|
420
|
+
onResume?: unit => unit,
|
|
421
|
+
onSwipeStart?: ReactEvent.Mouse.t => unit,
|
|
422
|
+
onSwipeMove?: ReactEvent.Mouse.t => unit,
|
|
423
|
+
onSwipeEnd?: ReactEvent.Mouse.t => unit,
|
|
424
|
+
onSwipeCancel?: ReactEvent.Mouse.t => unit,
|
|
425
|
+
className?: string,
|
|
426
|
+
label?: string,
|
|
427
|
+
children: React.element,
|
|
428
|
+
}
|
|
429
|
+
@module("@radix-ui/react-toast")
|
|
430
|
+
external make: React.component<props> = "Root"
|
|
431
|
+
}
|
|
432
|
+
module Title = {
|
|
433
|
+
type props = {
|
|
434
|
+
asChild?: string,
|
|
435
|
+
className?: string,
|
|
436
|
+
children: React.element,
|
|
437
|
+
}
|
|
438
|
+
@module("@radix-ui/react-toast")
|
|
439
|
+
external make: React.component<props> = "Title"
|
|
440
|
+
}
|
|
441
|
+
module Description = {
|
|
442
|
+
type props = {
|
|
443
|
+
asChild?: string,
|
|
444
|
+
className?: string,
|
|
445
|
+
children: React.element,
|
|
446
|
+
}
|
|
447
|
+
@module("@radix-ui/react-toast")
|
|
448
|
+
external make: React.component<props> = "Description"
|
|
449
|
+
}
|
|
450
|
+
module Action = {
|
|
451
|
+
type props = {
|
|
452
|
+
asChild?: string,
|
|
453
|
+
altText?: string,
|
|
454
|
+
className?: string,
|
|
455
|
+
}
|
|
456
|
+
@module("@radix-ui/react-toast")
|
|
457
|
+
external make: React.component<props> = "Action"
|
|
458
|
+
}
|
|
459
|
+
module Close = {
|
|
460
|
+
type props = {
|
|
461
|
+
asChild?: string,
|
|
462
|
+
altText?: string,
|
|
463
|
+
className?: string,
|
|
464
|
+
children: React.element,
|
|
465
|
+
}
|
|
466
|
+
@module("@radix-ui/react-toast")
|
|
467
|
+
external make: React.component<props> = "Close"
|
|
468
|
+
}
|
|
469
|
+
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
type position = [
|
|
2
|
-
| #bottom
|
|
3
|
-
| #right
|
|
4
|
-
| #top
|
|
5
|
-
| #left
|
|
6
|
-
]
|
|
7
|
-
|
|
8
|
-
@react.component
|
|
9
|
-
let make: (
|
|
10
|
-
~label: React.element,
|
|
11
|
-
~children: React.element,
|
|
12
|
-
~tooltipClassName: string=?,
|
|
13
|
-
~containerClassName: string=?,
|
|
14
|
-
~triangleClassName: string=?,
|
|
15
|
-
~position: position=?,
|
|
16
|
-
~canBeShowed: bool=?,
|
|
17
|
-
) => React.element
|