glints-aries 4.1.7 → 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 +8 -0
- package/es/@next/Input/Input.js +27 -5
- package/es/@next/Input/InputStyle.d.ts +15 -2
- package/es/@next/Input/InputStyle.js +36 -3
- package/es/@next/NumberInput/NumberInput.d.ts +12 -2
- package/es/@next/NumberInput/NumberInput.js +20 -2
- package/es/@next/Pagination/PaginationStyle.d.ts +6 -1
- package/es/@next/PasswordInput/PasswordInput.d.ts +16 -0
- package/es/@next/PasswordInput/PasswordInput.js +18 -2
- package/es/@next/Select/Select.d.ts +7 -1
- package/es/@next/Select/Select.js +27 -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 +15 -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 +29 -9
- package/es/@next/Select/components/SearchableSelectInput/SearchableSelectInputStyle.d.ts +11 -2
- package/es/@next/Select/components/SearchableSelectInput/SearchableSelectInputStyle.js +11 -2
- package/es/@next/TextArea/TextArea.d.ts +14 -0
- package/es/@next/TextArea/TextArea.js +25 -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 +16 -0
- package/es/@next/TextInput/TextInput.js +18 -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 +8 -0
- package/lib/@next/Input/Input.js +26 -4
- package/lib/@next/Input/InputStyle.d.ts +15 -2
- package/lib/@next/Input/InputStyle.js +40 -5
- package/lib/@next/NumberInput/NumberInput.d.ts +12 -2
- package/lib/@next/NumberInput/NumberInput.js +20 -2
- package/lib/@next/Pagination/PaginationStyle.d.ts +6 -1
- package/lib/@next/PasswordInput/PasswordInput.d.ts +16 -0
- package/lib/@next/PasswordInput/PasswordInput.js +18 -2
- package/lib/@next/Select/Select.d.ts +7 -1
- package/lib/@next/Select/Select.js +27 -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 +15 -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 +28 -8
- package/lib/@next/Select/components/SearchableSelectInput/SearchableSelectInputStyle.d.ts +11 -2
- package/lib/@next/Select/components/SearchableSelectInput/SearchableSelectInputStyle.js +11 -2
- package/lib/@next/TextArea/TextArea.d.ts +14 -0
- package/lib/@next/TextArea/TextArea.js +25 -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 +16 -0
- package/lib/@next/TextInput/TextInput.js +18 -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,6 +1,14 @@
|
|
|
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;
|
|
10
|
+
placeholderColor?: string;
|
|
11
|
+
floatingPlaceholderTop?: number;
|
|
4
12
|
prefix?: React.ReactNode;
|
|
5
13
|
suffix?: React.ReactNode;
|
|
6
14
|
inputRef?: React.Ref<HTMLInputElement>;
|
package/es/@next/Input/Input.js
CHANGED
|
@@ -1,14 +1,23 @@
|
|
|
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"];
|
|
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
|
-
import { StyledContainer, StyledInput, StyledPrefixContainer, StyledSuffixContainer } from './InputStyle';
|
|
5
|
+
import { AsteriskIcon, FloatingLabel, StyledContainer, StyledInput, StyledPrefixContainer, StyledSuffixContainer } from './InputStyle';
|
|
6
6
|
export var Input = /*#__PURE__*/React.forwardRef(function Input(_ref, ref) {
|
|
7
7
|
var error = _ref.error,
|
|
8
8
|
disabled = _ref.disabled,
|
|
9
9
|
prefix = _ref.prefix,
|
|
10
10
|
suffix = _ref.suffix,
|
|
11
11
|
inputRef = _ref.inputRef,
|
|
12
|
+
height = _ref.height,
|
|
13
|
+
border = _ref.border,
|
|
14
|
+
borderRadius = _ref.borderRadius,
|
|
15
|
+
floatingFontSize = _ref.floatingFontSize,
|
|
16
|
+
isPlaceholderFloating = _ref.isPlaceholderFloating,
|
|
17
|
+
placeholder = _ref.placeholder,
|
|
18
|
+
required = _ref.required,
|
|
19
|
+
placeholderColor = _ref.placeholderColor,
|
|
20
|
+
floatingPlaceholderTop = _ref.floatingPlaceholderTop,
|
|
12
21
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
13
22
|
var hasPrefix = !!prefix;
|
|
14
23
|
var hasSuffix = !!suffix;
|
|
@@ -16,12 +25,14 @@ export var Input = /*#__PURE__*/React.forwardRef(function Input(_ref, ref) {
|
|
|
16
25
|
var suffixRef = useRef(null);
|
|
17
26
|
var Prefix = function Prefix() {
|
|
18
27
|
return hasPrefix ? /*#__PURE__*/React.createElement(StyledPrefixContainer, {
|
|
19
|
-
ref: prefixRef
|
|
28
|
+
ref: prefixRef,
|
|
29
|
+
height: height
|
|
20
30
|
}, prefix) : null;
|
|
21
31
|
};
|
|
22
32
|
var Suffix = function Suffix() {
|
|
23
33
|
return hasSuffix ? /*#__PURE__*/React.createElement(StyledSuffixContainer, {
|
|
24
|
-
ref: suffixRef
|
|
34
|
+
ref: suffixRef,
|
|
35
|
+
height: height
|
|
25
36
|
}, suffix) : null;
|
|
26
37
|
};
|
|
27
38
|
var _React$useState = React.useState(0),
|
|
@@ -42,6 +53,7 @@ export var Input = /*#__PURE__*/React.forwardRef(function Input(_ref, ref) {
|
|
|
42
53
|
setSuffixWidth(_suffixWidth);
|
|
43
54
|
}
|
|
44
55
|
}, [hasSuffix, suffix]);
|
|
56
|
+
var selectedPlaceholder = required ? placeholder + "*" : placeholder;
|
|
45
57
|
return /*#__PURE__*/React.createElement(StyledContainer, {
|
|
46
58
|
ref: ref,
|
|
47
59
|
"data-prefix": hasPrefix,
|
|
@@ -52,6 +64,16 @@ export var Input = /*#__PURE__*/React.forwardRef(function Input(_ref, ref) {
|
|
|
52
64
|
suffixWidth: suffixWidth
|
|
53
65
|
}, /*#__PURE__*/React.createElement(Prefix, null), /*#__PURE__*/React.createElement(StyledInput, _extends({
|
|
54
66
|
ref: inputRef,
|
|
67
|
+
placeholder: isPlaceholderFloating && !disabled ? undefined : selectedPlaceholder,
|
|
68
|
+
borderRadius: borderRadius,
|
|
69
|
+
border: border,
|
|
70
|
+
height: height,
|
|
55
71
|
disabled: disabled
|
|
56
|
-
}, props)), /*#__PURE__*/React.createElement(
|
|
72
|
+
}, props)), isPlaceholderFloating && !disabled && /*#__PURE__*/React.createElement(FloatingLabel, {
|
|
73
|
+
"data-testid": "textarea-label",
|
|
74
|
+
"data-error": error,
|
|
75
|
+
fontSize: floatingFontSize,
|
|
76
|
+
color: placeholderColor,
|
|
77
|
+
top: floatingPlaceholderTop
|
|
78
|
+
}, placeholder, required && /*#__PURE__*/React.createElement(AsteriskIcon, null, "*")), /*#__PURE__*/React.createElement(Suffix, null));
|
|
57
79
|
});
|
|
@@ -4,6 +4,19 @@ 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
|
+
color?: string;
|
|
20
|
+
}, never>;
|
|
9
21
|
export declare const StyledInput: import("styled-components").StyledComponent<"input", any, InputProps, never>;
|
|
22
|
+
export declare const AsteriskIcon: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
@@ -4,6 +4,7 @@ import { Neutral, Red } from '../utilities/colors';
|
|
|
4
4
|
import { space12, space4, space8 } from '../utilities/spacing';
|
|
5
5
|
import { NotoSans } from '../utilities/fonts';
|
|
6
6
|
import { borderRadius4 } from '../utilities/borderRadius';
|
|
7
|
+
import { Greyscale } from '../../Utils/Colors';
|
|
7
8
|
export var StyledContainer = styled.div.withConfig({
|
|
8
9
|
displayName: "InputStyle__StyledContainer",
|
|
9
10
|
componentId: "sc-15z2mnd-0"
|
|
@@ -15,12 +16,44 @@ export var StyledContainer = styled.div.withConfig({
|
|
|
15
16
|
export var StyledPrefixContainer = styled.div.withConfig({
|
|
16
17
|
displayName: "InputStyle__StyledPrefixContainer",
|
|
17
18
|
componentId: "sc-15z2mnd-1"
|
|
18
|
-
})(["position:absolute;left:0;color:", ";display:flex;align-items:center;height:
|
|
19
|
+
})(["position:absolute;left:0;color:", ";display:flex;align-items:center;height:", ";padding:0px ", " 0 ", ";svg{height:17px;width:17px;fill:", ";}"], Neutral.B40, function (_ref) {
|
|
20
|
+
var height = _ref.height;
|
|
21
|
+
return height != null ? height : '36px';
|
|
22
|
+
}, space8, space12, Neutral.B40);
|
|
19
23
|
export var StyledSuffixContainer = styled(StyledPrefixContainer).withConfig({
|
|
20
24
|
displayName: "InputStyle__StyledSuffixContainer",
|
|
21
25
|
componentId: "sc-15z2mnd-2"
|
|
22
26
|
})(["left:auto;right:0;padding:0px ", " 0 ", ";"], space12, space4);
|
|
27
|
+
export var FloatingLabel = styled.label.withConfig({
|
|
28
|
+
displayName: "InputStyle__FloatingLabel",
|
|
29
|
+
componentId: "sc-15z2mnd-3"
|
|
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
|
+
var left = _ref2.left;
|
|
32
|
+
return left != null ? left : '0.5';
|
|
33
|
+
}, function (_ref3) {
|
|
34
|
+
var top = _ref3.top;
|
|
35
|
+
return top != null ? top : '-1.25';
|
|
36
|
+
}, function (_ref4) {
|
|
37
|
+
var fontSize = _ref4.fontSize;
|
|
38
|
+
return fontSize != null ? fontSize : '12px';
|
|
39
|
+
}, function (_ref5) {
|
|
40
|
+
var color = _ref5.color;
|
|
41
|
+
return color != null ? color : Greyscale.devilsgrey;
|
|
42
|
+
}, Red.B93);
|
|
23
43
|
export var StyledInput = styled.input.withConfig({
|
|
24
44
|
displayName: "InputStyle__StyledInput",
|
|
25
|
-
componentId: "sc-15z2mnd-
|
|
26
|
-
})(["background:", ";box-sizing:border-box;border:
|
|
45
|
+
componentId: "sc-15z2mnd-4"
|
|
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;
|
|
48
|
+
return border != null ? border : "1px solid " + Neutral.B68;
|
|
49
|
+
}, function (_ref7) {
|
|
50
|
+
var borderRadius = _ref7.borderRadius;
|
|
51
|
+
return borderRadius != null ? borderRadius : borderRadius4;
|
|
52
|
+
}, NotoSans, Neutral.B18, function (_ref8) {
|
|
53
|
+
var height = _ref8.height;
|
|
54
|
+
return height != null ? height : "36px";
|
|
55
|
+
}, Neutral.B68, Neutral.B100, Breakpoints.large);
|
|
56
|
+
export var AsteriskIcon = styled.span.withConfig({
|
|
57
|
+
displayName: "InputStyle__AsteriskIcon",
|
|
58
|
+
componentId: "sc-15z2mnd-5"
|
|
59
|
+
})(["color:", ";font-size:20px;vertical-align:middle;"], Red.B93);
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { InputProps } from '../Input/Input';
|
|
3
|
-
export declare type NumberInputProps = Omit<InputProps, 'type' | 'prefix'
|
|
4
|
-
|
|
3
|
+
export declare type NumberInputProps = Omit<InputProps, 'type' | 'prefix'> & {
|
|
4
|
+
border?: string;
|
|
5
|
+
borderRadius?: string;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
isPlaceholderFloating?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const NumberInput: React.ForwardRefExoticComponent<Omit<InputProps, "type" | "prefix"> & {
|
|
10
|
+
border?: string;
|
|
11
|
+
borderRadius?: string;
|
|
12
|
+
required?: boolean;
|
|
13
|
+
isPlaceholderFloating?: boolean;
|
|
14
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
|
+
var _excluded = ["required", "border", "borderRadius", "isPlaceholderFloating", "floatingFontSize", "placeholderColor", "floatingPlaceholderTop"];
|
|
2
4
|
import React from 'react';
|
|
3
5
|
import styled from 'styled-components';
|
|
4
6
|
import { Input } from '../Input/Input';
|
|
@@ -6,9 +8,25 @@ var StyledInput = styled(Input).withConfig({
|
|
|
6
8
|
displayName: "NumberInput__StyledInput",
|
|
7
9
|
componentId: "sc-1f5ws9y-0"
|
|
8
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;}"]);
|
|
9
|
-
export var NumberInput = /*#__PURE__*/React.forwardRef(function NumberInput(
|
|
11
|
+
export var NumberInput = /*#__PURE__*/React.forwardRef(function NumberInput(_ref, ref) {
|
|
12
|
+
var required = _ref.required,
|
|
13
|
+
border = _ref.border,
|
|
14
|
+
borderRadius = _ref.borderRadius,
|
|
15
|
+
isPlaceholderFloating = _ref.isPlaceholderFloating,
|
|
16
|
+
floatingFontSize = _ref.floatingFontSize,
|
|
17
|
+
placeholderColor = _ref.placeholderColor,
|
|
18
|
+
floatingPlaceholderTop = _ref.floatingPlaceholderTop,
|
|
19
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
10
20
|
return /*#__PURE__*/React.createElement(StyledInput, _extends({
|
|
11
21
|
ref: ref,
|
|
12
22
|
type: "number"
|
|
13
|
-
}, props
|
|
23
|
+
}, props, {
|
|
24
|
+
border: border,
|
|
25
|
+
borderRadius: borderRadius,
|
|
26
|
+
required: required,
|
|
27
|
+
isPlaceholderFloating: isPlaceholderFloating,
|
|
28
|
+
floatingFontSize: floatingFontSize,
|
|
29
|
+
placeholderColor: placeholderColor,
|
|
30
|
+
floatingPlaceholderTop: floatingPlaceholderTop
|
|
31
|
+
}));
|
|
14
32
|
});
|
|
@@ -8,4 +8,9 @@ export declare const StyledSimplePaginationButton: import("styled-components").S
|
|
|
8
8
|
export declare const StyledBorderPaginationButton: import("styled-components").StyledComponent<"button", any, PageButtonProps, never>;
|
|
9
9
|
export declare const StyledLabel: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
10
10
|
export declare const StyledActiveSimplePaginationButton: import("styled-components").StyledComponent<(props: PageButtonProps) => JSX.Element, any, {}, never>;
|
|
11
|
-
export declare const StyledSimplePaginationInput: import("styled-components").StyledComponent<React.ForwardRefExoticComponent<import("../
|
|
11
|
+
export declare const StyledSimplePaginationInput: import("styled-components").StyledComponent<React.ForwardRefExoticComponent<Omit<import("../Input/Input").InputProps, "type" | "prefix"> & {
|
|
12
|
+
border?: string;
|
|
13
|
+
borderRadius?: string;
|
|
14
|
+
required?: boolean;
|
|
15
|
+
isPlaceholderFloating?: boolean;
|
|
16
|
+
} & React.RefAttributes<HTMLInputElement>>, any, {}, never>;
|
|
@@ -2,8 +2,24 @@ import React from 'react';
|
|
|
2
2
|
export declare type PasswordInputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type' | 'onChange'> & {
|
|
3
3
|
onChange?: (value: string) => void;
|
|
4
4
|
error?: boolean;
|
|
5
|
+
height?: string;
|
|
6
|
+
border?: string;
|
|
7
|
+
borderRadius?: string;
|
|
8
|
+
required?: boolean;
|
|
9
|
+
isPlaceholderFloating?: boolean;
|
|
10
|
+
floatingFontSize?: string;
|
|
11
|
+
placeholderColor?: string;
|
|
12
|
+
floatingPlaceholderTop?: number;
|
|
5
13
|
};
|
|
6
14
|
export declare const PasswordInput: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "onChange"> & {
|
|
7
15
|
onChange?: (value: string) => void;
|
|
8
16
|
error?: boolean;
|
|
17
|
+
height?: string;
|
|
18
|
+
border?: string;
|
|
19
|
+
borderRadius?: string;
|
|
20
|
+
required?: boolean;
|
|
21
|
+
isPlaceholderFloating?: boolean;
|
|
22
|
+
floatingFontSize?: string;
|
|
23
|
+
placeholderColor?: string;
|
|
24
|
+
floatingPlaceholderTop?: number;
|
|
9
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"];
|
|
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';
|
|
@@ -9,6 +9,14 @@ export var PasswordInput = /*#__PURE__*/React.forwardRef(function PasswordInput(
|
|
|
9
9
|
var value = _ref.value,
|
|
10
10
|
_onChange = _ref.onChange,
|
|
11
11
|
error = _ref.error,
|
|
12
|
+
height = _ref.height,
|
|
13
|
+
border = _ref.border,
|
|
14
|
+
borderRadius = _ref.borderRadius,
|
|
15
|
+
required = _ref.required,
|
|
16
|
+
isPlaceholderFloating = _ref.isPlaceholderFloating,
|
|
17
|
+
floatingFontSize = _ref.floatingFontSize,
|
|
18
|
+
placeholderColor = _ref.placeholderColor,
|
|
19
|
+
floatingPlaceholderTop = _ref.floatingPlaceholderTop,
|
|
12
20
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
13
21
|
var _useState = useState(false),
|
|
14
22
|
showPassword = _useState[0],
|
|
@@ -31,6 +39,14 @@ export var PasswordInput = /*#__PURE__*/React.forwardRef(function PasswordInput(
|
|
|
31
39
|
return _onChange == null ? void 0 : _onChange(e.currentTarget.value);
|
|
32
40
|
},
|
|
33
41
|
error: error,
|
|
34
|
-
suffix: !props.disabled && suffixComponent
|
|
42
|
+
suffix: !props.disabled && suffixComponent,
|
|
43
|
+
height: height,
|
|
44
|
+
border: border,
|
|
45
|
+
borderRadius: borderRadius,
|
|
46
|
+
required: required,
|
|
47
|
+
isPlaceholderFloating: isPlaceholderFloating,
|
|
48
|
+
floatingFontSize: floatingFontSize,
|
|
49
|
+
placeholderColor: placeholderColor,
|
|
50
|
+
floatingPlaceholderTop: floatingPlaceholderTop
|
|
35
51
|
}, props)));
|
|
36
52
|
});
|
|
@@ -50,8 +50,14 @@ export interface SelectProps {
|
|
|
50
50
|
selectedValues?: string[];
|
|
51
51
|
/** sets a width for the Select component*/
|
|
52
52
|
width: string;
|
|
53
|
+
height?: string;
|
|
53
54
|
/** sets z-index override for option list dropdown. z-index default to 400 */
|
|
54
55
|
zIndexOverride?: number;
|
|
56
|
+
border?: string;
|
|
57
|
+
borderRadius?: string;
|
|
58
|
+
required?: boolean;
|
|
59
|
+
isPopoverActive?: boolean;
|
|
60
|
+
isPlaceholderFloating?: boolean;
|
|
55
61
|
}
|
|
56
|
-
export declare const Select: ({ allowMultiple, customActivatorIcon, disabled, hasError, helpText, label, listHeight, loadingOptions, name, onBlur, onClose, onFocus, onRemoveTag, onSelect, onSelectClick, optionListFitContent, options, placeholder, prefix, searchable, searchableProps, optionsPlaceholderProps, showPopoverOnFocus, scrollable, sections, selectedValues, width, zIndexOverride, }: SelectProps) => JSX.Element;
|
|
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;
|
|
57
63
|
export {};
|
|
@@ -33,8 +33,7 @@ export var Select = function Select(_ref) {
|
|
|
33
33
|
options = _ref$options === void 0 ? [] : _ref$options,
|
|
34
34
|
placeholder = _ref.placeholder,
|
|
35
35
|
prefix = _ref.prefix,
|
|
36
|
-
|
|
37
|
-
searchable = _ref$searchable === void 0 ? false : _ref$searchable,
|
|
36
|
+
searchable = _ref.searchable,
|
|
38
37
|
searchableProps = _ref.searchableProps,
|
|
39
38
|
optionsPlaceholderProps = _ref.optionsPlaceholderProps,
|
|
40
39
|
_ref$showPopoverOnFoc = _ref.showPopoverOnFocus,
|
|
@@ -44,14 +43,20 @@ export var Select = function Select(_ref) {
|
|
|
44
43
|
sections = _ref.sections,
|
|
45
44
|
selectedValues = _ref.selectedValues,
|
|
46
45
|
width = _ref.width,
|
|
47
|
-
|
|
46
|
+
height = _ref.height,
|
|
47
|
+
zIndexOverride = _ref.zIndexOverride,
|
|
48
|
+
border = _ref.border,
|
|
49
|
+
borderRadius = _ref.borderRadius,
|
|
50
|
+
required = _ref.required,
|
|
51
|
+
isPlaceholderFloating = _ref.isPlaceholderFloating,
|
|
52
|
+
isPopoverActive = _ref.isPopoverActive;
|
|
48
53
|
var _useState = useState(false),
|
|
49
54
|
popoverActive = _useState[0],
|
|
50
55
|
setPopoverActive = _useState[1];
|
|
51
56
|
var _useState2 = useState(''),
|
|
52
57
|
optionListHeight = _useState2[0],
|
|
53
58
|
setOptionListHeight = _useState2[1];
|
|
54
|
-
var _useState3 = useState(
|
|
59
|
+
var _useState3 = useState([]),
|
|
55
60
|
menuOptions = _useState3[0],
|
|
56
61
|
setMenuOptions = _useState3[1];
|
|
57
62
|
var optionsLength = options.length;
|
|
@@ -74,6 +79,11 @@ export var Select = function Select(_ref) {
|
|
|
74
79
|
var updateMenuOptions = function updateMenuOptions(newState) {
|
|
75
80
|
setMenuOptions(newState);
|
|
76
81
|
};
|
|
82
|
+
useEffect(function () {
|
|
83
|
+
if (isPopoverActive === false && popoverActive) {
|
|
84
|
+
setPopoverActive(false);
|
|
85
|
+
}
|
|
86
|
+
}, [isPopoverActive, popoverActive]);
|
|
77
87
|
var handleClose = function handleClose() {
|
|
78
88
|
setPopoverActive(false);
|
|
79
89
|
onClose == null ? void 0 : onClose();
|
|
@@ -127,6 +137,7 @@ export var Select = function Select(_ref) {
|
|
|
127
137
|
onChange: searchableProps == null ? void 0 : searchableProps.onInputChange,
|
|
128
138
|
placeholder: placeholder != null ? placeholder : 'Search',
|
|
129
139
|
width: width,
|
|
140
|
+
height: height,
|
|
130
141
|
selectedValues: selectedValues,
|
|
131
142
|
onBlur: onBlur,
|
|
132
143
|
onSelect: onSelect,
|
|
@@ -140,7 +151,11 @@ export var Select = function Select(_ref) {
|
|
|
140
151
|
options: options,
|
|
141
152
|
updateMenuOptions: updateMenuOptions,
|
|
142
153
|
prefix: prefix,
|
|
143
|
-
name: name
|
|
154
|
+
name: name,
|
|
155
|
+
isPlaceholderFloating: isPlaceholderFloating,
|
|
156
|
+
required: required,
|
|
157
|
+
border: border,
|
|
158
|
+
borderRadius: borderRadius
|
|
144
159
|
});
|
|
145
160
|
}
|
|
146
161
|
return /*#__PURE__*/React.createElement(ActivatorSelect, {
|
|
@@ -153,18 +168,23 @@ export var Select = function Select(_ref) {
|
|
|
153
168
|
onRemoveTag: onRemoveTag,
|
|
154
169
|
onSelectClick: handleSelectClick,
|
|
155
170
|
width: width,
|
|
171
|
+
height: height,
|
|
156
172
|
selectedValues: selectedValues,
|
|
157
173
|
options: options,
|
|
158
174
|
name: name,
|
|
159
175
|
prefix: prefix,
|
|
160
|
-
onClick: onSelectClick
|
|
176
|
+
onClick: onSelectClick,
|
|
177
|
+
required: required,
|
|
178
|
+
border: border,
|
|
179
|
+
borderRadius: borderRadius,
|
|
180
|
+
isPlaceholderFloating: isPlaceholderFloating
|
|
161
181
|
});
|
|
162
182
|
};
|
|
163
183
|
return /*#__PURE__*/React.createElement(Popover, {
|
|
164
184
|
active: popoverActive,
|
|
165
185
|
activator: /*#__PURE__*/React.createElement(ActivatorWrapper, {
|
|
166
186
|
width: width
|
|
167
|
-
}, label && /*#__PURE__*/React.createElement(Label, null, label), activator(), helpText && /*#__PURE__*/React.createElement(HelpTextContainer, null, /*#__PURE__*/React.createElement(Typography, {
|
|
187
|
+
}, label && !isPlaceholderFloating && /*#__PURE__*/React.createElement(Label, null, label), activator(), helpText && /*#__PURE__*/React.createElement(HelpTextContainer, null, /*#__PURE__*/React.createElement(Typography, {
|
|
168
188
|
as: "span",
|
|
169
189
|
variant: "subtitle2",
|
|
170
190
|
color: disabled ? Neutral.B85 : Neutral.B40
|
|
@@ -2,7 +2,9 @@ import { Meta } from '@storybook/react';
|
|
|
2
2
|
declare const _default: Meta<import("@storybook/react").Args>;
|
|
3
3
|
export default _default;
|
|
4
4
|
export declare const NonSearchableSingleSelect: any;
|
|
5
|
+
export declare const NonSearchableSingleSelectWithFloatingPlaceholder: any;
|
|
5
6
|
export declare const NonSearchableMultipleSelect: any;
|
|
7
|
+
export declare const NonSearchableMultipleSelectWithFloatingPlaceholder: any;
|
|
6
8
|
export declare const WithErrorNonSearchable: any;
|
|
7
9
|
export declare const NonSearchableDisabled: any;
|
|
8
10
|
export declare const NonSearchablePrefixed: any;
|
|
@@ -14,5 +14,11 @@ export interface ActivatorSelectProps extends Omit<React.ButtonHTMLAttributes<HT
|
|
|
14
14
|
onSelectClick?(): void;
|
|
15
15
|
options?: Option[];
|
|
16
16
|
width?: string;
|
|
17
|
+
height?: string;
|
|
18
|
+
required?: boolean;
|
|
19
|
+
floatingFontSize?: string;
|
|
20
|
+
isPlaceholderFloating?: boolean;
|
|
21
|
+
border?: string;
|
|
22
|
+
borderRadius?: string;
|
|
17
23
|
}
|
|
18
|
-
export declare const ActivatorSelect: ({ customActivatorIcon, placeholder, selectedValues, onClick, onRemoveTag, width, allowMultiple, disabled, onSelectClick, hasError, options, prefix, ...props }: ActivatorSelectProps) => JSX.Element;
|
|
24
|
+
export declare const ActivatorSelect: ({ customActivatorIcon, placeholder, selectedValues, onClick, onRemoveTag, width, allowMultiple, disabled, onSelectClick, hasError, options, prefix, required, border, borderRadius, height, floatingFontSize, isPlaceholderFloating, ...props }: ActivatorSelectProps) => JSX.Element;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
|
-
var _excluded = ["customActivatorIcon", "placeholder", "selectedValues", "onClick", "onRemoveTag", "width", "allowMultiple", "disabled", "onSelectClick", "hasError", "options", "prefix"];
|
|
3
|
+
var _excluded = ["customActivatorIcon", "placeholder", "selectedValues", "onClick", "onRemoveTag", "width", "allowMultiple", "disabled", "onSelectClick", "hasError", "options", "prefix", "required", "border", "borderRadius", "height", "floatingFontSize", "isPlaceholderFloating"];
|
|
4
4
|
import React, { useEffect, useRef, useState } from 'react';
|
|
5
5
|
import { Typography } from '../../../Typography';
|
|
6
6
|
import { Blue, Neutral } from '../../../utilities/colors';
|
|
7
|
-
import { StyledIcon, StyledPrefixContainer, StyledSelect, StyledSelectTypography, StyledTag, TagsContainer, WithPrefixContainer } from './ActivatorStyle';
|
|
7
|
+
import { StyledIcon, StyledPrefixContainer, StyledSelect, StyledSelectTypography, StyledTag, SuffixContainer, TagsContainer, WithPrefixContainer } from './ActivatorStyle';
|
|
8
|
+
import { AsteriskIcon, FloatingLabel } from '../../../Input/InputStyle';
|
|
8
9
|
export var ActivatorSelect = function ActivatorSelect(_ref) {
|
|
9
10
|
var customActivatorIcon = _ref.customActivatorIcon,
|
|
10
11
|
placeholder = _ref.placeholder,
|
|
@@ -21,6 +22,12 @@ export var ActivatorSelect = function ActivatorSelect(_ref) {
|
|
|
21
22
|
hasError = _ref$hasError === void 0 ? false : _ref$hasError,
|
|
22
23
|
options = _ref.options,
|
|
23
24
|
prefix = _ref.prefix,
|
|
25
|
+
required = _ref.required,
|
|
26
|
+
border = _ref.border,
|
|
27
|
+
borderRadius = _ref.borderRadius,
|
|
28
|
+
height = _ref.height,
|
|
29
|
+
floatingFontSize = _ref.floatingFontSize,
|
|
30
|
+
isPlaceholderFloating = _ref.isPlaceholderFloating,
|
|
24
31
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
25
32
|
var _useState = useState([]),
|
|
26
33
|
filteredValues = _useState[0],
|
|
@@ -49,11 +56,12 @@ export var ActivatorSelect = function ActivatorSelect(_ref) {
|
|
|
49
56
|
onSelectClick();
|
|
50
57
|
onClick == null ? void 0 : onClick(e);
|
|
51
58
|
};
|
|
52
|
-
var
|
|
59
|
+
var selectedPlaceholder = required ? placeholder + "*" : placeholder;
|
|
60
|
+
var placeholderMarkup = isPlaceholderFloating ? undefined : /*#__PURE__*/React.createElement(Typography, {
|
|
53
61
|
variant: "body1",
|
|
54
62
|
as: "span",
|
|
55
63
|
color: disabled ? Neutral.B85 : Neutral.B68
|
|
56
|
-
},
|
|
64
|
+
}, selectedPlaceholder);
|
|
57
65
|
var tagsMarkup = function tagsMarkup() {
|
|
58
66
|
if (!hasSelectedValues) {
|
|
59
67
|
return placeholderMarkup;
|
|
@@ -76,14 +84,21 @@ export var ActivatorSelect = function ActivatorSelect(_ref) {
|
|
|
76
84
|
"data-error": hasError,
|
|
77
85
|
onClick: handleClick,
|
|
78
86
|
disabled: disabled,
|
|
79
|
-
width: width
|
|
87
|
+
width: width,
|
|
88
|
+
height: height,
|
|
89
|
+
border: border,
|
|
90
|
+
borderRadius: borderRadius,
|
|
91
|
+
isPlaceholderFloating: isPlaceholderFloating
|
|
80
92
|
}), /*#__PURE__*/React.createElement(WithPrefixContainer, null, prefix && /*#__PURE__*/React.createElement(StyledPrefixContainer, null, prefix), allowMultiple ? tagsMarkup() : /*#__PURE__*/React.createElement(StyledSelectTypography, {
|
|
81
93
|
variant: "body1",
|
|
82
94
|
"data-disabled": disabled,
|
|
83
95
|
color: hasSelectedValues ? Neutral.B18 : Neutral.B40
|
|
84
|
-
}, hasSelectedValues ? selectedLabels[0] : placeholderMarkup)), /*#__PURE__*/React.createElement(StyledIcon, {
|
|
96
|
+
}, hasSelectedValues ? selectedLabels[0] : placeholderMarkup)), /*#__PURE__*/React.createElement(SuffixContainer, null, /*#__PURE__*/React.createElement(StyledIcon, {
|
|
85
97
|
height: 24,
|
|
86
98
|
name: customActivatorIcon || 'ri-arrow-m-down-line',
|
|
87
99
|
fill: disabled ? Neutral.B85 : Neutral.B40
|
|
88
|
-
}))
|
|
100
|
+
})), isPlaceholderFloating && /*#__PURE__*/React.createElement(FloatingLabel, {
|
|
101
|
+
"data-testid": "textarea-label",
|
|
102
|
+
fontSize: floatingFontSize
|
|
103
|
+
}, placeholder, required && /*#__PURE__*/React.createElement(AsteriskIcon, null, "*")));
|
|
89
104
|
};
|
|
@@ -6,8 +6,23 @@ export declare const StyledTag: import("styled-components").StyledComponent<impo
|
|
|
6
6
|
export declare const StyledTextInput: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<Omit<import("../../../Input/Input").InputProps, "type" | "onChange"> & {
|
|
7
7
|
canClear?: boolean;
|
|
8
8
|
onChange?: (value: string) => void;
|
|
9
|
+
height?: string;
|
|
10
|
+
border?: string;
|
|
11
|
+
borderRadius?: string;
|
|
12
|
+
required?: boolean;
|
|
13
|
+
isPlaceholderFloating?: boolean;
|
|
14
|
+
floatingFontSize?: string;
|
|
15
|
+
placeholderColor?: string;
|
|
16
|
+
floatingPlaceholderTop?: number;
|
|
9
17
|
} & import("react").RefAttributes<HTMLInputElement>>, any, {}, never>;
|
|
10
18
|
export declare const StyledSelectTypography: import("styled-components").StyledComponent<({ as, children, variant, style, ...props }: import("../../../Typography").TypographyProps) => JSX.Element, any, {}, never>;
|
|
11
19
|
export declare const WithPrefixContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
12
20
|
export declare const StyledPrefixContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
13
21
|
export declare const StyledIcon: import("styled-components").StyledComponent<({ name, ...props }: import("../../../Icon").IconProps) => JSX.Element, any, {}, never>;
|
|
22
|
+
export declare const SuffixContainer: import("styled-components").StyledComponent<"div", any, {
|
|
23
|
+
height?: string;
|
|
24
|
+
} & {
|
|
25
|
+
height?: string;
|
|
26
|
+
} & {
|
|
27
|
+
height?: string;
|
|
28
|
+
}, never>;
|
|
@@ -8,10 +8,20 @@ import { TextInput } from '../../../TextInput';
|
|
|
8
8
|
import { Tag } from '../../../Tag';
|
|
9
9
|
import { Typography } from '../../../Typography';
|
|
10
10
|
import { Icon } from '../../../Icon';
|
|
11
|
+
import { StyledSuffixContainer } from '../../../Input/InputStyle';
|
|
11
12
|
export var StyledSelect = styled.button.withConfig({
|
|
12
13
|
displayName: "ActivatorStyle__StyledSelect",
|
|
13
14
|
componentId: "sc-rui73p-0"
|
|
14
|
-
})(["display:flex;align-items:center;justify-content:space-between;height:
|
|
15
|
+
})(["position:relative;display:flex;align-items:center;justify-content:space-between;height:", ";cursor:pointer;padding:0px 8px 0px 12px;border:", ";box-shadow:0px 1px 0px rgba(0,0,0,0.05);border-radius:", ";background:", ";width:", ";color:", ";font-family:", ",sans-serif;font-weight:400;font-size:16px;line-height:150%;letter-spacing:0px;@media (max-width:", "){font-size:14px;}&:focus{outline:none;box-shadow:0px 0px 0px 1px #ffffff,0px 0px 0px 3px #6cc9ec;}&:disabled{background:", ";pointer-events:none;cursor:default;border:1px solid ", ";}&[data-error='true']{border:1px solid ", ";border-radius:", ";}"], function (props) {
|
|
16
|
+
var _props$height;
|
|
17
|
+
return (_props$height = props.height) != null ? _props$height : '36px';
|
|
18
|
+
}, function (_ref) {
|
|
19
|
+
var border = _ref.border;
|
|
20
|
+
return border != null ? border : "1px solid " + Neutral.B68;
|
|
21
|
+
}, function (_ref2) {
|
|
22
|
+
var borderRadius = _ref2.borderRadius;
|
|
23
|
+
return borderRadius != null ? borderRadius : borderRadius4;
|
|
24
|
+
}, Neutral.B100, function (props) {
|
|
15
25
|
return props.width;
|
|
16
26
|
}, Neutral.B18, NotoSans, Breakpoints.large, Neutral.B95, Neutral.B85, Red.B93, borderRadius4);
|
|
17
27
|
export var TagsContainer = styled.div.withConfig({
|
|
@@ -43,4 +53,8 @@ export var StyledPrefixContainer = styled.div.withConfig({
|
|
|
43
53
|
export var StyledIcon = styled(Icon).withConfig({
|
|
44
54
|
displayName: "ActivatorStyle__StyledIcon",
|
|
45
55
|
componentId: "sc-rui73p-7"
|
|
46
|
-
})(["margin-left:auto;"]);
|
|
56
|
+
})(["margin-left:auto;"]);
|
|
57
|
+
export var SuffixContainer = styled(StyledSuffixContainer).withConfig({
|
|
58
|
+
displayName: "ActivatorStyle__SuffixContainer",
|
|
59
|
+
componentId: "sc-rui73p-8"
|
|
60
|
+
})(["z-index:2;"]);
|
|
@@ -12,11 +12,16 @@ export interface ActivatorTextInputProps extends Omit<TextInputProps, 'onChange'
|
|
|
12
12
|
}): void;
|
|
13
13
|
selectedValues?: string[];
|
|
14
14
|
width?: string;
|
|
15
|
+
height?: string;
|
|
15
16
|
inputValue?: string;
|
|
16
17
|
updateInputValue?: (newValue: string) => void;
|
|
17
18
|
searchableSelectState?: SearchableSelectState;
|
|
18
19
|
updateSearchableSelectState?: (newState: SearchableSelectState) => void;
|
|
19
20
|
options?: Option[];
|
|
20
21
|
updateMenuOptions?: (newState: Option[]) => void;
|
|
22
|
+
border?: string;
|
|
23
|
+
borderRadius?: string;
|
|
24
|
+
isPlaceholderFloating?: boolean;
|
|
25
|
+
required?: boolean;
|
|
21
26
|
}
|
|
22
|
-
export declare const ActivatorTextInput: ({ allowMultiple, disabled, hasError, onChange, onBlur, onFocus, onSelect, prefix, selectedValues, width, inputValue, updateInputValue, options, updateMenuOptions, ...props }: ActivatorTextInputProps) => JSX.Element;
|
|
27
|
+
export declare const ActivatorTextInput: ({ allowMultiple, disabled, hasError, onChange, onBlur, onFocus, onSelect, prefix, selectedValues, width, inputValue, updateInputValue, options, updateMenuOptions, border, borderRadius, isPlaceholderFloating, required, height, ...props }: ActivatorTextInputProps) => JSX.Element;
|
|
@@ -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 = ["allowMultiple", "disabled", "hasError", "onChange", "onBlur", "onFocus", "onSelect", "prefix", "selectedValues", "width", "inputValue", "updateInputValue", "options", "updateMenuOptions"];
|
|
3
|
+
var _excluded = ["allowMultiple", "disabled", "hasError", "onChange", "onBlur", "onFocus", "onSelect", "prefix", "selectedValues", "width", "inputValue", "updateInputValue", "options", "updateMenuOptions", "border", "borderRadius", "isPlaceholderFloating", "required", "height"];
|
|
4
4
|
import React, { useEffect, useRef, useState } from 'react';
|
|
5
5
|
import { Icon } from '../../../Icon';
|
|
6
6
|
import { SearchableSelectInput } from '../SearchableSelectInput/SearchableSelectInput';
|
|
@@ -25,6 +25,11 @@ export var ActivatorTextInput = function ActivatorTextInput(_ref) {
|
|
|
25
25
|
updateInputValue = _ref.updateInputValue,
|
|
26
26
|
options = _ref.options,
|
|
27
27
|
updateMenuOptions = _ref.updateMenuOptions,
|
|
28
|
+
border = _ref.border,
|
|
29
|
+
borderRadius = _ref.borderRadius,
|
|
30
|
+
isPlaceholderFloating = _ref.isPlaceholderFloating,
|
|
31
|
+
required = _ref.required,
|
|
32
|
+
height = _ref.height,
|
|
28
33
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
29
34
|
var activatorRef = useRef(null);
|
|
30
35
|
var _useState = useState(false),
|
|
@@ -68,7 +73,11 @@ export var ActivatorTextInput = function ActivatorTextInput(_ref) {
|
|
|
68
73
|
onFocus: onFocus,
|
|
69
74
|
error: hasError,
|
|
70
75
|
disabled: disabled,
|
|
71
|
-
width: width
|
|
76
|
+
width: width,
|
|
77
|
+
border: border,
|
|
78
|
+
borderRadius: borderRadius,
|
|
79
|
+
isPlaceholderFloating: isPlaceholderFloating,
|
|
80
|
+
required: required
|
|
72
81
|
})) : /*#__PURE__*/React.createElement(SearchableSelectInput, _extends({}, props, {
|
|
73
82
|
ref: activatorRef,
|
|
74
83
|
prefix: prefix,
|
|
@@ -84,6 +93,11 @@ export var ActivatorTextInput = function ActivatorTextInput(_ref) {
|
|
|
84
93
|
inputValue: inputValue,
|
|
85
94
|
updateInputValue: updateInputValue,
|
|
86
95
|
options: options,
|
|
87
|
-
updateMenuOptions: updateMenuOptions
|
|
96
|
+
updateMenuOptions: updateMenuOptions,
|
|
97
|
+
border: border,
|
|
98
|
+
borderRadius: borderRadius,
|
|
99
|
+
isPlaceholderFloating: isPlaceholderFloating,
|
|
100
|
+
required: required,
|
|
101
|
+
height: height
|
|
88
102
|
})));
|
|
89
103
|
};
|
|
@@ -5,5 +5,6 @@ export interface ClearSelectedProps {
|
|
|
5
5
|
}): void;
|
|
6
6
|
handleClearIconClick?: () => void;
|
|
7
7
|
updateInputValue?(newValue: string): void;
|
|
8
|
+
height?: string;
|
|
8
9
|
}
|
|
9
|
-
export declare const ClearSelected: ({ onSelect, handleClearIconClick, updateInputValue, }: ClearSelectedProps) => JSX.Element;
|
|
10
|
+
export declare const ClearSelected: ({ onSelect, handleClearIconClick, updateInputValue, height, }: ClearSelectedProps) => JSX.Element;
|