sag_components 1.0.490 → 1.0.492
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/stories/CampaignTool/Popup.stories.js +651 -39
- package/dist/stories/CampaignTool/PopupContent.stories.js +284 -0
- package/dist/stories/components/AttachedFile.js +2 -2
- package/dist/stories/components/CampaignTool/FormInput.js +40 -0
- package/dist/stories/components/CampaignTool/FormSelect.js +44 -0
- package/dist/stories/components/CampaignTool/Popup.js +92 -28
- package/dist/stories/components/CampaignTool/Popup.style.js +14 -12
- package/dist/stories/components/CampaignTool/PopupContent.js +110 -0
- package/dist/stories/components/CampaignTool/PopupContent.style.js +21 -0
- package/dist/stories/components/CampaignTool/PopupFieldsRules.js +168 -0
- package/dist/stories/components/Input.js +2 -3
- package/dist/stories/components/SagButton.js +66 -0
- package/dist/stories/components/SagButton.style.js +13 -0
- package/dist/stories/components/Select.js +84 -0
- package/dist/stories/components/Select.style.js +17 -0
- package/dist/stories/components/icons/MenuItemClosedIcon.js +27 -0
- package/dist/stories/components/icons/MenuItemOpenIcon.js +27 -0
- package/package.json +1 -1
- package/.history/.env_20231001120549 +0 -0
- package/.history/.env_20231001120613 +0 -1
- package/.history/.env_20231003143620 +0 -1
- package/.history/.eslintrc_20230928112617.js +0 -26
- package/.history/.eslintrc_20230928130534.js +0 -27
- package/.history/.eslintrc_20230928133400.js +0 -28
- package/.history/.eslintrc_20230928133404.js +0 -28
- package/.history/.eslintrc_20230928133416.js +0 -28
- package/.history/.eslintrc_20230928133419.js +0 -28
- package/.history/.eslintrc_20230928133432.js +0 -28
- package/.history/.eslintrc_20230928133439.js +0 -28
- package/.history/.eslintrc_20230928133458.js +0 -29
- package/.history/.eslintrc_20230928133500.js +0 -28
- package/.history/.eslintrc_20230928134009.js +0 -28
- package/.history/.eslintrc_20230928135318.js +0 -34
- package/.history/.eslintrc_20230928135321.js +0 -34
- package/.history/.eslintrc_20230928135323.js +0 -34
- package/.history/.eslintrc_20230928135332.js +0 -34
- package/.history/.eslintrc_20230928135333.js +0 -34
- package/.history/.eslintrc_20230928135352.js +0 -29
- package/.history/.eslintrc_20230928135353.js +0 -29
- package/.history/.eslintrc_20230928135355.js +0 -29
- package/.history/.eslintrc_20230928135408.js +0 -29
- package/.history/.eslintrc_20230928135538.js +0 -30
- package/.history/.eslintrc_20230928135539.js +0 -30
- package/.history/.eslintrc_20230928135543.js +0 -30
- package/.history/.gitignore_20230921093332 +0 -119
- package/.history/.gitignore_20230921111638 +0 -120
- package/.history/.gitignore_20230921111650 +0 -120
- package/.history/.gitignore_20230921111810 +0 -121
- package/.history/package-lock_20231114111138.json +0 -47810
- package/.history/package-lock_20231114111158.json +0 -47802
- package/.history/package_20231029152422.json +0 -82
- package/.history/package_20231029153420.json +0 -82
- package/.history/package_20231029154416.json +0 -82
- package/.history/package_20231030094127.json +0 -82
- package/.history/package_20231030114707.json +0 -82
- package/.history/package_20231030130704.json +0 -82
- package/.history/package_20231030132422.json +0 -82
- package/.history/package_20231030134051.json +0 -82
- package/.history/package_20231030142913.json +0 -82
- package/.history/package_20231030143556.json +0 -82
- package/.history/package_20231030144210.json +0 -82
- package/.history/package_20231101113942.json +0 -82
- package/.history/package_20231101114544.json +0 -82
- package/.history/package_20231101151518.json +0 -82
- package/.history/package_20231101154501.json +0 -82
- package/.history/package_20231101155811.json +0 -82
- package/.history/package_20231101160235.json +0 -82
- package/.history/package_20231101160406.json +0 -82
- package/.history/package_20231101161325.json +0 -82
- package/.history/package_20231101161333.json +0 -82
- package/.history/package_20231102123623.json +0 -82
- package/.history/package_20231102125741.json +0 -82
- package/.history/package_20231102130857.json +0 -82
- package/.history/package_20231102132227.json +0 -82
- package/.history/package_20231102142340.json +0 -82
- package/.history/package_20231102143256.json +0 -82
- package/.history/package_20231105153539.json +0 -82
- package/.history/package_20231105154332.json +0 -82
- package/.history/package_20231105171201.json +0 -82
- package/.history/package_20231106123849.json +0 -82
- package/.history/package_20231107170638.json +0 -82
- package/.history/package_20231109103647.json +0 -82
- package/.history/package_20231109103911.json +0 -82
- package/.history/package_20231109105426.json +0 -82
- package/.history/package_20231109132014.json +0 -82
- package/.history/package_20231109132115.json +0 -82
- package/.history/package_20231114100517.json +0 -82
- package/.history/package_20231114100859.json +0 -82
- package/.history/package_20231114101553.json +0 -82
- package/.history/package_20231114102545.json +0 -82
- package/.history/package_20231114111208.json +0 -83
- package/.history/package_20231114111515.json +0 -83
- package/.history/package_20231114112931.json +0 -83
- package/.history/package_20231114113014.json +0 -83
- package/.history/package_20231114113155.json +0 -83
- package/.history/package_20231114124318.json +0 -83
- package/.history/package_20231114125107.json +0 -83
- package/.history/package_20231114125510.json +0 -83
- package/.history/package_20231114132634.json +0 -83
- package/.history/package_20231116165815.json +0 -83
- package/.history/package_20231116165916.json +0 -83
- package/.history/package_20231119113637.json +0 -83
- package/.history/package_20231120100907.json +0 -83
- package/.history/package_20231121151523.json +0 -77
- package/.history/package_20231121155513.json +0 -77
- package/.history/package_20231121162434.json +0 -77
- package/.history/package_20231122100718.json +0 -77
- package/.history/package_20231128125149.json +0 -82
- package/.history/package_20231128125208.json +0 -82
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = exports.PopupContent = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _reactHookForm = require("react-hook-form");
|
|
10
|
+
var _FormSelect = require("./FormSelect");
|
|
11
|
+
var _FormInput = require("./FormInput");
|
|
12
|
+
var _Datepicker = require("../Datepicker");
|
|
13
|
+
var _PopupContent = require("./PopupContent.style");
|
|
14
|
+
/* PopupContent */
|
|
15
|
+
const PopupContent = props => {
|
|
16
|
+
let {
|
|
17
|
+
width,
|
|
18
|
+
height
|
|
19
|
+
} = props;
|
|
20
|
+
const methods = (0, _reactHookForm.useFormContext)();
|
|
21
|
+
const {
|
|
22
|
+
rowsData,
|
|
23
|
+
onClick,
|
|
24
|
+
onChange,
|
|
25
|
+
borderColor
|
|
26
|
+
} = props;
|
|
27
|
+
const [RowsDataState, setRowsDataState] = (0, _react.useState)(rowsData);
|
|
28
|
+
(0, _react.useEffect)(() => {
|
|
29
|
+
//console.log("RowsDataState", RowsDataState);
|
|
30
|
+
}, [RowsDataState]);
|
|
31
|
+
const displayRowFields = function (data, height) {
|
|
32
|
+
let paddingBottom = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "5px";
|
|
33
|
+
if (data && data.length > 0) {
|
|
34
|
+
return /*#__PURE__*/_react.default.createElement(_PopupContent.FieldsContainer, {
|
|
35
|
+
id: "FieldsContainer",
|
|
36
|
+
height: height,
|
|
37
|
+
paddingBottom: paddingBottom
|
|
38
|
+
}, data === null || data === void 0 ? void 0 : data.map(item => /*#__PURE__*/_react.default.createElement(_PopupContent.FieldContainer, {
|
|
39
|
+
id: "FieldContainer"
|
|
40
|
+
}, item.inputType === "dropdown" ? /*#__PURE__*/_react.default.createElement(_FormSelect.FormSelect, {
|
|
41
|
+
id: "Select",
|
|
42
|
+
name: item.name,
|
|
43
|
+
control: methods.control,
|
|
44
|
+
errorMessage: "",
|
|
45
|
+
label: item.label,
|
|
46
|
+
required: item.required,
|
|
47
|
+
placeHolder: item.placeHolder
|
|
48
|
+
//onChange={item.onChange}
|
|
49
|
+
,
|
|
50
|
+
options: item.dropdownOptions && item.dropdownOptions.length > 0 ? item.dropdownOptions : [],
|
|
51
|
+
height: "45px",
|
|
52
|
+
width: "100%"
|
|
53
|
+
}) : item.inputType === "textbox" ? /*#__PURE__*/_react.default.createElement(_FormInput.FormInput, {
|
|
54
|
+
id: "FormInput",
|
|
55
|
+
name: item.name,
|
|
56
|
+
control: methods.control,
|
|
57
|
+
borderRadius: "4px",
|
|
58
|
+
required: item.required,
|
|
59
|
+
label: item.label,
|
|
60
|
+
placeholder: item.placeHolder,
|
|
61
|
+
height: "45px",
|
|
62
|
+
width: "100%"
|
|
63
|
+
//onChange={item.onChange}
|
|
64
|
+
,
|
|
65
|
+
borderColor: borderColor
|
|
66
|
+
}) : item.inputType === "datepicker" ? /*#__PURE__*/_react.default.createElement(_PopupContent.DatePickerContainer, {
|
|
67
|
+
id: "DatePickerContainer"
|
|
68
|
+
}, /*#__PURE__*/_react.default.createElement(_Datepicker.Datepicker, {
|
|
69
|
+
id: "Datepicker",
|
|
70
|
+
name: item.name,
|
|
71
|
+
required: item.required,
|
|
72
|
+
placeholder: item.placeHolder,
|
|
73
|
+
borderColor: borderColor,
|
|
74
|
+
format: "MM/DD/YYYY",
|
|
75
|
+
labelColor: borderColor,
|
|
76
|
+
onChange: () => {},
|
|
77
|
+
shape: "square",
|
|
78
|
+
text: item.label,
|
|
79
|
+
height: "45px",
|
|
80
|
+
width: "100%"
|
|
81
|
+
})) : "")));
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
const displayRows = () => {
|
|
85
|
+
if (RowsDataState && RowsDataState.length > 0) {
|
|
86
|
+
return /*#__PURE__*/_react.default.createElement(_PopupContent.AllFieldsContainer, {
|
|
87
|
+
id: "AllFieldsContainer"
|
|
88
|
+
}, RowsDataState.map((row, i) => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, displayRowFields(row.fieldsArray, height = "160px", "20px"))));
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
//= ======================================== MAIN RETURN ====================================
|
|
93
|
+
return /*#__PURE__*/_react.default.createElement(_PopupContent.MainContainer, {
|
|
94
|
+
id: "MainContainer",
|
|
95
|
+
height: height,
|
|
96
|
+
width: width
|
|
97
|
+
}, /*#__PURE__*/_react.default.createElement(_PopupContent.PanelContainer, {
|
|
98
|
+
id: "PanelContainer"
|
|
99
|
+
}, displayRows()));
|
|
100
|
+
//= ======================================== MAIN RETURN END====================================
|
|
101
|
+
};
|
|
102
|
+
exports.PopupContent = PopupContent;
|
|
103
|
+
var _default = exports.default = PopupContent;
|
|
104
|
+
PopupContent.defaultProps = {
|
|
105
|
+
RowsData: [],
|
|
106
|
+
borderColor: "#066768",
|
|
107
|
+
width: "100%",
|
|
108
|
+
height: "100%",
|
|
109
|
+
onClick: () => {}
|
|
110
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.PanelContainer = exports.MainContainer = exports.FieldsContainer = exports.FieldTitle = exports.FieldContainer = exports.DatePickerContainer = exports.AllFieldsContainer = void 0;
|
|
8
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
9
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
11
|
+
const MainContainer = exports.MainContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: row;\n position: relative;\n font-family: \"Poppins\", sans-serif;\n font-style: normal;\n font-size: 1rem;\n border-radius: 12px;\n width: ", ";\n height: ", ";\n"])), props => {
|
|
12
|
+
return props.width;
|
|
13
|
+
}, props => {
|
|
14
|
+
return props.height;
|
|
15
|
+
});
|
|
16
|
+
const PanelContainer = exports.PanelContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-content: center;\n flex-direction: column;\n align-items: center;\n justify-content: space-around;\n border-radius: 12px;\n background: #ffffff;\n padding: 0 10px ;\n font-weight: 400;\n font-size: 14px;\n line-height: 19px;\n white-space: pre-wrap;\n overflow: hidden;\n width: 100%;\n"])));
|
|
17
|
+
const FieldTitle = exports.FieldTitle = _styledComponents.default.h4(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 600;\n font-size: 14px;\n margin: 5px;\n @media (max-width: 1536px) {\n font-size: 11px;\n }\n @media (max-width: 1366px) {\n font-size: 10px;\n }\n"])));
|
|
18
|
+
const AllFieldsContainer = exports.AllFieldsContainer = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n flex-wrap: wrap;\n width: 100%;\n"])));
|
|
19
|
+
const FieldsContainer = exports.FieldsContainer = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: row;\n white-space: wrap;\n padding: 10px;\n gap: 20px;\n width: 100%;\n \n"])));
|
|
20
|
+
const FieldContainer = exports.FieldContainer = _styledComponents.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)([" \n width: 100%;\n margin: 0;\n \n"])));
|
|
21
|
+
const DatePickerContainer = exports.DatePickerContainer = _styledComponents.default.div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n \n"])));
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getPopupFieldsRules = void 0;
|
|
7
|
+
var _Email = require("../../utils/regex/Email.regex");
|
|
8
|
+
var _Phone = require("../../utils/regex/Phone.regex");
|
|
9
|
+
var _LatinWithSpaces = require("../../utils/regex/LatinWithSpaces.regex");
|
|
10
|
+
const getPopupFieldsRules = name => {
|
|
11
|
+
switch (name) {
|
|
12
|
+
case "AllowInStoreGroups":
|
|
13
|
+
return {
|
|
14
|
+
required: false
|
|
15
|
+
};
|
|
16
|
+
case "BlockInStoreGroups":
|
|
17
|
+
return {
|
|
18
|
+
required: false
|
|
19
|
+
};
|
|
20
|
+
case "BrandDescription":
|
|
21
|
+
return {
|
|
22
|
+
required: false
|
|
23
|
+
};
|
|
24
|
+
case "BrandName":
|
|
25
|
+
return {
|
|
26
|
+
required: false
|
|
27
|
+
};
|
|
28
|
+
case "Broker":
|
|
29
|
+
return {
|
|
30
|
+
required: false
|
|
31
|
+
};
|
|
32
|
+
case "Budget":
|
|
33
|
+
return {
|
|
34
|
+
required: false
|
|
35
|
+
};
|
|
36
|
+
case "Category":
|
|
37
|
+
return {
|
|
38
|
+
required: "Category is required"
|
|
39
|
+
};
|
|
40
|
+
case "CategoryLevel1":
|
|
41
|
+
return {
|
|
42
|
+
required: false
|
|
43
|
+
};
|
|
44
|
+
case "CategoryManager":
|
|
45
|
+
return {
|
|
46
|
+
required: false
|
|
47
|
+
};
|
|
48
|
+
case "ConditionMinBasketValue":
|
|
49
|
+
return {
|
|
50
|
+
required: false
|
|
51
|
+
};
|
|
52
|
+
case "ConditionMinQuantityPurchased":
|
|
53
|
+
return {
|
|
54
|
+
required: false
|
|
55
|
+
};
|
|
56
|
+
case "ConsiderStoreAvailability":
|
|
57
|
+
return {
|
|
58
|
+
required: false
|
|
59
|
+
};
|
|
60
|
+
case "ContactEmail":
|
|
61
|
+
return {
|
|
62
|
+
required: "Contact Email is required",
|
|
63
|
+
pattern: {
|
|
64
|
+
value: _Email.EmailRegex,
|
|
65
|
+
message: "invalid contact email address"
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
case "ContactName":
|
|
69
|
+
return {
|
|
70
|
+
required: "Contact Name is required",
|
|
71
|
+
maxLength: {
|
|
72
|
+
value: 17,
|
|
73
|
+
message: "Maximum 17 letters"
|
|
74
|
+
},
|
|
75
|
+
minLength: {
|
|
76
|
+
value: 2,
|
|
77
|
+
message: "Contact Name should include at least two letters"
|
|
78
|
+
},
|
|
79
|
+
pattern: {
|
|
80
|
+
value: _LatinWithSpaces.OnlyLatinWithSpacesRegex,
|
|
81
|
+
message: "Only english letters allowed"
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
case "ContactPhone":
|
|
85
|
+
return {
|
|
86
|
+
required: false,
|
|
87
|
+
pattern: {
|
|
88
|
+
value: _Phone.PhoneRegex,
|
|
89
|
+
message: "Please provide a valid phone number"
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
case "DescriptionLowCase":
|
|
93
|
+
return {
|
|
94
|
+
required: false
|
|
95
|
+
};
|
|
96
|
+
case "DiscountType":
|
|
97
|
+
return {
|
|
98
|
+
required: false
|
|
99
|
+
};
|
|
100
|
+
case "FundationSource":
|
|
101
|
+
return {
|
|
102
|
+
required: "Fundation Source is required"
|
|
103
|
+
};
|
|
104
|
+
case "Image":
|
|
105
|
+
return {
|
|
106
|
+
required: false
|
|
107
|
+
};
|
|
108
|
+
case "MaxIssuances":
|
|
109
|
+
return {
|
|
110
|
+
required: false
|
|
111
|
+
};
|
|
112
|
+
case "MaxTransactions":
|
|
113
|
+
return {
|
|
114
|
+
required: false
|
|
115
|
+
};
|
|
116
|
+
case "OfferInventory":
|
|
117
|
+
return {
|
|
118
|
+
required: false
|
|
119
|
+
};
|
|
120
|
+
case "PurchaseOrder":
|
|
121
|
+
return {
|
|
122
|
+
required: false
|
|
123
|
+
};
|
|
124
|
+
case "PurchaseOrderPDN":
|
|
125
|
+
return {
|
|
126
|
+
required: false
|
|
127
|
+
};
|
|
128
|
+
case "RedemptionID":
|
|
129
|
+
return {
|
|
130
|
+
required: false
|
|
131
|
+
};
|
|
132
|
+
case "RewardQuantity":
|
|
133
|
+
return {
|
|
134
|
+
required: false
|
|
135
|
+
};
|
|
136
|
+
case "SummaryPodHeader":
|
|
137
|
+
return {
|
|
138
|
+
required: false
|
|
139
|
+
};
|
|
140
|
+
case "Supplier":
|
|
141
|
+
return {
|
|
142
|
+
required: "Supplier is required"
|
|
143
|
+
};
|
|
144
|
+
case "SupplierOfferID":
|
|
145
|
+
return {
|
|
146
|
+
required: false
|
|
147
|
+
};
|
|
148
|
+
case "TargetAudienceType":
|
|
149
|
+
return {
|
|
150
|
+
required: false
|
|
151
|
+
};
|
|
152
|
+
case "TargetingNotes":
|
|
153
|
+
return {
|
|
154
|
+
required: false
|
|
155
|
+
};
|
|
156
|
+
case "TypeReward":
|
|
157
|
+
return {
|
|
158
|
+
required: false
|
|
159
|
+
};
|
|
160
|
+
case "VendorID":
|
|
161
|
+
return {
|
|
162
|
+
required: false
|
|
163
|
+
};
|
|
164
|
+
default:
|
|
165
|
+
return "";
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
exports.getPopupFieldsRules = getPopupFieldsRules;
|
|
@@ -6,14 +6,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _fa = require("react-icons/fa");
|
|
9
10
|
var _Input = require("./Input.style");
|
|
10
11
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
11
12
|
/* eslint-disable react/require-default-props */
|
|
12
13
|
/* eslint-disable no-nested-ternary */
|
|
13
14
|
// CustomInput.js
|
|
14
15
|
|
|
15
|
-
// import { FaEye, FaEyeSlash } from 'react-icons/fa';
|
|
16
|
-
|
|
17
16
|
const Input = _ref => {
|
|
18
17
|
let {
|
|
19
18
|
label,
|
|
@@ -73,7 +72,7 @@ const Input = _ref => {
|
|
|
73
72
|
}), error && /*#__PURE__*/_react.default.createElement(_Input.ErrorLabel, null, errorMessage), password && /*#__PURE__*/_react.default.createElement(_Input.EyeIcon, {
|
|
74
73
|
onClick: toggleShowPassword,
|
|
75
74
|
textColor: textColor
|
|
76
|
-
}, showPassword ? /*#__PURE__*/_react.default.createElement(FaEyeSlash, null) : /*#__PURE__*/_react.default.createElement(FaEye, null)));
|
|
75
|
+
}, showPassword ? /*#__PURE__*/_react.default.createElement(_fa.FaEyeSlash, null) : /*#__PURE__*/_react.default.createElement(_fa.FaEye, null)));
|
|
77
76
|
};
|
|
78
77
|
// Adding defaultProps
|
|
79
78
|
Input.defaultProps = {
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _SagButton = require("./SagButton.style");
|
|
10
|
+
const SagButton = props => {
|
|
11
|
+
const {
|
|
12
|
+
text,
|
|
13
|
+
disabled,
|
|
14
|
+
fontSize,
|
|
15
|
+
fontWeight,
|
|
16
|
+
textColor,
|
|
17
|
+
backgroundColor,
|
|
18
|
+
borderColor,
|
|
19
|
+
onClickColor,
|
|
20
|
+
height,
|
|
21
|
+
width,
|
|
22
|
+
radius,
|
|
23
|
+
onClick
|
|
24
|
+
} = props;
|
|
25
|
+
const [clicked, setClicked] = (0, _react.useState)(false);
|
|
26
|
+
const handleButtonClick = event => {
|
|
27
|
+
setClicked(true);
|
|
28
|
+
onClick(event);
|
|
29
|
+
setTimeout(() => {
|
|
30
|
+
setClicked(false);
|
|
31
|
+
// Add any logic you want to execute after the transition is complete
|
|
32
|
+
}, 300); // Adjust the transition duration (in milliseconds) as needed
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
return /*#__PURE__*/_react.default.createElement(_SagButton.ButtonContainer, {
|
|
36
|
+
id: "ButtonContainer"
|
|
37
|
+
}, /*#__PURE__*/_react.default.createElement(_SagButton.Button, {
|
|
38
|
+
id: "Button",
|
|
39
|
+
className: clicked ? "button-clicked" : "button",
|
|
40
|
+
onClick: !disabled ? handleButtonClick : null,
|
|
41
|
+
width: width,
|
|
42
|
+
height: height,
|
|
43
|
+
radius: radius,
|
|
44
|
+
disabled: disabled,
|
|
45
|
+
backgroundColor: backgroundColor,
|
|
46
|
+
borderColor: borderColor,
|
|
47
|
+
onClickColor: onClickColor
|
|
48
|
+
}, /*#__PURE__*/_react.default.createElement(_SagButton.Label, {
|
|
49
|
+
id: "Label",
|
|
50
|
+
textColor: textColor,
|
|
51
|
+
fontSize: fontSize,
|
|
52
|
+
fontWeight: fontWeight
|
|
53
|
+
}, text)));
|
|
54
|
+
};
|
|
55
|
+
var _default = exports.default = SagButton;
|
|
56
|
+
SagButton.defaultProps = {
|
|
57
|
+
text: "",
|
|
58
|
+
textColor: "#1B30AA",
|
|
59
|
+
onClickColor: "#1B30AA",
|
|
60
|
+
backgroundColor: "#ffffff",
|
|
61
|
+
fontSize: "14px",
|
|
62
|
+
disabled: false,
|
|
63
|
+
width: "100%",
|
|
64
|
+
radius: "12px",
|
|
65
|
+
onClick: () => {}
|
|
66
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.Label = exports.ButtonContainer = exports.Button = void 0;
|
|
8
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
9
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
11
|
+
const ButtonContainer = exports.ButtonContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n"])));
|
|
12
|
+
const Button = exports.Button = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n //padding: 14px 10px;\n align-items: center;\n justify-content: center;\n align-content: center;\n flex-wrap: wrap;\n overflow: hidden;\n width: ", ";\n height: ", ";\n border: ", "; \n border-radius: ", ";\n background-color: ", ";\n box-sizing: border-box;\n &:hover {\n background-color: ", ";\n cursor: ", ";\n }\n &.button-clicked {\n background-color: ", ";\n color: white;\n padding: 10px 20px;\n border-radius: 5px;\n cursor: pointer;\n display: inline-block;\n transition: background-color 0.3s, color 0.3s;\n }\n"])), props => props.width, props => props.height, props => "1px solid ".concat(props.borderColor), props => props.radius, props => props.disabled ? "#c5c5c5" : props.backgroundColor, props => props.disabled ? "#c5c5c5" : "#f0f0f0", props => !props.disabled ? "pointer" : "default", props => props.onClickColor);
|
|
13
|
+
const Label = exports.Label = _styledComponents.default.label(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n font-family: \"Poppins\", sans-serif;\n font-style: normal;\n font-weight: ", ";\n color: ", ";\n pointer-events: none;\n font-size: ", ";\n @media (max-width: 1536px) {\n font-size: 12px;\n }\n @media (max-width: 1366px) {\n font-size: 10px;\n }\n"])), props => props.fontWeight, props => props.textColor, props => props.fontSize);
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = exports.Select = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _Select = require("./Select.style");
|
|
10
|
+
/* eslint-disable react/prop-types */
|
|
11
|
+
|
|
12
|
+
const Select = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
label,
|
|
15
|
+
options,
|
|
16
|
+
value,
|
|
17
|
+
onChange,
|
|
18
|
+
required,
|
|
19
|
+
disabled,
|
|
20
|
+
width,
|
|
21
|
+
height,
|
|
22
|
+
error,
|
|
23
|
+
errorMessage
|
|
24
|
+
} = _ref;
|
|
25
|
+
const [isFocused, setIsFocused] = (0, _react.useState)(false);
|
|
26
|
+
const [showOptions, setShowOptions] = (0, _react.useState)(false);
|
|
27
|
+
const [inputValue, setInputValue] = (0, _react.useState)('');
|
|
28
|
+
const inputRef = (0, _react.useRef)(null);
|
|
29
|
+
const filteredOptions = options.filter(option => option.label.toLowerCase().includes(inputValue.toLowerCase()));
|
|
30
|
+
const handleFocus = () => {
|
|
31
|
+
setIsFocused(true);
|
|
32
|
+
setShowOptions(true);
|
|
33
|
+
};
|
|
34
|
+
const handleBlur = () => {
|
|
35
|
+
setIsFocused(false);
|
|
36
|
+
setTimeout(() => setShowOptions(false), 200); // Delay hiding options to allow clicking on them
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const handleInputChange = e => {
|
|
40
|
+
setInputValue(e.target.value);
|
|
41
|
+
};
|
|
42
|
+
const handleOptionClick = option => {
|
|
43
|
+
console.log('inputValue', option);
|
|
44
|
+
onChange({
|
|
45
|
+
target: {
|
|
46
|
+
value: option.value
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
setIsFocused(true);
|
|
50
|
+
setShowOptions(false);
|
|
51
|
+
setInputValue(option.label);
|
|
52
|
+
};
|
|
53
|
+
return /*#__PURE__*/_react.default.createElement(_Select.SelectWrapper, {
|
|
54
|
+
width: width,
|
|
55
|
+
height: height
|
|
56
|
+
}, /*#__PURE__*/_react.default.createElement(_Select.Label, {
|
|
57
|
+
isFocused: isFocused,
|
|
58
|
+
hasValue: value || inputValue,
|
|
59
|
+
disabled: disabled,
|
|
60
|
+
error: error
|
|
61
|
+
}, label, required && /*#__PURE__*/_react.default.createElement("span", null, "*")), /*#__PURE__*/_react.default.createElement(_Select.StyledInput, {
|
|
62
|
+
ref: inputRef,
|
|
63
|
+
value: inputValue,
|
|
64
|
+
onChange: handleInputChange,
|
|
65
|
+
onFocus: handleFocus,
|
|
66
|
+
onBlur: handleBlur,
|
|
67
|
+
disabled: disabled,
|
|
68
|
+
placeholder: isFocused ? 'Type to search...' : '',
|
|
69
|
+
style: {
|
|
70
|
+
width,
|
|
71
|
+
height
|
|
72
|
+
},
|
|
73
|
+
error: error
|
|
74
|
+
}), error && /*#__PURE__*/_react.default.createElement(_Select.ErrorMessage, null, errorMessage), /*#__PURE__*/_react.default.createElement(_Select.OptionsContainer, {
|
|
75
|
+
showOptions: showOptions,
|
|
76
|
+
filteredOptions: filteredOptions,
|
|
77
|
+
disabled: disabled
|
|
78
|
+
}, filteredOptions.map(option => /*#__PURE__*/_react.default.createElement(_Select.OptionItem, {
|
|
79
|
+
key: option.value,
|
|
80
|
+
onClick: () => handleOptionClick(option)
|
|
81
|
+
}, option.label))));
|
|
82
|
+
};
|
|
83
|
+
exports.Select = Select;
|
|
84
|
+
var _default = exports.default = Select;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.StyledInput = exports.SelectWrapper = exports.OptionsContainer = exports.OptionItem = exports.Label = exports.ErrorMessage = void 0;
|
|
8
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
9
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
11
|
+
/* eslint-disable no-nested-ternary */
|
|
12
|
+
const SelectWrapper = exports.SelectWrapper = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n width: ", ";\n margin-bottom: 20px;\n"])), props => props.width || '200px');
|
|
13
|
+
const Label = exports.Label = _styledComponents.default.label(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n font-size: ", ";\n padding-inline-end: 5px;\n padding-inline-start: 5px;\n margin-right: 10px;\n color: ", ";\n background-color: white;\n position: absolute;\n top: ", ";\n left: 10px;\n transform: translateY(-50%);\n transition: top 0.3s ease, font-size 0.3s ease, color 0.3s ease;\n display: flex;\n align-items: center;\n box-sizing: border-box;\n"])), props => props.isFocused || props.hasValue ? '12px' : '16px', props => props.error ? 'red' : props.disabled ? '#888' : '#333', props => props.isFocused || props.hasValue ? '0px' : '50%');
|
|
14
|
+
const StyledInput = exports.StyledInput = _styledComponents.default.input(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n padding: 10px;\n font-size: 14px;\n border: 2px solid ", ";\n border-radius: 4px;\n outline: none;\n box-sizing: border-box;\n color: ", ";\n\n &:focus {\n border-color: ", ";\n }\n"])), props => props.disabled ? '#bdbdbd' : props.error ? 'red' : '#bdbdbd', props => props.disabled ? '#888' : '#333', props => props.disabled ? '#bdbdbd' : '#1976d2');
|
|
15
|
+
const OptionsContainer = exports.OptionsContainer = _styledComponents.default.ul(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n list-style: none;\n margin: 0;\n padding: 0;\n position: absolute;\n top: calc(100% + 2px);\n left: 0;\n z-index: 1;\n width: 100%;\n border-top: none;\n border-radius: 0 0 4px 4px;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n background-color: #fff;\n display: ", ";\n"])), props => props.showOptions && props.filteredOptions.length > 0 ? 'block' : 'none');
|
|
16
|
+
const OptionItem = exports.OptionItem = _styledComponents.default.li(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n padding: 8px;\n cursor: pointer;\n transition: background-color 0.3s;\n\n &:hover {\n background-color: #f0f0f0;\n }\n"])));
|
|
17
|
+
const ErrorMessage = exports.ErrorMessage = _styledComponents.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n font-size: 12px;\n color: red;\n margin-top: 5px;\n"])));
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = exports.MenuItemClosedIcon = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
const MenuItemClosedIcon = _ref => {
|
|
10
|
+
let {
|
|
11
|
+
clicked,
|
|
12
|
+
width = "16",
|
|
13
|
+
height = "16"
|
|
14
|
+
} = _ref;
|
|
15
|
+
return /*#__PURE__*/_react.default.createElement("svg", {
|
|
16
|
+
width: width,
|
|
17
|
+
height: height,
|
|
18
|
+
viewBox: "0 0 10 16",
|
|
19
|
+
fill: "none",
|
|
20
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
21
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
22
|
+
d: "M8.72266 7.15234C9.03906 7.50391 9.03906 8.03125 8.72266 8.34766L1.97266 15.0977C1.62109 15.4492 1.09375 15.4492 0.777344 15.0977C0.425781 14.7812 0.425781 14.2539 0.777344 13.9375L6.92969 7.78516L0.777344 1.59766C0.425781 1.28125 0.425781 0.753906 0.777344 0.4375C1.09375 0.0859375 1.62109 0.0859375 1.9375 0.4375L8.72266 7.15234Z",
|
|
23
|
+
fill: "#7E7E7E"
|
|
24
|
+
}));
|
|
25
|
+
};
|
|
26
|
+
exports.MenuItemClosedIcon = MenuItemClosedIcon;
|
|
27
|
+
var _default = exports.default = MenuItemClosedIcon;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = exports.MenuItemOpenIcon = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
const MenuItemOpenIcon = _ref => {
|
|
10
|
+
let {
|
|
11
|
+
clicked,
|
|
12
|
+
width = "16",
|
|
13
|
+
height = "16"
|
|
14
|
+
} = _ref;
|
|
15
|
+
return /*#__PURE__*/_react.default.createElement("svg", {
|
|
16
|
+
width: width,
|
|
17
|
+
height: height,
|
|
18
|
+
viewBox: "0 0 16 10",
|
|
19
|
+
fill: "none",
|
|
20
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
21
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
22
|
+
d: "M7.40234 8.84766L0.652344 2.09766C0.300781 1.78125 0.300781 1.25391 0.652344 0.902344C0.96875 0.585938 1.49609 0.585938 1.84766 0.902344L8 7.08984L14.1523 0.9375C14.4688 0.585938 14.9961 0.585938 15.3477 0.9375C15.6641 1.25391 15.6641 1.78125 15.3477 2.09766L8.5625 8.84766C8.24609 9.19922 7.71875 9.19922 7.40234 8.84766Z",
|
|
23
|
+
fill: "#7E7E7E"
|
|
24
|
+
}));
|
|
25
|
+
};
|
|
26
|
+
exports.MenuItemOpenIcon = MenuItemOpenIcon;
|
|
27
|
+
var _default = exports.default = MenuItemOpenIcon;
|
package/package.json
CHANGED
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
STORYBOOK_FIGMA_ACCESS_TOKEN=figd_YdAmQQKQ2B6ZngEijA0JiqNNUdJvP23G46NK7-fc
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
STORYBOOK_FIGMA_ACCESS_TOKEN=figd_MOcc8-aS91XJ3mFdtNlH4oPVY73ChHlmw6-hKhsb
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
env: {
|
|
3
|
-
browser: true,
|
|
4
|
-
es2021: true,
|
|
5
|
-
},
|
|
6
|
-
extends: 'airbnb',
|
|
7
|
-
overrides: [
|
|
8
|
-
{
|
|
9
|
-
env: {
|
|
10
|
-
node: true,
|
|
11
|
-
},
|
|
12
|
-
files: [
|
|
13
|
-
'.eslintrc.{js,cjs}',
|
|
14
|
-
],
|
|
15
|
-
parserOptions: {
|
|
16
|
-
sourceType: 'script',
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
parserOptions: {
|
|
21
|
-
ecmaVersion: 'latest',
|
|
22
|
-
sourceType: 'module',
|
|
23
|
-
},
|
|
24
|
-
rules: {
|
|
25
|
-
},
|
|
26
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
env: {
|
|
3
|
-
browser: true,
|
|
4
|
-
es2021: true,
|
|
5
|
-
},
|
|
6
|
-
extends: 'airbnb',
|
|
7
|
-
overrides: [
|
|
8
|
-
{
|
|
9
|
-
env: {
|
|
10
|
-
node: true,
|
|
11
|
-
},
|
|
12
|
-
files: [
|
|
13
|
-
'.eslintrc.{js,cjs}',
|
|
14
|
-
],
|
|
15
|
-
parserOptions: {
|
|
16
|
-
sourceType: 'script',
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
parserOptions: {
|
|
21
|
-
ecmaVersion: 'latest',
|
|
22
|
-
sourceType: 'module',
|
|
23
|
-
},
|
|
24
|
-
rules: {
|
|
25
|
-
'max-len': 'off',
|
|
26
|
-
},
|
|
27
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
env: {
|
|
3
|
-
browser: true,
|
|
4
|
-
es2021: true,
|
|
5
|
-
},
|
|
6
|
-
extends: 'airbnb',
|
|
7
|
-
overrides: [
|
|
8
|
-
{
|
|
9
|
-
env: {
|
|
10
|
-
node: true,
|
|
11
|
-
},
|
|
12
|
-
files: [
|
|
13
|
-
'.eslintrc.{js,cjs}',
|
|
14
|
-
],
|
|
15
|
-
parserOptions: {
|
|
16
|
-
sourceType: 'script',
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
parserOptions: {
|
|
21
|
-
ecmaVersion: 'latest',
|
|
22
|
-
sourceType: 'module',
|
|
23
|
-
},
|
|
24
|
-
rules: {
|
|
25
|
-
'max-len': 'off',
|
|
26
|
-
/*eslint linebreak-style: ["error", "windows"]*/
|
|
27
|
-
},
|
|
28
|
-
};
|