@entur/dropdown 7.1.0 → 7.1.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,91 +1,5 @@
1
1
  /* DO NOT CHANGE!*/
2
2
  /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
3
- .eds-dropdown__list {
4
- position: absolute;
5
- width: 100%;
6
- box-sizing: content-box;
7
- max-height: 50vh;
8
- overflow-y: auto;
9
- padding: 0;
10
- margin: 0;
11
- list-style: none;
12
- border: 0.125rem solid var(--components-form-basemenu-border);
13
- border-radius: 0.25rem;
14
- box-shadow: 0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.25);
15
- cursor: default;
16
- }
17
- .eds-dropdown__list__floating-container {
18
- z-index: 20;
19
- width: 100%;
20
- }
21
- .eds-dropdown__list:focus {
22
- outline: none;
23
- }
24
- .eds-dropdown__list__item {
25
- display: flex;
26
- align-items: center;
27
- justify-content: flex-start;
28
- padding: 0.75rem 1rem;
29
- font-family: inherit;
30
- font-size: 1rem;
31
- word-break: break-word;
32
- line-height: 1.25rem;
33
- overflow-x: hidden;
34
- color: var(--components-form-basemenu-text);
35
- background-color: var(--components-form-basemenu-fill-default);
36
- }
37
- .eds-dropdown__list__item:last-child {
38
- border-bottom: none;
39
- }
40
- .eds-dropdown__list__item__text {
41
- flex: 1;
42
- cursor: default;
43
- }
44
- .eds-dropdown__list__item__icon {
45
- margin-left: 0.75rem;
46
- }
47
- .eds-dropdown__list__item__checkbox {
48
- pointer-events: none;
49
- }
50
- .eds-contrast .eds-dropdown__list__item__checkbox.eds-checkbox__container > input + .eds-checkbox__icon {
51
- border-color: var(--components-form-checkbox-standard-border);
52
- }
53
- .eds-contrast .eds-dropdown__list__item__checkbox.eds-checkbox__container > input:checked + .eds-checkbox__icon,
54
- .eds-contrast .eds-dropdown__list__item__checkbox.eds-checkbox__container > input:indeterminate + .eds-checkbox__icon {
55
- background-color: var(--components-form-checkbox-standard-fill-selected);
56
- }
57
- .eds-contrast .eds-dropdown__list__item__checkbox.eds-checkbox__container > input:checked + .eds-checkbox__icon path,
58
- .eds-contrast .eds-dropdown__list__item__checkbox.eds-checkbox__container > input:indeterminate + .eds-checkbox__icon path {
59
- stroke: var(--components-form-checkbox-standard-icon);
60
- }
61
- .eds-contrast .eds-dropdown__list__item__checkbox.eds-checkbox__container > input:checked + .eds-checkbox__icon rect,
62
- .eds-contrast .eds-dropdown__list__item__checkbox.eds-checkbox__container > input:indeterminate + .eds-checkbox__icon rect {
63
- fill: var(--components-form-checkbox-standard-icon);
64
- }
65
- .eds-dropdown__list__item--highlighted {
66
- background-color: var(--components-form-basemenu-fill-hover);
67
- }
68
- .eds-dropdown__list__item--highlighted .eds-dropdown__list__item__checkbox.eds-checkbox__container > input:checked + .eds-checkbox__icon,
69
- .eds-dropdown__list__item--highlighted .eds-dropdown__list__item__checkbox.eds-checkbox__container > input:indeterminate + .eds-checkbox__icon,
70
- .eds-dropdown__list__item--highlighted .eds-dropdown__list__item__checkbox.eds-checkbox__container:hover > input:checked + .eds-checkbox__icon,
71
- .eds-dropdown__list__item--highlighted .eds-dropdown__list__item__checkbox.eds-checkbox__container:hover > input:indeterminate + .eds-checkbox__icon {
72
- background-color: var(--components-form-checkbox-standard-fill-selected);
73
- border-color: transparent;
74
- }
75
- .eds-dropdown__list__item--highlighted .eds-dropdown__list__item__checkbox.eds-checkbox__container > input + .eds-checkbox__icon,
76
- .eds-dropdown__list__item--highlighted .eds-dropdown__list__item__checkbox.eds-checkbox__container:hover > input + .eds-checkbox__icon {
77
- border-color: var(--components-form-checkbox-standard-border);
78
- }
79
- .eds-dropdown__list__item--selected {
80
- background-color: var(--components-form-basemenu-fill-hover);
81
- }
82
- @media all and (min-width: 50rem) {
83
- .eds-dropdown__list {
84
- max-height: 30vh;
85
- }
86
- }
87
- /* DO NOT CHANGE!*/
88
- /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
89
3
  .eds-contrast .eds-dropdown__selected-item-tag {
90
4
  background: var(--components-chip-standard-default);
91
5
  border: 0.0625rem solid var(--components-chip-standard-border);
@@ -118,18 +32,18 @@
118
32
  cursor: text;
119
33
  }
120
34
  .eds-contrast .eds-dropdown__selected-item-tag--readonly {
121
- background-color: var(--components-dropdown-dropdown-standard-fill-readonly);
35
+ background-color: var(--components-form-baseform-standard-fill-readonly);
122
36
  border-color: var(--components-chip-contrast-border);
123
- color: var(--components-dropdown-dropdown-standard-text-readonly);
37
+ color: var(--components-form-baseform-standard-text-content);
124
38
  }
125
39
  .eds-dropdown__selected-item-tag--disabled {
126
40
  cursor: not-allowed;
127
41
  border: 1px dashed var(--components-chip-standard-border-disabled);
128
42
  }
129
43
  .eds-contrast .eds-dropdown__selected-item-tag--disabled {
130
- background-color: var(--components-dropdown-dropdown-standard-fill-disabled);
44
+ background-color: var(--components-form-baseform-standard-fill-disabled);
131
45
  border: 1px dashed var(--components-chip-contrast-border-disabled);
132
- color: var(--components-dropdown-dropdown-standard-text-disabled);
46
+ color: var(--components-form-baseform-standard-text-disabled);
133
47
  }
134
48
  .eds-dropdown__selected-item-tag__text {
135
49
  text-wrap: nowrap;
@@ -153,16 +67,9 @@
153
67
  .eds-dropdown__appendix {
154
68
  display: flex;
155
69
  align-items: center;
156
- }
157
- .eds-dropdown__appendix__clear-button {
158
- padding: 0.5rem;
159
- margin-right: 0.25rem;
160
- }
161
- .eds-contrast .eds-dropdown__appendix__clear-button:hover {
162
- background-color: var(--components-button-iconbutton-standard-hover);
163
- }
164
- .eds-contrast .eds-dropdown__appendix__clear-button:focus-visible {
165
- outline-color: var(--basecolors-stroke-focus-standard);
70
+ align-self: flex-start;
71
+ margin-top: 0.25rem;
72
+ gap: 0.25rem;
166
73
  }
167
74
  .eds-dropdown__appendix__clear-button__tooltip {
168
75
  white-space: nowrap;
@@ -170,13 +77,12 @@
170
77
  .eds-dropdown__appendix__divider {
171
78
  content: "";
172
79
  display: block;
173
- background-color: var(--components-dropdown-dropdown-standard-text-content);
80
+ background-color: var(--components-form-baseform-standard-text-content);
174
81
  height: 1.5rem;
175
82
  width: 1px;
176
83
  }
177
84
  .eds-dropdown__appendix__toggle-button {
178
85
  margin-right: -0.75rem;
179
- margin-left: 0.25rem;
180
86
  }
181
87
  .eds-dropdown__appendix__toggle-button--open svg {
182
88
  transform: rotate(180deg);
@@ -206,9 +112,89 @@
206
112
  }
207
113
  /* DO NOT CHANGE!*/
208
114
  /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
115
+ .eds-dropdown__list {
116
+ position: absolute;
117
+ box-sizing: border-box;
118
+ max-height: 20rem;
119
+ overflow-y: auto;
120
+ padding: 0;
121
+ margin: 0;
122
+ list-style: none;
123
+ border: 0.125rem solid var(--components-form-basemenu-border);
124
+ border-radius: 0.25rem;
125
+ box-shadow: 0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.25);
126
+ cursor: default;
127
+ z-index: 20;
128
+ }
129
+ .eds-dropdown__list:focus {
130
+ outline: none;
131
+ }
132
+ .eds-dropdown__list__item {
133
+ display: flex;
134
+ align-items: center;
135
+ justify-content: flex-start;
136
+ padding: 0.75rem 1rem;
137
+ font-family: inherit;
138
+ font-size: 1rem;
139
+ word-break: break-word;
140
+ line-height: 1.25rem;
141
+ overflow-x: hidden;
142
+ color: var(--components-form-basemenu-text);
143
+ background-color: var(--components-form-basemenu-fill-default);
144
+ }
145
+ .eds-dropdown__list__item:last-child {
146
+ border-bottom: none;
147
+ }
148
+ .eds-dropdown__list__item__text {
149
+ flex: 1;
150
+ cursor: default;
151
+ }
152
+ .eds-dropdown__list__item__icon {
153
+ margin-left: 0.75rem;
154
+ }
155
+ .eds-dropdown__list__item__checkbox {
156
+ pointer-events: none;
157
+ }
158
+ .eds-contrast .eds-dropdown__list__item__checkbox.eds-checkbox__container > input + .eds-checkbox__icon {
159
+ border-color: var(--components-form-checkbox-standard-border);
160
+ }
161
+ .eds-contrast .eds-dropdown__list__item__checkbox.eds-checkbox__container > input:checked + .eds-checkbox__icon,
162
+ .eds-contrast .eds-dropdown__list__item__checkbox.eds-checkbox__container > input:indeterminate + .eds-checkbox__icon {
163
+ background-color: var(--components-form-checkbox-standard-fill-selected);
164
+ }
165
+ .eds-contrast .eds-dropdown__list__item__checkbox.eds-checkbox__container > input:checked + .eds-checkbox__icon path,
166
+ .eds-contrast .eds-dropdown__list__item__checkbox.eds-checkbox__container > input:indeterminate + .eds-checkbox__icon path {
167
+ stroke: var(--components-form-checkbox-standard-icon);
168
+ }
169
+ .eds-contrast .eds-dropdown__list__item__checkbox.eds-checkbox__container > input:checked + .eds-checkbox__icon rect,
170
+ .eds-contrast .eds-dropdown__list__item__checkbox.eds-checkbox__container > input:indeterminate + .eds-checkbox__icon rect {
171
+ fill: var(--components-form-checkbox-standard-icon);
172
+ }
173
+ .eds-dropdown__list__item--highlighted {
174
+ background-color: var(--components-form-basemenu-fill-hover);
175
+ }
176
+ .eds-dropdown__list__item--highlighted .eds-dropdown__list__item__checkbox.eds-checkbox__container > input:checked + .eds-checkbox__icon,
177
+ .eds-dropdown__list__item--highlighted .eds-dropdown__list__item__checkbox.eds-checkbox__container > input:indeterminate + .eds-checkbox__icon,
178
+ .eds-dropdown__list__item--highlighted .eds-dropdown__list__item__checkbox.eds-checkbox__container:hover > input:checked + .eds-checkbox__icon,
179
+ .eds-dropdown__list__item--highlighted .eds-dropdown__list__item__checkbox.eds-checkbox__container:hover > input:indeterminate + .eds-checkbox__icon {
180
+ background-color: var(--components-form-checkbox-standard-fill-selected);
181
+ border-color: transparent;
182
+ }
183
+ .eds-dropdown__list__item--highlighted .eds-dropdown__list__item__checkbox.eds-checkbox__container > input + .eds-checkbox__icon,
184
+ .eds-dropdown__list__item--highlighted .eds-dropdown__list__item__checkbox.eds-checkbox__container:hover > input + .eds-checkbox__icon {
185
+ border-color: var(--components-form-checkbox-standard-border);
186
+ }
187
+ .eds-dropdown__list__item--selected {
188
+ background-color: var(--components-form-basemenu-fill-hover);
189
+ }
190
+ /* DO NOT CHANGE!*/
191
+ /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
209
192
  .eds-dropdown {
210
193
  cursor: pointer;
211
194
  }
195
+ .eds-dropdown:has(.eds-form-control-wrapper--readonly) {
196
+ cursor: text;
197
+ }
212
198
  .eds-dropdown__input {
213
199
  flex: 1;
214
200
  width: 0;
@@ -240,7 +226,7 @@
240
226
  flex: 1;
241
227
  overflow-x: hidden;
242
228
  text-overflow: ellipsis;
243
- padding: 1.375rem 0rem 0.25rem;
229
+ padding: 1.375rem 0rem 0.3rem;
244
230
  white-space: nowrap;
245
231
  line-height: 1rem;
246
232
  font-family: inherit;
@@ -248,6 +234,13 @@
248
234
  .eds-dropdown--searchable__selected-item--hidden {
249
235
  flex: 0;
250
236
  }
237
+ .eds-dropdown--searchable :not(.eds-dropdown--searchable__selected-item--hidden) + ::-moz-placeholder {
238
+ -moz-transition: none;
239
+ transition: none;
240
+ }
241
+ .eds-dropdown--searchable :not(.eds-dropdown--searchable__selected-item--hidden) + ::placeholder {
242
+ transition: none;
243
+ }
251
244
  .eds-dropdown--multiselect {
252
245
  cursor: text;
253
246
  }
package/dist/utils.d.ts CHANGED
@@ -1,11 +1,15 @@
1
1
  import { UseComboboxState } from 'downshift';
2
2
  import { NormalizedDropdownItemType } from './types';
3
+ declare module 'react' {
4
+ function forwardRef<T, P = object>(render: (props: P, ref: React.Ref<T>) => React.ReactElement | null): (props: P & React.RefAttributes<T>) => React.ReactElement | null;
5
+ }
3
6
  export declare const EMPTY_INPUT = "";
4
7
  export declare function lowerCaseFilterTest(item: NormalizedDropdownItemType<any>, input: string | undefined): boolean;
5
8
  export declare function noFilter<ValueType>(item: NormalizedDropdownItemType<ValueType>, input: string | undefined): boolean;
6
9
  export declare const itemToString: (item: NormalizedDropdownItemType<any> | null) => string;
7
10
  export declare const itemToKey: (item: NormalizedDropdownItemType<any> | null) => any;
8
11
  export declare const isFunctionWithQueryArgument: (object: any) => boolean;
12
+ export declare const clamp: (val: number, min?: number, max?: number) => number;
9
13
  type useMultiselectUtilsType<ValueType> = {
10
14
  selectedItems: NormalizedDropdownItemType<ValueType>[];
11
15
  listItems: NormalizedDropdownItemType<ValueType | string>[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@entur/dropdown",
3
- "version": "7.1.0",
3
+ "version": "7.1.1",
4
4
  "license": "EUPL-1.2",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/dropdown.esm.js",
@@ -28,13 +28,13 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@entur/a11y": "^0.2.98",
31
- "@entur/button": "^3.3.4",
32
- "@entur/chip": "^0.8.4",
33
- "@entur/form": "^8.2.4",
34
- "@entur/icons": "^7.8.0",
35
- "@entur/loader": "^0.5.21",
31
+ "@entur/button": "^3.3.5",
32
+ "@entur/chip": "^0.8.5",
33
+ "@entur/form": "^8.2.5",
34
+ "@entur/icons": "^7.9.0",
35
+ "@entur/loader": "^0.5.22",
36
36
  "@entur/tokens": "^3.19.0",
37
- "@entur/tooltip": "^5.2.4",
37
+ "@entur/tooltip": "^5.2.5",
38
38
  "@entur/utils": "^0.12.3",
39
39
  "@floating-ui/react-dom": "^2.1.0",
40
40
  "classnames": "^2.3.1",
@@ -43,5 +43,5 @@
43
43
  "devDependencies": {
44
44
  "dts-cli": "2.0.5"
45
45
  },
46
- "gitHead": "bfd8f62e4735cc13d55e50bc8747535d72aaf679"
46
+ "gitHead": "e59bee5bf5aa6ab864c96be6cf4979feab287c61"
47
47
  }