@colisweb/rescript-toolkit 5.15.5 → 5.16.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.
- package/package.json +6 -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
package/src/ui/radix.css
ADDED
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
/* reset */
|
|
2
|
+
|
|
3
|
+
.TooltipContent {
|
|
4
|
+
border-radius: 4px;
|
|
5
|
+
padding: 10px 15px;
|
|
6
|
+
font-size: 15px;
|
|
7
|
+
line-height: 1;
|
|
8
|
+
box-shadow:
|
|
9
|
+
hsl(206 22% 7% / 35%) 0px 10px 38px -10px,
|
|
10
|
+
hsl(206 22% 7% / 20%) 0px 10px 20px -15px;
|
|
11
|
+
animation-duration: 400ms;
|
|
12
|
+
animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
|
|
13
|
+
will-change: transform, opacity;
|
|
14
|
+
@apply z-40;
|
|
15
|
+
}
|
|
16
|
+
.TooltipContent[data-state="delayed-open"][data-side="top"] {
|
|
17
|
+
animation-name: slideDownAndFade;
|
|
18
|
+
}
|
|
19
|
+
.TooltipContent[data-state="delayed-open"][data-side="right"] {
|
|
20
|
+
animation-name: slideLeftAndFade;
|
|
21
|
+
}
|
|
22
|
+
.TooltipContent[data-state="delayed-open"][data-side="bottom"] {
|
|
23
|
+
animation-name: slideUpAndFade;
|
|
24
|
+
}
|
|
25
|
+
.TooltipContent[data-state="delayed-open"][data-side="left"] {
|
|
26
|
+
animation-name: slideRightAndFade;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.TooltipContent--White {
|
|
30
|
+
@apply bg-white text-neutral-800;
|
|
31
|
+
}
|
|
32
|
+
.TooltipContent--Black {
|
|
33
|
+
@apply bg-neutral-900 text-white;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.TooltipContent--White .TooltipArrow {
|
|
37
|
+
@apply fill-white;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.TooltipContent--Black .TooltipArrow {
|
|
41
|
+
@apply fill-neutral-900;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@keyframes slideUpAndFade {
|
|
45
|
+
from {
|
|
46
|
+
opacity: 0;
|
|
47
|
+
transform: translateY(2px);
|
|
48
|
+
}
|
|
49
|
+
to {
|
|
50
|
+
opacity: 1;
|
|
51
|
+
transform: translateY(0);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@keyframes slideRightAndFade {
|
|
56
|
+
from {
|
|
57
|
+
opacity: 0;
|
|
58
|
+
transform: translateX(-2px);
|
|
59
|
+
}
|
|
60
|
+
to {
|
|
61
|
+
opacity: 1;
|
|
62
|
+
transform: translateX(0);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@keyframes slideDownAndFade {
|
|
67
|
+
from {
|
|
68
|
+
opacity: 0;
|
|
69
|
+
transform: translateY(-2px);
|
|
70
|
+
}
|
|
71
|
+
to {
|
|
72
|
+
opacity: 1;
|
|
73
|
+
transform: translateY(0);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@keyframes slideLeftAndFade {
|
|
78
|
+
from {
|
|
79
|
+
opacity: 0;
|
|
80
|
+
transform: translateX(2px);
|
|
81
|
+
}
|
|
82
|
+
to {
|
|
83
|
+
opacity: 1;
|
|
84
|
+
transform: translateX(0);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
.cw-PopoverContent {
|
|
88
|
+
animation-duration: 400ms;
|
|
89
|
+
animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
|
|
90
|
+
will-change: transform, opacity;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.cw-PopoverContent[data-state="open"][data-side="top"] {
|
|
94
|
+
animation-name: slideDownAndFade;
|
|
95
|
+
}
|
|
96
|
+
.cw-PopoverContent[data-state="open"][data-side="right"] {
|
|
97
|
+
animation-name: slideLeftAndFade;
|
|
98
|
+
}
|
|
99
|
+
.cw-PopoverContent[data-state="open"][data-side="bottom"] {
|
|
100
|
+
animation-name: slideUpAndFade;
|
|
101
|
+
}
|
|
102
|
+
.cw-PopoverContent[data-state="open"][data-side="left"] {
|
|
103
|
+
animation-name: slideRightAndFade;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.PopoverArrow {
|
|
107
|
+
fill: white;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.DropdownMenuContent,
|
|
111
|
+
.DropdownMenuSubContent {
|
|
112
|
+
min-width: 220px;
|
|
113
|
+
background-color: white;
|
|
114
|
+
border-radius: 6px;
|
|
115
|
+
padding: 5px;
|
|
116
|
+
box-shadow:
|
|
117
|
+
0px 10px 38px -10px rgba(22, 23, 24, 0.35),
|
|
118
|
+
0px 10px 20px -15px rgba(22, 23, 24, 0.2);
|
|
119
|
+
animation-duration: 400ms;
|
|
120
|
+
animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
|
|
121
|
+
will-change: transform, opacity;
|
|
122
|
+
@apply z-50;
|
|
123
|
+
}
|
|
124
|
+
.DropdownMenuContent[data-side="top"],
|
|
125
|
+
.DropdownMenuSubContent[data-side="top"] {
|
|
126
|
+
animation-name: slideDownAndFade;
|
|
127
|
+
}
|
|
128
|
+
.DropdownMenuContent[data-side="right"],
|
|
129
|
+
.DropdownMenuSubContent[data-side="right"] {
|
|
130
|
+
animation-name: slideLeftAndFade;
|
|
131
|
+
}
|
|
132
|
+
.DropdownMenuContent[data-side="bottom"],
|
|
133
|
+
.DropdownMenuSubContent[data-side="bottom"] {
|
|
134
|
+
animation-name: slideUpAndFade;
|
|
135
|
+
}
|
|
136
|
+
.DropdownMenuContent[data-side="left"],
|
|
137
|
+
.DropdownMenuSubContent[data-side="left"] {
|
|
138
|
+
animation-name: slideRightAndFade;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.DropdownMenuItem,
|
|
142
|
+
.DropdownMenuCheckboxItem,
|
|
143
|
+
.DropdownMenuRadioItem,
|
|
144
|
+
.DropdownMenuSubTrigger {
|
|
145
|
+
font-size: 13px;
|
|
146
|
+
line-height: 1;
|
|
147
|
+
@apply text-neutral-900;
|
|
148
|
+
border-radius: 3px;
|
|
149
|
+
display: flex;
|
|
150
|
+
align-items: center;
|
|
151
|
+
height: 25px;
|
|
152
|
+
padding: 0 5px;
|
|
153
|
+
position: relative;
|
|
154
|
+
padding-left: 25px;
|
|
155
|
+
user-select: none;
|
|
156
|
+
outline: none;
|
|
157
|
+
}
|
|
158
|
+
.DropdownMenuSubTrigger[data-state="open"] {
|
|
159
|
+
@apply bg-neutral-200 text-neutral-700;
|
|
160
|
+
}
|
|
161
|
+
.DropdownMenuItem[data-disabled],
|
|
162
|
+
.DropdownMenuCheckboxItem[data-disabled],
|
|
163
|
+
.DropdownMenuRadioItem[data-disabled],
|
|
164
|
+
.DropdownMenuSubTrigger[data-disabled] {
|
|
165
|
+
@apply text-gray-400;
|
|
166
|
+
pointer-events: none;
|
|
167
|
+
}
|
|
168
|
+
.DropdownMenuItem[data-highlighted],
|
|
169
|
+
.DropdownMenuCheckboxItem[data-highlighted],
|
|
170
|
+
.DropdownMenuRadioItem[data-highlighted],
|
|
171
|
+
.DropdownMenuSubTrigger[data-highlighted] {
|
|
172
|
+
@apply bg-neutral-200 text-neutral-700;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.DropdownMenuLabel {
|
|
176
|
+
padding-left: 25px;
|
|
177
|
+
font-size: 12px;
|
|
178
|
+
line-height: 25px;
|
|
179
|
+
@apply text-neutral-600;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.DropdownMenuSeparator {
|
|
183
|
+
height: 1px;
|
|
184
|
+
@apply bg-neutral-400;
|
|
185
|
+
margin: 5px;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.DropdownMenuItemIndicator {
|
|
189
|
+
position: absolute;
|
|
190
|
+
left: 0;
|
|
191
|
+
width: 25px;
|
|
192
|
+
display: inline-flex;
|
|
193
|
+
align-items: center;
|
|
194
|
+
justify-content: center;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.DropdownMenuArrow {
|
|
198
|
+
fill: white;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.IconButton {
|
|
202
|
+
font-family: inherit;
|
|
203
|
+
border-radius: 100%;
|
|
204
|
+
height: 35px;
|
|
205
|
+
width: 35px;
|
|
206
|
+
display: inline-flex;
|
|
207
|
+
align-items: center;
|
|
208
|
+
justify-content: center;
|
|
209
|
+
color: var(--violet-11);
|
|
210
|
+
background-color: white;
|
|
211
|
+
box-shadow: 0 2px 10px var(--black-a7);
|
|
212
|
+
}
|
|
213
|
+
.IconButton:hover {
|
|
214
|
+
@apply bg-neutral-500;
|
|
215
|
+
}
|
|
216
|
+
.IconButton:focus {
|
|
217
|
+
box-shadow: 0 0 0 2px black;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.RightSlot {
|
|
221
|
+
margin-left: auto;
|
|
222
|
+
padding-left: 20px;
|
|
223
|
+
@apply text-neutral-600;
|
|
224
|
+
}
|
|
225
|
+
[data-highlighted] > .RightSlot {
|
|
226
|
+
@apply text-neutral-700;
|
|
227
|
+
}
|
|
228
|
+
[data-disabled] .RightSlot {
|
|
229
|
+
color: var(--mauve-8);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.ScrollAreaRoot {
|
|
233
|
+
border-radius: 4px;
|
|
234
|
+
overflow: hidden;
|
|
235
|
+
--scrollbar-size: 10px;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.ScrollAreaViewport {
|
|
239
|
+
width: 100%;
|
|
240
|
+
height: 100%;
|
|
241
|
+
border-radius: inherit;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.ScrollAreaScrollbar {
|
|
245
|
+
display: flex;
|
|
246
|
+
/* ensures no selection */
|
|
247
|
+
user-select: none;
|
|
248
|
+
/* disable browser handling of all panning and zooming gestures on touch devices */
|
|
249
|
+
touch-action: none;
|
|
250
|
+
padding: 2px;
|
|
251
|
+
transition: background 160ms ease-out;
|
|
252
|
+
@apply bg-neutral-300;
|
|
253
|
+
}
|
|
254
|
+
.ScrollAreaScrollbar:hover {
|
|
255
|
+
@apply bg-neutral-400;
|
|
256
|
+
}
|
|
257
|
+
.ScrollAreaScrollbar[data-orientation="vertical"] {
|
|
258
|
+
width: var(--scrollbar-size);
|
|
259
|
+
}
|
|
260
|
+
.ScrollAreaScrollbar[data-orientation="horizontal"] {
|
|
261
|
+
flex-direction: column;
|
|
262
|
+
height: var(--scrollbar-size);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.ScrollAreaThumb {
|
|
266
|
+
flex: 1;
|
|
267
|
+
border-radius: var(--scrollbar-size);
|
|
268
|
+
position: relative;
|
|
269
|
+
@apply bg-neutral-700;
|
|
270
|
+
}
|
|
271
|
+
/* increase target size for touch devices https://www.w3.org/WAI/WCAG21/Understanding/target-size.html */
|
|
272
|
+
.ScrollAreaThumb::before {
|
|
273
|
+
content: "";
|
|
274
|
+
position: absolute;
|
|
275
|
+
top: 50%;
|
|
276
|
+
left: 50%;
|
|
277
|
+
transform: translate(-50%, -50%);
|
|
278
|
+
width: 100%;
|
|
279
|
+
height: 100%;
|
|
280
|
+
min-width: 44px;
|
|
281
|
+
min-height: 44px;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.ScrollAreaCorner {
|
|
285
|
+
@apply bg-neutral-700;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
@keyframes swipeOut {
|
|
289
|
+
from {
|
|
290
|
+
transform: translateX(var(--radix-toast-swipe-end-x));
|
|
291
|
+
}
|
|
292
|
+
to {
|
|
293
|
+
transform: translateX(calc(100% + var(--viewport-padding)));
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
@keyframes hide {
|
|
297
|
+
from {
|
|
298
|
+
opacity: 1;
|
|
299
|
+
}
|
|
300
|
+
to {
|
|
301
|
+
opacity: 0;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
@keyframes slideIn {
|
|
306
|
+
from {
|
|
307
|
+
transform: translateX(calc(100% + var(--viewport-padding)));
|
|
308
|
+
}
|
|
309
|
+
to {
|
|
310
|
+
transform: translateX(0);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.ToastViewport {
|
|
315
|
+
--viewport-padding: 25px;
|
|
316
|
+
position: fixed;
|
|
317
|
+
bottom: 0;
|
|
318
|
+
right: 0;
|
|
319
|
+
display: flex;
|
|
320
|
+
flex-direction: column;
|
|
321
|
+
padding: var(--viewport-padding);
|
|
322
|
+
gap: 10px;
|
|
323
|
+
width: 390px;
|
|
324
|
+
max-width: 100vw;
|
|
325
|
+
margin: 0;
|
|
326
|
+
list-style: none;
|
|
327
|
+
z-index: 2147483647;
|
|
328
|
+
outline: none;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.ToastRoot {
|
|
332
|
+
border-radius: 6px;
|
|
333
|
+
box-shadow:
|
|
334
|
+
hsl(206 22% 7% / 35%) 0px 10px 38px -10px,
|
|
335
|
+
hsl(206 22% 7% / 20%) 0px 10px 20px -15px;
|
|
336
|
+
padding: 15px;
|
|
337
|
+
display: grid;
|
|
338
|
+
grid-template-areas: "title action" "description action";
|
|
339
|
+
grid-template-columns: auto max-content;
|
|
340
|
+
column-gap: 15px;
|
|
341
|
+
align-items: center;
|
|
342
|
+
}
|
|
343
|
+
.ToastRoot[data-state="open"] {
|
|
344
|
+
animation: slideIn 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
345
|
+
}
|
|
346
|
+
.ToastRoot[data-state="closed"] {
|
|
347
|
+
animation: hide 100ms ease-in;
|
|
348
|
+
}
|
|
349
|
+
.ToastRoot[data-swipe="move"] {
|
|
350
|
+
transform: translateX(var(--radix-toast-swipe-move-x));
|
|
351
|
+
}
|
|
352
|
+
.ToastRoot[data-swipe="cancel"] {
|
|
353
|
+
transform: translateX(0);
|
|
354
|
+
transition: transform 200ms ease-out;
|
|
355
|
+
}
|
|
356
|
+
.ToastRoot[data-swipe="end"] {
|
|
357
|
+
animation: swipeOut 100ms ease-out;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.ToastTitle {
|
|
361
|
+
grid-area: title;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
.ToastDescription {
|
|
365
|
+
grid-area: description;
|
|
366
|
+
margin: 0;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
.ToastAction {
|
|
370
|
+
grid-area: action;
|
|
371
|
+
}
|
package/src/ui/styles.css
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* purgecss start ignore */
|
|
2
2
|
@import url("./tailwind-init.css");
|
|
3
|
+
@import url("./radix.css");
|
|
3
4
|
@import url("https://fonts.googleapis.com/css?family=Montserrat:300,400,500,600,700");
|
|
4
5
|
@import url("https://fonts.googleapis.com/css?family=Open+Sans:300,400,500,600,700");
|
|
5
6
|
@import url("https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&display=swap");
|