glints-aries 4.1.6 → 4.1.8
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/es/@next/Icon/components/RiIndeterminateCircleFill.d.ts +3 -0
- package/es/@next/Icon/components/RiIndeterminateCircleFill.js +11 -0
- package/es/@next/Icon/components/RiIndeterminateCircleLine.d.ts +3 -0
- package/es/@next/Icon/components/RiIndeterminateCircleLine.js +11 -0
- package/es/@next/Icon/components/index.d.ts +2 -0
- package/es/@next/Icon/components/index.js +2 -0
- package/es/@next/Icon/icons/icons.d.ts +1 -1
- package/es/@next/Icon/icons/icons.js +2 -2
- package/es/@next/Input/Input.d.ts +6 -0
- package/es/@next/Input/Input.js +22 -5
- package/es/@next/Input/InputStyle.d.ts +14 -2
- package/es/@next/Input/InputStyle.js +33 -3
- package/es/@next/NumberInput/NumberInput.d.ts +12 -2
- package/es/@next/NumberInput/NumberInput.js +14 -2
- package/es/@next/Pagination/PaginationStyle.d.ts +6 -1
- package/es/@next/PasswordInput/PasswordInput.d.ts +10 -0
- package/es/@next/PasswordInput/PasswordInput.js +12 -2
- package/es/@next/Select/Select.d.ts +6 -1
- package/es/@next/Select/Select.js +21 -7
- package/es/@next/Select/Select.stories.d.ts +2 -0
- package/es/@next/Select/components/Activator/ActivatorSelect.d.ts +7 -1
- package/es/@next/Select/components/Activator/ActivatorSelect.js +22 -7
- package/es/@next/Select/components/Activator/ActivatorStyle.d.ts +13 -0
- package/es/@next/Select/components/Activator/ActivatorStyle.js +16 -2
- package/es/@next/Select/components/Activator/ActivatorTextInput.d.ts +6 -1
- package/es/@next/Select/components/Activator/ActivatorTextInput.js +17 -3
- package/es/@next/Select/components/SearchableSelectInput/ClearSelected.d.ts +2 -1
- package/es/@next/Select/components/SearchableSelectInput/ClearSelected.js +5 -2
- package/es/@next/Select/components/SearchableSelectInput/SearchableSelectInput.d.ts +12 -0
- package/es/@next/Select/components/SearchableSelectInput/SearchableSelectInput.js +26 -8
- package/es/@next/Select/components/SearchableSelectInput/SearchableSelectInputStyle.d.ts +7 -1
- package/es/@next/Select/components/SearchableSelectInput/SearchableSelectInputStyle.js +4 -1
- package/es/@next/TextArea/TextArea.d.ts +10 -0
- package/es/@next/TextArea/TextArea.js +20 -4
- package/es/@next/TextArea/TextArea.stories.d.ts +1 -0
- package/es/@next/TextArea/TextAreaStyle.d.ts +3 -0
- package/es/@next/TextArea/TextAreaStyle.js +13 -3
- package/es/@next/TextInput/TextInput.d.ts +12 -0
- package/es/@next/TextInput/TextInput.js +14 -2
- package/es/@next/TextInput/TextInput.stories.d.ts +1 -0
- package/es/Input/PhoneNumberInput/PhoneNumberInput.d.ts +4 -1
- package/es/Input/PhoneNumberInput/PhoneNumberInput.js +12 -6
- package/es/Input/PhoneNumberInput/PhoneNumberInput.stories.d.ts +1 -0
- package/es/Input/PhoneNumberInput/PhoneNumberInputStyles.d.ts +3 -1
- package/es/Input/PhoneNumberInput/PhoneNumberInputStyles.js +9 -6
- package/lib/@next/Icon/components/RiIndeterminateCircleFill.d.ts +3 -0
- package/lib/@next/Icon/components/RiIndeterminateCircleFill.js +19 -0
- package/lib/@next/Icon/components/RiIndeterminateCircleLine.d.ts +3 -0
- package/lib/@next/Icon/components/RiIndeterminateCircleLine.js +19 -0
- package/lib/@next/Icon/components/index.d.ts +2 -0
- package/lib/@next/Icon/components/index.js +5 -1
- package/lib/@next/Icon/icons/icons.d.ts +1 -1
- package/lib/@next/Icon/icons/icons.js +2 -2
- package/lib/@next/Input/Input.d.ts +6 -0
- package/lib/@next/Input/Input.js +21 -4
- package/lib/@next/Input/InputStyle.d.ts +14 -2
- package/lib/@next/Input/InputStyle.js +37 -5
- package/lib/@next/NumberInput/NumberInput.d.ts +12 -2
- package/lib/@next/NumberInput/NumberInput.js +14 -2
- package/lib/@next/Pagination/PaginationStyle.d.ts +6 -1
- package/lib/@next/PasswordInput/PasswordInput.d.ts +10 -0
- package/lib/@next/PasswordInput/PasswordInput.js +12 -2
- package/lib/@next/Select/Select.d.ts +6 -1
- package/lib/@next/Select/Select.js +21 -7
- package/lib/@next/Select/Select.stories.d.ts +2 -0
- package/lib/@next/Select/components/Activator/ActivatorSelect.d.ts +7 -1
- package/lib/@next/Select/components/Activator/ActivatorSelect.js +21 -6
- package/lib/@next/Select/components/Activator/ActivatorStyle.d.ts +13 -0
- package/lib/@next/Select/components/Activator/ActivatorStyle.js +18 -3
- package/lib/@next/Select/components/Activator/ActivatorTextInput.d.ts +6 -1
- package/lib/@next/Select/components/Activator/ActivatorTextInput.js +17 -3
- package/lib/@next/Select/components/SearchableSelectInput/ClearSelected.d.ts +2 -1
- package/lib/@next/Select/components/SearchableSelectInput/ClearSelected.js +5 -2
- package/lib/@next/Select/components/SearchableSelectInput/SearchableSelectInput.d.ts +12 -0
- package/lib/@next/Select/components/SearchableSelectInput/SearchableSelectInput.js +25 -7
- package/lib/@next/Select/components/SearchableSelectInput/SearchableSelectInputStyle.d.ts +7 -1
- package/lib/@next/Select/components/SearchableSelectInput/SearchableSelectInputStyle.js +4 -1
- package/lib/@next/TextArea/TextArea.d.ts +10 -0
- package/lib/@next/TextArea/TextArea.js +20 -4
- package/lib/@next/TextArea/TextArea.stories.d.ts +1 -0
- package/lib/@next/TextArea/TextAreaStyle.d.ts +3 -0
- package/lib/@next/TextArea/TextAreaStyle.js +13 -3
- package/lib/@next/TextInput/TextInput.d.ts +12 -0
- package/lib/@next/TextInput/TextInput.js +14 -2
- package/lib/@next/TextInput/TextInput.stories.d.ts +1 -0
- package/lib/Input/PhoneNumberInput/PhoneNumberInput.d.ts +4 -1
- package/lib/Input/PhoneNumberInput/PhoneNumberInput.js +12 -6
- package/lib/Input/PhoneNumberInput/PhoneNumberInput.stories.d.ts +1 -0
- package/lib/Input/PhoneNumberInput/PhoneNumberInputStyles.d.ts +3 -1
- package/lib/Input/PhoneNumberInput/PhoneNumberInputStyles.js +9 -6
- package/package.json +1 -1
|
@@ -50,8 +50,13 @@ export interface SelectProps {
|
|
|
50
50
|
selectedValues?: string[];
|
|
51
51
|
/** sets a width for the Select component*/
|
|
52
52
|
width: string;
|
|
53
|
+
height?: string;
|
|
53
54
|
/** sets z-index override for option list dropdown. z-index default to 400 */
|
|
54
55
|
zIndexOverride?: number;
|
|
56
|
+
border?: string;
|
|
57
|
+
borderRadius?: string;
|
|
58
|
+
required?: boolean;
|
|
59
|
+
isPlaceholderFloating?: boolean;
|
|
55
60
|
}
|
|
56
|
-
export declare const Select: ({ allowMultiple, customActivatorIcon, disabled, hasError, helpText, label, listHeight, loadingOptions, name, onBlur, onClose, onFocus, onRemoveTag, onSelect, onSelectClick, optionListFitContent, options, placeholder, prefix, searchable, searchableProps, optionsPlaceholderProps, showPopoverOnFocus, scrollable, sections, selectedValues, width, zIndexOverride, }: SelectProps) => JSX.Element;
|
|
61
|
+
export declare const Select: ({ allowMultiple, customActivatorIcon, disabled, hasError, helpText, label, listHeight, loadingOptions, name, onBlur, onClose, onFocus, onRemoveTag, onSelect, onSelectClick, optionListFitContent, options, placeholder, prefix, searchable, searchableProps, optionsPlaceholderProps, showPopoverOnFocus, scrollable, sections, selectedValues, width, height, zIndexOverride, border, borderRadius, required, isPlaceholderFloating, }: SelectProps) => JSX.Element;
|
|
57
62
|
export {};
|
|
@@ -39,8 +39,7 @@ var Select = function Select(_ref) {
|
|
|
39
39
|
options = _ref$options === void 0 ? [] : _ref$options,
|
|
40
40
|
placeholder = _ref.placeholder,
|
|
41
41
|
prefix = _ref.prefix,
|
|
42
|
-
|
|
43
|
-
searchable = _ref$searchable === void 0 ? false : _ref$searchable,
|
|
42
|
+
searchable = _ref.searchable,
|
|
44
43
|
searchableProps = _ref.searchableProps,
|
|
45
44
|
optionsPlaceholderProps = _ref.optionsPlaceholderProps,
|
|
46
45
|
_ref$showPopoverOnFoc = _ref.showPopoverOnFocus,
|
|
@@ -50,14 +49,19 @@ var Select = function Select(_ref) {
|
|
|
50
49
|
sections = _ref.sections,
|
|
51
50
|
selectedValues = _ref.selectedValues,
|
|
52
51
|
width = _ref.width,
|
|
53
|
-
|
|
52
|
+
height = _ref.height,
|
|
53
|
+
zIndexOverride = _ref.zIndexOverride,
|
|
54
|
+
border = _ref.border,
|
|
55
|
+
borderRadius = _ref.borderRadius,
|
|
56
|
+
required = _ref.required,
|
|
57
|
+
isPlaceholderFloating = _ref.isPlaceholderFloating;
|
|
54
58
|
var _useState = (0, _react.useState)(false),
|
|
55
59
|
popoverActive = _useState[0],
|
|
56
60
|
setPopoverActive = _useState[1];
|
|
57
61
|
var _useState2 = (0, _react.useState)(''),
|
|
58
62
|
optionListHeight = _useState2[0],
|
|
59
63
|
setOptionListHeight = _useState2[1];
|
|
60
|
-
var _useState3 = (0, _react.useState)(
|
|
64
|
+
var _useState3 = (0, _react.useState)([]),
|
|
61
65
|
menuOptions = _useState3[0],
|
|
62
66
|
setMenuOptions = _useState3[1];
|
|
63
67
|
var optionsLength = options.length;
|
|
@@ -133,6 +137,7 @@ var Select = function Select(_ref) {
|
|
|
133
137
|
onChange: searchableProps == null ? void 0 : searchableProps.onInputChange,
|
|
134
138
|
placeholder: placeholder != null ? placeholder : 'Search',
|
|
135
139
|
width: width,
|
|
140
|
+
height: height,
|
|
136
141
|
selectedValues: selectedValues,
|
|
137
142
|
onBlur: onBlur,
|
|
138
143
|
onSelect: onSelect,
|
|
@@ -146,7 +151,11 @@ var Select = function Select(_ref) {
|
|
|
146
151
|
options: options,
|
|
147
152
|
updateMenuOptions: updateMenuOptions,
|
|
148
153
|
prefix: prefix,
|
|
149
|
-
name: name
|
|
154
|
+
name: name,
|
|
155
|
+
isPlaceholderFloating: isPlaceholderFloating,
|
|
156
|
+
required: required,
|
|
157
|
+
border: border,
|
|
158
|
+
borderRadius: borderRadius
|
|
150
159
|
});
|
|
151
160
|
}
|
|
152
161
|
return /*#__PURE__*/_react["default"].createElement(_ActivatorSelect.ActivatorSelect, {
|
|
@@ -159,18 +168,23 @@ var Select = function Select(_ref) {
|
|
|
159
168
|
onRemoveTag: onRemoveTag,
|
|
160
169
|
onSelectClick: handleSelectClick,
|
|
161
170
|
width: width,
|
|
171
|
+
height: height,
|
|
162
172
|
selectedValues: selectedValues,
|
|
163
173
|
options: options,
|
|
164
174
|
name: name,
|
|
165
175
|
prefix: prefix,
|
|
166
|
-
onClick: onSelectClick
|
|
176
|
+
onClick: onSelectClick,
|
|
177
|
+
required: required,
|
|
178
|
+
border: border,
|
|
179
|
+
borderRadius: borderRadius,
|
|
180
|
+
isPlaceholderFloating: isPlaceholderFloating
|
|
167
181
|
});
|
|
168
182
|
};
|
|
169
183
|
return /*#__PURE__*/_react["default"].createElement(_Popover.Popover, {
|
|
170
184
|
active: popoverActive,
|
|
171
185
|
activator: /*#__PURE__*/_react["default"].createElement(_SelectStyle.ActivatorWrapper, {
|
|
172
186
|
width: width
|
|
173
|
-
}, label && /*#__PURE__*/_react["default"].createElement(_Label.Label, null, label), activator(), helpText && /*#__PURE__*/_react["default"].createElement(_SelectStyle.HelpTextContainer, null, /*#__PURE__*/_react["default"].createElement(_Typography.Typography, {
|
|
187
|
+
}, label && !isPlaceholderFloating && /*#__PURE__*/_react["default"].createElement(_Label.Label, null, label), activator(), helpText && /*#__PURE__*/_react["default"].createElement(_SelectStyle.HelpTextContainer, null, /*#__PURE__*/_react["default"].createElement(_Typography.Typography, {
|
|
174
188
|
as: "span",
|
|
175
189
|
variant: "subtitle2",
|
|
176
190
|
color: disabled ? _colors.Neutral.B85 : _colors.Neutral.B40
|
|
@@ -2,7 +2,9 @@ import { Meta } from '@storybook/react';
|
|
|
2
2
|
declare const _default: Meta<import("@storybook/react").Args>;
|
|
3
3
|
export default _default;
|
|
4
4
|
export declare const NonSearchableSingleSelect: any;
|
|
5
|
+
export declare const NonSearchableSingleSelectWithFloatingPlaceholder: any;
|
|
5
6
|
export declare const NonSearchableMultipleSelect: any;
|
|
7
|
+
export declare const NonSearchableMultipleSelectWithFloatingPlaceholder: any;
|
|
6
8
|
export declare const WithErrorNonSearchable: any;
|
|
7
9
|
export declare const NonSearchableDisabled: any;
|
|
8
10
|
export declare const NonSearchablePrefixed: any;
|
|
@@ -14,5 +14,11 @@ export interface ActivatorSelectProps extends Omit<React.ButtonHTMLAttributes<HT
|
|
|
14
14
|
onSelectClick?(): void;
|
|
15
15
|
options?: Option[];
|
|
16
16
|
width?: string;
|
|
17
|
+
height?: string;
|
|
18
|
+
required?: boolean;
|
|
19
|
+
floatingFontSize?: string;
|
|
20
|
+
isPlaceholderFloating?: boolean;
|
|
21
|
+
border?: string;
|
|
22
|
+
borderRadius?: string;
|
|
17
23
|
}
|
|
18
|
-
export declare const ActivatorSelect: ({ customActivatorIcon, placeholder, selectedValues, onClick, onRemoveTag, width, allowMultiple, disabled, onSelectClick, hasError, options, prefix, ...props }: ActivatorSelectProps) => JSX.Element;
|
|
24
|
+
export declare const ActivatorSelect: ({ customActivatorIcon, placeholder, selectedValues, onClick, onRemoveTag, width, allowMultiple, disabled, onSelectClick, hasError, options, prefix, required, border, borderRadius, height, floatingFontSize, isPlaceholderFloating, ...props }: ActivatorSelectProps) => JSX.Element;
|
|
@@ -9,7 +9,8 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
var _Typography = require("../../../Typography");
|
|
10
10
|
var _colors = require("../../../utilities/colors");
|
|
11
11
|
var _ActivatorStyle = require("./ActivatorStyle");
|
|
12
|
-
var
|
|
12
|
+
var _InputStyle = require("../../../Input/InputStyle");
|
|
13
|
+
var _excluded = ["customActivatorIcon", "placeholder", "selectedValues", "onClick", "onRemoveTag", "width", "allowMultiple", "disabled", "onSelectClick", "hasError", "options", "prefix", "required", "border", "borderRadius", "height", "floatingFontSize", "isPlaceholderFloating"];
|
|
13
14
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
15
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
16
|
var ActivatorSelect = function ActivatorSelect(_ref) {
|
|
@@ -28,6 +29,12 @@ var ActivatorSelect = function ActivatorSelect(_ref) {
|
|
|
28
29
|
hasError = _ref$hasError === void 0 ? false : _ref$hasError,
|
|
29
30
|
options = _ref.options,
|
|
30
31
|
prefix = _ref.prefix,
|
|
32
|
+
required = _ref.required,
|
|
33
|
+
border = _ref.border,
|
|
34
|
+
borderRadius = _ref.borderRadius,
|
|
35
|
+
height = _ref.height,
|
|
36
|
+
floatingFontSize = _ref.floatingFontSize,
|
|
37
|
+
isPlaceholderFloating = _ref.isPlaceholderFloating,
|
|
31
38
|
props = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
|
|
32
39
|
var _useState = (0, _react.useState)([]),
|
|
33
40
|
filteredValues = _useState[0],
|
|
@@ -56,11 +63,12 @@ var ActivatorSelect = function ActivatorSelect(_ref) {
|
|
|
56
63
|
onSelectClick();
|
|
57
64
|
onClick == null ? void 0 : onClick(e);
|
|
58
65
|
};
|
|
59
|
-
var
|
|
66
|
+
var selectedPlaceholder = required ? placeholder + "*" : placeholder;
|
|
67
|
+
var placeholderMarkup = isPlaceholderFloating ? undefined : /*#__PURE__*/_react["default"].createElement(_Typography.Typography, {
|
|
60
68
|
variant: "body1",
|
|
61
69
|
as: "span",
|
|
62
70
|
color: disabled ? _colors.Neutral.B85 : _colors.Neutral.B68
|
|
63
|
-
},
|
|
71
|
+
}, selectedPlaceholder);
|
|
64
72
|
var tagsMarkup = function tagsMarkup() {
|
|
65
73
|
if (!hasSelectedValues) {
|
|
66
74
|
return placeholderMarkup;
|
|
@@ -83,15 +91,22 @@ var ActivatorSelect = function ActivatorSelect(_ref) {
|
|
|
83
91
|
"data-error": hasError,
|
|
84
92
|
onClick: handleClick,
|
|
85
93
|
disabled: disabled,
|
|
86
|
-
width: width
|
|
94
|
+
width: width,
|
|
95
|
+
height: height,
|
|
96
|
+
border: border,
|
|
97
|
+
borderRadius: borderRadius,
|
|
98
|
+
isPlaceholderFloating: isPlaceholderFloating
|
|
87
99
|
}), /*#__PURE__*/_react["default"].createElement(_ActivatorStyle.WithPrefixContainer, null, prefix && /*#__PURE__*/_react["default"].createElement(_ActivatorStyle.StyledPrefixContainer, null, prefix), allowMultiple ? tagsMarkup() : /*#__PURE__*/_react["default"].createElement(_ActivatorStyle.StyledSelectTypography, {
|
|
88
100
|
variant: "body1",
|
|
89
101
|
"data-disabled": disabled,
|
|
90
102
|
color: hasSelectedValues ? _colors.Neutral.B18 : _colors.Neutral.B40
|
|
91
|
-
}, hasSelectedValues ? selectedLabels[0] : placeholderMarkup)), /*#__PURE__*/_react["default"].createElement(_ActivatorStyle.StyledIcon, {
|
|
103
|
+
}, hasSelectedValues ? selectedLabels[0] : placeholderMarkup)), /*#__PURE__*/_react["default"].createElement(_ActivatorStyle.SuffixContainer, null, /*#__PURE__*/_react["default"].createElement(_ActivatorStyle.StyledIcon, {
|
|
92
104
|
height: 24,
|
|
93
105
|
name: customActivatorIcon || 'ri-arrow-m-down-line',
|
|
94
106
|
fill: disabled ? _colors.Neutral.B85 : _colors.Neutral.B40
|
|
95
|
-
}))
|
|
107
|
+
})), isPlaceholderFloating && /*#__PURE__*/_react["default"].createElement(_InputStyle.FloatingLabel, {
|
|
108
|
+
"data-testid": "textarea-label",
|
|
109
|
+
fontSize: floatingFontSize
|
|
110
|
+
}, placeholder, required && /*#__PURE__*/_react["default"].createElement(_InputStyle.AsteriskIcon, null, "*")));
|
|
96
111
|
};
|
|
97
112
|
exports.ActivatorSelect = ActivatorSelect;
|
|
@@ -6,8 +6,21 @@ export declare const StyledTag: import("styled-components").StyledComponent<impo
|
|
|
6
6
|
export declare const StyledTextInput: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<Omit<import("../../../Input/Input").InputProps, "type" | "onChange"> & {
|
|
7
7
|
canClear?: boolean;
|
|
8
8
|
onChange?: (value: string) => void;
|
|
9
|
+
height?: string;
|
|
10
|
+
border?: string;
|
|
11
|
+
borderRadius?: string;
|
|
12
|
+
required?: boolean;
|
|
13
|
+
isPlaceholderFloating?: boolean;
|
|
14
|
+
floatingFontSize?: string;
|
|
9
15
|
} & import("react").RefAttributes<HTMLInputElement>>, any, {}, never>;
|
|
10
16
|
export declare const StyledSelectTypography: import("styled-components").StyledComponent<({ as, children, variant, style, ...props }: import("../../../Typography").TypographyProps) => JSX.Element, any, {}, never>;
|
|
11
17
|
export declare const WithPrefixContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
12
18
|
export declare const StyledPrefixContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
13
19
|
export declare const StyledIcon: import("styled-components").StyledComponent<({ name, ...props }: import("../../../Icon").IconProps) => JSX.Element, any, {}, never>;
|
|
20
|
+
export declare const SuffixContainer: import("styled-components").StyledComponent<"div", any, {
|
|
21
|
+
height?: string;
|
|
22
|
+
} & {
|
|
23
|
+
height?: string;
|
|
24
|
+
} & {
|
|
25
|
+
height?: string;
|
|
26
|
+
}, never>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
exports.__esModule = true;
|
|
5
|
-
exports.WithPrefixContainer = exports.TagsContainer = exports.StyledTextInput = exports.StyledTag = exports.StyledSelectTypography = exports.StyledSelect = exports.StyledPrefixContainer = exports.StyledIcon = void 0;
|
|
5
|
+
exports.WithPrefixContainer = exports.TagsContainer = exports.SuffixContainer = exports.StyledTextInput = exports.StyledTag = exports.StyledSelectTypography = exports.StyledSelect = exports.StyledPrefixContainer = exports.StyledIcon = void 0;
|
|
6
6
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
7
7
|
var Breakpoints = _interopRequireWildcard(require("../../../utilities/breakpoints/Breakpoints"));
|
|
8
8
|
var _borderRadius = require("../../../utilities/borderRadius");
|
|
@@ -13,12 +13,22 @@ var _TextInput = require("../../../TextInput");
|
|
|
13
13
|
var _Tag = require("../../../Tag");
|
|
14
14
|
var _Typography = require("../../../Typography");
|
|
15
15
|
var _Icon = require("../../../Icon");
|
|
16
|
+
var _InputStyle = require("../../../Input/InputStyle");
|
|
16
17
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
18
19
|
var StyledSelect = _styledComponents["default"].button.withConfig({
|
|
19
20
|
displayName: "ActivatorStyle__StyledSelect",
|
|
20
21
|
componentId: "sc-rui73p-0"
|
|
21
|
-
})(["display:flex;align-items:center;justify-content:space-between;height:
|
|
22
|
+
})(["position:relative;display:flex;align-items:center;justify-content:space-between;height:", ";cursor:pointer;padding:0px 8px 0px 12px;border:", ";box-shadow:0px 1px 0px rgba(0,0,0,0.05);border-radius:", ";background:", ";width:", ";color:", ";font-family:", ",sans-serif;font-weight:400;font-size:16px;line-height:150%;letter-spacing:0px;@media (max-width:", "){font-size:14px;}&:focus{outline:none;box-shadow:0px 0px 0px 1px #ffffff,0px 0px 0px 3px #6cc9ec;}&:disabled{background:", ";pointer-events:none;cursor:default;border:1px solid ", ";}&[data-error='true']{border:1px solid ", ";border-radius:", ";}"], function (props) {
|
|
23
|
+
var _props$height;
|
|
24
|
+
return (_props$height = props.height) != null ? _props$height : '36px';
|
|
25
|
+
}, function (_ref) {
|
|
26
|
+
var border = _ref.border;
|
|
27
|
+
return border != null ? border : "1px solid " + _colors.Neutral.B68;
|
|
28
|
+
}, function (_ref2) {
|
|
29
|
+
var borderRadius = _ref2.borderRadius;
|
|
30
|
+
return borderRadius != null ? borderRadius : _borderRadius.borderRadius4;
|
|
31
|
+
}, _colors.Neutral.B100, function (props) {
|
|
22
32
|
return props.width;
|
|
23
33
|
}, _colors.Neutral.B18, _fonts.NotoSans, Breakpoints.large, _colors.Neutral.B95, _colors.Neutral.B85, _colors.Red.B93, _borderRadius.borderRadius4);
|
|
24
34
|
exports.StyledSelect = StyledSelect;
|
|
@@ -58,4 +68,9 @@ var StyledIcon = (0, _styledComponents["default"])(_Icon.Icon).withConfig({
|
|
|
58
68
|
displayName: "ActivatorStyle__StyledIcon",
|
|
59
69
|
componentId: "sc-rui73p-7"
|
|
60
70
|
})(["margin-left:auto;"]);
|
|
61
|
-
exports.StyledIcon = StyledIcon;
|
|
71
|
+
exports.StyledIcon = StyledIcon;
|
|
72
|
+
var SuffixContainer = (0, _styledComponents["default"])(_InputStyle.StyledSuffixContainer).withConfig({
|
|
73
|
+
displayName: "ActivatorStyle__SuffixContainer",
|
|
74
|
+
componentId: "sc-rui73p-8"
|
|
75
|
+
})(["z-index:2;"]);
|
|
76
|
+
exports.SuffixContainer = SuffixContainer;
|
|
@@ -12,11 +12,16 @@ export interface ActivatorTextInputProps extends Omit<TextInputProps, 'onChange'
|
|
|
12
12
|
}): void;
|
|
13
13
|
selectedValues?: string[];
|
|
14
14
|
width?: string;
|
|
15
|
+
height?: string;
|
|
15
16
|
inputValue?: string;
|
|
16
17
|
updateInputValue?: (newValue: string) => void;
|
|
17
18
|
searchableSelectState?: SearchableSelectState;
|
|
18
19
|
updateSearchableSelectState?: (newState: SearchableSelectState) => void;
|
|
19
20
|
options?: Option[];
|
|
20
21
|
updateMenuOptions?: (newState: Option[]) => void;
|
|
22
|
+
border?: string;
|
|
23
|
+
borderRadius?: string;
|
|
24
|
+
isPlaceholderFloating?: boolean;
|
|
25
|
+
required?: boolean;
|
|
21
26
|
}
|
|
22
|
-
export declare const ActivatorTextInput: ({ allowMultiple, disabled, hasError, onChange, onBlur, onFocus, onSelect, prefix, selectedValues, width, inputValue, updateInputValue, options, updateMenuOptions, ...props }: ActivatorTextInputProps) => JSX.Element;
|
|
27
|
+
export declare const ActivatorTextInput: ({ allowMultiple, disabled, hasError, onChange, onBlur, onFocus, onSelect, prefix, selectedValues, width, inputValue, updateInputValue, options, updateMenuOptions, border, borderRadius, isPlaceholderFloating, required, height, ...props }: ActivatorTextInputProps) => JSX.Element;
|
|
@@ -9,7 +9,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
var _Icon = require("../../../Icon");
|
|
10
10
|
var _SearchableSelectInput = require("../SearchableSelectInput/SearchableSelectInput");
|
|
11
11
|
var _ActivatorStyle = require("./ActivatorStyle");
|
|
12
|
-
var _excluded = ["allowMultiple", "disabled", "hasError", "onChange", "onBlur", "onFocus", "onSelect", "prefix", "selectedValues", "width", "inputValue", "updateInputValue", "options", "updateMenuOptions"];
|
|
12
|
+
var _excluded = ["allowMultiple", "disabled", "hasError", "onChange", "onBlur", "onFocus", "onSelect", "prefix", "selectedValues", "width", "inputValue", "updateInputValue", "options", "updateMenuOptions", "border", "borderRadius", "isPlaceholderFloating", "required", "height"];
|
|
13
13
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
15
|
var ActivatorTextInput = function ActivatorTextInput(_ref) {
|
|
@@ -32,6 +32,11 @@ var ActivatorTextInput = function ActivatorTextInput(_ref) {
|
|
|
32
32
|
updateInputValue = _ref.updateInputValue,
|
|
33
33
|
options = _ref.options,
|
|
34
34
|
updateMenuOptions = _ref.updateMenuOptions,
|
|
35
|
+
border = _ref.border,
|
|
36
|
+
borderRadius = _ref.borderRadius,
|
|
37
|
+
isPlaceholderFloating = _ref.isPlaceholderFloating,
|
|
38
|
+
required = _ref.required,
|
|
39
|
+
height = _ref.height,
|
|
35
40
|
props = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
|
|
36
41
|
var activatorRef = (0, _react.useRef)(null);
|
|
37
42
|
var _useState = (0, _react.useState)(false),
|
|
@@ -75,7 +80,11 @@ var ActivatorTextInput = function ActivatorTextInput(_ref) {
|
|
|
75
80
|
onFocus: onFocus,
|
|
76
81
|
error: hasError,
|
|
77
82
|
disabled: disabled,
|
|
78
|
-
width: width
|
|
83
|
+
width: width,
|
|
84
|
+
border: border,
|
|
85
|
+
borderRadius: borderRadius,
|
|
86
|
+
isPlaceholderFloating: isPlaceholderFloating,
|
|
87
|
+
required: required
|
|
79
88
|
})) : /*#__PURE__*/_react["default"].createElement(_SearchableSelectInput.SearchableSelectInput, (0, _extends2["default"])({}, props, {
|
|
80
89
|
ref: activatorRef,
|
|
81
90
|
prefix: prefix,
|
|
@@ -91,7 +100,12 @@ var ActivatorTextInput = function ActivatorTextInput(_ref) {
|
|
|
91
100
|
inputValue: inputValue,
|
|
92
101
|
updateInputValue: updateInputValue,
|
|
93
102
|
options: options,
|
|
94
|
-
updateMenuOptions: updateMenuOptions
|
|
103
|
+
updateMenuOptions: updateMenuOptions,
|
|
104
|
+
border: border,
|
|
105
|
+
borderRadius: borderRadius,
|
|
106
|
+
isPlaceholderFloating: isPlaceholderFloating,
|
|
107
|
+
required: required,
|
|
108
|
+
height: height
|
|
95
109
|
})));
|
|
96
110
|
};
|
|
97
111
|
exports.ActivatorTextInput = ActivatorTextInput;
|
|
@@ -5,5 +5,6 @@ export interface ClearSelectedProps {
|
|
|
5
5
|
}): void;
|
|
6
6
|
handleClearIconClick?: () => void;
|
|
7
7
|
updateInputValue?(newValue: string): void;
|
|
8
|
+
height?: string;
|
|
8
9
|
}
|
|
9
|
-
export declare const ClearSelected: ({ onSelect, handleClearIconClick, updateInputValue, }: ClearSelectedProps) => JSX.Element;
|
|
10
|
+
export declare const ClearSelected: ({ onSelect, handleClearIconClick, updateInputValue, height, }: ClearSelectedProps) => JSX.Element;
|
|
@@ -9,7 +9,8 @@ var _SearchableSelectInputStyle = require("./SearchableSelectInputStyle");
|
|
|
9
9
|
var ClearSelected = function ClearSelected(_ref) {
|
|
10
10
|
var onSelect = _ref.onSelect,
|
|
11
11
|
handleClearIconClick = _ref.handleClearIconClick,
|
|
12
|
-
updateInputValue = _ref.updateInputValue
|
|
12
|
+
updateInputValue = _ref.updateInputValue,
|
|
13
|
+
height = _ref.height;
|
|
13
14
|
var onClearIconClick = function onClearIconClick() {
|
|
14
15
|
updateInputValue('');
|
|
15
16
|
onSelect({
|
|
@@ -17,7 +18,9 @@ var ClearSelected = function ClearSelected(_ref) {
|
|
|
17
18
|
});
|
|
18
19
|
handleClearIconClick();
|
|
19
20
|
};
|
|
20
|
-
return /*#__PURE__*/_react["default"].createElement(_SearchableSelectInputStyle.ClearSelectedContainer,
|
|
21
|
+
return /*#__PURE__*/_react["default"].createElement(_SearchableSelectInputStyle.ClearSelectedContainer, {
|
|
22
|
+
height: height
|
|
23
|
+
}, /*#__PURE__*/_react["default"].createElement(_Icon.Icon, {
|
|
21
24
|
name: "ri-close-circle-fill",
|
|
22
25
|
style: {
|
|
23
26
|
cursor: 'pointer'
|
|
@@ -20,6 +20,12 @@ export declare type SearchableSelectInputProps = Omit<InputProps, 'type' | 'onCh
|
|
|
20
20
|
updateSearchableSelectState?: (newState: SearchableSelectState) => void;
|
|
21
21
|
options?: Option[];
|
|
22
22
|
updateMenuOptions?: (newState: Option[]) => void;
|
|
23
|
+
border?: string;
|
|
24
|
+
borderRadius?: string;
|
|
25
|
+
floatingFontSize?: string;
|
|
26
|
+
isPlaceholderFloating?: boolean;
|
|
27
|
+
required?: boolean;
|
|
28
|
+
height?: string;
|
|
23
29
|
};
|
|
24
30
|
export declare const SearchableSelectInput: React.ForwardRefExoticComponent<Omit<InputProps, "type" | "onChange" | "onSelect"> & {
|
|
25
31
|
canClear?: boolean;
|
|
@@ -35,4 +41,10 @@ export declare const SearchableSelectInput: React.ForwardRefExoticComponent<Omit
|
|
|
35
41
|
updateSearchableSelectState?: (newState: SearchableSelectState) => void;
|
|
36
42
|
options?: Option[];
|
|
37
43
|
updateMenuOptions?: (newState: Option[]) => void;
|
|
44
|
+
border?: string;
|
|
45
|
+
borderRadius?: string;
|
|
46
|
+
floatingFontSize?: string;
|
|
47
|
+
isPlaceholderFloating?: boolean;
|
|
48
|
+
required?: boolean;
|
|
49
|
+
height?: string;
|
|
38
50
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -9,7 +9,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
var _InputStyle = require("../../../Input/InputStyle");
|
|
10
10
|
var _ClearSelected = require("./ClearSelected");
|
|
11
11
|
var _SearchableSelectInputStyle = require("./SearchableSelectInputStyle");
|
|
12
|
-
var _excluded = ["disabled", "error", "filterOptions", "onSelect", "placeholder", "prefix", "selectedValue", "width", "inputValue", "updateInputValue", "onInputChange", "onBlur", "onFocus", "searchableSelectState", "updateSearchableSelectState", "options", "updateMenuOptions"];
|
|
12
|
+
var _excluded = ["disabled", "error", "filterOptions", "onSelect", "placeholder", "prefix", "selectedValue", "width", "inputValue", "updateInputValue", "onInputChange", "onBlur", "onFocus", "searchableSelectState", "updateSearchableSelectState", "options", "updateMenuOptions", "border", "borderRadius", "floatingFontSize", "isPlaceholderFloating", "required", "height"];
|
|
13
13
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
15
|
var SearchableSelectInput = /*#__PURE__*/(0, _react.forwardRef)(function SearchableSelectInput(_ref, ref) {
|
|
@@ -35,6 +35,12 @@ var SearchableSelectInput = /*#__PURE__*/(0, _react.forwardRef)(function Searcha
|
|
|
35
35
|
updateSearchableSelectState = _ref.updateSearchableSelectState,
|
|
36
36
|
options = _ref.options,
|
|
37
37
|
updateMenuOptions = _ref.updateMenuOptions,
|
|
38
|
+
border = _ref.border,
|
|
39
|
+
borderRadius = _ref.borderRadius,
|
|
40
|
+
floatingFontSize = _ref.floatingFontSize,
|
|
41
|
+
isPlaceholderFloating = _ref.isPlaceholderFloating,
|
|
42
|
+
required = _ref.required,
|
|
43
|
+
height = _ref.height,
|
|
38
44
|
props = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
|
|
39
45
|
var inputRef = (0, _react.useRef)(null);
|
|
40
46
|
var _useState = (0, _react.useState)(false),
|
|
@@ -43,6 +49,7 @@ var SearchableSelectInput = /*#__PURE__*/(0, _react.forwardRef)(function Searcha
|
|
|
43
49
|
var _useState2 = (0, _react.useState)(false),
|
|
44
50
|
isSelectedClicked = _useState2[0],
|
|
45
51
|
setIsSelectedClicked = _useState2[1];
|
|
52
|
+
var isShowPlaceholder = showPlaceholder && !isPlaceholderFloating;
|
|
46
53
|
var handleFocus = function handleFocus(e) {
|
|
47
54
|
if (disabled) return;
|
|
48
55
|
setIsSelectedClicked(false);
|
|
@@ -126,6 +133,7 @@ var SearchableSelectInput = /*#__PURE__*/(0, _react.forwardRef)(function Searcha
|
|
|
126
133
|
showPlaceholder: true
|
|
127
134
|
});
|
|
128
135
|
}, [selectedValue, handleUpdateSearchableSelectState]);
|
|
136
|
+
var selectedPlaceholder = required ? placeholder + "*" : placeholder;
|
|
129
137
|
return /*#__PURE__*/_react["default"].createElement(_SearchableSelectInputStyle.StyledContainer, {
|
|
130
138
|
className: "select-input-container",
|
|
131
139
|
ref: ref,
|
|
@@ -133,8 +141,12 @@ var SearchableSelectInput = /*#__PURE__*/(0, _react.forwardRef)(function Searcha
|
|
|
133
141
|
"data-disabled": disabled,
|
|
134
142
|
prefixWidth: 37,
|
|
135
143
|
suffixWidth: 33,
|
|
136
|
-
width: width
|
|
137
|
-
|
|
144
|
+
width: width,
|
|
145
|
+
height: height,
|
|
146
|
+
isPlaceholderFloating: isPlaceholderFloating
|
|
147
|
+
}, /*#__PURE__*/_react["default"].createElement(_InputStyle.StyledPrefixContainer, {
|
|
148
|
+
height: height
|
|
149
|
+
}, prefix), showSelected && /*#__PURE__*/_react["default"].createElement(_SearchableSelectInputStyle.StyledSelectedValue, {
|
|
138
150
|
className: "searchable-select",
|
|
139
151
|
onClick: handleSelectedClick
|
|
140
152
|
}, /*#__PURE__*/_react["default"].createElement(_SearchableSelectInputStyle.StyledSelected, null, ((_options$find = options.find(function (option) {
|
|
@@ -143,14 +155,20 @@ var SearchableSelectInput = /*#__PURE__*/(0, _react.forwardRef)(function Searcha
|
|
|
143
155
|
ref: inputRef,
|
|
144
156
|
onChange: handleInputChange,
|
|
145
157
|
disabled: disabled,
|
|
146
|
-
placeholder:
|
|
158
|
+
placeholder: isShowPlaceholder ? selectedPlaceholder : null,
|
|
147
159
|
value: inputValue,
|
|
148
160
|
onBlur: handleInputBlur,
|
|
149
|
-
onFocus: handleFocus
|
|
161
|
+
onFocus: handleFocus,
|
|
162
|
+
border: border,
|
|
163
|
+
borderRadius: borderRadius
|
|
150
164
|
}, props))), showClear && !disabled && /*#__PURE__*/_react["default"].createElement(_ClearSelected.ClearSelected, {
|
|
151
165
|
onSelect: onSelect,
|
|
152
166
|
handleClearIconClick: handleClearIconClick,
|
|
153
|
-
updateInputValue: updateInputValue
|
|
154
|
-
|
|
167
|
+
updateInputValue: updateInputValue,
|
|
168
|
+
height: height
|
|
169
|
+
}), isPlaceholderFloating && /*#__PURE__*/_react["default"].createElement(_InputStyle.FloatingLabel, {
|
|
170
|
+
"data-testid": "textarea-label",
|
|
171
|
+
fontSize: floatingFontSize
|
|
172
|
+
}, placeholder, required && /*#__PURE__*/_react["default"].createElement(_InputStyle.AsteriskIcon, null, "*")));
|
|
155
173
|
});
|
|
156
174
|
exports.SearchableSelectInput = SearchableSelectInput;
|
|
@@ -2,4 +2,10 @@ export declare const StyledContainer: import("styled-components").StyledComponen
|
|
|
2
2
|
export declare const StyledSelected: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
3
3
|
export declare const StyledSelectedValue: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
4
|
export declare const InputContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
|
-
export declare const ClearSelectedContainer: import("styled-components").StyledComponent<"div", any, {
|
|
5
|
+
export declare const ClearSelectedContainer: import("styled-components").StyledComponent<"div", any, {
|
|
6
|
+
height?: string;
|
|
7
|
+
} & {
|
|
8
|
+
height?: string;
|
|
9
|
+
} & {
|
|
10
|
+
height?: string;
|
|
11
|
+
}, never>;
|
|
@@ -14,7 +14,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
14
14
|
var StyledContainer = (0, _styledComponents["default"])(_InputStyle.StyledContainer).withConfig({
|
|
15
15
|
displayName: "SearchableSelectInputStyle__StyledContainer",
|
|
16
16
|
componentId: "sc-1oj168h-0"
|
|
17
|
-
})(["position:relative;height:36px;width:", ";background:", ";box-shadow:0px 1px 0px rgba(0,0,0,0.05);box-sizing:border-box;display:grid;input{background:transparent;z-index:1;width:", ";}&:has(> div > input:focus) > .searchable-select{color:", ";}.searchable-select{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.searchable-select,input{padding-left:", "px;padding-right:", "px;}&[data-error='true'] .searchable-select{border:1px solid ", ";}&[data-error='true'] .searchable-select:focus{box-shadow:none;}&[data-disabled='true'] .searchable-select{border:1px solid ", ";background:", ";color:", ";}"], function (props) {
|
|
17
|
+
})(["position:relative;height:36px;width:", ";background:", ";box-shadow:0px 1px 0px rgba(0,0,0,0.05);box-sizing:border-box;display:grid;input{background:transparent;z-index:1;width:", ";}&:has(> div > input:focus) > .searchable-select{color:", ";}.searchable-select{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.searchable-select,input{padding-left:", "px;padding-right:", "px;height:", ";}&[data-error='true'] .searchable-select{border:1px solid ", ";}&[data-error='true'] .searchable-select:focus{box-shadow:none;}&[data-disabled='true'] .searchable-select{border:1px solid ", ";background:", ";color:", ";}"], function (props) {
|
|
18
18
|
return props.width;
|
|
19
19
|
}, _colors.Neutral.B100, function (props) {
|
|
20
20
|
return props.width;
|
|
@@ -22,6 +22,9 @@ var StyledContainer = (0, _styledComponents["default"])(_InputStyle.StyledContai
|
|
|
22
22
|
return props.prefixWidth;
|
|
23
23
|
}, function (props) {
|
|
24
24
|
return props.suffixWidth;
|
|
25
|
+
}, function (props) {
|
|
26
|
+
var _props$height;
|
|
27
|
+
return (_props$height = props.height) != null ? _props$height : '36px';
|
|
25
28
|
}, _colors.Red.B93, _colors.Neutral.B85, _colors.Neutral.B95, _colors.Neutral.B85);
|
|
26
29
|
exports.StyledContainer = StyledContainer;
|
|
27
30
|
var StyledSelected = _styledComponents["default"].span.withConfig({
|
|
@@ -13,6 +13,11 @@ export declare type TextAreaProps = Omit<TextareaHTMLAttributes<HTMLTextAreaElem
|
|
|
13
13
|
* **defaults to** `true`
|
|
14
14
|
*/
|
|
15
15
|
canExceedMaxLength: boolean;
|
|
16
|
+
border?: string;
|
|
17
|
+
borderRadius?: string;
|
|
18
|
+
required?: boolean;
|
|
19
|
+
isPlaceholderFloating?: boolean;
|
|
20
|
+
floatingFontSize?: string;
|
|
16
21
|
};
|
|
17
22
|
export declare const TextArea: React.ForwardRefExoticComponent<Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "onChange"> & {
|
|
18
23
|
value: string;
|
|
@@ -28,4 +33,9 @@ export declare const TextArea: React.ForwardRefExoticComponent<Omit<React.Textar
|
|
|
28
33
|
* **defaults to** `true`
|
|
29
34
|
*/
|
|
30
35
|
canExceedMaxLength: boolean;
|
|
36
|
+
border?: string;
|
|
37
|
+
borderRadius?: string;
|
|
38
|
+
required?: boolean;
|
|
39
|
+
isPlaceholderFloating?: boolean;
|
|
40
|
+
floatingFontSize?: string;
|
|
31
41
|
} & React.RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -8,7 +8,8 @@ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runt
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _TextAreaStyle = require("./TextAreaStyle");
|
|
10
10
|
var _Typography = require("../Typography");
|
|
11
|
-
var
|
|
11
|
+
var _InputStyle = require("../Input/InputStyle");
|
|
12
|
+
var _excluded = ["value", "rows", "maxLength", "error", "disabled", "width", "onChange", "forwardedRef", "canExceedMaxLength", "required", "border", "borderRadius", "isPlaceholderFloating", "floatingFontSize", "placeholder"];
|
|
12
13
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
15
|
var _TextArea = function _TextArea(_ref) {
|
|
@@ -26,6 +27,12 @@ var _TextArea = function _TextArea(_ref) {
|
|
|
26
27
|
forwardedRef = _ref.forwardedRef,
|
|
27
28
|
_ref$canExceedMaxLeng = _ref.canExceedMaxLength,
|
|
28
29
|
canExceedMaxLength = _ref$canExceedMaxLeng === void 0 ? true : _ref$canExceedMaxLeng,
|
|
30
|
+
required = _ref.required,
|
|
31
|
+
border = _ref.border,
|
|
32
|
+
borderRadius = _ref.borderRadius,
|
|
33
|
+
isPlaceholderFloating = _ref.isPlaceholderFloating,
|
|
34
|
+
floatingFontSize = _ref.floatingFontSize,
|
|
35
|
+
placeholder = _ref.placeholder,
|
|
29
36
|
props = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
|
|
30
37
|
var _useState = (0, _react.useState)(false),
|
|
31
38
|
isFocused = _useState[0],
|
|
@@ -50,7 +57,10 @@ var _TextArea = function _TextArea(_ref) {
|
|
|
50
57
|
"data-focus": isFocused,
|
|
51
58
|
"data-has-counter": hasMaxLengthEnforced,
|
|
52
59
|
width: width,
|
|
53
|
-
onClick: handleContainerClick
|
|
60
|
+
onClick: handleContainerClick,
|
|
61
|
+
border: border,
|
|
62
|
+
borderRadius: borderRadius,
|
|
63
|
+
isPlaceholderFloating: isPlaceholderFloating
|
|
54
64
|
}, /*#__PURE__*/_react["default"].createElement(_TextAreaStyle.StyledTextArea, (0, _extends2["default"])({
|
|
55
65
|
ref: textAreaInputRef,
|
|
56
66
|
value: value,
|
|
@@ -64,14 +74,20 @@ var _TextArea = function _TextArea(_ref) {
|
|
|
64
74
|
},
|
|
65
75
|
onBlur: function onBlur() {
|
|
66
76
|
return setIsFocused(false);
|
|
67
|
-
}
|
|
77
|
+
},
|
|
78
|
+
border: border,
|
|
79
|
+
borderRadius: borderRadius,
|
|
80
|
+
placeholder: isPlaceholderFloating ? undefined : placeholder
|
|
68
81
|
}, props)), hasMaxLengthEnforced && /*#__PURE__*/_react["default"].createElement(_TextAreaStyle.StyledWordCountContainer, {
|
|
69
82
|
"data-disabled": disabled,
|
|
70
83
|
"data-error": hasError
|
|
71
84
|
}, /*#__PURE__*/_react["default"].createElement(_Typography.Typography, {
|
|
72
85
|
as: "span",
|
|
73
86
|
variant: "overline"
|
|
74
|
-
}, charCount, " / ", maxLength))
|
|
87
|
+
}, charCount, " / ", maxLength)), isPlaceholderFloating && /*#__PURE__*/_react["default"].createElement(_InputStyle.FloatingLabel, {
|
|
88
|
+
"data-testid": "textarea-label",
|
|
89
|
+
fontSize: floatingFontSize
|
|
90
|
+
}, placeholder, required && /*#__PURE__*/_react["default"].createElement(_InputStyle.AsteriskIcon, null, "*")));
|
|
75
91
|
};
|
|
76
92
|
var forwardRef = function forwardRef(props, ref) {
|
|
77
93
|
return /*#__PURE__*/_react["default"].createElement(_TextArea, (0, _extends2["default"])({}, props, {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
interface TextAreaProp {
|
|
2
2
|
width: string;
|
|
3
|
+
border?: string;
|
|
4
|
+
borderRadius?: string;
|
|
5
|
+
isPlaceholderFloating?: boolean;
|
|
3
6
|
}
|
|
4
7
|
export declare const StyledTextAreaContainer: import("styled-components").StyledComponent<"div", any, TextAreaProp, never>;
|
|
5
8
|
export declare const StyledTextArea: import("styled-components").StyledComponent<"textarea", any, TextAreaProp, never>;
|
|
@@ -7,17 +7,27 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
7
7
|
var _borderRadius = require("../utilities/borderRadius");
|
|
8
8
|
var _colors = require("../utilities/colors");
|
|
9
9
|
var _TypographyStyles = require("../Typography/TypographyStyles");
|
|
10
|
+
var _InputStyle = require("../Input/InputStyle");
|
|
10
11
|
var StyledTextAreaContainer = _styledComponents["default"].div.withConfig({
|
|
11
12
|
displayName: "TextAreaStyle__StyledTextAreaContainer",
|
|
12
13
|
componentId: "sc-1cq0fhw-0"
|
|
13
|
-
})(["position:relative;width:", ";border:
|
|
14
|
+
})(["position:relative;width:", ";border:", ";border-radius:", ";padding:8px 12px 25px 12px;cursor:text;&:not([data-has-counter='true']){padding-bottom:8px;}&[data-focus='true']{outline:none;box-shadow:0px 0px 0px 1px ", ",0px 0px 0px 3px #6ac9ec;}&[data-error='true']{border:1px solid ", ";&[data-focus='true']{box-shadow:none;}}&[data-disabled='true']{border:1px solid ", ";background:", ";}"], function (props) {
|
|
14
15
|
return props.width;
|
|
15
|
-
},
|
|
16
|
+
}, function (_ref) {
|
|
17
|
+
var border = _ref.border;
|
|
18
|
+
return border != null ? border : "1px solid " + _colors.Neutral.B68;
|
|
19
|
+
}, function (_ref2) {
|
|
20
|
+
var borderRadius = _ref2.borderRadius;
|
|
21
|
+
return borderRadius != null ? borderRadius : _borderRadius.borderRadius4;
|
|
22
|
+
}, _colors.Neutral.B100, _colors.Red.B93, _colors.Neutral.B85, _colors.Neutral.B95);
|
|
16
23
|
exports.StyledTextAreaContainer = StyledTextAreaContainer;
|
|
17
24
|
var StyledTextArea = _styledComponents["default"].textarea.withConfig({
|
|
18
25
|
displayName: "TextAreaStyle__StyledTextArea",
|
|
19
26
|
componentId: "sc-1cq0fhw-1"
|
|
20
|
-
})(["background:", ";box-sizing:border-box;border:none;", " color:", ";resize:none;width:100%;::-webkit-scrollbar{width:4px;}::-webkit-scrollbar-thumb{background-color:", ";border-radius:2px;}::-webkit-scrollbar-thumb:hover{background-color:", ";}&::placeholder{color:", ";}&:focus{outline:none;}:disabled{background:", ";::placeholder{color:", ";}}"], _colors.Neutral.B100,
|
|
27
|
+
})(["background:", ";box-sizing:border-box;border:none;", " ", " color:", ";resize:none;width:100%;::-webkit-scrollbar{width:4px;}::-webkit-scrollbar-thumb{background-color:", ";border-radius:2px;}::-webkit-scrollbar-thumb:hover{background-color:", ";}&::placeholder{color:", ";}&:focus{outline:none;}:disabled{background:", ";::placeholder{color:", ";}}"], _colors.Neutral.B100, function (_ref3) {
|
|
28
|
+
var isPlaceholderFloating = _ref3.isPlaceholderFloating;
|
|
29
|
+
return isPlaceholderFloating && _InputStyle.FloatingLabel;
|
|
30
|
+
}, _TypographyStyles.body1, _colors.Neutral.B18, _colors.Neutral.B68, _colors.Neutral.B40, _colors.Neutral.B68, _colors.Neutral.B95, _colors.Neutral.B85);
|
|
21
31
|
exports.StyledTextArea = StyledTextArea;
|
|
22
32
|
var StyledWordCountContainer = _styledComponents["default"].div.withConfig({
|
|
23
33
|
displayName: "TextAreaStyle__StyledWordCountContainer",
|