@entur/dropdown 4.0.0-beta.2 → 4.0.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/dist/styles.css CHANGED
@@ -1,6 +1,21 @@
1
1
  :root {
2
2
  --eds-dropdown: 1;
3
- }/* DO NOT CHANGE!*/
3
+ }
4
+ /* DO NOT CHANGE!*/
5
+ /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
6
+ .eds-dropdown + .eds-form-control__append {
7
+ margin-left: -2em;
8
+ pointer-events: none;
9
+ }
10
+
11
+ .eds-dropdown option {
12
+ color: #181c56;
13
+ background-color: #ffffff;
14
+ }
15
+ .eds-contrast .eds-dropdown option {
16
+ color: #181c56;
17
+ }
18
+ /* DO NOT CHANGE!*/
4
19
  /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
5
20
  .eds-multi-select {
6
21
  position: relative;
@@ -83,34 +98,15 @@
83
98
  }
84
99
  .eds-multiselect-checkbox--checked .eds-checkbox-icon__path {
85
100
  stroke: #ffffff;
86
- -webkit-animation: stroke ease-in-out 0.2s 0.1s forwards;
87
- animation: stroke ease-in-out 0.2s 0.1s forwards;
88
- }
89
-
90
- @-webkit-keyframes stroke {
91
- 100% {
92
- stroke-dashoffset: 0;
93
- }
101
+ animation: stroke ease-in-out 0.2s 0.1s forwards;
94
102
  }
95
103
 
96
104
  @keyframes stroke {
97
105
  100% {
98
106
  stroke-dashoffset: 0;
99
107
  }
100
- }/* DO NOT CHANGE!*/
101
- /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
102
- .eds-dropdown + .eds-form-control__append {
103
- margin-left: -2em;
104
- pointer-events: none;
105
108
  }
106
-
107
- .eds-dropdown option {
108
- color: #181c56;
109
- background-color: #ffffff;
110
- }
111
- .eds-contrast .eds-dropdown option {
112
- color: #181c56;
113
- }/* DO NOT CHANGE!*/
109
+ /* DO NOT CHANGE!*/
114
110
  /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
115
111
  .eds-dropdown-list {
116
112
  border-radius: 0.25rem;
@@ -126,7 +122,7 @@
126
122
  z-index: 20;
127
123
  }
128
124
  .eds-contrast .eds-dropdown-list {
129
- box-shadow: 0 0.0625rem 0.1875rem #393d79;
125
+ box-shadow: 0 0.0625rem 0.1875rem rgb(57, 61, 121);
130
126
  }
131
127
  .eds-dropdown-list--open {
132
128
  display: inline-block;
@@ -139,7 +135,6 @@
139
135
  max-height: 30vh;
140
136
  }
141
137
  }
142
-
143
138
  .eds-dropdown-list__item {
144
139
  align-items: center;
145
140
  background-color: #f8f8f8;
@@ -172,10 +167,19 @@
172
167
  .eds-contrast .eds-dropdown-list__item--highlighted {
173
168
  background-color: #d1d4e3;
174
169
  }
175
-
176
- .eds-dropdown-list__item-icon {
170
+ .eds-dropdown-list-icon {
177
171
  margin-left: 0.75rem;
178
- }/* DO NOT CHANGE!*/
172
+ }
173
+ /* DO NOT CHANGE!*/
174
+ /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
175
+ .eds-inline-spinner {
176
+ align-items: center;
177
+ display: flex;
178
+ justify-content: center;
179
+ height: 100%;
180
+ width: 100%;
181
+ }
182
+ /* DO NOT CHANGE!*/
179
183
  /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
180
184
  .eds-dropdown__searchable-selected-item {
181
185
  display: block;
@@ -197,22 +201,10 @@
197
201
  transition: none;
198
202
  }
199
203
 
200
- .eds-form-control.eds-dropdown__input:-ms-input-placeholder {
201
- -ms-transition: none;
202
- transition: none;
203
- }
204
-
205
204
  .eds-form-control.eds-dropdown__input::placeholder {
206
205
  transition: none;
207
- }/* DO NOT CHANGE!*/
208
- /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
209
- .eds-inline-spinner {
210
- align-items: center;
211
- display: flex;
212
- justify-content: center;
213
- height: 100%;
214
- width: 100%;
215
- }/* DO NOT CHANGE!*/
206
+ }
207
+ /* DO NOT CHANGE!*/
216
208
  /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
217
209
  .eds-searchable-dropdown__wrapper {
218
210
  position: relative;
@@ -232,25 +224,18 @@
232
224
  max-width: 65%;
233
225
  }
234
226
  .eds-searchable-dropdown-appendix__clear-button {
235
- background: none;
236
- border: none;
237
- border-radius: 50%;
238
- color: inherit;
239
- cursor: pointer;
240
- display: flex;
241
- font: inherit;
242
- font-size: 1rem;
243
- line-height: 1rem;
244
227
  padding: 0.5rem;
245
228
  margin-right: 0.25rem;
246
229
  }
247
- .eds-searchable-dropdown-appendix__clear-button:hover {
248
- background: #f3f3f3;
230
+ .eds-contrast .eds-searchable-dropdown-appendix__clear-button:hover {
231
+ background: #d1d3d3;
249
232
  }
250
- .eds-searchable-dropdown-appendix__clear-button:focus {
251
- outline-offset: 0.125rem;
233
+ .eds-contrast .eds-searchable-dropdown-appendix__clear-button:active {
234
+ background: #949494;
235
+ }
236
+ .eds-contrast .eds-searchable-dropdown-appendix__clear-button:focus {
237
+ border: 0.0625rem solid #181c56;
252
238
  outline: none;
253
- box-shadow: 0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #181c56;
254
239
  }
255
240
  .eds-searchable-dropdown-appendix__divider {
256
241
  content: "";
@@ -262,49 +247,41 @@
262
247
  .eds-contrast .eds-form-control-wrapper--disabled .eds-searchable-dropdown-appendix__divider {
263
248
  background-color: #8285a8;
264
249
  }
250
+ .eds-contrast .eds-searchable-dropdown-appendix__divider {
251
+ background-color: #d1d3d3;
252
+ }
265
253
  .eds-searchable-dropdown-appendix__toggle-button {
266
- -webkit-appearance: none;
267
- -moz-appearance: none;
268
- appearance: none;
269
- background: none;
270
- border: none;
271
- border-radius: 50%;
272
- color: inherit;
273
- font-size: inherit;
274
- font-family: inherit;
275
254
  margin-right: -0.75rem;
276
255
  margin-left: 0.25rem;
277
- padding: 0.5rem;
278
- display: flex;
279
- justify-content: center;
280
256
  }
281
257
  .eds-searchable-dropdown-appendix__toggle-button--open svg {
282
258
  transform: rotate(180deg);
283
259
  }
284
- .eds-searchable-dropdown-appendix__toggle-button:hover {
285
- background: #f3f3f3;
260
+ .eds-searchable-dropdown-appendix__toggle-button svg {
261
+ transition: transform ease-in-out 0.1s;
286
262
  }
287
- .eds-searchable-dropdown-appendix__toggle-button:focus {
288
- outline-offset: 0.125rem;
289
- outline: none;
290
- box-shadow: 0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #181c56;
263
+ .eds-contrast .eds-searchable-dropdown-appendix__toggle-button:hover {
264
+ background: #d1d3d3;
291
265
  }
292
- .eds-contrast .eds-searchable-dropdown-appendix__toggle-button:focus {
293
- box-shadow: 0 0 0 0.125rem #181c56, 0 0 0 0.25rem #ffffff;
266
+ .eds-contrast .eds-searchable-dropdown-appendix__toggle-button:active {
267
+ background: #949494;
294
268
  }
295
- .eds-searchable-dropdown-appendix__toggle-button svg {
296
- transition: transform ease-in-out 0.1s;
269
+ .eds-contrast .eds-searchable-dropdown-appendix__toggle-button:focus {
270
+ border: 0.0625rem solid #181c56;
271
+ outline: none;
297
272
  }
298
273
  .eds-searchable-dropdown__list {
299
274
  position: absolute;
300
275
  top: 3rem;
301
- border-radius: 0.25rem;
302
- box-shadow: 0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.25);
303
276
  display: none;
304
277
  list-style: none;
278
+ border-radius: 0.25rem;
279
+ border: 0.125rem solid #d1d3d3;
280
+ box-shadow: 0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.25);
281
+ padding: 0;
305
282
  margin: 0;
283
+ margin-top: 0.5rem;
306
284
  max-height: 50vh;
307
- padding: 0;
308
285
  overflow-y: auto;
309
286
  width: 100%;
310
287
  z-index: 20;
@@ -323,9 +300,7 @@
323
300
  .eds-searchable-dropdown__list__item {
324
301
  align-items: center;
325
302
  background-color: #f8f8f8;
326
- border-bottom: 0.125rem solid #e9e9e9;
327
- border-left: 0.125rem solid #e9e9e9;
328
- border-right: 0.125rem solid #e9e9e9;
303
+ border-bottom: 0.125rem solid #d1d3d3;
329
304
  color: #181c56;
330
305
  display: flex;
331
306
  justify-content: space-between;
@@ -335,9 +310,6 @@
335
310
  padding: 0.75rem 1rem;
336
311
  width: 100%;
337
312
  }
338
- .eds-searchable-dropdown__list__item:first-child {
339
- border-top: 0.125rem solid #e9e9e9;
340
- }
341
313
  .eds-searchable-dropdown__list__item:last-child {
342
314
  border-bottom: none;
343
315
  }
@@ -347,9 +319,6 @@
347
319
  .eds-searchable-dropdown__list__item--highlighted {
348
320
  background-color: #d1d4e3;
349
321
  }
350
- .eds-contrast .eds-searchable-dropdown__list__item--highlighted {
351
- background-color: #d1d4e3;
352
- }
353
322
 
354
323
  .eds-form-control.eds-searchable-dropdown__input::-moz-placeholder {
355
324
  -moz-transition: none;
@@ -358,18 +327,12 @@
358
327
  bottom: 1px;
359
328
  }
360
329
 
361
- .eds-form-control.eds-searchable-dropdown__input:-ms-input-placeholder {
362
- -ms-transition: none;
363
- transition: none;
364
- position: relative;
365
- bottom: 1px;
366
- }
367
-
368
330
  .eds-form-control.eds-searchable-dropdown__input::placeholder {
369
331
  transition: none;
370
332
  position: relative;
371
333
  bottom: 1px;
372
- }/* DO NOT CHANGE!*/
334
+ }
335
+ /* DO NOT CHANGE!*/
373
336
  /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
374
337
  .eds-dropdown-wrapper {
375
338
  position: relative;
@@ -386,10 +349,6 @@
386
349
  color: #656782;
387
350
  }
388
351
 
389
- .eds-dropdown__input:-ms-input-placeholder {
390
- color: #656782;
391
- }
392
-
393
352
  .eds-dropdown__input::placeholder {
394
353
  color: #656782;
395
354
  }
@@ -430,7 +389,8 @@
430
389
  }
431
390
  .eds-contrast .eds-form-control-wrapper--disabled .eds-dropdown__divider {
432
391
  background-color: #8285a8;
433
- }/* DO NOT CHANGE!*/
392
+ }
393
+ /* DO NOT CHANGE!*/
434
394
  /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
435
395
  .eds-dropdown__toggle-button {
436
396
  -webkit-appearance: none;
@@ -457,4 +417,4 @@
457
417
  }
458
418
  .eds-contrast .eds-dropdown__toggle-button:focus {
459
419
  box-shadow: 0 0 0 0.125rem #181c56, 0 0 0 0.25rem #ffffff;
460
- }
420
+ }
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
2
  /** A dropdown item has a string label and a string value */
3
- export declare type NormalizedDropdownItemType = {
3
+ export type NormalizedDropdownItemType = {
4
4
  value: string;
5
5
  label: string;
6
6
  icons?: React.ComponentType<any>[];
7
7
  };
8
- export declare type DropdownItemType = {
8
+ export type DropdownItemType = {
9
9
  value?: string;
10
10
  label: string;
11
11
  icons?: React.ComponentType<any>[];
@@ -1,7 +1,7 @@
1
1
  import { DropdownItemType, NormalizedDropdownItemType } from './useNormalizedItems';
2
- declare type AsyncDropdownItemType = (inputType: string) => Promise<DropdownItemType[]>;
3
- declare type SyncDropdownItemType = (inputType: string) => DropdownItemType[];
4
- export declare type PotentiallyAsyncDropdownItemType = DropdownItemType[] | SyncDropdownItemType | AsyncDropdownItemType;
2
+ type AsyncDropdownItemType = (inputType: string) => Promise<DropdownItemType[]>;
3
+ type SyncDropdownItemType = (inputType: string) => DropdownItemType[];
4
+ export type PotentiallyAsyncDropdownItemType = DropdownItemType[] | SyncDropdownItemType | AsyncDropdownItemType;
5
5
  export declare const useResolvedItems: (itemsOrItemsResolver: PotentiallyAsyncDropdownItemType, debounceTimeout?: number) => {
6
6
  fetchItems: (arg: string) => void;
7
7
  loading: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@entur/dropdown",
3
- "version": "4.0.0-beta.2",
3
+ "version": "4.0.1",
4
4
  "license": "EUPL-1.2",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/dropdown.esm.js",
@@ -19,24 +19,25 @@
19
19
  "scripts": {
20
20
  "start": "dts watch --noClean",
21
21
  "build": "dts build",
22
- "test": "dts test --env=jsdom",
23
- "lint": "dts lint"
22
+ "test": "dts test",
23
+ "lint": "dts lint src"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "react": ">=16.8.0",
27
27
  "react-dom": ">=16.8.0"
28
28
  },
29
29
  "dependencies": {
30
- "@entur/a11y": "^0.2.49",
31
- "@entur/chip": "^0.6.7",
32
- "@entur/form": "^5.4.4",
33
- "@entur/icons": "^4.3.3",
34
- "@entur/loader": "^0.4.12",
35
- "@entur/tokens": "^3.4.1",
36
- "@entur/tooltip": "^2.5.16",
37
- "@entur/utils": "^0.4.5",
30
+ "@entur/a11y": "^0.2.61",
31
+ "@entur/button": "^3.0.2",
32
+ "@entur/chip": "^0.6.27",
33
+ "@entur/form": "^7.0.0",
34
+ "@entur/icons": "^6.0.1",
35
+ "@entur/loader": "^0.4.25",
36
+ "@entur/tokens": "^3.8.1",
37
+ "@entur/tooltip": "^2.6.10",
38
+ "@entur/utils": "^0.6.0",
38
39
  "classnames": "^2.3.1",
39
40
  "downshift": "^6.1.7"
40
41
  },
41
- "gitHead": "2fb68e6566f45ac15cc66d8d1a6b4fdec4105d51"
42
+ "gitHead": "8e5454328103d2a6f3e44cbfd900cc534f1a05b9"
42
43
  }