@commercetools-uikit/select-utils 12.2.7 → 13.0.2

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 (23) hide show
  1. package/dist/commercetools-uikit-select-utils.cjs.d.ts +1 -0
  2. package/dist/commercetools-uikit-select-utils.cjs.dev.js +55 -96
  3. package/dist/commercetools-uikit-select-utils.cjs.prod.js +48 -53
  4. package/dist/commercetools-uikit-select-utils.esm.js +54 -94
  5. package/dist/declarations/src/clear-indicator/clear-indicator.d.ts +13 -0
  6. package/dist/declarations/src/clear-indicator/index.d.ts +1 -0
  7. package/dist/declarations/src/clear-indicator/messages.d.ts +8 -0
  8. package/dist/declarations/src/create-select-styles.d.ts +294 -0
  9. package/dist/declarations/src/custom-styled-select-options/constants.d.ts +6 -0
  10. package/dist/declarations/src/custom-styled-select-options/custom-styled-select-options.d.ts +29 -0
  11. package/dist/declarations/src/custom-styled-select-options/index.d.ts +2 -0
  12. package/dist/declarations/src/dropdown-indicator/dropdown-indicator.d.ts +6 -0
  13. package/dist/declarations/src/dropdown-indicator/index.d.ts +1 -0
  14. package/dist/declarations/src/index.d.ts +10 -0
  15. package/dist/declarations/src/messages.d.ts +28 -0
  16. package/dist/declarations/src/search-icon-dropdown-indicator/index.d.ts +1 -0
  17. package/dist/declarations/src/search-icon-dropdown-indicator/search-icon-dropdown-indicator.d.ts +6 -0
  18. package/dist/declarations/src/tag-remove/index.d.ts +1 -0
  19. package/dist/declarations/src/tag-remove/tag-remove.d.ts +12 -0
  20. package/dist/declarations/src/version.d.ts +2 -0
  21. package/dist/declarations/src/wrapper-with-icon/index.d.ts +1 -0
  22. package/dist/declarations/src/wrapper-with-icon/wrapper-with-icon.d.ts +19 -0
  23. package/package.json +12 -12
@@ -0,0 +1,294 @@
1
+ import { ReactNode } from 'react';
2
+ import { Theme } from '@emotion/react';
3
+ declare type TProps = {
4
+ isDisabled?: boolean;
5
+ hasError?: boolean;
6
+ hasWarning?: boolean;
7
+ isReadOnly?: boolean;
8
+ showOptionGroupDivider?: boolean;
9
+ menuPortalZIndex?: number;
10
+ iconLeft?: ReactNode;
11
+ isMulti?: boolean;
12
+ hasValue?: boolean;
13
+ };
14
+ declare type TBase = {
15
+ fontColorForInput?: string;
16
+ borderColorForInput?: string;
17
+ color?: string;
18
+ backgroundColor?: string;
19
+ borderTop?: string;
20
+ borderColor?: string;
21
+ boxShadow?: string;
22
+ pointerEvents?: string;
23
+ };
24
+ declare type TState = {
25
+ isFocused?: boolean;
26
+ isDisabled?: boolean;
27
+ isSelected?: boolean;
28
+ };
29
+ export default function createSelectStyles(props: TProps, theme: Theme): {
30
+ control: (base: TBase, state: TState) => {
31
+ fontSize: "1rem";
32
+ backgroundColor: "hsl(195, 35.2941176471%, 98%)" | "#fff";
33
+ borderColor: "#00b39e" | "#ccc" | "hsl(0, 0%, 60%)" | "#f16d0e" | "#e60050";
34
+ borderRadius: "6px";
35
+ minHeight: "32px";
36
+ cursor: string;
37
+ padding: string;
38
+ transition: string;
39
+ outline: number;
40
+ boxShadow: string;
41
+ '&:focus-within': {
42
+ boxShadow: string | null;
43
+ borderColor: "#00b39e" | null;
44
+ };
45
+ '&:hover': {
46
+ borderColor: "#00b39e" | null;
47
+ };
48
+ pointerEvents: string;
49
+ color: string | undefined;
50
+ fontColorForInput?: string | undefined;
51
+ borderColorForInput?: string | undefined;
52
+ borderTop?: string | undefined;
53
+ };
54
+ menu: (base: TBase) => {
55
+ border: string;
56
+ borderRadius: "6px";
57
+ backgroundColor: "#fff";
58
+ boxShadow: "0 -1px 1.5px 0 rgba(0, 0, 0, 0.12), 0 1px 1px 0 rgba(0, 0, 0, 0.24)";
59
+ fontSize: "1rem";
60
+ fontFamily: string;
61
+ margin: string;
62
+ borderColor: string | undefined;
63
+ fontColorForInput?: string | undefined;
64
+ borderColorForInput?: string | undefined;
65
+ color?: string | undefined;
66
+ borderTop?: string | undefined;
67
+ pointerEvents?: string | undefined;
68
+ };
69
+ indicatorSeparator: (base: TBase) => {
70
+ display: string;
71
+ margin: string;
72
+ padding: string;
73
+ marginLeft: "4px";
74
+ fontColorForInput?: string | undefined;
75
+ borderColorForInput?: string | undefined;
76
+ color?: string | undefined;
77
+ backgroundColor?: string | undefined;
78
+ borderTop?: string | undefined;
79
+ borderColor?: string | undefined;
80
+ boxShadow?: string | undefined;
81
+ pointerEvents?: string | undefined;
82
+ };
83
+ dropdownIndicator: (base: TBase) => {
84
+ color: "#1a1a1a";
85
+ margin: string;
86
+ padding: string;
87
+ marginLeft: "4px";
88
+ fill: string | undefined;
89
+ fontColorForInput?: string | undefined;
90
+ borderColorForInput?: string | undefined;
91
+ backgroundColor?: string | undefined;
92
+ borderTop?: string | undefined;
93
+ borderColor?: string | undefined;
94
+ boxShadow?: string | undefined;
95
+ pointerEvents?: string | undefined;
96
+ };
97
+ clearIndicator: (base: TBase) => {
98
+ display: string;
99
+ padding: number;
100
+ fontColorForInput?: string | undefined;
101
+ borderColorForInput?: string | undefined;
102
+ color?: string | undefined;
103
+ backgroundColor?: string | undefined;
104
+ borderTop?: string | undefined;
105
+ borderColor?: string | undefined;
106
+ boxShadow?: string | undefined;
107
+ pointerEvents?: string | undefined;
108
+ };
109
+ menuList: (base: TBase) => {
110
+ padding: string;
111
+ borderRadius: "6px";
112
+ backgroundColor: "#fff";
113
+ fontColorForInput?: string | undefined;
114
+ borderColorForInput?: string | undefined;
115
+ color?: string | undefined;
116
+ borderTop?: string | undefined;
117
+ borderColor?: string | undefined;
118
+ boxShadow?: string | undefined;
119
+ pointerEvents?: string | undefined;
120
+ };
121
+ menuPortal: (base: TBase) => {
122
+ zIndex: number | undefined;
123
+ fontColorForInput?: string | undefined;
124
+ borderColorForInput?: string | undefined;
125
+ color?: string | undefined;
126
+ backgroundColor?: string | undefined;
127
+ borderTop?: string | undefined;
128
+ borderColor?: string | undefined;
129
+ boxShadow?: string | undefined;
130
+ pointerEvents?: string | undefined;
131
+ };
132
+ multiValue: (base: TBase) => {
133
+ height: "26px";
134
+ backgroundColor: "hsl(0, 0%, 95%)";
135
+ padding: string;
136
+ fontColorForInput?: string | undefined;
137
+ borderColorForInput?: string | undefined;
138
+ color?: string | undefined;
139
+ borderTop?: string | undefined;
140
+ borderColor?: string | undefined;
141
+ boxShadow?: string | undefined;
142
+ pointerEvents?: string | undefined;
143
+ };
144
+ multiValueLabel: (base: TBase) => {
145
+ fontSize: "0.9231rem";
146
+ color: string | undefined;
147
+ padding: string;
148
+ borderRadius: string;
149
+ border: string;
150
+ borderWidth: string;
151
+ '&:last-child': {
152
+ borderRadius: "2px";
153
+ borderWidth: string;
154
+ };
155
+ fontColorForInput?: string | undefined;
156
+ borderColorForInput?: string | undefined;
157
+ backgroundColor?: string | undefined;
158
+ borderTop?: string | undefined;
159
+ borderColor?: string | undefined;
160
+ boxShadow?: string | undefined;
161
+ pointerEvents?: string | undefined;
162
+ };
163
+ multiValueRemove: (base: TBase, state: TState) => {
164
+ borderColor: "hsl(0, 0%, 60%)";
165
+ padding: string;
166
+ borderRadius: string;
167
+ borderStyle: string;
168
+ borderWidth: string;
169
+ pointerEvents: string | undefined;
170
+ backgroundColor: "hsl(0, 0%, 95%)";
171
+ 'svg *': {
172
+ fill: string;
173
+ };
174
+ '&:hover, &:focus': {
175
+ borderColor: "#f16d0e";
176
+ backgroundColor: "hsl(0, 0%, 95%)";
177
+ 'svg *': {
178
+ fill: "#f16d0e";
179
+ };
180
+ };
181
+ fontColorForInput?: string | undefined;
182
+ borderColorForInput?: string | undefined;
183
+ color?: string | undefined;
184
+ borderTop?: string | undefined;
185
+ boxShadow?: string | undefined;
186
+ };
187
+ indicatorsContainer: () => {
188
+ background: string;
189
+ display: string;
190
+ alignItems: string;
191
+ };
192
+ option: (base: TBase, state: TState) => {
193
+ transition: string;
194
+ paddingLeft: "8px";
195
+ paddingRight: "8px";
196
+ color: string | undefined;
197
+ backgroundColor: string | undefined;
198
+ '&:active': {
199
+ color: string | undefined;
200
+ backgroundColor: "hsl(195, 35.2941176471%, 95%)";
201
+ };
202
+ fontColorForInput?: string | undefined;
203
+ borderColorForInput?: string | undefined;
204
+ borderTop?: string | undefined;
205
+ borderColor?: string | undefined;
206
+ boxShadow?: string | undefined;
207
+ pointerEvents?: string | undefined;
208
+ };
209
+ placeholder: (base: TBase) => {
210
+ color: "hsl(0, 0%, 60%)";
211
+ width: string;
212
+ overflow: string;
213
+ whiteSpace: string;
214
+ textOverflow: string;
215
+ fill: string | undefined;
216
+ fontColorForInput?: string | undefined;
217
+ borderColorForInput?: string | undefined;
218
+ backgroundColor?: string | undefined;
219
+ borderTop?: string | undefined;
220
+ borderColor?: string | undefined;
221
+ boxShadow?: string | undefined;
222
+ pointerEvents?: string | undefined;
223
+ };
224
+ valueContainer: (base: TBase) => {
225
+ padding: string;
226
+ backgroundColor: string;
227
+ overflow: string;
228
+ display: string;
229
+ fill: string | undefined;
230
+ fontColorForInput?: string | undefined;
231
+ borderColorForInput?: string | undefined;
232
+ color?: string | undefined;
233
+ borderTop?: string | undefined;
234
+ borderColor?: string | undefined;
235
+ boxShadow?: string | undefined;
236
+ pointerEvents?: string | undefined;
237
+ };
238
+ singleValue: (base: TBase) => {
239
+ color: "hsl(0, 0%, 60%)" | "#1a1a1a";
240
+ fontColorForInput?: string | undefined;
241
+ borderColorForInput?: string | undefined;
242
+ backgroundColor?: string | undefined;
243
+ borderTop?: string | undefined;
244
+ borderColor?: string | undefined;
245
+ boxShadow?: string | undefined;
246
+ pointerEvents?: string | undefined;
247
+ };
248
+ group: (base: TBase) => {
249
+ padding: number;
250
+ '&:not(:first-of-type)': {
251
+ borderTop: string | undefined;
252
+ };
253
+ fontColorForInput?: string | undefined;
254
+ borderColorForInput?: string | undefined;
255
+ color?: string | undefined;
256
+ backgroundColor?: string | undefined;
257
+ borderTop?: string | undefined;
258
+ borderColor?: string | undefined;
259
+ boxShadow?: string | undefined;
260
+ pointerEvents?: string | undefined;
261
+ };
262
+ groupHeading: (base: TBase) => {
263
+ color: "hsl(0, 0%, 60%)";
264
+ fontSize: "0.9231rem";
265
+ textTransform: string;
266
+ fontWeight: string;
267
+ margin: string;
268
+ padding: string;
269
+ '&:empty': {
270
+ padding: number;
271
+ };
272
+ fontColorForInput?: string | undefined;
273
+ borderColorForInput?: string | undefined;
274
+ backgroundColor?: string | undefined;
275
+ borderTop?: string | undefined;
276
+ borderColor?: string | undefined;
277
+ boxShadow?: string | undefined;
278
+ pointerEvents?: string | undefined;
279
+ };
280
+ container: (base: TBase, state: TState) => {
281
+ fontFamily: string;
282
+ minHeight: "32px";
283
+ borderRadius: "6px";
284
+ borderColor: string | undefined;
285
+ boxShadow: string | undefined;
286
+ fontColorForInput?: string | undefined;
287
+ borderColorForInput?: string | undefined;
288
+ color?: string | undefined;
289
+ backgroundColor?: string | undefined;
290
+ borderTop?: string | undefined;
291
+ pointerEvents?: string | undefined;
292
+ };
293
+ };
294
+ export {};
@@ -0,0 +1,6 @@
1
+ export declare const NO_VALUE_FALLBACK = "- - - -";
2
+ export declare const SELECT_DROPDOWN_OPTION_TYPES: {
3
+ readonly SINGLE_PROPERTY: "single-property";
4
+ readonly DOUBLE_PROPERTY: "double-property";
5
+ readonly MULTIPLE_PROPERTIES: "multiple-properties";
6
+ };
@@ -0,0 +1,29 @@
1
+ import { OptionProps } from 'react-select';
2
+ import { SELECT_DROPDOWN_OPTION_TYPES } from './constants';
3
+ declare type TData = {
4
+ label?: string;
5
+ key?: string;
6
+ id?: string;
7
+ };
8
+ declare type SelectDropdownOptionTypesKeys = keyof typeof SELECT_DROPDOWN_OPTION_TYPES;
9
+ declare type TProps = {
10
+ data?: TData;
11
+ noValueFallback?: string;
12
+ optionType?: typeof SELECT_DROPDOWN_OPTION_TYPES[SelectDropdownOptionTypesKeys];
13
+ } & OptionProps;
14
+ export declare const MultiplePropertiesSelectInputOption: {
15
+ (props: TProps): import("@emotion/react/jsx-runtime").JSX.Element;
16
+ displayName: string;
17
+ };
18
+ export declare const DoublePropertySelectInputOption: {
19
+ (props: TProps): import("@emotion/react/jsx-runtime").JSX.Element;
20
+ displayName: string;
21
+ };
22
+ declare type TCustomSelectInputOptionProps = {
23
+ optionInnerProps: TProps;
24
+ } & TProps;
25
+ export declare const CustomSelectInputOption: {
26
+ (props: TCustomSelectInputOptionProps): import("@emotion/react/jsx-runtime").JSX.Element;
27
+ displayName: string;
28
+ };
29
+ export {};
@@ -0,0 +1,2 @@
1
+ export { SELECT_DROPDOWN_OPTION_TYPES } from './constants';
2
+ export * from './custom-styled-select-options';
@@ -0,0 +1,6 @@
1
+ import { DropdownIndicatorProps } from 'react-select';
2
+ declare const DropdownIndicator: {
3
+ (props: DropdownIndicatorProps): import("@emotion/react/jsx-runtime").JSX.Element;
4
+ displayName: string;
5
+ };
6
+ export default DropdownIndicator;
@@ -0,0 +1 @@
1
+ export { default } from './dropdown-indicator';
@@ -0,0 +1,10 @@
1
+ export { default as ClearIndicator } from './clear-indicator';
2
+ export { default as TagRemove } from './tag-remove';
3
+ export { default as DropdownIndicator } from './dropdown-indicator';
4
+ export { default as SearchIconDropdownIndicator } from './search-icon-dropdown-indicator';
5
+ export { default as ValueWrapperWithIcon } from './wrapper-with-icon';
6
+ export { customComponents as customComponentsWithIcons } from './wrapper-with-icon';
7
+ export * from './custom-styled-select-options';
8
+ export { default as messages } from './messages';
9
+ export { default as createSelectStyles } from './create-select-styles';
10
+ export { default as version } from './version';
@@ -0,0 +1,28 @@
1
+ declare const _default: {
2
+ createLabel: {
3
+ id: string;
4
+ description: string;
5
+ defaultMessage: string;
6
+ };
7
+ noOptionsMessageWithInputValue: {
8
+ id: string;
9
+ description: string;
10
+ defaultMessage: string;
11
+ };
12
+ noOptionsMessageWithoutInputValue: {
13
+ id: string;
14
+ description: string;
15
+ defaultMessage: string;
16
+ };
17
+ placeholder: {
18
+ id: string;
19
+ description: string;
20
+ defaultMessage: string;
21
+ };
22
+ loadingOptions: {
23
+ id: string;
24
+ description: string;
25
+ defaultMessage: string;
26
+ };
27
+ };
28
+ export default _default;
@@ -0,0 +1 @@
1
+ export { default } from './search-icon-dropdown-indicator';
@@ -0,0 +1,6 @@
1
+ import { DropdownIndicatorProps } from 'react-select';
2
+ declare const SearchIconDropdownIndicator: {
3
+ (props: DropdownIndicatorProps): import("@emotion/react/jsx-runtime").JSX.Element;
4
+ displayName: string;
5
+ };
6
+ export default SearchIconDropdownIndicator;
@@ -0,0 +1 @@
1
+ export { default } from './tag-remove';
@@ -0,0 +1,12 @@
1
+ import type { MultiValueGenericProps } from 'react-select';
2
+ declare type TSelectProps = {
3
+ isReadOnly: boolean;
4
+ } & MultiValueGenericProps['selectProps'];
5
+ declare type TTagRemoveProps = {
6
+ selectProps: TSelectProps;
7
+ } & MultiValueGenericProps;
8
+ declare const TagRemove: {
9
+ (props: TTagRemoveProps): import("@emotion/react/jsx-runtime").JSX.Element;
10
+ displayName: string;
11
+ };
12
+ export default TagRemove;
@@ -0,0 +1,2 @@
1
+ declare const _default: "__@UI_KIT_PACKAGE/VERSION_OF_RELEASE__";
2
+ export default _default;
@@ -0,0 +1 @@
1
+ export { default, customComponents } from './wrapper-with-icon';
@@ -0,0 +1,19 @@
1
+ import { ReactElement } from 'react';
2
+ import { SingleValueProps, PlaceholderProps } from 'react-select';
3
+ export declare type TWrapperWithIconProps = {
4
+ type: string;
5
+ selectProps: TSelectProps;
6
+ } & SingleValueProps & PlaceholderProps;
7
+ declare type TSelectProps = {
8
+ iconLeft: ReactElement;
9
+ };
10
+ declare const WrapperWithIcon: {
11
+ (props: TWrapperWithIconProps): import("@emotion/react/jsx-runtime").JSX.Element;
12
+ displayName: string;
13
+ };
14
+ export default WrapperWithIcon;
15
+ declare const customComponents: {
16
+ SingleValue: (props: TWrapperWithIconProps) => import("@emotion/react/jsx-runtime").JSX.Element;
17
+ Placeholder: (props: TWrapperWithIconProps) => import("@emotion/react/jsx-runtime").JSX.Element;
18
+ };
19
+ export { customComponents };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@commercetools-uikit/select-utils",
3
3
  "description": "Utilities for working with select components.",
4
- "version": "12.2.7",
4
+ "version": "13.0.2",
5
5
  "bugs": "https://github.com/commercetools/ui-kit/issues",
6
6
  "repository": {
7
7
  "type": "git",
@@ -19,23 +19,23 @@
19
19
  "module": "dist/commercetools-uikit-select-utils.esm.js",
20
20
  "files": ["dist"],
21
21
  "dependencies": {
22
- "@babel/runtime": "7.16.3",
23
- "@babel/runtime-corejs3": "7.16.3",
24
- "@commercetools-uikit/accessible-button": "12.2.5",
25
- "@commercetools-uikit/design-system": "12.2.5",
26
- "@commercetools-uikit/icons": "12.2.7",
27
- "@commercetools-uikit/spacings": "12.2.5",
28
- "@commercetools-uikit/text": "12.2.5",
29
- "@commercetools-uikit/utils": "12.2.5",
22
+ "@babel/runtime": "7.17.2",
23
+ "@babel/runtime-corejs3": "7.17.2",
24
+ "@commercetools-uikit/accessible-button": "13.0.2",
25
+ "@commercetools-uikit/design-system": "13.0.0",
26
+ "@commercetools-uikit/icons": "13.0.2",
27
+ "@commercetools-uikit/spacings": "13.0.2",
28
+ "@commercetools-uikit/text": "13.0.2",
29
+ "@commercetools-uikit/utils": "13.0.2",
30
30
  "@emotion/react": "^11.4.0",
31
31
  "@emotion/styled": "^11.3.0",
32
32
  "lodash": "4.17.21",
33
- "prop-types": "15.7.2",
34
- "react-select": "4.3.1"
33
+ "prop-types": "15.8.1",
34
+ "react-select": "5.2.2"
35
35
  },
36
36
  "devDependencies": {
37
37
  "react": "17.0.2",
38
- "react-intl": "5.21.2"
38
+ "react-intl": "5.24.6"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "react": "17.x",