@mrshmllw/smores-react 2.1.27 → 2.3.0
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/dist/CheckBoxGroup/CheckBox.d.ts +9 -0
- package/dist/CheckBoxGroup/CheckBox.js +67 -0
- package/dist/CheckBoxGroup/CheckBox.js.map +1 -0
- package/dist/ConfirmationRadioButtons/Confirmation.js +6 -5
- package/dist/ConfirmationRadioButtons/Confirmation.js.map +1 -1
- package/dist/ConfirmationRadioButtons/Confirmation.stories.d.ts +1 -0
- package/dist/ConfirmationRadioButtons/Confirmation.stories.js +8 -0
- package/dist/ConfirmationRadioButtons/Confirmation.stories.js.map +1 -1
- package/dist/Dropdown/Dropdown.d.ts +7 -33
- package/dist/Dropdown/Dropdown.js +22 -48
- package/dist/Dropdown/Dropdown.js.map +1 -1
- package/dist/Dropdown/Dropdown.stories.d.ts +3 -39
- package/dist/Field/Field.d.ts +12 -0
- package/dist/Field/Field.js +68 -0
- package/dist/Field/Field.js.map +1 -0
- package/dist/Field/index.d.ts +1 -0
- package/dist/Field/index.js +2 -0
- package/dist/Field/index.js.map +1 -0
- package/dist/Field/types/commonFieldTypes.d.ts +10 -0
- package/dist/Field/types/commonFieldTypes.js +2 -0
- package/dist/Field/types/commonFieldTypes.js.map +1 -0
- package/dist/Fieldset/Fieldset.d.ts +8 -0
- package/dist/Fieldset/Fieldset.js +15 -0
- package/dist/Fieldset/Fieldset.js.map +1 -0
- package/dist/Fieldset/index.d.ts +1 -0
- package/dist/Fieldset/index.js +2 -0
- package/dist/Fieldset/index.js.map +1 -0
- package/dist/SearchInput/SearchInput.d.ts +3 -12
- package/dist/SearchInput/SearchInput.js +12 -21
- package/dist/SearchInput/SearchInput.js.map +1 -1
- package/dist/SupportMessage/SupportMessage.d.ts +2 -2
- package/dist/SupportMessage/SupportMessage.js.map +1 -1
- package/dist/SupportMessage/SupportMessage.stories.d.ts +1 -0
- package/dist/SupportMessage/SupportMessage.stories.js +9 -0
- package/dist/SupportMessage/SupportMessage.stories.js.map +1 -1
- package/dist/SupportMessage/SupportMessage.test.js +8 -0
- package/dist/SupportMessage/SupportMessage.test.js.map +1 -1
- package/dist/Tag/Tag.js +1 -1
- package/dist/Tag/Tag.js.map +1 -1
- package/dist/TextInput/TextInput.d.ts +5 -23
- package/dist/TextInput/TextInput.js +19 -49
- package/dist/TextInput/TextInput.js.map +1 -1
- package/dist/Textarea/Textarea.d.ts +1 -15
- package/dist/Textarea/Textarea.js +20 -21
- package/dist/Textarea/Textarea.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
@@ -0,0 +1,67 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import styled from 'styled-components';
|
3
|
+
import { Text } from '../Text';
|
4
|
+
import { theme } from '../theme';
|
5
|
+
export const CheckBox = ({ id, checked, children, toggle }) => (React.createElement(BoxContainer, { id: id },
|
6
|
+
React.createElement(Text, { tag: "span", typo: "base" }, children),
|
7
|
+
React.createElement("input", { type: "checkbox", checked: checked, onChange: toggle }),
|
8
|
+
React.createElement(Checkmark, null)));
|
9
|
+
const Checkmark = styled.span `
|
10
|
+
position: absolute;
|
11
|
+
left: 0;
|
12
|
+
width: 24px;
|
13
|
+
height: 24px;
|
14
|
+
border: solid 1px ${theme.colors.secondary};
|
15
|
+
box-sizing: border-box;
|
16
|
+
border-radius: 1px;
|
17
|
+
|
18
|
+
&:after {
|
19
|
+
content: '';
|
20
|
+
position: absolute;
|
21
|
+
display: none;
|
22
|
+
top: 3px;
|
23
|
+
left: 7px;
|
24
|
+
width: 5px;
|
25
|
+
height: 12px;
|
26
|
+
border: solid white;
|
27
|
+
border-width: 0 2px 2px 0;
|
28
|
+
-webkit-transform: rotate(45deg);
|
29
|
+
-ms-transform: rotate(45deg);
|
30
|
+
transform: rotate(45deg);
|
31
|
+
}
|
32
|
+
`;
|
33
|
+
const BoxContainer = styled.label `
|
34
|
+
position: relative;
|
35
|
+
display: flex;
|
36
|
+
align-items: center;
|
37
|
+
padding-left: 32px;
|
38
|
+
user-select: none;
|
39
|
+
cursor: pointer;
|
40
|
+
|
41
|
+
input {
|
42
|
+
position: absolute;
|
43
|
+
opacity: 0;
|
44
|
+
cursor: pointer;
|
45
|
+
|
46
|
+
&:checked ~ ${Checkmark} {
|
47
|
+
background-color: ${theme.colors.secondary};
|
48
|
+
border: solid 1px ${theme.colors.secondary};
|
49
|
+
}
|
50
|
+
|
51
|
+
&:checked ~ ${Checkmark}:after {
|
52
|
+
display: block;
|
53
|
+
}
|
54
|
+
}
|
55
|
+
|
56
|
+
&:hover {
|
57
|
+
${Checkmark} {
|
58
|
+
background-color: ${theme.colors.background};
|
59
|
+
border: solid 1px ${theme.colors.secondary};
|
60
|
+
}
|
61
|
+
}
|
62
|
+
|
63
|
+
@media (min-width: 768px) {
|
64
|
+
padding-left: 32px;
|
65
|
+
}
|
66
|
+
`;
|
67
|
+
//# sourceMappingURL=CheckBox.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"CheckBox.js","sourceRoot":"","sources":["../../src/CheckBoxGroup/CheckBox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAA;AAC5C,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAShC,MAAM,CAAC,MAAM,QAAQ,GAAc,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CACxE,oBAAC,YAAY,IAAC,EAAE,EAAE,EAAE;IAClB,oBAAC,IAAI,IAAC,GAAG,EAAC,MAAM,EAAC,IAAI,EAAC,MAAM,IACzB,QAAQ,CACJ;IAEP,+BAAO,IAAI,EAAC,UAAU,EAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAI;IAC7D,oBAAC,SAAS,OAAG,CACA,CAChB,CAAA;AAED,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAA;;;;;sBAKP,KAAK,CAAC,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;;;;CAkB3C,CAAA;AAED,MAAM,YAAY,GAAG,MAAM,CAAC,KAAK,CAAA;;;;;;;;;;;;;kBAaf,SAAS;0BACD,KAAK,CAAC,MAAM,CAAC,SAAS;0BACtB,KAAK,CAAC,MAAM,CAAC,SAAS;;;kBAG9B,SAAS;;;;;;MAMrB,SAAS;0BACW,KAAK,CAAC,MAAM,CAAC,UAAU;0BACvB,KAAK,CAAC,MAAM,CAAC,SAAS;;;;;;;CAO/C,CAAA"}
|
@@ -9,9 +9,9 @@ export const Confirmation = ({ checked, onChange, id: idProp, error = false, err
|
|
9
9
|
const id = useUniqueId(idProp);
|
10
10
|
return (React.createElement(ConfirmationWrapper, null,
|
11
11
|
(label || sublabel) && (React.createElement(TextWrapper, null,
|
12
|
-
React.createElement(
|
13
|
-
label
|
14
|
-
required &&
|
12
|
+
label && (React.createElement(SectionHeadingText, { tag: "h3" },
|
13
|
+
label,
|
14
|
+
required && React.createElement(Asterisk, null, "*"))),
|
15
15
|
sublabel && (React.createElement(Text, { tag: "p", typo: "base-small", color: "subtext" }, sublabel)))),
|
16
16
|
React.createElement(RadioButtonGroupWrapper, null,
|
17
17
|
React.createElement(RadioButtonGroup, null,
|
@@ -70,7 +70,8 @@ const TextWrapper = styled.div `
|
|
70
70
|
display: flex;
|
71
71
|
flex-direction: column;
|
72
72
|
`;
|
73
|
-
const
|
74
|
-
|
73
|
+
const Asterisk = styled.span `
|
74
|
+
font-size: 14px;
|
75
|
+
color: ${theme.colors.error};
|
75
76
|
`;
|
76
77
|
//# sourceMappingURL=Confirmation.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Confirmation.js","sourceRoot":"","sources":["../../src/ConfirmationRadioButtons/Confirmation.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AEjB,KAAK,CAAC,MAAM,CAAC,KAAK;CAC5B,CAAA"}
|
@@ -57,4 +57,12 @@ Required.args = {
|
|
57
57
|
checked: undefined,
|
58
58
|
required: true,
|
59
59
|
};
|
60
|
+
export const RequiredWithLongLabel = Template.bind({});
|
61
|
+
RequiredWithLongLabel.args = {
|
62
|
+
id: 'radioButton',
|
63
|
+
label: 'This is a really long label to test the placement of the required asterisk. Do you like ice cream, pie, marshmallows, smores, cupcakes, cookies, and muffins?',
|
64
|
+
onChange: noop,
|
65
|
+
checked: undefined,
|
66
|
+
required: true,
|
67
|
+
};
|
60
68
|
//# sourceMappingURL=Confirmation.stories.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Confirmation.stories.js","sourceRoot":"","sources":["../../src/ConfirmationRadioButtons/Confirmation.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACpC,OAAO,EAAE,YAAY,EAAqB,MAAM,gBAAgB,CAAA;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,eAAe;IACb,KAAK,EAAE,2BAA2B;IAClC,SAAS,EAAE,YAAY;IACvB,QAAQ,EAAE,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE;CAC9C,CAAA;AAED,MAAM,QAAQ,GAAG,CAAC,KAAwB,EAAE,EAAE,CAAC,oBAAC,YAAY,oBAAK,KAAK,EAAI,CAAA;AAE1E,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAExC,OAAO,CAAC,IAAI,GAAG;IACb,EAAE,EAAE,aAAa;IACjB,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,KAAK;IACd,KAAK,EAAE,2BAA2B;CACnC,CAAA;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC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,CAAA"}
|
@@ -1,61 +1,35 @@
|
|
1
1
|
import React, { FormEvent, RefObject } from 'react';
|
2
|
+
import { CommonFieldTypes } from 'Field/types/commonFieldTypes';
|
2
3
|
export declare type DropdownItem = {
|
3
4
|
optionGroupLabel?: string;
|
4
5
|
label: string;
|
5
6
|
value: string;
|
6
7
|
};
|
7
|
-
|
8
|
-
id?: string;
|
9
|
-
className?: string;
|
10
|
-
/** ref attribute for select input */
|
8
|
+
export interface Props extends CommonFieldTypes {
|
11
9
|
ref?: RefObject<HTMLSelectElement>;
|
12
|
-
/** Placeholder (initial state) */
|
13
10
|
placeholder?: string;
|
14
|
-
/** label displayed above the dropdown */
|
15
|
-
label?: string;
|
16
|
-
/** used for label - input connection */
|
17
11
|
name?: string;
|
18
|
-
/** input value */
|
19
12
|
value?: string;
|
20
|
-
/** Default value */
|
21
13
|
defaultValue?: string;
|
22
|
-
/** conditionally renders error message below dropdown */
|
23
|
-
error?: boolean;
|
24
|
-
/** error message to be displayed */
|
25
|
-
errorMsg?: string;
|
26
|
-
/** Disabled flag */
|
27
14
|
disabled?: boolean;
|
28
|
-
/** list of items for the dropdown list */
|
29
15
|
list: DropdownItem[];
|
30
|
-
/** onSelect handler */
|
31
16
|
onSelect: (element: string) => void;
|
32
|
-
/** Displays border */
|
33
|
-
outlined?: boolean;
|
34
|
-
/** onBlur listener */
|
35
17
|
onBlur?: (e: FormEvent<HTMLSelectElement>) => void;
|
36
|
-
/** required item */
|
37
|
-
required?: boolean;
|
38
|
-
/** set required asterisk */
|
39
18
|
showRequiredAsterisk?: boolean;
|
40
|
-
}
|
41
|
-
/** on change or on input required */
|
19
|
+
}
|
42
20
|
declare type TruncateProps = {
|
43
|
-
/** on change is required and on input optional */
|
44
21
|
onSelect: (e: string) => void;
|
45
22
|
onInputChange?: (e: FormEvent<HTMLSelectElement>) => void;
|
46
23
|
} | {
|
47
|
-
/** on input is required and on change optional */
|
48
24
|
onSelect?: (e: string) => void;
|
49
25
|
onInputChange: (e: FormEvent<HTMLSelectElement>) => void;
|
50
26
|
};
|
51
|
-
export declare type DropdownProps =
|
52
|
-
export declare const Dropdown: React.ForwardRefExoticComponent<(Pick<
|
53
|
-
/** on change is required and on input optional */
|
27
|
+
export declare type DropdownProps = Props & TruncateProps;
|
28
|
+
export declare const Dropdown: React.ForwardRefExoticComponent<(Pick<Props & {
|
54
29
|
onSelect: (e: string) => void;
|
55
30
|
onInputChange?: ((e: FormEvent<HTMLSelectElement>) => void) | undefined;
|
56
|
-
}, "required" | "error" | "id" | "name" | "value" | "label" | "className" | "disabled" | "list" | "defaultValue" | "placeholder" | "onBlur" | "onSelect" | "outlined" | "errorMsg" | "
|
57
|
-
/** on input is required and on change optional */
|
31
|
+
}, "required" | "error" | "id" | "name" | "value" | "label" | "className" | "disabled" | "list" | "defaultValue" | "placeholder" | "onBlur" | "onSelect" | "outlined" | "errorMsg" | "renderAsTitle" | "showRequiredAsterisk" | "onInputChange"> | Pick<Props & {
|
58
32
|
onSelect?: ((e: string) => void) | undefined;
|
59
33
|
onInputChange: (e: FormEvent<HTMLSelectElement>) => void;
|
60
|
-
}, "required" | "error" | "id" | "name" | "value" | "label" | "className" | "disabled" | "list" | "defaultValue" | "placeholder" | "onBlur" | "onSelect" | "outlined" | "errorMsg" | "
|
34
|
+
}, "required" | "error" | "id" | "name" | "value" | "label" | "className" | "disabled" | "list" | "defaultValue" | "placeholder" | "onBlur" | "onSelect" | "outlined" | "errorMsg" | "renderAsTitle" | "showRequiredAsterisk" | "onInputChange">) & React.RefAttributes<HTMLSelectElement>>;
|
61
35
|
export {};
|
@@ -1,12 +1,22 @@
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
2
|
+
var t = {};
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
4
|
+
t[p] = s[p];
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
8
|
+
t[p[i]] = s[p[i]];
|
9
|
+
}
|
10
|
+
return t;
|
11
|
+
};
|
1
12
|
import React, { useEffect, useState, forwardRef, } from 'react';
|
2
|
-
import styled from 'styled-components';
|
3
13
|
import { darken } from 'polished';
|
4
|
-
import
|
5
|
-
import { Icon } from '../Icon';
|
6
|
-
import { Box } from '../Box';
|
14
|
+
import styled from 'styled-components';
|
7
15
|
import { theme } from '../theme';
|
16
|
+
import { Field } from '../Field';
|
8
17
|
import { useUniqueId } from '../utils/id';
|
9
|
-
export const Dropdown = forwardRef(function Dropdown(
|
18
|
+
export const Dropdown = forwardRef(function Dropdown(_a, ref) {
|
19
|
+
var { id: idProp, placeholder, name, value, defaultValue, disabled = false, list, onSelect, outlined = false, error = false, onInputChange, onBlur, required = true } = _a, fieldProps = __rest(_a, ["id", "placeholder", "name", "value", "defaultValue", "disabled", "list", "onSelect", "outlined", "error", "onInputChange", "onBlur", "required"]);
|
10
20
|
const id = useUniqueId(idProp);
|
11
21
|
const [key, setKey] = useState('');
|
12
22
|
const [hasOptGroups, setHasOptGroups] = useState(false);
|
@@ -28,12 +38,9 @@ export const Dropdown = forwardRef(function Dropdown({ id: idProp, className = '
|
|
28
38
|
});
|
29
39
|
setDropdownItemsGroups(Array.from(itemsPerGroupLabel.values()));
|
30
40
|
}, [list]);
|
31
|
-
return (React.createElement(
|
32
|
-
|
33
|
-
React.createElement(
|
34
|
-
showRequiredAsterisk && (React.createElement(Text, { tag: "label", color: "error", typo: "label" }, "*")))),
|
35
|
-
React.createElement(Content, { outlined: outlined, key: key },
|
36
|
-
React.createElement(Select, { id: id, defaultValue: list.length === 1
|
41
|
+
return (React.createElement(Field, Object.assign({}, fieldProps, { showCaret: true, dropdownKey: key, id: id, error: error, outlined: outlined, value: value }),
|
42
|
+
React.createElement(React.Fragment, null,
|
43
|
+
React.createElement(StyledSelect, { id: id, defaultValue: list.length === 1
|
37
44
|
? String(list[0].value)
|
38
45
|
: defaultValue
|
39
46
|
? defaultValue
|
@@ -48,23 +55,8 @@ export const Dropdown = forwardRef(function Dropdown({ id: idProp, className = '
|
|
48
55
|
dropdownItemsGroups.map((groupItems, i) => {
|
49
56
|
var _a;
|
50
57
|
return hasOptGroups ? (React.createElement("optgroup", { key: i, label: (_a = groupItems[0].optionGroupLabel) !== null && _a !== void 0 ? _a : 'Other' }, groupItems.map((el, j) => (React.createElement("option", { key: `${i}-${j}`, value: el.value }, el.label))))) : (groupItems.map((el, j) => (React.createElement("option", { key: j, value: el.value }, el.label))));
|
51
|
-
}))
|
52
|
-
React.createElement(Caret, { outlined: outlined },
|
53
|
-
React.createElement(Icon, { render: "caret", color: "subtext", size: 24 }))),
|
54
|
-
error && React.createElement(ErrorBox, null, errorMsg)));
|
58
|
+
})))));
|
55
59
|
});
|
56
|
-
const Container = styled.div `
|
57
|
-
display: flex;
|
58
|
-
flex-direction: column;
|
59
|
-
height: 44px;
|
60
|
-
width: 100%;
|
61
|
-
margin: 0;
|
62
|
-
padding: 0;
|
63
|
-
`;
|
64
|
-
const Content = styled.div `
|
65
|
-
width: 100%;
|
66
|
-
position: relative;
|
67
|
-
`;
|
68
60
|
const getErrorOutline = (outlined, error) => {
|
69
61
|
if (error && outlined) {
|
70
62
|
return `border: 2px solid ${theme.colors.error}`;
|
@@ -76,7 +68,7 @@ const getErrorOutline = (outlined, error) => {
|
|
76
68
|
return;
|
77
69
|
}
|
78
70
|
};
|
79
|
-
const
|
71
|
+
const StyledSelect = styled.select `
|
80
72
|
width: 100%;
|
81
73
|
height: 32px;
|
82
74
|
padding-right: 24px;
|
@@ -87,16 +79,13 @@ const Select = styled.select `
|
|
87
79
|
font-size: 16px;
|
88
80
|
cursor: pointer;
|
89
81
|
appearance: none; /* remove default arrow */
|
90
|
-
|
91
82
|
&:disabled {
|
92
83
|
cursor: not-allowed;
|
93
84
|
opacity: 0.5;
|
94
85
|
}
|
95
|
-
|
96
86
|
&:not(:focus):invalid {
|
97
87
|
color: ${theme.colors.outline};
|
98
88
|
}
|
99
|
-
|
100
89
|
&:hover,
|
101
90
|
&:focus,
|
102
91
|
&:focus-visible,
|
@@ -104,7 +93,6 @@ const Select = styled.select `
|
|
104
93
|
outline: none;
|
105
94
|
border-color: ${darken(0.1, theme.colors.outline)};
|
106
95
|
}
|
107
|
-
|
108
96
|
${({ outlined }) => outlined &&
|
109
97
|
`
|
110
98
|
border: 2px solid ${theme.colors.outline};
|
@@ -117,26 +105,12 @@ const Select = styled.select `
|
|
117
105
|
border: 2px solid ${theme.colors.outline};
|
118
106
|
}
|
119
107
|
`}
|
120
|
-
|
121
108
|
${({ value }) => value &&
|
122
109
|
value != '' &&
|
123
110
|
`
|
124
111
|
border: 2px solid ${theme.colors.outline};
|
125
|
-
`}
|
112
|
+
`}}
|
126
113
|
|
127
|
-
${({ error, outlined }) => getErrorOutline(outlined, error)};
|
128
|
-
`;
|
129
|
-
const Caret = styled.div `
|
130
|
-
position: absolute;
|
131
|
-
top: 50%;
|
132
|
-
z-index: 1;
|
133
|
-
right: ${({ outlined }) => (outlined ? '15px' : '0')};
|
134
|
-
pointer-events: none;
|
135
|
-
transform: translateY(-50%);
|
136
|
-
`;
|
137
|
-
const ErrorBox = styled.span `
|
138
|
-
margin-top: 7px;
|
139
|
-
font-size: 12px;
|
140
|
-
color: ${theme.colors.error};
|
114
|
+
${({ error, outlined }) => getErrorOutline(outlined, error)};
|
141
115
|
`;
|
142
116
|
//# sourceMappingURL=Dropdown.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Dropdown.js","sourceRoot":"","sources":["../../src/Dropdown/Dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,SAAS,EACT,QAAQ,EAGR,UAAU,GAEX,MAAM,OAAO,CAAA;AACd,OAAO,
|
1
|
+
{"version":3,"file":"Dropdown.js","sourceRoot":"","sources":["../../src/Dropdown/D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
|
declare const _default: {
|
3
3
|
title: string;
|
4
|
-
component: React.ForwardRefExoticComponent<(Pick<{
|
5
|
-
id?: string | undefined;
|
6
|
-
className?: string | undefined;
|
7
|
-
ref?: React.RefObject<HTMLSelectElement> | undefined;
|
8
|
-
placeholder?: string | undefined;
|
9
|
-
label?: string | undefined;
|
10
|
-
name?: string | undefined;
|
11
|
-
value?: string | undefined;
|
12
|
-
defaultValue?: string | undefined;
|
13
|
-
error?: boolean | undefined;
|
14
|
-
errorMsg?: string | undefined;
|
15
|
-
disabled?: boolean | undefined;
|
16
|
-
list: import("./Dropdown").DropdownItem[];
|
17
|
-
onSelect: (element: string) => void;
|
18
|
-
outlined?: boolean | undefined;
|
19
|
-
onBlur?: ((e: React.FormEvent<HTMLSelectElement>) => void) | undefined;
|
20
|
-
required?: boolean | undefined;
|
21
|
-
showRequiredAsterisk?: boolean | undefined;
|
22
|
-
} & {
|
4
|
+
component: React.ForwardRefExoticComponent<(Pick<import("./Dropdown").Props & {
|
23
5
|
onSelect: (e: string) => void;
|
24
6
|
onInputChange?: ((e: React.FormEvent<HTMLSelectElement>) => void) | undefined;
|
25
|
-
}, "required" | "error" | "id" | "name" | "value" | "label" | "className" | "disabled" | "list" | "defaultValue" | "placeholder" | "onBlur" | "onSelect" | "outlined" | "errorMsg" | "
|
26
|
-
id?: string | undefined;
|
27
|
-
className?: string | undefined;
|
28
|
-
ref?: React.RefObject<HTMLSelectElement> | undefined;
|
29
|
-
placeholder?: string | undefined;
|
30
|
-
label?: string | undefined;
|
31
|
-
name?: string | undefined;
|
32
|
-
value?: string | undefined;
|
33
|
-
defaultValue?: string | undefined;
|
34
|
-
error?: boolean | undefined;
|
35
|
-
errorMsg?: string | undefined;
|
36
|
-
disabled?: boolean | undefined;
|
37
|
-
list: import("./Dropdown").DropdownItem[];
|
38
|
-
onSelect: (element: string) => void;
|
39
|
-
outlined?: boolean | undefined;
|
40
|
-
onBlur?: ((e: React.FormEvent<HTMLSelectElement>) => void) | undefined;
|
41
|
-
required?: boolean | undefined;
|
42
|
-
showRequiredAsterisk?: boolean | undefined;
|
43
|
-
} & {
|
7
|
+
}, "required" | "error" | "id" | "name" | "value" | "label" | "className" | "disabled" | "list" | "defaultValue" | "placeholder" | "onBlur" | "onSelect" | "outlined" | "errorMsg" | "renderAsTitle" | "showRequiredAsterisk" | "onInputChange"> | Pick<import("./Dropdown").Props & {
|
44
8
|
onSelect?: ((e: string) => void) | undefined;
|
45
9
|
onInputChange: (e: React.FormEvent<HTMLSelectElement>) => void;
|
46
|
-
}, "required" | "error" | "id" | "name" | "value" | "label" | "className" | "disabled" | "list" | "defaultValue" | "placeholder" | "onBlur" | "onSelect" | "outlined" | "errorMsg" | "
|
10
|
+
}, "required" | "error" | "id" | "name" | "value" | "label" | "className" | "disabled" | "list" | "defaultValue" | "placeholder" | "onBlur" | "onSelect" | "outlined" | "errorMsg" | "renderAsTitle" | "showRequiredAsterisk" | "onInputChange">) & React.RefAttributes<HTMLSelectElement>>;
|
47
11
|
argTypes: {
|
48
12
|
onSelect: {
|
49
13
|
action: string;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { CommonFieldTypes } from './types/commonFieldTypes';
|
3
|
+
interface FieldProps extends CommonFieldTypes {
|
4
|
+
children: React.ReactElement;
|
5
|
+
showCaret?: boolean;
|
6
|
+
value: string;
|
7
|
+
trailingIcon?: string;
|
8
|
+
dropdownKey?: string;
|
9
|
+
fullHeight?: boolean;
|
10
|
+
}
|
11
|
+
export declare const Field: ({ children, renderAsTitle, className, error, id, label, outlined, value, trailingIcon, errorMsg, dropdownKey, required, showCaret, fullHeight, }: FieldProps) => JSX.Element;
|
12
|
+
export {};
|
@@ -0,0 +1,68 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import styled from 'styled-components';
|
3
|
+
import { darken } from 'polished';
|
4
|
+
import { Icon } from '../Icon';
|
5
|
+
import { Text } from '../Text';
|
6
|
+
import { Box } from '../Box';
|
7
|
+
import { theme } from '../theme';
|
8
|
+
export const Field = ({ children, renderAsTitle, className = '', error, id, label, outlined = false, value, trailingIcon, errorMsg, dropdownKey, required, showCaret, fullHeight = false, }) => {
|
9
|
+
return (React.createElement(Container, { className: className },
|
10
|
+
label && (React.createElement(Box, { mb: outlined ? '4px' : '0px' },
|
11
|
+
renderAsTitle ? (React.createElement(Title, null, label)) : (React.createElement(Text, { tag: "label", color: "subtext", typo: "label", htmlFor: id }, label)),
|
12
|
+
required && (React.createElement(Text, { tag: "label", color: "error", typo: "base" },
|
13
|
+
' ',
|
14
|
+
"*")))),
|
15
|
+
React.createElement(Content, { fullHeight: fullHeight, value: value, outlined: outlined, error: error, key: dropdownKey !== null && dropdownKey !== void 0 ? dropdownKey : null },
|
16
|
+
children,
|
17
|
+
showCaret && (React.createElement(Caret, { outlined: outlined },
|
18
|
+
React.createElement(Icon, { render: "caret", color: "subtext", size: 24 })))),
|
19
|
+
trailingIcon && React.createElement(Icon, { render: trailingIcon, color: "subtext" }),
|
20
|
+
error && React.createElement(ErrorBox, null, errorMsg)));
|
21
|
+
};
|
22
|
+
const Container = styled(Box) `
|
23
|
+
display: flex;
|
24
|
+
flex-direction: column;
|
25
|
+
position: relative;
|
26
|
+
`;
|
27
|
+
const Content = styled.div `
|
28
|
+
position: relative;
|
29
|
+
border-color: ${({ error }) => theme.colors[`${error ? 'error' : 'outline'}`]};
|
30
|
+
background-color: ${({ outlined }) => !outlined ? 'transparent' : theme.colors['white']};
|
31
|
+
display: flex;
|
32
|
+
height: ${({ fullHeight }) => (fullHeight ? `100%` : `32px`)};
|
33
|
+
|
34
|
+
&:hover,
|
35
|
+
&:focus-within {
|
36
|
+
border-color: ${({ error }) => error ? theme.colors.error : darken(0.1, theme.colors.outline)};
|
37
|
+
}
|
38
|
+
|
39
|
+
${({ outlined }) => outlined &&
|
40
|
+
`
|
41
|
+
border-radius: 8px;
|
42
|
+
height: auto;
|
43
|
+
`}
|
44
|
+
|
45
|
+
${({ value }) => value &&
|
46
|
+
value != '' &&
|
47
|
+
`
|
48
|
+
border-color: ${theme.colors.outline};
|
49
|
+
`}
|
50
|
+
`;
|
51
|
+
const ErrorBox = styled.span `
|
52
|
+
margin-top: 7px;
|
53
|
+
color: ${theme.colors.error};
|
54
|
+
font-size: 12px;
|
55
|
+
`;
|
56
|
+
const Title = styled.h3 `
|
57
|
+
font-weight: bold;
|
58
|
+
padding-bottom: 8px;
|
59
|
+
`;
|
60
|
+
const Caret = styled.div `
|
61
|
+
position: absolute;
|
62
|
+
top: 50%;
|
63
|
+
z-index: 1;
|
64
|
+
right: ${({ outlined }) => (outlined ? '15px' : '0')};
|
65
|
+
pointer-events: none;
|
66
|
+
transform: translateY(-50%);
|
67
|
+
`;
|
68
|
+
//# sourceMappingURL=Field.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Field.js","sourceRoot":"","sources":["../../src/Field/Field.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,MAAM,MAAM,mBAAmB,CAAA;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAYhC,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,EACpB,QAAQ,EACR,aAAa,EACb,SAAS,GAAG,EAAE,EACd,KAAK,EACL,EAAE,EACF,KAAK,EACL,QAAQ,GAAG,KAAK,EAChB,KAAK,EACL,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,SAAS,EACT,UAAU,GAAG,KAAK,GACP,EAAE,EAAE;IACf,OAAO,CACL,oBAAC,SAAS,IAAC,SAAS,EAAE,SAAS;QAC5B,KAAK,IAAI,CACR,oBAAC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0 +1 @@
|
|
1
|
+
{"version":3,"file":"commonFieldTypes.js","sourceRoot":"","sources":["../../../src/Field/types/commonFieldTypes.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import styled from 'styled-components';
|
3
|
+
import { Box } from '../Box';
|
4
|
+
export const Fieldset = ({ children, label, outlined = false, }) => {
|
5
|
+
return (React.createElement("fieldset", null,
|
6
|
+
React.createElement(Box, { mb: outlined ? '4px' : '0px' },
|
7
|
+
React.createElement(Legend, null, label)),
|
8
|
+
children));
|
9
|
+
};
|
10
|
+
const Legend = styled.legend `
|
11
|
+
font-size: 16px;
|
12
|
+
font-weight: bold;
|
13
|
+
padding-bottom: 8px;
|
14
|
+
`;
|
15
|
+
//# sourceMappingURL=Fieldset.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Fieldset.js","sourceRoot":"","sources":["../../src/Fieldset/Fieldset.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,MAAM,MAAM,mBAAmB,CAAA;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAQ5B,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,EACvB,QAAQ,EACR,KAAK,EACL,QAAQ,GAAG,KAAK,GACF,EAAE,EAAE;IAClB,OAAO,CACL;QACE,oBAAC,GAAG,IAAC,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK;YAC/B,oBAAC,MAAM,QAAE,KAAK,CAAU,CACpB;QAEL,QAAQ,CACA,CACZ,CAAA;AACH,CAAC,CAAA;AAED,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAA;;;;CAI3B,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export { Fieldset } from './Fieldset';
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Fieldset/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA"}
|
@@ -1,25 +1,16 @@
|
|
1
1
|
import { FC } from 'react';
|
2
|
+
import { CommonFieldTypes } from 'Field/types/commonFieldTypes';
|
2
3
|
export declare type SearchInputItem = {
|
3
4
|
label: string;
|
4
5
|
value: string;
|
5
6
|
};
|
6
|
-
export
|
7
|
-
id?: string;
|
8
|
-
/** Name of the form control */
|
7
|
+
export interface SearchInputProps extends CommonFieldTypes {
|
9
8
|
name?: string;
|
10
|
-
/** label displayed above the input */
|
11
9
|
label?: string;
|
12
|
-
/** Placeholder (initial state) */
|
13
10
|
placeholder?: string;
|
14
|
-
/** list of items for the search list */
|
15
11
|
searchList: SearchInputItem[];
|
16
|
-
/** onFound listener */
|
17
12
|
onFound: (element: string) => void;
|
18
|
-
/** Displays search results in a relative position to other elements */
|
19
13
|
resultsRelativePosition?: boolean;
|
20
|
-
/** Displays border */
|
21
|
-
outlined?: boolean;
|
22
|
-
/** Displays search icon */
|
23
14
|
showIcon?: boolean;
|
24
|
-
}
|
15
|
+
}
|
25
16
|
export declare const SearchInput: FC<SearchInputProps>;
|
@@ -1,12 +1,11 @@
|
|
1
1
|
import React, { useState } from 'react';
|
2
2
|
import styled from 'styled-components';
|
3
3
|
import { darken } from 'polished';
|
4
|
-
import { Text } from '../Text';
|
5
|
-
import { Box } from '../Box';
|
6
4
|
import { theme } from '../theme';
|
7
5
|
import { Icon } from '../Icon';
|
6
|
+
import { Field } from '../Field';
|
8
7
|
import { useUniqueId } from '../utils/id';
|
9
|
-
export const SearchInput = ({ id: idProp, name = 'search_input', label, placeholder, searchList, onFound, resultsRelativePosition = false, outlined = false, showIcon = false, }) => {
|
8
|
+
export const SearchInput = ({ id: idProp, name = 'search_input', label, className = '', placeholder, searchList, onFound, resultsRelativePosition = false, outlined = false, showIcon = false, renderAsTitle = false, }) => {
|
10
9
|
const id = useUniqueId(idProp);
|
11
10
|
const [active, setActive] = useState(false);
|
12
11
|
const [list, setList] = useState([]);
|
@@ -15,10 +14,8 @@ export const SearchInput = ({ id: idProp, name = 'search_input', label, placehol
|
|
15
14
|
const search = (e) => {
|
16
15
|
const value = e.currentTarget.value;
|
17
16
|
if (value) {
|
18
|
-
// start filtering if the input has at least 2 characters
|
19
17
|
if (value.length >= 2) {
|
20
18
|
const filteredList = searchList.filter((el) => el.label.toLowerCase().includes(value.toLocaleLowerCase()));
|
21
|
-
// update the local state with the filtered results
|
22
19
|
setActive(true);
|
23
20
|
setList(filteredList);
|
24
21
|
}
|
@@ -37,21 +34,15 @@ export const SearchInput = ({ id: idProp, name = 'search_input', label, placehol
|
|
37
34
|
onFound(selectedItem.value);
|
38
35
|
setSelected(true);
|
39
36
|
};
|
40
|
-
return (React.createElement(
|
41
|
-
|
42
|
-
React.createElement(
|
43
|
-
|
44
|
-
|
45
|
-
React.createElement(
|
46
|
-
|
47
|
-
React.createElement(ResultsList, { outlined: outlined }, list.length ? (list.map((el, i) => (React.createElement("li", { key: i, onClick: () => select(el) }, el.label)))) : (React.createElement("li", null, "No results"))))));
|
37
|
+
return (React.createElement(Field, { className: className, renderAsTitle: renderAsTitle, id: id, label: label, outlined: outlined, value: selectedResult },
|
38
|
+
React.createElement(React.Fragment, null,
|
39
|
+
React.createElement(StyledInputBox, { outlined: outlined, selected: selected },
|
40
|
+
showIcon && React.createElement(SearchIcon, { size: 24, render: "search", color: "subtext" }),
|
41
|
+
React.createElement(StyledInput, { id: id, type: "text", name: name, placeholder: placeholder, autoComplete: "off", value: selectedResult, onKeyUp: search, onChange: updateInputState, outlined: outlined, selected: selected })),
|
42
|
+
React.createElement(StyledResultsContainer, { show: active, absolutePosition: !resultsRelativePosition, outlined: outlined },
|
43
|
+
React.createElement(ResultsList, { outlined: outlined }, list.length ? (list.map((el, i) => (React.createElement("li", { key: i, onClick: () => select(el) }, el.label)))) : (React.createElement("li", null, "No results")))))));
|
48
44
|
};
|
49
|
-
const
|
50
|
-
position: relative;
|
51
|
-
width: 100%;
|
52
|
-
background: ${theme.colors.white};
|
53
|
-
`;
|
54
|
-
const InputBox = styled.div `
|
45
|
+
const StyledInputBox = styled.div `
|
55
46
|
display: flex;
|
56
47
|
align-items: center;
|
57
48
|
border-bottom: ${({ outlined }) => outlined ? 'none' : `1px solid ${theme.colors.outline}`};
|
@@ -75,7 +66,7 @@ const InputBox = styled.div `
|
|
75
66
|
`}
|
76
67
|
color: ${({ outlined }) => outlined ? `${theme.colors.outline}` : `${theme.colors.secondary}`};
|
77
68
|
`;
|
78
|
-
const
|
69
|
+
const StyledInput = styled.input `
|
79
70
|
display: block;
|
80
71
|
border: none;
|
81
72
|
outline: none;
|
@@ -92,7 +83,7 @@ const Input = styled.input `
|
|
92
83
|
height: auto;
|
93
84
|
`}
|
94
85
|
`;
|
95
|
-
const
|
86
|
+
const StyledResultsContainer = styled.div `
|
96
87
|
box-sizing: border-box;
|
97
88
|
overflow-y: hidden;
|
98
89
|
${({ absolutePosition }) => absolutePosition && 'position: absolute;'}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SearchInput.js","sourceRoot":"","sources":["../../src/SearchInput/SearchInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAM,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,MAAM,MAAM,mBAAmB,CAAA;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"SearchInput.js","sourceRoot":"","sources":["../../src/SearchInput/SearchInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAM,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,MAAM,MAAM,mBAAmB,CAAA;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM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AC,OAAO;;;IAG7B,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CACjB,QAAQ;IACR;;GAED;CACF,CAAA;AAOD,MAAM,sBAAsB,GAAG,MAAM,CAAC,GAAG,CAAkB;;;IAGvD,CAAC,EAAE,gBAAgB,EAAE,EAAE,EAAE,CAAC,gBAAgB,IAAI,qBAAqB;;gBAEvD,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC;IACvD,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,QAAQ,IAAI,sBAAsB;;;kBAGtC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;;CAEvD,CAAA;AAED,MAAM,WAAW,GAAG,MAAM,CAAC,EAAE,CAAa;;;;;;sBAMpB,KAAK,CAAC,MAAM,CAAC,KAAK;sBAClB,KAAK,CAAC,MAAM,CAAC,OAAO;;;;;IAKtC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CACjB,QAAQ;IACR;wBACoB,KAAK,CAAC,MAAM,CAAC,OAAO;GACzC;;;;;;aAMU,KAAK,CAAC,MAAM,CAAC,SAAS;;;;0BAIT,KAAK,CAAC,MAAM,CAAC,UAAU;;;CAGhD,CAAA;AAED,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;CAE9B,CAAA"}
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import { FC } from 'react';
|
1
|
+
import { FC, ReactElement } from 'react';
|
2
2
|
declare type SupportMessageType = 'info' | 'info-outline' | 'alert' | 'warning';
|
3
3
|
export declare type SupportMessageProps = {
|
4
4
|
className?: string;
|
5
|
-
description: string;
|
5
|
+
description: string | ReactElement;
|
6
6
|
type: SupportMessageType;
|
7
7
|
title?: string;
|
8
8
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SupportMessage.js","sourceRoot":"","sources":["../../src/SupportMessage/SupportMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"SupportMessage.js","sourceRoot":"","sources":["../../src/SupportMessage/SupportMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAA;AAC/C,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAElC,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,KAAK,EAAS,MAAM,UAAU,CAAA;AAQvC,MAAM,MAAM,GAA2C;IACrD,IAAI,EAAE;QACJ,SAAS,EAAE,WAAW;QACtB,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,UAAU;QACxC,IAAI,EAAE,MAAM;KACb;IACD,cAAc,EAAE;QACd,SAAS,EAAE,WAAW;QACtB,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK;QACnC,IAAI,EAAE,MAAM;KACb;IACD,KAAK,EAAE;QACL,SAAS,EAAE,cAAc;QACzB,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,WAAW;QACzC,IAAI,EAAE,OAAO;KACd;IACD,OAAO,EAAE;QACP,SAAS,EAAE,OAAO;QAClB,eAAe,EAAE,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;QAClD,IAAI,EAAE,SAAS;KAChB;CACF,CAAA;AAWD,MAAM,CAAC,MAAM,cAAc,GAA4B,CAAC,EACtD,SAAS,EACT,WAAW,EACX,IAAI,GAAG,MAAM,EACb,KAAK,GACN,EAAE,EAAE,CAAC,CACJ,oBAAC,OAAO,IAAC,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI;IACvC,oBAAC,WAAW;QACV,oBAAC,IAAI,IACH,IAAI,EAAE,EAAE,EACR,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,EACzB,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,SAAS,GAC7B,CACU;IACd,oBAAC,UAAU,IAAC,IAAI,QAAC,SAAS,EAAC,QAAQ;QAChC,KAAK,IAAI,oBAAC,KAAK,QAAE,KAAK,CAAS;QAC/B,WAAW,CACD,CACL,CACX,CAAA;AAMD,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;;CAE9B,CAAA;AAED,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CACxB,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,GAAG,CAAA;;wBAEK,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe;MAC9C,IAAI,KAAK,cAAc,IAAI,qBAAqB,KAAK,CAAC,MAAM,CAAC,SAAS,EAAE;;;;;GAK3E,CACF,CAAA;AAED,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;;WAEnB,KAAK,CAAC,MAAM,CAAC,SAAS;;CAEhC,CAAA;AAED,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAA;;iBAEL,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM;WAC9B,KAAK,CAAC,MAAM,CAAC,SAAS;;;CAGhC,CAAA"}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { SupportMessage } from './SupportMessage';
|
3
|
+
import { Link } from '../Link';
|
3
4
|
import { CollectionPage } from './Collection';
|
4
5
|
export default {
|
5
6
|
title: 'SupportMessage',
|
@@ -13,5 +14,13 @@ const supportMessageArgs = {
|
|
13
14
|
description: 'Some description text',
|
14
15
|
};
|
15
16
|
Default.args = supportMessageArgs;
|
17
|
+
export const WithCustomDescription = Template.bind({});
|
18
|
+
WithCustomDescription.args = {
|
19
|
+
type: 'info',
|
20
|
+
title: 'A SupportMessage using the Link component',
|
21
|
+
description: (React.createElement(React.Fragment, null,
|
22
|
+
"Some text rendered using a ",
|
23
|
+
React.createElement(Link, { href: '' }, "Link"))),
|
24
|
+
};
|
16
25
|
export const Collection = CollectionPage.bind({});
|
17
26
|
//# sourceMappingURL=SupportMessage.stories.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SupportMessage.stories.js","sourceRoot":"","sources":["../../src/SupportMessage/SupportMessage.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,cAAc,EAAuB,MAAM,kBAAkB,CAAA;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAE7C,eAAe;IACb,KAAK,EAAE,gBAAgB;IACvB,SAAS,EAAE,cAAc;CAC1B,CAAA;AAED,MAAM,QAAQ,GAAG,CAAC,KAA0B,EAAE,EAAE,CAAC,CAC/C,oBAAC,cAAc,oBAAK,KAAK,kCAA+C,CACzE,CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAExC,MAAM,kBAAkB,GAAwB;IAC9C,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,SAAS;IAChB,WAAW,EAAE,uBAAuB;CACrC,CAAA;AAED,OAAO,CAAC,IAAI,GAAG,kBAAkB,CAAA;AAEjC,MAAM,CAAC,MAAM,UAAU,GAAG,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA"}
|
1
|
+
{"version":3,"file":"SupportMessage.stories.js","sourceRoot":"","sources":["../../src/SupportMessage/SupportMessage.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,cAAc,EAAuB,MAAM,kBAAkB,CAAA;AACtE,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAE7C,eAAe;IACb,KAAK,EAAE,gBAAgB;IACvB,SAAS,EAAE,cAAc;CAC1B,CAAA;AAED,MAAM,QAAQ,GAAG,CAAC,KAA0B,EAAE,EAAE,CAAC,CAC/C,oBAAC,cAAc,oBAAK,KAAK,kCAA+C,CACzE,CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAExC,MAAM,kBAAkB,GAAwB;IAC9C,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,SAAS;IAChB,WAAW,EAAE,uBAAuB;CACrC,CAAA;AAED,OAAO,CAAC,IAAI,GAAG,kBAAkB,CAAA;AAEjC,MAAM,CAAC,MAAM,qBAAqB,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAEtD,qBAAqB,CAAC,IAAI,GAAG;IAC3B,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,2CAA2C;IAClD,WAAW,EAAE,CACX;;QAC6B,oBAAC,IAAI,IAAC,IAAI,EAAE,EAAE,WAAa,CACrD,CACJ;CACF,CAAA;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA"}
|
@@ -11,6 +11,7 @@ import React from 'react';
|
|
11
11
|
import { render, screen } from '@testing-library/react';
|
12
12
|
import 'jest-styled-components';
|
13
13
|
import { SupportMessage } from './SupportMessage';
|
14
|
+
import { Link } from '../Link';
|
14
15
|
const supportMessageProps = {
|
15
16
|
description: 'Type info support message',
|
16
17
|
type: 'info',
|
@@ -26,5 +27,12 @@ describe('SupportMessage component', () => {
|
|
26
27
|
expect(yield findByText('Type info support message')).toBeInTheDocument();
|
27
28
|
expect(yield findByText('Info title')).toBeInTheDocument();
|
28
29
|
}));
|
30
|
+
it('Renders a Link within the description', () => {
|
31
|
+
const { container } = render(React.createElement(React.Fragment, null,
|
32
|
+
"Some text rendered with a ",
|
33
|
+
React.createElement(Link, { href: '' }, "Link"),
|
34
|
+
' '));
|
35
|
+
expect(container.firstChild).toMatchSnapshot();
|
36
|
+
});
|
29
37
|
});
|
30
38
|
//# sourceMappingURL=SupportMessage.test.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SupportMessage.test.js","sourceRoot":"","sources":["../../src/SupportMessage/SupportMessage.test.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,wBAAwB,CAAA;AAE/B,OAAO,EAAE,cAAc,EAAuB,MAAM,kBAAkB,CAAA;
|
1
|
+
{"version":3,"file":"SupportMessage.test.js","sourceRoot":"","sources":["../../src/SupportMessage/SupportMessage.test.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,wBAAwB,CAAA;AAE/B,OAAO,EAAE,cAAc,EAAuB,MAAM,kBAAkB,CAAA;AACtE,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAE9B,MAAM,mBAAmB,GAAwB;IAC/C,WAAW,EAAE,2BAA2B;IACxC,IAAI,EAAE,MAAM;CACb,CAAA;AAED,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,CAAA;IAC7B,EAAE,CAAC,2CAA2C,EAAE,GAAS,EAAE;QACzD,MAAM,CAAC,oBAAC,cAAc,oBAAK,mBAAmB,EAAI,CAAC,CAAA;QAEnD,MAAM,CAAC,MAAM,UAAU,CAAC,2BAA2B,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAA;IAC3E,CAAC,CAAA,CAAC,CAAA;IAEF,EAAE,CAAC,sDAAsD,EAAE,GAAS,EAAE;QACpE,MAAM,CAAC,oBAAC,cAAc,oBAAK,mBAAmB,IAAE,KAAK,EAAC,YAAY,IAAG,CAAC,CAAA;QAEtE,MAAM,CAAC,MAAM,UAAU,CAAC,2BAA2B,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAA;QACzE,MAAM,CAAC,MAAM,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAA;IAC5D,CAAC,CAAA,CAAC,CAAA;IAEF,EAAE,CAAC,uCAAuC,EAAE,GAAG,EAAE;QAC/C,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAC1B;;YAC4B,oBAAC,IAAI,IAAC,IAAI,EAAE,EAAE,WAAa;YAAC,GAAG,CACxD,CACJ,CAAA;QACD,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,eAAe,EAAE,CAAA;IAChD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
package/dist/Tag/Tag.js
CHANGED
@@ -12,7 +12,7 @@ const Wrapper = styled.div `
|
|
12
12
|
border: ${({ borderColor }) => borderColor && `1px solid ${theme.colors[borderColor]}`};
|
13
13
|
box-sizing: border-box;
|
14
14
|
display: inline-flex;
|
15
|
-
height:
|
15
|
+
height: 23px;
|
16
16
|
padding: 5px 12px;
|
17
17
|
`;
|
18
18
|
const TagText = styled(Text) `
|
package/dist/Tag/Tag.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Tag.js","sourceRoot":"","sources":["../../src/Tag/Tag.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAa,MAAM,OAAO,CAAA;AACjC,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAS,KAAK,EAAE,MAAM,UAAU,CAAA;AAyBvC,MAAM,CAAC,MAAM,GAAG,GAAiB,CAAC,EAChC,KAAK,EACL,KAAK,EACL,WAAW,EACX,OAAO,EACP,SAAS,EACT,IAAI,EACJ,UA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IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,OAAO,EAAE,KAAK,EAAE,KAAK,IACpD,KAAK,CACE,CACF,CACX,CAAA;AAID,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAc;sBAClB,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC;gBACvD,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAC/B,UAAU;IACV,8EAA8E;;YAEtE,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAC5B,WAAW,IAAI,aAAa,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE;;;;;CAK1D,CAAA;AAED,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;;;;CAK3B,CAAA"}
|
@@ -1,34 +1,16 @@
|
|
1
1
|
import React, { FormEvent } from 'react';
|
2
|
-
|
3
|
-
|
4
|
-
className?: string;
|
5
|
-
/** Input type for proper browser support */
|
2
|
+
import { CommonFieldTypes } from 'Field/types/commonFieldTypes';
|
3
|
+
interface Props extends CommonFieldTypes {
|
6
4
|
type?: 'text' | 'email' | 'password' | 'time' | 'date';
|
7
|
-
/** used to render outlined style */
|
8
|
-
outlined?: boolean;
|
9
|
-
/** Placeholder */
|
10
5
|
placeholder: string;
|
11
|
-
/** label displayed above the input */
|
12
|
-
label?: string;
|
13
|
-
/** used for label - input connection */
|
14
6
|
name?: string;
|
15
|
-
/** input value */
|
16
7
|
value: string;
|
17
|
-
/** error flag */
|
18
|
-
error?: boolean;
|
19
|
-
/** error text message */
|
20
|
-
errorMsg?: string;
|
21
|
-
/** onBlur listener */
|
22
8
|
onBlur?: (e: FormEvent<HTMLInputElement>) => void;
|
23
|
-
/** used for adding a trailing icon */
|
24
9
|
trailingIcon?: string;
|
25
|
-
/** Disabled flag */
|
26
10
|
disabled?: boolean;
|
27
|
-
|
28
|
-
required?: boolean;
|
29
|
-
};
|
11
|
+
}
|
30
12
|
/** on change or on input required */
|
31
|
-
declare type
|
13
|
+
declare type InputProps = {
|
32
14
|
/** on change is required and on input optional */
|
33
15
|
onChange: (e: string) => void;
|
34
16
|
onInputChange?: (e: FormEvent<HTMLInputElement>) => void;
|
@@ -37,6 +19,6 @@ declare type TruncateProps = {
|
|
37
19
|
onChange?: (e: string) => void;
|
38
20
|
onInputChange: (e: FormEvent<HTMLInputElement>) => void;
|
39
21
|
};
|
40
|
-
export declare type TextInputProps =
|
22
|
+
export declare type TextInputProps = Props & InputProps;
|
41
23
|
export declare const TextInput: React.ForwardRefExoticComponent<TextInputProps & React.RefAttributes<HTMLInputElement>>;
|
42
24
|
export {};
|
@@ -1,59 +1,34 @@
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
2
|
+
var t = {};
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
4
|
+
t[p] = s[p];
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
8
|
+
t[p[i]] = s[p[i]];
|
9
|
+
}
|
10
|
+
return t;
|
11
|
+
};
|
1
12
|
import React, { forwardRef } from 'react';
|
2
13
|
import styled from 'styled-components';
|
3
|
-
import { darken } from 'polished';
|
4
|
-
import { Box } from '../Box';
|
5
|
-
import { Text } from '../Text';
|
6
|
-
import { Icon } from '../Icon';
|
7
14
|
import { theme } from '../theme';
|
15
|
+
import { Field } from '../Field';
|
8
16
|
import { useUniqueId } from '../utils/id';
|
9
|
-
export const TextInput = forwardRef(function TextInput(
|
17
|
+
export const TextInput = forwardRef(function TextInput(_a, ref) {
|
18
|
+
var { id: idProp, type = 'text', placeholder, name, value, outlined = false, error = false, onBlur, onChange, onInputChange, disabled = false } = _a, fieldProps = __rest(_a, ["id", "type", "placeholder", "name", "value", "outlined", "error", "onBlur", "onChange", "onInputChange", "disabled"]);
|
10
19
|
const id = useUniqueId(idProp);
|
11
|
-
return (React.createElement(
|
12
|
-
|
13
|
-
React.createElement(
|
14
|
-
required && (React.createElement(Text, { tag: "label", color: "error", typo: "label" }, "*")))),
|
15
|
-
React.createElement(Content, { value: value, outlined: outlined, error: error },
|
16
|
-
React.createElement(Input, { disabled: disabled, type: type, id: id, name: name, ref: ref, placeholder: placeholder, value: value, error: error, outlined: outlined, autoComplete: "off", onChange: (e) => {
|
20
|
+
return (React.createElement(Field, Object.assign({}, fieldProps, { id: id, error: error, outlined: outlined, value: value }),
|
21
|
+
React.createElement(React.Fragment, null,
|
22
|
+
React.createElement(StyledInput, { disabled: disabled, type: type, id: id, name: name, ref: ref, placeholder: placeholder, value: value, error: error, outlined: outlined, autoComplete: "off", onChange: (e) => {
|
17
23
|
onChange && onChange(e.currentTarget.value);
|
18
24
|
onInputChange && onInputChange(e);
|
19
25
|
}, onBlur: (e) => {
|
20
26
|
onBlur && onBlur(e);
|
21
|
-
} })
|
22
|
-
trailingIcon && React.createElement(Icon, { render: trailingIcon, color: "subtext" })),
|
23
|
-
error && React.createElement(ErrorBox, null, errorMsg)));
|
27
|
+
} }))));
|
24
28
|
});
|
25
|
-
const
|
26
|
-
display: flex;
|
27
|
-
flex-direction: column;
|
28
|
-
height: auto;
|
29
|
-
`;
|
30
|
-
const Content = styled.div `
|
29
|
+
const StyledInput = styled.input `
|
31
30
|
border-bottom: 1px solid;
|
32
31
|
border-color: ${({ error }) => theme.colors[`${error ? 'error' : 'outline'}`]};
|
33
|
-
background-color: ${({ outlined }) => outlined ? 'transparent' : theme.colors['white']};
|
34
|
-
display: flex;
|
35
|
-
height: 32px;
|
36
|
-
|
37
|
-
&:hover,
|
38
|
-
&:focus-within {
|
39
|
-
border-color: ${({ error }) => error ? theme.colors.error : darken(0.1, theme.colors.outline)};
|
40
|
-
}
|
41
|
-
|
42
|
-
${({ outlined, error }) => outlined &&
|
43
|
-
`
|
44
|
-
border: 2px solid ${error ? theme.colors.error : theme.colors.outline};
|
45
|
-
border-radius: 8px;
|
46
|
-
height: auto;
|
47
|
-
`}
|
48
|
-
|
49
|
-
${({ value }) => value &&
|
50
|
-
value != '' &&
|
51
|
-
`
|
52
|
-
border-color: ${theme.colors.outline};
|
53
|
-
`}
|
54
|
-
`;
|
55
|
-
const Input = styled.input `
|
56
|
-
border: none;
|
57
32
|
background-color: transparent;
|
58
33
|
color: ${({ error }) => theme.colors[`${error ? 'error' : 'secondary'}`]};
|
59
34
|
font-size: 16px;
|
@@ -67,9 +42,4 @@ const Input = styled.input `
|
|
67
42
|
color: ${theme.colors.subtext};
|
68
43
|
}
|
69
44
|
`;
|
70
|
-
const ErrorBox = styled.span `
|
71
|
-
margin-top: 7px;
|
72
|
-
color: ${theme.colors.error};
|
73
|
-
font-size: 12px;
|
74
|
-
`;
|
75
45
|
//# sourceMappingURL=TextInput.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"TextInput.js","sourceRoot":"","sources":["../../src/TextInput/TextInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAa,UAAU,EAAgB,MAAM,OAAO,CAAA;AAClE,OAAO,MAAM,MAAM,mBAAmB,CAAA;
|
1
|
+
{"version":3,"file":"TextInput.js","sourceRoot":"","sources":["../../src/TextInput/TextInput.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAa,UAAU,EAAgB,MAAM,OAAO,CAAA;AAClE,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AA4BzC,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CAAC,SAAS,SAAS,CACpD,EAaiB,EACjB,GAAmC;QAdn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,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;;;;YAI9D,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC;aACvD,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC;aAC1C,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC;;;aAGtD,KAAK,CAAC,MAAM,CAAC,OAAO;;CAEhC,CAAA"}
|
@@ -2,38 +2,24 @@ import React, { FormEvent } from 'react';
|
|
2
2
|
declare type BaseProps = {
|
3
3
|
id?: string;
|
4
4
|
className?: string;
|
5
|
-
/** Placeholder */
|
6
5
|
placeholder?: string;
|
7
|
-
/** label displayed above the input */
|
8
6
|
label?: string;
|
9
|
-
/** used for label - input connection */
|
10
7
|
name?: string;
|
11
|
-
/** input value */
|
12
8
|
value: string;
|
13
|
-
/** error flag */
|
14
9
|
error?: boolean;
|
15
|
-
/** error text message */
|
16
10
|
errorMsg?: string;
|
17
|
-
/** Allow user to resize the textarea vertically and horizontally or not */
|
18
11
|
resize?: 'none' | 'both';
|
19
|
-
/** Disabled flag */
|
20
12
|
disabled?: boolean;
|
21
|
-
/** maxLength property */
|
22
13
|
maxLength?: number;
|
23
|
-
/** onBlur listener */
|
24
14
|
onBlur?: (e: FormEvent<HTMLTextAreaElement>) => void;
|
25
|
-
/** number of rows of input */
|
26
15
|
rows?: number;
|
27
|
-
/** Required flag */
|
28
16
|
required?: boolean;
|
17
|
+
renderAsTitle?: boolean;
|
29
18
|
};
|
30
|
-
/** on change or on input required */
|
31
19
|
declare type TruncateProps = {
|
32
|
-
/** on change is required and on input optional */
|
33
20
|
onChange: (e: string) => void;
|
34
21
|
onInputChange?: (e: FormEvent<HTMLTextAreaElement>) => void;
|
35
22
|
} | {
|
36
|
-
/** on input is required and on change optional */
|
37
23
|
onChange?: (e: string) => void;
|
38
24
|
onInputChange: (e: FormEvent<HTMLTextAreaElement>) => void;
|
39
25
|
};
|
@@ -1,26 +1,30 @@
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
2
|
+
var t = {};
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
4
|
+
t[p] = s[p];
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
8
|
+
t[p[i]] = s[p[i]];
|
9
|
+
}
|
10
|
+
return t;
|
11
|
+
};
|
1
12
|
import React, { forwardRef } from 'react';
|
2
13
|
import styled from 'styled-components';
|
3
14
|
import { darken } from 'polished';
|
4
|
-
import { Text } from '../Text';
|
5
|
-
import { Box } from '../Box';
|
6
15
|
import { theme } from '../theme';
|
7
16
|
import { useUniqueId } from '../utils/id';
|
8
|
-
|
17
|
+
import { Field } from '../Field';
|
18
|
+
export const Textarea = forwardRef(function Textarea(_a, ref) {
|
19
|
+
var { id: idProp, name, value, onChange, onInputChange, resize = 'none', error = false, placeholder, disabled = false, maxLength, onBlur, rows = 4 } = _a, fieldProps = __rest(_a, ["id", "name", "value", "onChange", "onInputChange", "resize", "error", "placeholder", "disabled", "maxLength", "onBlur", "rows"]);
|
9
20
|
const id = useUniqueId(idProp);
|
10
|
-
return (React.createElement(
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
React.createElement(Field, { error: error, id: id, name: name, disabled: disabled, resize: resize, placeholder: placeholder, value: value, onChange: (e) => {
|
16
|
-
onChange && onChange(e.currentTarget.value);
|
17
|
-
onInputChange && onInputChange(e);
|
18
|
-
}, maxLength: maxLength, ref: ref, onBlur: (e) => {
|
19
|
-
onBlur && onBlur(e);
|
20
|
-
}, rows: rows })),
|
21
|
-
error && React.createElement(ErrorBox, null, errorMsg)));
|
21
|
+
return (React.createElement(Field, Object.assign({}, fieldProps, { id: id, error: error, value: value, fullHeight: true }),
|
22
|
+
React.createElement(StyledTextArea, { error: error, id: id, name: name, disabled: disabled, resize: resize, placeholder: placeholder, value: value, onChange: (e) => {
|
23
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(e.currentTarget.value);
|
24
|
+
onInputChange === null || onInputChange === void 0 ? void 0 : onInputChange(e);
|
25
|
+
}, maxLength: maxLength, onBlur: onBlur, rows: rows })));
|
22
26
|
});
|
23
|
-
const
|
27
|
+
const StyledTextArea = styled.textarea `
|
24
28
|
font-size: 16px;
|
25
29
|
line-height: 20px;
|
26
30
|
background: ${theme.colors.white};
|
@@ -48,9 +52,4 @@ const Field = styled.textarea `
|
|
48
52
|
border-color: ${theme.colors.outline};
|
49
53
|
`}
|
50
54
|
`;
|
51
|
-
const ErrorBox = styled.span `
|
52
|
-
margin-top: 7px;
|
53
|
-
font-size: 12px;
|
54
|
-
color: ${theme.colors.error};
|
55
|
-
`;
|
56
55
|
//# sourceMappingURL=Textarea.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Textarea.js","sourceRoot":"","sources":["../../src/Textarea/Textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA2B,UAAU,EAAE,MAAM,OAAO,CAAA;AAClE,OAAO,MAAM,MAAM,mBAAmB,CAAA;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"Textarea.js","sourceRoot":"","sources":["../../src/Textarea/Textarea.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,O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MAAM,EACd,IAAI,EAAE,IAAI,GACV,CACI,CACT,CAAA;AACH,CAAC,CAAC,CAAA;AASF,MAAM,cAAc,GAAG,MAAM,CAAC,QAAQ,CAAU;;;gBAGhC,KAAK,CAAC,MAAM,CAAC,KAAK;sBACZ,KAAK,CAAC,MAAM,CAAC,OAAO;;;;;WAK/B,KAAK,CAAC,MAAM,CAAC,SAAS;YACrB,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM;YACtB,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC;aACpD,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC;kBACrC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAC5B,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;;;;;;oBAM9B,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAC5B,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC;;;IAGhE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CACd,KAAK;IACL,KAAK,IAAI,EAAE;IACX;sBACkB,KAAK,CAAC,MAAM,CAAC,OAAO;KACrC;CACJ,CAAA"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,OAAO,CAAA;AACr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