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
|
@@ -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",
|
|
@@ -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>>;
|
|
@@ -8,7 +8,7 @@ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runt
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _Icon = require("../Icon");
|
|
10
10
|
var _Input = require("../Input/Input");
|
|
11
|
-
var _excluded = ["canClear", "suffix", "value", "onChange", "error"];
|
|
11
|
+
var _excluded = ["canClear", "suffix", "value", "onChange", "error", "height", "border", "borderRadius", "required", "floatingFontSize", "isPlaceholderFloating"];
|
|
12
12
|
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
13
|
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
14
|
var TextInput = /*#__PURE__*/_react["default"].forwardRef(function TextInput(_ref, ref) {
|
|
@@ -17,6 +17,12 @@ var TextInput = /*#__PURE__*/_react["default"].forwardRef(function TextInput(_re
|
|
|
17
17
|
value = _ref.value,
|
|
18
18
|
onChange = _ref.onChange,
|
|
19
19
|
error = _ref.error,
|
|
20
|
+
height = _ref.height,
|
|
21
|
+
border = _ref.border,
|
|
22
|
+
borderRadius = _ref.borderRadius,
|
|
23
|
+
required = _ref.required,
|
|
24
|
+
floatingFontSize = _ref.floatingFontSize,
|
|
25
|
+
isPlaceholderFloating = _ref.isPlaceholderFloating,
|
|
20
26
|
props = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
|
|
21
27
|
var ClearIcon = function ClearIcon() {
|
|
22
28
|
return /*#__PURE__*/_react["default"].createElement(_Icon.Icon, {
|
|
@@ -51,7 +57,13 @@ var TextInput = /*#__PURE__*/_react["default"].forwardRef(function TextInput(_re
|
|
|
51
57
|
suffix: suffixValue,
|
|
52
58
|
value: value,
|
|
53
59
|
onChange: handleChange,
|
|
54
|
-
error: error
|
|
60
|
+
error: error,
|
|
61
|
+
border: border,
|
|
62
|
+
borderRadius: borderRadius,
|
|
63
|
+
floatingFontSize: floatingFontSize,
|
|
64
|
+
isPlaceholderFloating: isPlaceholderFloating,
|
|
65
|
+
required: required,
|
|
66
|
+
height: height
|
|
55
67
|
}, props));
|
|
56
68
|
});
|
|
57
69
|
exports.TextInput = TextInput;
|
|
@@ -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;
|
|
@@ -13,7 +13,8 @@ var _components = require("../../General/Icon/components");
|
|
|
13
13
|
var _Flex = require("../../Layout/Flex");
|
|
14
14
|
var _useOutsideAlerter = require("../../Utils/useOutsideAlerter");
|
|
15
15
|
var S = _interopRequireWildcard(require("./PhoneNumberInputStyles"));
|
|
16
|
-
var
|
|
16
|
+
var _InputStyle = require("../../@next/Input/InputStyle");
|
|
17
|
+
var _excluded = ["value", "onChange", "onFocus", "onBlur", "callingCodeOptions", "onInputChange", "filterValue", "isLoadingCallingCodeOptions", "label", "featuredOptionsLabel", "otherOptionsLabel", "callingCodeFilterInputPlaceholder", "callingCodeNoOptionsLabel", "isDisableCallingCode", "isPlaceholderFloating", "isRequired", "error", "addon"];
|
|
17
18
|
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); }
|
|
18
19
|
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; }
|
|
19
20
|
// Downshift wants a ref to this, but we need one ourselves, and there is no way
|
|
@@ -37,6 +38,9 @@ var PhoneNumberInput = function PhoneNumberInput(_ref) {
|
|
|
37
38
|
otherOptionsLabel = _ref.otherOptionsLabel,
|
|
38
39
|
callingCodeFilterInputPlaceholder = _ref.callingCodeFilterInputPlaceholder,
|
|
39
40
|
callingCodeNoOptionsLabel = _ref.callingCodeNoOptionsLabel,
|
|
41
|
+
isDisableCallingCode = _ref.isDisableCallingCode,
|
|
42
|
+
isPlaceholderFloating = _ref.isPlaceholderFloating,
|
|
43
|
+
isRequired = _ref.isRequired,
|
|
40
44
|
error = _ref.error,
|
|
41
45
|
addon = _ref.addon,
|
|
42
46
|
restProps = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
|
|
@@ -88,15 +92,16 @@ var PhoneNumberInput = function PhoneNumberInput(_ref) {
|
|
|
88
92
|
(0, _useOutsideAlerter.useOutsideAlerter)(containerRef, closeCallingCodeInput);
|
|
89
93
|
var _useId = (0, _reactIdGenerator.useId)(1, 'significant-number-input-'),
|
|
90
94
|
significantNumberInputId = _useId[0];
|
|
95
|
+
var placeholder = isRequired ? label + "*" : label;
|
|
91
96
|
return /*#__PURE__*/_react["default"].createElement(S.PhoneNumberInputContainer, (0, _extends2["default"])({
|
|
92
97
|
ref: containerRef
|
|
93
98
|
}, restProps), /*#__PURE__*/_react["default"].createElement(S.TopRow, {
|
|
94
99
|
"data-invalid": Boolean(error)
|
|
95
100
|
}, /*#__PURE__*/_react["default"].createElement(S.CallingCodeInputToggle, (0, _extends2["default"])({}, getToggleButtonProps(), {
|
|
96
101
|
type: "button",
|
|
97
|
-
onClick: toggleIsCallingCodeOpen,
|
|
102
|
+
onClick: isDisableCallingCode ? undefined : toggleIsCallingCodeOpen,
|
|
98
103
|
"data-testid": "calling-code-input-toggle"
|
|
99
|
-
}), "+", value.callingCode, /*#__PURE__*/_react["default"].createElement(S.CallingCodeInputOpenIndicator, null, isCallingCodeInputOpen ? /*#__PURE__*/_react["default"].createElement(_components.ArrowUpIcon, null) : /*#__PURE__*/_react["default"].createElement(_components.ArrowDownIcon, null))), /*#__PURE__*/_react["default"].createElement(S.SignificantNumberInput, {
|
|
104
|
+
}), "+", value.callingCode, /*#__PURE__*/_react["default"].createElement(S.CallingCodeInputOpenIndicator, null, isDisableCallingCode ? /*#__PURE__*/_react["default"].createElement("span", null, "\xA0") : isCallingCodeInputOpen ? /*#__PURE__*/_react["default"].createElement(_components.ArrowUpIcon, null) : /*#__PURE__*/_react["default"].createElement(_components.ArrowDownIcon, null))), /*#__PURE__*/_react["default"].createElement(S.SignificantNumberInput, {
|
|
100
105
|
id: significantNumberInputId,
|
|
101
106
|
"data-testid": "significant-number-input",
|
|
102
107
|
type: "tel",
|
|
@@ -108,12 +113,13 @@ var PhoneNumberInput = function PhoneNumberInput(_ref) {
|
|
|
108
113
|
},
|
|
109
114
|
onFocus: onFocus,
|
|
110
115
|
onBlur: onBlur,
|
|
111
|
-
placeholder:
|
|
116
|
+
placeholder: isPlaceholderFloating ? undefined : placeholder,
|
|
112
117
|
"data-invalid": Boolean(error),
|
|
113
|
-
"aria-label": label
|
|
118
|
+
"aria-label": label,
|
|
119
|
+
isPlaceholderFloating: isPlaceholderFloating
|
|
114
120
|
}), /*#__PURE__*/_react["default"].createElement(S.Label, {
|
|
115
121
|
htmlFor: significantNumberInputId
|
|
116
|
-
}, label), /*#__PURE__*/_react["default"].createElement(S.TopRowAddon, {
|
|
122
|
+
}, label, isRequired && /*#__PURE__*/_react["default"].createElement(_InputStyle.AsteriskIcon, null)), /*#__PURE__*/_react["default"].createElement(S.TopRowAddon, {
|
|
117
123
|
"data-testid": "addon"
|
|
118
124
|
}, addon)), /*#__PURE__*/_react["default"].createElement(S.CallingCodeInput, (0, _extends2["default"])({
|
|
119
125
|
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;
|
|
@@ -31,15 +31,18 @@ exports.CallingCodeInputOpenIndicator = CallingCodeInputOpenIndicator;
|
|
|
31
31
|
var Label = _styledComponents["default"].label.withConfig({
|
|
32
32
|
displayName: "PhoneNumberInputStyles__Label",
|
|
33
33
|
componentId: "sc-80kraj-4"
|
|
34
|
-
})(["position:absolute;left:0.5em;top:-
|
|
34
|
+
})(["position:absolute;left:0.5em;top:-1.25em;visibility:hidden;padding:0 0.3em;background:white;color:", ";"], _Colors.Greyscale.devilsgrey);
|
|
35
35
|
exports.Label = Label;
|
|
36
36
|
var visibleLabel = (0, _styledComponents.css)(["+ ", "{visibility:visible;color:#646464;font-size:12px;}"], Label);
|
|
37
37
|
var SignificantNumberInput = _styledComponents["default"].input.withConfig({
|
|
38
38
|
displayName: "PhoneNumberInputStyles__SignificantNumberInput",
|
|
39
39
|
componentId: "sc-80kraj-5"
|
|
40
|
-
})(["border:none;width:100%;font-size:16px;padding:12px;&:focus{outline:2px solid ", ";::placeholder{color:transparent;}", "}", " &[data-invalid='true']:focus{outline:2px solid ", ";}"], _Colors.SecondaryColor.actionblue, visibleLabel, function (_ref) {
|
|
40
|
+
})(["border:none;width:100%;font-size:16px;padding:12px;&:focus{outline:2px solid ", ";::placeholder{color:transparent;}", "}", " ", " &[data-invalid='true']:focus{outline:2px solid ", ";}"], _Colors.SecondaryColor.actionblue, visibleLabel, function (_ref) {
|
|
41
41
|
var value = _ref.value;
|
|
42
42
|
return value && visibleLabel;
|
|
43
|
+
}, function (_ref2) {
|
|
44
|
+
var isPlaceholderFloating = _ref2.isPlaceholderFloating;
|
|
45
|
+
return isPlaceholderFloating && visibleLabel;
|
|
43
46
|
}, _Colors.PrimaryColor.glintsred);
|
|
44
47
|
exports.SignificantNumberInput = SignificantNumberInput;
|
|
45
48
|
var TopRowAddon = _styledComponents["default"].div.withConfig({
|
|
@@ -50,8 +53,8 @@ exports.TopRowAddon = TopRowAddon;
|
|
|
50
53
|
var CallingCodeInput = _styledComponents["default"].div.withConfig({
|
|
51
54
|
displayName: "PhoneNumberInputStyles__CallingCodeInput",
|
|
52
55
|
componentId: "sc-80kraj-7"
|
|
53
|
-
})(["position:absolute;display:none;z-index:2;background:white;margin-top:4px;width:100%;border:1px solid ", ";box-shadow:", ";", ""], _Colors.Greyscale.lightgrey, _Shadow.Shadow.down1, function (
|
|
54
|
-
var isOpen =
|
|
56
|
+
})(["position:absolute;display:none;z-index:2;background:white;margin-top:4px;width:100%;border:1px solid ", ";box-shadow:", ";", ""], _Colors.Greyscale.lightgrey, _Shadow.Shadow.down1, function (_ref3) {
|
|
57
|
+
var isOpen = _ref3.isOpen;
|
|
55
58
|
return isOpen && (0, _styledComponents.css)(["display:initial;"]);
|
|
56
59
|
});
|
|
57
60
|
exports.CallingCodeInput = CallingCodeInput;
|
|
@@ -76,8 +79,8 @@ var CallingCodeOptionsList = _styledComponents["default"].ol.withConfig({
|
|
|
76
79
|
componentId: "sc-80kraj-11"
|
|
77
80
|
})(["list-style:none;margin:0;padding:0;max-height:260px;overflow:auto;font-size:16px;"]);
|
|
78
81
|
exports.CallingCodeOptionsList = CallingCodeOptionsList;
|
|
79
|
-
var getGroupHeaderStyles = function getGroupHeaderStyles(
|
|
80
|
-
var withGroupHeader =
|
|
82
|
+
var getGroupHeaderStyles = function getGroupHeaderStyles(_ref4) {
|
|
83
|
+
var withGroupHeader = _ref4.withGroupHeader;
|
|
81
84
|
return withGroupHeader && (0, _styledComponents.css)(["content:'", "';display:block;padding:4px 8px;color:", ";font-size:8px;border-bottom:1px solid ", ";text-transform:uppercase;background:white;cursor:default;"], withGroupHeader, _Colors.Greyscale.devilsgrey, _Colors.Greyscale.softgrey);
|
|
82
85
|
};
|
|
83
86
|
var CallingCodeOption = _styledComponents["default"].li.withConfig({
|