@sellout/ui 0.0.300 → 0.0.301
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/build/Colors.d.ts +15 -1
- package/build/Colors.js +14 -0
- package/build/Colors.js.map +1 -1
- package/build/components/AddressSearchDropdown.d.ts +8 -2
- package/build/components/AddressSearchDropdown.js +2 -4
- package/build/components/AddressSearchDropdown.js.map +1 -1
- package/build/components/Button.d.ts +19 -2
- package/build/components/Button.js +76 -11
- package/build/components/Button.js.map +1 -1
- package/build/components/CodeInput.d.ts +14 -1
- package/build/components/CodeInput.js +30 -21
- package/build/components/CodeInput.js.map +1 -1
- package/build/components/Counter.js +6 -8
- package/build/components/Counter.js.map +1 -1
- package/build/components/Dropdown.d.ts +12 -1
- package/build/components/Dropdown.js +15 -11
- package/build/components/Dropdown.js.map +1 -1
- package/build/components/Flex.d.ts +2 -0
- package/build/components/Flex.js +3 -3
- package/build/components/Flex.js.map +1 -1
- package/build/components/Icon.d.ts +11 -1
- package/build/components/Icon.js +6 -6
- package/build/components/Icon.js.map +1 -1
- package/build/components/Input.d.ts +29 -3
- package/build/components/Input.js +38 -25
- package/build/components/Input.js.map +1 -1
- package/build/components/Label.d.ts +7 -0
- package/build/components/Label.js +6 -6
- package/build/components/Label.js.map +1 -1
- package/build/components/Loader.js.map +1 -1
- package/build/components/MaxLength.d.ts +1 -0
- package/build/components/MaxLength.js +4 -1
- package/build/components/MaxLength.js.map +1 -1
- package/build/components/PhoneNumberInput.d.ts +15 -1
- package/build/components/PhoneNumberInput.js +14 -6
- package/build/components/PhoneNumberInput.js.map +1 -1
- package/build/components/Product.d.ts +7 -2
- package/build/components/Product.js +47 -34
- package/build/components/Product.js.map +1 -1
- package/build/components/SearchDropdown.d.ts +8 -1
- package/build/components/SearchDropdown.js +12 -15
- package/build/components/SearchDropdown.js.map +1 -1
- package/build/components/SvgIcons.d.ts +15 -0
- package/build/components/SvgIcons.js +41 -0
- package/build/components/SvgIcons.js.map +1 -0
- package/build/components/SvgRendrer.d.ts +5 -0
- package/build/components/SvgRendrer.js +21 -0
- package/build/components/SvgRendrer.js.map +1 -0
- package/build/components/TextButton.d.ts +2 -0
- package/build/components/TextButton.js +6 -6
- package/build/components/TextButton.js.map +1 -1
- package/build/components/UserInfo.d.ts +10 -2
- package/build/components/UserInfo.js +9 -7
- package/build/components/UserInfo.js.map +1 -1
- package/build/components/ValidationError.d.ts +1 -0
- package/build/components/ValidationError.js +4 -1
- package/build/components/ValidationError.js.map +1 -1
- package/build/index.d.ts +2 -1
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/package.json +3 -3
package/build/Colors.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export declare enum Colors {
|
|
2
2
|
White = "#FFFFFF",
|
|
3
3
|
Black = "#000000",
|
|
4
|
+
Black2 = "#141414",
|
|
4
5
|
Yellow = "#FFBA49",
|
|
5
6
|
Green = "#42BB83",
|
|
6
7
|
OffWhite = "#FCFCFC",
|
|
7
8
|
LightBlue = "#39159C",
|
|
9
|
+
Secondary = "#1E1E1E",
|
|
8
10
|
Blue = "#2D0E84",
|
|
9
11
|
DarkBlue = "#1D0858",
|
|
10
12
|
Red = "#E63946",
|
|
@@ -19,5 +21,17 @@ export declare enum Colors {
|
|
|
19
21
|
Grey5 = "#E0E0E0",
|
|
20
22
|
Grey6 = "#F2F2F2",
|
|
21
23
|
Grey7 = "#F8F8F8",
|
|
22
|
-
|
|
24
|
+
Grey8 = "#424242",
|
|
25
|
+
Purple = "#040436",
|
|
26
|
+
SecondarySurface = "#1E1E1E",
|
|
27
|
+
SecondaryStroke = "#424242",
|
|
28
|
+
SurfaceTertiary = "#141414",
|
|
29
|
+
HeadingSecondary = "#FCFCFC",
|
|
30
|
+
SupportTertiary = "#A3A3A3",
|
|
31
|
+
HeadingPrimary = "#EF602E",
|
|
32
|
+
InteractiveBGSecondary = "#292929",
|
|
33
|
+
InteractiveBGPrimary = "#EA4513",
|
|
34
|
+
TagBGTertiary = "#0C0C0C",
|
|
35
|
+
TextSupportSecondary = "#D6D6D6",
|
|
36
|
+
ErrorRed = "#F31B43"
|
|
23
37
|
}
|
package/build/Colors.js
CHANGED
|
@@ -2,11 +2,13 @@ var Colors;
|
|
|
2
2
|
(function (Colors) {
|
|
3
3
|
Colors["White"] = "#FFFFFF";
|
|
4
4
|
Colors["Black"] = "#000000";
|
|
5
|
+
Colors["Black2"] = "#141414";
|
|
5
6
|
Colors["Yellow"] = "#FFBA49";
|
|
6
7
|
// Green = "#419D78",
|
|
7
8
|
Colors["Green"] = "#42BB83";
|
|
8
9
|
Colors["OffWhite"] = "#FCFCFC";
|
|
9
10
|
Colors["LightBlue"] = "#39159C";
|
|
11
|
+
Colors["Secondary"] = "#1E1E1E";
|
|
10
12
|
Colors["Blue"] = "#2D0E84";
|
|
11
13
|
Colors["DarkBlue"] = "#1D0858";
|
|
12
14
|
Colors["Red"] = "#E63946";
|
|
@@ -21,7 +23,19 @@ var Colors;
|
|
|
21
23
|
Colors["Grey5"] = "#E0E0E0";
|
|
22
24
|
Colors["Grey6"] = "#F2F2F2";
|
|
23
25
|
Colors["Grey7"] = "#F8F8F8";
|
|
26
|
+
Colors["Grey8"] = "#424242";
|
|
24
27
|
Colors["Purple"] = "#040436";
|
|
28
|
+
Colors["SecondarySurface"] = "#1E1E1E";
|
|
29
|
+
Colors["SecondaryStroke"] = "#424242";
|
|
30
|
+
Colors["SurfaceTertiary"] = "#141414";
|
|
31
|
+
Colors["HeadingSecondary"] = "#FCFCFC";
|
|
32
|
+
Colors["SupportTertiary"] = "#A3A3A3";
|
|
33
|
+
Colors["HeadingPrimary"] = "#EF602E";
|
|
34
|
+
Colors["InteractiveBGSecondary"] = "#292929";
|
|
35
|
+
Colors["InteractiveBGPrimary"] = "#EA4513";
|
|
36
|
+
Colors["TagBGTertiary"] = "#0C0C0C";
|
|
37
|
+
Colors["TextSupportSecondary"] = "#D6D6D6";
|
|
38
|
+
Colors["ErrorRed"] = "#F31B43";
|
|
25
39
|
})(Colors || (Colors = {}));
|
|
26
40
|
|
|
27
41
|
export { Colors };
|
package/build/Colors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Colors.js","sources":["../src/Colors.ts"],"sourcesContent":["export enum Colors {\n White = \"#FFFFFF\",\n Black = \"#000000\",\n Yellow = '#FFBA49',\n // Green = \"#419D78\",\n Green = '#42BB83',\n OffWhite = \"#FCFCFC\",\n LightBlue = \"#39159C\",\n Blue = \"#2D0E84\",\n DarkBlue = \"#1D0858\",\n Red = \"#E63946\",\n Orange = \"#FF700F\",\n FadedOrange = '#FFF1E7',\n LightOrange = \"#FFBE93\",\n DarkOrange = \"#D65600\",\n Grey1 = \"#333333\",\n Grey2 = \"#4F4F4F\",\n Grey3 = \"#828282\",\n Grey4 = \"#BDBDBD\",\n Grey5 = \"#E0E0E0\",\n Grey6 = \"#F2F2F2\",\n Grey7 = \"#F8F8F8\",\n Purple = \"#040436\",\n}\n"],"names":[],"mappings":"IAAY,
|
|
1
|
+
{"version":3,"file":"Colors.js","sources":["../src/Colors.ts"],"sourcesContent":["export enum Colors {\n White = \"#FFFFFF\",\n Black = \"#000000\",\n Black2= '#141414',\n Yellow = '#FFBA49',\n // Green = \"#419D78\",\n Green = '#42BB83',\n OffWhite = \"#FCFCFC\",\n LightBlue = \"#39159C\",\n Secondary= \"#1E1E1E\",\n Blue = \"#2D0E84\",\n DarkBlue = \"#1D0858\",\n Red = \"#E63946\",\n Orange = \"#FF700F\",\n FadedOrange = '#FFF1E7',\n LightOrange = \"#FFBE93\",\n DarkOrange = \"#D65600\",\n Grey1 = \"#333333\",\n Grey2 = \"#4F4F4F\",\n Grey3 = \"#828282\",\n Grey4 = \"#BDBDBD\",\n Grey5 = \"#E0E0E0\",\n Grey6 = \"#F2F2F2\",\n Grey7 = \"#F8F8F8\",\n Grey8 = '#424242',\n Purple = \"#040436\",\n\n SecondarySurface = \"#1E1E1E\",\n SecondaryStroke = \"#424242\",\n SurfaceTertiary = \"#141414\",\n HeadingSecondary = \"#FCFCFC\",\n SupportTertiary = \"#A3A3A3\",\n HeadingPrimary = \"#EF602E\",\n InteractiveBGSecondary = \"#292929\",\n InteractiveBGPrimary = \"#EA4513\",\n TagBGTertiary = \"#0C0C0C\",\n TextSupportSecondary = \"#D6D6D6\",\n ErrorRed='#F31B43'\n}\n"],"names":[],"mappings":"IAAY,OAsCX;AAtCD,CAAA,UAAY,MAAM,EAAA;AAChB,IAAA,MAAA,CAAA,OAAA,CAAA,GAAA,SAAiB,CAAA;AACjB,IAAA,MAAA,CAAA,OAAA,CAAA,GAAA,SAAiB,CAAA;AACjB,IAAA,MAAA,CAAA,QAAA,CAAA,GAAA,SAAiB,CAAA;AACjB,IAAA,MAAA,CAAA,QAAA,CAAA,GAAA,SAAkB,CAAA;;AAElB,IAAA,MAAA,CAAA,OAAA,CAAA,GAAA,SAAiB,CAAA;AACjB,IAAA,MAAA,CAAA,UAAA,CAAA,GAAA,SAAoB,CAAA;AACpB,IAAA,MAAA,CAAA,WAAA,CAAA,GAAA,SAAqB,CAAA;AACrB,IAAA,MAAA,CAAA,WAAA,CAAA,GAAA,SAAoB,CAAA;AACpB,IAAA,MAAA,CAAA,MAAA,CAAA,GAAA,SAAgB,CAAA;AAChB,IAAA,MAAA,CAAA,UAAA,CAAA,GAAA,SAAoB,CAAA;AACpB,IAAA,MAAA,CAAA,KAAA,CAAA,GAAA,SAAe,CAAA;AACf,IAAA,MAAA,CAAA,QAAA,CAAA,GAAA,SAAkB,CAAA;AAClB,IAAA,MAAA,CAAA,aAAA,CAAA,GAAA,SAAuB,CAAA;AACvB,IAAA,MAAA,CAAA,aAAA,CAAA,GAAA,SAAuB,CAAA;AACvB,IAAA,MAAA,CAAA,YAAA,CAAA,GAAA,SAAsB,CAAA;AACtB,IAAA,MAAA,CAAA,OAAA,CAAA,GAAA,SAAiB,CAAA;AACjB,IAAA,MAAA,CAAA,OAAA,CAAA,GAAA,S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label?:
|
|
20
|
+
label?: any;
|
|
21
21
|
tip?: string;
|
|
22
|
+
fontSize?: string;
|
|
23
|
+
fontWeight?: string;
|
|
24
|
+
fontFamily?: string;
|
|
25
|
+
darkThemeProps?: string;
|
|
26
|
+
labelColor?: string;
|
|
27
|
+
borderColor?: string;
|
|
22
28
|
};
|
|
23
|
-
export default function AddressSearchDropdown({ value, onChange, width, label, tip, }: AddressSearchDropdownProps): React.JSX.Element;
|
|
29
|
+
export default function AddressSearchDropdown({ value, onChange, width, label, tip, fontSize, fontWeight, fontFamily, darkThemeProps, labelColor, borderColor, }: AddressSearchDropdownProps): React.JSX.Element;
|
|
24
30
|
export {};
|
|
@@ -8,7 +8,7 @@ import { IconEnum } from './Icons.js';
|
|
|
8
8
|
var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: 100%;\n z-index: 100000;\n"], ["\n width: 100%;\n z-index: 100000;\n"])));
|
|
9
9
|
function AddressSearchDropdown(_a) {
|
|
10
10
|
var _this = this;
|
|
11
|
-
var value = _a.value, onChange = _a.onChange, width = _a.width, label = _a.label, tip = _a.tip;
|
|
11
|
+
var value = _a.value, onChange = _a.onChange, width = _a.width, label = _a.label, tip = _a.tip, fontSize = _a.fontSize, fontWeight = _a.fontWeight, fontFamily = _a.fontFamily, darkThemeProps = _a.darkThemeProps, labelColor = _a.labelColor, borderColor = _a.borderColor;
|
|
12
12
|
/* Hooks */
|
|
13
13
|
var _b = usePlacesAutocomplete({
|
|
14
14
|
requestOptions: {
|
|
@@ -36,7 +36,6 @@ function AddressSearchDropdown(_a) {
|
|
|
36
36
|
case 1:
|
|
37
37
|
result = (_a.sent())[0];
|
|
38
38
|
location_1 = result.geometry.location;
|
|
39
|
-
console.log(result);
|
|
40
39
|
addressObject_1 = {
|
|
41
40
|
address1: "",
|
|
42
41
|
address2: "",
|
|
@@ -75,7 +74,6 @@ function AddressSearchDropdown(_a) {
|
|
|
75
74
|
addressObject_1.zip = ac.short_name;
|
|
76
75
|
}
|
|
77
76
|
});
|
|
78
|
-
console.log(addressObject_1, "addressObject");
|
|
79
77
|
onChange(addressObject_1);
|
|
80
78
|
return [3 /*break*/, 3];
|
|
81
79
|
case 2:
|
|
@@ -103,7 +101,7 @@ function AddressSearchDropdown(_a) {
|
|
|
103
101
|
}); });
|
|
104
102
|
}
|
|
105
103
|
return (React.createElement(Container, null,
|
|
106
|
-
React.createElement(SearchDropdown, { type: SearchDropdownTypes.SingleSelect, icon: IconEnum.MapPinLight, onChange: selectAddress, value: innerValue, searchQuery: innerValue, setSearchQuery: setValue, placeholder: "Search for an address", items: items, width: width, label: label, tip: tip })));
|
|
104
|
+
React.createElement(SearchDropdown, { type: SearchDropdownTypes.SingleSelect, icon: IconEnum.MapPinLight, onChange: selectAddress, value: innerValue, searchQuery: innerValue, setSearchQuery: setValue, placeholder: "Search for an address", items: items, width: width, label: label, tip: tip, fontSize: fontSize, fontWeight: fontWeight, fontFamily: fontFamily, darkThemeProps: darkThemeProps, labelColor: labelColor, borderColor: borderColor })));
|
|
107
105
|
}
|
|
108
106
|
var templateObject_1;
|
|
109
107
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddressSearchDropdown.js","sources":["../../src/components/AddressSearchDropdown.tsx"],"sourcesContent":["import React from \"react\";\r\nimport usePlacesAutocomplete, { getGeocode } from \"use-places-autocomplete\";\r\nimport styled from \"styled-components\";\r\nimport SearchDropdown, { SearchDropdownTypes } from \"./SearchDropdown\";\r\nimport { IconEnum } from \"./Icons\";\r\n\r\ninterface IAddress {\r\n address1?: string;\r\n address2?: string;\r\n city?: string;\r\n state?: string;\r\n zip?: string;\r\n country?: string;\r\n phone?: string;\r\n lat?: number | null;\r\n lng?: number | null;\r\n placeId?: string;\r\n placeName?: string;\r\n timezone?: string;\r\n}\r\n\r\ninterface ISearchDropdownItem {\r\n text: string;\r\n value: any;\r\n}\r\n\r\nconst Container = styled.div`\r\n width: 100%;\r\n z-index: 100000;\r\n`;\r\n\r\nexport type AddressSearchDropdownProps = {\r\n value: IAddress;\r\n onChange: (address: IAddress) => void;\r\n width?: string;\r\n label?:
|
|
1
|
+
{"version":3,"file":"AddressSearchDropdown.js","sources":["../../src/components/AddressSearchDropdown.tsx"],"sourcesContent":["import React from \"react\";\r\nimport usePlacesAutocomplete, { getGeocode } from \"use-places-autocomplete\";\r\nimport styled from \"styled-components\";\r\nimport SearchDropdown, { SearchDropdownTypes } from \"./SearchDropdown\";\r\nimport { IconEnum } from \"./Icons\";\r\n\r\ninterface IAddress {\r\n address1?: string;\r\n address2?: string;\r\n city?: string;\r\n state?: string;\r\n zip?: string;\r\n country?: string;\r\n phone?: string;\r\n lat?: number | null;\r\n lng?: number | null;\r\n placeId?: string;\r\n placeName?: string;\r\n timezone?: string;\r\n}\r\n\r\ninterface ISearchDropdownItem {\r\n text: string;\r\n value: any;\r\n}\r\n\r\nconst Container = styled.div`\r\n width: 100%;\r\n z-index: 100000;\r\n`;\r\n\r\nexport type AddressSearchDropdownProps = {\r\n value: IAddress;\r\n onChange: (address: IAddress) => void;\r\n width?: string;\r\n label?:any;\r\n tip?: string;\r\n fontSize?:string;\r\n fontWeight?:string;\r\n fontFamily?:string;\r\n darkThemeProps?:string;\r\n labelColor?:string;\r\n borderColor?:string;\r\n}\r\n\r\nexport default function AddressSearchDropdown({\r\n value,\r\n onChange,\r\n width,\r\n label,\r\n tip,\r\n fontSize,\r\n fontWeight,\r\n fontFamily,\r\n darkThemeProps,\r\n labelColor,\r\n borderColor,\r\n}: AddressSearchDropdownProps) {\r\n /* Hooks */\r\n let {\r\n value: innerValue,\r\n suggestions: { data },\r\n setValue,\r\n } = usePlacesAutocomplete({\r\n requestOptions: {\r\n componentRestrictions: { country: \"us\" },\r\n },\r\n debounce: 300,\r\n });\r\n\r\n React.useEffect(() => {\r\n let placeName = value?.placeName ? value?.placeName : \"\";\r\n setValue(placeName);\r\n innerValue = placeName;\r\n }, []);\r\n\r\n const selectAddress = React.useCallback(\r\n (address) => {\r\n console.log(address, \"address\");\r\n\r\n setValue(address);\r\n const doEffect = async () => {\r\n try {\r\n const [result] = await getGeocode({\r\n address,\r\n });\r\n const {\r\n geometry: { location },\r\n } = result;\r\n\r\n const addressObject = {\r\n address1: \"\",\r\n address2: \"\",\r\n city: \"\",\r\n state: \"\",\r\n zip: \"\",\r\n country: \"\",\r\n lat: location.lat(),\r\n lng: location.lng(),\r\n placeId: result.place_id,\r\n placeName: address,\r\n };\r\n result.address_components.forEach((ac: any) => {\r\n if (ac.types.includes(\"street_number\")) {\r\n addressObject.address1 = ac.short_name;\r\n }\r\n if (ac.types.includes(\"route\")) {\r\n addressObject.address1 = `${addressObject.address1} ${ac.short_name}`;\r\n }\r\n if (ac.types.includes(\"subpremise\")) {\r\n addressObject.address2 = ac.short_name;\r\n }\r\n if (\r\n ac.types.includes(\"locality\") &&\r\n ac.types.includes(\"political\")\r\n ) {\r\n addressObject.city = ac.short_name;\r\n }\r\n if (\r\n ac.types.includes(\"administrative_area_level_1\") &&\r\n ac.types.includes(\"political\")\r\n ) {\r\n addressObject.state = ac.short_name;\r\n }\r\n if (\r\n ac.types.includes(\"country\") &&\r\n ac.types.includes(\"political\")\r\n ) {\r\n addressObject.country = ac.short_name;\r\n }\r\n if (ac.types.includes(\"postal_code\")) {\r\n addressObject.zip = ac.short_name;\r\n }\r\n });\r\n onChange(addressObject);\r\n } catch (e) {\r\n // HANDLE ERROR\r\n console.error(e);\r\n }\r\n };\r\n doEffect();\r\n },\r\n [onChange, setValue]\r\n );\r\n\r\n React.useEffect(() => {\r\n let intialAddress: IAddress = {};\r\n if (!innerValue) onChange(intialAddress);\r\n }, [innerValue]);\r\n\r\n /* Render */\r\n let items: ISearchDropdownItem[] = [];\r\n\r\n if (data.length) {\r\n items = data.map(\r\n (suggestion): ISearchDropdownItem => ({\r\n text: suggestion.description,\r\n value: suggestion.description,\r\n })\r\n );\r\n }\r\n\r\n return (\r\n <Container>\r\n <SearchDropdown\r\n type={SearchDropdownTypes.SingleSelect}\r\n icon={IconEnum.MapPinLight}\r\n onChange={selectAddress}\r\n value={innerValue}\r\n searchQuery={innerValue}\r\n setSearchQuery={setValue}\r\n placeholder=\"Search for an address\"\r\n items={items}\r\n width={width}\r\n label={label}\r\n tip={tip}\r\n fontSize={fontSize}\r\n fontWeight={fontWeight}\r\n fontFamily={fontFamily}\r\n darkThemeProps={darkThemeProps}\r\n labelColor={labelColor}\r\n borderColor={borderColor}\r\n />\r\n </Container>\r\n );\r\n}\r\n"],"names":[],"mappings":";;;;;;;AA0BA,IAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAA,gBAAA,KAAA,gBAAA,GAAA,oBAAA,CAAA,CAAA,wCAAA,CAAA,EAAA,CAAA,wCAG3B,IAAA,CAAC;AAgBsB,SAAA,qBAAqB,CAAC,EAYjB,EAAA;IAZ7B,IA4IC,KAAA,GAAA,IAAA,CAAA;AA3IC,IAAA,IAAA,KAAK,GAAA,EAAA,CAAA,KAAA,EACL,QAAQ,GAAA,EAAA,CAAA,QAAA,EACR,KAAK,GAAA,EAAA,CAAA,KAAA,EACL,KAAK,GAAA,EAAA,CAAA,KAAA,EACL,GAAG,SAAA,EACH,QAAQ,GAAA,EAAA,CAAA,QAAA,EACR,UAAU,GAAA,EAAA,CAAA,UAAA,EACV,UAAU,GAAA,EAAA,CAAA,UAAA,EACV,cAAc,GAAA,EAAA,CAAA,cAAA,EACd,UAAU,GAAA,EAAA,CAAA,UAAA,EACV,WAAW,GAAA,EAAA,CAAA,WAAA,CAAA;;IAGP,IAAA,EAAA,GAIA,qBAAqB,CAAC;AACxB,QAAA,cAAc,EAAE;AACd,YAAA,qBAAqB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;AACzC,SAAA;AACD,QAAA,QAAQ,EAAE,GAAG;KACd,CAAC,EARO,UAAU,GAAA,EAAA,CAAA,KAAA,EACF,IAAI,GAAA,EAAA,CAAA,WAAA,CAAA,IAAA,EACnB,QAAQ,GAAA,EAAA,CAAA,QAMR,CAAC;I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ACtB,UAAU,EAAE,UAAU,EACtB,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,CAAA,CACQ,EACZ;AACJ,CAAC;;;;;"}
|
|
@@ -3,7 +3,9 @@ import { Colors } from "../Colors";
|
|
|
3
3
|
export declare enum ButtonTypes {
|
|
4
4
|
Next = "Next",
|
|
5
5
|
Regular = "Regular",
|
|
6
|
-
Thin = "Thin"
|
|
6
|
+
Thin = "Thin",
|
|
7
|
+
Normal = "Normal",
|
|
8
|
+
CustomInputHeight = "CustomInputHeight"
|
|
7
9
|
}
|
|
8
10
|
export declare enum ButtonStates {
|
|
9
11
|
Active = "Active",
|
|
@@ -29,5 +31,20 @@ export declare type ButtonProps = {
|
|
|
29
31
|
label?: string;
|
|
30
32
|
tip?: string;
|
|
31
33
|
subLabel?: string;
|
|
34
|
+
marginBottam?: string;
|
|
35
|
+
paddingAround?: string;
|
|
36
|
+
contentAlign?: string;
|
|
37
|
+
textTransform?: string;
|
|
38
|
+
fontSize?: string;
|
|
39
|
+
fontWeight?: string;
|
|
40
|
+
fontFamily?: string;
|
|
41
|
+
letterSpacing?: string;
|
|
42
|
+
disabledbuttonTheme?: boolean;
|
|
43
|
+
CustomInputHeight?: string;
|
|
44
|
+
lineHeight?: string;
|
|
45
|
+
svgIconName?: string;
|
|
46
|
+
svgWidth?: string;
|
|
47
|
+
svgHeight?: string;
|
|
48
|
+
marginOnButtonText?: boolean;
|
|
32
49
|
};
|
|
33
|
-
export default function Button({ type, state, bgColor, textColor, text, onClick, icon, iconPosition, iconSize, margin, loading, }: ButtonProps): React.JSX.Element;
|
|
50
|
+
export default function Button({ type, state, bgColor, textColor, text, onClick, icon, iconPosition, iconSize, margin, marginBottam, loading, paddingAround, contentAlign, textTransform, fontSize, fontWeight, fontFamily, letterSpacing, disabledbuttonTheme, CustomInputHeight, lineHeight, svgIconName, svgHeight, svgWidth, marginOnButtonText }: ButtonProps): React.JSX.Element;
|
|
@@ -5,12 +5,15 @@ import * as Polished from 'polished';
|
|
|
5
5
|
import { Colors } from '../Colors.js';
|
|
6
6
|
import Icon from './Icon.js';
|
|
7
7
|
import Loader, { LoaderSizes } from './Loader.js';
|
|
8
|
+
import SvgRenderer from './SvgRendrer.js';
|
|
8
9
|
|
|
9
10
|
var ButtonTypes;
|
|
10
11
|
(function (ButtonTypes) {
|
|
11
12
|
ButtonTypes["Next"] = "Next";
|
|
12
13
|
ButtonTypes["Regular"] = "Regular";
|
|
13
14
|
ButtonTypes["Thin"] = "Thin";
|
|
15
|
+
ButtonTypes["Normal"] = "Normal";
|
|
16
|
+
ButtonTypes["CustomInputHeight"] = "CustomInputHeight";
|
|
14
17
|
})(ButtonTypes || (ButtonTypes = {}));
|
|
15
18
|
var ButtonStates;
|
|
16
19
|
(function (ButtonStates) {
|
|
@@ -23,9 +26,10 @@ var ButtonIconPosition;
|
|
|
23
26
|
ButtonIconPosition["Left"] = "Left";
|
|
24
27
|
ButtonIconPosition["Right"] = "Right";
|
|
25
28
|
})(ButtonIconPosition || (ButtonIconPosition = {}));
|
|
26
|
-
var StyledButton = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n height: ", ";\n width: ", ";\n display: flex;\n flex-direction: row;\n align-items: center;\n overflow: hidden;\n justify-content:
|
|
29
|
+
var StyledButton = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n height: ", ";\n width: ", ";\n margin-bottom: ", ";\n display: flex;\n flex-direction: row;\n align-items: center;\n overflow: hidden;\n justify-content: ", ";\n white-space: nowrap;\n box-sizing: border-box;\n text-align: center;\n border-radius: 10px;\n transition: all 0.2s;\n margin: ", ";\n padding: ", ";\n background-color: ", ";\n border: ", ";\n\n &:hover {\n cursor: ", ";\n background-color: ", ";\n }\n\n &:active {\n cursor: ", ";\n background-color: ", ";\n }\n"], ["\n position: relative;\n height: ",
|
|
27
30
|
";\n width: ",
|
|
28
|
-
";\n
|
|
31
|
+
";\n margin-bottom: ",
|
|
32
|
+
";\n display: flex;\n flex-direction: row;\n align-items: center;\n overflow: hidden;\n justify-content: ", ";\n white-space: nowrap;\n box-sizing: border-box;\n text-align: center;\n border-radius: 10px;\n transition: all 0.2s;\n margin: ", ";\n padding: ",
|
|
29
33
|
";\n background-color: ",
|
|
30
34
|
";\n border: ",
|
|
31
35
|
";\n\n &:hover {\n cursor: ",
|
|
@@ -33,12 +37,21 @@ var StyledButton = styled.div(templateObject_1 || (templateObject_1 = __makeTemp
|
|
|
33
37
|
";\n }\n\n &:active {\n cursor: ",
|
|
34
38
|
";\n background-color: ",
|
|
35
39
|
";\n }\n"])), function (props) {
|
|
40
|
+
if (props.CustomInputHeight) {
|
|
41
|
+
return "55px";
|
|
42
|
+
}
|
|
36
43
|
if (props.type === ButtonTypes.Next) {
|
|
37
44
|
return "48px";
|
|
38
45
|
}
|
|
46
|
+
if (props.type === ButtonTypes.CustomInputHeight) {
|
|
47
|
+
return "55px";
|
|
48
|
+
}
|
|
39
49
|
if (props.type === ButtonTypes.Regular) {
|
|
40
50
|
return "40px";
|
|
41
51
|
}
|
|
52
|
+
if (props.type === ButtonTypes.Normal) {
|
|
53
|
+
return "50px";
|
|
54
|
+
}
|
|
42
55
|
if (props.type === ButtonTypes.Thin) {
|
|
43
56
|
if (props.state === ButtonStates.Warning) {
|
|
44
57
|
return "30px";
|
|
@@ -56,8 +69,16 @@ var StyledButton = styled.div(templateObject_1 || (templateObject_1 = __makeTemp
|
|
|
56
69
|
if (props.type === ButtonTypes.Thin) {
|
|
57
70
|
return "fit-content";
|
|
58
71
|
}
|
|
72
|
+
if (props.type === ButtonTypes.Normal) {
|
|
73
|
+
return "50px";
|
|
74
|
+
}
|
|
59
75
|
return null;
|
|
60
|
-
}, function (props) {
|
|
76
|
+
}, function (props) {
|
|
77
|
+
return props.marginBottam ? props.marginBottam + " !important" : "0px !important";
|
|
78
|
+
}, function (props) { return props.contentAlign || "center"; }, function (props) { return (Boolean(props.margin) ? props.margin : "0px"); }, function (props) {
|
|
79
|
+
if (props.type === ButtonTypes.Next && props.paddingAround) {
|
|
80
|
+
return props.paddingAround;
|
|
81
|
+
}
|
|
61
82
|
if (props.type === ButtonTypes.Next) {
|
|
62
83
|
return "0px";
|
|
63
84
|
}
|
|
@@ -67,8 +88,14 @@ var StyledButton = styled.div(templateObject_1 || (templateObject_1 = __makeTemp
|
|
|
67
88
|
if (props.type === ButtonTypes.Thin) {
|
|
68
89
|
return "0 15px";
|
|
69
90
|
}
|
|
91
|
+
if (props.type === ButtonTypes.Normal) {
|
|
92
|
+
return "0 25px";
|
|
93
|
+
}
|
|
70
94
|
return null;
|
|
71
95
|
}, function (props) {
|
|
96
|
+
if (props.state === ButtonStates.Disabled && props.disabledbuttonTheme) {
|
|
97
|
+
return Colors.InteractiveBGSecondary;
|
|
98
|
+
}
|
|
72
99
|
if (props.state === ButtonStates.Disabled) {
|
|
73
100
|
return Colors.Grey6;
|
|
74
101
|
}
|
|
@@ -87,6 +114,9 @@ var StyledButton = styled.div(templateObject_1 || (templateObject_1 = __makeTemp
|
|
|
87
114
|
}
|
|
88
115
|
return props.onClick ? "pointer" : null;
|
|
89
116
|
}, function (props) {
|
|
117
|
+
if (props.state === ButtonStates.Disabled && props.disabledbuttonTheme) {
|
|
118
|
+
return Colors.Grey1;
|
|
119
|
+
}
|
|
90
120
|
if (props.state === ButtonStates.Disabled) {
|
|
91
121
|
return Colors.Grey6;
|
|
92
122
|
}
|
|
@@ -108,12 +138,18 @@ var StyledButton = styled.div(templateObject_1 || (templateObject_1 = __makeTemp
|
|
|
108
138
|
}
|
|
109
139
|
return Polished.darken(0.025, props.bgColor || Colors.Orange);
|
|
110
140
|
});
|
|
111
|
-
var Text = styled.span(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: relative;\n font-size: ", ";\n font-weight: ", ";\n text-transform:
|
|
141
|
+
var Text = styled.span(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: relative;\n line-height:", ";\n font-family: ", ";\n letter-spacing: ", ";\n font-size: ", ";\n font-weight: ", ";\n text-transform: ", ";\n margin: ", ";\n color: ", ";\n top: ", ";\n"], ["\n position: relative;\n line-height:", ";\n font-family: ", ";\n letter-spacing: ", ";\n font-size: ",
|
|
112
142
|
";\n font-weight: ",
|
|
113
|
-
";\n text-transform:
|
|
143
|
+
";\n text-transform: ", ";\n margin: ",
|
|
114
144
|
";\n color: ",
|
|
115
145
|
";\n top: ",
|
|
116
|
-
";\n"])), function (props) {
|
|
146
|
+
";\n"])), function (props) { return props.lineHeight; }, function (props) { return props.fontFamily; }, function (props) { return props.letterSpacing; }, function (props) {
|
|
147
|
+
if (props.type === ButtonTypes.Next && props.fontSize) {
|
|
148
|
+
return props.fontSize;
|
|
149
|
+
}
|
|
150
|
+
if (props.type === ButtonTypes.Regular && props.fontSize) {
|
|
151
|
+
return props.fontSize;
|
|
152
|
+
}
|
|
117
153
|
if (props.type === ButtonTypes.Next) {
|
|
118
154
|
return "1.4rem";
|
|
119
155
|
}
|
|
@@ -126,8 +162,17 @@ var Text = styled.span(templateObject_2 || (templateObject_2 = __makeTemplateObj
|
|
|
126
162
|
if (props.type === ButtonTypes.Thin) {
|
|
127
163
|
return "1.2rem";
|
|
128
164
|
}
|
|
165
|
+
if (props.type === ButtonTypes.Normal) {
|
|
166
|
+
return "2.5rem";
|
|
167
|
+
}
|
|
129
168
|
return null;
|
|
130
169
|
}, function (props) {
|
|
170
|
+
if (props.type === ButtonTypes.Next && props.fontWeight) {
|
|
171
|
+
return props.fontWeight;
|
|
172
|
+
}
|
|
173
|
+
if (props.type === ButtonTypes.Regular && props.fontWeight) {
|
|
174
|
+
return props.fontWeight;
|
|
175
|
+
}
|
|
131
176
|
if (props.type === ButtonTypes.Next) {
|
|
132
177
|
return "600";
|
|
133
178
|
// return "700";
|
|
@@ -139,8 +184,14 @@ var Text = styled.span(templateObject_2 || (templateObject_2 = __makeTemplateObj
|
|
|
139
184
|
if (props.type === ButtonTypes.Thin) {
|
|
140
185
|
return "600";
|
|
141
186
|
}
|
|
187
|
+
if (props.type === ButtonTypes.Normal) {
|
|
188
|
+
return "500";
|
|
189
|
+
}
|
|
142
190
|
return null;
|
|
143
|
-
}, function (props) {
|
|
191
|
+
}, function (props) { return props.textTransform || "uppercase"; }, function (props) {
|
|
192
|
+
if (props.type === ButtonTypes.Next && props.marginOnButtonText) {
|
|
193
|
+
return "0 10px 0 0";
|
|
194
|
+
}
|
|
144
195
|
if (props.type === ButtonTypes.Next) {
|
|
145
196
|
return "0 10px";
|
|
146
197
|
}
|
|
@@ -153,6 +204,15 @@ var Text = styled.span(templateObject_2 || (templateObject_2 = __makeTemplateObj
|
|
|
153
204
|
}
|
|
154
205
|
return "0";
|
|
155
206
|
}
|
|
207
|
+
if (props.type === ButtonTypes.Normal) {
|
|
208
|
+
if (props.iconPosition === ButtonIconPosition.Left) {
|
|
209
|
+
return "0 0 0 10px";
|
|
210
|
+
}
|
|
211
|
+
if (props.iconPosition === ButtonIconPosition.Right) {
|
|
212
|
+
return "0 10px 0 0";
|
|
213
|
+
}
|
|
214
|
+
return "0";
|
|
215
|
+
}
|
|
156
216
|
if (props.type === ButtonTypes.Thin) {
|
|
157
217
|
if (props.iconPosition === ButtonIconPosition.Left) {
|
|
158
218
|
return "0 0 0 7px";
|
|
@@ -164,6 +224,9 @@ var Text = styled.span(templateObject_2 || (templateObject_2 = __makeTemplateObj
|
|
|
164
224
|
}
|
|
165
225
|
return null;
|
|
166
226
|
}, function (props) {
|
|
227
|
+
if (props.state === ButtonStates.Disabled && props.disabledbuttonTheme) {
|
|
228
|
+
return Colors.Grey3;
|
|
229
|
+
}
|
|
167
230
|
if (props.state)
|
|
168
231
|
if (props.state === ButtonStates.Disabled) {
|
|
169
232
|
return Colors.Grey5;
|
|
@@ -186,14 +249,14 @@ function Button(_a) {
|
|
|
186
249
|
// label,
|
|
187
250
|
// tip,
|
|
188
251
|
// subLabel,
|
|
189
|
-
margin = _a.margin, _f = _a.loading, loading = _f === void 0 ? false : _f;
|
|
252
|
+
margin = _a.margin, marginBottam = _a.marginBottam, _f = _a.loading, loading = _f === void 0 ? false : _f, paddingAround = _a.paddingAround, contentAlign = _a.contentAlign, textTransform = _a.textTransform, fontSize = _a.fontSize, fontWeight = _a.fontWeight, fontFamily = _a.fontFamily, letterSpacing = _a.letterSpacing, disabledbuttonTheme = _a.disabledbuttonTheme, CustomInputHeight = _a.CustomInputHeight, lineHeight = _a.lineHeight, svgIconName = _a.svgIconName, svgHeight = _a.svgHeight, svgWidth = _a.svgWidth, marginOnButtonText = _a.marginOnButtonText;
|
|
190
253
|
var iconColor = state === ButtonStates.Disabled ? Colors.Grey3 : Colors.White;
|
|
191
254
|
if (icon && !iconPosition)
|
|
192
255
|
iconPosition = ButtonIconPosition.Left;
|
|
193
256
|
var iconEl = (React.createElement(Icon, { icon: icon, color: iconColor, size: iconSize, top: iconSize < 14 ? "-1px" : undefined }));
|
|
194
257
|
var click = loading || state === ButtonStates.Disabled ? null : function () { return onClick(); };
|
|
195
258
|
return (React.createElement(React.Fragment, null,
|
|
196
|
-
React.createElement(StyledButton, { type: type, state: state, onClick: click, margin: margin, bgColor: bgColor }, (function () {
|
|
259
|
+
React.createElement(StyledButton, { type: type, state: state, onClick: click, margin: margin, bgColor: bgColor, marginBottam: marginBottam, paddingAround: paddingAround, contentAlign: contentAlign, disabledbuttonTheme: disabledbuttonTheme, CustomInputHeight: CustomInputHeight }, (function () {
|
|
197
260
|
return (React.createElement(Fragment, null, (function () {
|
|
198
261
|
if (loading) {
|
|
199
262
|
return (React.createElement(Fragment, null,
|
|
@@ -201,10 +264,12 @@ function Button(_a) {
|
|
|
201
264
|
}
|
|
202
265
|
return (React.createElement(Fragment, null,
|
|
203
266
|
icon && iconPosition === ButtonIconPosition.Left && iconEl,
|
|
204
|
-
text && (React.createElement(Text, { type: type, state: state, icon: Boolean(icon), iconPosition: iconPosition, textColor: textColor }, text)),
|
|
267
|
+
text && (React.createElement(Text, { type: type, state: state, icon: Boolean(icon), iconPosition: iconPosition, textColor: textColor, textTransform: textTransform, fontSize: fontSize, fontWeight: fontWeight, fontFamily: fontFamily, letterSpacing: letterSpacing, disabledbuttonTheme: disabledbuttonTheme, lineHeight: lineHeight, marginOnButtonText: marginOnButtonText }, text)),
|
|
205
268
|
icon &&
|
|
206
269
|
iconPosition === ButtonIconPosition.Right &&
|
|
207
|
-
iconEl
|
|
270
|
+
iconEl,
|
|
271
|
+
svgIconName &&
|
|
272
|
+
React.createElement(SvgRenderer, { iconName: svgIconName, width: svgWidth, height: svgHeight, style: { margin: '2px 0px' } })));
|
|
208
273
|
})()));
|
|
209
274
|
})())));
|
|
210
275
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["../../src/components/Button.tsx"],"sourcesContent":["import React, { Fragment } from \"react\";\nimport styled from \"styled-components\";\nimport * as Polished from \"polished\";\n// import Label from \"../../../../backstage/src/elements/Label\";\nimport { Colors } from \"../Colors\";\nimport Icon from \"./Icon\";\nimport Loader, { LoaderSizes } from \"./Loader\";\n\nexport enum ButtonTypes {\n Next = \"Next\",\n Regular = \"Regular\",\n Thin = \"Thin\",\n}\n\nexport enum ButtonStates {\n Active = \"Active\",\n Warning = \"Warning\",\n Disabled = \"Disabled\",\n}\n\nexport enum ButtonIconPosition {\n Left = \"Left\",\n Right = \"Right\",\n}\n\ntype StyledButtonProps = {\n type: string;\n state: string;\n bgColor?: Colors;\n onClick?: any;\n margin?: string;\n};\n\nconst StyledButton = styled.div<StyledButtonProps>`\n position: relative;\n height: ${(props) => {\n if (props.type === ButtonTypes.Next) {\n return \"48px\";\n }\n\n if (props.type === ButtonTypes.Regular) {\n return \"40px\";\n }\n\n if (props.type === ButtonTypes.Thin) {\n if (props.state === ButtonStates.Warning) {\n return \"30px\";\n }\n\n return \"30px\";\n }\n\n return null;\n }};\n width: ${(props) => {\n if (props.type === ButtonTypes.Next) {\n return \"100%\";\n }\n\n if (props.type === ButtonTypes.Regular) {\n return \"fit-content\";\n }\n\n if (props.type === ButtonTypes.Thin) {\n return \"fit-content\";\n }\n\n return null;\n }};\n display: flex;\n flex-direction: row;\n align-items: center;\n overflow: hidden;\n justify-content: center;\n white-space: nowrap;\n box-sizing: border-box;\n text-align: center;\n border-radius: 10px;\n transition: all 0.2s;\n margin: ${(props) => (Boolean(props.margin) ? props.margin : \"0px\")};\n padding: ${(props) => {\n if (props.type === ButtonTypes.Next) {\n return \"0px\";\n }\n\n if (props.type === ButtonTypes.Regular) {\n return \"0 25px\";\n }\n\n if (props.type === ButtonTypes.Thin) {\n return \"0 15px\";\n }\n\n return null;\n }};\n background-color: ${(props) => {\n if (props.state === ButtonStates.Disabled) {\n return Colors.Grey6;\n }\n\n if (props.state === ButtonStates.Warning) {\n return Colors.White;\n }\n\n return props.bgColor || Colors.Orange;\n }};\n border: ${(props) => {\n if (props.state === ButtonStates.Warning) {\n return `1px solid ${Colors.Grey5}`;\n }\n\n return null;\n }};\n\n &:hover {\n cursor: ${(props) => {\n if (props.state === ButtonStates.Disabled) {\n return null;\n }\n\n return props.onClick ? \"pointer\" : null;\n }};\n background-color: ${(props) => {\n if (props.state === ButtonStates.Disabled) {\n return Colors.Grey6;\n }\n\n if (props.state === ButtonStates.Warning) {\n return Colors.White;\n }\n\n return Polished.lighten(0.025, props.bgColor || Colors.Orange);\n }};\n }\n\n &:active {\n cursor: ${(props) => {\n if (props.state === ButtonStates.Disabled) {\n return null;\n }\n\n return props.onClick ? \"pointer\" : null;\n }};\n background-color: ${(props) => {\n if (props.state === ButtonStates.Disabled) {\n return Colors.Grey6;\n }\n\n if (props.state === ButtonStates.Warning) {\n return Colors.White;\n }\n\n return Polished.darken(0.025, props.bgColor || Colors.Orange);\n }};\n }\n`;\n\ntype TextProps = {\n type: string;\n state: string;\n icon: boolean;\n iconPosition?: ButtonIconPosition;\n textColor?: Colors;\n};\n\nconst Text = styled.span<TextProps>`\n position: relative;\n font-size: ${(props) => {\n if (props.type === ButtonTypes.Next) {\n return \"1.4rem\";\n }\n\n if (props.type === ButtonTypes.Regular) {\n return \"1.4rem\";\n }\n\n if (props.type === ButtonTypes.Regular) {\n return \"1.2rem\";\n }\n\n if (props.type === ButtonTypes.Thin) {\n return \"1.2rem\";\n }\n\n return null;\n }};\n font-weight: ${(props) => {\n if (props.type === ButtonTypes.Next) {\n return \"600\";\n // return \"700\";\n }\n\n if (props.type === ButtonTypes.Regular) {\n return \"600\";\n // return \"700\";\n }\n\n if (props.type === ButtonTypes.Thin) {\n return \"600\";\n }\n\n return null;\n }};\n text-transform: uppercase;\n margin: ${(props) => {\n if (props.type === ButtonTypes.Next) {\n return \"0 10px\";\n }\n\n if (props.type === ButtonTypes.Regular) {\n if (props.iconPosition === ButtonIconPosition.Left) {\n return \"0 0 0 10px\";\n }\n\n if (props.iconPosition === ButtonIconPosition.Right) {\n return \"0 10px 0 0\";\n }\n\n return \"0\";\n }\n\n if (props.type === ButtonTypes.Thin) {\n if (props.iconPosition === ButtonIconPosition.Left) {\n return \"0 0 0 7px\";\n }\n\n if (props.iconPosition === ButtonIconPosition.Right) {\n return \"0 7px 0 0\";\n }\n\n return \"0\";\n }\n\n return null;\n }};\n color: ${(props: any) => {\n if (props.state)\n if (props.state === ButtonStates.Disabled) {\n return Colors.Grey5;\n }\n\n if (props.state === ButtonStates.Warning) {\n return Colors.Grey3;\n }\n\n return props.textColor || Colors.White;\n }};\n top: ${(props) => {\n if (props.type === ButtonTypes.Thin) {\n if (props.icon) {\n return \"-1px\";\n }\n\n return \"0\";\n }\n\n return null;\n }};\n`;\n\nexport type ButtonProps = {\n type?: ButtonTypes;\n state?: ButtonStates;\n bgColor?: Colors;\n textColor?: Colors;\n text?: string;\n onClick?: any;\n icon?: any;\n iconPosition?: ButtonIconPosition;\n iconSize?: number;\n margin?: string;\n loading?: boolean;\n label?: string;\n tip?: string;\n subLabel?: string;\n};\n\nexport default function Button({\n type = ButtonTypes.Next,\n state = ButtonStates.Active,\n bgColor,\n textColor,\n text,\n onClick = () => {},\n icon,\n iconPosition,\n iconSize = 14,\n // label,\n // tip,\n // subLabel,\n margin,\n loading = false,\n}: ButtonProps) {\n const iconColor: Colors =\n state === ButtonStates.Disabled ? Colors.Grey3 : Colors.White;\n\n if (icon && !iconPosition) iconPosition = ButtonIconPosition.Left;\n\n const iconEl = (\n <Icon\n icon={icon}\n color={iconColor}\n size={iconSize}\n top={iconSize < 14 ? \"-1px\" : undefined}\n />\n );\n\n const click =\n loading || state === ButtonStates.Disabled ? null : () => onClick();\n\n return (\n <>\n {/* {label && <Label text={label} subText={subLabel} tip={tip} />} */}\n <StyledButton\n type={type}\n state={state}\n onClick={click}\n margin={margin}\n bgColor={bgColor}\n >\n {(() => {\n return (\n <Fragment>\n {(() => {\n if (loading) {\n return (\n <Fragment>\n <Loader size={LoaderSizes.VerySmall} color={iconColor} />\n {/* <Text \n type={type} \n state={state} \n icon={true}\n >\n Loading...\n </Text> */}\n </Fragment>\n );\n }\n\n return (\n <Fragment>\n {icon && iconPosition === ButtonIconPosition.Left && iconEl}\n {text && (\n <Text\n type={type}\n state={state}\n icon={Boolean(icon)}\n iconPosition={iconPosition}\n textColor={textColor}\n >\n {text}\n </Text>\n )}\n {icon &&\n iconPosition === ButtonIconPosition.Right &&\n iconEl}\n </Fragment>\n );\n })()}\n </Fragment>\n );\n })()}\n </StyledButton>\n </>\n );\n}\n"],"names":[],"mappings":";;;;;;;;IAQY,YAIX;AAJD,CAAA,UAAY,WAAW,EAAA;AACrB,IAAA,WAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,WAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnB,IAAA,WAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACf,CAAC,EAJW,WAAW,KAAX,WAAW,GAItB,EAAA,CAAA,CAAA,CAAA;IAEW,aAIX;AAJD,CAAA,UAAY,YAAY,EAAA;AACtB,IAAA,YAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AAC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I,KAAK,KAAK,YAAY,CAAC,QAAQ,GAAG,IAAI,GAAG,YAAA,EAAM,OAAA,OAAO,EAAE,CAAT,EAAS,CAAC;AAEtE,IAAA,QACE,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA;QAEE,KAAC,CAAA,aAAA,CAAA,YAAY,IACX,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,KAAK,EACd,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAAA,EAEf,CAAC,YAAA;AACA,YAAA,QACE,KAAA,CAAA,aAAA,CAAC,QAAQ,EAAA,IAAA,EACN,CAAC,YAAA;AACA,gBAAA,IAAI,OAAO,EAAE;oBACX,QACE,oBAAC,QAAQ,EAAA,IAAA;AACP,wBAAA,KAAA,CAAA,aAAA,CAAC,MAAM,EAAA,EAAC,IAAI,EAAE,WAAW,CAAC,SAAS,EAAE,KAAK,EAAE,SAAS,EAAI,CAAA,CAQhD,EACX;AACH,iBAAA;gBAED,QACE,oBAAC,QAAQ,EAAA,IAAA;AACN,oBAAA,IAAI,IAAI,YAAY,KAAK,kBAAkB,CAAC,IAAI,IAAI,MAAM;AAC1D,oBAAA,IAAI,KACH,KAAC,CAAA,aAAA,CAAA,IAAI,EACH,EAAA,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,EACnB,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,EAEnB,EAAA,IAAI,CACA,CACR;oBACA,IAAI;wBACH,YAAY,KAAK,kBAAkB,CAAC,KAAK;wBACzC,MAAM,CACC,EACX;AACJ,aAAC,GAAG,CACK,EACX;AACJ,SAAC,GAAG,CACS,CACd,EACH;AACJ,CAAC;;;;;"}
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../../src/components/Button.tsx"],"sourcesContent":["import React, { Fragment } from \"react\";\nimport styled from \"styled-components\";\nimport * as Polished from \"polished\";\n// import Label from \"../../../../backstage/src/elements/Label\";\nimport { Colors } from \"../Colors\";\nimport Icon from \"./Icon\";\nimport Loader, { LoaderSizes } from \"./Loader\";\nimport SvgRenderer from \"./SvgRendrer\";\n\nexport enum ButtonTypes {\n Next = \"Next\",\n Regular = \"Regular\",\n Thin = \"Thin\",\n Normal = \"Normal\",\n CustomInputHeight=\"CustomInputHeight\"\n}\n\nexport enum ButtonStates {\n Active = \"Active\",\n Warning = \"Warning\",\n Disabled = \"Disabled\",\n}\n\nexport enum ButtonIconPosition {\n Left = \"Left\",\n Right = \"Right\",\n}\n\ntype StyledButtonProps = {\n type: string;\n state: string;\n bgColor?: Colors;\n onClick?: any;\n margin?: string;\n marginBottam?: string;\n paddingAround?: string;\n contentAlign?: string;\n disabledbuttonTheme?:Boolean;\n CustomInputHeight?:string;\n};\n\nconst StyledButton = styled.div<StyledButtonProps>`\n position: relative;\n height: ${(props) => {\n if (props.CustomInputHeight) {\n return \"55px\";\n }\n if (props.type === ButtonTypes.Next) {\n return \"48px\";\n }\n if (props.type === ButtonTypes.CustomInputHeight) {\n return \"55px\";\n }\n if (props.type === ButtonTypes.Regular) {\n return \"40px\";\n }\n\n if (props.type === ButtonTypes.Normal) {\n return \"50px\";\n }\n\n if (props.type === ButtonTypes.Thin) {\n if (props.state === ButtonStates.Warning) {\n return \"30px\";\n }\n return \"30px\";\n }\n\n return null;\n }};\n width: ${(props) => {\n if (props.type === ButtonTypes.Next) {\n return \"100%\";\n }\n\n if (props.type === ButtonTypes.Regular) {\n return \"fit-content\";\n }\n\n if (props.type === ButtonTypes.Thin) {\n return \"fit-content\";\n }\n\n if (props.type === ButtonTypes.Normal) {\n return \"50px\";\n }\n return null;\n }};\n margin-bottom: ${(props) =>\n props.marginBottam ? `${props.marginBottam} !important` : \"0px !important\"};\n display: flex;\n flex-direction: row;\n align-items: center;\n overflow: hidden;\n justify-content: ${(props) => props.contentAlign || \"center\"};\n white-space: nowrap;\n box-sizing: border-box;\n text-align: center;\n border-radius: 10px;\n transition: all 0.2s;\n margin: ${(props) => (Boolean(props.margin) ? props.margin : \"0px\")};\n padding: ${(props) => {\n if (props.type === ButtonTypes.Next && props.paddingAround) {\n return props.paddingAround;\n }\n if (props.type === ButtonTypes.Next) {\n return \"0px\";\n }\n if (props.type === ButtonTypes.Regular) {\n return \"0 25px\";\n }\n\n if (props.type === ButtonTypes.Thin) {\n return \"0 15px\";\n }\n\n if (props.type === ButtonTypes.Normal) {\n return \"0 25px\";\n }\n\n return null;\n }};\n background-color: ${(props) => {\n if (props.state === ButtonStates.Disabled && props.disabledbuttonTheme) {\n return Colors.InteractiveBGSecondary;\n }\n if (props.state === ButtonStates.Disabled) {\n return Colors.Grey6;\n }\n\n if (props.state === ButtonStates.Warning) {\n return Colors.White;\n }\n\n return props.bgColor || Colors.Orange;\n }};\n border: ${(props) => {\n if (props.state === ButtonStates.Warning) {\n return `1px solid ${Colors.Grey5}`;\n }\n\n return null;\n }};\n\n &:hover {\n cursor: ${(props) => {\n if (props.state === ButtonStates.Disabled) {\n return null;\n }\n\n return props.onClick ? \"pointer\" : null;\n }};\n background-color: ${(props) => {\n if (props.state === ButtonStates.Disabled && props.disabledbuttonTheme) {\n return Colors.Grey1;\n }\n if (props.state === ButtonStates.Disabled) {\n return Colors.Grey6;\n }\n\n if (props.state === ButtonStates.Warning) {\n return Colors.White;\n }\n\n return Polished.lighten(0.025, props.bgColor || Colors.Orange);\n }};\n }\n\n &:active {\n cursor: ${(props) => {\n if (props.state === ButtonStates.Disabled) {\n return null;\n }\n\n return props.onClick ? \"pointer\" : null;\n }};\n background-color: ${(props) => {\n if (props.state === ButtonStates.Disabled) {\n return Colors.Grey6;\n }\n\n if (props.state === ButtonStates.Warning) {\n return Colors.White;\n }\n\n return Polished.darken(0.025, props.bgColor || Colors.Orange);\n }};\n }\n`;\n\ntype TextProps = {\n type: string;\n state: string;\n icon: boolean;\n iconPosition?: ButtonIconPosition;\n textColor?: Colors;\n textTransform?: string;\n fontSize?: string;\n fontWeight?: string;\n fontFamily?: string;\n letterSpacing?: string;\n disabledbuttonTheme?: boolean;\n lineHeight?:string;\n marginOnButtonText?:boolean\n};\n\nconst Text = styled.span<TextProps>`\n position: relative;\n line-height:${(props) => props.lineHeight};\n font-family: ${(props) => props.fontFamily};\n letter-spacing: ${(props) => props.letterSpacing};\n font-size: ${(props) => {\n if (props.type === ButtonTypes.Next && props.fontSize) {\n return props.fontSize;\n }\n if (props.type === ButtonTypes.Regular && props.fontSize) {\n return props.fontSize;\n }\n if (props.type === ButtonTypes.Next) {\n return \"1.4rem\";\n }\n\n if (props.type === ButtonTypes.Regular) {\n return \"1.4rem\";\n }\n\n if (props.type === ButtonTypes.Regular) {\n return \"1.2rem\";\n }\n\n if (props.type === ButtonTypes.Thin) {\n return \"1.2rem\";\n }\n if (props.type === ButtonTypes.Normal) {\n return \"2.5rem\";\n }\n\n return null;\n }};\n font-weight: ${(props) => {\n if (props.type === ButtonTypes.Next && props.fontWeight) {\n return props.fontWeight;\n }\n if (props.type === ButtonTypes.Regular && props.fontWeight) {\n return props.fontWeight;\n }\n if (props.type === ButtonTypes.Next) {\n return \"600\";\n // return \"700\";\n }\n\n if (props.type === ButtonTypes.Regular) {\n return \"600\";\n // return \"700\";\n }\n\n if (props.type === ButtonTypes.Thin) {\n return \"600\";\n }\n\n if (props.type === ButtonTypes.Normal) {\n return \"500\";\n }\n return null;\n }};\n text-transform: ${(props) => props.textTransform || \"uppercase\"};\n margin: ${(props) => {\n if (props.type === ButtonTypes.Next && props.marginOnButtonText) {\n return \"0 10px 0 0\";\n }\n if (props.type === ButtonTypes.Next) {\n return \"0 10px\";\n }\n\n if (props.type === ButtonTypes.Regular) {\n if (props.iconPosition === ButtonIconPosition.Left) {\n return \"0 0 0 10px\";\n }\n\n if (props.iconPosition === ButtonIconPosition.Right) {\n return \"0 10px 0 0\";\n }\n\n return \"0\";\n }\n\n if (props.type === ButtonTypes.Normal) {\n if (props.iconPosition === ButtonIconPosition.Left) {\n return \"0 0 0 10px\";\n }\n\n if (props.iconPosition === ButtonIconPosition.Right) {\n return \"0 10px 0 0\";\n }\n\n return \"0\";\n }\n\n if (props.type === ButtonTypes.Thin) {\n if (props.iconPosition === ButtonIconPosition.Left) {\n return \"0 0 0 7px\";\n }\n\n if (props.iconPosition === ButtonIconPosition.Right) {\n return \"0 7px 0 0\";\n }\n\n return \"0\";\n }\n\n return null;\n }};\n color: ${(props: any) => {\n if (props.state === ButtonStates.Disabled && props.disabledbuttonTheme) {\n return Colors.Grey3;\n }\n if (props.state)\n if (props.state === ButtonStates.Disabled) {\n return Colors.Grey5;\n }\n\n if (props.state === ButtonStates.Warning) {\n return Colors.Grey3;\n }\n\n return props.textColor || Colors.White;\n }};\n top: ${(props) => {\n if (props.type === ButtonTypes.Thin) {\n if (props.icon) {\n return \"-1px\";\n }\n\n return \"0\";\n }\n\n return null;\n }};\n`;\n\nexport type ButtonProps = {\n type?: ButtonTypes;\n state?: ButtonStates;\n bgColor?: Colors;\n textColor?: Colors;\n text?: string;\n onClick?: any;\n icon?: any;\n iconPosition?: ButtonIconPosition;\n iconSize?: number;\n margin?: string;\n loading?: boolean;\n label?: string;\n tip?: string;\n subLabel?: string;\n marginBottam?: string;\n paddingAround?: string;\n contentAlign?: string;\n textTransform?: string;\n fontSize?: string;\n fontWeight?: string;\n fontFamily?: string;\n letterSpacing?: string;\n disabledbuttonTheme?: boolean;\n CustomInputHeight?:string;\n lineHeight?:string;\n svgIconName?:string;\n svgWidth?:string;\n svgHeight?:string;\n marginOnButtonText?:boolean;\n};\n\nexport default function Button({\n type = ButtonTypes.Next,\n state = ButtonStates.Active,\n bgColor,\n textColor,\n text,\n onClick = () => {},\n icon,\n iconPosition,\n iconSize = 14,\n // label,\n // tip,\n // subLabel,\n margin,\n marginBottam,\n loading = false,\n paddingAround,\n contentAlign,\n textTransform,\n fontSize,\n fontWeight,\n fontFamily,\n letterSpacing,\n disabledbuttonTheme,\n CustomInputHeight,\n lineHeight,\n svgIconName,\n svgHeight,\n svgWidth,\n marginOnButtonText\n}: ButtonProps) {\n const iconColor: Colors =\n state === ButtonStates.Disabled ? Colors.Grey3 : Colors.White;\n\n if (icon && !iconPosition) iconPosition = ButtonIconPosition.Left;\n\n const iconEl = (\n <Icon\n icon={icon}\n color={iconColor}\n size={iconSize}\n top={iconSize < 14 ? \"-1px\" : undefined}\n />\n );\n\n const click =\n loading || state === ButtonStates.Disabled ? null : () => onClick();\n\n return (\n <>\n {/* {label && <Label text={label} subText={subLabel} tip={tip} />} */}\n <StyledButton\n type={type}\n state={state}\n onClick={click}\n margin={margin}\n bgColor={bgColor}\n marginBottam={marginBottam}\n paddingAround={paddingAround}\n contentAlign={contentAlign}\n disabledbuttonTheme={disabledbuttonTheme}\n CustomInputHeight={CustomInputHeight}\n >\n {(() => {\n return (\n <Fragment>\n {(() => {\n if (loading) {\n return (\n <Fragment>\n <Loader size={LoaderSizes.VerySmall} color={iconColor} />\n {/* <Text \n type={type} \n state={state} \n icon={true}\n >\n Loading...\n </Text> */}\n </Fragment>\n );\n }\n\n return (\n <Fragment>\n {icon && iconPosition === ButtonIconPosition.Left && iconEl}\n {text && (\n <Text\n type={type}\n state={state}\n icon={Boolean(icon)}\n iconPosition={iconPosition}\n textColor={textColor}\n textTransform={textTransform}\n fontSize={fontSize}\n fontWeight={fontWeight}\n fontFamily={fontFamily}\n letterSpacing={letterSpacing}\n disabledbuttonTheme={disabledbuttonTheme}\n lineHeight={lineHeight}\n marginOnButtonText={marginOnButtonText}\n >\n {text}\n </Text>\n )}\n {icon &&\n iconPosition === ButtonIconPosition.Right &&\n iconEl}\n {svgIconName &&\n <SvgRenderer\n iconName={svgIconName}\n width={svgWidth}\n height={svgHeight} \n style={{ margin: '2px 0px'}}\n />\n }\n </Fragment>\n );\n })()}\n </Fragment>\n );\n })()}\n </StyledButton>\n </>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;IASY,YAMX;AAND,CAAA,UAAY,WAAW,EAAA;AACrB,IAAA,W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,EAAE,OAAO,CAAC,IAAI,CAAC,EACnB,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,aAAa,EAC5B,mBAAmB,EAAE,mBAAmB,EACxC,UAAU,EAAE,UAAU,EACtB,kBAAkB,EAAE,kBAAkB,EAErC,EAAA,IAAI,CACA,CACR;oBACA,IAAI;wBACH,YAAY,KAAK,kBAAkB,CAAC,KAAK;wBACzC,MAAM;oBACL,WAAW;wBACX,KAAC,CAAA,aAAA,CAAA,WAAW,EACX,EAAA,QAAQ,EAAE,WAAW,EACrB,KAAK,EAAE,QAAQ,EACf,MAAM,EAAE,SAAS,EACjB,KAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAC,EAAA,CAC3B,CAEK,EACX;AACJ,aAAC,GAAG,CACK,EACX;AACJ,SAAC,GAAG,CACS,CACd,EACH;AACJ,CAAC;;;;;"}
|
|
@@ -1,9 +1,22 @@
|
|
|
1
|
-
import React from
|
|
1
|
+
import React from "react";
|
|
2
2
|
declare type CodeInputProps = {
|
|
3
3
|
length: number;
|
|
4
4
|
onChange: Function;
|
|
5
5
|
onComplete: Function;
|
|
6
6
|
resetCode?: boolean;
|
|
7
|
+
color?: string;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
height?: string;
|
|
10
|
+
width?: string;
|
|
11
|
+
border?: string;
|
|
12
|
+
bgColor?: string;
|
|
13
|
+
borderRadius?: string;
|
|
14
|
+
borderHover?: string;
|
|
15
|
+
fontSize?: string;
|
|
16
|
+
marginRight?: string;
|
|
17
|
+
fontWeight?: string;
|
|
18
|
+
fontFamily?: string;
|
|
19
|
+
paddingLeft?: string;
|
|
7
20
|
};
|
|
8
21
|
declare const CodeInput: React.FC<CodeInputProps>;
|
|
9
22
|
export default CodeInput;
|