@invoicebox/ui 0.1.0-alpha.201 → 0.1.0-alpha.202
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,11 +1,13 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { TProps as TInputLabelProps } from '../InputLabel';
|
|
3
3
|
import { TSizes } from '../constants';
|
|
4
|
+
import { TTagsInputPalette } from './palette';
|
|
4
5
|
export type TProps = Pick<TInputLabelProps, 'label'> & {
|
|
5
6
|
hasError?: boolean;
|
|
6
7
|
} & {
|
|
7
8
|
value?: Array<string>;
|
|
8
9
|
onChange: (value?: Array<string>) => void;
|
|
9
10
|
size?: TSizes;
|
|
11
|
+
palette?: Partial<TTagsInputPalette>;
|
|
10
12
|
};
|
|
11
13
|
export declare const TagsInput: FC<TProps>;
|
|
@@ -34,7 +34,8 @@ var TagsInput = exports.TagsInput = function TagsInput(_ref) {
|
|
|
34
34
|
size = _ref$size === void 0 ? 'M' : _ref$size,
|
|
35
35
|
label = _ref.label,
|
|
36
36
|
value = _ref.value,
|
|
37
|
-
onChange = _ref.onChange
|
|
37
|
+
onChange = _ref.onChange,
|
|
38
|
+
palette = _ref.palette;
|
|
38
39
|
var _useState = (0, _react.useState)(''),
|
|
39
40
|
_useState2 = _slicedToArray(_useState, 2),
|
|
40
41
|
newValue = _useState2[0],
|
|
@@ -45,7 +46,7 @@ var TagsInput = exports.TagsInput = function TagsInput(_ref) {
|
|
|
45
46
|
handleBlur = _useInputFocus.handleBlur;
|
|
46
47
|
var inputRef = (0, _react.useRef)(null);
|
|
47
48
|
var pureInputPalette = (0, _palette.useComponentPalette)('pureInput');
|
|
48
|
-
var tagsInputPalette = (0, _palette.useComponentPalette)('tagsInput');
|
|
49
|
+
var tagsInputPalette = (0, _palette.useComponentPalette)('tagsInput', palette);
|
|
49
50
|
var _SIZE_PARAMS_MAP$size = _constants.SIZE_PARAMS_MAP[size],
|
|
50
51
|
paddingBottom = _SIZE_PARAMS_MAP$size.paddingBottom,
|
|
51
52
|
paddingTop = _SIZE_PARAMS_MAP$size.paddingTop;
|