glints-aries 4.1.8 → 4.1.9
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 +2 -0
- package/es/@next/Input/Input.js +9 -4
- package/es/@next/Input/InputStyle.d.ts +1 -0
- package/es/@next/Input/InputStyle.js +11 -8
- package/es/@next/NumberInput/NumberInput.js +10 -4
- package/es/@next/PasswordInput/PasswordInput.d.ts +6 -0
- package/es/@next/PasswordInput/PasswordInput.js +8 -2
- package/es/@next/Select/Select.d.ts +2 -1
- package/es/@next/Select/Select.js +7 -1
- package/es/@next/Select/components/Activator/ActivatorStyle.d.ts +2 -0
- package/es/@next/Select/components/SearchableSelectInput/SearchableSelectInput.js +3 -1
- package/es/@next/Select/components/SearchableSelectInput/SearchableSelectInputStyle.d.ts +4 -1
- package/es/@next/Select/components/SearchableSelectInput/SearchableSelectInputStyle.js +7 -1
- package/es/@next/TextArea/TextArea.d.ts +4 -0
- package/es/@next/TextArea/TextArea.js +9 -4
- package/es/@next/TextInput/TextInput.d.ts +4 -0
- package/es/@next/TextInput/TextInput.js +5 -1
- package/lib/@next/Input/Input.d.ts +2 -0
- package/lib/@next/Input/Input.js +9 -4
- package/lib/@next/Input/InputStyle.d.ts +1 -0
- package/lib/@next/Input/InputStyle.js +11 -8
- package/lib/@next/NumberInput/NumberInput.js +10 -4
- package/lib/@next/PasswordInput/PasswordInput.d.ts +6 -0
- package/lib/@next/PasswordInput/PasswordInput.js +8 -2
- package/lib/@next/Select/Select.d.ts +2 -1
- package/lib/@next/Select/Select.js +7 -1
- package/lib/@next/Select/components/Activator/ActivatorStyle.d.ts +2 -0
- package/lib/@next/Select/components/SearchableSelectInput/SearchableSelectInput.js +3 -1
- package/lib/@next/Select/components/SearchableSelectInput/SearchableSelectInputStyle.d.ts +4 -1
- package/lib/@next/Select/components/SearchableSelectInput/SearchableSelectInputStyle.js +7 -1
- package/lib/@next/TextArea/TextArea.d.ts +4 -0
- package/lib/@next/TextArea/TextArea.js +9 -4
- package/lib/@next/TextInput/TextInput.d.ts +4 -0
- package/lib/@next/TextInput/TextInput.js +5 -1
- package/package.json +1 -1
|
@@ -7,6 +7,8 @@ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElem
|
|
|
7
7
|
floatingFontSize?: string;
|
|
8
8
|
isPlaceholderFloating?: boolean;
|
|
9
9
|
required?: boolean;
|
|
10
|
+
placeholderColor?: string;
|
|
11
|
+
floatingPlaceholderTop?: number;
|
|
10
12
|
prefix?: React.ReactNode;
|
|
11
13
|
suffix?: React.ReactNode;
|
|
12
14
|
inputRef?: React.Ref<HTMLInputElement>;
|
package/es/@next/Input/Input.js
CHANGED
|
@@ -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 = ["error", "disabled", "prefix", "suffix", "inputRef", "height", "border", "borderRadius", "floatingFontSize", "isPlaceholderFloating", "placeholder", "required"];
|
|
3
|
+
var _excluded = ["error", "disabled", "prefix", "suffix", "inputRef", "height", "border", "borderRadius", "floatingFontSize", "isPlaceholderFloating", "placeholder", "required", "placeholderColor", "floatingPlaceholderTop"];
|
|
4
4
|
import React, { useEffect, useRef } from 'react';
|
|
5
5
|
import { AsteriskIcon, FloatingLabel, StyledContainer, StyledInput, StyledPrefixContainer, StyledSuffixContainer } from './InputStyle';
|
|
6
6
|
export var Input = /*#__PURE__*/React.forwardRef(function Input(_ref, ref) {
|
|
@@ -16,6 +16,8 @@ export var Input = /*#__PURE__*/React.forwardRef(function Input(_ref, ref) {
|
|
|
16
16
|
isPlaceholderFloating = _ref.isPlaceholderFloating,
|
|
17
17
|
placeholder = _ref.placeholder,
|
|
18
18
|
required = _ref.required,
|
|
19
|
+
placeholderColor = _ref.placeholderColor,
|
|
20
|
+
floatingPlaceholderTop = _ref.floatingPlaceholderTop,
|
|
19
21
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
20
22
|
var hasPrefix = !!prefix;
|
|
21
23
|
var hasSuffix = !!suffix;
|
|
@@ -62,13 +64,16 @@ export var Input = /*#__PURE__*/React.forwardRef(function Input(_ref, ref) {
|
|
|
62
64
|
suffixWidth: suffixWidth
|
|
63
65
|
}, /*#__PURE__*/React.createElement(Prefix, null), /*#__PURE__*/React.createElement(StyledInput, _extends({
|
|
64
66
|
ref: inputRef,
|
|
65
|
-
placeholder: isPlaceholderFloating ? undefined : selectedPlaceholder,
|
|
67
|
+
placeholder: isPlaceholderFloating && !disabled ? undefined : selectedPlaceholder,
|
|
66
68
|
borderRadius: borderRadius,
|
|
67
69
|
border: border,
|
|
68
70
|
height: height,
|
|
69
71
|
disabled: disabled
|
|
70
|
-
}, props)), isPlaceholderFloating && /*#__PURE__*/React.createElement(FloatingLabel, {
|
|
72
|
+
}, props)), isPlaceholderFloating && !disabled && /*#__PURE__*/React.createElement(FloatingLabel, {
|
|
71
73
|
"data-testid": "textarea-label",
|
|
72
|
-
|
|
74
|
+
"data-error": error,
|
|
75
|
+
fontSize: floatingFontSize,
|
|
76
|
+
color: placeholderColor,
|
|
77
|
+
top: floatingPlaceholderTop
|
|
73
78
|
}, placeholder, required && /*#__PURE__*/React.createElement(AsteriskIcon, null, "*")), /*#__PURE__*/React.createElement(Suffix, null));
|
|
74
79
|
});
|
|
@@ -16,6 +16,7 @@ export declare const FloatingLabel: import("styled-components").StyledComponent<
|
|
|
16
16
|
top?: number;
|
|
17
17
|
left?: number;
|
|
18
18
|
fontSize?: string;
|
|
19
|
+
color?: string;
|
|
19
20
|
}, never>;
|
|
20
21
|
export declare const StyledInput: import("styled-components").StyledComponent<"input", any, InputProps, never>;
|
|
21
22
|
export declare const AsteriskIcon: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
@@ -27,7 +27,7 @@ export var StyledSuffixContainer = styled(StyledPrefixContainer).withConfig({
|
|
|
27
27
|
export var FloatingLabel = styled.label.withConfig({
|
|
28
28
|
displayName: "InputStyle__FloatingLabel",
|
|
29
29
|
componentId: "sc-15z2mnd-3"
|
|
30
|
-
})(["position:absolute;left:", "em;top:", "em;visibility:visible;padding:0 0.3em;background:white;font-size:", ";color:", ";"], function (_ref2) {
|
|
30
|
+
})(["position:absolute;left:", "em;top:", "em;visibility:visible;padding:0 0.3em;background:white;font-size:", ";color:", ";transition:color 0.2s ease-in-out;pointer-events:none;[data-error='true'] &{color:", ";}"], function (_ref2) {
|
|
31
31
|
var left = _ref2.left;
|
|
32
32
|
return left != null ? left : '0.5';
|
|
33
33
|
}, function (_ref3) {
|
|
@@ -36,18 +36,21 @@ export var FloatingLabel = styled.label.withConfig({
|
|
|
36
36
|
}, function (_ref4) {
|
|
37
37
|
var fontSize = _ref4.fontSize;
|
|
38
38
|
return fontSize != null ? fontSize : '12px';
|
|
39
|
-
},
|
|
39
|
+
}, function (_ref5) {
|
|
40
|
+
var color = _ref5.color;
|
|
41
|
+
return color != null ? color : Greyscale.devilsgrey;
|
|
42
|
+
}, Red.B93);
|
|
40
43
|
export var StyledInput = styled.input.withConfig({
|
|
41
44
|
displayName: "InputStyle__StyledInput",
|
|
42
45
|
componentId: "sc-15z2mnd-4"
|
|
43
|
-
})(["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;}"], Neutral.B100, function (
|
|
44
|
-
var border =
|
|
46
|
+
})(["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;}"], Neutral.B100, function (_ref6) {
|
|
47
|
+
var border = _ref6.border;
|
|
45
48
|
return border != null ? border : "1px solid " + Neutral.B68;
|
|
46
|
-
}, function (
|
|
47
|
-
var borderRadius =
|
|
49
|
+
}, function (_ref7) {
|
|
50
|
+
var borderRadius = _ref7.borderRadius;
|
|
48
51
|
return borderRadius != null ? borderRadius : borderRadius4;
|
|
49
|
-
}, NotoSans, Neutral.B18, function (
|
|
50
|
-
var height =
|
|
52
|
+
}, NotoSans, Neutral.B18, function (_ref8) {
|
|
53
|
+
var height = _ref8.height;
|
|
51
54
|
return height != null ? height : "36px";
|
|
52
55
|
}, Neutral.B68, Neutral.B100, Breakpoints.large);
|
|
53
56
|
export var AsteriskIcon = styled.span.withConfig({
|
|
@@ -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 = ["border", "borderRadius", "isPlaceholderFloating", "
|
|
3
|
+
var _excluded = ["required", "border", "borderRadius", "isPlaceholderFloating", "floatingFontSize", "placeholderColor", "floatingPlaceholderTop"];
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import styled from 'styled-components';
|
|
6
6
|
import { Input } from '../Input/Input';
|
|
@@ -9,10 +9,13 @@ var StyledInput = styled(Input).withConfig({
|
|
|
9
9
|
componentId: "sc-1f5ws9y-0"
|
|
10
10
|
})(["&[type='number']{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;}&[type='number']::-webkit-inner-spin-button,&[type='number']::-webkit-outer-spin-button{-webkit-appearance:none;}"]);
|
|
11
11
|
export var NumberInput = /*#__PURE__*/React.forwardRef(function NumberInput(_ref, ref) {
|
|
12
|
-
var
|
|
12
|
+
var required = _ref.required,
|
|
13
|
+
border = _ref.border,
|
|
13
14
|
borderRadius = _ref.borderRadius,
|
|
14
15
|
isPlaceholderFloating = _ref.isPlaceholderFloating,
|
|
15
|
-
|
|
16
|
+
floatingFontSize = _ref.floatingFontSize,
|
|
17
|
+
placeholderColor = _ref.placeholderColor,
|
|
18
|
+
floatingPlaceholderTop = _ref.floatingPlaceholderTop,
|
|
16
19
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
17
20
|
return /*#__PURE__*/React.createElement(StyledInput, _extends({
|
|
18
21
|
ref: ref,
|
|
@@ -21,6 +24,9 @@ export var NumberInput = /*#__PURE__*/React.forwardRef(function NumberInput(_ref
|
|
|
21
24
|
border: border,
|
|
22
25
|
borderRadius: borderRadius,
|
|
23
26
|
required: required,
|
|
24
|
-
isPlaceholderFloating: isPlaceholderFloating
|
|
27
|
+
isPlaceholderFloating: isPlaceholderFloating,
|
|
28
|
+
floatingFontSize: floatingFontSize,
|
|
29
|
+
placeholderColor: placeholderColor,
|
|
30
|
+
floatingPlaceholderTop: floatingPlaceholderTop
|
|
25
31
|
}));
|
|
26
32
|
});
|
|
@@ -7,6 +7,9 @@ export declare type PasswordInputProps = Omit<React.InputHTMLAttributes<HTMLInpu
|
|
|
7
7
|
borderRadius?: string;
|
|
8
8
|
required?: boolean;
|
|
9
9
|
isPlaceholderFloating?: boolean;
|
|
10
|
+
floatingFontSize?: string;
|
|
11
|
+
placeholderColor?: string;
|
|
12
|
+
floatingPlaceholderTop?: number;
|
|
10
13
|
};
|
|
11
14
|
export declare const PasswordInput: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "onChange"> & {
|
|
12
15
|
onChange?: (value: string) => void;
|
|
@@ -16,4 +19,7 @@ export declare const PasswordInput: React.ForwardRefExoticComponent<Omit<React.I
|
|
|
16
19
|
borderRadius?: string;
|
|
17
20
|
required?: boolean;
|
|
18
21
|
isPlaceholderFloating?: boolean;
|
|
22
|
+
floatingFontSize?: string;
|
|
23
|
+
placeholderColor?: string;
|
|
24
|
+
floatingPlaceholderTop?: number;
|
|
19
25
|
} & 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 = ["value", "onChange", "error", "height", "border", "borderRadius", "required", "isPlaceholderFloating"];
|
|
3
|
+
var _excluded = ["value", "onChange", "error", "height", "border", "borderRadius", "required", "isPlaceholderFloating", "floatingFontSize", "placeholderColor", "floatingPlaceholderTop"];
|
|
4
4
|
import React, { useState } from 'react';
|
|
5
5
|
import { Icon } from '../Icon';
|
|
6
6
|
import { Input } from '../Input/Input';
|
|
@@ -14,6 +14,9 @@ export var PasswordInput = /*#__PURE__*/React.forwardRef(function PasswordInput(
|
|
|
14
14
|
borderRadius = _ref.borderRadius,
|
|
15
15
|
required = _ref.required,
|
|
16
16
|
isPlaceholderFloating = _ref.isPlaceholderFloating,
|
|
17
|
+
floatingFontSize = _ref.floatingFontSize,
|
|
18
|
+
placeholderColor = _ref.placeholderColor,
|
|
19
|
+
floatingPlaceholderTop = _ref.floatingPlaceholderTop,
|
|
17
20
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
18
21
|
var _useState = useState(false),
|
|
19
22
|
showPassword = _useState[0],
|
|
@@ -41,6 +44,9 @@ export var PasswordInput = /*#__PURE__*/React.forwardRef(function PasswordInput(
|
|
|
41
44
|
border: border,
|
|
42
45
|
borderRadius: borderRadius,
|
|
43
46
|
required: required,
|
|
44
|
-
isPlaceholderFloating: isPlaceholderFloating
|
|
47
|
+
isPlaceholderFloating: isPlaceholderFloating,
|
|
48
|
+
floatingFontSize: floatingFontSize,
|
|
49
|
+
placeholderColor: placeholderColor,
|
|
50
|
+
floatingPlaceholderTop: floatingPlaceholderTop
|
|
45
51
|
}, props)));
|
|
46
52
|
});
|
|
@@ -56,7 +56,8 @@ export interface SelectProps {
|
|
|
56
56
|
border?: string;
|
|
57
57
|
borderRadius?: string;
|
|
58
58
|
required?: boolean;
|
|
59
|
+
isPopoverActive?: boolean;
|
|
59
60
|
isPlaceholderFloating?: boolean;
|
|
60
61
|
}
|
|
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;
|
|
62
|
+
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, isPopoverActive, }: SelectProps) => JSX.Element;
|
|
62
63
|
export {};
|
|
@@ -48,7 +48,8 @@ export var Select = function Select(_ref) {
|
|
|
48
48
|
border = _ref.border,
|
|
49
49
|
borderRadius = _ref.borderRadius,
|
|
50
50
|
required = _ref.required,
|
|
51
|
-
isPlaceholderFloating = _ref.isPlaceholderFloating
|
|
51
|
+
isPlaceholderFloating = _ref.isPlaceholderFloating,
|
|
52
|
+
isPopoverActive = _ref.isPopoverActive;
|
|
52
53
|
var _useState = useState(false),
|
|
53
54
|
popoverActive = _useState[0],
|
|
54
55
|
setPopoverActive = _useState[1];
|
|
@@ -78,6 +79,11 @@ export var Select = function Select(_ref) {
|
|
|
78
79
|
var updateMenuOptions = function updateMenuOptions(newState) {
|
|
79
80
|
setMenuOptions(newState);
|
|
80
81
|
};
|
|
82
|
+
useEffect(function () {
|
|
83
|
+
if (isPopoverActive === false && popoverActive) {
|
|
84
|
+
setPopoverActive(false);
|
|
85
|
+
}
|
|
86
|
+
}, [isPopoverActive, popoverActive]);
|
|
81
87
|
var handleClose = function handleClose() {
|
|
82
88
|
setPopoverActive(false);
|
|
83
89
|
onClose == null ? void 0 : onClose();
|
|
@@ -12,6 +12,8 @@ export declare const StyledTextInput: import("styled-components").StyledComponen
|
|
|
12
12
|
required?: boolean;
|
|
13
13
|
isPlaceholderFloating?: boolean;
|
|
14
14
|
floatingFontSize?: string;
|
|
15
|
+
placeholderColor?: string;
|
|
16
|
+
floatingPlaceholderTop?: number;
|
|
15
17
|
} & import("react").RefAttributes<HTMLInputElement>>, any, {}, never>;
|
|
16
18
|
export declare const StyledSelectTypography: import("styled-components").StyledComponent<({ as, children, variant, style, ...props }: import("../../../Typography").TypographyProps) => JSX.Element, any, {}, never>;
|
|
17
19
|
export declare const WithPrefixContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -141,7 +141,9 @@ export var SearchableSelectInput = /*#__PURE__*/forwardRef(function SearchableSe
|
|
|
141
141
|
height: height
|
|
142
142
|
}, prefix), showSelected && /*#__PURE__*/React.createElement(StyledSelectedValue, {
|
|
143
143
|
className: "searchable-select",
|
|
144
|
-
onClick: handleSelectedClick
|
|
144
|
+
onClick: handleSelectedClick,
|
|
145
|
+
border: border,
|
|
146
|
+
borderRadius: borderRadius
|
|
145
147
|
}, /*#__PURE__*/React.createElement(StyledSelected, null, ((_options$find = options.find(function (option) {
|
|
146
148
|
return option.value === selectedValue;
|
|
147
149
|
})) == null ? void 0 : _options$find.label) || selectedValue)), showInput && /*#__PURE__*/React.createElement(InputContainer, null, /*#__PURE__*/React.createElement(StyledInput, _extends({
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export declare const StyledContainer: import("styled-components").StyledComponent<"div", any, import("../../../Input/Input").InputProps & import("../../../Input/InputStyle").PreffixSuffixWidthProps, never>;
|
|
2
2
|
export declare const StyledSelected: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
3
|
-
export declare const StyledSelectedValue: import("styled-components").StyledComponent<"div", any, {
|
|
3
|
+
export declare const StyledSelectedValue: import("styled-components").StyledComponent<"div", any, {
|
|
4
|
+
border?: string;
|
|
5
|
+
borderRadius?: string;
|
|
6
|
+
}, never>;
|
|
4
7
|
export declare const InputContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
8
|
export declare const ClearSelectedContainer: import("styled-components").StyledComponent<"div", any, {
|
|
6
9
|
height?: string;
|
|
@@ -26,7 +26,13 @@ export var StyledSelected = styled.span.withConfig({
|
|
|
26
26
|
export var StyledSelectedValue = styled.div.withConfig({
|
|
27
27
|
displayName: "SearchableSelectInputStyle__StyledSelectedValue",
|
|
28
28
|
componentId: "sc-1oj168h-2"
|
|
29
|
-
})(["border:
|
|
29
|
+
})(["border:", ";border-radius:", ";background:transparent;box-sizing:border-box;padding:0 12px;height:36px;display:flex;align-items:center;grid-column:1 / 1;grid-row:1 / 1;font-family:", ",sans-serif;font-style:normal;font-weight:400;font-size:16px;line-height:150%;color:", ";@media (max-width:", "){font-size:14px;}"], function (_ref) {
|
|
30
|
+
var border = _ref.border;
|
|
31
|
+
return border != null ? border : "1px solid " + Neutral.B68;
|
|
32
|
+
}, function (_ref2) {
|
|
33
|
+
var borderRadius = _ref2.borderRadius;
|
|
34
|
+
return borderRadius != null ? borderRadius : borderRadius4;
|
|
35
|
+
}, NotoSans, Neutral.B18, Breakpoints.large);
|
|
30
36
|
export var InputContainer = styled.div.withConfig({
|
|
31
37
|
displayName: "SearchableSelectInputStyle__InputContainer",
|
|
32
38
|
componentId: "sc-1oj168h-3"
|
|
@@ -18,6 +18,8 @@ export declare type TextAreaProps = Omit<TextareaHTMLAttributes<HTMLTextAreaElem
|
|
|
18
18
|
required?: boolean;
|
|
19
19
|
isPlaceholderFloating?: boolean;
|
|
20
20
|
floatingFontSize?: string;
|
|
21
|
+
floatingPlaceholderTop?: number;
|
|
22
|
+
placeholderColor?: string;
|
|
21
23
|
};
|
|
22
24
|
export declare const TextArea: React.ForwardRefExoticComponent<Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "onChange"> & {
|
|
23
25
|
value: string;
|
|
@@ -38,4 +40,6 @@ export declare const TextArea: React.ForwardRefExoticComponent<Omit<React.Textar
|
|
|
38
40
|
required?: boolean;
|
|
39
41
|
isPlaceholderFloating?: boolean;
|
|
40
42
|
floatingFontSize?: string;
|
|
43
|
+
floatingPlaceholderTop?: number;
|
|
44
|
+
placeholderColor?: string;
|
|
41
45
|
} & React.RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -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", "rows", "maxLength", "error", "disabled", "width", "onChange", "forwardedRef", "canExceedMaxLength", "required", "border", "borderRadius", "isPlaceholderFloating", "floatingFontSize", "placeholder"];
|
|
3
|
+
var _excluded = ["value", "rows", "maxLength", "error", "disabled", "width", "onChange", "forwardedRef", "canExceedMaxLength", "required", "border", "borderRadius", "isPlaceholderFloating", "floatingFontSize", "placeholder", "floatingPlaceholderTop", "placeholderColor"];
|
|
4
4
|
import React, { useRef, useState } from 'react';
|
|
5
5
|
import { StyledTextAreaContainer, StyledTextArea, StyledWordCountContainer } from './TextAreaStyle';
|
|
6
6
|
import { Typography } from '../Typography';
|
|
@@ -26,6 +26,8 @@ var _TextArea = function _TextArea(_ref) {
|
|
|
26
26
|
isPlaceholderFloating = _ref.isPlaceholderFloating,
|
|
27
27
|
floatingFontSize = _ref.floatingFontSize,
|
|
28
28
|
placeholder = _ref.placeholder,
|
|
29
|
+
floatingPlaceholderTop = _ref.floatingPlaceholderTop,
|
|
30
|
+
placeholderColor = _ref.placeholderColor,
|
|
29
31
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
30
32
|
var _useState = useState(false),
|
|
31
33
|
isFocused = _useState[0],
|
|
@@ -70,16 +72,19 @@ var _TextArea = function _TextArea(_ref) {
|
|
|
70
72
|
},
|
|
71
73
|
border: border,
|
|
72
74
|
borderRadius: borderRadius,
|
|
73
|
-
placeholder: isPlaceholderFloating ? undefined : placeholder
|
|
75
|
+
placeholder: isPlaceholderFloating && !disabled ? undefined : placeholder
|
|
74
76
|
}, props)), hasMaxLengthEnforced && /*#__PURE__*/React.createElement(StyledWordCountContainer, {
|
|
75
77
|
"data-disabled": disabled,
|
|
76
78
|
"data-error": hasError
|
|
77
79
|
}, /*#__PURE__*/React.createElement(Typography, {
|
|
78
80
|
as: "span",
|
|
79
81
|
variant: "overline"
|
|
80
|
-
}, charCount, " / ", maxLength)), isPlaceholderFloating && /*#__PURE__*/React.createElement(FloatingLabel, {
|
|
82
|
+
}, charCount, " / ", maxLength)), isPlaceholderFloating && !disabled && /*#__PURE__*/React.createElement(FloatingLabel, {
|
|
81
83
|
"data-testid": "textarea-label",
|
|
82
|
-
|
|
84
|
+
"data-error": error,
|
|
85
|
+
fontSize: floatingFontSize,
|
|
86
|
+
color: placeholderColor,
|
|
87
|
+
top: floatingPlaceholderTop
|
|
83
88
|
}, placeholder, required && /*#__PURE__*/React.createElement(AsteriskIcon, null, "*")));
|
|
84
89
|
};
|
|
85
90
|
var forwardRef = function forwardRef(props, ref) {
|
|
@@ -9,6 +9,8 @@ export declare type TextInputProps = Omit<InputProps, 'type' | 'onChange'> & {
|
|
|
9
9
|
required?: boolean;
|
|
10
10
|
isPlaceholderFloating?: boolean;
|
|
11
11
|
floatingFontSize?: string;
|
|
12
|
+
placeholderColor?: string;
|
|
13
|
+
floatingPlaceholderTop?: number;
|
|
12
14
|
};
|
|
13
15
|
export declare const TextInput: React.ForwardRefExoticComponent<Omit<InputProps, "type" | "onChange"> & {
|
|
14
16
|
canClear?: boolean;
|
|
@@ -19,4 +21,6 @@ export declare const TextInput: React.ForwardRefExoticComponent<Omit<InputProps,
|
|
|
19
21
|
required?: boolean;
|
|
20
22
|
isPlaceholderFloating?: boolean;
|
|
21
23
|
floatingFontSize?: string;
|
|
24
|
+
placeholderColor?: string;
|
|
25
|
+
floatingPlaceholderTop?: number;
|
|
22
26
|
} & 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", "height", "border", "borderRadius", "required", "floatingFontSize", "isPlaceholderFloating"];
|
|
3
|
+
var _excluded = ["canClear", "suffix", "value", "onChange", "error", "height", "border", "borderRadius", "required", "floatingFontSize", "isPlaceholderFloating", "placeholderColor", "floatingPlaceholderTop"];
|
|
4
4
|
import React, { useEffect, useState } from 'react';
|
|
5
5
|
import { Icon } from '../Icon';
|
|
6
6
|
import { Input } from '../Input/Input';
|
|
@@ -16,6 +16,8 @@ export var TextInput = /*#__PURE__*/React.forwardRef(function TextInput(_ref, re
|
|
|
16
16
|
required = _ref.required,
|
|
17
17
|
floatingFontSize = _ref.floatingFontSize,
|
|
18
18
|
isPlaceholderFloating = _ref.isPlaceholderFloating,
|
|
19
|
+
placeholderColor = _ref.placeholderColor,
|
|
20
|
+
floatingPlaceholderTop = _ref.floatingPlaceholderTop,
|
|
19
21
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
20
22
|
var ClearIcon = function ClearIcon() {
|
|
21
23
|
return /*#__PURE__*/React.createElement(Icon, {
|
|
@@ -55,6 +57,8 @@ export var TextInput = /*#__PURE__*/React.forwardRef(function TextInput(_ref, re
|
|
|
55
57
|
borderRadius: borderRadius,
|
|
56
58
|
floatingFontSize: floatingFontSize,
|
|
57
59
|
isPlaceholderFloating: isPlaceholderFloating,
|
|
60
|
+
placeholderColor: placeholderColor,
|
|
61
|
+
floatingPlaceholderTop: floatingPlaceholderTop,
|
|
58
62
|
required: required,
|
|
59
63
|
height: height
|
|
60
64
|
}, props));
|
|
@@ -7,6 +7,8 @@ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElem
|
|
|
7
7
|
floatingFontSize?: string;
|
|
8
8
|
isPlaceholderFloating?: boolean;
|
|
9
9
|
required?: boolean;
|
|
10
|
+
placeholderColor?: string;
|
|
11
|
+
floatingPlaceholderTop?: number;
|
|
10
12
|
prefix?: React.ReactNode;
|
|
11
13
|
suffix?: React.ReactNode;
|
|
12
14
|
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", "height", "border", "borderRadius", "floatingFontSize", "isPlaceholderFloating", "placeholder", "required"];
|
|
10
|
+
var _excluded = ["error", "disabled", "prefix", "suffix", "inputRef", "height", "border", "borderRadius", "floatingFontSize", "isPlaceholderFloating", "placeholder", "required", "placeholderColor", "floatingPlaceholderTop"];
|
|
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) {
|
|
@@ -23,6 +23,8 @@ var Input = /*#__PURE__*/_react["default"].forwardRef(function Input(_ref, ref)
|
|
|
23
23
|
isPlaceholderFloating = _ref.isPlaceholderFloating,
|
|
24
24
|
placeholder = _ref.placeholder,
|
|
25
25
|
required = _ref.required,
|
|
26
|
+
placeholderColor = _ref.placeholderColor,
|
|
27
|
+
floatingPlaceholderTop = _ref.floatingPlaceholderTop,
|
|
26
28
|
props = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
|
|
27
29
|
var hasPrefix = !!prefix;
|
|
28
30
|
var hasSuffix = !!suffix;
|
|
@@ -69,14 +71,17 @@ var Input = /*#__PURE__*/_react["default"].forwardRef(function Input(_ref, ref)
|
|
|
69
71
|
suffixWidth: suffixWidth
|
|
70
72
|
}, /*#__PURE__*/_react["default"].createElement(Prefix, null), /*#__PURE__*/_react["default"].createElement(_InputStyle.StyledInput, (0, _extends2["default"])({
|
|
71
73
|
ref: inputRef,
|
|
72
|
-
placeholder: isPlaceholderFloating ? undefined : selectedPlaceholder,
|
|
74
|
+
placeholder: isPlaceholderFloating && !disabled ? undefined : selectedPlaceholder,
|
|
73
75
|
borderRadius: borderRadius,
|
|
74
76
|
border: border,
|
|
75
77
|
height: height,
|
|
76
78
|
disabled: disabled
|
|
77
|
-
}, props)), isPlaceholderFloating && /*#__PURE__*/_react["default"].createElement(_InputStyle.FloatingLabel, {
|
|
79
|
+
}, props)), isPlaceholderFloating && !disabled && /*#__PURE__*/_react["default"].createElement(_InputStyle.FloatingLabel, {
|
|
78
80
|
"data-testid": "textarea-label",
|
|
79
|
-
|
|
81
|
+
"data-error": error,
|
|
82
|
+
fontSize: floatingFontSize,
|
|
83
|
+
color: placeholderColor,
|
|
84
|
+
top: floatingPlaceholderTop
|
|
80
85
|
}, placeholder, required && /*#__PURE__*/_react["default"].createElement(_InputStyle.AsteriskIcon, null, "*")), /*#__PURE__*/_react["default"].createElement(Suffix, null));
|
|
81
86
|
});
|
|
82
87
|
exports.Input = Input;
|
|
@@ -16,6 +16,7 @@ export declare const FloatingLabel: import("styled-components").StyledComponent<
|
|
|
16
16
|
top?: number;
|
|
17
17
|
left?: number;
|
|
18
18
|
fontSize?: string;
|
|
19
|
+
color?: string;
|
|
19
20
|
}, never>;
|
|
20
21
|
export declare const StyledInput: import("styled-components").StyledComponent<"input", any, InputProps, never>;
|
|
21
22
|
export declare const AsteriskIcon: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
@@ -37,7 +37,7 @@ exports.StyledSuffixContainer = StyledSuffixContainer;
|
|
|
37
37
|
var FloatingLabel = _styledComponents["default"].label.withConfig({
|
|
38
38
|
displayName: "InputStyle__FloatingLabel",
|
|
39
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) {
|
|
40
|
+
})(["position:absolute;left:", "em;top:", "em;visibility:visible;padding:0 0.3em;background:white;font-size:", ";color:", ";transition:color 0.2s ease-in-out;pointer-events:none;[data-error='true'] &{color:", ";}"], function (_ref2) {
|
|
41
41
|
var left = _ref2.left;
|
|
42
42
|
return left != null ? left : '0.5';
|
|
43
43
|
}, function (_ref3) {
|
|
@@ -46,19 +46,22 @@ var FloatingLabel = _styledComponents["default"].label.withConfig({
|
|
|
46
46
|
}, function (_ref4) {
|
|
47
47
|
var fontSize = _ref4.fontSize;
|
|
48
48
|
return fontSize != null ? fontSize : '12px';
|
|
49
|
-
},
|
|
49
|
+
}, function (_ref5) {
|
|
50
|
+
var color = _ref5.color;
|
|
51
|
+
return color != null ? color : _Colors.Greyscale.devilsgrey;
|
|
52
|
+
}, _colors.Red.B93);
|
|
50
53
|
exports.FloatingLabel = FloatingLabel;
|
|
51
54
|
var StyledInput = _styledComponents["default"].input.withConfig({
|
|
52
55
|
displayName: "InputStyle__StyledInput",
|
|
53
56
|
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 (
|
|
55
|
-
var border =
|
|
57
|
+
})(["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 (_ref6) {
|
|
58
|
+
var border = _ref6.border;
|
|
56
59
|
return border != null ? border : "1px solid " + _colors.Neutral.B68;
|
|
57
|
-
}, function (
|
|
58
|
-
var borderRadius =
|
|
60
|
+
}, function (_ref7) {
|
|
61
|
+
var borderRadius = _ref7.borderRadius;
|
|
59
62
|
return borderRadius != null ? borderRadius : _borderRadius.borderRadius4;
|
|
60
|
-
}, _fonts.NotoSans, _colors.Neutral.B18, function (
|
|
61
|
-
var height =
|
|
63
|
+
}, _fonts.NotoSans, _colors.Neutral.B18, function (_ref8) {
|
|
64
|
+
var height = _ref8.height;
|
|
62
65
|
return height != null ? height : "36px";
|
|
63
66
|
}, _colors.Neutral.B68, _colors.Neutral.B100, Breakpoints.large);
|
|
64
67
|
exports.StyledInput = StyledInput;
|
|
@@ -8,16 +8,19 @@ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runt
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
10
|
var _Input = require("../Input/Input");
|
|
11
|
-
var _excluded = ["border", "borderRadius", "isPlaceholderFloating", "
|
|
11
|
+
var _excluded = ["required", "border", "borderRadius", "isPlaceholderFloating", "floatingFontSize", "placeholderColor", "floatingPlaceholderTop"];
|
|
12
12
|
var StyledInput = (0, _styledComponents["default"])(_Input.Input).withConfig({
|
|
13
13
|
displayName: "NumberInput__StyledInput",
|
|
14
14
|
componentId: "sc-1f5ws9y-0"
|
|
15
15
|
})(["&[type='number']{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;}&[type='number']::-webkit-inner-spin-button,&[type='number']::-webkit-outer-spin-button{-webkit-appearance:none;}"]);
|
|
16
16
|
var NumberInput = /*#__PURE__*/_react["default"].forwardRef(function NumberInput(_ref, ref) {
|
|
17
|
-
var
|
|
17
|
+
var required = _ref.required,
|
|
18
|
+
border = _ref.border,
|
|
18
19
|
borderRadius = _ref.borderRadius,
|
|
19
20
|
isPlaceholderFloating = _ref.isPlaceholderFloating,
|
|
20
|
-
|
|
21
|
+
floatingFontSize = _ref.floatingFontSize,
|
|
22
|
+
placeholderColor = _ref.placeholderColor,
|
|
23
|
+
floatingPlaceholderTop = _ref.floatingPlaceholderTop,
|
|
21
24
|
props = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
|
|
22
25
|
return /*#__PURE__*/_react["default"].createElement(StyledInput, (0, _extends2["default"])({
|
|
23
26
|
ref: ref,
|
|
@@ -26,7 +29,10 @@ var NumberInput = /*#__PURE__*/_react["default"].forwardRef(function NumberInput
|
|
|
26
29
|
border: border,
|
|
27
30
|
borderRadius: borderRadius,
|
|
28
31
|
required: required,
|
|
29
|
-
isPlaceholderFloating: isPlaceholderFloating
|
|
32
|
+
isPlaceholderFloating: isPlaceholderFloating,
|
|
33
|
+
floatingFontSize: floatingFontSize,
|
|
34
|
+
placeholderColor: placeholderColor,
|
|
35
|
+
floatingPlaceholderTop: floatingPlaceholderTop
|
|
30
36
|
}));
|
|
31
37
|
});
|
|
32
38
|
exports.NumberInput = NumberInput;
|
|
@@ -7,6 +7,9 @@ export declare type PasswordInputProps = Omit<React.InputHTMLAttributes<HTMLInpu
|
|
|
7
7
|
borderRadius?: string;
|
|
8
8
|
required?: boolean;
|
|
9
9
|
isPlaceholderFloating?: boolean;
|
|
10
|
+
floatingFontSize?: string;
|
|
11
|
+
placeholderColor?: string;
|
|
12
|
+
floatingPlaceholderTop?: number;
|
|
10
13
|
};
|
|
11
14
|
export declare const PasswordInput: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "onChange"> & {
|
|
12
15
|
onChange?: (value: string) => void;
|
|
@@ -16,4 +19,7 @@ export declare const PasswordInput: React.ForwardRefExoticComponent<Omit<React.I
|
|
|
16
19
|
borderRadius?: string;
|
|
17
20
|
required?: boolean;
|
|
18
21
|
isPlaceholderFloating?: boolean;
|
|
22
|
+
floatingFontSize?: string;
|
|
23
|
+
placeholderColor?: string;
|
|
24
|
+
floatingPlaceholderTop?: number;
|
|
19
25
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -9,7 +9,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
var _Icon = require("../Icon");
|
|
10
10
|
var _Input = require("../Input/Input");
|
|
11
11
|
var _PasswordInputStyle = require("./PasswordInputStyle");
|
|
12
|
-
var _excluded = ["value", "onChange", "error", "height", "border", "borderRadius", "required", "isPlaceholderFloating"];
|
|
12
|
+
var _excluded = ["value", "onChange", "error", "height", "border", "borderRadius", "required", "isPlaceholderFloating", "floatingFontSize", "placeholderColor", "floatingPlaceholderTop"];
|
|
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 PasswordInput = /*#__PURE__*/_react["default"].forwardRef(function PasswordInput(_ref, ref) {
|
|
@@ -21,6 +21,9 @@ var PasswordInput = /*#__PURE__*/_react["default"].forwardRef(function PasswordI
|
|
|
21
21
|
borderRadius = _ref.borderRadius,
|
|
22
22
|
required = _ref.required,
|
|
23
23
|
isPlaceholderFloating = _ref.isPlaceholderFloating,
|
|
24
|
+
floatingFontSize = _ref.floatingFontSize,
|
|
25
|
+
placeholderColor = _ref.placeholderColor,
|
|
26
|
+
floatingPlaceholderTop = _ref.floatingPlaceholderTop,
|
|
24
27
|
props = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
|
|
25
28
|
var _useState = (0, _react.useState)(false),
|
|
26
29
|
showPassword = _useState[0],
|
|
@@ -48,7 +51,10 @@ var PasswordInput = /*#__PURE__*/_react["default"].forwardRef(function PasswordI
|
|
|
48
51
|
border: border,
|
|
49
52
|
borderRadius: borderRadius,
|
|
50
53
|
required: required,
|
|
51
|
-
isPlaceholderFloating: isPlaceholderFloating
|
|
54
|
+
isPlaceholderFloating: isPlaceholderFloating,
|
|
55
|
+
floatingFontSize: floatingFontSize,
|
|
56
|
+
placeholderColor: placeholderColor,
|
|
57
|
+
floatingPlaceholderTop: floatingPlaceholderTop
|
|
52
58
|
}, props)));
|
|
53
59
|
});
|
|
54
60
|
exports.PasswordInput = PasswordInput;
|
|
@@ -56,7 +56,8 @@ export interface SelectProps {
|
|
|
56
56
|
border?: string;
|
|
57
57
|
borderRadius?: string;
|
|
58
58
|
required?: boolean;
|
|
59
|
+
isPopoverActive?: boolean;
|
|
59
60
|
isPlaceholderFloating?: boolean;
|
|
60
61
|
}
|
|
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;
|
|
62
|
+
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, isPopoverActive, }: SelectProps) => JSX.Element;
|
|
62
63
|
export {};
|
|
@@ -54,7 +54,8 @@ var Select = function Select(_ref) {
|
|
|
54
54
|
border = _ref.border,
|
|
55
55
|
borderRadius = _ref.borderRadius,
|
|
56
56
|
required = _ref.required,
|
|
57
|
-
isPlaceholderFloating = _ref.isPlaceholderFloating
|
|
57
|
+
isPlaceholderFloating = _ref.isPlaceholderFloating,
|
|
58
|
+
isPopoverActive = _ref.isPopoverActive;
|
|
58
59
|
var _useState = (0, _react.useState)(false),
|
|
59
60
|
popoverActive = _useState[0],
|
|
60
61
|
setPopoverActive = _useState[1];
|
|
@@ -84,6 +85,11 @@ var Select = function Select(_ref) {
|
|
|
84
85
|
var updateMenuOptions = function updateMenuOptions(newState) {
|
|
85
86
|
setMenuOptions(newState);
|
|
86
87
|
};
|
|
88
|
+
(0, _react.useEffect)(function () {
|
|
89
|
+
if (isPopoverActive === false && popoverActive) {
|
|
90
|
+
setPopoverActive(false);
|
|
91
|
+
}
|
|
92
|
+
}, [isPopoverActive, popoverActive]);
|
|
87
93
|
var handleClose = function handleClose() {
|
|
88
94
|
setPopoverActive(false);
|
|
89
95
|
onClose == null ? void 0 : onClose();
|
|
@@ -12,6 +12,8 @@ export declare const StyledTextInput: import("styled-components").StyledComponen
|
|
|
12
12
|
required?: boolean;
|
|
13
13
|
isPlaceholderFloating?: boolean;
|
|
14
14
|
floatingFontSize?: string;
|
|
15
|
+
placeholderColor?: string;
|
|
16
|
+
floatingPlaceholderTop?: number;
|
|
15
17
|
} & import("react").RefAttributes<HTMLInputElement>>, any, {}, never>;
|
|
16
18
|
export declare const StyledSelectTypography: import("styled-components").StyledComponent<({ as, children, variant, style, ...props }: import("../../../Typography").TypographyProps) => JSX.Element, any, {}, never>;
|
|
17
19
|
export declare const WithPrefixContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -148,7 +148,9 @@ var SearchableSelectInput = /*#__PURE__*/(0, _react.forwardRef)(function Searcha
|
|
|
148
148
|
height: height
|
|
149
149
|
}, prefix), showSelected && /*#__PURE__*/_react["default"].createElement(_SearchableSelectInputStyle.StyledSelectedValue, {
|
|
150
150
|
className: "searchable-select",
|
|
151
|
-
onClick: handleSelectedClick
|
|
151
|
+
onClick: handleSelectedClick,
|
|
152
|
+
border: border,
|
|
153
|
+
borderRadius: borderRadius
|
|
152
154
|
}, /*#__PURE__*/_react["default"].createElement(_SearchableSelectInputStyle.StyledSelected, null, ((_options$find = options.find(function (option) {
|
|
153
155
|
return option.value === selectedValue;
|
|
154
156
|
})) == null ? void 0 : _options$find.label) || selectedValue)), showInput && /*#__PURE__*/_react["default"].createElement(_SearchableSelectInputStyle.InputContainer, null, /*#__PURE__*/_react["default"].createElement(_InputStyle.StyledInput, (0, _extends2["default"])({
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export declare const StyledContainer: import("styled-components").StyledComponent<"div", any, import("../../../Input/Input").InputProps & import("../../../Input/InputStyle").PreffixSuffixWidthProps, never>;
|
|
2
2
|
export declare const StyledSelected: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
3
|
-
export declare const StyledSelectedValue: import("styled-components").StyledComponent<"div", any, {
|
|
3
|
+
export declare const StyledSelectedValue: import("styled-components").StyledComponent<"div", any, {
|
|
4
|
+
border?: string;
|
|
5
|
+
borderRadius?: string;
|
|
6
|
+
}, never>;
|
|
4
7
|
export declare const InputContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
8
|
export declare const ClearSelectedContainer: import("styled-components").StyledComponent<"div", any, {
|
|
6
9
|
height?: string;
|
|
@@ -35,7 +35,13 @@ exports.StyledSelected = StyledSelected;
|
|
|
35
35
|
var StyledSelectedValue = _styledComponents["default"].div.withConfig({
|
|
36
36
|
displayName: "SearchableSelectInputStyle__StyledSelectedValue",
|
|
37
37
|
componentId: "sc-1oj168h-2"
|
|
38
|
-
})(["border:
|
|
38
|
+
})(["border:", ";border-radius:", ";background:transparent;box-sizing:border-box;padding:0 12px;height:36px;display:flex;align-items:center;grid-column:1 / 1;grid-row:1 / 1;font-family:", ",sans-serif;font-style:normal;font-weight:400;font-size:16px;line-height:150%;color:", ";@media (max-width:", "){font-size:14px;}"], function (_ref) {
|
|
39
|
+
var border = _ref.border;
|
|
40
|
+
return border != null ? border : "1px solid " + _colors.Neutral.B68;
|
|
41
|
+
}, function (_ref2) {
|
|
42
|
+
var borderRadius = _ref2.borderRadius;
|
|
43
|
+
return borderRadius != null ? borderRadius : _borderRadius.borderRadius4;
|
|
44
|
+
}, _fonts.NotoSans, _colors.Neutral.B18, Breakpoints.large);
|
|
39
45
|
exports.StyledSelectedValue = StyledSelectedValue;
|
|
40
46
|
var InputContainer = _styledComponents["default"].div.withConfig({
|
|
41
47
|
displayName: "SearchableSelectInputStyle__InputContainer",
|
|
@@ -18,6 +18,8 @@ export declare type TextAreaProps = Omit<TextareaHTMLAttributes<HTMLTextAreaElem
|
|
|
18
18
|
required?: boolean;
|
|
19
19
|
isPlaceholderFloating?: boolean;
|
|
20
20
|
floatingFontSize?: string;
|
|
21
|
+
floatingPlaceholderTop?: number;
|
|
22
|
+
placeholderColor?: string;
|
|
21
23
|
};
|
|
22
24
|
export declare const TextArea: React.ForwardRefExoticComponent<Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "onChange"> & {
|
|
23
25
|
value: string;
|
|
@@ -38,4 +40,6 @@ export declare const TextArea: React.ForwardRefExoticComponent<Omit<React.Textar
|
|
|
38
40
|
required?: boolean;
|
|
39
41
|
isPlaceholderFloating?: boolean;
|
|
40
42
|
floatingFontSize?: string;
|
|
43
|
+
floatingPlaceholderTop?: number;
|
|
44
|
+
placeholderColor?: string;
|
|
41
45
|
} & React.RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -9,7 +9,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
var _TextAreaStyle = require("./TextAreaStyle");
|
|
10
10
|
var _Typography = require("../Typography");
|
|
11
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
|
+
var _excluded = ["value", "rows", "maxLength", "error", "disabled", "width", "onChange", "forwardedRef", "canExceedMaxLength", "required", "border", "borderRadius", "isPlaceholderFloating", "floatingFontSize", "placeholder", "floatingPlaceholderTop", "placeholderColor"];
|
|
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 _TextArea = function _TextArea(_ref) {
|
|
@@ -33,6 +33,8 @@ var _TextArea = function _TextArea(_ref) {
|
|
|
33
33
|
isPlaceholderFloating = _ref.isPlaceholderFloating,
|
|
34
34
|
floatingFontSize = _ref.floatingFontSize,
|
|
35
35
|
placeholder = _ref.placeholder,
|
|
36
|
+
floatingPlaceholderTop = _ref.floatingPlaceholderTop,
|
|
37
|
+
placeholderColor = _ref.placeholderColor,
|
|
36
38
|
props = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
|
|
37
39
|
var _useState = (0, _react.useState)(false),
|
|
38
40
|
isFocused = _useState[0],
|
|
@@ -77,16 +79,19 @@ var _TextArea = function _TextArea(_ref) {
|
|
|
77
79
|
},
|
|
78
80
|
border: border,
|
|
79
81
|
borderRadius: borderRadius,
|
|
80
|
-
placeholder: isPlaceholderFloating ? undefined : placeholder
|
|
82
|
+
placeholder: isPlaceholderFloating && !disabled ? undefined : placeholder
|
|
81
83
|
}, props)), hasMaxLengthEnforced && /*#__PURE__*/_react["default"].createElement(_TextAreaStyle.StyledWordCountContainer, {
|
|
82
84
|
"data-disabled": disabled,
|
|
83
85
|
"data-error": hasError
|
|
84
86
|
}, /*#__PURE__*/_react["default"].createElement(_Typography.Typography, {
|
|
85
87
|
as: "span",
|
|
86
88
|
variant: "overline"
|
|
87
|
-
}, charCount, " / ", maxLength)), isPlaceholderFloating && /*#__PURE__*/_react["default"].createElement(_InputStyle.FloatingLabel, {
|
|
89
|
+
}, charCount, " / ", maxLength)), isPlaceholderFloating && !disabled && /*#__PURE__*/_react["default"].createElement(_InputStyle.FloatingLabel, {
|
|
88
90
|
"data-testid": "textarea-label",
|
|
89
|
-
|
|
91
|
+
"data-error": error,
|
|
92
|
+
fontSize: floatingFontSize,
|
|
93
|
+
color: placeholderColor,
|
|
94
|
+
top: floatingPlaceholderTop
|
|
90
95
|
}, placeholder, required && /*#__PURE__*/_react["default"].createElement(_InputStyle.AsteriskIcon, null, "*")));
|
|
91
96
|
};
|
|
92
97
|
var forwardRef = function forwardRef(props, ref) {
|
|
@@ -9,6 +9,8 @@ export declare type TextInputProps = Omit<InputProps, 'type' | 'onChange'> & {
|
|
|
9
9
|
required?: boolean;
|
|
10
10
|
isPlaceholderFloating?: boolean;
|
|
11
11
|
floatingFontSize?: string;
|
|
12
|
+
placeholderColor?: string;
|
|
13
|
+
floatingPlaceholderTop?: number;
|
|
12
14
|
};
|
|
13
15
|
export declare const TextInput: React.ForwardRefExoticComponent<Omit<InputProps, "type" | "onChange"> & {
|
|
14
16
|
canClear?: boolean;
|
|
@@ -19,4 +21,6 @@ export declare const TextInput: React.ForwardRefExoticComponent<Omit<InputProps,
|
|
|
19
21
|
required?: boolean;
|
|
20
22
|
isPlaceholderFloating?: boolean;
|
|
21
23
|
floatingFontSize?: string;
|
|
24
|
+
placeholderColor?: string;
|
|
25
|
+
floatingPlaceholderTop?: number;
|
|
22
26
|
} & 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", "height", "border", "borderRadius", "required", "floatingFontSize", "isPlaceholderFloating"];
|
|
11
|
+
var _excluded = ["canClear", "suffix", "value", "onChange", "error", "height", "border", "borderRadius", "required", "floatingFontSize", "isPlaceholderFloating", "placeholderColor", "floatingPlaceholderTop"];
|
|
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) {
|
|
@@ -23,6 +23,8 @@ var TextInput = /*#__PURE__*/_react["default"].forwardRef(function TextInput(_re
|
|
|
23
23
|
required = _ref.required,
|
|
24
24
|
floatingFontSize = _ref.floatingFontSize,
|
|
25
25
|
isPlaceholderFloating = _ref.isPlaceholderFloating,
|
|
26
|
+
placeholderColor = _ref.placeholderColor,
|
|
27
|
+
floatingPlaceholderTop = _ref.floatingPlaceholderTop,
|
|
26
28
|
props = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
|
|
27
29
|
var ClearIcon = function ClearIcon() {
|
|
28
30
|
return /*#__PURE__*/_react["default"].createElement(_Icon.Icon, {
|
|
@@ -62,6 +64,8 @@ var TextInput = /*#__PURE__*/_react["default"].forwardRef(function TextInput(_re
|
|
|
62
64
|
borderRadius: borderRadius,
|
|
63
65
|
floatingFontSize: floatingFontSize,
|
|
64
66
|
isPlaceholderFloating: isPlaceholderFloating,
|
|
67
|
+
placeholderColor: placeholderColor,
|
|
68
|
+
floatingPlaceholderTop: floatingPlaceholderTop,
|
|
65
69
|
required: required,
|
|
66
70
|
height: height
|
|
67
71
|
}, props));
|