@ntbjs/react-components 2.0.2-rc.9 → 2.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.
@@ -1,221 +1,236 @@
1
- import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
1
  import React__default, { useState, useEffect, useMemo } from 'react';
3
2
  import PropTypes from 'prop-types';
4
3
  import { nanoid } from 'nanoid';
5
4
  import { components } from 'react-select';
6
- import { MultiSelectWrapper, Label, InnerWrapper, AsyncCreatableMultiSelect, AsyncMultiSelect, CreatableMultiSelect, MultiSelect as MultiSelect$1, ShowMoreWrapper, ShowMoreOverlay, ShowMoreText, ErrorMessage, MultiValue, InputWrapper, DropdownMenu, SelectedOption, DropdownOptionDeleteIcon, Option } from './MultiSelect.styled.js';
7
- import { ReactComponent as SvgClose } from '../../icons/close.svg.js';
5
+ import { colors } from '../../styles/utils/colors-export.js';
6
+ import { AsyncCreatableMultiSelect, AsyncMultiSelect, CreatableMultiSelect, MultiSelect as MultiSelect$1, MultiSelectWrapper, Label, InnerWrapper, ShowMoreWrapper, ShowMoreOverlay, ShowMoreText, ErrorMessage, DropdownOptionDeleteIcon, MultiValueWrapper } from './MultiSelect.styled.js';
8
7
 
9
- const reactSelectTheme = theme => ({
10
- ...theme,
11
- spacing: {
12
- baseUnit: 4,
13
- controlHeight: 38,
14
- menuGutter: 8
15
- }
16
- });
17
- const MultiSelect = React__default.forwardRef(function MultiSelect({
18
- label,
19
- selectedOptions = [],
20
- availableOptions,
21
- loadOptions,
22
- loadingMessageFunc,
23
- onUpdateCallback,
24
- editText,
25
- creatable,
26
- readOnly,
27
- hidden,
28
- disabled,
29
- error,
30
- warning,
31
- onMultiValueClick,
32
- showMore,
33
- showMoreText = 'Show more',
34
- displayTotalOnShowMore = true,
35
- noOptionsMessageFunc,
36
- ...props
37
- }, forwardedRef) {
8
+ const showMoreHeight = 114;
9
+ const MultiSelect = React__default.forwardRef((props, forwardedRef) => {
10
+ const {
11
+ label,
12
+ selectedOptions = [],
13
+ availableOptions,
14
+ loadOptions,
15
+ onUpdateCallback,
16
+ editText,
17
+ creatable,
18
+ readOnly,
19
+ disabled,
20
+ error,
21
+ warning,
22
+ onMultiValueClick,
23
+ showMore,
24
+ showMoreText = 'Show more',
25
+ displayTotalOnShowMore = true,
26
+ hidden,
27
+ ...rest
28
+ } = props;
38
29
  const [uniqueId] = useState(nanoid());
39
30
  const [selected, setSelected] = useState(selectedOptions);
40
- const [focused, setFocused] = useState(false);
41
- const [displayShowMore, setDisplayShowMore] = useState(error || warning ? false : showMore);
42
31
  const [cacheUnique, setCacheUnique] = useState(0);
43
- const [controlledMenuIsOpen, setControlledMenuIsOpen] = useState(undefined);
44
- const [isMenuOpen, setIsMenuOpen] = useState(false);
45
- const wrapperRef = React__default.useRef(null);
46
- useEffect(() => {
47
- setSelected(selectedOptions);
48
- }, [selectedOptions]);
32
+ const [displayShowMore, setDisplayShowMore] = useState(showMore && !error && !warning);
33
+ const [focused, setFocused] = useState(false);
34
+ const [isDarkMode, setIsDarkMode] = useState(() => document.body.classList.contains('dark-theme'));
35
+ useEffect(() => setSelected(selectedOptions), [selectedOptions]);
49
36
  useEffect(() => {
50
- function handleClick(event) {
51
- if (wrapperRef.current) {
52
- const isClickInside = wrapperRef.current.contains(event.target);
53
- if (!isClickInside) {
54
- setControlledMenuIsOpen(false);
55
- setIsMenuOpen(false);
56
- } else {
57
- const isRemoveButton = event.target.closest('.multi-select__multi-value__remove') || event.target.closest('[role="button"]') || event.target instanceof SVGElement || event.target.closest('svg');
58
- if (!isRemoveButton && !readOnly && !disabled) {
59
- setControlledMenuIsOpen(true);
60
- setIsMenuOpen(true);
61
- }
37
+ const observer = new MutationObserver(() => {
38
+ setIsDarkMode(document.body.classList.contains('dark-theme'));
39
+ });
40
+ observer.observe(document.body, {
41
+ attributes: true,
42
+ attributeFilter: ['class']
43
+ });
44
+ return () => observer.disconnect();
45
+ }, []);
46
+ const selectStyles = useMemo(() => {
47
+ const getThemeColor = (darkKey, lightKey) => {
48
+ const prefersDark = !document.body.classList.contains('light-theme') && !document.body.classList.contains('dark-theme') && window.matchMedia('(prefers-color-scheme: dark)').matches;
49
+ const key = isDarkMode || prefersDark ? darkKey : lightKey;
50
+ return colors[key] || colors['gray-500'];
51
+ };
52
+ const errorColor = colors['red-500'];
53
+ const warningColor = colors['orange-500'];
54
+ const menuBg = getThemeColor('gray-600', 'white');
55
+ const textColor = getThemeColor('gray-100', 'gray-900');
56
+ const placeholderColor = getThemeColor('gray-400', 'gray-500');
57
+ const multiValueBg = getThemeColor('gray-600', 'gray-800');
58
+ return {
59
+ control: base => ({
60
+ ...base,
61
+ alignItems: 'center',
62
+ background: 'transparent',
63
+ border: error ? `1px solid ${errorColor}` : warning ? `1px solid ${warningColor}` : 'none',
64
+ borderRadius: '3px',
65
+ boxShadow: 'none',
66
+ minHeight: '38px',
67
+ opacity: disabled ? 0.5 : 1,
68
+ pointerEvents: 'auto',
69
+ '&:hover': {
70
+ border: error ? `1px solid ${errorColor}` : warning ? `1px solid ${warningColor}` : 'none'
62
71
  }
63
- }
64
- }
65
- document.addEventListener('mousedown', handleClick);
66
- return () => {
67
- document.removeEventListener('mousedown', handleClick);
72
+ }),
73
+ valueContainer: base => ({
74
+ ...base,
75
+ alignItems: 'center',
76
+ gap: '8px',
77
+ padding: '0 8px',
78
+ maxHeight: displayShowMore ? error || warning ? '100%' : `${showMoreHeight + 16}px` : '100%',
79
+ overflow: 'hidden'
80
+ }),
81
+ multiValue: base => ({
82
+ ...base,
83
+ backgroundColor: multiValueBg,
84
+ borderRadius: '3px',
85
+ margin: '0',
86
+ display: 'flex',
87
+ alignItems: 'stretch',
88
+ minHeight: '26px',
89
+ overflow: 'hidden',
90
+ opacity: disabled ? 0.7 : 1
91
+ }),
92
+ multiValueLabel: base => ({
93
+ ...base,
94
+ color: colors['white'],
95
+ fontSize: '12px',
96
+ padding: disabled || readOnly ? '0 8px' : '0 3px 0 8px',
97
+ display: 'flex',
98
+ alignItems: 'center',
99
+ cursor: disabled ? 'not-allowed' : readOnly ? 'default' : 'pointer'
100
+ }),
101
+ multiValueRemove: base => ({
102
+ ...base,
103
+ color: 'white',
104
+ padding: '0 8px 0 5px',
105
+ display: disabled || readOnly ? 'none' : 'flex',
106
+ alignItems: 'center',
107
+ alignSelf: 'stretch',
108
+ borderRadius: '0',
109
+ cursor: 'pointer',
110
+ '&:hover': {
111
+ backgroundColor: errorColor,
112
+ color: 'white'
113
+ }
114
+ }),
115
+ menu: base => ({
116
+ ...base,
117
+ backgroundColor: menuBg,
118
+ boxShadow: '0 4px 12px rgba(0,0,0,0.5)',
119
+ zIndex: 999,
120
+ marginTop: '4px',
121
+ border: `1px solid ${getThemeColor('gray-500', 'gray-300')}`
122
+ }),
123
+ menuList: base => ({
124
+ ...base,
125
+ backgroundColor: 'transparent',
126
+ padding: 0
127
+ }),
128
+ option: (base, state) => ({
129
+ ...base,
130
+ backgroundColor: state.isFocused ? getThemeColor('gray-500', 'gray-100') : 'transparent',
131
+ color: textColor,
132
+ cursor: 'pointer',
133
+ fontSize: '14px',
134
+ padding: '8px 12px',
135
+ ':active': {
136
+ backgroundColor: getThemeColor('gray-400', 'gray-200')
137
+ }
138
+ }),
139
+ input: (base, state) => ({
140
+ ...base,
141
+ display: 'inline-grid',
142
+ whiteSpace: 'nowrap',
143
+ color: textColor,
144
+ margin: 0,
145
+ padding: 0,
146
+ ':before': !focused && editText && !state.value ? {
147
+ content: `"${editText}"`,
148
+ color: placeholderColor,
149
+ marginRight: '8px',
150
+ lineHeight: '26px',
151
+ gridArea: '1 / 1'
152
+ } : {}
153
+ }),
154
+ noOptionsMessage: base => ({
155
+ ...base,
156
+ color: textColor,
157
+ backgroundColor: 'transparent'
158
+ }),
159
+ loadingMessage: base => ({
160
+ ...base,
161
+ color: textColor,
162
+ backgroundColor: 'transparent'
163
+ }),
164
+ placeholder: () => ({
165
+ display: 'none'
166
+ }),
167
+ indicatorsContainer: () => ({
168
+ display: 'none'
169
+ })
68
170
  };
69
- }, [readOnly, disabled]);
70
- const getNoOptionsMessage = inputValue => {
71
- if (typeof noOptionsMessageFunc === 'function') {
72
- return noOptionsMessageFunc(inputValue);
73
- }
74
- return inputValue ? `No matches for "${inputValue}"` : 'No available options';
75
- };
171
+ }, [error, warning, displayShowMore, disabled, readOnly, editText, focused, isDarkMode, onMultiValueClick]);
76
172
  const innerComponents = {
77
- DropdownIndicator: null,
78
- MultiValue: ({
79
- data,
80
- ...props
81
- }) => {
82
- return React__default.createElement("div", {
83
- className: "multi-value-wrapper",
84
- onMouseDown: e => {
85
- if (onMultiValueClick && data && !(e.target.role === 'button' || e.target instanceof SVGElement)) {
86
- e.stopPropagation();
87
- onMultiValueClick(data);
88
- }
173
+ Option: optProps => React__default.createElement(components.Option, optProps, React__default.createElement("div", {
174
+ style: {
175
+ display: 'flex',
176
+ justifyContent: 'space-between',
177
+ width: '100%',
178
+ alignItems: 'center'
179
+ }
180
+ }, React__default.createElement("span", null, optProps.label), optProps.isSelected && React__default.createElement(DropdownOptionDeleteIcon, null))),
181
+ MultiValue: mvProps => React__default.createElement(MultiValueWrapper, {
182
+ onMouseDown: e => {
183
+ if (onMultiValueClick && !readOnly && !disabled && !e.target.closest('.multi-select__multi-value__remove')) {
184
+ e.stopPropagation();
185
+ onMultiValueClick(mvProps.data);
89
186
  }
90
- }, React__default.createElement(MultiValue, _extends({
91
- data: data,
92
- $isDisabled: disabled,
93
- $isReadOnly: readOnly
94
- }, props)));
95
- },
96
- MultiValueRemove: props => {
97
- if (readOnly || disabled) return null;
98
- return React__default.createElement(components.MultiValueRemove, props, React__default.createElement(SvgClose, null));
99
- },
100
- Input: inputProps => React__default.createElement(InputWrapper, {
101
- $focused: focused,
102
- $editText: !readOnly && !disabled ? editText : '',
103
- $isDisabled: readOnly || disabled,
104
- $isMenuOpen: isMenuOpen
105
- }, React__default.createElement(components.Input, inputProps)),
106
- Menu: menuProps => React__default.createElement(DropdownMenu, menuProps),
107
- Option: optProps => optProps.isSelected ? React__default.createElement(SelectedOption, optProps, React__default.createElement("span", null, optProps.label), React__default.createElement(DropdownOptionDeleteIcon, null)) : React__default.createElement(Option, optProps)
187
+ }
188
+ }, React__default.createElement(components.MultiValue, mvProps))
108
189
  };
109
- const selectStyles = useMemo(() => ({
110
- control: base => ({
111
- ...base,
112
- alignItems: 'flex-start',
113
- background: 'transparent',
114
- border: 'none',
115
- boxShadow: 'none',
116
- minHeight: 'unset'
117
- }),
118
- valueContainer: base => ({
119
- ...base,
120
- padding: 0,
121
- gap: '8px',
122
- maxHeight: displayShowMore && !(error || warning) ? '130px' : '100%'
123
- }),
124
- menu: base => ({
125
- ...base,
126
- backgroundColor: 'transparent',
127
- boxShadow: 'none'
128
- }),
129
- menuList: base => ({
130
- ...base,
131
- backgroundColor: 'transparent'
132
- }),
133
- option: base => ({
134
- ...base,
135
- backgroundColor: 'transparent',
136
- color: 'inherit'
137
- }),
138
- multiValue: base => ({
139
- ...base,
140
- margin: 0,
141
- border: 'none',
142
- background: 'none'
143
- }),
144
- multiValueLabel: base => ({
145
- ...base,
146
- padding: 0
147
- }),
148
- multiValueRemove: base => ({
149
- ...base,
150
- padding: 0,
151
- cursor: 'pointer'
152
- })
153
- }), [error, warning, displayShowMore]);
154
- const sharedProps = {
155
- ...props,
190
+ const sharedSelectProps = {
191
+ ...rest,
156
192
  ref: forwardedRef,
193
+ id: uniqueId,
157
194
  classNamePrefix: 'multi-select',
195
+ styles: selectStyles,
196
+ components: innerComponents,
158
197
  value: selected,
159
198
  options: loadOptions ? undefined : availableOptions,
160
199
  loadOptions,
161
- loadingMessage: loadingMessageFunc,
162
- theme: reactSelectTheme,
163
- styles: selectStyles,
164
- components: innerComponents,
165
200
  isMulti: true,
166
- isClearable: false,
167
- placeholder: null,
168
- isDisabled: disabled,
169
- readOnly: readOnly,
201
+ isDisabled: disabled || readOnly,
170
202
  closeMenuOnSelect: false,
171
203
  hideSelectedOptions: false,
172
- openMenuOnClick: false,
173
- openMenuOnFocus: false,
174
- blurInputOnSelect: false,
175
- menuIsOpen: controlledMenuIsOpen,
176
- cacheUniqs: loadOptions ? [cacheUnique] : undefined,
177
- onMenuOpen: () => {
178
- setIsMenuOpen(true);
179
- setControlledMenuIsOpen(true);
180
- },
181
- onMenuClose: () => {
182
- setIsMenuOpen(false);
183
- setControlledMenuIsOpen(false);
184
- },
204
+ openMenuOnClick: true,
185
205
  onFocus: () => setFocused(true),
186
206
  onBlur: () => setFocused(false),
187
- noOptionsMessage: ({
188
- inputValue
189
- }) => getNoOptionsMessage(inputValue),
190
- onChange: (selectedOptions, actionMeta) => {
191
- if (props.onChange) {
192
- props.onChange(selectedOptions, actionMeta);
193
- }
207
+ onChange: (newValue, actionMeta) => {
208
+ setSelected(newValue);
194
209
  if (onUpdateCallback) {
195
- const updatedItem = actionMeta.option || actionMeta.removedValue;
196
- onUpdateCallback(actionMeta.action, updatedItem);
210
+ const item = actionMeta.option || actionMeta.removedValue;
211
+ onUpdateCallback(actionMeta.action, item);
197
212
  }
198
- setSelected(selectedOptions);
199
213
  if (actionMeta.action === 'create-option' && loadOptions) {
200
- setCacheUnique(cacheUnique + 1);
214
+ setCacheUnique(c => c + 1);
201
215
  }
202
- }
216
+ },
217
+ cacheUniqs: loadOptions ? [cacheUnique] : undefined
203
218
  };
219
+ const SelectComponent = useMemo(() => {
220
+ if (loadOptions) return creatable ? AsyncCreatableMultiSelect : AsyncMultiSelect;
221
+ return creatable ? CreatableMultiSelect : MultiSelect$1;
222
+ }, [loadOptions, creatable]);
204
223
  if (hidden) return null;
205
- return React__default.createElement(MultiSelectWrapper, {
206
- ref: wrapperRef
207
- }, label && React__default.createElement(Label, {
224
+ return React__default.createElement(MultiSelectWrapper, null, label && React__default.createElement(Label, {
208
225
  htmlFor: uniqueId
209
- }, label), React__default.createElement(InnerWrapper, {
210
- $error: error,
211
- $warning: warning
212
- }, loadOptions ? creatable ? React__default.createElement(AsyncCreatableMultiSelect, sharedProps) : React__default.createElement(AsyncMultiSelect, sharedProps) : creatable ? React__default.createElement(CreatableMultiSelect, sharedProps) : React__default.createElement(MultiSelect$1, sharedProps)), displayShowMore && !(error || warning) && React__default.createElement(ShowMoreWrapper, {
226
+ }, label), React__default.createElement(InnerWrapper, null, React__default.createElement(SelectComponent, sharedSelectProps)), displayShowMore && React__default.createElement(ShowMoreWrapper, {
213
227
  onClick: () => setDisplayShowMore(false)
214
- }, React__default.createElement(ShowMoreOverlay, null), React__default.createElement(ShowMoreText, null, showMoreText, " ", displayTotalOnShowMore && `(${selected.length})`)), (typeof error === 'string' || typeof warning === 'string') && React__default.createElement(ErrorMessage, {
215
- $error: error,
216
- $warning: warning
217
- }, error ? error : warning));
228
+ }, React__default.createElement(ShowMoreOverlay, null), React__default.createElement(ShowMoreText, null, showMoreText, " ", displayTotalOnShowMore && `(${selected.length})`)), (error || warning) && React__default.createElement(ErrorMessage, {
229
+ $error: !!error,
230
+ $warning: !!warning
231
+ }, error || warning));
218
232
  });
233
+ MultiSelect.displayName = 'MultiSelect';
219
234
  MultiSelect.propTypes = process.env.NODE_ENV !== "production" ? {
220
235
  label: PropTypes.string,
221
236
  availableOptions: PropTypes.arrayOf(PropTypes.object),
@@ -235,8 +250,7 @@ MultiSelect.propTypes = process.env.NODE_ENV !== "production" ? {
235
250
  hidden: PropTypes.bool,
236
251
  disabled: PropTypes.bool,
237
252
  error: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
238
- warning: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
239
- onChange: PropTypes.func
253
+ warning: PropTypes.oneOfType([PropTypes.bool, PropTypes.string])
240
254
  } : {};
241
255
  MultiSelect.defaultProps = {
242
256
  noOptionsMessageFunc: inputValue => {
@@ -1 +1 @@
1
- {"version":3,"file":"MultiSelect.js","sources":["../../../src/components/inputs/MultiSelect/MultiSelect.js"],"sourcesContent":["import React, { useState, useMemo, useEffect } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { nanoid } from 'nanoid';\nimport { components } from 'react-select';\nimport * as S from './MultiSelect.styled';\nimport { ReactComponent as CloseIcon } from '../../../icons/close.svg';\n\n/**\n * Multi-select with autocomplete and support for asynchronous fetching/filtering of\n * available options with pagination, update handling with callback,\n * and the ability for the end-user to create new options.\n *\n * The component uses [react-select](https://react-select.com/) for the main select functionality,\n * with [react-select-async-paginate](https://www.npmjs.com/package/react-select-async-paginate) for pagination.\n *\n *\n * <br />### Import\n *\n * ``` js\n * import { MultiSelect } from '@ntbjs/react-components/inputs'\n * // or\n * import MultiSelect from '@ntbjs/react-components/inputs/MultiSelect'\n * ```\n *\n * <br />## Option `object` format\n * Options are represented by an `Array` of `objects` with the following format:\n *\n * ``` js\n * {\n * value: \"Example\",\n * label: \"Example\"\n * }\n * ```\n *\n * The `label` is what will visible to the end-user. Whether `value` and `label`\n * should be different will depend on your use-case, but they are not required to.\n *\n *\n * <br />## Update handling\n * Changes from the end-user to the selected/available options can be handled with a callback function\n * passed through the `onUpdateCallback` prop, which is triggered any time the selected values change.\n *\n * The callback function will be passed two arguments:\n * * `action: string`\n * * `updatedOption: object`\n *\n * <br />#### `action`\n * A `string` indicating what kind of update was made.\n *\n * The possible values of `action` are:\n * * `create-option`: an option that didn't exist in the original list of available options were added\n * * `select-option`: an option was selected\n * * `deselect-option`: an option was de-selected by clicking the X in the dropdown menu\n * * `remove-value`: an option was de-selected by clicking the X on the option label/box\n * * `pop-value`: an option was de-selected with backspace\n * * `clear`: all options were de-selected by clicking the clear indicator (not currently in use)\n *\n * <br />#### `updatedOption`\n * Option `object`of the updated option:\n *\n * In addition to the default `value` and `label` keys, an `__isNew__` flag will be present if the option was\n * not part of the original list of available options, i.e. created by the user in the current \"session\".\n * This is the case regardless of whether the list is provided through `availableOptions` or\n * asynchronously through `loadOptions`.\n *\n *\n * <br />## Asynchronous fetching/filtering with pagination\n * The list of available options can be fetched and filtered asynchronously with a `Promise`\n * passed through the `loadOptions` prop.\n *\n * It will be passed two arguments:\n *\n * * `inputValue: string`: current input value/search\n * * `prevOptions: Array`: previously loaded options for the current search\n *\n * The function is triggered and the first page is fetched when the dropdown menu opens.\n * Whenever the user scrolls down to the bottom of the list, `loadOptions` will\n * be triggered again to fetch the next page.\n *\n * The `Promise` should return an `object` with the following keys:\n *\n * ``` js\n * {\n * options: Array,\n * hasMore: boolean\n * }\n * ```\n *\n * `options` should contain the current page of options. It will be concatenated to the previous\n * set of options automatically. The `hasMore` flag indicates whether there is another page to be fetched.\n *\n * **Example:**\n *\n * ``` js\n *\n * const availableOptions = [\n * { value: \"Example 1\", label: \"Example 1\" },\n * ...\n * { value: \"Example N\", label: \"Example N\" }\n * ];\n *\n * const filterOptions = inputValue => {\n * return availableOptions.filter(option => {\n * return option.label.toLowerCase().includes(inputValue.toLowerCase());\n * });\n * };\n *\n * const loadOptionsFunc = (inputValue, prevOptions) => {\n * const currentLength = prevOptions.length;\n * const pageLength = 10;\n *\n * let filteredOptions;\n *\n * if (inputValue) {\n * filteredOptions = filterOptions(inputValue);\n * } else {\n * filteredOptions = availableOptions;\n * }\n *\n * const hasMore = filteredOptions.length > currentLength + pageLength;\n * const slicedOptions = filteredOptions.slice(currentLength, currentLength + pageLength);\n *\n * return {\n * options: slicedOptions,\n * hasMore\n * };\n * };\n *\n * const loadOptions = (inputValue, prevOptions) => {\n * return new Promise(resolve => {\n * resolve(loadOptionsFunc(inputValue, prevOptions));\n * });\n * };\n * ```\n *\n * While waiting for the `Promise` to resolve, the component will be in a loading state.\n * The loading state is showcased in the \"Primary With Fetching Timeout\" Story.\n *\n * <br />#### Without asynchronous fetching/filtering\n * If you wish to not use asynchronous fetching/filtering, leave the `loadOptions` prop undefined\n * and pass the `Array` of all available options to the `availableOptions` prop instead.\n * The component will use the built-in filtering on `label` from `react-select`, and the options\n * will not be paginated.\n *\n *\n * <br />## \"Show more\" overlay\n * The \"Show more\" overlay must be set manually with the `showMore` prop.\n *\n * By default, the total number\n * of selected options will be displayed in parenthesis after the \"Show more\" text. This can be\n * disabled with the `displayTotalOnShowMore` prop.\n *\n * **Note:**\n * <br />The component has been given a max-width in these Stories.\n * This is because the \"Show more\" overlay does not work well visually when there are\n * fewer than three rows of selected options. The component itself does not have\n * a max-width, so keep this in mind when using it.\n *\n * <br />\n */\n\nconst reactSelectTheme = theme => ({\n ...theme,\n spacing: {\n baseUnit: 4,\n controlHeight: 38,\n menuGutter: 8\n }\n});\n\nconst MultiSelect = React.forwardRef(function MultiSelect(\n {\n label,\n selectedOptions = [],\n availableOptions,\n loadOptions,\n loadingMessageFunc,\n onUpdateCallback,\n editText,\n creatable,\n readOnly,\n hidden,\n disabled,\n error,\n warning,\n onMultiValueClick,\n showMore,\n showMoreText = 'Show more',\n displayTotalOnShowMore = true,\n noOptionsMessageFunc,\n ...props\n },\n forwardedRef\n) {\n const [uniqueId] = useState(nanoid());\n const [selected, setSelected] = useState(selectedOptions);\n const [focused, setFocused] = useState(false);\n const [displayShowMore, setDisplayShowMore] = useState(error || warning ? false : showMore);\n const [cacheUnique, setCacheUnique] = useState(0);\n const [controlledMenuIsOpen, setControlledMenuIsOpen] = useState(undefined);\n const [isMenuOpen, setIsMenuOpen] = useState(false);\n const wrapperRef = React.useRef(null);\n\n useEffect(() => {\n setSelected(selectedOptions);\n }, [selectedOptions]);\n\n // Handle clicks inside and outside the component\n useEffect(() => {\n function handleClick(event) {\n if (wrapperRef.current) {\n const isClickInside = wrapperRef.current.contains(event.target);\n\n if (!isClickInside) {\n // Clicked outside - close menu by setting to false\n setControlledMenuIsOpen(false);\n setIsMenuOpen(false);\n } else {\n // Clicked inside - check if it's NOT a remove button\n const isRemoveButton =\n event.target.closest('.multi-select__multi-value__remove') ||\n event.target.closest('[role=\"button\"]') ||\n event.target instanceof SVGElement ||\n event.target.closest('svg');\n\n if (!isRemoveButton && !readOnly && !disabled) {\n // Clicked on input area or multi-value labels - open the menu immediately\n setControlledMenuIsOpen(true);\n setIsMenuOpen(true);\n }\n }\n }\n }\n\n // Use mousedown to catch events before react-select processes them\n document.addEventListener('mousedown', handleClick);\n return () => {\n document.removeEventListener('mousedown', handleClick);\n };\n }, [readOnly, disabled]);\n\n const getNoOptionsMessage = inputValue => {\n if (typeof noOptionsMessageFunc === 'function') {\n return noOptionsMessageFunc(inputValue);\n }\n return inputValue ? `No matches for \"${inputValue}\"` : 'No available options';\n };\n\n const innerComponents = {\n DropdownIndicator: null,\n /* eslint-disable react/prop-types */\n MultiValue: ({ data, ...props }) => {\n return (\n <div\n className=\"multi-value-wrapper\"\n onMouseDown={e => {\n if (\n onMultiValueClick &&\n data &&\n !(e.target.role === 'button' || e.target instanceof SVGElement)\n ) {\n e.stopPropagation();\n onMultiValueClick(data);\n }\n }}\n >\n <S.MultiValue data={data} $isDisabled={disabled} $isReadOnly={readOnly} {...props} />\n </div>\n );\n },\n /* eslint-enable react/prop-types */\n MultiValueRemove: props => {\n if (readOnly || disabled) return null;\n return (\n <components.MultiValueRemove {...props}>\n <CloseIcon />\n </components.MultiValueRemove>\n );\n },\n Input: inputProps => (\n <S.InputWrapper\n $focused={focused}\n $editText={!readOnly && !disabled ? editText : ''}\n $isDisabled={readOnly || disabled}\n $isMenuOpen={isMenuOpen}\n >\n <components.Input {...inputProps} />\n </S.InputWrapper>\n ),\n Menu: menuProps => <S.DropdownMenu {...menuProps} />,\n Option: optProps =>\n optProps.isSelected ? (\n <S.SelectedOption {...optProps}>\n <span>{optProps.label}</span>\n <S.DropdownOptionDeleteIcon />\n </S.SelectedOption>\n ) : (\n <S.Option {...optProps} />\n )\n };\n\n const selectStyles = useMemo(\n () => ({\n control: base => ({\n ...base,\n alignItems: 'flex-start',\n background: 'transparent',\n border: 'none',\n boxShadow: 'none',\n minHeight: 'unset'\n }),\n valueContainer: base => ({\n ...base,\n padding: 0,\n gap: '8px',\n maxHeight: displayShowMore && !(error || warning) ? '130px' : '100%'\n }),\n menu: base => ({\n ...base,\n backgroundColor: 'transparent',\n boxShadow: 'none'\n }),\n menuList: base => ({\n ...base,\n backgroundColor: 'transparent'\n }),\n option: base => ({\n ...base,\n backgroundColor: 'transparent',\n color: 'inherit'\n }),\n multiValue: base => ({ ...base, margin: 0, border: 'none', background: 'none' }),\n multiValueLabel: base => ({ ...base, padding: 0 }),\n multiValueRemove: base => ({ ...base, padding: 0, cursor: 'pointer' })\n }),\n [error, warning, displayShowMore]\n );\n\n const sharedProps = {\n ...props,\n ref: forwardedRef,\n classNamePrefix: 'multi-select',\n value: selected,\n options: loadOptions ? undefined : availableOptions,\n loadOptions,\n loadingMessage: loadingMessageFunc,\n theme: reactSelectTheme,\n styles: selectStyles,\n components: innerComponents,\n isMulti: true,\n isClearable: false,\n placeholder: null,\n isDisabled: disabled,\n readOnly: readOnly,\n closeMenuOnSelect: false,\n hideSelectedOptions: false,\n openMenuOnClick: false,\n openMenuOnFocus: false,\n blurInputOnSelect: false,\n menuIsOpen: controlledMenuIsOpen,\n cacheUniqs: loadOptions ? [cacheUnique] : undefined,\n onMenuOpen: () => {\n setIsMenuOpen(true);\n setControlledMenuIsOpen(true);\n },\n onMenuClose: () => {\n setIsMenuOpen(false);\n setControlledMenuIsOpen(false);\n },\n onFocus: () => setFocused(true),\n onBlur: () => setFocused(false),\n noOptionsMessage: ({ inputValue }) => getNoOptionsMessage(inputValue),\n onChange: (selectedOptions, actionMeta) => {\n if (props.onChange) {\n props.onChange(selectedOptions, actionMeta);\n }\n\n if (onUpdateCallback) {\n const updatedItem = actionMeta.option || actionMeta.removedValue;\n onUpdateCallback(actionMeta.action, updatedItem);\n }\n\n setSelected(selectedOptions);\n\n if (actionMeta.action === 'create-option' && loadOptions) {\n setCacheUnique(cacheUnique + 1);\n }\n }\n };\n\n if (hidden) return null;\n\n return (\n <S.MultiSelectWrapper ref={wrapperRef}>\n {label && <S.Label htmlFor={uniqueId}>{label}</S.Label>}\n <S.InnerWrapper $error={error} $warning={warning}>\n {loadOptions ? (\n creatable ? (\n <S.AsyncCreatableMultiSelect {...sharedProps} />\n ) : (\n <S.AsyncMultiSelect {...sharedProps} />\n )\n ) : creatable ? (\n <S.CreatableMultiSelect {...sharedProps} />\n ) : (\n <S.MultiSelect {...sharedProps} />\n )}\n </S.InnerWrapper>\n {displayShowMore && !(error || warning) && (\n <S.ShowMoreWrapper onClick={() => setDisplayShowMore(false)}>\n <S.ShowMoreOverlay />\n <S.ShowMoreText>\n {showMoreText} {displayTotalOnShowMore && `(${selected.length})`}\n </S.ShowMoreText>\n </S.ShowMoreWrapper>\n )}\n {(typeof error === 'string' || typeof warning === 'string') && (\n <S.ErrorMessage $error={error} $warning={warning}>\n {error ? error : warning}\n </S.ErrorMessage>\n )}\n </S.MultiSelectWrapper>\n );\n});\n\nMultiSelect.propTypes = {\n /**\n *\n * The label of the input field — leave `undefined` to hide the label\n */\n label: PropTypes.string,\n /**\n * `Array` of `objects` containing the default options. This is only needed\n * when asynchronous option fetching with the `loadOptions` prop is not used.\n *\n * **Note:**\n * <br />This will be overridden by the `loadOptions` prop if both props are set.\n */\n availableOptions: PropTypes.arrayOf(PropTypes.object),\n\n /**\n * `Array` of `objects` containing the selected options.\n */\n selectedOptions: PropTypes.arrayOf(PropTypes.object),\n\n /**\n * Function with a `Promise` returning filtered options.\n *\n * See [Asynchronous fetching/filtering with pagination](#asynchronous-fetchingfiltering-with-pagination)\n * for details.\n *\n * **Note:**\n * <br />This will override the `availableOptions` prop if both props are set.\n */\n loadOptions: PropTypes.func,\n\n /**\n * Function for custom \"Loading...\" message while waiting for the first page\n * from `loadOptions` to resolve. Defaults to \"Loading...\" if no function is provided.\n */\n loadingMessageFunc: PropTypes.func,\n\n /**\n * Callback function for sending updates to the backend whenever the selected values are updated.\n * See [Update handling](#update-handling) for details.\n */\n onUpdateCallback: PropTypes.func,\n\n /**\n * Text to be displayed on the input element when the component\n * is enabled and not focused — e.g. \"Add a keyword...\"\n */\n editText: PropTypes.string.isRequired,\n\n /**\n * Whether the user can create new options.\n */\n creatable: PropTypes.bool,\n\n /**\n * Callback function for formatting the message displayed in the dropdown when there\n * are no matching options, and the user has permission to create new options.\n * The callback function will be given the current input value as an argument.\n */\n createNewOptionMessageFunc: PropTypes.func,\n\n /**\n * If the list of options is empty, or if the current input value doesn't match\n * any of the available options and the user doesn't have permission to add options,\n * this function will be called and passed the current input value as an argument.\n */\n noOptionsMessageFunc: PropTypes.func,\n\n /**\n * Optional callback function to be trigger when clicking a selected option's label — e.g. opening\n * a search filtered on the given multi-value's `label`.\n *\n * The callback function will be passed the option `object` as an argument.\n */\n onMultiValueClick: PropTypes.func,\n\n /**\n * Display an overlay which the user needs to click in order to\n * show the selected options list in its entirety and edit it.\n */\n showMore: PropTypes.bool,\n\n /**\n * Text displayed on the \"Show more\" overlay.\n */\n showMoreText: PropTypes.string,\n\n /**\n * Whether to display the total number of selected options after the show more text.\n */\n displayTotalOnShowMore: PropTypes.bool,\n\n /**\n * Whether the multi-select should be displayed in read-only mode.\n * The user can still click the selected options to trigger their on-click effect.\n */\n readOnly: PropTypes.bool,\n /**\n * Whether the component is hidden or visible.\n */\n hidden: PropTypes.bool,\n\n /**\n * Whether the multi-select should be disabled.\n * The user will not be able to trigger the on-click effect of the selected options.\n */\n disabled: PropTypes.bool,\n\n /**\n * Set to `true` to display a red border indicating an error.\n * Pass in a `string` instead to also show the string underneath the input field.\n *\n * **Note:**\n * <br />This overrides the \"Show more\" overlay. Errors will be prioritized over warnings.\n */\n error: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),\n\n /**\n * Set to `true` to display an orange border.\n * Pass in a `string` instead to also show the string underneath the input field.\n *\n * **Note:**\n * <br />This overrides the \"Show more\" overlay. Errors will be prioritized over warnings.\n */\n warning: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),\n\n /**\n * Optional onChange handler that receives the selected options and action metadata.\n */\n onChange: PropTypes.func\n};\n\nMultiSelect.defaultProps = {\n noOptionsMessageFunc: inputValue => {\n if (inputValue) {\n return `No matches for \"${inputValue}\"`;\n } else {\n return 'No available options';\n }\n },\n showMore: false,\n displayTotalOnShowMore: true,\n readOnly: false,\n disabled: false,\n creatable: false,\n error: false,\n warning: false,\n showMoreText: 'Show more',\n hidden: false\n};\n\nexport default MultiSelect;\n"],"names":["reactSelectTheme","theme","spacing","baseUnit","controlHeight","menuGutter","MultiSelect","React","forwardRef","label","selectedOptions","availableOptions","loadOptions","loadingMessageFunc","onUpdateCallback","editText","creatable","readOnly","hidden","disabled","error","warning","onMultiValueClick","showMore","showMoreText","displayTotalOnShowMore","noOptionsMessageFunc","props","forwardedRef","uniqueId","useState","nanoid","selected","setSelected","focused","setFocused","displayShowMore","setDisplayShowMore","cacheUnique","setCacheUnique","controlledMenuIsOpen","setControlledMenuIsOpen","undefined","isMenuOpen","setIsMenuOpen","wrapperRef","useRef","useEffect","handleClick","event","current","isClickInside","contains","target","isRemoveButton","closest","SVGElement","document","addEventListener","removeEventListener","getNoOptionsMessage","inputValue","innerComponents","DropdownIndicator","MultiValue","data","createElement","className","onMouseDown","e","role","stopPropagation","S","_extends","$isDisabled","$isReadOnly","MultiValueRemove","components","CloseIcon","Input","inputProps","$focused","$editText","$isMenuOpen","Menu","menuProps","Option","optProps","isSelected","selectStyles","useMemo","control","base","alignItems","background","border","boxShadow","minHeight","valueContainer","padding","gap","maxHeight","menu","backgroundColor","menuList","option","color","multiValue","margin","multiValueLabel","multiValueRemove","cursor","sharedProps","ref","classNamePrefix","value","options","loadingMessage","styles","isMulti","isClearable","placeholder","isDisabled","closeMenuOnSelect","hideSelectedOptions","openMenuOnClick","openMenuOnFocus","blurInputOnSelect","menuIsOpen","cacheUniqs","onMenuOpen","onMenuClose","onFocus","onBlur","noOptionsMessage","onChange","actionMeta","updatedItem","removedValue","action","htmlFor","$error","$warning","onClick","length","propTypes","process","env","NODE_ENV","PropTypes","string","arrayOf","object","func","isRequired","bool","createNewOptionMessageFunc","oneOfType","defaultProps"],"mappings":";;;;;;;;AAkKA,MAAMA,gBAAgB,GAAGC,KAAK,KAAK;AACjC,EAAA,GAAGA,KAAK;AACRC,EAAAA,OAAO,EAAE;AACPC,IAAAA,QAAQ,EAAE,CAAC;A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I,SAAS,CAACM,IAAI;EAIxBzI,MAAM,EAAEmI,SAAS,CAACM,IAAI;EAMtBxI,QAAQ,EAAEkI,SAAS,CAACM,IAAI;AASxBvI,EAAAA,KAAK,EAAEiI,SAAS,CAACQ,SAAS,CAAC,CAACR,SAAS,CAACM,IAAI,EAAEN,SAAS,CAACC,MAAM,CAAC,CAAC;AAS9DjI,EAAAA,OAAO,EAAEgI,SAAS,CAACQ,SAAS,CAAC,CAACR,SAAS,CAACM,IAAI,EAAEN,SAAS,CAACC,MAAM,CAAC,CAAC;EAKhEf,QAAQ,EAAEc,SAAS,CAACI,IAAAA;AACtB,CAAC,GAAA,EAAA,CAAA;AAEDnJ,WAAW,CAACwJ,YAAY,GAAG;EACzBpI,oBAAoB,EAAEmC,UAAU,IAAI;AAClC,IAAA,IAAIA,UAAU,EAAE;MACd,OAAO,CAAA,gBAAA,EAAmBA,UAAU,CAAG,CAAA,CAAA,CAAA;AACzC,KAAC,MAAM;AACL,MAAA,OAAO,sBAAsB,CAAA;AAC/B,KAAA;GACD;AACDtC,EAAAA,QAAQ,EAAE,KAAK;AACfE,EAAAA,sBAAsB,EAAE,IAAI;AAC5BR,EAAAA,QAAQ,EAAE,KAAK;AACfE,EAAAA,QAAQ,EAAE,KAAK;AACfH,EAAAA,SAAS,EAAE,KAAK;AAChBI,EAAAA,KAAK,EAAE,KAAK;AACZC,EAAAA,OAAO,EAAE,KAAK;AACdG,EAAAA,YAAY,EAAE,WAAW;AACzBN,EAAAA,MAAM,EAAE,KAAA;AACV,CAAC;;;;"}
1
+ {"version":3,"file":"MultiSelect.js","sources":["../../../src/components/inputs/MultiSelect/MultiSelect.js"],"sourcesContent":["import React, { useState, useEffect, useMemo } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { nanoid } from 'nanoid';\nimport { components } from 'react-select';\nimport { colors } from '../../../styles/utils/colors-export';\nimport * as S from './MultiSelect.styled';\n\n/**\n * Multi-select with autocomplete and support for asynchronous fetching/filtering of\n * available options with pagination, update handling with callback,\n * and the ability for the end-user to create new options.\n *\n * The component uses [react-select](https://react-select.com/) for the main select functionality,\n * with [react-select-async-paginate](https://www.npmjs.com/package/react-select-async-paginate) for pagination.\n *\n *\n * <br />### Import\n *\n * ``` js\n * import { MultiSelect } from '@ntbjs/react-components/inputs'\n * // or\n * import MultiSelect from '@ntbjs/react-components/inputs/MultiSelect'\n * ```\n *\n * <br />## Option `object` format\n * Options are represented by an `Array` of `objects` with the following format:\n *\n * ``` js\n * {\n * value: \"Example\",\n * label: \"Example\"\n * }\n * ```\n *\n * The `label` is what will visible to the end-user. Whether `value` and `label`\n * should be different will depend on your use-case, but they are not required to.\n *\n *\n * <br />## Update handling\n * Changes from the end-user to the selected/available options can be handled with a callback function\n * passed through the `onUpdateCallback` prop, which is triggered any time the selected values change.\n *\n * The callback function will be passed two arguments:\n * * `action: string`\n * * `updatedOption: object`\n *\n * <br />#### `action`\n * A `string` indicating what kind of update was made.\n *\n * The possible values of `action` are:\n * * `create-option`: an option that didn't exist in the original list of available options were added\n * * `select-option`: an option was selected\n * * `deselect-option`: an option was de-selected by clicking the X in the dropdown menu\n * * `remove-value`: an option was de-selected by clicking the X on the option label/box\n * * `pop-value`: an option was de-selected with backspace\n * * `clear`: all options were de-selected by clicking the clear indicator (not currently in use)\n *\n * <br />#### `updatedOption`\n * Option `object`of the updated option:\n *\n * In addition to the default `value` and `label` keys, an `__isNew__` flag will be present if the option was\n * not part of the original list of available options, i.e. created by the user in the current \"session\".\n * This is the case regardless of whether the list is provided through `availableOptions` or\n * asynchronously through `loadOptions`.\n *\n *\n * <br />## Asynchronous fetching/filtering with pagination\n * The list of available options can be fetched and filtered asynchronously with a `Promise`\n * passed through the `loadOptions` prop.\n *\n * It will be passed two arguments:\n *\n * * `inputValue: string`: current input value/search\n * * `prevOptions: Array`: previously loaded options for the current search\n *\n * The function is triggered and the first page is fetched when the dropdown menu opens.\n * Whenever the user scrolls down to the bottom of the list, `loadOptions` will\n * be triggered again to fetch the next page.\n *\n * The `Promise` should return an `object` with the following keys:\n *\n * ``` js\n * {\n * options: Array,\n * hasMore: boolean\n * }\n * ```\n *\n * `options` should contain the current page of options. It will be concatenated to the previous\n * set of options automatically. The `hasMore` flag indicates whether there is another page to be fetched.\n *\n * **Example:**\n *\n * ``` js\n *\n * const availableOptions = [\n * { value: \"Example 1\", label: \"Example 1\" },\n * ...\n * { value: \"Example N\", label: \"Example N\" }\n * ];\n *\n * const filterOptions = inputValue => {\n * return availableOptions.filter(option => {\n * return option.label.toLowerCase().includes(inputValue.toLowerCase());\n * });\n * };\n *\n * const loadOptionsFunc = (inputValue, prevOptions) => {\n * const currentLength = prevOptions.length;\n * const pageLength = 10;\n *\n * let filteredOptions;\n *\n * if (inputValue) {\n * filteredOptions = filterOptions(inputValue);\n * } else {\n * filteredOptions = availableOptions;\n * }\n *\n * const hasMore = filteredOptions.length > currentLength + pageLength;\n * const slicedOptions = filteredOptions.slice(currentLength, currentLength + pageLength);\n *\n * return {\n * options: slicedOptions,\n * hasMore\n * };\n * };\n *\n * const loadOptions = (inputValue, prevOptions) => {\n * return new Promise(resolve => {\n * resolve(loadOptionsFunc(inputValue, prevOptions));\n * });\n * };\n * ```\n *\n * While waiting for the `Promise` to resolve, the component will be in a loading state.\n * The loading state is showcased in the \"Primary With Fetching Timeout\" Story.\n *\n * <br />#### Without asynchronous fetching/filtering\n * If you wish to not use asynchronous fetching/filtering, leave the `loadOptions` prop undefined\n * and pass the `Array` of all available options to the `availableOptions` prop instead.\n * The component will use the built-in filtering on `label` from `react-select`, and the options\n * will not be paginated.\n *\n *\n * <br />## \"Show more\" overlay\n * The \"Show more\" overlay must be set manually with the `showMore` prop.\n *\n * By default, the total number\n * of selected options will be displayed in parenthesis after the \"Show more\" text. This can be\n * disabled with the `displayTotalOnShowMore` prop.\n *\n * **Note:**\n * <br />The component has been given a max-width in these Stories.\n * This is because the \"Show more\" overlay does not work well visually when there are\n * fewer than three rows of selected options. The component itself does not have\n * a max-width, so keep this in mind when using it.\n *\n * <br />\n */\n\nconst showMoreHeight = 114;\n\nconst MultiSelect = React.forwardRef((props, forwardedRef) => {\n const {\n label,\n selectedOptions = [],\n availableOptions,\n loadOptions,\n onUpdateCallback,\n editText,\n creatable,\n readOnly,\n disabled,\n error,\n warning,\n onMultiValueClick,\n showMore,\n showMoreText = 'Show more',\n displayTotalOnShowMore = true,\n hidden,\n ...rest\n } = props;\n\n const [uniqueId] = useState(nanoid());\n const [selected, setSelected] = useState(selectedOptions);\n const [cacheUnique, setCacheUnique] = useState(0);\n const [displayShowMore, setDisplayShowMore] = useState(showMore && !error && !warning);\n const [focused, setFocused] = useState(false);\n\n // Track theme changes by checking the DOM\n const [isDarkMode, setIsDarkMode] = useState(() =>\n document.body.classList.contains('dark-theme')\n );\n\n useEffect(() => setSelected(selectedOptions), [selectedOptions]);\n\n useEffect(() => {\n const observer = new MutationObserver(() => {\n setIsDarkMode(document.body.classList.contains('dark-theme'));\n });\n\n observer.observe(document.body, {\n attributes: true,\n attributeFilter: ['class']\n });\n\n return () => observer.disconnect();\n }, []);\n\n /**\n * Custom styles for react-select components using the Styles API.\n *\n * Note: We use inline styles via the `styles` prop instead of styled-components\n * because styled-components clash with the latest react-select version.\n * See: https://react-select.com/styles\n *\n * Theme handling:\n * - Colors are imported from colors-export.js (single source of truth)\n * - Theme detection uses MutationObserver to watch body class changes\n * - Supports both explicit themes (dark-theme/light-theme classes) and\n * system preference (prefers-color-scheme media query)\n *\n * The getThemeColor helper function returns actual hex color values based on\n * the current theme mode (dark/light), ensuring proper theme switching without\n * requiring a styled-components ThemeProvider context.\n */\n\n const selectStyles = useMemo(() => {\n const getThemeColor = (darkKey, lightKey) => {\n const prefersDark =\n !document.body.classList.contains('light-theme') &&\n !document.body.classList.contains('dark-theme') &&\n window.matchMedia('(prefers-color-scheme: dark)').matches;\n\n const key = isDarkMode || prefersDark ? darkKey : lightKey;\n return colors[key] || colors['gray-500']; // Return actual hex color\n };\n\n const errorColor = colors['red-500'];\n const warningColor = colors['orange-500'];\n\n const menuBg = getThemeColor('gray-600', 'white');\n const textColor = getThemeColor('gray-100', 'gray-900');\n const placeholderColor = getThemeColor('gray-400', 'gray-500');\n const multiValueBg = getThemeColor('gray-600', 'gray-800');\n\n return {\n control: base => ({\n ...base,\n alignItems: 'center',\n background: 'transparent',\n border: error ? `1px solid ${errorColor}` : warning ? `1px solid ${warningColor}` : 'none',\n borderRadius: '3px',\n boxShadow: 'none',\n minHeight: '38px',\n opacity: disabled ? 0.5 : 1,\n pointerEvents: 'auto',\n '&:hover': {\n border: error ? `1px solid ${errorColor}` : warning ? `1px solid ${warningColor}` : 'none'\n }\n }),\n valueContainer: base => ({\n ...base,\n alignItems: 'center',\n gap: '8px',\n padding: '0 8px',\n maxHeight: displayShowMore\n ? error || warning\n ? '100%'\n : `${showMoreHeight + 16}px`\n : '100%',\n overflow: 'hidden'\n }),\n multiValue: base => ({\n ...base,\n backgroundColor: multiValueBg,\n borderRadius: '3px',\n margin: '0',\n display: 'flex',\n alignItems: 'stretch',\n minHeight: '26px',\n overflow: 'hidden',\n opacity: disabled ? 0.7 : 1\n }),\n multiValueLabel: base => ({\n ...base,\n color: colors['white'],\n fontSize: '12px',\n padding: disabled || readOnly ? '0 8px' : '0 3px 0 8px',\n display: 'flex',\n alignItems: 'center',\n cursor: disabled ? 'not-allowed' : readOnly ? 'default' : 'pointer'\n }),\n multiValueRemove: base => ({\n ...base,\n color: 'white',\n padding: '0 8px 0 5px',\n display: disabled || readOnly ? 'none' : 'flex',\n alignItems: 'center',\n alignSelf: 'stretch',\n borderRadius: '0',\n cursor: 'pointer',\n '&:hover': {\n backgroundColor: errorColor,\n color: 'white'\n }\n }),\n menu: base => ({\n ...base,\n backgroundColor: menuBg,\n boxShadow: '0 4px 12px rgba(0,0,0,0.5)',\n zIndex: 999,\n marginTop: '4px',\n border: `1px solid ${getThemeColor('gray-500', 'gray-300')}`\n }),\n menuList: base => ({\n ...base,\n backgroundColor: 'transparent',\n padding: 0\n }),\n option: (base, state) => ({\n ...base,\n backgroundColor: state.isFocused ? getThemeColor('gray-500', 'gray-100') : 'transparent',\n color: textColor,\n cursor: 'pointer',\n fontSize: '14px',\n padding: '8px 12px',\n ':active': {\n backgroundColor: getThemeColor('gray-400', 'gray-200')\n }\n }),\n input: (base, state) => ({\n ...base,\n display: 'inline-grid',\n whiteSpace: 'nowrap',\n color: textColor,\n margin: 0,\n padding: 0,\n ':before':\n !focused && editText && !state.value\n ? {\n content: `\"${editText}\"`,\n color: placeholderColor,\n marginRight: '8px',\n lineHeight: '26px',\n gridArea: '1 / 1'\n }\n : {}\n }),\n noOptionsMessage: base => ({ ...base, color: textColor, backgroundColor: 'transparent' }),\n loadingMessage: base => ({ ...base, color: textColor, backgroundColor: 'transparent' }),\n placeholder: () => ({ display: 'none' }),\n indicatorsContainer: () => ({ display: 'none' })\n };\n }, [\n error,\n warning,\n displayShowMore,\n disabled,\n readOnly,\n editText,\n focused,\n isDarkMode,\n onMultiValueClick\n ]);\n\n const innerComponents = {\n Option: optProps => (\n <components.Option {...optProps}>\n <div\n style={{\n display: 'flex',\n justifyContent: 'space-between',\n width: '100%',\n alignItems: 'center'\n }}\n >\n <span>{optProps.label}</span>\n {optProps.isSelected && <S.DropdownOptionDeleteIcon />}\n </div>\n </components.Option>\n ),\n MultiValue: mvProps => (\n <S.MultiValueWrapper\n onMouseDown={e => {\n if (\n onMultiValueClick &&\n !readOnly &&\n !disabled &&\n !e.target.closest('.multi-select__multi-value__remove')\n ) {\n e.stopPropagation();\n onMultiValueClick(mvProps.data);\n }\n }}\n >\n <components.MultiValue {...mvProps} />\n </S.MultiValueWrapper>\n )\n };\n\n const sharedSelectProps = {\n ...rest,\n ref: forwardedRef,\n id: uniqueId,\n classNamePrefix: 'multi-select',\n styles: selectStyles,\n components: innerComponents,\n value: selected,\n options: loadOptions ? undefined : availableOptions,\n loadOptions,\n isMulti: true,\n isDisabled: disabled || readOnly,\n closeMenuOnSelect: false,\n hideSelectedOptions: false,\n openMenuOnClick: true,\n onFocus: () => setFocused(true),\n onBlur: () => setFocused(false),\n onChange: (newValue, actionMeta) => {\n setSelected(newValue);\n if (onUpdateCallback) {\n const item = actionMeta.option || actionMeta.removedValue;\n onUpdateCallback(actionMeta.action, item);\n }\n if (actionMeta.action === 'create-option' && loadOptions) {\n setCacheUnique(c => c + 1);\n }\n },\n cacheUniqs: loadOptions ? [cacheUnique] : undefined\n };\n\n const SelectComponent = useMemo(() => {\n if (loadOptions) return creatable ? S.AsyncCreatableMultiSelect : S.AsyncMultiSelect;\n return creatable ? S.CreatableMultiSelect : S.MultiSelect;\n }, [loadOptions, creatable]);\n\n if (hidden) return null;\n\n return (\n <S.MultiSelectWrapper>\n {label && <S.Label htmlFor={uniqueId}>{label}</S.Label>}\n <S.InnerWrapper>\n <SelectComponent {...sharedSelectProps} />\n </S.InnerWrapper>\n {displayShowMore && (\n <S.ShowMoreWrapper onClick={() => setDisplayShowMore(false)}>\n <S.ShowMoreOverlay />\n <S.ShowMoreText>\n {showMoreText} {displayTotalOnShowMore && `(${selected.length})`}\n </S.ShowMoreText>\n </S.ShowMoreWrapper>\n )}\n {(error || warning) && (\n <S.ErrorMessage $error={!!error} $warning={!!warning}>\n {error || warning}\n </S.ErrorMessage>\n )}\n </S.MultiSelectWrapper>\n );\n});\n\nMultiSelect.displayName = 'MultiSelect';\n\nMultiSelect.propTypes = {\n /**\n *\n * The label of the input field – leave `undefined` to hide the label\n */\n label: PropTypes.string,\n /**\n * `Array` of `objects` containing the default options. This is only needed\n * when asynchronous option fetching with the `loadOptions` prop is not used.\n *\n * **Note:**\n * <br />This will be overridden by the `loadOptions` prop if both props are set.\n */\n availableOptions: PropTypes.arrayOf(PropTypes.object),\n\n /**\n * `Array` of `objects` containing the selected options.\n */\n selectedOptions: PropTypes.arrayOf(PropTypes.object),\n\n /**\n * Function with a `Promise` returning filtered options.\n *\n * See [Asynchronous fetching/filtering with pagination](#asynchronous-fetchingfiltering-with-pagination)\n * for details.\n *\n * **Note:**\n * <br />This will override the `availableOptions` prop if both props are set.\n */\n loadOptions: PropTypes.func,\n\n /**\n * Function for custom \"Loading...\" message while waiting for the first page\n * from `loadOptions` to resolve. Defaults to \"Loading...\" if no function is provided.\n */\n loadingMessageFunc: PropTypes.func,\n\n /**\n * Callback function for sending updates to the backend whenever the selected values are updated.\n * See [Update handling](#update-handling) for details.\n */\n onUpdateCallback: PropTypes.func,\n\n /**\n * Text to be displayed on the input element when the component\n * is enabled and not focused – e.g. \"Add a keyword...\"\n */\n editText: PropTypes.string.isRequired,\n\n /**\n * Whether the user can create new options.\n */\n creatable: PropTypes.bool,\n\n /**\n * Callback function for formatting the message displayed in the dropdown when there\n * are no matching options, and the user has permission to create new options.\n * The callback function will be given the current input value as an argument.\n */\n createNewOptionMessageFunc: PropTypes.func,\n\n /**\n * If the list of options is empty, or if the current input value doesn't match\n * any of the available options and the user doesn't have permission to add options,\n * this function will be called and passed the current input value as an argument.\n */\n noOptionsMessageFunc: PropTypes.func,\n\n /**\n * Optional callback function to be trigger when clicking a selected option's label – e.g. opening\n * a search filtered on the given multi-value's `label`.\n *\n * The callback function will be passed the option `object` as an argument.\n */\n onMultiValueClick: PropTypes.func,\n\n /**\n * Display an overlay which the user needs to click in order to\n * show the selected options list in its entirety and edit it.\n */\n showMore: PropTypes.bool,\n\n /**\n * Text displayed on the \"Show more\" overlay.\n */\n showMoreText: PropTypes.string,\n\n /**\n * Whether to display the total number of selected options after the show more text.\n */\n displayTotalOnShowMore: PropTypes.bool,\n\n /**\n * Whether the multi-select should be displayed in read-only mode.\n * The user can still click the selected options to trigger their on-click effect.\n */\n readOnly: PropTypes.bool,\n /**\n * Whether the component is hidden or visible.\n */\n hidden: PropTypes.bool,\n\n /**\n * Whether the multi-select should be disabled.\n * The user will not be able to trigger the on-click effect of the selected options.\n */\n disabled: PropTypes.bool,\n\n /**\n * Set to `true` to display a red border indicating an error.\n * Pass in a `string` instead to also show the string underneath the input field.\n *\n * **Note:**\n * <br />This overrides the \"Show more\" overlay. Errors will be prioritized over warnings.\n */\n error: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),\n\n /**\n * Set to `true` to display an orange border.\n * Pass in a `string` instead to also show the string underneath the input field.\n *\n * **Note:**\n * <br />This overrides the \"Show more\" overlay. Errors will be prioritized over warnings.\n */\n warning: PropTypes.oneOfType([PropTypes.bool, PropTypes.string])\n};\n\nMultiSelect.defaultProps = {\n noOptionsMessageFunc: inputValue => {\n if (inputValue) {\n return `No matches for \"${inputValue}\"`;\n } else {\n return 'No available options';\n }\n },\n showMore: false,\n displayTotalOnShowMore: true,\n readOnly: false,\n disabled: false,\n creatable: false,\n error: false,\n warning: false,\n showMoreText: 'Show more',\n hidden: false\n};\n\nexport default MultiSelect;\n"],"names":["showMoreHeight","MultiSelect","React","forwardRef","props","forwardedRef","label","selectedOptions","availableOptions","loadOptions","onUpdateCallback","editText","creatable","readOnly","disabled","error","warning","onMultiValueClick","showMore","showMoreText","displayTotalOnShowMore","hidden","rest","uniqueId","useState","nanoid","selected","setSelected","cacheUnique","setCacheUnique","displayShowMore","setDisplayShowMore","focused","setFocused","isDarkMode","setIsDarkMode","document","body","classList","contains","useEffect","observer","MutationObserver","observe","attributes","attributeFilter","disconnect","selectStyles","useMemo","getThemeColor","darkKey","lightKey","prefersDark","window","matchMedia","matches","key","colors","errorColor","warningColor","menuBg","textColor","placeholderColor","multiValueBg","control","base","alignItems","background","border","borderRadius","boxShadow","minHeight","opacity","pointerEvents","valueContainer","gap","padding","maxHeight","overflow","multiValue","backgroundColor","margin","display","multiValueLabel","color","fontSize","cursor","multiValueRemove","alignSelf","menu","zIndex","marginTop","menuList","option","state","isFocused","input","whiteSpace","value","content","marginRight","lineHeight","gridArea","noOptionsMessage","loadingMessage","placeholder","indicatorsContainer","innerComponents","Option","optProps","createElement","components","style","justifyContent","width","isSelected","S","MultiValue","mvProps","onMouseDown","e","target","closest","stopPropagation","data","sharedSelectProps","ref","id","classNamePrefix","styles","options","undefined","isMulti","isDisabled","closeMenuOnSelect","hideSelectedOptions","openMenuOnClick","onFocus","onBlur","onChange","newValue","actionMeta","item","removedValue","action","c","cacheUniqs","SelectComponent","htmlFor","onClick","length","$error","$warning","displayName","propTypes","process","env","NODE_ENV","PropTypes","string","arrayOf","object","func","loadingMessageFunc","isRequired","bool","createNewOptionMessageFunc","noOptionsMessageFunc","oneOfType","defaultProps","inputValue"],"mappings":";;;;;;;AAkKA,MAAMA,cAAc,GAAG,GAAG,CAAA;AAEpBC,MAAAA,WAAW,GAAGC,cAAK,CAACC,UAAU,CAAC,CAACC,KAAK,EAAEC,YAAY,KAAK;EAC5D,MAAM;IACJC,KAAK;AACLC,IAAAA,eAAe,GAAG,EAAE;IACpBC,gBAAgB;IAChBC,WAAW;IACXC,gBAAgB;IAChBC,QAAQ;IACRC,SAAS;IACTC,QAAQ;IACRC,QAAQ;IACRC,KAAK;IACLC,OAAO;IACPC,iBAAiB;IACjBC,QAAQ;AACRC,IAAAA,YAAY,GAAG,WAAW;AAC1BC,IAAAA,sBAAsB,GAAG,IAAI;IAC7BC,MAAM;IACN,GAAGC,IAAAA;AACL,GAAC,GAAGlB,KAAK,CAAA;EAET,MAAM,CAACmB,QAAQ,CAAC,GAAGC,QAAQ,CAACC,MAAM,EAAE,CAAC,CAAA;EACrC,MAAM,CAACC,QAAQ,EAAEC,WAAW,CAAC,GAAGH,QAAQ,CAACjB,eAAe,CAAC,CAAA;EACzD,MAAM,CAACqB,WAAW,EAAEC,cAAc,CAAC,GAAGL,QAAQ,CAAC,CAAC,CAAC,CAAA;AACjD,EAAA,MAAM,CAACM,eAAe,EAAEC,kBAAkB,CAAC,GAAGP,QAAQ,CAACN,QAAQ,IAAI,CAACH,KAAK,IAAI,CAACC,OAAO,CAAC,CAAA;EACtF,MAAM,CAACgB,OAAO,EAAEC,UAAU,CAAC,GAAGT,QAAQ,CAAC,KAAK,CAAC,CAAA;AAG7C,EAAA,MAAM,CAACU,UAAU,EAAEC,aAAa,CAAC,GAAGX,QAAQ,CA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-1,236 +1,87 @@
1
1
  import styled, { css } from 'styled-components';
2
- import { applyDefaultTheme } from '../../utils/defaultTheme.js';
3
- import { ReactComponent as SvgClose } from '../../icons/close.svg.js';
4
- import Select, { components } from 'react-select';
2
+ import Select from 'react-select';
5
3
  import CreatableSelect from 'react-select/creatable';
6
4
  import { withAsyncPaginate, AsyncPaginate } from 'react-select-async-paginate';
5
+ import { applyDefaultTheme } from '../../utils/defaultTheme.js';
6
+ import { ReactComponent as SvgClose } from '../../icons/close.svg.js';
7
7
 
8
- const showMoreHeight = 114;
9
8
  const AsyncCreatableSelectPaginate = withAsyncPaginate(CreatableSelect);
10
- const shouldForwardProp = prop => {
11
- return prop !== 'theme' && !prop.startsWith('$');
12
- };
13
9
  const sharedStyle = css`
14
- font-family: ${props => props.theme?.primaryFontFamily || 'Arial, sans-serif'};
10
+ font-family: ${props => props.theme.primaryFontFamily};
15
11
  font-size: 12px;
16
- font-weight: 400;
17
12
  position: relative;
18
13
  `;
19
- const MultiSelectWrapper = styled.div.withConfig({
20
- shouldForwardProp
21
- }).attrs(applyDefaultTheme)`
14
+ const MultiSelectWrapper = styled.div.attrs(applyDefaultTheme)`
22
15
  position: relative;
23
16
  `;
24
- const InnerWrapper = styled.div.withConfig({
25
- shouldForwardProp
26
- }).attrs(applyDefaultTheme)`
27
- ${props => (props.$error || props.$warning) && css`
28
- border: 1px solid;
29
- border-radius: 3px;
30
- padding: 4px;
31
- border-color: ${props.$error ? props.theme.getColor('red-500') : props.theme.getColor('orange-500')};
32
- `}
17
+ const InnerWrapper = styled.div`
18
+ position: relative;
19
+ width: 100%;
33
20
  `;
34
- const Label = styled.label.withConfig({
35
- shouldForwardProp
36
- }).attrs(applyDefaultTheme)`
37
- ${props => props.theme.themeProp('color', props.theme.getColor('white'), props.theme.getColor('gray-700'))};
38
- flex-basis: 33.33%;
21
+ const Label = styled.label.attrs(applyDefaultTheme)`
22
+ color: ${props => props.theme.themeProp('color', props.theme.getColor('white'), props.theme.getColor('gray-700'))};
39
23
  font-size: 0.875rem;
40
- line-height: 1rem;
41
- cursor: pointer;
42
- height: 19px;
43
- display: flex;
44
- align-items: center;
45
- `;
46
- const MultiValue = styled(components.MultiValue).attrs(applyDefaultTheme)`
47
- && {
48
- border-radius: 3px;
49
- margin: 0;
50
- display: flex;
51
- align-items: center;
52
- border: none;
53
-
54
- ${props => props.theme.themeProp('background-color', props.theme.getColor('gray-600'), props.theme.getColor('gray-800'))}
55
-
56
- ${props => props.$isDisabled && css`
57
- opacity: 0.6;
58
- cursor: not-allowed !important;
59
-
60
- & > * {
61
- pointer-events: none;
62
- cursor: not-allowed !important;
63
- }
64
- `}
65
-
66
- ${props => props.$isReadOnly && !props.$isDisabled && css`
67
- cursor: default !important;
68
- `}
69
-
70
-
71
- & > div:first-of-type {
72
- font-size: 12px;
73
- min-height: 26px;
74
- display: flex;
75
- align-items: center;
76
- padding: ${props => props.$isDisabled || props.$isReadOnly ? '0 8px' : '0 3px 0 8px'};
77
- color: ${props => props.theme.getColor('gray-100')};
78
- cursor: ${props => props.$isDisabled ? 'not-allowed' : props.$isReadOnly ? 'default' : 'pointer'};
79
- }
80
-
81
- /* Target the Remove Button */
82
- .multi-select__multi-value__remove,
83
- & > div:last-of-type {
84
- display: flex;
85
- align-items: center;
86
- padding: 0 8px 0 5px;
87
- height: 26px;
88
- width: fit-content;
89
- cursor: pointer;
90
- background-color: transparent;
91
-
92
- ${props => !props.$isDisabled && !props.$isReadOnly && css`
93
- &:hover {
94
- background-color: ${props.theme.getColor('red-500')} !important;
95
- border-radius: 0 3px 3px 0;
96
- }
97
- `}
98
-
99
- svg {
100
- stroke: white;
101
- stroke-width: 2px;
102
- width: 8px;
103
- }
104
- }
105
- }
24
+ margin-bottom: 4px;
25
+ display: block;
106
26
  `;
107
- const MultiSelect = styled(Select)`
27
+ const MultiSelect = styled(Select).attrs(applyDefaultTheme)`
108
28
  ${sharedStyle}
109
29
  `;
110
- const CreatableMultiSelect = styled(CreatableSelect)`
30
+ const CreatableMultiSelect = styled(CreatableSelect).attrs(applyDefaultTheme)`
111
31
  ${sharedStyle}
112
32
  `;
113
- const AsyncMultiSelect = styled(AsyncPaginate)`
33
+ const AsyncMultiSelect = styled(AsyncPaginate).attrs(applyDefaultTheme)`
114
34
  ${sharedStyle}
115
35
  `;
116
- const AsyncCreatableMultiSelect = styled(AsyncCreatableSelectPaginate)`
36
+ const AsyncCreatableMultiSelect = styled(AsyncCreatableSelectPaginate).attrs(applyDefaultTheme)`
117
37
  ${sharedStyle}
118
38
  `;
119
- const InputWrapper = styled.div.withConfig({
120
- shouldForwardProp
121
- }).attrs(applyDefaultTheme)`
122
- position: relative;
39
+ const MultiValueWrapper = styled.div`
40
+ border-radius: 3px;
123
41
  display: flex;
124
- align-items: center;
125
- min-width: 150px;
126
-
127
- input {
128
- color: ${props => props.theme.themeProp('color', props.theme.getColor('gray-100'), props.theme.getColor('gray-900'))} !important;
129
- font-size: ${props => props.$focused ? '14px' : '12px'} !important;
130
- }
131
-
132
- ${props => !props.$isMenuOpen && css`
133
- &:before {
134
- content: '${props.$editText}';
135
- position: absolute;
136
- left: 2px;
137
- color: ${props.theme.themeProp('color', props.theme.getColor('gray-400'), props.theme.getColor('gray-500'))};
138
- pointer-events: none;
139
- font-size: 12px;
140
- }
141
- `}
142
-
143
- ${props => props.$isDisabled && css`
144
- opacity: 0.5;
145
- cursor: not-allowed;
146
- pointer-events: none;
147
- `};
148
42
  `;
149
- const DropdownMenu = styled(components.Menu).attrs(applyDefaultTheme)`
150
- font-size: 14px;
151
-
152
- ${props => props.theme.themeProp('background-color', props.theme.getColor('gray-600'), props.theme.getColor('white'))}
153
-
154
- ${props => props.theme.themeProp('color', props.theme.getColor('gray-100'), props.theme.getColor('gray-900'))}
155
- `;
156
- const sharedOptionStyle = css`
157
- ${props => props.isFocused && css`
158
- ${props.theme.themeProp('background-color', props.theme.getColor('gray-500'), props.theme.getColor('gray-200'))}
159
- `}
160
-
161
- ${props => props.isSelected && css`
162
- ${props.theme.themeProp('background-color', 'transparent', 'transparent')}
163
-
164
- ${props.theme.themeProp('color', props.theme.getColor('gray-100'), props.theme.getColor('gray-900'))}
165
- `}
166
-
167
- ${props => props.isFocused && props.isSelected && css`
168
- ${props.theme.themeProp('background-color', props.theme.getColor('gray-500'), props.theme.getColor('gray-200'))}
169
- `}
170
-
171
- :hover {
172
- cursor: pointer;
173
- }
174
- `;
175
- const Option = styled(components.Option).attrs(applyDefaultTheme)`
176
- ${sharedOptionStyle}
177
- padding: 8px 12px;
43
+ const DropdownOptionDeleteIcon = styled(SvgClose).attrs(applyDefaultTheme)`
44
+ width: 10px;
45
+ stroke: ${props => props.theme.themeProp('stroke', props.theme.getColor('gray-100'), props.theme.getColor('gray-900'))};
178
46
  `;
179
- const SelectedOption = styled(components.Option).attrs(applyDefaultTheme)`
180
- ${sharedOptionStyle}
181
- display: flex !important;
182
- justify-content: space-between;
183
- align-items: center;
184
- padding: 8px 12px;
185
- `;
186
- const DropdownOptionDeleteIcon = styled(SvgClose).withConfig({
187
- shouldForwardProp
188
- }).attrs(applyDefaultTheme)`
189
- stroke-width: 1px;
190
- width: 8px;
191
- ${props => props.theme.themeProp('stroke', props.theme.getColor('gray-100'), props.theme.getColor('gray-900'))}
192
- `;
193
- const ShowMoreWrapper = styled.div.withConfig({
194
- shouldForwardProp
195
- }).attrs(applyDefaultTheme)`
47
+ const ShowMoreWrapper = styled.div.attrs(applyDefaultTheme)`
196
48
  align-items: end;
197
49
  display: flex;
198
50
  flex-direction: column;
199
51
  height: 100%;
200
52
  left: 0;
201
53
  position: absolute;
202
- max-height: ${showMoreHeight + 16}px;
203
54
  top: 0;
204
55
  width: 100%;
205
- z-index: 2;
206
- cursor: pointer;
207
- color: ${props => props.theme.themeProp('color', props.theme.getColor('gray-100'), props.theme.getColor('emerald-500'))};
208
- &:hover {
56
+
57
+ ${props => props.theme.themeProp('color', props.theme.getColor('gray-100'), props.theme.getColor('emerald-500'))}
58
+
59
+ :hover {
60
+ cursor: pointer;
209
61
  text-decoration: underline;
210
62
  }
211
63
  `;
212
- const ShowMoreOverlay = styled.div.withConfig({
213
- shouldForwardProp
214
- }).attrs(applyDefaultTheme)`
64
+ const ShowMoreOverlay = styled.div.attrs(applyDefaultTheme)`
65
+ align-items: end;
66
+ display: block;
215
67
  height: 100%;
216
- max-height: ${showMoreHeight}px;
68
+ left: 0;
69
+ top: 0;
70
+ width: 100%;
71
+
217
72
  ${props => props.theme.themeProp('background', 'transparent linear-gradient(180deg, #12121200 0%, #12121230 40%, #12121279 70%, #121212 95%, #121212 100%) 0% 0% no-repeat padding-box', 'transparent linear-gradient(180deg, #fefefe00 0%, #fefefe30 40%, #fefefe79 70%, #fefefe 95%, #fefefe 100%) 0% 0% no-repeat padding-box')}
218
73
  `;
219
- const ShowMoreText = styled.div.withConfig({
220
- shouldForwardProp
221
- }).attrs(applyDefaultTheme)`
74
+ const ShowMoreText = styled.div.attrs(applyDefaultTheme)`
222
75
  font-size: 0.875rem;
223
76
  width: 100%;
224
- background-color: ${props => props.theme.themeProp('background-color', '#121212', '#fefefe')};
77
+ ${props => props.theme.themeProp('background-color', '#121212', '#fefefe')}
225
78
  `;
226
- const ErrorMessage = styled.div.withConfig({
227
- shouldForwardProp
228
- }).attrs(applyDefaultTheme)`
79
+ const ErrorMessage = styled.div.attrs(applyDefaultTheme)`
229
80
  color: ${props => props.$error ? props.theme.getColor('red-500') : props.$warning ? props.theme.getColor('orange-500') : 'inherit'};
230
81
  font-size: 0.75rem;
231
82
  margin-top: 8px;
232
83
  padding: 0 12px;
233
84
  `;
234
85
 
235
- export { AsyncCreatableMultiSelect, AsyncMultiSelect, CreatableMultiSelect, DropdownMenu, DropdownOptionDeleteIcon, ErrorMessage, InnerWrapper, InputWrapper, Label, MultiSelect, MultiSelectWrapper, MultiValue, Option, SelectedOption, ShowMoreOverlay, ShowMoreText, ShowMoreWrapper };
86
+ export { AsyncCreatableMultiSelect, AsyncMultiSelect, CreatableMultiSelect, DropdownOptionDeleteIcon, ErrorMessage, InnerWrapper, Label, MultiSelect, MultiSelectWrapper, MultiValueWrapper, ShowMoreOverlay, ShowMoreText, ShowMoreWrapper };
236
87
  //# sourceMappingURL=MultiSelect.styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MultiSelect.styled.js","sources":["../../../src/components/inputs/MultiSelect/MultiSelect.styled.js"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\nimport { ReactComponent as CloseIcon } from '../../../icons/close.svg';\nimport { components } from 'react-select';\nimport Select from 'react-select';\nimport CreatableSelect from 'react-select/creatable';\nimport { AsyncPaginate, withAsyncPaginate } from 'react-select-async-paginate';\n\nconst showMoreHeight = 114;\nconst AsyncCreatableSelectPaginate = withAsyncPaginate(CreatableSelect);\n\nconst shouldForwardProp = prop => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\nconst sharedStyle = css`\n font-family: ${props => props.theme?.primaryFontFamily || 'Arial, sans-serif'};\n font-size: 12px;\n font-weight: 400;\n position: relative;\n`;\n\nexport const MultiSelectWrapper = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n position: relative;\n`;\n\nexport const InnerWrapper = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n ${props =>\n (props.$error || props.$warning) &&\n css`\n border: 1px solid;\n border-radius: 3px;\n padding: 4px;\n border-color: ${props.$error\n ? props.theme.getColor('red-500')\n : props.theme.getColor('orange-500')};\n `}\n`;\n\nexport const Label = styled.label\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('white'),\n props.theme.getColor('gray-700')\n )};\n flex-basis: 33.33%;\n font-size: 0.875rem;\n line-height: 1rem;\n cursor: pointer;\n height: 19px;\n display: flex;\n align-items: center;\n`;\n\nexport const MultiValue = styled(components.MultiValue).attrs(applyDefaultTheme)`\n && {\n border-radius: 3px;\n margin: 0;\n display: flex;\n align-items: center;\n border: none;\n\n ${props =>\n props.theme.themeProp(\n 'background-color',\n props.theme.getColor('gray-600'),\n props.theme.getColor('gray-800')\n )}\n\n ${props =>\n props.$isDisabled &&\n css`\n opacity: 0.6;\n cursor: not-allowed !important;\n\n & > * {\n pointer-events: none;\n cursor: not-allowed !important;\n }\n `}\n\n ${props =>\n props.$isReadOnly &&\n !props.$isDisabled &&\n css`\n cursor: default !important;\n `}\n\n \n & > div:first-of-type {\n font-size: 12px;\n min-height: 26px;\n display: flex;\n align-items: center;\n padding: ${props => (props.$isDisabled || props.$isReadOnly ? '0 8px' : '0 3px 0 8px')};\n color: ${props => props.theme.getColor('gray-100')};\n cursor: ${props =>\n props.$isDisabled ? 'not-allowed' : props.$isReadOnly ? 'default' : 'pointer'};\n }\n\n /* Target the Remove Button */\n .multi-select__multi-value__remove,\n & > div:last-of-type {\n display: flex;\n align-items: center;\n padding: 0 8px 0 5px;\n height: 26px;\n width: fit-content;\n cursor: pointer;\n background-color: transparent;\n\n ${props =>\n !props.$isDisabled &&\n !props.$isReadOnly &&\n css`\n &:hover {\n background-color: ${props.theme.getColor('red-500')} !important;\n border-radius: 0 3px 3px 0;\n }\n `}\n\n svg {\n stroke: white;\n stroke-width: 2px;\n width: 8px;\n }\n }\n }\n`;\n\nexport const MultiSelect = styled(Select)`\n ${sharedStyle}\n`;\nexport const CreatableMultiSelect = styled(CreatableSelect)`\n ${sharedStyle}\n`;\nexport const AsyncMultiSelect = styled(AsyncPaginate)`\n ${sharedStyle}\n`;\nexport const AsyncCreatableMultiSelect = styled(AsyncCreatableSelectPaginate)`\n ${sharedStyle}\n`;\n\nexport const InputWrapper = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n position: relative;\n display: flex;\n align-items: center;\n min-width: 150px;\n\n input {\n color: ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-100'),\n props.theme.getColor('gray-900')\n )} !important;\n font-size: ${props => (props.$focused ? '14px' : '12px')} !important;\n }\n\n ${props =>\n !props.$isMenuOpen &&\n css`\n &:before {\n content: '${props.$editText}';\n position: absolute;\n left: 2px;\n color: ${props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-400'),\n props.theme.getColor('gray-500')\n )};\n pointer-events: none;\n font-size: 12px;\n }\n `}\n\n ${props =>\n props.$isDisabled &&\n css`\n opacity: 0.5;\n cursor: not-allowed;\n pointer-events: none;\n `};\n`;\n\nexport const DropdownMenu = styled(components.Menu).attrs(applyDefaultTheme)`\n font-size: 14px;\n\n ${props =>\n props.theme.themeProp(\n 'background-color',\n props.theme.getColor('gray-600'),\n props.theme.getColor('white')\n )}\n\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-100'),\n props.theme.getColor('gray-900')\n )}\n`;\n\nconst sharedOptionStyle = css`\n ${props =>\n props.isFocused &&\n css`\n ${props.theme.themeProp(\n 'background-color',\n props.theme.getColor('gray-500'),\n props.theme.getColor('gray-200')\n )}\n `}\n\n ${props =>\n props.isSelected &&\n css`\n ${props.theme.themeProp('background-color', 'transparent', 'transparent')}\n\n ${props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-100'),\n props.theme.getColor('gray-900')\n )}\n `}\n\n ${props =>\n props.isFocused &&\n props.isSelected &&\n css`\n ${props.theme.themeProp(\n 'background-color',\n props.theme.getColor('gray-500'),\n props.theme.getColor('gray-200')\n )}\n `}\n\n :hover {\n cursor: pointer;\n }\n`;\n\nexport const Option = styled(components.Option).attrs(applyDefaultTheme)`\n ${sharedOptionStyle}\n padding: 8px 12px;\n`;\n\nexport const SelectedOption = styled(components.Option).attrs(applyDefaultTheme)`\n ${sharedOptionStyle}\n display: flex !important;\n justify-content: space-between;\n align-items: center;\n padding: 8px 12px;\n`;\n\nexport const DropdownOptionDeleteIcon = styled(CloseIcon)\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n stroke-width: 1px;\n width: 8px;\n ${props =>\n props.theme.themeProp(\n 'stroke',\n props.theme.getColor('gray-100'),\n props.theme.getColor('gray-900')\n )}\n`;\n\nexport const ShowMoreWrapper = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n align-items: end;\n display: flex;\n flex-direction: column;\n height: 100%;\n left: 0;\n position: absolute;\n max-height: ${showMoreHeight + 16}px;\n top: 0;\n width: 100%;\n z-index: 2;\n cursor: pointer;\n color: ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-100'),\n props.theme.getColor('emerald-500')\n )};\n &:hover {\n text-decoration: underline;\n }\n`;\n\nexport const ShowMoreOverlay = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n height: 100%;\n max-height: ${showMoreHeight}px;\n ${props =>\n props.theme.themeProp(\n 'background',\n 'transparent linear-gradient(180deg, #12121200 0%, #12121230 40%, #12121279 70%, #121212 95%, #121212 100%) 0% 0% no-repeat padding-box',\n 'transparent linear-gradient(180deg, #fefefe00 0%, #fefefe30 40%, #fefefe79 70%, #fefefe 95%, #fefefe 100%) 0% 0% no-repeat padding-box'\n )}\n`;\n\nexport const ShowMoreText = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n font-size: 0.875rem;\n width: 100%;\n background-color: ${props => props.theme.themeProp('background-color', '#121212', '#fefefe')};\n`;\n\nexport const ErrorMessage = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n color: ${props =>\n props.$error\n ? props.theme.getColor('red-500')\n : props.$warning\n ? props.theme.getColor('orange-500')\n : 'inherit'};\n font-size: 0.75rem;\n margin-top: 8px;\n padding: 0 12px;\n`;\n"],"names":["showMoreHeight","AsyncCreatableSelectPaginate","withAsyncPaginate","CreatableSelect","shouldForwardProp","prop","startsWith","sharedStyle","css","props","theme","primaryFontFamily","MultiSelectWrapper","styled","div","withConfig","attrs","applyDefaultTheme","InnerWrapper","$error","$warning","getColor","Label","label","themeProp","MultiValue","components","$isDisabled","$isReadOnly","MultiSelect","Select","CreatableMultiSelect","AsyncMultiSelect","AsyncPaginate","AsyncCreatableMultiSelect","InputWrapper","$focused","$isMenuOpen","$editText","DropdownMenu","Menu","sharedOptionStyle","isFocused","isSelected","Option","SelectedOption","DropdownOptionDeleteIcon","CloseIcon","ShowMoreWrapper","ShowMoreOverlay","ShowMoreText","ErrorMessage"],"mappings":";;;;;;;AAQA,MAAMA,cAAc,GAAG,GAAG,CAAA;AAC1B,MAAMC,4BAA4B,GAAGC,iBAAiB,CAACC,eAAe,CAAC,CAAA;AAEvE,MAAMC,iBAAiB,GAAGC,IAAI,IAAI;EAChC,OAAOA,IAAI,KAAK,OAAO,IAAI,CAACA,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC,CAAA;AAClD,CAAC,CAAA;AAED,MAAMC,WAAW,GAAGC,GAAG,CAAA;AACvB,eAAiBC,EAAAA,KAAK,IAAIA,KAAK,CAACC,KAAK,EAAEC,iBAAiB,IAAI,mBAAmB,CAAA;AAC/E;AACA;AACA;AACA,CAAC,CAAA;AAEM,MAAMC,kBAAkB,GAAGC,MAAM,CAACC,GAAG,CACzCC,UAAU,CAAC;AACVX,EAAAA,iBAAAA;AACF,CAAC,CAAC,CACDY,KAAK,CAACC,iBAAiB,CAAC,CAAA;AAC3B;AACA,EAAC;AAEM,MAAMC,YAAY,GAAGL,MAAM,CAACC,GAAG,CACnCC,UAAU,CAAC;AACVX,EAAAA,iBAAAA;AACF,CAAC,CAAC,CACDY,KAAK,CAACC,iBAAiB,CAAC,CAAA;AAC3B,EAAIR,EAAAA,KAAK,IACL,CAACA,KAAK,CAACU,MAAM,IAAIV,KAAK,CAACW,QAAQ,KAC/BZ,GAAG,CAAA;AACP;AACA;AACA;AACA,oBAAsBC,EAAAA,KAAK,CAACU,MAAM,GACxBV,KAAK,CAACC,KAAK,CAACW,QAAQ,CAAC,SAAS,CAAC,GAC/BZ,KAAK,CAACC,KAAK,CAACW,QAAQ,CAAC,YAAY,CAAC,C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AA;AACL,EAAC;AAEM,MAAM0B,YAAY,GAAGrC,MAAM,CAACC,GAAG,CACnCC,UAAU,CAAC;AACVX,EAAAA,iBAAAA;AACF,CAAC,CAAC,CACDY,KAAK,CAACC,iBAAiB,CAAC,CAAA;AAC3B;AACA;AACA,oBAAA,EAAsBR,KAAK,IAAIA,KAAK,CAACC,KAAK,CAACc,SAAS,CAAC,kBAAkB,EAAE,SAAS,EAAE,SAAS,CAAC,CAAA;AAC9F,EAAC;AAEM,MAAM2B,YAAY,GAAGtC,MAAM,CAACC,GAAG,CACnCC,UAAU,CAAC;AACVX,EAAAA,iBAAAA;AACF,CAAC,CAAC,CACDY,KAAK,CAACC,iBAAiB,CAAC,CAAA;AAC3B,SAAA,EAAWR,KAAK,IACZA,KAAK,CAACU,MAAM,GACRV,KAAK,CAACC,KAAK,CAACW,QAAQ,CAAC,SAAS,CAAC,GAC/BZ,KAAK,CAACW,QAAQ,GACZX,KAAK,CAACC,KAAK,CAACW,QAAQ,CAAC,YAAY,CAAC,GAClC,SAAS,CAAA;AACnB;AACA;AACA;AACA;;;;"}
1
+ {"version":3,"file":"MultiSelect.styled.js","sources":["../../../src/components/inputs/MultiSelect/MultiSelect.styled.js"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport Select from 'react-select';\nimport CreatableSelect from 'react-select/creatable';\nimport { AsyncPaginate, withAsyncPaginate } from 'react-select-async-paginate';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\nimport { ReactComponent as CloseIcon } from '../../../icons/close.svg';\n\nconst AsyncCreatableSelectPaginate = withAsyncPaginate(CreatableSelect);\n\nconst sharedStyle = css`\n font-family: ${props => props.theme.primaryFontFamily};\n font-size: 12px;\n position: relative;\n`;\n\nexport const MultiSelectWrapper = styled.div.attrs(applyDefaultTheme)`\n position: relative;\n`;\n\nexport const InnerWrapper = styled.div`\n position: relative;\n width: 100%;\n`;\n\nexport const Label = styled.label.attrs(applyDefaultTheme)`\n color: ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('white'),\n props.theme.getColor('gray-700')\n )};\n font-size: 0.875rem;\n margin-bottom: 4px;\n display: block;\n`;\n\nexport const MultiSelect = styled(Select).attrs(applyDefaultTheme)`\n ${sharedStyle}\n`;\nexport const CreatableMultiSelect = styled(CreatableSelect).attrs(applyDefaultTheme)`\n ${sharedStyle}\n`;\nexport const AsyncMultiSelect = styled(AsyncPaginate).attrs(applyDefaultTheme)`\n ${sharedStyle}\n`;\nexport const AsyncCreatableMultiSelect = styled(AsyncCreatableSelectPaginate).attrs(\n applyDefaultTheme\n)`\n ${sharedStyle}\n`;\n\nexport const MultiValueWrapper = styled.div`\n border-radius: 3px;\n display: flex;\n`;\n\nexport const DropdownOptionDeleteIcon = styled(CloseIcon).attrs(applyDefaultTheme)`\n width: 10px;\n stroke: ${props =>\n props.theme.themeProp(\n 'stroke',\n props.theme.getColor('gray-100'),\n props.theme.getColor('gray-900')\n )};\n`;\n\nexport const ShowMoreWrapper = styled.div.attrs(applyDefaultTheme)`\n align-items: end;\n display: flex;\n flex-direction: column;\n height: 100%;\n left: 0;\n position: absolute;\n top: 0;\n width: 100%;\n\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-100'),\n props.theme.getColor('emerald-500')\n )}\n\n :hover {\n cursor: pointer;\n text-decoration: underline;\n }\n`;\n\nexport const ShowMoreOverlay = styled.div.attrs(applyDefaultTheme)`\n align-items: end;\n display: block;\n height: 100%;\n left: 0;\n top: 0;\n width: 100%;\n\n ${props =>\n props.theme.themeProp(\n 'background',\n 'transparent linear-gradient(180deg, #12121200 0%, #12121230 40%, #12121279 70%, #121212 95%, #121212 100%) 0% 0% no-repeat padding-box',\n 'transparent linear-gradient(180deg, #fefefe00 0%, #fefefe30 40%, #fefefe79 70%, #fefefe 95%, #fefefe 100%) 0% 0% no-repeat padding-box'\n )}\n`;\n\nexport const ShowMoreText = styled.div.attrs(applyDefaultTheme)`\n font-size: 0.875rem;\n width: 100%;\n ${props => props.theme.themeProp('background-color', '#121212', '#fefefe')}\n`;\n\nexport const ErrorMessage = styled.div.attrs(applyDefaultTheme)`\n color: ${props =>\n props.$error\n ? props.theme.getColor('red-500')\n : props.$warning\n ? props.theme.getColor('orange-500')\n : 'inherit'};\n font-size: 0.75rem;\n margin-top: 8px;\n padding: 0 12px;\n`;\n"],"names":["AsyncCreatableSelectPaginate","withAsyncPaginate","CreatableSelect","sharedStyle","css","props","theme","primaryFontFamily","MultiSelectWrapper","styled","div","attrs","applyDefaultTheme","InnerWrapper","Label","label","themeProp","getColor","MultiSelect","Select","CreatableMultiSelect","AsyncMultiSelect","AsyncPaginate","AsyncCreatableMultiSelect","MultiValueWrapper","DropdownOptionDeleteIcon","CloseIcon","ShowMoreWrapper","ShowMoreOverlay","ShowMoreText","ErrorMessage","$error","$warning"],"mappings":";;;;;;;AAOA,MAAMA,4BAA4B,GAAGC,iBAAiB,CAACC,eAAe,CAAC,CAAA;AAEvE,MAAMC,WAAW,GAAGC,GAAG,CAAA;AACvB,eAAA,EAAiBC,KAAK,IAAIA,KAAK,CAACC,KAAK,CAACC,iBAAiB,CAAA;AACvD;AACA;AACA,CAAC,CAAA;AAEM,MAAMC,kBAAkB,GAAGC,MAAM,CAACC,GAAG,CAACC,KAAK,CAACC,iBAAiB,CAAC,CAAA;AACrE;AACA,EAAC;AAEYC,MAAAA,YAAY,GAAGJ,MAAM,CAACC,GAAG,CAAA;AACtC;AACA;AACA,EAAC;AAEM,MAAMI,KAAK,GAAGL,MAAM,CAACM,KAAK,CAACJ,KAAK,CAACC,iBAAiB,CAAC,CAAA;AAC1D,SAAWP,EAAAA,KAAK,IACZA,KAAK,CAACC,KAAK,CAACU,SAAS,CACnB,OAAO,EACPX,KAAK,CAACC,KAAK,CAACW,QAAQ,CAAC,OAAO,CAAC,EAC7BZ,KAAK,CAACC,KAAK,CAACW,QAAQ,CAAC,UAAU,CACjC,CAAC,CAAA;AACL;AACA;AACA;AACA,EAAC;AAEM,MAAMC,WAAW,GAAGT,M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AACA;AACA;AACA;AACA,EAAC;AAEM,MAAMW,eAAe,GAAGnB,MAAM,CAACC,GAAG,CAACC,KAAK,CAACC,iBAAiB,CAAC,CAAA;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA,EAAIP,KAAK,IACLA,KAAK,CAACC,KAAK,CAACU,SAAS,CACnB,YAAY,EACZ,wIAAwI,EACxI,wIACF,CAAC,CAAA;AACL,EAAC;AAEM,MAAMa,YAAY,GAAGpB,MAAM,CAACC,GAAG,CAACC,KAAK,CAACC,iBAAiB,CAAC,CAAA;AAC/D;AACA;AACA,EAAA,EAAIP,KAAK,IAAIA,KAAK,CAACC,KAAK,CAACU,SAAS,CAAC,kBAAkB,EAAE,SAAS,EAAE,SAAS,CAAC,CAAA;AAC5E,EAAC;AAEM,MAAMc,YAAY,GAAGrB,MAAM,CAACC,GAAG,CAACC,KAAK,CAACC,iBAAiB,CAAC,CAAA;AAC/D,SAAA,EAAWP,KAAK,IACZA,KAAK,CAAC0B,MAAM,GACR1B,KAAK,CAACC,KAAK,CAACW,QAAQ,CAAC,SAAS,CAAC,GAC/BZ,KAAK,CAAC2B,QAAQ,GACZ3B,KAAK,CAACC,KAAK,CAACW,QAAQ,CAAC,YAAY,CAAC,GAClC,SAAS,CAAA;AACnB;AACA;AACA;AACA;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ntbjs/react-components",
3
- "version": "2.0.2-rc.9",
3
+ "version": "2.0.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },