glints-aries 4.1.7 → 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/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/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
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
|
-
var _excluded = ["disabled", "error", "filterOptions", "onSelect", "placeholder", "prefix", "selectedValue", "width", "inputValue", "updateInputValue", "onInputChange", "onBlur", "onFocus", "searchableSelectState", "updateSearchableSelectState", "options", "updateMenuOptions"];
|
|
3
|
+
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"];
|
|
4
4
|
import React, { forwardRef, useEffect, useRef, useState } from 'react';
|
|
5
|
-
import { StyledInput, StyledPrefixContainer } from '../../../Input/InputStyle';
|
|
5
|
+
import { AsteriskIcon, FloatingLabel, StyledInput, StyledPrefixContainer } from '../../../Input/InputStyle';
|
|
6
6
|
import { ClearSelected } from './ClearSelected';
|
|
7
7
|
import { InputContainer, StyledContainer, StyledSelected, StyledSelectedValue } from './SearchableSelectInputStyle';
|
|
8
8
|
export var SearchableSelectInput = /*#__PURE__*/forwardRef(function SearchableSelectInput(_ref, ref) {
|
|
@@ -28,6 +28,12 @@ export var SearchableSelectInput = /*#__PURE__*/forwardRef(function SearchableSe
|
|
|
28
28
|
updateSearchableSelectState = _ref.updateSearchableSelectState,
|
|
29
29
|
options = _ref.options,
|
|
30
30
|
updateMenuOptions = _ref.updateMenuOptions,
|
|
31
|
+
border = _ref.border,
|
|
32
|
+
borderRadius = _ref.borderRadius,
|
|
33
|
+
floatingFontSize = _ref.floatingFontSize,
|
|
34
|
+
isPlaceholderFloating = _ref.isPlaceholderFloating,
|
|
35
|
+
required = _ref.required,
|
|
36
|
+
height = _ref.height,
|
|
31
37
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
32
38
|
var inputRef = useRef(null);
|
|
33
39
|
var _useState = useState(false),
|
|
@@ -36,6 +42,7 @@ export var SearchableSelectInput = /*#__PURE__*/forwardRef(function SearchableSe
|
|
|
36
42
|
var _useState2 = useState(false),
|
|
37
43
|
isSelectedClicked = _useState2[0],
|
|
38
44
|
setIsSelectedClicked = _useState2[1];
|
|
45
|
+
var isShowPlaceholder = showPlaceholder && !isPlaceholderFloating;
|
|
39
46
|
var handleFocus = function handleFocus(e) {
|
|
40
47
|
if (disabled) return;
|
|
41
48
|
setIsSelectedClicked(false);
|
|
@@ -119,6 +126,7 @@ export var SearchableSelectInput = /*#__PURE__*/forwardRef(function SearchableSe
|
|
|
119
126
|
showPlaceholder: true
|
|
120
127
|
});
|
|
121
128
|
}, [selectedValue, handleUpdateSearchableSelectState]);
|
|
129
|
+
var selectedPlaceholder = required ? placeholder + "*" : placeholder;
|
|
122
130
|
return /*#__PURE__*/React.createElement(StyledContainer, {
|
|
123
131
|
className: "select-input-container",
|
|
124
132
|
ref: ref,
|
|
@@ -126,8 +134,12 @@ export var SearchableSelectInput = /*#__PURE__*/forwardRef(function SearchableSe
|
|
|
126
134
|
"data-disabled": disabled,
|
|
127
135
|
prefixWidth: 37,
|
|
128
136
|
suffixWidth: 33,
|
|
129
|
-
width: width
|
|
130
|
-
|
|
137
|
+
width: width,
|
|
138
|
+
height: height,
|
|
139
|
+
isPlaceholderFloating: isPlaceholderFloating
|
|
140
|
+
}, /*#__PURE__*/React.createElement(StyledPrefixContainer, {
|
|
141
|
+
height: height
|
|
142
|
+
}, prefix), showSelected && /*#__PURE__*/React.createElement(StyledSelectedValue, {
|
|
131
143
|
className: "searchable-select",
|
|
132
144
|
onClick: handleSelectedClick
|
|
133
145
|
}, /*#__PURE__*/React.createElement(StyledSelected, null, ((_options$find = options.find(function (option) {
|
|
@@ -136,13 +148,19 @@ export var SearchableSelectInput = /*#__PURE__*/forwardRef(function SearchableSe
|
|
|
136
148
|
ref: inputRef,
|
|
137
149
|
onChange: handleInputChange,
|
|
138
150
|
disabled: disabled,
|
|
139
|
-
placeholder:
|
|
151
|
+
placeholder: isShowPlaceholder ? selectedPlaceholder : null,
|
|
140
152
|
value: inputValue,
|
|
141
153
|
onBlur: handleInputBlur,
|
|
142
|
-
onFocus: handleFocus
|
|
154
|
+
onFocus: handleFocus,
|
|
155
|
+
border: border,
|
|
156
|
+
borderRadius: borderRadius
|
|
143
157
|
}, props))), showClear && !disabled && /*#__PURE__*/React.createElement(ClearSelected, {
|
|
144
158
|
onSelect: onSelect,
|
|
145
159
|
handleClearIconClick: handleClearIconClick,
|
|
146
|
-
updateInputValue: updateInputValue
|
|
147
|
-
|
|
160
|
+
updateInputValue: updateInputValue,
|
|
161
|
+
height: height
|
|
162
|
+
}), isPlaceholderFloating && /*#__PURE__*/React.createElement(FloatingLabel, {
|
|
163
|
+
"data-testid": "textarea-label",
|
|
164
|
+
fontSize: floatingFontSize
|
|
165
|
+
}, placeholder, required && /*#__PURE__*/React.createElement(AsteriskIcon, null, "*")));
|
|
148
166
|
});
|
|
@@ -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>;
|
|
@@ -7,7 +7,7 @@ import { borderRadius4 } from '../../../utilities/borderRadius';
|
|
|
7
7
|
export var StyledContainer = styled(StyledInputContainer).withConfig({
|
|
8
8
|
displayName: "SearchableSelectInputStyle__StyledContainer",
|
|
9
9
|
componentId: "sc-1oj168h-0"
|
|
10
|
-
})(["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) {
|
|
10
|
+
})(["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) {
|
|
11
11
|
return props.width;
|
|
12
12
|
}, Neutral.B100, function (props) {
|
|
13
13
|
return props.width;
|
|
@@ -15,6 +15,9 @@ export var StyledContainer = styled(StyledInputContainer).withConfig({
|
|
|
15
15
|
return props.prefixWidth;
|
|
16
16
|
}, function (props) {
|
|
17
17
|
return props.suffixWidth;
|
|
18
|
+
}, function (props) {
|
|
19
|
+
var _props$height;
|
|
20
|
+
return (_props$height = props.height) != null ? _props$height : '36px';
|
|
18
21
|
}, Red.B93, Neutral.B85, Neutral.B95, Neutral.B85);
|
|
19
22
|
export var StyledSelected = styled.span.withConfig({
|
|
20
23
|
displayName: "SearchableSelectInputStyle__StyledSelected",
|
|
@@ -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>>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
|
-
var _excluded = ["value", "rows", "maxLength", "error", "disabled", "width", "onChange", "forwardedRef", "canExceedMaxLength"];
|
|
3
|
+
var _excluded = ["value", "rows", "maxLength", "error", "disabled", "width", "onChange", "forwardedRef", "canExceedMaxLength", "required", "border", "borderRadius", "isPlaceholderFloating", "floatingFontSize", "placeholder"];
|
|
4
4
|
import React, { useRef, useState } from 'react';
|
|
5
5
|
import { StyledTextAreaContainer, StyledTextArea, StyledWordCountContainer } from './TextAreaStyle';
|
|
6
6
|
import { Typography } from '../Typography';
|
|
7
|
+
import { AsteriskIcon, FloatingLabel } from '../Input/InputStyle';
|
|
7
8
|
var _TextArea = function _TextArea(_ref) {
|
|
8
9
|
var value = _ref.value,
|
|
9
10
|
_ref$rows = _ref.rows,
|
|
@@ -19,6 +20,12 @@ var _TextArea = function _TextArea(_ref) {
|
|
|
19
20
|
forwardedRef = _ref.forwardedRef,
|
|
20
21
|
_ref$canExceedMaxLeng = _ref.canExceedMaxLength,
|
|
21
22
|
canExceedMaxLength = _ref$canExceedMaxLeng === void 0 ? true : _ref$canExceedMaxLeng,
|
|
23
|
+
required = _ref.required,
|
|
24
|
+
border = _ref.border,
|
|
25
|
+
borderRadius = _ref.borderRadius,
|
|
26
|
+
isPlaceholderFloating = _ref.isPlaceholderFloating,
|
|
27
|
+
floatingFontSize = _ref.floatingFontSize,
|
|
28
|
+
placeholder = _ref.placeholder,
|
|
22
29
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
23
30
|
var _useState = useState(false),
|
|
24
31
|
isFocused = _useState[0],
|
|
@@ -43,7 +50,10 @@ var _TextArea = function _TextArea(_ref) {
|
|
|
43
50
|
"data-focus": isFocused,
|
|
44
51
|
"data-has-counter": hasMaxLengthEnforced,
|
|
45
52
|
width: width,
|
|
46
|
-
onClick: handleContainerClick
|
|
53
|
+
onClick: handleContainerClick,
|
|
54
|
+
border: border,
|
|
55
|
+
borderRadius: borderRadius,
|
|
56
|
+
isPlaceholderFloating: isPlaceholderFloating
|
|
47
57
|
}, /*#__PURE__*/React.createElement(StyledTextArea, _extends({
|
|
48
58
|
ref: textAreaInputRef,
|
|
49
59
|
value: value,
|
|
@@ -57,14 +67,20 @@ var _TextArea = function _TextArea(_ref) {
|
|
|
57
67
|
},
|
|
58
68
|
onBlur: function onBlur() {
|
|
59
69
|
return setIsFocused(false);
|
|
60
|
-
}
|
|
70
|
+
},
|
|
71
|
+
border: border,
|
|
72
|
+
borderRadius: borderRadius,
|
|
73
|
+
placeholder: isPlaceholderFloating ? undefined : placeholder
|
|
61
74
|
}, props)), hasMaxLengthEnforced && /*#__PURE__*/React.createElement(StyledWordCountContainer, {
|
|
62
75
|
"data-disabled": disabled,
|
|
63
76
|
"data-error": hasError
|
|
64
77
|
}, /*#__PURE__*/React.createElement(Typography, {
|
|
65
78
|
as: "span",
|
|
66
79
|
variant: "overline"
|
|
67
|
-
}, charCount, " / ", maxLength))
|
|
80
|
+
}, charCount, " / ", maxLength)), isPlaceholderFloating && /*#__PURE__*/React.createElement(FloatingLabel, {
|
|
81
|
+
"data-testid": "textarea-label",
|
|
82
|
+
fontSize: floatingFontSize
|
|
83
|
+
}, placeholder, required && /*#__PURE__*/React.createElement(AsteriskIcon, null, "*")));
|
|
68
84
|
};
|
|
69
85
|
var forwardRef = function forwardRef(props, ref) {
|
|
70
86
|
return /*#__PURE__*/React.createElement(_TextArea, _extends({}, 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>;
|
|
@@ -2,16 +2,26 @@ import styled from 'styled-components';
|
|
|
2
2
|
import { borderRadius4 } from '../utilities/borderRadius';
|
|
3
3
|
import { Neutral, Red } from '../utilities/colors';
|
|
4
4
|
import { body1 as typographyBody1 } from '../Typography/TypographyStyles';
|
|
5
|
+
import { FloatingLabel } from '../Input/InputStyle';
|
|
5
6
|
export var StyledTextAreaContainer = styled.div.withConfig({
|
|
6
7
|
displayName: "TextAreaStyle__StyledTextAreaContainer",
|
|
7
8
|
componentId: "sc-1cq0fhw-0"
|
|
8
|
-
})(["position:relative;width:", ";border:
|
|
9
|
+
})(["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) {
|
|
9
10
|
return props.width;
|
|
10
|
-
},
|
|
11
|
+
}, function (_ref) {
|
|
12
|
+
var border = _ref.border;
|
|
13
|
+
return border != null ? border : "1px solid " + Neutral.B68;
|
|
14
|
+
}, function (_ref2) {
|
|
15
|
+
var borderRadius = _ref2.borderRadius;
|
|
16
|
+
return borderRadius != null ? borderRadius : borderRadius4;
|
|
17
|
+
}, Neutral.B100, Red.B93, Neutral.B85, Neutral.B95);
|
|
11
18
|
export var StyledTextArea = styled.textarea.withConfig({
|
|
12
19
|
displayName: "TextAreaStyle__StyledTextArea",
|
|
13
20
|
componentId: "sc-1cq0fhw-1"
|
|
14
|
-
})(["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:", ";}}"], Neutral.B100,
|
|
21
|
+
})(["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:", ";}}"], Neutral.B100, function (_ref3) {
|
|
22
|
+
var isPlaceholderFloating = _ref3.isPlaceholderFloating;
|
|
23
|
+
return isPlaceholderFloating && FloatingLabel;
|
|
24
|
+
}, typographyBody1, Neutral.B18, Neutral.B68, Neutral.B40, Neutral.B68, Neutral.B95, Neutral.B85);
|
|
15
25
|
export var StyledWordCountContainer = styled.div.withConfig({
|
|
16
26
|
displayName: "TextAreaStyle__StyledWordCountContainer",
|
|
17
27
|
componentId: "sc-1cq0fhw-2"
|
|
@@ -3,8 +3,20 @@ import { InputProps } from '../Input/Input';
|
|
|
3
3
|
export declare type TextInputProps = Omit<InputProps, 'type' | 'onChange'> & {
|
|
4
4
|
canClear?: boolean;
|
|
5
5
|
onChange?: (value: string) => void;
|
|
6
|
+
height?: string;
|
|
7
|
+
border?: string;
|
|
8
|
+
borderRadius?: string;
|
|
9
|
+
required?: boolean;
|
|
10
|
+
isPlaceholderFloating?: boolean;
|
|
11
|
+
floatingFontSize?: string;
|
|
6
12
|
};
|
|
7
13
|
export declare const TextInput: React.ForwardRefExoticComponent<Omit<InputProps, "type" | "onChange"> & {
|
|
8
14
|
canClear?: boolean;
|
|
9
15
|
onChange?: (value: string) => void;
|
|
16
|
+
height?: string;
|
|
17
|
+
border?: string;
|
|
18
|
+
borderRadius?: string;
|
|
19
|
+
required?: boolean;
|
|
20
|
+
isPlaceholderFloating?: boolean;
|
|
21
|
+
floatingFontSize?: string;
|
|
10
22
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
|
-
var _excluded = ["canClear", "suffix", "value", "onChange", "error"];
|
|
3
|
+
var _excluded = ["canClear", "suffix", "value", "onChange", "error", "height", "border", "borderRadius", "required", "floatingFontSize", "isPlaceholderFloating"];
|
|
4
4
|
import React, { useEffect, useState } from 'react';
|
|
5
5
|
import { Icon } from '../Icon';
|
|
6
6
|
import { Input } from '../Input/Input';
|
|
@@ -10,6 +10,12 @@ export var TextInput = /*#__PURE__*/React.forwardRef(function TextInput(_ref, re
|
|
|
10
10
|
value = _ref.value,
|
|
11
11
|
onChange = _ref.onChange,
|
|
12
12
|
error = _ref.error,
|
|
13
|
+
height = _ref.height,
|
|
14
|
+
border = _ref.border,
|
|
15
|
+
borderRadius = _ref.borderRadius,
|
|
16
|
+
required = _ref.required,
|
|
17
|
+
floatingFontSize = _ref.floatingFontSize,
|
|
18
|
+
isPlaceholderFloating = _ref.isPlaceholderFloating,
|
|
13
19
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
14
20
|
var ClearIcon = function ClearIcon() {
|
|
15
21
|
return /*#__PURE__*/React.createElement(Icon, {
|
|
@@ -44,6 +50,12 @@ export var TextInput = /*#__PURE__*/React.forwardRef(function TextInput(_ref, re
|
|
|
44
50
|
suffix: suffixValue,
|
|
45
51
|
value: value,
|
|
46
52
|
onChange: handleChange,
|
|
47
|
-
error: error
|
|
53
|
+
error: error,
|
|
54
|
+
border: border,
|
|
55
|
+
borderRadius: borderRadius,
|
|
56
|
+
floatingFontSize: floatingFontSize,
|
|
57
|
+
isPlaceholderFloating: isPlaceholderFloating,
|
|
58
|
+
required: required,
|
|
59
|
+
height: height
|
|
48
60
|
}, props));
|
|
49
61
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
-
export declare const PhoneNumberInput: ({ value, onChange, onFocus, onBlur, callingCodeOptions: callingCodeOptionsExternal, onInputChange, filterValue, isLoadingCallingCodeOptions, label, featuredOptionsLabel, otherOptionsLabel, callingCodeFilterInputPlaceholder, callingCodeNoOptionsLabel, error, addon, ...restProps }: Props) => JSX.Element;
|
|
2
|
+
export declare const PhoneNumberInput: ({ value, onChange, onFocus, onBlur, callingCodeOptions: callingCodeOptionsExternal, onInputChange, filterValue, isLoadingCallingCodeOptions, label, featuredOptionsLabel, otherOptionsLabel, callingCodeFilterInputPlaceholder, callingCodeNoOptionsLabel, isDisableCallingCode, isPlaceholderFloating, isRequired, error, addon, ...restProps }: Props) => JSX.Element;
|
|
3
3
|
export interface Props {
|
|
4
4
|
value: PhoneNumber;
|
|
5
5
|
onChange: (value: PhoneNumber) => void;
|
|
@@ -17,6 +17,9 @@ export interface Props {
|
|
|
17
17
|
otherOptionsLabel: string;
|
|
18
18
|
callingCodeFilterInputPlaceholder: string;
|
|
19
19
|
callingCodeNoOptionsLabel: string;
|
|
20
|
+
isDisableCallingCode?: boolean;
|
|
21
|
+
isPlaceholderFloating?: boolean;
|
|
22
|
+
isRequired?: boolean;
|
|
20
23
|
}
|
|
21
24
|
export interface PhoneNumber {
|
|
22
25
|
callingCode: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
|
-
var _excluded = ["value", "onChange", "onFocus", "onBlur", "callingCodeOptions", "onInputChange", "filterValue", "isLoadingCallingCodeOptions", "label", "featuredOptionsLabel", "otherOptionsLabel", "callingCodeFilterInputPlaceholder", "callingCodeNoOptionsLabel", "error", "addon"];
|
|
3
|
+
var _excluded = ["value", "onChange", "onFocus", "onBlur", "callingCodeOptions", "onInputChange", "filterValue", "isLoadingCallingCodeOptions", "label", "featuredOptionsLabel", "otherOptionsLabel", "callingCodeFilterInputPlaceholder", "callingCodeNoOptionsLabel", "isDisableCallingCode", "isPlaceholderFloating", "isRequired", "error", "addon"];
|
|
4
4
|
import { useCombobox } from 'downshift';
|
|
5
5
|
import { find, orderBy } from 'lodash-es';
|
|
6
6
|
import React, { useEffect, useRef, useState } from 'react';
|
|
@@ -9,6 +9,7 @@ import { ArrowDownIcon, ArrowUpIcon } from '../../General/Icon/components';
|
|
|
9
9
|
import { Flex } from '../../Layout/Flex';
|
|
10
10
|
import { useOutsideAlerter } from '../../Utils/useOutsideAlerter';
|
|
11
11
|
import * as S from './PhoneNumberInputStyles';
|
|
12
|
+
import { AsteriskIcon } from '../../@next/Input/InputStyle';
|
|
12
13
|
|
|
13
14
|
// Downshift wants a ref to this, but we need one ourselves, and there is no way
|
|
14
15
|
// to share.
|
|
@@ -31,6 +32,9 @@ export var PhoneNumberInput = function PhoneNumberInput(_ref) {
|
|
|
31
32
|
otherOptionsLabel = _ref.otherOptionsLabel,
|
|
32
33
|
callingCodeFilterInputPlaceholder = _ref.callingCodeFilterInputPlaceholder,
|
|
33
34
|
callingCodeNoOptionsLabel = _ref.callingCodeNoOptionsLabel,
|
|
35
|
+
isDisableCallingCode = _ref.isDisableCallingCode,
|
|
36
|
+
isPlaceholderFloating = _ref.isPlaceholderFloating,
|
|
37
|
+
isRequired = _ref.isRequired,
|
|
34
38
|
error = _ref.error,
|
|
35
39
|
addon = _ref.addon,
|
|
36
40
|
restProps = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
@@ -82,15 +86,16 @@ export var PhoneNumberInput = function PhoneNumberInput(_ref) {
|
|
|
82
86
|
useOutsideAlerter(containerRef, closeCallingCodeInput);
|
|
83
87
|
var _useId = useId(1, 'significant-number-input-'),
|
|
84
88
|
significantNumberInputId = _useId[0];
|
|
89
|
+
var placeholder = isRequired ? label + "*" : label;
|
|
85
90
|
return /*#__PURE__*/React.createElement(S.PhoneNumberInputContainer, _extends({
|
|
86
91
|
ref: containerRef
|
|
87
92
|
}, restProps), /*#__PURE__*/React.createElement(S.TopRow, {
|
|
88
93
|
"data-invalid": Boolean(error)
|
|
89
94
|
}, /*#__PURE__*/React.createElement(S.CallingCodeInputToggle, _extends({}, getToggleButtonProps(), {
|
|
90
95
|
type: "button",
|
|
91
|
-
onClick: toggleIsCallingCodeOpen,
|
|
96
|
+
onClick: isDisableCallingCode ? undefined : toggleIsCallingCodeOpen,
|
|
92
97
|
"data-testid": "calling-code-input-toggle"
|
|
93
|
-
}), "+", value.callingCode, /*#__PURE__*/React.createElement(S.CallingCodeInputOpenIndicator, null, isCallingCodeInputOpen ? /*#__PURE__*/React.createElement(ArrowUpIcon, null) : /*#__PURE__*/React.createElement(ArrowDownIcon, null))), /*#__PURE__*/React.createElement(S.SignificantNumberInput, {
|
|
98
|
+
}), "+", value.callingCode, /*#__PURE__*/React.createElement(S.CallingCodeInputOpenIndicator, null, isDisableCallingCode ? /*#__PURE__*/React.createElement("span", null, "\xA0") : isCallingCodeInputOpen ? /*#__PURE__*/React.createElement(ArrowUpIcon, null) : /*#__PURE__*/React.createElement(ArrowDownIcon, null))), /*#__PURE__*/React.createElement(S.SignificantNumberInput, {
|
|
94
99
|
id: significantNumberInputId,
|
|
95
100
|
"data-testid": "significant-number-input",
|
|
96
101
|
type: "tel",
|
|
@@ -102,12 +107,13 @@ export var PhoneNumberInput = function PhoneNumberInput(_ref) {
|
|
|
102
107
|
},
|
|
103
108
|
onFocus: onFocus,
|
|
104
109
|
onBlur: onBlur,
|
|
105
|
-
placeholder:
|
|
110
|
+
placeholder: isPlaceholderFloating ? undefined : placeholder,
|
|
106
111
|
"data-invalid": Boolean(error),
|
|
107
|
-
"aria-label": label
|
|
112
|
+
"aria-label": label,
|
|
113
|
+
isPlaceholderFloating: isPlaceholderFloating
|
|
108
114
|
}), /*#__PURE__*/React.createElement(S.Label, {
|
|
109
115
|
htmlFor: significantNumberInputId
|
|
110
|
-
}, label), /*#__PURE__*/React.createElement(S.TopRowAddon, {
|
|
116
|
+
}, label, isRequired && /*#__PURE__*/React.createElement(AsteriskIcon, null)), /*#__PURE__*/React.createElement(S.TopRowAddon, {
|
|
111
117
|
"data-testid": "addon"
|
|
112
118
|
}, addon)), /*#__PURE__*/React.createElement(S.CallingCodeInput, _extends({
|
|
113
119
|
isOpen: isCallingCodeInputOpen
|
|
@@ -4,7 +4,9 @@ export declare const TopRow: import("styled-components").StyledComponent<"div",
|
|
|
4
4
|
export declare const CallingCodeInputToggle: import("styled-components").StyledComponent<"button", any, {}, never>;
|
|
5
5
|
export declare const CallingCodeInputOpenIndicator: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
6
6
|
export declare const Label: import("styled-components").StyledComponent<"label", any, {}, never>;
|
|
7
|
-
export declare const SignificantNumberInput: import("styled-components").StyledComponent<"input", any, {
|
|
7
|
+
export declare const SignificantNumberInput: import("styled-components").StyledComponent<"input", any, {
|
|
8
|
+
isPlaceholderFloating?: boolean;
|
|
9
|
+
}, never>;
|
|
8
10
|
export declare const TopRowAddon: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
9
11
|
export declare const CallingCodeInput: import("styled-components").StyledComponent<"div", any, {
|
|
10
12
|
isOpen: boolean;
|
|
@@ -21,14 +21,17 @@ export var CallingCodeInputOpenIndicator = styled.span.withConfig({
|
|
|
21
21
|
export var Label = styled.label.withConfig({
|
|
22
22
|
displayName: "PhoneNumberInputStyles__Label",
|
|
23
23
|
componentId: "sc-80kraj-4"
|
|
24
|
-
})(["position:absolute;left:0.5em;top:-
|
|
24
|
+
})(["position:absolute;left:0.5em;top:-1.25em;visibility:hidden;padding:0 0.3em;background:white;color:", ";"], Greyscale.devilsgrey);
|
|
25
25
|
var visibleLabel = css(["+ ", "{visibility:visible;color:#646464;font-size:12px;}"], Label);
|
|
26
26
|
export var SignificantNumberInput = styled.input.withConfig({
|
|
27
27
|
displayName: "PhoneNumberInputStyles__SignificantNumberInput",
|
|
28
28
|
componentId: "sc-80kraj-5"
|
|
29
|
-
})(["border:none;width:100%;font-size:16px;padding:12px;&:focus{outline:2px solid ", ";::placeholder{color:transparent;}", "}", " &[data-invalid='true']:focus{outline:2px solid ", ";}"], SecondaryColor.actionblue, visibleLabel, function (_ref) {
|
|
29
|
+
})(["border:none;width:100%;font-size:16px;padding:12px;&:focus{outline:2px solid ", ";::placeholder{color:transparent;}", "}", " ", " &[data-invalid='true']:focus{outline:2px solid ", ";}"], SecondaryColor.actionblue, visibleLabel, function (_ref) {
|
|
30
30
|
var value = _ref.value;
|
|
31
31
|
return value && visibleLabel;
|
|
32
|
+
}, function (_ref2) {
|
|
33
|
+
var isPlaceholderFloating = _ref2.isPlaceholderFloating;
|
|
34
|
+
return isPlaceholderFloating && visibleLabel;
|
|
32
35
|
}, PrimaryColor.glintsred);
|
|
33
36
|
export var TopRowAddon = styled.div.withConfig({
|
|
34
37
|
displayName: "PhoneNumberInputStyles__TopRowAddon",
|
|
@@ -37,8 +40,8 @@ export var TopRowAddon = styled.div.withConfig({
|
|
|
37
40
|
export var CallingCodeInput = styled.div.withConfig({
|
|
38
41
|
displayName: "PhoneNumberInputStyles__CallingCodeInput",
|
|
39
42
|
componentId: "sc-80kraj-7"
|
|
40
|
-
})(["position:absolute;display:none;z-index:2;background:white;margin-top:4px;width:100%;border:1px solid ", ";box-shadow:", ";", ""], Greyscale.lightgrey, Shadow.down1, function (
|
|
41
|
-
var isOpen =
|
|
43
|
+
})(["position:absolute;display:none;z-index:2;background:white;margin-top:4px;width:100%;border:1px solid ", ";box-shadow:", ";", ""], Greyscale.lightgrey, Shadow.down1, function (_ref3) {
|
|
44
|
+
var isOpen = _ref3.isOpen;
|
|
42
45
|
return isOpen && css(["display:initial;"]);
|
|
43
46
|
});
|
|
44
47
|
var CALLING_CODE_INPUT_MARGIN = '8px';
|
|
@@ -58,8 +61,8 @@ export var CallingCodeOptionsList = styled.ol.withConfig({
|
|
|
58
61
|
displayName: "PhoneNumberInputStyles__CallingCodeOptionsList",
|
|
59
62
|
componentId: "sc-80kraj-11"
|
|
60
63
|
})(["list-style:none;margin:0;padding:0;max-height:260px;overflow:auto;font-size:16px;"]);
|
|
61
|
-
var getGroupHeaderStyles = function getGroupHeaderStyles(
|
|
62
|
-
var withGroupHeader =
|
|
64
|
+
var getGroupHeaderStyles = function getGroupHeaderStyles(_ref4) {
|
|
65
|
+
var withGroupHeader = _ref4.withGroupHeader;
|
|
63
66
|
return withGroupHeader && css(["content:'", "';display:block;padding:4px 8px;color:", ";font-size:8px;border-bottom:1px solid ", ";text-transform:uppercase;background:white;cursor:default;"], withGroupHeader, Greyscale.devilsgrey, Greyscale.softgrey);
|
|
64
67
|
};
|
|
65
68
|
export var CallingCodeOption = styled.li.withConfig({
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'prefix'> {
|
|
3
3
|
error?: boolean;
|
|
4
|
+
height?: string;
|
|
5
|
+
border?: string;
|
|
6
|
+
borderRadius?: string;
|
|
7
|
+
floatingFontSize?: string;
|
|
8
|
+
isPlaceholderFloating?: boolean;
|
|
9
|
+
required?: boolean;
|
|
4
10
|
prefix?: React.ReactNode;
|
|
5
11
|
suffix?: React.ReactNode;
|
|
6
12
|
inputRef?: React.Ref<HTMLInputElement>;
|
package/lib/@next/Input/Input.js
CHANGED
|
@@ -7,7 +7,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
7
7
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _InputStyle = require("./InputStyle");
|
|
10
|
-
var _excluded = ["error", "disabled", "prefix", "suffix", "inputRef"];
|
|
10
|
+
var _excluded = ["error", "disabled", "prefix", "suffix", "inputRef", "height", "border", "borderRadius", "floatingFontSize", "isPlaceholderFloating", "placeholder", "required"];
|
|
11
11
|
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); }
|
|
12
12
|
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; }
|
|
13
13
|
var Input = /*#__PURE__*/_react["default"].forwardRef(function Input(_ref, ref) {
|
|
@@ -16,6 +16,13 @@ var Input = /*#__PURE__*/_react["default"].forwardRef(function Input(_ref, ref)
|
|
|
16
16
|
prefix = _ref.prefix,
|
|
17
17
|
suffix = _ref.suffix,
|
|
18
18
|
inputRef = _ref.inputRef,
|
|
19
|
+
height = _ref.height,
|
|
20
|
+
border = _ref.border,
|
|
21
|
+
borderRadius = _ref.borderRadius,
|
|
22
|
+
floatingFontSize = _ref.floatingFontSize,
|
|
23
|
+
isPlaceholderFloating = _ref.isPlaceholderFloating,
|
|
24
|
+
placeholder = _ref.placeholder,
|
|
25
|
+
required = _ref.required,
|
|
19
26
|
props = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
|
|
20
27
|
var hasPrefix = !!prefix;
|
|
21
28
|
var hasSuffix = !!suffix;
|
|
@@ -23,12 +30,14 @@ var Input = /*#__PURE__*/_react["default"].forwardRef(function Input(_ref, ref)
|
|
|
23
30
|
var suffixRef = (0, _react.useRef)(null);
|
|
24
31
|
var Prefix = function Prefix() {
|
|
25
32
|
return hasPrefix ? /*#__PURE__*/_react["default"].createElement(_InputStyle.StyledPrefixContainer, {
|
|
26
|
-
ref: prefixRef
|
|
33
|
+
ref: prefixRef,
|
|
34
|
+
height: height
|
|
27
35
|
}, prefix) : null;
|
|
28
36
|
};
|
|
29
37
|
var Suffix = function Suffix() {
|
|
30
38
|
return hasSuffix ? /*#__PURE__*/_react["default"].createElement(_InputStyle.StyledSuffixContainer, {
|
|
31
|
-
ref: suffixRef
|
|
39
|
+
ref: suffixRef,
|
|
40
|
+
height: height
|
|
32
41
|
}, suffix) : null;
|
|
33
42
|
};
|
|
34
43
|
var _React$useState = _react["default"].useState(0),
|
|
@@ -49,6 +58,7 @@ var Input = /*#__PURE__*/_react["default"].forwardRef(function Input(_ref, ref)
|
|
|
49
58
|
setSuffixWidth(_suffixWidth);
|
|
50
59
|
}
|
|
51
60
|
}, [hasSuffix, suffix]);
|
|
61
|
+
var selectedPlaceholder = required ? placeholder + "*" : placeholder;
|
|
52
62
|
return /*#__PURE__*/_react["default"].createElement(_InputStyle.StyledContainer, {
|
|
53
63
|
ref: ref,
|
|
54
64
|
"data-prefix": hasPrefix,
|
|
@@ -59,7 +69,14 @@ var Input = /*#__PURE__*/_react["default"].forwardRef(function Input(_ref, ref)
|
|
|
59
69
|
suffixWidth: suffixWidth
|
|
60
70
|
}, /*#__PURE__*/_react["default"].createElement(Prefix, null), /*#__PURE__*/_react["default"].createElement(_InputStyle.StyledInput, (0, _extends2["default"])({
|
|
61
71
|
ref: inputRef,
|
|
72
|
+
placeholder: isPlaceholderFloating ? undefined : selectedPlaceholder,
|
|
73
|
+
borderRadius: borderRadius,
|
|
74
|
+
border: border,
|
|
75
|
+
height: height,
|
|
62
76
|
disabled: disabled
|
|
63
|
-
}, props)), /*#__PURE__*/_react["default"].createElement(
|
|
77
|
+
}, props)), isPlaceholderFloating && /*#__PURE__*/_react["default"].createElement(_InputStyle.FloatingLabel, {
|
|
78
|
+
"data-testid": "textarea-label",
|
|
79
|
+
fontSize: floatingFontSize
|
|
80
|
+
}, placeholder, required && /*#__PURE__*/_react["default"].createElement(_InputStyle.AsteriskIcon, null, "*")), /*#__PURE__*/_react["default"].createElement(Suffix, null));
|
|
64
81
|
});
|
|
65
82
|
exports.Input = Input;
|
|
@@ -4,6 +4,18 @@ export interface PreffixSuffixWidthProps {
|
|
|
4
4
|
suffixWidth: number;
|
|
5
5
|
}
|
|
6
6
|
export declare const StyledContainer: import("styled-components").StyledComponent<"div", any, InputProps & PreffixSuffixWidthProps, never>;
|
|
7
|
-
export declare const StyledPrefixContainer: import("styled-components").StyledComponent<"div", any, {
|
|
8
|
-
|
|
7
|
+
export declare const StyledPrefixContainer: import("styled-components").StyledComponent<"div", any, {
|
|
8
|
+
height?: string;
|
|
9
|
+
}, never>;
|
|
10
|
+
export declare const StyledSuffixContainer: import("styled-components").StyledComponent<"div", any, {
|
|
11
|
+
height?: string;
|
|
12
|
+
} & {
|
|
13
|
+
height?: string;
|
|
14
|
+
}, never>;
|
|
15
|
+
export declare const FloatingLabel: import("styled-components").StyledComponent<"label", any, {
|
|
16
|
+
top?: number;
|
|
17
|
+
left?: number;
|
|
18
|
+
fontSize?: string;
|
|
19
|
+
}, never>;
|
|
9
20
|
export declare const StyledInput: import("styled-components").StyledComponent<"input", any, InputProps, never>;
|
|
21
|
+
export declare const AsteriskIcon: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
exports.__esModule = true;
|
|
5
|
-
exports.StyledSuffixContainer = exports.StyledPrefixContainer = exports.StyledInput = exports.StyledContainer = void 0;
|
|
5
|
+
exports.StyledSuffixContainer = exports.StyledPrefixContainer = exports.StyledInput = exports.StyledContainer = exports.FloatingLabel = exports.AsteriskIcon = void 0;
|
|
6
6
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
7
7
|
var Breakpoints = _interopRequireWildcard(require("../utilities/breakpoints"));
|
|
8
8
|
var _colors = require("../utilities/colors");
|
|
9
9
|
var _spacing = require("../utilities/spacing");
|
|
10
10
|
var _fonts = require("../utilities/fonts");
|
|
11
11
|
var _borderRadius = require("../utilities/borderRadius");
|
|
12
|
+
var _Colors = require("../../Utils/Colors");
|
|
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 StyledContainer = _styledComponents["default"].div.withConfig({
|
|
@@ -23,15 +24,46 @@ exports.StyledContainer = StyledContainer;
|
|
|
23
24
|
var StyledPrefixContainer = _styledComponents["default"].div.withConfig({
|
|
24
25
|
displayName: "InputStyle__StyledPrefixContainer",
|
|
25
26
|
componentId: "sc-15z2mnd-1"
|
|
26
|
-
})(["position:absolute;left:0;color:", ";display:flex;align-items:center;height:
|
|
27
|
+
})(["position:absolute;left:0;color:", ";display:flex;align-items:center;height:", ";padding:0px ", " 0 ", ";svg{height:17px;width:17px;fill:", ";}"], _colors.Neutral.B40, function (_ref) {
|
|
28
|
+
var height = _ref.height;
|
|
29
|
+
return height != null ? height : '36px';
|
|
30
|
+
}, _spacing.space8, _spacing.space12, _colors.Neutral.B40);
|
|
27
31
|
exports.StyledPrefixContainer = StyledPrefixContainer;
|
|
28
32
|
var StyledSuffixContainer = (0, _styledComponents["default"])(StyledPrefixContainer).withConfig({
|
|
29
33
|
displayName: "InputStyle__StyledSuffixContainer",
|
|
30
34
|
componentId: "sc-15z2mnd-2"
|
|
31
35
|
})(["left:auto;right:0;padding:0px ", " 0 ", ";"], _spacing.space12, _spacing.space4);
|
|
32
36
|
exports.StyledSuffixContainer = StyledSuffixContainer;
|
|
37
|
+
var FloatingLabel = _styledComponents["default"].label.withConfig({
|
|
38
|
+
displayName: "InputStyle__FloatingLabel",
|
|
39
|
+
componentId: "sc-15z2mnd-3"
|
|
40
|
+
})(["position:absolute;left:", "em;top:", "em;visibility:visible;padding:0 0.3em;background:white;font-size:", ";color:", ";"], function (_ref2) {
|
|
41
|
+
var left = _ref2.left;
|
|
42
|
+
return left != null ? left : '0.5';
|
|
43
|
+
}, function (_ref3) {
|
|
44
|
+
var top = _ref3.top;
|
|
45
|
+
return top != null ? top : '-1.25';
|
|
46
|
+
}, function (_ref4) {
|
|
47
|
+
var fontSize = _ref4.fontSize;
|
|
48
|
+
return fontSize != null ? fontSize : '12px';
|
|
49
|
+
}, _Colors.Greyscale.devilsgrey);
|
|
50
|
+
exports.FloatingLabel = FloatingLabel;
|
|
33
51
|
var StyledInput = _styledComponents["default"].input.withConfig({
|
|
34
52
|
displayName: "InputStyle__StyledInput",
|
|
35
|
-
componentId: "sc-15z2mnd-
|
|
36
|
-
})(["background:", ";box-sizing:border-box;border:
|
|
37
|
-
|
|
53
|
+
componentId: "sc-15z2mnd-4"
|
|
54
|
+
})(["background:", ";box-sizing:border-box;border:", ";border-radius:", ";padding:0 12px;font-family:", ",sans-serif;font-style:normal;font-weight:400;font-size:16px;line-height:150%;color:", ";flex:none;order:1;align-self:stretch;flex-grow:0;height:", ";&::placeholder{color:", ";}&:focus{outline:none;box-shadow:0px 0px 0px 1px ", ",0px 0px 0px 3px #6ac9ec;}@media (max-width:", "){font-size:14px;}"], _colors.Neutral.B100, function (_ref5) {
|
|
55
|
+
var border = _ref5.border;
|
|
56
|
+
return border != null ? border : "1px solid " + _colors.Neutral.B68;
|
|
57
|
+
}, function (_ref6) {
|
|
58
|
+
var borderRadius = _ref6.borderRadius;
|
|
59
|
+
return borderRadius != null ? borderRadius : _borderRadius.borderRadius4;
|
|
60
|
+
}, _fonts.NotoSans, _colors.Neutral.B18, function (_ref7) {
|
|
61
|
+
var height = _ref7.height;
|
|
62
|
+
return height != null ? height : "36px";
|
|
63
|
+
}, _colors.Neutral.B68, _colors.Neutral.B100, Breakpoints.large);
|
|
64
|
+
exports.StyledInput = StyledInput;
|
|
65
|
+
var AsteriskIcon = _styledComponents["default"].span.withConfig({
|
|
66
|
+
displayName: "InputStyle__AsteriskIcon",
|
|
67
|
+
componentId: "sc-15z2mnd-5"
|
|
68
|
+
})(["color:", ";font-size:20px;vertical-align:middle;"], _colors.Red.B93);
|
|
69
|
+
exports.AsteriskIcon = AsteriskIcon;
|