@invoicebox/ui 0.1.0-alpha.313 → 0.1.0-alpha.315
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/common/Tooltip/index.d.ts +9 -0
- package/dist/components/common/Tooltip/index.js +60 -0
- package/dist/components/common/Tooltip/index.stories.d.ts +6 -0
- package/dist/components/common/Tooltip/index.stories.js +43 -0
- package/dist/components/common/Tooltip/palette.d.ts +7 -0
- package/dist/components/common/Tooltip/palette.js +13 -0
- package/dist/components/common/Tooltip/styles.d.ts +9 -0
- package/dist/components/common/Tooltip/styles.js +34 -0
- package/dist/components/form/Checkbox/CheckIcon.d.ts +2 -0
- package/dist/components/form/Checkbox/CheckIcon.js +23 -0
- package/dist/components/form/Checkbox/index.d.ts +11 -0
- package/dist/components/form/Checkbox/index.js +47 -0
- package/dist/components/form/Checkbox/index.stories.d.ts +8 -0
- package/dist/components/form/Checkbox/index.stories.js +69 -0
- package/dist/components/form/Checkbox/palette.d.ts +12 -0
- package/dist/components/form/Checkbox/palette.js +20 -0
- package/dist/components/form/Checkbox/styles.d.ts +13 -0
- package/dist/components/form/Checkbox/styles.js +71 -0
- package/dist/components/form/CurrencyInput/CoreCurrencyInput/index.js +1 -1
- package/dist/components/form/Select/components/MultipleValue/index.d.ts +9 -0
- package/dist/components/form/Select/components/MultipleValue/index.js +129 -0
- package/dist/components/form/Select/components/MultipleValue/styles.d.ts +8 -0
- package/dist/components/form/Select/components/MultipleValue/styles.js +31 -0
- package/dist/components/form/Select/index.d.ts +17 -4
- package/dist/components/form/Select/index.js +98 -44
- package/dist/components/form/Select/index.stories.d.ts +3 -1
- package/dist/components/form/Select/index.stories.js +32 -1
- package/dist/components/form/Select/palette.d.ts +2 -0
- package/dist/components/form/Select/palette.js +3 -1
- package/dist/components/form/Select/styles.d.ts +4 -0
- package/dist/components/form/Select/styles.js +26 -10
- package/dist/esm/components/common/Tooltip/index.js +51 -0
- package/dist/esm/components/common/Tooltip/index.stories.js +36 -0
- package/dist/esm/components/common/Tooltip/palette.js +7 -0
- package/dist/esm/components/common/Tooltip/styles.js +27 -0
- package/dist/esm/components/form/Checkbox/CheckIcon.js +16 -0
- package/dist/esm/components/form/Checkbox/index.js +38 -0
- package/dist/esm/components/form/Checkbox/index.stories.js +60 -0
- package/dist/esm/components/form/Checkbox/palette.js +13 -0
- package/dist/esm/components/form/Checkbox/styles.js +64 -0
- package/dist/esm/components/form/CurrencyInput/CoreCurrencyInput/index.js +1 -1
- package/dist/esm/components/form/Select/components/MultipleValue/index.js +120 -0
- package/dist/esm/components/form/Select/components/MultipleValue/styles.js +22 -0
- package/dist/esm/components/form/Select/index.js +98 -44
- package/dist/esm/components/form/Select/index.stories.js +31 -0
- package/dist/esm/components/form/Select/palette.js +3 -1
- package/dist/esm/components/form/Select/styles.js +25 -9
- package/dist/esm/index.js +2 -0
- package/dist/esm/palette/context.js +5 -1
- package/dist/esm/palette/provider.js +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +14 -0
- package/dist/palette/context.d.ts +4 -0
- package/dist/palette/context.js +5 -1
- package/dist/palette/provider.js +5 -1
- package/dist/palette/usePalette.d.ts +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const TAGS_GAP = 6;
|
|
3
|
+
export declare const Wrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
4
|
+
$collapse: boolean;
|
|
5
|
+
}>> & string;
|
|
6
|
+
export declare const ItemWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
7
|
+
export declare const TagLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("../../../../common/Typography").TTypographyProps & import("styled-components/dist/types").BaseObject, import("styled-components/dist/types").BaseObject>> & string & Omit<import("react").FC<import("../../../../common/Typography").TTypographyProps>, keyof import("react").Component<any, {}, any>>;
|
|
8
|
+
export declare const TagRemove: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.Wrapper = exports.TagRemove = exports.TagLabel = exports.TAGS_GAP = exports.ItemWrapper = void 0;
|
|
8
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
|
+
var _Typography = require("../../../../common/Typography");
|
|
10
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
11
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
12
|
+
var TAGS_GAP = exports.TAGS_GAP = 6;
|
|
13
|
+
var Wrapper = exports.Wrapper = _styledComponents["default"].div.withConfig({
|
|
14
|
+
displayName: "styles__Wrapper",
|
|
15
|
+
componentId: "sc-gzjw07-0"
|
|
16
|
+
})(["display:flex;align-items:center;gap:", "px;width:100%;min-width:0;", ""], TAGS_GAP, function (_ref) {
|
|
17
|
+
var $collapse = _ref.$collapse;
|
|
18
|
+
return $collapse ? (0, _styledComponents.css)(["flex-wrap:nowrap;overflow:hidden;"]) : (0, _styledComponents.css)(["flex-wrap:wrap;"]);
|
|
19
|
+
});
|
|
20
|
+
var ItemWrapper = exports.ItemWrapper = _styledComponents["default"].div.withConfig({
|
|
21
|
+
displayName: "styles__ItemWrapper",
|
|
22
|
+
componentId: "sc-gzjw07-1"
|
|
23
|
+
})(["display:inline-flex;flex:0 0 auto;max-width:100%;"]);
|
|
24
|
+
var TagLabel = exports.TagLabel = (0, _styledComponents["default"])(_Typography.Typography).withConfig({
|
|
25
|
+
displayName: "styles__TagLabel",
|
|
26
|
+
componentId: "sc-gzjw07-2"
|
|
27
|
+
})(["overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"]);
|
|
28
|
+
var TagRemove = exports.TagRemove = _styledComponents["default"].button.withConfig({
|
|
29
|
+
displayName: "styles__TagRemove",
|
|
30
|
+
componentId: "sc-gzjw07-3"
|
|
31
|
+
})(["display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:14px;height:14px;padding:0;border:none;background:none;color:inherit;font-size:16px;line-height:1;cursor:pointer;"]);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { TProps as TInputProps } from './components/Input';
|
|
3
|
+
import { TProps as TChipProps } from '../../common/Chip';
|
|
3
4
|
export type TOption<TValue> = {
|
|
4
5
|
label: string;
|
|
5
6
|
value: TValue;
|
|
@@ -11,9 +12,7 @@ export type TGroup = {
|
|
|
11
12
|
id: string;
|
|
12
13
|
entity?: unknown;
|
|
13
14
|
};
|
|
14
|
-
|
|
15
|
-
value: TValue | null;
|
|
16
|
-
onChange: (value: TValue | null) => void;
|
|
15
|
+
type TSharedProps<TValue> = Pick<TInputProps, 'label' | 'hasError' | 'placeholder' | 'name' | 'size' | 'onBlur' | 'required'> & {
|
|
17
16
|
options: TOption<TValue>[];
|
|
18
17
|
groups?: TGroup[];
|
|
19
18
|
isResetButtonEnabled?: boolean;
|
|
@@ -31,4 +30,18 @@ export type TProps<TValue> = Pick<TInputProps, 'label' | 'hasError' | 'placehold
|
|
|
31
30
|
dropdownWidth?: string;
|
|
32
31
|
useModernStyles?: boolean;
|
|
33
32
|
};
|
|
34
|
-
export
|
|
33
|
+
export type TProps<TValue> = TSharedProps<TValue> & {
|
|
34
|
+
isMultiple?: false;
|
|
35
|
+
value: TValue | null;
|
|
36
|
+
onChange: (value: TValue | null) => void;
|
|
37
|
+
};
|
|
38
|
+
export type TMultipleProps<TValue> = TSharedProps<TValue> & {
|
|
39
|
+
isMultiple: true;
|
|
40
|
+
value: TValue[];
|
|
41
|
+
onChange: (value: TValue[]) => void;
|
|
42
|
+
collapseTags?: boolean;
|
|
43
|
+
chipProps?: Partial<Omit<TChipProps, 'label'>>;
|
|
44
|
+
};
|
|
45
|
+
type TAllProps<TValue> = TProps<TValue> | TMultipleProps<TValue>;
|
|
46
|
+
export declare const Select: <TValue extends string | number>(props: TAllProps<TValue>) => import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
export {};
|
|
@@ -16,9 +16,15 @@ var _palette = require("../../../palette");
|
|
|
16
16
|
var _useOptionGroups = require("./hooks/useOptionGroups");
|
|
17
17
|
var _Drawer = require("../../common/Drawer");
|
|
18
18
|
var _Loader = _interopRequireDefault(require("./components/Loader"));
|
|
19
|
+
var _MultipleValue = require("./components/MultipleValue");
|
|
20
|
+
var _Checkbox = require("../Checkbox");
|
|
19
21
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
20
22
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
21
23
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
24
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
25
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
26
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
27
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
22
28
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
23
29
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
24
30
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
@@ -27,37 +33,43 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
27
33
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
28
34
|
var MAX_LIST_HEIGHT = 294;
|
|
29
35
|
var OPTION_IDENTIFIER = 'option-identifier';
|
|
30
|
-
var Select = exports.Select = function Select(
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
groups =
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
usePadding =
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
36
|
+
var Select = exports.Select = function Select(props) {
|
|
37
|
+
var _collapseTags;
|
|
38
|
+
var label = props.label,
|
|
39
|
+
hasError = props.hasError,
|
|
40
|
+
placeholder = props.placeholder,
|
|
41
|
+
name = props.name,
|
|
42
|
+
value = props.value,
|
|
43
|
+
renderValue = props.renderValue,
|
|
44
|
+
onChange = props.onChange,
|
|
45
|
+
options = props.options,
|
|
46
|
+
_props$groups = props.groups,
|
|
47
|
+
groups = _props$groups === void 0 ? [] : _props$groups,
|
|
48
|
+
_props$isResetButtonE = props.isResetButtonEnabled,
|
|
49
|
+
isResetButtonEnabled = _props$isResetButtonE === void 0 ? false : _props$isResetButtonE,
|
|
50
|
+
size = props.size,
|
|
51
|
+
renderOption = props.renderOption,
|
|
52
|
+
dropdownHeader = props.dropdownHeader,
|
|
53
|
+
_props$isDrawerOption = props.isDrawerOptions,
|
|
54
|
+
isDrawerOptions = _props$isDrawerOption === void 0 ? false : _props$isDrawerOption,
|
|
55
|
+
renderGroup = props.renderGroup,
|
|
56
|
+
_props$scrollbarMaxHe = props.scrollbarMaxHeight,
|
|
57
|
+
scrollbarMaxHeight = _props$scrollbarMaxHe === void 0 ? MAX_LIST_HEIGHT : _props$scrollbarMaxHe,
|
|
58
|
+
scrollbarHeader = props.scrollbarHeader,
|
|
59
|
+
emptyOptionsLabel = props.emptyOptionsLabel,
|
|
60
|
+
isLoading = props.isLoading,
|
|
61
|
+
onBlur = props.onBlur,
|
|
62
|
+
required = props.required,
|
|
63
|
+
_props$usePadding = props.usePadding,
|
|
64
|
+
usePadding = _props$usePadding === void 0 ? false : _props$usePadding,
|
|
65
|
+
dropdownWidth = props.dropdownWidth,
|
|
66
|
+
_props$useModernStyle = props.useModernStyles,
|
|
67
|
+
useModernStyles = _props$useModernStyle === void 0 ? false : _props$useModernStyle;
|
|
68
|
+
var isMultiple = props.isMultiple === true;
|
|
69
|
+
var collapseTags = isMultiple ? (_collapseTags = props.collapseTags) !== null && _collapseTags !== void 0 ? _collapseTags : false : false;
|
|
70
|
+
var chipProps = isMultiple ? props.chipProps : undefined;
|
|
71
|
+
var onChangeSingle = onChange;
|
|
72
|
+
var onChangeMultiple = onChange;
|
|
61
73
|
var palette = (0, _palette.useComponentPalette)('select');
|
|
62
74
|
var _useInputFocus = (0, _useInputFocus2.useInputFocus)({
|
|
63
75
|
onBlur: onBlur
|
|
@@ -84,11 +96,23 @@ var Select = exports.Select = function Select(_ref) {
|
|
|
84
96
|
*/
|
|
85
97
|
var delayBlur = (0, _react.useRef)(null);
|
|
86
98
|
var inputRef = (0, _react.useRef)(null);
|
|
99
|
+
var multipleValue = (0, _react.useMemo)(function () {
|
|
100
|
+
var _ref;
|
|
101
|
+
return isMultiple ? (_ref = value) !== null && _ref !== void 0 ? _ref : [] : [];
|
|
102
|
+
}, [isMultiple, value]);
|
|
87
103
|
var selectedOption = (0, _react.useMemo)(function () {
|
|
88
|
-
return options.find(function (option) {
|
|
104
|
+
return isMultiple ? undefined : options.find(function (option) {
|
|
89
105
|
return option.value === value;
|
|
90
106
|
});
|
|
91
|
-
}, [options, value]);
|
|
107
|
+
}, [isMultiple, options, value]);
|
|
108
|
+
var selectedOptions = (0, _react.useMemo)(function () {
|
|
109
|
+
return isMultiple ? options.filter(function (option) {
|
|
110
|
+
return multipleValue.includes(option.value);
|
|
111
|
+
}) : [];
|
|
112
|
+
}, [isMultiple, options, multipleValue]);
|
|
113
|
+
var selectedValuesSet = (0, _react.useMemo)(function () {
|
|
114
|
+
return new Set(multipleValue);
|
|
115
|
+
}, [multipleValue]);
|
|
92
116
|
var optionGroups = (0, _useOptionGroups.useOptionGroups)(options, groups);
|
|
93
117
|
var handleShow = (0, _react.useCallback)(function () {
|
|
94
118
|
return setIsOpen(true);
|
|
@@ -115,16 +139,29 @@ var Select = exports.Select = function Select(_ref) {
|
|
|
115
139
|
}, [blurHandler]);
|
|
116
140
|
var handleSelect = (0, _react.useCallback)(function (event) {
|
|
117
141
|
var newValue = JSON.parse(event.currentTarget.dataset.value);
|
|
118
|
-
|
|
142
|
+
if (isMultiple) {
|
|
143
|
+
var next = multipleValue.includes(newValue) ? multipleValue.filter(function (item) {
|
|
144
|
+
return item !== newValue;
|
|
145
|
+
}) : [].concat(_toConsumableArray(multipleValue), [newValue]);
|
|
146
|
+
onChangeMultiple(next);
|
|
147
|
+
// при множественном выборе дропдаун остаётся открытым
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
onChangeSingle(newValue);
|
|
119
151
|
handleHide();
|
|
120
152
|
if (delayBlur.current) {
|
|
121
153
|
delayBlur.current();
|
|
122
154
|
delayBlur.current = null;
|
|
123
155
|
}
|
|
124
|
-
}, [handleHide,
|
|
156
|
+
}, [handleHide, isMultiple, multipleValue, onChangeMultiple, onChangeSingle]);
|
|
157
|
+
var handleRemoveTag = (0, _react.useCallback)(function (removedValue) {
|
|
158
|
+
return onChangeMultiple(multipleValue.filter(function (item) {
|
|
159
|
+
return item !== removedValue;
|
|
160
|
+
}));
|
|
161
|
+
}, [multipleValue, onChangeMultiple]);
|
|
125
162
|
var handleReset = (0, _react.useCallback)(function () {
|
|
126
|
-
return
|
|
127
|
-
}, [
|
|
163
|
+
return isMultiple ? onChangeMultiple([]) : onChangeSingle(null);
|
|
164
|
+
}, [isMultiple, onChangeMultiple, onChangeSingle]);
|
|
128
165
|
var handleInputClick = function handleInputClick() {
|
|
129
166
|
var _inputRef$current;
|
|
130
167
|
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.blur();
|
|
@@ -140,8 +177,9 @@ var Select = exports.Select = function Select(_ref) {
|
|
|
140
177
|
return renderOption(option.entity);
|
|
141
178
|
}
|
|
142
179
|
return /*#__PURE__*/_react["default"].createElement(S.DefaultOptionWrapper, {
|
|
143
|
-
$usePadding: usePadding
|
|
144
|
-
|
|
180
|
+
$usePadding: usePadding,
|
|
181
|
+
$isMultiple: isMultiple
|
|
182
|
+
}, option.label);
|
|
145
183
|
};
|
|
146
184
|
var handleGroupRender = function handleGroupRender(group) {
|
|
147
185
|
if (group) {
|
|
@@ -176,8 +214,12 @@ var Select = exports.Select = function Select(_ref) {
|
|
|
176
214
|
"data-value": JSON.stringify(option.value),
|
|
177
215
|
"data-option-identifier": OPTION_IDENTIFIER,
|
|
178
216
|
$isGrouped: !!group && !renderOption,
|
|
179
|
-
$usePadding: usePadding
|
|
180
|
-
|
|
217
|
+
$usePadding: usePadding,
|
|
218
|
+
$isSelected: !isMultiple && option.value === value
|
|
219
|
+
}, isMultiple ? /*#__PURE__*/_react["default"].createElement(S.OptionContent, null, /*#__PURE__*/_react["default"].createElement(S.CheckboxWrapper, null, /*#__PURE__*/_react["default"].createElement(_Checkbox.Checkbox, {
|
|
220
|
+
checked: selectedValuesSet.has(option.value),
|
|
221
|
+
readOnly: true
|
|
222
|
+
})), handleOptionRender(option)) : handleOptionRender(option)));
|
|
181
223
|
}));
|
|
182
224
|
}));
|
|
183
225
|
var emptyLabel = /*#__PURE__*/_react["default"].createElement(S.DefaultOptionWrapper, null, /*#__PURE__*/_react["default"].createElement(S.EmptyLabel, {
|
|
@@ -208,20 +250,32 @@ var Select = exports.Select = function Select(_ref) {
|
|
|
208
250
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, dropdownHeader, " ", emptyLabel);
|
|
209
251
|
};
|
|
210
252
|
var renderedValue = (0, _react.useMemo)(function () {
|
|
253
|
+
if (isMultiple) {
|
|
254
|
+
if (!selectedOptions.length) return;
|
|
255
|
+
return /*#__PURE__*/_react["default"].createElement(_MultipleValue.MultipleValue, {
|
|
256
|
+
selectedOptions: selectedOptions,
|
|
257
|
+
onRemove: handleRemoveTag,
|
|
258
|
+
collapse: collapseTags,
|
|
259
|
+
chipProps: chipProps
|
|
260
|
+
});
|
|
261
|
+
}
|
|
211
262
|
if (!renderValue || !(selectedOption !== null && selectedOption !== void 0 && selectedOption.entity)) return;
|
|
212
263
|
return renderValue(selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.entity);
|
|
213
|
-
}, [renderValue, selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.entity]);
|
|
264
|
+
}, [isMultiple, selectedOptions, handleRemoveTag, collapseTags, chipProps, renderValue, selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.entity]);
|
|
265
|
+
var inputValue = isMultiple ? selectedOptions.map(function (option) {
|
|
266
|
+
return option.label;
|
|
267
|
+
}).join(', ') : (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label) || '';
|
|
214
268
|
return /*#__PURE__*/_react["default"].createElement(S.Wrapper, {
|
|
215
269
|
ref: isDrawerOptions ? undefined : wrapperRef
|
|
216
270
|
}, /*#__PURE__*/_react["default"].createElement(S.InputWrapper, null, /*#__PURE__*/_react["default"].createElement(_Input.Input, {
|
|
217
271
|
ref: inputRef,
|
|
218
272
|
label: label,
|
|
219
273
|
hasError: hasError,
|
|
220
|
-
inFocus: inFocus,
|
|
274
|
+
inFocus: isMultiple ? isOpen : inFocus,
|
|
221
275
|
placeholder: placeholder,
|
|
222
276
|
onFocus: isDrawerOptions ? undefined : handleFocus,
|
|
223
277
|
onBlur: isDrawerOptions ? undefined : handleBlur,
|
|
224
|
-
value:
|
|
278
|
+
value: inputValue,
|
|
225
279
|
renderedValue: renderedValue,
|
|
226
280
|
name: name,
|
|
227
281
|
isOpen: isOpen,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Select, TProps } from '.';
|
|
2
|
+
import { Select, TProps, TMultipleProps } from '.';
|
|
3
3
|
declare const meta: Meta<typeof Select>;
|
|
4
4
|
export default meta;
|
|
5
5
|
export declare const Default: StoryObj<TProps<string>>;
|
|
@@ -10,3 +10,5 @@ export declare const WithGroups: StoryObj<TProps<string>>;
|
|
|
10
10
|
export declare const RenderOptionWithGroups: StoryObj<TProps<string>>;
|
|
11
11
|
export declare const WithCustomGroups: StoryObj<TProps<string>>;
|
|
12
12
|
export declare const WithRenderedValue: StoryObj<TProps<string>>;
|
|
13
|
+
export declare const Multiple: StoryObj<TMultipleProps<string>>;
|
|
14
|
+
export declare const MultipleCollapsed: StoryObj<TMultipleProps<string>>;
|
|
@@ -4,7 +4,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports["default"] = exports.WithRenderedValue = exports.WithGroups = exports.WithDropdownHeader = exports.WithCustomGroups = exports.RenderOptionWithGroups = exports.RenderOption = exports.EmptyOptions = exports.Default = void 0;
|
|
7
|
+
exports["default"] = exports.WithRenderedValue = exports.WithGroups = exports.WithDropdownHeader = exports.WithCustomGroups = exports.RenderOptionWithGroups = exports.RenderOption = exports.MultipleCollapsed = exports.Multiple = exports.EmptyOptions = exports.Default = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _addonActions = require("@storybook/addon-actions");
|
|
10
10
|
var _ = require(".");
|
|
@@ -247,4 +247,35 @@ var WithRenderedValue = exports.WithRenderedValue = {
|
|
|
247
247
|
renderValue: renderValue
|
|
248
248
|
}),
|
|
249
249
|
render: Component
|
|
250
|
+
};
|
|
251
|
+
var MultipleComponent = function MultipleComponent(props) {
|
|
252
|
+
var _useState3 = (0, _react.useState)([]),
|
|
253
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
254
|
+
value = _useState4[0],
|
|
255
|
+
setValue = _useState4[1];
|
|
256
|
+
var handleChange = (0, _react.useCallback)(function (newValue) {
|
|
257
|
+
setValue(newValue);
|
|
258
|
+
(0, _addonActions.action)('onChange')(newValue);
|
|
259
|
+
}, []);
|
|
260
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
261
|
+
style: {
|
|
262
|
+
maxWidth: 360
|
|
263
|
+
}
|
|
264
|
+
}, /*#__PURE__*/_react["default"].createElement(_.Select, _extends({}, props, {
|
|
265
|
+
value: value,
|
|
266
|
+
onChange: handleChange
|
|
267
|
+
})));
|
|
268
|
+
};
|
|
269
|
+
var Multiple = exports.Multiple = {
|
|
270
|
+
args: _objectSpread(_objectSpread({}, COMMON_ARGS), {}, {
|
|
271
|
+
isMultiple: true
|
|
272
|
+
}),
|
|
273
|
+
render: MultipleComponent
|
|
274
|
+
};
|
|
275
|
+
var MultipleCollapsed = exports.MultipleCollapsed = {
|
|
276
|
+
args: _objectSpread(_objectSpread({}, COMMON_ARGS), {}, {
|
|
277
|
+
isMultiple: true,
|
|
278
|
+
collapseTags: true
|
|
279
|
+
}),
|
|
280
|
+
render: MultipleComponent
|
|
250
281
|
};
|
|
@@ -9,6 +9,8 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default":
|
|
|
9
9
|
var generateSelectPalette = exports.generateSelectPalette = function generateSelectPalette(abstractPalette) {
|
|
10
10
|
return {
|
|
11
11
|
bgHover: (0, _hexToRgba["default"])(abstractPalette.neutralUsual, 0.5),
|
|
12
|
-
empty: abstractPalette.neutralFoggy
|
|
12
|
+
empty: abstractPalette.neutralFoggy,
|
|
13
|
+
tagColor: '#6590FD',
|
|
14
|
+
tagBg: (0, _hexToRgba["default"])('#6590FD', 0.16)
|
|
13
15
|
};
|
|
14
16
|
};
|
|
@@ -9,10 +9,12 @@ export declare const Option: import("styled-components/dist/types").IStyledCompo
|
|
|
9
9
|
$palette: TSelectPalette;
|
|
10
10
|
$isGrouped: boolean;
|
|
11
11
|
$usePadding: boolean;
|
|
12
|
+
$isSelected?: boolean | undefined;
|
|
12
13
|
}>> & string & Omit<import("react").FC<import("../../common/Typography").TTypographyProps>, keyof import("react").Component<any, {}, any>>;
|
|
13
14
|
export declare const Group: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("../../common/Typography").TTypographyProps & import("styled-components/dist/types").BaseObject, import("styled-components/dist/types").BaseObject>> & string & Omit<import("react").FC<import("../../common/Typography").TTypographyProps>, keyof import("react").Component<any, {}, any>>;
|
|
14
15
|
export declare const DefaultOptionWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
15
16
|
$usePadding?: boolean | undefined;
|
|
17
|
+
$isMultiple?: boolean | undefined;
|
|
16
18
|
}>> & string;
|
|
17
19
|
export declare const DrawerContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
18
20
|
export declare const DrawerBottom: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
@@ -20,3 +22,5 @@ export declare const EmptyLabel: import("styled-components/dist/types").IStyledC
|
|
|
20
22
|
$color: string;
|
|
21
23
|
}>> & string & Omit<import("react").FC<import("../../common/Typography").TTypographyProps>, keyof import("react").Component<any, {}, any>>;
|
|
22
24
|
export declare const ScrollbarContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
25
|
+
export declare const OptionContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
26
|
+
export declare const CheckboxWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
@@ -4,7 +4,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.Wrapper = exports.ScrollbarContent = exports.OptionWrapper = exports.Option = exports.InputWrapper = exports.Group = exports.EmptyLabel = exports.DrawerContent = exports.DrawerBottom = exports.DefaultOptionWrapper = void 0;
|
|
7
|
+
exports.Wrapper = exports.ScrollbarContent = exports.OptionWrapper = exports.OptionContent = exports.Option = exports.InputWrapper = exports.Group = exports.EmptyLabel = exports.DrawerContent = exports.DrawerBottom = exports.DefaultOptionWrapper = exports.CheckboxWrapper = void 0;
|
|
8
8
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
9
|
var _Typography = require("../../common/Typography");
|
|
10
10
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
@@ -27,14 +27,18 @@ var OptionWrapper = exports.OptionWrapper = _styledComponents["default"].div.wit
|
|
|
27
27
|
var Option = exports.Option = (0, _styledComponents["default"])(_Typography.Typography).withConfig({
|
|
28
28
|
displayName: "styles__Option",
|
|
29
29
|
componentId: "sc-1x9n0z5-3"
|
|
30
|
-
})(["overflow:hidden;width:100%;text-align:left;transition:all 0.2s ease-in-out 0s;box-sizing:border-box;cursor:pointer;border-radius:", "
|
|
30
|
+
})(["overflow:hidden;width:100%;text-align:left;transition:all 0.2s ease-in-out 0s;box-sizing:border-box;cursor:pointer;border-radius:", ";", " &:hover{background-color:", ";}", ""], function (_ref2) {
|
|
31
31
|
var $usePadding = _ref2.$usePadding;
|
|
32
32
|
return $usePadding ? '12px' : 'none';
|
|
33
33
|
}, function (_ref3) {
|
|
34
|
-
var $
|
|
35
|
-
|
|
34
|
+
var $isSelected = _ref3.$isSelected,
|
|
35
|
+
$palette = _ref3.$palette;
|
|
36
|
+
return $isSelected && (0, _styledComponents.css)(["background-color:", ";border-radius:8px;"], $palette.bgHover);
|
|
36
37
|
}, function (_ref4) {
|
|
37
|
-
var $
|
|
38
|
+
var $palette = _ref4.$palette;
|
|
39
|
+
return $palette.bgHover;
|
|
40
|
+
}, function (_ref5) {
|
|
41
|
+
var $isGrouped = _ref5.$isGrouped;
|
|
38
42
|
return $isGrouped && (0, _styledComponents.css)(["padding-left:30px;"]);
|
|
39
43
|
});
|
|
40
44
|
var Group = exports.Group = (0, _styledComponents["default"])(_Typography.Typography).withConfig({
|
|
@@ -44,9 +48,13 @@ var Group = exports.Group = (0, _styledComponents["default"])(_Typography.Typogr
|
|
|
44
48
|
var DefaultOptionWrapper = exports.DefaultOptionWrapper = _styledComponents["default"].div.withConfig({
|
|
45
49
|
displayName: "styles__DefaultOptionWrapper",
|
|
46
50
|
componentId: "sc-1x9n0z5-5"
|
|
47
|
-
})(["padding:", ";"], function (
|
|
48
|
-
var $usePadding =
|
|
51
|
+
})(["padding:", ";padding-left:", ";"], function (_ref6) {
|
|
52
|
+
var $usePadding = _ref6.$usePadding;
|
|
49
53
|
return $usePadding ? '12px' : '12px 20px';
|
|
54
|
+
}, function (_ref7) {
|
|
55
|
+
var $isMultiple = _ref7.$isMultiple,
|
|
56
|
+
$usePadding = _ref7.$usePadding;
|
|
57
|
+
return $isMultiple && !$usePadding ? '6px' : undefined;
|
|
50
58
|
});
|
|
51
59
|
var DrawerContent = exports.DrawerContent = _styledComponents["default"].div.withConfig({
|
|
52
60
|
displayName: "styles__DrawerContent",
|
|
@@ -59,11 +67,19 @@ var DrawerBottom = exports.DrawerBottom = _styledComponents["default"].div.withC
|
|
|
59
67
|
var EmptyLabel = exports.EmptyLabel = (0, _styledComponents["default"])(_Typography.Typography).withConfig({
|
|
60
68
|
displayName: "styles__EmptyLabel",
|
|
61
69
|
componentId: "sc-1x9n0z5-8"
|
|
62
|
-
})(["color:", ";"], function (
|
|
63
|
-
var $color =
|
|
70
|
+
})(["color:", ";"], function (_ref8) {
|
|
71
|
+
var $color = _ref8.$color;
|
|
64
72
|
return $color;
|
|
65
73
|
});
|
|
66
74
|
var ScrollbarContent = exports.ScrollbarContent = _styledComponents["default"].div.withConfig({
|
|
67
75
|
displayName: "styles__ScrollbarContent",
|
|
68
76
|
componentId: "sc-1x9n0z5-9"
|
|
69
|
-
})([""]);
|
|
77
|
+
})([""]);
|
|
78
|
+
var OptionContent = exports.OptionContent = _styledComponents["default"].div.withConfig({
|
|
79
|
+
displayName: "styles__OptionContent",
|
|
80
|
+
componentId: "sc-1x9n0z5-10"
|
|
81
|
+
})(["display:flex;align-items:center;gap:8px;padding-left:16px;"]);
|
|
82
|
+
var CheckboxWrapper = exports.CheckboxWrapper = _styledComponents["default"].div.withConfig({
|
|
83
|
+
displayName: "styles__CheckboxWrapper",
|
|
84
|
+
componentId: "sc-1x9n0z5-11"
|
|
85
|
+
})(["flex:0 0 auto;pointer-events:none;"]);
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
7
|
+
import React, { useCallback, useRef, useState } from 'react';
|
|
8
|
+
import { createPortal } from 'react-dom';
|
|
9
|
+
import { Typography } from '../Typography';
|
|
10
|
+
import { useComponentPalette } from '../../../palette';
|
|
11
|
+
import * as S from './styles';
|
|
12
|
+
export var Tooltip = function Tooltip(_ref) {
|
|
13
|
+
var overlay = _ref.overlay,
|
|
14
|
+
_ref$placement = _ref.placement,
|
|
15
|
+
placement = _ref$placement === void 0 ? 'top' : _ref$placement,
|
|
16
|
+
_ref$gap = _ref.gap,
|
|
17
|
+
gap = _ref$gap === void 0 ? 8 : _ref$gap,
|
|
18
|
+
children = _ref.children;
|
|
19
|
+
var palette = useComponentPalette('tooltip');
|
|
20
|
+
var triggerRef = useRef(null);
|
|
21
|
+
var _useState = useState(null),
|
|
22
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
23
|
+
coords = _useState2[0],
|
|
24
|
+
setCoords = _useState2[1];
|
|
25
|
+
var show = useCallback(function () {
|
|
26
|
+
var el = triggerRef.current;
|
|
27
|
+
if (!el || !overlay) return;
|
|
28
|
+
var rect = el.getBoundingClientRect();
|
|
29
|
+
setCoords({
|
|
30
|
+
top: placement === 'top' ? rect.top - gap : rect.bottom + gap,
|
|
31
|
+
left: rect.left + rect.width / 2
|
|
32
|
+
});
|
|
33
|
+
}, [overlay, placement, gap]);
|
|
34
|
+
var hide = useCallback(function () {
|
|
35
|
+
return setCoords(null);
|
|
36
|
+
}, []);
|
|
37
|
+
return /*#__PURE__*/React.createElement(S.Trigger, {
|
|
38
|
+
ref: triggerRef,
|
|
39
|
+
onMouseEnter: show,
|
|
40
|
+
onMouseLeave: hide,
|
|
41
|
+
onFocus: show,
|
|
42
|
+
onBlur: hide
|
|
43
|
+
}, children, coords && /*#__PURE__*/createPortal(/*#__PURE__*/React.createElement(S.Overlay, {
|
|
44
|
+
$palette: palette,
|
|
45
|
+
$top: coords.top,
|
|
46
|
+
$left: coords.left,
|
|
47
|
+
$placement: placement
|
|
48
|
+
}, typeof overlay === 'string' ? /*#__PURE__*/React.createElement(Typography, {
|
|
49
|
+
variant: "captionRegular"
|
|
50
|
+
}, overlay) : overlay), document.body));
|
|
51
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Tooltip } from '.';
|
|
3
|
+
var meta = {
|
|
4
|
+
title: 'common/Tooltip',
|
|
5
|
+
component: Tooltip,
|
|
6
|
+
tags: ['autodocs']
|
|
7
|
+
};
|
|
8
|
+
export default meta;
|
|
9
|
+
var Component = function Component(props) {
|
|
10
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
11
|
+
style: {
|
|
12
|
+
padding: 80,
|
|
13
|
+
display: 'flex',
|
|
14
|
+
justifyContent: 'center'
|
|
15
|
+
}
|
|
16
|
+
}, /*#__PURE__*/React.createElement(Tooltip, props, /*#__PURE__*/React.createElement("span", {
|
|
17
|
+
style: {
|
|
18
|
+
border: '1px dashed #999',
|
|
19
|
+
padding: 8
|
|
20
|
+
}
|
|
21
|
+
}, "\u041D\u0430\u0432\u0435\u0434\u0438 \u043D\u0430 \u043C\u0435\u043D\u044F")));
|
|
22
|
+
};
|
|
23
|
+
export var Top = {
|
|
24
|
+
args: {
|
|
25
|
+
overlay: 'Подсказка сверху',
|
|
26
|
+
placement: 'top'
|
|
27
|
+
},
|
|
28
|
+
render: Component
|
|
29
|
+
};
|
|
30
|
+
export var Bottom = {
|
|
31
|
+
args: {
|
|
32
|
+
overlay: 'Подсказка снизу',
|
|
33
|
+
placement: 'bottom'
|
|
34
|
+
},
|
|
35
|
+
render: Component
|
|
36
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
export var Trigger = styled.span.withConfig({
|
|
3
|
+
displayName: "styles__Trigger",
|
|
4
|
+
componentId: "sc-153dwvc-0"
|
|
5
|
+
})(["display:inline-flex;"]);
|
|
6
|
+
export var Overlay = styled.div.withConfig({
|
|
7
|
+
displayName: "styles__Overlay",
|
|
8
|
+
componentId: "sc-153dwvc-1"
|
|
9
|
+
})(["position:fixed;z-index:9999;top:", "px;left:", "px;transform:", ";box-sizing:border-box;min-height:28px;padding:4px 6px;border-radius:10px;background-color:", ";color:", ";box-shadow:", ";pointer-events:none;max-width:240px;"], function (_ref) {
|
|
10
|
+
var $top = _ref.$top;
|
|
11
|
+
return $top;
|
|
12
|
+
}, function (_ref2) {
|
|
13
|
+
var $left = _ref2.$left;
|
|
14
|
+
return $left;
|
|
15
|
+
}, function (_ref3) {
|
|
16
|
+
var $placement = _ref3.$placement;
|
|
17
|
+
return $placement === 'top' ? 'translate(-50%, -100%)' : 'translate(-50%, 0)';
|
|
18
|
+
}, function (_ref4) {
|
|
19
|
+
var $palette = _ref4.$palette;
|
|
20
|
+
return $palette.bg;
|
|
21
|
+
}, function (_ref5) {
|
|
22
|
+
var $palette = _ref5.$palette;
|
|
23
|
+
return $palette.color;
|
|
24
|
+
}, function (_ref6) {
|
|
25
|
+
var $palette = _ref6.$palette;
|
|
26
|
+
return $palette.shadow;
|
|
27
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export var CheckIcon = function CheckIcon(props) {
|
|
4
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
5
|
+
width: "12",
|
|
6
|
+
height: "11",
|
|
7
|
+
viewBox: "0 0 12 11",
|
|
8
|
+
fill: "none",
|
|
9
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
10
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
11
|
+
fillRule: "evenodd",
|
|
12
|
+
clipRule: "evenodd",
|
|
13
|
+
d: "M5.43158 10.0674C5.22406 10.3745 4.94736 10.5156 4.62744 10.5156C4.3075 10.5156 4.0481 10.3911 3.78006 10.0757L0.442444 6.19092C0.295471 6.0166 0.208984 5.79248 0.208984 5.58496C0.208984 5.14502 0.563507 4.82129 0.987183 4.82129C1.26389 4.82129 1.49734 4.9209 1.72217 5.19482L4.5842 8.63965L9.9624 0.430176C10.1526 0.147949 10.4034 0.00683594 10.6541 0.00683594C11.0778 0.00683594 11.4842 0.280762 11.4842 0.720703C11.4842 0.919922 11.3718 1.14404 11.2421 1.32666L5.43158 10.0674Z",
|
|
14
|
+
fill: "white"
|
|
15
|
+
}));
|
|
16
|
+
};
|