@toptal/picasso-select 1.0.30 → 2.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 (83) hide show
  1. package/dist-package/src/NativeSelect/NativeSelect.d.ts.map +1 -1
  2. package/dist-package/src/NativeSelect/NativeSelect.js +18 -23
  3. package/dist-package/src/NativeSelect/NativeSelect.js.map +1 -1
  4. package/dist-package/src/NativeSelect/NativeSelectInput.d.ts +9 -0
  5. package/dist-package/src/NativeSelect/NativeSelectInput.d.ts.map +1 -0
  6. package/dist-package/src/NativeSelect/NativeSelectInput.js +27 -0
  7. package/dist-package/src/NativeSelect/NativeSelectInput.js.map +1 -0
  8. package/dist-package/src/NonNativeSelect/NonNativeSelect.d.ts.map +1 -1
  9. package/dist-package/src/NonNativeSelect/NonNativeSelect.js +12 -18
  10. package/dist-package/src/NonNativeSelect/NonNativeSelect.js.map +1 -1
  11. package/dist-package/src/NonNativeSelectLimitFooter/NonNativeSelectLimitFooter.d.ts.map +1 -1
  12. package/dist-package/src/NonNativeSelectLimitFooter/NonNativeSelectLimitFooter.js +1 -5
  13. package/dist-package/src/NonNativeSelectLimitFooter/NonNativeSelectLimitFooter.js.map +1 -1
  14. package/dist-package/src/NonNativeSelectOptions/NonNativeSelectOptions.d.ts.map +1 -1
  15. package/dist-package/src/NonNativeSelectOptions/NonNativeSelectOptions.js +1 -5
  16. package/dist-package/src/NonNativeSelectOptions/NonNativeSelectOptions.js.map +1 -1
  17. package/dist-package/src/ScrollMenu/ScrollMenu.d.ts.map +1 -1
  18. package/dist-package/src/ScrollMenu/ScrollMenu.js +3 -9
  19. package/dist-package/src/ScrollMenu/ScrollMenu.js.map +1 -1
  20. package/dist-package/src/SelectCaret/SelectCaret.d.ts.map +1 -1
  21. package/dist-package/src/SelectCaret/SelectCaret.js +11 -8
  22. package/dist-package/src/SelectCaret/SelectCaret.js.map +1 -1
  23. package/dist-package/src/SelectOptions/SelectOptions.d.ts.map +1 -1
  24. package/dist-package/src/SelectOptions/SelectOptions.js +2 -11
  25. package/dist-package/src/SelectOptions/SelectOptions.js.map +1 -1
  26. package/package.json +14 -12
  27. package/src/NativeSelect/NativeSelect.tsx +54 -56
  28. package/src/NativeSelect/NativeSelectInput.tsx +51 -0
  29. package/src/NativeSelect/__snapshots__/test.tsx.snap +10 -36
  30. package/src/NonNativeSelect/NonNativeSelect.tsx +21 -23
  31. package/src/NonNativeSelect/__snapshots__/test.tsx.snap +45 -62
  32. package/src/NonNativeSelectLimitFooter/NonNativeSelectLimitFooter.tsx +1 -9
  33. package/src/NonNativeSelectLimitFooter/__snapshots__/test.tsx.snap +5 -5
  34. package/src/NonNativeSelectLoader/__snapshots__/test.tsx.snap +11 -9
  35. package/src/NonNativeSelectOption/__snapshots__/test.tsx.snap +14 -16
  36. package/src/NonNativeSelectOptions/NonNativeSelectOptions.tsx +1 -7
  37. package/src/NonNativeSelectOptions/__snapshots__/test.tsx.snap +51 -51
  38. package/src/ScrollMenu/ScrollMenu.tsx +8 -12
  39. package/src/ScrollMenu/__snapshots__/test.tsx.snap +17 -17
  40. package/src/Select/story/index.jsx +1 -1
  41. package/src/SelectCaret/SelectCaret.tsx +10 -12
  42. package/src/SelectCaret/__snapshots__/test.tsx.snap +2 -2
  43. package/src/SelectOptions/SelectOptions.tsx +5 -15
  44. package/dist-package/src/NativeSelect/styles.d.ts +0 -6
  45. package/dist-package/src/NativeSelect/styles.d.ts.map +0 -1
  46. package/dist-package/src/NativeSelect/styles.js +0 -54
  47. package/dist-package/src/NativeSelect/styles.js.map +0 -1
  48. package/dist-package/src/NonNativeSelect/styles.d.ts +0 -7
  49. package/dist-package/src/NonNativeSelect/styles.d.ts.map +0 -1
  50. package/dist-package/src/NonNativeSelect/styles.js +0 -56
  51. package/dist-package/src/NonNativeSelect/styles.js.map +0 -1
  52. package/dist-package/src/NonNativeSelectLimitFooter/styles.d.ts +0 -4
  53. package/dist-package/src/NonNativeSelectLimitFooter/styles.d.ts.map +0 -1
  54. package/dist-package/src/NonNativeSelectLimitFooter/styles.js +0 -10
  55. package/dist-package/src/NonNativeSelectLimitFooter/styles.js.map +0 -1
  56. package/dist-package/src/NonNativeSelectOptions/styles.d.ts +0 -3
  57. package/dist-package/src/NonNativeSelectOptions/styles.d.ts.map +0 -1
  58. package/dist-package/src/NonNativeSelectOptions/styles.js +0 -7
  59. package/dist-package/src/NonNativeSelectOptions/styles.js.map +0 -1
  60. package/dist-package/src/ScrollMenu/styles.d.ts +0 -4
  61. package/dist-package/src/ScrollMenu/styles.d.ts.map +0 -1
  62. package/dist-package/src/ScrollMenu/styles.js +0 -19
  63. package/dist-package/src/ScrollMenu/styles.js.map +0 -1
  64. package/dist-package/src/Select/styles.d.ts +0 -7
  65. package/dist-package/src/Select/styles.d.ts.map +0 -1
  66. package/dist-package/src/Select/styles.js +0 -49
  67. package/dist-package/src/Select/styles.js.map +0 -1
  68. package/dist-package/src/SelectCaret/styles.d.ts +0 -4
  69. package/dist-package/src/SelectCaret/styles.d.ts.map +0 -1
  70. package/dist-package/src/SelectCaret/styles.js +0 -21
  71. package/dist-package/src/SelectCaret/styles.js.map +0 -1
  72. package/dist-package/src/SelectOptions/styles.d.ts +0 -4
  73. package/dist-package/src/SelectOptions/styles.d.ts.map +0 -1
  74. package/dist-package/src/SelectOptions/styles.js +0 -19
  75. package/dist-package/src/SelectOptions/styles.js.map +0 -1
  76. package/src/NativeSelect/styles.ts +0 -57
  77. package/src/NonNativeSelect/styles.ts +0 -59
  78. package/src/NonNativeSelectLimitFooter/styles.ts +0 -12
  79. package/src/NonNativeSelectOptions/styles.ts +0 -8
  80. package/src/ScrollMenu/styles.ts +0 -23
  81. package/src/Select/styles.ts +0 -52
  82. package/src/SelectCaret/styles.ts +0 -23
  83. package/src/SelectOptions/styles.ts +0 -22
@@ -6,7 +6,7 @@ exports[`NonNativeSelectOptions renders 1`] = `
6
6
  class="Picasso-root"
7
7
  >
8
8
  <ul
9
- class="MuiList-root PicassoMenu-root PicassoScrollMenu-menu PicassoSelectOptions-menu"
9
+ class="relative list-none outline-none py-2 px-0 m-0 rounded-sm bg-white shadow-5"
10
10
  role="listbox"
11
11
  tabindex="-1"
12
12
  >
@@ -14,64 +14,64 @@ exports[`NonNativeSelectOptions renders 1`] = `
14
14
  tabindex="0"
15
15
  >
16
16
  <div
17
- class="PicassoScrollMenu-scrollView"
17
+ class="overflow-y max-h [@media(max-height:585px)]:max-h-[calc(50vh [@media(max-height:585px)]:md:max-h-[calc(50vh"
18
18
  >
19
19
  <li
20
20
  aria-disabled="false"
21
- class="MuiButtonBase-root MuiListItem-root MuiMenuItem-root PicassoMenuItem-root PicassoMenuItem-light MuiMenuItem-gutters PicassoMenuItem-gutters MuiListItem-gutters MuiListItem-button"
21
+ class="text-black bg-transparent hover:bg-blue focus:bg-blue px-4 py-[0.375rem] min-w w-auto min-h sm:min-h md:min-h relative cursor-pointer transition-colors duration-150 ease-in overflow-hidden whitespace-normal text-left no-underline flex items-center justify-start outline-none appearance-none leading-4"
22
22
  data-highlighted="false"
23
23
  role="option"
24
24
  tabindex="-1"
25
25
  value="1"
26
26
  >
27
27
  <div
28
- class="PicassoContainer-flex PicassoMenuItem-itemWrapper"
28
+ class="flex flex-1 max-w"
29
29
  >
30
30
  <div
31
- class="PicassoContainer-flex PicassoContainer-column PicassoMenuItem-content"
31
+ class="flex flex-col flex-1 min-w"
32
32
  >
33
33
  <div
34
- class="PicassoContainer-centerAlignItems PicassoContainer-flex"
34
+ class="flex items-center"
35
35
  />
36
36
  </div>
37
37
  </div>
38
38
  </li>
39
39
  <li
40
40
  aria-disabled="false"
41
- class="MuiButtonBase-root MuiListItem-root MuiMenuItem-root PicassoMenuItem-root PicassoMenuItem-light MuiMenuItem-gutters PicassoMenuItem-gutters MuiListItem-gutters MuiListItem-button"
41
+ class="text-black bg-transparent hover:bg-blue focus:bg-blue px-4 py-[0.375rem] min-w w-auto min-h sm:min-h md:min-h relative cursor-pointer transition-colors duration-150 ease-in overflow-hidden whitespace-normal text-left no-underline flex items-center justify-start outline-none appearance-none leading-4"
42
42
  data-highlighted="false"
43
43
  role="option"
44
44
  tabindex="-1"
45
45
  value="2"
46
46
  >
47
47
  <div
48
- class="PicassoContainer-flex PicassoMenuItem-itemWrapper"
48
+ class="flex flex-1 max-w"
49
49
  >
50
50
  <div
51
- class="PicassoContainer-flex PicassoContainer-column PicassoMenuItem-content"
51
+ class="flex flex-col flex-1 min-w"
52
52
  >
53
53
  <div
54
- class="PicassoContainer-centerAlignItems PicassoContainer-flex"
54
+ class="flex items-center"
55
55
  />
56
56
  </div>
57
57
  </div>
58
58
  </li>
59
59
  <li
60
60
  aria-disabled="false"
61
- class="MuiButtonBase-root MuiListItem-root MuiMenuItem-root PicassoMenuItem-root PicassoMenuItem-light MuiMenuItem-gutters PicassoMenuItem-gutters MuiListItem-gutters MuiListItem-button"
61
+ class="text-black bg-transparent hover:bg-blue focus:bg-blue px-4 py-[0.375rem] min-w w-auto min-h sm:min-h md:min-h relative cursor-pointer transition-colors duration-150 ease-in overflow-hidden whitespace-normal text-left no-underline flex items-center justify-start outline-none appearance-none leading-4"
62
62
  data-highlighted="false"
63
63
  role="option"
64
64
  tabindex="-1"
65
65
  value="3"
66
66
  >
67
67
  <div
68
- class="PicassoContainer-flex PicassoMenuItem-itemWrapper"
68
+ class="flex flex-1 max-w"
69
69
  >
70
70
  <div
71
- class="PicassoContainer-flex PicassoContainer-column PicassoMenuItem-content"
71
+ class="flex flex-col flex-1 min-w"
72
72
  >
73
73
  <div
74
- class="PicassoContainer-centerAlignItems PicassoContainer-flex"
74
+ class="flex items-center"
75
75
  />
76
76
  </div>
77
77
  </div>
@@ -89,7 +89,7 @@ exports[`NonNativeSelectOptions renders no option 1`] = `
89
89
  class="Picasso-root"
90
90
  >
91
91
  <ul
92
- class="MuiList-root PicassoMenu-root PicassoScrollMenu-menu PicassoSelectOptions-menu"
92
+ class="relative list-none outline-none py-2 px-0 m-0 rounded-sm bg-white shadow-5"
93
93
  data-testid="no-options"
94
94
  role="listbox"
95
95
  tabindex="-1"
@@ -98,22 +98,22 @@ exports[`NonNativeSelectOptions renders no option 1`] = `
98
98
  tabindex="0"
99
99
  >
100
100
  <div
101
- class="PicassoScrollMenu-scrollView"
101
+ class="overflow-y max-h [@media(max-height:585px)]:max-h-[calc(50vh [@media(max-height:585px)]:md:max-h-[calc(50vh"
102
102
  >
103
103
  <li
104
104
  aria-disabled="true"
105
- class="MuiButtonBase-root MuiListItem-root MuiMenuItem-root PicassoMenuItem-root PicassoMenuItem-light PicassoMenuItem-disabled MuiMenuItem-gutters PicassoMenuItem-gutters MuiListItem-gutters Mui-disabled MuiListItem-button Mui-disabled"
105
+ class="bg-transparent hover:bg-blue focus:bg-blue px-4 py-[0.375rem] min-w w-auto min-h sm:min-h md:min-h relative cursor-pointer transition-colors duration-150 ease-in overflow-hidden whitespace-normal text-left no-underline flex items-center justify-start outline-none appearance-none leading-4 text-gray opacity-100 pointer-events"
106
+ disabled=""
106
107
  role="menuitem"
107
- tabindex="-1"
108
108
  >
109
109
  <div
110
- class="PicassoContainer-flex PicassoMenuItem-itemWrapper"
110
+ class="flex flex-1 max-w"
111
111
  >
112
112
  <div
113
- class="PicassoContainer-flex PicassoContainer-column PicassoMenuItem-content"
113
+ class="flex flex-col flex-1 min-w"
114
114
  >
115
115
  <div
116
- class="PicassoContainer-centerAlignItems PicassoContainer-flex"
116
+ class="flex items-center"
117
117
  />
118
118
  </div>
119
119
  </div>
@@ -131,7 +131,7 @@ exports[`NonNativeSelectOptions renders option groups 1`] = `
131
131
  class="Picasso-root"
132
132
  >
133
133
  <ul
134
- class="MuiList-root PicassoMenu-root PicassoScrollMenu-menu PicassoSelectOptions-menu"
134
+ class="relative list-none outline-none py-2 px-0 m-0 rounded-sm bg-white shadow-5"
135
135
  role="listbox"
136
136
  tabindex="-1"
137
137
  >
@@ -139,22 +139,22 @@ exports[`NonNativeSelectOptions renders option groups 1`] = `
139
139
  tabindex="0"
140
140
  >
141
141
  <div
142
- class="PicassoScrollMenu-scrollView"
142
+ class="overflow-y max-h [@media(max-height:585px)]:max-h-[calc(50vh [@media(max-height:585px)]:md:max-h-[calc(50vh"
143
143
  >
144
144
  <li
145
145
  aria-disabled="false"
146
- class="MuiButtonBase-root MuiListItem-root MuiMenuItem-root PicassoMenuItem-root PicassoMenuItem-light makeStyles-menuGroup PicassoMenuItem-nonSelectable MuiMenuItem-gutters PicassoMenuItem-gutters MuiListItem-gutters MuiListItem-button"
146
+ class="text-black bg-transparent py-[0.375rem] min-w w-auto min-h sm:min-h md:min-h relative cursor-pointer transition-colors duration-150 ease-in overflow-hidden whitespace-normal text-left no-underline flex items-center justify-start outline-none appearance-none leading-4 pt-4 px-4 pb-[10px]"
147
147
  role="option"
148
148
  tabindex="-1"
149
149
  >
150
150
  <div
151
- class="PicassoContainer-flex PicassoMenuItem-itemWrapper"
151
+ class="flex flex-1 max-w"
152
152
  >
153
153
  <div
154
- class="PicassoContainer-flex PicassoContainer-column PicassoMenuItem-content"
154
+ class="flex flex-col flex-1 min-w"
155
155
  >
156
156
  <div
157
- class="PicassoContainer-centerAlignItems PicassoContainer-flex"
157
+ class="flex items-center"
158
158
  >
159
159
  <p
160
160
  class="m-0 text-xxs text-graphite font-semibold"
@@ -167,78 +167,78 @@ exports[`NonNativeSelectOptions renders option groups 1`] = `
167
167
  </li>
168
168
  <li
169
169
  aria-disabled="false"
170
- class="MuiButtonBase-root MuiListItem-root MuiMenuItem-root PicassoMenuItem-root PicassoMenuItem-light MuiMenuItem-gutters PicassoMenuItem-gutters MuiListItem-gutters MuiListItem-button"
170
+ class="text-black bg-transparent hover:bg-blue focus:bg-blue px-4 py-[0.375rem] min-w w-auto min-h sm:min-h md:min-h relative cursor-pointer transition-colors duration-150 ease-in overflow-hidden whitespace-normal text-left no-underline flex items-center justify-start outline-none appearance-none leading-4"
171
171
  data-highlighted="false"
172
172
  role="option"
173
173
  tabindex="-1"
174
174
  value="1"
175
175
  >
176
176
  <div
177
- class="PicassoContainer-flex PicassoMenuItem-itemWrapper"
177
+ class="flex flex-1 max-w"
178
178
  >
179
179
  <div
180
- class="PicassoContainer-flex PicassoContainer-column PicassoMenuItem-content"
180
+ class="flex flex-col flex-1 min-w"
181
181
  >
182
182
  <div
183
- class="PicassoContainer-centerAlignItems PicassoContainer-flex"
183
+ class="flex items-center"
184
184
  />
185
185
  </div>
186
186
  </div>
187
187
  </li>
188
188
  <li
189
189
  aria-disabled="false"
190
- class="MuiButtonBase-root MuiListItem-root MuiMenuItem-root PicassoMenuItem-root PicassoMenuItem-light MuiMenuItem-gutters PicassoMenuItem-gutters MuiListItem-gutters MuiListItem-button"
190
+ class="text-black bg-transparent hover:bg-blue focus:bg-blue px-4 py-[0.375rem] min-w w-auto min-h sm:min-h md:min-h relative cursor-pointer transition-colors duration-150 ease-in overflow-hidden whitespace-normal text-left no-underline flex items-center justify-start outline-none appearance-none leading-4"
191
191
  data-highlighted="false"
192
192
  role="option"
193
193
  tabindex="-1"
194
194
  value="2"
195
195
  >
196
196
  <div
197
- class="PicassoContainer-flex PicassoMenuItem-itemWrapper"
197
+ class="flex flex-1 max-w"
198
198
  >
199
199
  <div
200
- class="PicassoContainer-flex PicassoContainer-column PicassoMenuItem-content"
200
+ class="flex flex-col flex-1 min-w"
201
201
  >
202
202
  <div
203
- class="PicassoContainer-centerAlignItems PicassoContainer-flex"
203
+ class="flex items-center"
204
204
  />
205
205
  </div>
206
206
  </div>
207
207
  </li>
208
208
  <li
209
209
  aria-disabled="false"
210
- class="MuiButtonBase-root MuiListItem-root MuiMenuItem-root PicassoMenuItem-root PicassoMenuItem-light MuiMenuItem-gutters PicassoMenuItem-gutters MuiListItem-gutters MuiListItem-button"
210
+ class="text-black bg-transparent hover:bg-blue focus:bg-blue px-4 py-[0.375rem] min-w w-auto min-h sm:min-h md:min-h relative cursor-pointer transition-colors duration-150 ease-in overflow-hidden whitespace-normal text-left no-underline flex items-center justify-start outline-none appearance-none leading-4"
211
211
  data-highlighted="false"
212
212
  role="option"
213
213
  tabindex="-1"
214
214
  value="3"
215
215
  >
216
216
  <div
217
- class="PicassoContainer-flex PicassoMenuItem-itemWrapper"
217
+ class="flex flex-1 max-w"
218
218
  >
219
219
  <div
220
- class="PicassoContainer-flex PicassoContainer-column PicassoMenuItem-content"
220
+ class="flex flex-col flex-1 min-w"
221
221
  >
222
222
  <div
223
- class="PicassoContainer-centerAlignItems PicassoContainer-flex"
223
+ class="flex items-center"
224
224
  />
225
225
  </div>
226
226
  </div>
227
227
  </li>
228
228
  <li
229
229
  aria-disabled="false"
230
- class="MuiButtonBase-root MuiListItem-root MuiMenuItem-root PicassoMenuItem-root PicassoMenuItem-light makeStyles-menuGroup PicassoMenuItem-nonSelectable MuiMenuItem-gutters PicassoMenuItem-gutters MuiListItem-gutters MuiListItem-button"
230
+ class="text-black bg-transparent py-[0.375rem] min-w w-auto min-h sm:min-h md:min-h relative cursor-pointer transition-colors duration-150 ease-in overflow-hidden whitespace-normal text-left no-underline flex items-center justify-start outline-none appearance-none leading-4 pt-4 px-4 pb-[10px]"
231
231
  role="option"
232
232
  tabindex="-1"
233
233
  >
234
234
  <div
235
- class="PicassoContainer-flex PicassoMenuItem-itemWrapper"
235
+ class="flex flex-1 max-w"
236
236
  >
237
237
  <div
238
- class="PicassoContainer-flex PicassoContainer-column PicassoMenuItem-content"
238
+ class="flex flex-col flex-1 min-w"
239
239
  >
240
240
  <div
241
- class="PicassoContainer-centerAlignItems PicassoContainer-flex"
241
+ class="flex items-center"
242
242
  >
243
243
  <p
244
244
  class="m-0 text-xxs text-graphite font-semibold"
@@ -251,40 +251,40 @@ exports[`NonNativeSelectOptions renders option groups 1`] = `
251
251
  </li>
252
252
  <li
253
253
  aria-disabled="false"
254
- class="MuiButtonBase-root MuiListItem-root MuiMenuItem-root PicassoMenuItem-root PicassoMenuItem-light MuiMenuItem-gutters PicassoMenuItem-gutters MuiListItem-gutters MuiListItem-button"
254
+ class="text-black bg-transparent hover:bg-blue focus:bg-blue px-4 py-[0.375rem] min-w w-auto min-h sm:min-h md:min-h relative cursor-pointer transition-colors duration-150 ease-in overflow-hidden whitespace-normal text-left no-underline flex items-center justify-start outline-none appearance-none leading-4"
255
255
  data-highlighted="false"
256
256
  role="option"
257
257
  tabindex="-1"
258
258
  value="4"
259
259
  >
260
260
  <div
261
- class="PicassoContainer-flex PicassoMenuItem-itemWrapper"
261
+ class="flex flex-1 max-w"
262
262
  >
263
263
  <div
264
- class="PicassoContainer-flex PicassoContainer-column PicassoMenuItem-content"
264
+ class="flex flex-col flex-1 min-w"
265
265
  >
266
266
  <div
267
- class="PicassoContainer-centerAlignItems PicassoContainer-flex"
267
+ class="flex items-center"
268
268
  />
269
269
  </div>
270
270
  </div>
271
271
  </li>
272
272
  <li
273
273
  aria-disabled="false"
274
- class="MuiButtonBase-root MuiListItem-root MuiMenuItem-root PicassoMenuItem-root PicassoMenuItem-light MuiMenuItem-gutters PicassoMenuItem-gutters MuiListItem-gutters MuiListItem-button"
274
+ class="text-black bg-transparent hover:bg-blue focus:bg-blue px-4 py-[0.375rem] min-w w-auto min-h sm:min-h md:min-h relative cursor-pointer transition-colors duration-150 ease-in overflow-hidden whitespace-normal text-left no-underline flex items-center justify-start outline-none appearance-none leading-4"
275
275
  data-highlighted="false"
276
276
  role="option"
277
277
  tabindex="-1"
278
278
  value="5"
279
279
  >
280
280
  <div
281
- class="PicassoContainer-flex PicassoMenuItem-itemWrapper"
281
+ class="flex flex-1 max-w"
282
282
  >
283
283
  <div
284
- class="PicassoContainer-flex PicassoContainer-column PicassoMenuItem-content"
284
+ class="flex flex-col flex-1 min-w"
285
285
  >
286
286
  <div
287
- class="PicassoContainer-centerAlignItems PicassoContainer-flex"
287
+ class="flex items-center"
288
288
  />
289
289
  </div>
290
290
  </div>
@@ -1,13 +1,9 @@
1
1
  import type { ReactNode, RefObject } from 'react'
2
2
  import React, { useRef } from 'react'
3
- import type { Theme } from '@material-ui/core/styles'
4
- import { makeStyles } from '@material-ui/core/styles'
5
3
  import type { BaseProps } from '@toptal/picasso-shared'
6
- import cx from 'classnames'
7
4
  import { useIsomorphicLayoutEffect } from '@toptal/picasso-utils'
8
5
  import { Menu } from '@toptal/picasso-menu'
9
-
10
- import styles from './styles'
6
+ import { twJoin, twMerge } from '@toptal/picasso-tailwind-merge'
11
7
 
12
8
  export interface Props extends BaseProps {
13
9
  children: React.ReactNode
@@ -22,10 +18,6 @@ export interface Props extends BaseProps {
22
18
  }
23
19
  }
24
20
 
25
- const useStyles = makeStyles<Theme>(styles, {
26
- name: 'PicassoScrollMenu',
27
- })
28
-
29
21
  const getMenuSelectedNode = (
30
22
  menuRef: RefObject<HTMLDivElement>,
31
23
  selectedIndex?: number | null
@@ -75,7 +67,6 @@ const ScrollMenu = (props: Props) => {
75
67
  'data-testid': dataTestId,
76
68
  ...rest
77
69
  } = props
78
- const classes = useStyles()
79
70
  const menuRef = useRef<HTMLDivElement>(null)
80
71
 
81
72
  useIsomorphicLayoutEffect(
@@ -85,7 +76,7 @@ const ScrollMenu = (props: Props) => {
85
76
 
86
77
  return (
87
78
  <Menu
88
- className={cx(classes.menu, className)}
79
+ className={twMerge('bg-white', className)}
89
80
  style={style}
90
81
  role={role}
91
82
  data-testid={dataTestId || testIds?.root}
@@ -96,7 +87,12 @@ const ScrollMenu = (props: Props) => {
96
87
  <div
97
88
  data-testid={testIds?.list}
98
89
  ref={menuRef}
99
- className={classes.scrollView}
90
+ className={twJoin(
91
+ 'overflow-y-auto',
92
+ 'max-h-[26.875rem]',
93
+ '[@media(max-height:585px)]:max-h-[calc(50vh-4.3125rem)]',
94
+ '[@media(max-height:585px)]:md:max-h-[calc(50vh-4.8125rem)]'
95
+ )}
100
96
  onBlur={onBlur}
101
97
  >
102
98
  {children}
@@ -6,7 +6,7 @@ exports[`ScrollMenu renders 1`] = `
6
6
  class="Picasso-root"
7
7
  >
8
8
  <ul
9
- class="MuiList-root PicassoMenu-root PicassoScrollMenu-menu"
9
+ class="relative list-none outline-none shadow-1 py-2 px-0 m-0 rounded-sm bg-white"
10
10
  role="menu"
11
11
  tabindex="-1"
12
12
  >
@@ -14,25 +14,25 @@ exports[`ScrollMenu renders 1`] = `
14
14
  tabindex="0"
15
15
  >
16
16
  <div
17
- class="PicassoScrollMenu-scrollView"
17
+ class="overflow-y max-h [@media(max-height:585px)]:max-h-[calc(50vh [@media(max-height:585px)]:md:max-h-[calc(50vh"
18
18
  >
19
19
  <li
20
20
  aria-disabled="false"
21
- class="MuiButtonBase-root MuiListItem-root MuiMenuItem-root PicassoMenuItem-root PicassoMenuItem-light MuiMenuItem-gutters PicassoMenuItem-gutters MuiListItem-gutters MuiListItem-button"
21
+ class="text-black bg-transparent hover:bg-blue focus:bg-blue px-4 py-[0.375rem] min-w w-auto min-h sm:min-h md:min-h relative cursor-pointer transition-colors duration-150 ease-in overflow-hidden whitespace-normal text-left no-underline flex items-center justify-start outline-none appearance-none leading-4"
22
22
  role="menuitem"
23
23
  tabindex="-1"
24
24
  >
25
25
  <div
26
- class="PicassoContainer-flex PicassoMenuItem-itemWrapper"
26
+ class="flex flex-1 max-w"
27
27
  >
28
28
  <div
29
- class="PicassoContainer-flex PicassoContainer-column PicassoMenuItem-content"
29
+ class="flex flex-col flex-1 min-w"
30
30
  >
31
31
  <div
32
- class="PicassoContainer-centerAlignItems PicassoContainer-flex"
32
+ class="flex items-center"
33
33
  >
34
34
  <span
35
- class="PicassoMenuItem-stringContent"
35
+ class="flex-1 text-md leading-5"
36
36
  >
37
37
  top
38
38
  </span>
@@ -42,21 +42,21 @@ exports[`ScrollMenu renders 1`] = `
42
42
  </li>
43
43
  <li
44
44
  aria-disabled="false"
45
- class="MuiButtonBase-root MuiListItem-root MuiMenuItem-root PicassoMenuItem-root PicassoMenuItem-light MuiMenuItem-gutters PicassoMenuItem-gutters MuiListItem-gutters MuiListItem-button"
45
+ class="text-black bg-transparent hover:bg-blue focus:bg-blue px-4 py-[0.375rem] min-w w-auto min-h sm:min-h md:min-h relative cursor-pointer transition-colors duration-150 ease-in overflow-hidden whitespace-normal text-left no-underline flex items-center justify-start outline-none appearance-none leading-4"
46
46
  role="menuitem"
47
47
  tabindex="-1"
48
48
  >
49
49
  <div
50
- class="PicassoContainer-flex PicassoMenuItem-itemWrapper"
50
+ class="flex flex-1 max-w"
51
51
  >
52
52
  <div
53
- class="PicassoContainer-flex PicassoContainer-column PicassoMenuItem-content"
53
+ class="flex flex-col flex-1 min-w"
54
54
  >
55
55
  <div
56
- class="PicassoContainer-centerAlignItems PicassoContainer-flex"
56
+ class="flex items-center"
57
57
  >
58
58
  <span
59
- class="PicassoMenuItem-stringContent"
59
+ class="flex-1 text-md leading-5"
60
60
  >
61
61
  middle
62
62
  </span>
@@ -66,21 +66,21 @@ exports[`ScrollMenu renders 1`] = `
66
66
  </li>
67
67
  <li
68
68
  aria-disabled="false"
69
- class="MuiButtonBase-root MuiListItem-root MuiMenuItem-root PicassoMenuItem-root PicassoMenuItem-light MuiMenuItem-gutters PicassoMenuItem-gutters MuiListItem-gutters MuiListItem-button"
69
+ class="text-black bg-transparent hover:bg-blue focus:bg-blue px-4 py-[0.375rem] min-w w-auto min-h sm:min-h md:min-h relative cursor-pointer transition-colors duration-150 ease-in overflow-hidden whitespace-normal text-left no-underline flex items-center justify-start outline-none appearance-none leading-4"
70
70
  role="menuitem"
71
71
  tabindex="-1"
72
72
  >
73
73
  <div
74
- class="PicassoContainer-flex PicassoMenuItem-itemWrapper"
74
+ class="flex flex-1 max-w"
75
75
  >
76
76
  <div
77
- class="PicassoContainer-flex PicassoContainer-column PicassoMenuItem-content"
77
+ class="flex flex-col flex-1 min-w"
78
78
  >
79
79
  <div
80
- class="PicassoContainer-centerAlignItems PicassoContainer-flex"
80
+ class="flex items-center"
81
81
  >
82
82
  <span
83
- class="PicassoMenuItem-stringContent"
83
+ class="flex-1 text-md leading-5"
84
84
  >
85
85
  bottom
86
86
  </span>
@@ -63,7 +63,7 @@ page
63
63
  {
64
64
  title: 'Search behavior',
65
65
  description: `Search is enabled when the number of options is greater or equal to \`searchThreshold\`.
66
- ⚠️ When used in Drawer, we need to use \`disablePortal\` to enable the mouse focus of the search input.`,
66
+ ⚠️ When used in Drawer, we need to use \`disablePortal\` to enable the mouse focus of the search input.`,
67
67
  takeScreenshot: false,
68
68
  },
69
69
  'base/Select'
@@ -1,25 +1,23 @@
1
1
  import React from 'react'
2
- import type { Theme } from '@material-ui/core/styles'
3
- import { makeStyles } from '@material-ui/core/styles'
4
- import cx from 'classnames'
5
2
  import { DropdownArrows16 } from '@toptal/picasso-icons'
6
-
7
- import styles from './styles'
8
-
9
- const useStyles = makeStyles<Theme>(styles)
3
+ import { twJoin } from '@toptal/picasso-tailwind-merge'
10
4
 
11
5
  interface Props {
12
6
  disabled?: boolean
13
7
  }
14
8
 
15
9
  const SelectCaret = ({ disabled }: Props) => {
16
- const classes = useStyles()
17
-
18
10
  return (
19
11
  <DropdownArrows16
20
- className={cx(classes.caret, {
21
- [classes.caretDisabled]: disabled,
22
- })}
12
+ // className={twJoin(classes.caret, disabled && classes.caretDisabled)}
13
+ className={twJoin(
14
+ // in specs right spacing is defined relative to 6px icon width, while we use 16px
15
+ // so 5px are left instead of 10px when we use wider icon.
16
+ `absolute top-[calc(50%-0.5rem)] right-[0.3125rem]
17
+ text-graphite-700 text-[1rem]
18
+ cursor-inherit pointer-events-none`,
19
+ disabled && 'text-graphite-700/[.48] z-[1]'
20
+ )}
23
21
  />
24
22
  )
25
23
  }
@@ -6,7 +6,7 @@ exports[`SelectCaret renders 1`] = `
6
6
  class="Picasso-root"
7
7
  >
8
8
  <svg
9
- class="PicassoSvgDropdownArrows16-root makeStyles-caret"
9
+ class="PicassoSvgDropdownArrows16-root absolute top-[calc(50%-0.5rem)] right-[0.3125rem] text-graphite text-[1rem] cursor-inherit pointer-events"
10
10
  style="min-width: 16px; min-height: 16px;"
11
11
  viewBox="0 0 16 16"
12
12
  >
@@ -24,7 +24,7 @@ exports[`SelectCaret renders disabled 1`] = `
24
24
  class="Picasso-root"
25
25
  >
26
26
  <svg
27
- class="PicassoSvgDropdownArrows16-root makeStyles-caret makeStyles-caretDisabled"
27
+ class="PicassoSvgDropdownArrows16-root absolute top-[calc(50%-0.5rem)] right-[0.3125rem] text-graphite text-[1rem] cursor-inherit pointer-events text-graphite z-[1]"
28
28
  style="min-width: 16px; min-height: 16px;"
29
29
  viewBox="0 0 16 16"
30
30
  >
@@ -1,18 +1,11 @@
1
- import type { Theme } from '@material-ui/core/styles'
2
- import { makeStyles } from '@material-ui/core/styles'
3
1
  import React from 'react'
4
- import cx from 'classnames'
2
+ import { twJoin } from '@toptal/picasso-tailwind-merge'
5
3
 
6
4
  import type { ScrollMenuProps } from '../ScrollMenu'
7
5
  import { ScrollMenu } from '../ScrollMenu'
8
- import styles from './styles'
9
6
 
10
7
  export interface Props extends ScrollMenuProps {}
11
8
 
12
- const useStyles = makeStyles<Theme>(styles, {
13
- name: 'PicassoSelectOptions',
14
- })
15
-
16
9
  const SelectOptions = (props: Props) => {
17
10
  const {
18
11
  selectedIndex,
@@ -25,16 +18,13 @@ const SelectOptions = (props: Props) => {
25
18
  role,
26
19
  ...rest
27
20
  } = props
28
- const classes = useStyles()
29
21
 
30
22
  return (
31
23
  <ScrollMenu
32
- className={cx(
33
- classes.menu,
34
- {
35
- [classes.withHeader]: Boolean(fixedHeader),
36
- [classes.withFooter]: Boolean(fixedFooter),
37
- },
24
+ className={twJoin(
25
+ 'shadow-5',
26
+ Boolean(fixedHeader) && 'pt-[0.125rem] [&>div:first-child]:pb-2',
27
+ Boolean(fixedFooter) && 'pb-0',
38
28
  className
39
29
  )}
40
30
  style={style}
@@ -1,6 +0,0 @@
1
- import type { Theme } from '@material-ui/core/styles';
2
- import '@toptal/picasso-input/styles';
3
- import '@toptal/picasso-loader/styles';
4
- declare const _default: (theme: Theme) => import("@material-ui/styles").StyleRules<{}, "placeholder" | "startAdornment" | "endAdornment" | "select" | "root" | "rootFull" | "rootShrink" | "rootAuto" | "rootDisabled" | "nativeInput" | "startAdornmentPadding" | "endAdornmentPadding">;
5
- export default _default;
6
- //# sourceMappingURL=styles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/NativeSelect/styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAGrD,OAAO,8BAA8B,CAAA;AACrC,OAAO,+BAA+B,CAAA;gCAEf,KAAK;AAA5B,wBAkDC"}
@@ -1,54 +0,0 @@
1
- // eslint-disable-next-line import/order
2
- import { createStyles } from '@material-ui/core/styles';
3
- import '@toptal/picasso-input/styles';
4
- import '@toptal/picasso-loader/styles';
5
- export default (theme) => {
6
- const { palette } = theme;
7
- return createStyles({
8
- root: {
9
- position: 'relative',
10
- display: 'inline-flex',
11
- fontSize: '1rem',
12
- cursor: 'pointer',
13
- },
14
- rootFull: {
15
- width: '100%',
16
- },
17
- rootShrink: {
18
- width: 'auto',
19
- },
20
- rootAuto: {},
21
- rootDisabled: {
22
- cursor: 'default',
23
- },
24
- select: {
25
- width: '100%',
26
- padding: '0.5rem',
27
- '&:focus': {
28
- backgroundColor: 'inherit',
29
- },
30
- },
31
- nativeInput: {
32
- padding: 0,
33
- backgroundColor: palette.common.white,
34
- },
35
- placeholder: {
36
- color: palette.grey.main2,
37
- },
38
- startAdornment: {
39
- position: 'absolute',
40
- left: '0.625rem',
41
- },
42
- endAdornment: {
43
- position: 'absolute',
44
- right: '1.625rem',
45
- },
46
- startAdornmentPadding: {
47
- paddingLeft: '2.5625rem',
48
- },
49
- endAdornmentPadding: {
50
- paddingRight: '3.5625rem',
51
- },
52
- });
53
- };
54
- //# sourceMappingURL=styles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/NativeSelect/styles.ts"],"names":[],"mappings":"AACA,wCAAwC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,8BAA8B,CAAA;AACrC,OAAO,+BAA+B,CAAA;AAEtC,eAAe,CAAC,KAAY,EAAE,EAAE;IAC9B,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAA;IAEzB,OAAO,YAAY,CAAC;QAClB,IAAI,EAAE;YACJ,QAAQ,EAAE,UAAU;YACpB,OAAO,EAAE,aAAa;YACtB,QAAQ,EAAE,MAAM;YAChB,MAAM,EAAE,SAAS;SAClB;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,MAAM;SACd;QACD,UAAU,EAAE;YACV,KAAK,EAAE,MAAM;SACd;QACD,QAAQ,EAAE,EAAE;QACZ,YAAY,EAAE;YACZ,MAAM,EAAE,SAAS;SAClB;QACD,MAAM,EAAE;YACN,KAAK,EAAE,MAAM;YACb,OAAO,EAAE,QAAQ;YAEjB,SAAS,EAAE;gBACT,eAAe,EAAE,SAAS;aAC3B;SACF;QACD,WAAW,EAAE;YACX,OAAO,EAAE,CAAC;YACV,eAAe,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK;SACtC;QACD,WAAW,EAAE;YACX,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK;SAC1B;QACD,cAAc,EAAE;YACd,QAAQ,EAAE,UAAU;YACpB,IAAI,EAAE,UAAU;SACjB;QACD,YAAY,EAAE;YACZ,QAAQ,EAAE,UAAU;YACpB,KAAK,EAAE,UAAU;SAClB;QACD,qBAAqB,EAAE;YACrB,WAAW,EAAE,WAAW;SACzB;QACD,mBAAmB,EAAE;YACnB,YAAY,EAAE,WAAW;SAC1B;KACF,CAAC,CAAA;AACJ,CAAC,CAAA"}