@commercetools-uikit/selectable-search-input 0.0.0-canary-20230223135944
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/LICENSE +21 -0
- package/README.md +159 -0
- package/dist/commercetools-uikit-selectable-search-input.cjs.d.ts +2 -0
- package/dist/commercetools-uikit-selectable-search-input.cjs.dev.js +638 -0
- package/dist/commercetools-uikit-selectable-search-input.cjs.js +7 -0
- package/dist/commercetools-uikit-selectable-search-input.cjs.prod.js +579 -0
- package/dist/commercetools-uikit-selectable-search-input.esm.js +613 -0
- package/dist/declarations/src/index.d.ts +2 -0
- package/dist/declarations/src/selectable-search-input.d.ts +62 -0
- package/dist/declarations/src/selectable-search-input.styles.d.ts +425 -0
- package/dist/declarations/src/selectable-select.d.ts +13 -0
- package/dist/declarations/src/version.d.ts +2 -0
- package/package.json +54 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type Props as ReactSelectProps } from 'react-select';
|
|
3
|
+
export type TCustomEvent = {
|
|
4
|
+
target: {
|
|
5
|
+
id?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
value?: string | string[] | null;
|
|
8
|
+
};
|
|
9
|
+
persist?: () => void;
|
|
10
|
+
};
|
|
11
|
+
export type TValue = {
|
|
12
|
+
text: string;
|
|
13
|
+
option: string;
|
|
14
|
+
};
|
|
15
|
+
export type TOption = {
|
|
16
|
+
value: string;
|
|
17
|
+
label?: ReactNode;
|
|
18
|
+
};
|
|
19
|
+
export type TOptionObject = {
|
|
20
|
+
options: TOption[];
|
|
21
|
+
};
|
|
22
|
+
export type TSelectableSearchInputProps = {
|
|
23
|
+
id?: string;
|
|
24
|
+
autoComplete?: string;
|
|
25
|
+
'aria-invalid'?: boolean;
|
|
26
|
+
'aria-errormessage'?: string;
|
|
27
|
+
name?: string;
|
|
28
|
+
value: TValue;
|
|
29
|
+
onChange?: (event: TCustomEvent) => void;
|
|
30
|
+
onBlur?: (event: TCustomEvent) => void;
|
|
31
|
+
onFocus?: (event: TCustomEvent) => void;
|
|
32
|
+
onSubmit: (value: TValue) => void;
|
|
33
|
+
onReset?: () => void;
|
|
34
|
+
isAutofocussed?: boolean;
|
|
35
|
+
isDisabled?: boolean;
|
|
36
|
+
isReadOnly?: boolean;
|
|
37
|
+
hasError?: boolean;
|
|
38
|
+
hasWarning?: boolean;
|
|
39
|
+
placeholder?: string;
|
|
40
|
+
isClearable?: boolean;
|
|
41
|
+
horizontalConstraint?: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 'scale' | 'auto';
|
|
42
|
+
options: TOption[] | TOptionObject[];
|
|
43
|
+
menuPortalZIndex?: number;
|
|
44
|
+
menuPortalTarget?: ReactSelectProps['menuPortalTarget'];
|
|
45
|
+
menuShouldBlockScroll?: ReactSelectProps['menuShouldBlockScroll'];
|
|
46
|
+
onMenuInputChange?: ReactSelectProps['onInputChange'];
|
|
47
|
+
noMenuOptionsMessage?: ReactSelectProps['noOptionsMessage'];
|
|
48
|
+
isMenuSearchable?: ReactSelectProps['isSearchable'];
|
|
49
|
+
maxMenuHeight?: ReactSelectProps['maxMenuHeight'];
|
|
50
|
+
closeMenuOnSelect?: ReactSelectProps['closeMenuOnSelect'];
|
|
51
|
+
menuHorizontalConstraint?: 3 | 4 | 5;
|
|
52
|
+
showSubmitButton?: boolean;
|
|
53
|
+
};
|
|
54
|
+
declare const SelectableSearchInput: {
|
|
55
|
+
(props: TSelectableSearchInputProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
56
|
+
displayName: string;
|
|
57
|
+
defaultProps: Pick<TSelectableSearchInputProps, "isClearable" | "horizontalConstraint" | "menuHorizontalConstraint" | "showSubmitButton">;
|
|
58
|
+
isEmpty(formValue: TSelectableSearchInputProps['value']): boolean;
|
|
59
|
+
getTextInputId: (name?: string) => string | undefined;
|
|
60
|
+
getDropdownId: (name?: string) => string | undefined;
|
|
61
|
+
};
|
|
62
|
+
export default SelectableSearchInput;
|
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
import { type Props as ReactSelectProps } from 'react-select';
|
|
2
|
+
type TInputProps = {
|
|
3
|
+
isDisabled?: boolean;
|
|
4
|
+
hasError?: boolean;
|
|
5
|
+
hasWarning?: boolean;
|
|
6
|
+
isReadOnly?: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare const getSelectableSearchInputStyles: (props: TInputProps) => import("@emotion/utils").SerializedStyles[];
|
|
9
|
+
declare const getClearIconButtonStyles: (props: TInputProps) => import("@emotion/utils").SerializedStyles[];
|
|
10
|
+
declare const getSearchIconButtonStyles: (props: TInputProps) => import("@emotion/utils").SerializedStyles[];
|
|
11
|
+
declare const getBackgroundColor: (props: TInputProps, defaultColor: string) => string;
|
|
12
|
+
declare const getSelectableSearchInputContainerStyles: (props: TInputProps) => import("@emotion/utils").SerializedStyles[];
|
|
13
|
+
type TBase = {
|
|
14
|
+
backgroundColor?: string;
|
|
15
|
+
color?: string;
|
|
16
|
+
};
|
|
17
|
+
type TCreateSelectableSelectStyles = {
|
|
18
|
+
isDisabled?: boolean;
|
|
19
|
+
hasError?: boolean;
|
|
20
|
+
hasWarning?: boolean;
|
|
21
|
+
isReadOnly?: boolean;
|
|
22
|
+
menuPortalZIndex?: number;
|
|
23
|
+
isNewTheme: boolean;
|
|
24
|
+
dropdownHasFocus?: boolean;
|
|
25
|
+
textInputHasFocus?: boolean;
|
|
26
|
+
};
|
|
27
|
+
declare const createSelectableSelectStyles: ({ hasWarning, hasError, isDisabled, isReadOnly, menuPortalZIndex, isNewTheme, dropdownHasFocus, textInputHasFocus, }: TCreateSelectableSelectStyles) => {
|
|
28
|
+
control: (base: TBase, state: ReactSelectProps) => {
|
|
29
|
+
padding: "var(--padding-for-selectable-search-input-dropdown, 0 var(--spacing-20))";
|
|
30
|
+
borderTopRightRadius: string;
|
|
31
|
+
borderBottomRightRadius: string;
|
|
32
|
+
borderRight: string;
|
|
33
|
+
height: string;
|
|
34
|
+
borderColor: string;
|
|
35
|
+
cursor: string;
|
|
36
|
+
backgroundColor: string;
|
|
37
|
+
'&:hover': {
|
|
38
|
+
backgroundColor: string;
|
|
39
|
+
};
|
|
40
|
+
fontSize: "var(--font-size-for-input, 1rem)";
|
|
41
|
+
borderWidth: "var(--border-width-1, 1px)" | "var(--border-width-for-select-input, 1px)";
|
|
42
|
+
borderRadius: "var(--border-radius-for-input, 6px)";
|
|
43
|
+
minHeight: "var(--height-for-input, 32px)";
|
|
44
|
+
transition: string;
|
|
45
|
+
outline: number;
|
|
46
|
+
boxShadow: string;
|
|
47
|
+
'&:focus-within': {
|
|
48
|
+
boxShadow: string | null;
|
|
49
|
+
borderColor: "var(--border-color-for-input-when-focused, #00b39e)" | null;
|
|
50
|
+
};
|
|
51
|
+
pointerEvents: string;
|
|
52
|
+
color: string | undefined;
|
|
53
|
+
fontColorForInput?: string | undefined;
|
|
54
|
+
borderColorForInput?: string | undefined;
|
|
55
|
+
borderTop?: string | undefined;
|
|
56
|
+
};
|
|
57
|
+
singleValue: (base: TBase) => {
|
|
58
|
+
marginLeft: number;
|
|
59
|
+
maxWidth: string;
|
|
60
|
+
color: "var(--font-color-for-input, #1a1a1a)" | "var(--font-color-for-input-when-disabled, hsl(0, 0%, 60%))" | "var(--font-color-for-input-when-error, #e60050)" | "var(--font-color-for-input-when-readonly, hsl(0, 0%, 60%))" | "var(--font-color-for-input-when-warning, #f16d0e)";
|
|
61
|
+
backgroundColor?: string | undefined;
|
|
62
|
+
};
|
|
63
|
+
dropdownIndicator: () => {
|
|
64
|
+
fill: "var(--font-color-for-input-when-disabled, hsl(0, 0%, 60%))" | "var(--font-color-for-select-input-icon, #1a1a1a)";
|
|
65
|
+
};
|
|
66
|
+
menu: (base: {
|
|
67
|
+
fontColorForInput?: string | undefined;
|
|
68
|
+
borderColorForInput?: string | undefined;
|
|
69
|
+
color?: string | undefined;
|
|
70
|
+
backgroundColor?: string | undefined;
|
|
71
|
+
borderTop?: string | undefined;
|
|
72
|
+
borderColor?: string | undefined;
|
|
73
|
+
boxShadow?: string | undefined;
|
|
74
|
+
pointerEvents?: string | undefined;
|
|
75
|
+
}) => {
|
|
76
|
+
border: string;
|
|
77
|
+
borderRadius: "var(--border-radius-for-input, 6px)";
|
|
78
|
+
backgroundColor: "var(--background-color-for-input, #fff)";
|
|
79
|
+
boxShadow: "var(--shadow-for-select-input-menu, 0 -1px 1.5px 0 rgba(0, 0, 0, 0.12), 0 1px 1px 0 rgba(0, 0, 0, 0.24))";
|
|
80
|
+
fontSize: "var(--font-size-for-input, 1rem)";
|
|
81
|
+
fontFamily: string;
|
|
82
|
+
margin: string;
|
|
83
|
+
borderColor: string | undefined;
|
|
84
|
+
fontColorForInput?: string | undefined;
|
|
85
|
+
borderColorForInput?: string | undefined;
|
|
86
|
+
color?: string | undefined;
|
|
87
|
+
borderTop?: string | undefined;
|
|
88
|
+
pointerEvents?: string | undefined;
|
|
89
|
+
};
|
|
90
|
+
indicatorSeparator: (base: {
|
|
91
|
+
fontColorForInput?: string | undefined;
|
|
92
|
+
borderColorForInput?: string | undefined;
|
|
93
|
+
color?: string | undefined;
|
|
94
|
+
backgroundColor?: string | undefined;
|
|
95
|
+
borderTop?: string | undefined;
|
|
96
|
+
borderColor?: string | undefined;
|
|
97
|
+
boxShadow?: string | undefined;
|
|
98
|
+
pointerEvents?: string | undefined;
|
|
99
|
+
}) => {
|
|
100
|
+
display: string;
|
|
101
|
+
margin: string;
|
|
102
|
+
padding: string;
|
|
103
|
+
marginLeft: "var(--spacing-10, 4px)";
|
|
104
|
+
fontColorForInput?: string | undefined;
|
|
105
|
+
borderColorForInput?: string | undefined;
|
|
106
|
+
color?: string | undefined;
|
|
107
|
+
backgroundColor?: string | undefined;
|
|
108
|
+
borderTop?: string | undefined;
|
|
109
|
+
borderColor?: string | undefined;
|
|
110
|
+
boxShadow?: string | undefined;
|
|
111
|
+
pointerEvents?: string | undefined;
|
|
112
|
+
};
|
|
113
|
+
clearIndicator: (base: {
|
|
114
|
+
fontColorForInput?: string | undefined;
|
|
115
|
+
borderColorForInput?: string | undefined;
|
|
116
|
+
color?: string | undefined;
|
|
117
|
+
backgroundColor?: string | undefined;
|
|
118
|
+
borderTop?: string | undefined;
|
|
119
|
+
borderColor?: string | undefined;
|
|
120
|
+
boxShadow?: string | undefined;
|
|
121
|
+
pointerEvents?: string | undefined;
|
|
122
|
+
}) => {
|
|
123
|
+
display: string;
|
|
124
|
+
padding: number;
|
|
125
|
+
marginLeft: "var(--margin-for-select-input-icon, 4px)";
|
|
126
|
+
fontColorForInput?: string | undefined;
|
|
127
|
+
borderColorForInput?: string | undefined;
|
|
128
|
+
color?: string | undefined;
|
|
129
|
+
backgroundColor?: string | undefined;
|
|
130
|
+
borderTop?: string | undefined;
|
|
131
|
+
borderColor?: string | undefined;
|
|
132
|
+
boxShadow?: string | undefined;
|
|
133
|
+
pointerEvents?: string | undefined;
|
|
134
|
+
};
|
|
135
|
+
menuList: (base: {
|
|
136
|
+
fontColorForInput?: string | undefined;
|
|
137
|
+
borderColorForInput?: string | undefined;
|
|
138
|
+
color?: string | undefined;
|
|
139
|
+
backgroundColor?: string | undefined;
|
|
140
|
+
borderTop?: string | undefined;
|
|
141
|
+
borderColor?: string | undefined;
|
|
142
|
+
boxShadow?: string | undefined;
|
|
143
|
+
pointerEvents?: string | undefined;
|
|
144
|
+
}) => {
|
|
145
|
+
padding: "var(--padding-for-select-input-menu, inherit)";
|
|
146
|
+
borderRadius: "var(--border-radius-for-input, 6px)";
|
|
147
|
+
backgroundColor: "var(--background-color-for-input, #fff)";
|
|
148
|
+
fontColorForInput?: string | undefined;
|
|
149
|
+
borderColorForInput?: string | undefined;
|
|
150
|
+
color?: string | undefined;
|
|
151
|
+
borderTop?: string | undefined;
|
|
152
|
+
borderColor?: string | undefined;
|
|
153
|
+
boxShadow?: string | undefined;
|
|
154
|
+
pointerEvents?: string | undefined;
|
|
155
|
+
};
|
|
156
|
+
menuPortal: (base: {
|
|
157
|
+
fontColorForInput?: string | undefined;
|
|
158
|
+
borderColorForInput?: string | undefined;
|
|
159
|
+
color?: string | undefined;
|
|
160
|
+
backgroundColor?: string | undefined;
|
|
161
|
+
borderTop?: string | undefined;
|
|
162
|
+
borderColor?: string | undefined;
|
|
163
|
+
boxShadow?: string | undefined;
|
|
164
|
+
pointerEvents?: string | undefined;
|
|
165
|
+
}) => {
|
|
166
|
+
zIndex: number | undefined;
|
|
167
|
+
fontColorForInput?: string | undefined;
|
|
168
|
+
borderColorForInput?: string | undefined;
|
|
169
|
+
color?: string | undefined;
|
|
170
|
+
backgroundColor?: string | undefined;
|
|
171
|
+
borderTop?: string | undefined;
|
|
172
|
+
borderColor?: string | undefined;
|
|
173
|
+
boxShadow?: string | undefined;
|
|
174
|
+
pointerEvents?: string | undefined;
|
|
175
|
+
};
|
|
176
|
+
multiValue: (base: {
|
|
177
|
+
fontColorForInput?: string | undefined;
|
|
178
|
+
borderColorForInput?: string | undefined;
|
|
179
|
+
color?: string | undefined;
|
|
180
|
+
backgroundColor?: string | undefined;
|
|
181
|
+
borderTop?: string | undefined;
|
|
182
|
+
borderColor?: string | undefined;
|
|
183
|
+
boxShadow?: string | undefined;
|
|
184
|
+
pointerEvents?: string | undefined;
|
|
185
|
+
}) => {
|
|
186
|
+
display: string;
|
|
187
|
+
alignItems: "var(--align-items-for-select-input-tag, unset)";
|
|
188
|
+
height: "var(--height-for-select-input-tag, 26px)";
|
|
189
|
+
backgroundColor: "var(--background-color-for-tag, hsl(0, 0%, 95%))";
|
|
190
|
+
padding: string;
|
|
191
|
+
border: "var(--border-for-select-input-tag, none)";
|
|
192
|
+
fontColorForInput?: string | undefined;
|
|
193
|
+
borderColorForInput?: string | undefined;
|
|
194
|
+
color?: string | undefined;
|
|
195
|
+
borderTop?: string | undefined;
|
|
196
|
+
borderColor?: string | undefined;
|
|
197
|
+
boxShadow?: string | undefined;
|
|
198
|
+
pointerEvents?: string | undefined;
|
|
199
|
+
};
|
|
200
|
+
multiValueLabel: (base: {
|
|
201
|
+
fontColorForInput?: string | undefined;
|
|
202
|
+
borderColorForInput?: string | undefined;
|
|
203
|
+
color?: string | undefined;
|
|
204
|
+
backgroundColor?: string | undefined;
|
|
205
|
+
borderTop?: string | undefined;
|
|
206
|
+
borderColor?: string | undefined;
|
|
207
|
+
boxShadow?: string | undefined;
|
|
208
|
+
pointerEvents?: string | undefined;
|
|
209
|
+
}) => {
|
|
210
|
+
fontSize: "var(--font-size-for-select-input-tag, 0.9231rem)";
|
|
211
|
+
color: string | undefined;
|
|
212
|
+
padding: string;
|
|
213
|
+
borderRadius: string;
|
|
214
|
+
border: string;
|
|
215
|
+
borderWidth: string;
|
|
216
|
+
'&:last-child': {
|
|
217
|
+
borderRadius: "var(--border-radius-for-tag, 2px)";
|
|
218
|
+
borderWidth: "var(--border-width-1, 1px)";
|
|
219
|
+
};
|
|
220
|
+
fontColorForInput?: string | undefined;
|
|
221
|
+
borderColorForInput?: string | undefined;
|
|
222
|
+
backgroundColor?: string | undefined;
|
|
223
|
+
borderTop?: string | undefined;
|
|
224
|
+
borderColor?: string | undefined;
|
|
225
|
+
boxShadow?: string | undefined;
|
|
226
|
+
pointerEvents?: string | undefined;
|
|
227
|
+
};
|
|
228
|
+
multiValueRemove: (base: {
|
|
229
|
+
fontColorForInput?: string | undefined;
|
|
230
|
+
borderColorForInput?: string | undefined;
|
|
231
|
+
color?: string | undefined;
|
|
232
|
+
backgroundColor?: string | undefined;
|
|
233
|
+
borderTop?: string | undefined;
|
|
234
|
+
borderColor?: string | undefined;
|
|
235
|
+
boxShadow?: string | undefined;
|
|
236
|
+
pointerEvents?: string | undefined;
|
|
237
|
+
}, state: {
|
|
238
|
+
isFocused?: boolean | undefined;
|
|
239
|
+
isDisabled?: boolean | undefined;
|
|
240
|
+
isSelected?: boolean | undefined;
|
|
241
|
+
}) => {
|
|
242
|
+
borderColor: "var(--border-color-for-tag, hsl(0, 0%, 60%))";
|
|
243
|
+
padding: string;
|
|
244
|
+
borderRadius: string;
|
|
245
|
+
borderStyle: string;
|
|
246
|
+
borderWidth: string;
|
|
247
|
+
pointerEvents: string | undefined;
|
|
248
|
+
backgroundColor: "var(--background-color-for-tag, hsl(0, 0%, 95%))";
|
|
249
|
+
'svg *': {
|
|
250
|
+
fill: string;
|
|
251
|
+
};
|
|
252
|
+
'&:hover, &:focus': {
|
|
253
|
+
borderColor: "var(--border-color-for-tag-warning, #f16d0e)";
|
|
254
|
+
backgroundColor: "var(--background-color-for-tag, hsl(0, 0%, 95%))";
|
|
255
|
+
'svg *': {
|
|
256
|
+
fill: "var(--font-color-for-clear-input-icon-when-hovered, #f16d0e)";
|
|
257
|
+
};
|
|
258
|
+
};
|
|
259
|
+
fontColorForInput?: string | undefined;
|
|
260
|
+
borderColorForInput?: string | undefined;
|
|
261
|
+
color?: string | undefined;
|
|
262
|
+
borderTop?: string | undefined;
|
|
263
|
+
boxShadow?: string | undefined;
|
|
264
|
+
};
|
|
265
|
+
indicatorsContainer: () => {
|
|
266
|
+
background: string;
|
|
267
|
+
display: string;
|
|
268
|
+
alignItems: string;
|
|
269
|
+
};
|
|
270
|
+
option: (base: {
|
|
271
|
+
fontColorForInput?: string | undefined;
|
|
272
|
+
borderColorForInput?: string | undefined;
|
|
273
|
+
color?: string | undefined;
|
|
274
|
+
backgroundColor?: string | undefined;
|
|
275
|
+
borderTop?: string | undefined;
|
|
276
|
+
borderColor?: string | undefined;
|
|
277
|
+
boxShadow?: string | undefined;
|
|
278
|
+
pointerEvents?: string | undefined;
|
|
279
|
+
}, state: {
|
|
280
|
+
isFocused?: boolean | undefined;
|
|
281
|
+
isDisabled?: boolean | undefined;
|
|
282
|
+
isSelected?: boolean | undefined;
|
|
283
|
+
}) => {
|
|
284
|
+
transition: string;
|
|
285
|
+
paddingLeft: "var(--padding-left-for-select-input-options, 8px)";
|
|
286
|
+
paddingRight: "var(--padding-right-for-select-input-options, 8px)";
|
|
287
|
+
paddingTop: "var(--padding-top-for-select-input-options, 4px)";
|
|
288
|
+
paddingBottom: "var(--padding-bottom-for-select-input-options, 4px)";
|
|
289
|
+
color: string | undefined;
|
|
290
|
+
backgroundColor: string | undefined;
|
|
291
|
+
'&:active': {
|
|
292
|
+
color: string | undefined;
|
|
293
|
+
backgroundColor: "var(--background-color-for-input-when-active, hsl(195, 35.2941176471%, 95%))";
|
|
294
|
+
};
|
|
295
|
+
fontColorForInput?: string | undefined;
|
|
296
|
+
borderColorForInput?: string | undefined;
|
|
297
|
+
borderTop?: string | undefined;
|
|
298
|
+
borderColor?: string | undefined;
|
|
299
|
+
boxShadow?: string | undefined;
|
|
300
|
+
pointerEvents?: string | undefined;
|
|
301
|
+
};
|
|
302
|
+
placeholder: (base: {
|
|
303
|
+
fontColorForInput?: string | undefined;
|
|
304
|
+
borderColorForInput?: string | undefined;
|
|
305
|
+
color?: string | undefined;
|
|
306
|
+
backgroundColor?: string | undefined;
|
|
307
|
+
borderTop?: string | undefined;
|
|
308
|
+
borderColor?: string | undefined;
|
|
309
|
+
boxShadow?: string | undefined;
|
|
310
|
+
pointerEvents?: string | undefined;
|
|
311
|
+
}) => {
|
|
312
|
+
color: "var(--placeholder-font-color-for-input, hsl(0, 0%, 60%))";
|
|
313
|
+
width: string;
|
|
314
|
+
overflow: string;
|
|
315
|
+
whiteSpace: string;
|
|
316
|
+
textOverflow: string;
|
|
317
|
+
fill: string | undefined;
|
|
318
|
+
fontColorForInput?: string | undefined;
|
|
319
|
+
borderColorForInput?: string | undefined;
|
|
320
|
+
backgroundColor?: string | undefined;
|
|
321
|
+
borderTop?: string | undefined;
|
|
322
|
+
borderColor?: string | undefined;
|
|
323
|
+
boxShadow?: string | undefined;
|
|
324
|
+
pointerEvents?: string | undefined;
|
|
325
|
+
};
|
|
326
|
+
valueContainer: (base: {
|
|
327
|
+
fontColorForInput?: string | undefined;
|
|
328
|
+
borderColorForInput?: string | undefined;
|
|
329
|
+
color?: string | undefined;
|
|
330
|
+
backgroundColor?: string | undefined;
|
|
331
|
+
borderTop?: string | undefined;
|
|
332
|
+
borderColor?: string | undefined;
|
|
333
|
+
boxShadow?: string | undefined;
|
|
334
|
+
pointerEvents?: string | undefined;
|
|
335
|
+
}) => {
|
|
336
|
+
padding: string;
|
|
337
|
+
backgroundColor: string;
|
|
338
|
+
overflow: string;
|
|
339
|
+
display: string;
|
|
340
|
+
fill: "var(--font-color-for-input-when-disabled, hsl(0, 0%, 60%))" | "var(--font-color-for-select-input-icon, #1a1a1a)";
|
|
341
|
+
fontColorForInput?: string | undefined;
|
|
342
|
+
borderColorForInput?: string | undefined;
|
|
343
|
+
color?: string | undefined;
|
|
344
|
+
borderTop?: string | undefined;
|
|
345
|
+
borderColor?: string | undefined;
|
|
346
|
+
boxShadow?: string | undefined;
|
|
347
|
+
pointerEvents?: string | undefined;
|
|
348
|
+
};
|
|
349
|
+
group: (base: {
|
|
350
|
+
fontColorForInput?: string | undefined;
|
|
351
|
+
borderColorForInput?: string | undefined;
|
|
352
|
+
color?: string | undefined;
|
|
353
|
+
backgroundColor?: string | undefined;
|
|
354
|
+
borderTop?: string | undefined;
|
|
355
|
+
borderColor?: string | undefined;
|
|
356
|
+
boxShadow?: string | undefined;
|
|
357
|
+
pointerEvents?: string | undefined;
|
|
358
|
+
}) => {
|
|
359
|
+
padding: number;
|
|
360
|
+
'&:not(:first-of-type)': {
|
|
361
|
+
borderTop: string | undefined;
|
|
362
|
+
};
|
|
363
|
+
fontColorForInput?: string | undefined;
|
|
364
|
+
borderColorForInput?: string | undefined;
|
|
365
|
+
color?: string | undefined;
|
|
366
|
+
backgroundColor?: string | undefined;
|
|
367
|
+
borderTop?: string | undefined;
|
|
368
|
+
borderColor?: string | undefined;
|
|
369
|
+
boxShadow?: string | undefined;
|
|
370
|
+
pointerEvents?: string | undefined;
|
|
371
|
+
};
|
|
372
|
+
groupHeading: (base: {
|
|
373
|
+
fontColorForInput?: string | undefined;
|
|
374
|
+
borderColorForInput?: string | undefined;
|
|
375
|
+
color?: string | undefined;
|
|
376
|
+
backgroundColor?: string | undefined;
|
|
377
|
+
borderTop?: string | undefined;
|
|
378
|
+
borderColor?: string | undefined;
|
|
379
|
+
boxShadow?: string | undefined;
|
|
380
|
+
pointerEvents?: string | undefined;
|
|
381
|
+
}) => {
|
|
382
|
+
color: "var(--font-color-for-input-when-readonly, hsl(0, 0%, 60%))";
|
|
383
|
+
fontSize: "var(--font-size-small, 0.9231rem)";
|
|
384
|
+
textTransform: string;
|
|
385
|
+
fontWeight: string;
|
|
386
|
+
padding: string;
|
|
387
|
+
'&:empty': {
|
|
388
|
+
padding: number;
|
|
389
|
+
};
|
|
390
|
+
fontColorForInput?: string | undefined;
|
|
391
|
+
borderColorForInput?: string | undefined;
|
|
392
|
+
backgroundColor?: string | undefined;
|
|
393
|
+
borderTop?: string | undefined;
|
|
394
|
+
borderColor?: string | undefined;
|
|
395
|
+
boxShadow?: string | undefined;
|
|
396
|
+
pointerEvents?: string | undefined;
|
|
397
|
+
};
|
|
398
|
+
container: (base: {
|
|
399
|
+
fontColorForInput?: string | undefined;
|
|
400
|
+
borderColorForInput?: string | undefined;
|
|
401
|
+
color?: string | undefined;
|
|
402
|
+
backgroundColor?: string | undefined;
|
|
403
|
+
borderTop?: string | undefined;
|
|
404
|
+
borderColor?: string | undefined;
|
|
405
|
+
boxShadow?: string | undefined;
|
|
406
|
+
pointerEvents?: string | undefined;
|
|
407
|
+
}, state: {
|
|
408
|
+
isFocused?: boolean | undefined;
|
|
409
|
+
isDisabled?: boolean | undefined;
|
|
410
|
+
isSelected?: boolean | undefined;
|
|
411
|
+
}) => {
|
|
412
|
+
fontFamily: string;
|
|
413
|
+
minHeight: "var(--size-height-input, 32px)";
|
|
414
|
+
borderRadius: "var(--border-radius-for-input, 6px)";
|
|
415
|
+
borderColor: string | undefined;
|
|
416
|
+
boxShadow: string | undefined;
|
|
417
|
+
fontColorForInput?: string | undefined;
|
|
418
|
+
borderColorForInput?: string | undefined;
|
|
419
|
+
color?: string | undefined;
|
|
420
|
+
backgroundColor?: string | undefined;
|
|
421
|
+
borderTop?: string | undefined;
|
|
422
|
+
pointerEvents?: string | undefined;
|
|
423
|
+
};
|
|
424
|
+
};
|
|
425
|
+
export { getSelectableSearchInputStyles, getSelectableSearchInputContainerStyles, getClearIconButtonStyles, getSearchIconButtonStyles, getBackgroundColor, createSelectableSelectStyles, };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { TSelectableSearchInputProps, TOption } from './selectable-search-input';
|
|
3
|
+
type TSelectableSelect = {
|
|
4
|
+
textInputHasFocus: boolean;
|
|
5
|
+
dropdownHasFocus: boolean;
|
|
6
|
+
isNewTheme: boolean;
|
|
7
|
+
handleDropdownFocus: () => void;
|
|
8
|
+
handleDropdownBlur: () => void;
|
|
9
|
+
textInputRef: React.RefObject<HTMLInputElement>;
|
|
10
|
+
selectedOption: TOption;
|
|
11
|
+
} & TSelectableSearchInputProps;
|
|
12
|
+
declare const SelectableSelect: (props: TSelectableSelect) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
13
|
+
export default SelectableSelect;
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@commercetools-uikit/selectable-search-input",
|
|
3
|
+
"description": "A controlled selectable search input component for single-line strings with validation states.",
|
|
4
|
+
"version": "0.0.0-canary-20230223135944",
|
|
5
|
+
"bugs": "https://github.com/commercetools/ui-kit/issues",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/commercetools/ui-kit.git",
|
|
9
|
+
"directory": "packages/components/inputs/selectable-search-input"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://uikit.commercetools.com",
|
|
12
|
+
"keywords": [
|
|
13
|
+
"javascript",
|
|
14
|
+
"typescript",
|
|
15
|
+
"design-system",
|
|
16
|
+
"react",
|
|
17
|
+
"uikit"
|
|
18
|
+
],
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public"
|
|
22
|
+
},
|
|
23
|
+
"sideEffects": false,
|
|
24
|
+
"main": "dist/commercetools-uikit-selectable-search-input.cjs.js",
|
|
25
|
+
"module": "dist/commercetools-uikit-selectable-search-input.esm.js",
|
|
26
|
+
"files": [
|
|
27
|
+
"dist"
|
|
28
|
+
],
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@babel/runtime": "^7.20.13",
|
|
31
|
+
"@babel/runtime-corejs3": "^7.20.13",
|
|
32
|
+
"@commercetools-uikit/constraints": "0.0.0-canary-20230223135944",
|
|
33
|
+
"@commercetools-uikit/design-system": "0.0.0-canary-20230223135944",
|
|
34
|
+
"@commercetools-uikit/hooks": "0.0.0-canary-20230223135944",
|
|
35
|
+
"@commercetools-uikit/icons": "0.0.0-canary-20230223135944",
|
|
36
|
+
"@commercetools-uikit/input-utils": "0.0.0-canary-20230223135944",
|
|
37
|
+
"@commercetools-uikit/secondary-icon-button": "0.0.0-canary-20230223135944",
|
|
38
|
+
"@commercetools-uikit/select-utils": "0.0.0-canary-20230223135944",
|
|
39
|
+
"@commercetools-uikit/utils": "0.0.0-canary-20230223135944",
|
|
40
|
+
"@emotion/react": "^11.10.5",
|
|
41
|
+
"@emotion/styled": "^11.10.5",
|
|
42
|
+
"lodash": "4.17.21",
|
|
43
|
+
"prop-types": "15.8.1",
|
|
44
|
+
"react-select": "5.7.0"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"react": "17.0.2",
|
|
48
|
+
"react-intl": "^5.25.1"
|
|
49
|
+
},
|
|
50
|
+
"peerDependencies": {
|
|
51
|
+
"react": "17.x",
|
|
52
|
+
"react-intl": "5.x"
|
|
53
|
+
}
|
|
54
|
+
}
|