@willphan1712000/frontend 1.0.1 → 1.0.3
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/README.md +20 -1
- package/dist/index.d.mts +56 -13
- package/dist/index.d.ts +56 -13
- package/dist/index.js +642 -0
- package/dist/index.mjs +635 -1
- package/package.json +4 -7
- package/.babelrc +0 -20
- package/index.ts +0 -13
- package/public/favicon.ico +0 -0
- package/public/index.html +0 -43
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +0 -25
- package/public/robots.txt +0 -3
package/dist/index.js
CHANGED
|
@@ -7,6 +7,9 @@ function _array_like_to_array(arr, len) {
|
|
|
7
7
|
function _array_with_holes(arr) {
|
|
8
8
|
if (Array.isArray(arr)) return arr;
|
|
9
9
|
}
|
|
10
|
+
function _array_without_holes(arr) {
|
|
11
|
+
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
12
|
+
}
|
|
10
13
|
function _define_property(obj, key, value) {
|
|
11
14
|
if (key in obj) {
|
|
12
15
|
Object.defineProperty(obj, key, {
|
|
@@ -20,6 +23,9 @@ function _define_property(obj, key, value) {
|
|
|
20
23
|
}
|
|
21
24
|
return obj;
|
|
22
25
|
}
|
|
26
|
+
function _iterable_to_array(iter) {
|
|
27
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
28
|
+
}
|
|
23
29
|
function _iterable_to_array_limit(arr, i) {
|
|
24
30
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
25
31
|
if (_i == null) return;
|
|
@@ -47,6 +53,9 @@ function _iterable_to_array_limit(arr, i) {
|
|
|
47
53
|
function _non_iterable_rest() {
|
|
48
54
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
49
55
|
}
|
|
56
|
+
function _non_iterable_spread() {
|
|
57
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
58
|
+
}
|
|
50
59
|
function _object_spread(target) {
|
|
51
60
|
for(var i = 1; i < arguments.length; i++){
|
|
52
61
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
@@ -86,9 +95,39 @@ function _object_spread_props(target, source) {
|
|
|
86
95
|
}
|
|
87
96
|
return target;
|
|
88
97
|
}
|
|
98
|
+
function _object_without_properties(source, excluded) {
|
|
99
|
+
if (source == null) return {};
|
|
100
|
+
var target = _object_without_properties_loose(source, excluded);
|
|
101
|
+
var key, i;
|
|
102
|
+
if (Object.getOwnPropertySymbols) {
|
|
103
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
104
|
+
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
105
|
+
key = sourceSymbolKeys[i];
|
|
106
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
107
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
108
|
+
target[key] = source[key];
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return target;
|
|
112
|
+
}
|
|
113
|
+
function _object_without_properties_loose(source, excluded) {
|
|
114
|
+
if (source == null) return {};
|
|
115
|
+
var target = {};
|
|
116
|
+
var sourceKeys = Object.keys(source);
|
|
117
|
+
var key, i;
|
|
118
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
119
|
+
key = sourceKeys[i];
|
|
120
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
121
|
+
target[key] = source[key];
|
|
122
|
+
}
|
|
123
|
+
return target;
|
|
124
|
+
}
|
|
89
125
|
function _sliced_to_array(arr, i) {
|
|
90
126
|
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
91
127
|
}
|
|
128
|
+
function _to_consumable_array(arr) {
|
|
129
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
130
|
+
}
|
|
92
131
|
function _type_of(obj) {
|
|
93
132
|
"@swc/helpers - typeof";
|
|
94
133
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
@@ -150,12 +189,18 @@ var __toCommonJS = function(mod) {
|
|
|
150
189
|
// index.ts
|
|
151
190
|
var index_exports = {};
|
|
152
191
|
__export(index_exports, {
|
|
192
|
+
Button: function() {
|
|
193
|
+
return Button_default;
|
|
194
|
+
},
|
|
153
195
|
ColorPickerSlider: function() {
|
|
154
196
|
return ColorPickerSlider_default;
|
|
155
197
|
},
|
|
156
198
|
DropdownSelect: function() {
|
|
157
199
|
return DropdownSelect_default;
|
|
158
200
|
},
|
|
201
|
+
MultiSelect: function() {
|
|
202
|
+
return MultiSelect_default;
|
|
203
|
+
},
|
|
159
204
|
OptionSlider: function() {
|
|
160
205
|
return OptionSlider_default;
|
|
161
206
|
},
|
|
@@ -897,10 +942,607 @@ var ColorPickerSlider = function(param) {
|
|
|
897
942
|
});
|
|
898
943
|
};
|
|
899
944
|
var ColorPickerSlider_default = ColorPickerSlider;
|
|
945
|
+
// src/components/MultiSelect/MultiSelect.tsx
|
|
946
|
+
var import_react8 = require("react");
|
|
947
|
+
// src/components/MultiSelect/context.ts
|
|
948
|
+
var import_react6 = require("react");
|
|
949
|
+
var MyContext2 = (0, import_react6.createContext)(void 0);
|
|
950
|
+
function useMyContext2() {
|
|
951
|
+
var data = (0, import_react6.useContext)(MyContext2);
|
|
952
|
+
if (data === void 0) throw new Error("Select context is undefined");
|
|
953
|
+
return data;
|
|
954
|
+
}
|
|
955
|
+
// src/components/MultiSelect/Dropdown.tsx
|
|
956
|
+
var import_react7 = require("react");
|
|
957
|
+
// src/components/MultiSelect/styles.ts
|
|
958
|
+
var styles5 = {
|
|
959
|
+
select_box: {
|
|
960
|
+
borderRadius: "10px",
|
|
961
|
+
border: "solid 1px #dadada",
|
|
962
|
+
padding: "5px 10px",
|
|
963
|
+
display: "flex",
|
|
964
|
+
justifyContent: "space-between",
|
|
965
|
+
alignItems: "center",
|
|
966
|
+
cursor: "pointer"
|
|
967
|
+
},
|
|
968
|
+
value: {
|
|
969
|
+
display: "flex",
|
|
970
|
+
flexDirection: "row",
|
|
971
|
+
gap: "15px",
|
|
972
|
+
flexWrap: "wrap"
|
|
973
|
+
},
|
|
974
|
+
eachValue: {
|
|
975
|
+
borderRadius: "5px",
|
|
976
|
+
backgroundColor: "#f0f0f7",
|
|
977
|
+
padding: "5px",
|
|
978
|
+
position: "relative"
|
|
979
|
+
},
|
|
980
|
+
closeEach: {
|
|
981
|
+
position: "absolute",
|
|
982
|
+
top: 0,
|
|
983
|
+
right: 0,
|
|
984
|
+
transform: "translate(50%, -50%)",
|
|
985
|
+
borderRadius: "50%",
|
|
986
|
+
backgroundColor: "#fc2c2cf0",
|
|
987
|
+
aspectRatio: 1,
|
|
988
|
+
width: "24px",
|
|
989
|
+
display: "flex",
|
|
990
|
+
justifyContent: "center",
|
|
991
|
+
alignItems: "center",
|
|
992
|
+
color: "white",
|
|
993
|
+
transition: "scale .2s linear",
|
|
994
|
+
transformOrigin: "top right"
|
|
995
|
+
},
|
|
996
|
+
close: {
|
|
997
|
+
borderRadius: "50%",
|
|
998
|
+
width: "20px",
|
|
999
|
+
height: "20px",
|
|
1000
|
+
display: "flex",
|
|
1001
|
+
justifyContent: "center",
|
|
1002
|
+
alignItems: "center"
|
|
1003
|
+
},
|
|
1004
|
+
element: {
|
|
1005
|
+
display: "flex",
|
|
1006
|
+
padding: "5px",
|
|
1007
|
+
borderRadius: "10px",
|
|
1008
|
+
justifyContent: "flex-start",
|
|
1009
|
+
alignItems: "center",
|
|
1010
|
+
cursor: "pointer"
|
|
1011
|
+
},
|
|
1012
|
+
dropdown: {
|
|
1013
|
+
position: "absolute",
|
|
1014
|
+
boxSizing: "border-box",
|
|
1015
|
+
width: "100%",
|
|
1016
|
+
left: "0",
|
|
1017
|
+
display: "flex",
|
|
1018
|
+
flexDirection: "column",
|
|
1019
|
+
border: "solid 1px #dadada",
|
|
1020
|
+
borderRadius: "10px",
|
|
1021
|
+
padding: "5px",
|
|
1022
|
+
maxHeight: "300px",
|
|
1023
|
+
overflowY: "auto",
|
|
1024
|
+
backgroundColor: "white"
|
|
1025
|
+
},
|
|
1026
|
+
search_border: {
|
|
1027
|
+
position: "sticky",
|
|
1028
|
+
top: 0,
|
|
1029
|
+
left: 0,
|
|
1030
|
+
boxSizing: "border-box",
|
|
1031
|
+
width: "100%",
|
|
1032
|
+
backgroundColor: "white",
|
|
1033
|
+
marginBottom: "5px"
|
|
1034
|
+
},
|
|
1035
|
+
search: {
|
|
1036
|
+
width: "100%",
|
|
1037
|
+
borderRadius: "5px",
|
|
1038
|
+
padding: "5px",
|
|
1039
|
+
border: "solid 1px #dadada",
|
|
1040
|
+
display: "flex",
|
|
1041
|
+
justifyContent: "flex-start",
|
|
1042
|
+
alignItems: "center",
|
|
1043
|
+
boxSizing: "border-box"
|
|
1044
|
+
}
|
|
1045
|
+
};
|
|
1046
|
+
var styles_default5 = styles5;
|
|
1047
|
+
// src/components/MultiSelect/Search.tsx
|
|
1048
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1049
|
+
var Search2 = function(param) {
|
|
1050
|
+
var options = param.options, onSearch = param.onSearch;
|
|
1051
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", {
|
|
1052
|
+
style: styles_default5.search_border,
|
|
1053
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("input", {
|
|
1054
|
+
placeholder: "Search...",
|
|
1055
|
+
style: styles_default5.search,
|
|
1056
|
+
id: "search",
|
|
1057
|
+
name: "search",
|
|
1058
|
+
onChange: function(e) {
|
|
1059
|
+
return onSearch(options.filter(function(ele) {
|
|
1060
|
+
return ele.value.toLowerCase().includes(e.target.value.toLowerCase());
|
|
1061
|
+
}));
|
|
1062
|
+
}
|
|
1063
|
+
})
|
|
1064
|
+
});
|
|
1065
|
+
};
|
|
1066
|
+
var Search_default2 = Search2;
|
|
1067
|
+
// src/components/MultiSelect/Dropdown.tsx
|
|
1068
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1069
|
+
var Dropdown2 = function() {
|
|
1070
|
+
var _useMyContext2 = useMyContext2(), options = _useMyContext2.options, onChange = _useMyContext2.onChange, setOpen = _useMyContext2.setOpen;
|
|
1071
|
+
var _ref = _sliced_to_array((0, import_react7.useState)(true), 2), isVisible = _ref[0], setVisible = _ref[1];
|
|
1072
|
+
var _ref1 = _sliced_to_array((0, import_react7.useState)(-1), 2), keyOnHover = _ref1[0], setKeyOnHover = _ref1[1];
|
|
1073
|
+
var _ref2 = _sliced_to_array((0, import_react7.useState)(options), 2), optionsCopy = _ref2[0], setOption = _ref2[1];
|
|
1074
|
+
var dropdownRef = (0, import_react7.useRef)(null);
|
|
1075
|
+
var handleResize = function() {
|
|
1076
|
+
var dropdown = dropdownRef.current;
|
|
1077
|
+
var dimension = dropdown.getBoundingClientRect();
|
|
1078
|
+
var distanceToBottom = window.innerHeight - dimension.bottom;
|
|
1079
|
+
var distanceToTop = dimension.top;
|
|
1080
|
+
if (distanceToBottom < 0) {
|
|
1081
|
+
setVisible(false);
|
|
1082
|
+
}
|
|
1083
|
+
if (distanceToTop < 0) {
|
|
1084
|
+
setVisible(true);
|
|
1085
|
+
}
|
|
1086
|
+
};
|
|
1087
|
+
(0, import_react7.useEffect)(function() {
|
|
1088
|
+
handleResize();
|
|
1089
|
+
window.addEventListener("scroll", handleResize);
|
|
1090
|
+
return function() {
|
|
1091
|
+
window.removeEventListener("scroll", handleResize);
|
|
1092
|
+
};
|
|
1093
|
+
}, []);
|
|
1094
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", {
|
|
1095
|
+
ref: dropdownRef,
|
|
1096
|
+
style: isVisible ? _object_spread_props(_object_spread({}, styles_default5.dropdown), {
|
|
1097
|
+
top: "calc(100% + 5px)"
|
|
1098
|
+
}) : _object_spread_props(_object_spread({}, styles_default5.dropdown), {
|
|
1099
|
+
bottom: "calc(100% + 5px)"
|
|
1100
|
+
}),
|
|
1101
|
+
children: [
|
|
1102
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Search_default2, {
|
|
1103
|
+
options: options,
|
|
1104
|
+
onSearch: setOption
|
|
1105
|
+
}),
|
|
1106
|
+
optionsCopy.map(function(option, key) {
|
|
1107
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", {
|
|
1108
|
+
style: _object_spread_props(_object_spread({}, styles_default5.element), {
|
|
1109
|
+
backgroundColor: keyOnHover === key ? "#f0f0f0" : "#fff"
|
|
1110
|
+
}),
|
|
1111
|
+
onClick: function() {
|
|
1112
|
+
onChange(function(prev) {
|
|
1113
|
+
if (prev.includes(option.value)) return _to_consumable_array(prev);
|
|
1114
|
+
return _to_consumable_array(prev).concat([
|
|
1115
|
+
option.value
|
|
1116
|
+
]);
|
|
1117
|
+
});
|
|
1118
|
+
setOpen(function(prev) {
|
|
1119
|
+
return !prev;
|
|
1120
|
+
});
|
|
1121
|
+
},
|
|
1122
|
+
onMouseEnter: function() {
|
|
1123
|
+
return setKeyOnHover(key);
|
|
1124
|
+
},
|
|
1125
|
+
onMouseLeave: function() {
|
|
1126
|
+
return setKeyOnHover(-1);
|
|
1127
|
+
},
|
|
1128
|
+
children: option.label
|
|
1129
|
+
}, key);
|
|
1130
|
+
})
|
|
1131
|
+
]
|
|
1132
|
+
});
|
|
1133
|
+
};
|
|
1134
|
+
var Dropdown_default2 = Dropdown2;
|
|
1135
|
+
// src/components/MultiSelect/MultiSelect.tsx
|
|
1136
|
+
var import_io2 = require("react-icons/io");
|
|
1137
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1138
|
+
var MultiSelect = function(param) {
|
|
1139
|
+
var options = param.options, value = param.value, onChange = param.onChange, _param_width = param.width, width = _param_width === void 0 ? "200" : _param_width;
|
|
1140
|
+
var _ref = _sliced_to_array((0, import_react8.useState)(false), 2), open = _ref[0], setOpen = _ref[1];
|
|
1141
|
+
var _ref1 = _sliced_to_array((0, import_react8.useState)(false), 2), isHoverClose = _ref1[0], setHoverClose = _ref1[1];
|
|
1142
|
+
var _ref2 = _sliced_to_array((0, import_react8.useState)(-1), 2), isHoverCloseEach = _ref2[0], setHoverCloseEach = _ref2[1];
|
|
1143
|
+
var selectRef = (0, import_react8.useRef)(null);
|
|
1144
|
+
var clickHandler = function(e) {
|
|
1145
|
+
var select = selectRef.current;
|
|
1146
|
+
if (!select.contains(e.target)) {
|
|
1147
|
+
setOpen(false);
|
|
1148
|
+
}
|
|
1149
|
+
};
|
|
1150
|
+
(0, import_react8.useEffect)(function() {
|
|
1151
|
+
window.addEventListener("click", clickHandler);
|
|
1152
|
+
return function() {
|
|
1153
|
+
return window.removeEventListener("click", clickHandler);
|
|
1154
|
+
};
|
|
1155
|
+
}, []);
|
|
1156
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(MyContext2.Provider, {
|
|
1157
|
+
value: {
|
|
1158
|
+
options: options,
|
|
1159
|
+
value: value,
|
|
1160
|
+
onChange: onChange,
|
|
1161
|
+
setOpen: setOpen
|
|
1162
|
+
},
|
|
1163
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", {
|
|
1164
|
+
style: {
|
|
1165
|
+
width: "".concat(width, "px"),
|
|
1166
|
+
position: "relative"
|
|
1167
|
+
},
|
|
1168
|
+
ref: selectRef,
|
|
1169
|
+
children: [
|
|
1170
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", {
|
|
1171
|
+
style: styles_default5.select_box,
|
|
1172
|
+
onClick: function() {
|
|
1173
|
+
return setOpen(function(prev) {
|
|
1174
|
+
return !prev;
|
|
1175
|
+
});
|
|
1176
|
+
},
|
|
1177
|
+
children: [
|
|
1178
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", {
|
|
1179
|
+
style: styles_default5.value,
|
|
1180
|
+
children: value.map(function(eachValue, key) {
|
|
1181
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", {
|
|
1182
|
+
style: styles_default5.eachValue,
|
|
1183
|
+
children: [
|
|
1184
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", {
|
|
1185
|
+
onMouseEnter: function() {
|
|
1186
|
+
setHoverCloseEach(key);
|
|
1187
|
+
},
|
|
1188
|
+
onMouseLeave: function() {
|
|
1189
|
+
setHoverCloseEach(-1);
|
|
1190
|
+
},
|
|
1191
|
+
title: "Remove this option",
|
|
1192
|
+
style: _object_spread_props(_object_spread({}, styles_default5.closeEach), {
|
|
1193
|
+
scale: isHoverCloseEach === key ? "1.2" : "1"
|
|
1194
|
+
}),
|
|
1195
|
+
onClick: function() {
|
|
1196
|
+
onChange(function(prev) {
|
|
1197
|
+
return prev.filter(function(o) {
|
|
1198
|
+
return o !== eachValue;
|
|
1199
|
+
});
|
|
1200
|
+
});
|
|
1201
|
+
setOpen(function(prev) {
|
|
1202
|
+
return !prev;
|
|
1203
|
+
});
|
|
1204
|
+
},
|
|
1205
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_io2.IoMdClose, {})
|
|
1206
|
+
}),
|
|
1207
|
+
eachValue
|
|
1208
|
+
]
|
|
1209
|
+
}, key);
|
|
1210
|
+
})
|
|
1211
|
+
}),
|
|
1212
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", {
|
|
1213
|
+
style: _object_spread_props(_object_spread({}, styles_default5.close), {
|
|
1214
|
+
backgroundColor: isHoverClose ? "#f0f0f0" : "#fff"
|
|
1215
|
+
}),
|
|
1216
|
+
title: "Clear all",
|
|
1217
|
+
onClick: function() {
|
|
1218
|
+
onChange([]);
|
|
1219
|
+
setOpen(function(prev) {
|
|
1220
|
+
return !prev;
|
|
1221
|
+
});
|
|
1222
|
+
},
|
|
1223
|
+
onMouseEnter: function() {
|
|
1224
|
+
return setHoverClose(true);
|
|
1225
|
+
},
|
|
1226
|
+
onMouseLeave: function() {
|
|
1227
|
+
return setHoverClose(false);
|
|
1228
|
+
},
|
|
1229
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_io2.IoMdClose, {})
|
|
1230
|
+
})
|
|
1231
|
+
]
|
|
1232
|
+
}),
|
|
1233
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Dropdown_default2, {})
|
|
1234
|
+
]
|
|
1235
|
+
})
|
|
1236
|
+
});
|
|
1237
|
+
};
|
|
1238
|
+
var MultiSelect_default = MultiSelect;
|
|
1239
|
+
// src/components/Buttons/Button.tsx
|
|
1240
|
+
var import_react9 = require("react");
|
|
1241
|
+
// src/components/Buttons/gradient/Gradient.tsx
|
|
1242
|
+
var import_framer_motion = require("framer-motion");
|
|
1243
|
+
// src/components/Buttons/gradient/styles.ts
|
|
1244
|
+
var borderRadius = "20px";
|
|
1245
|
+
var styles6 = function(first, second) {
|
|
1246
|
+
var styles8 = {
|
|
1247
|
+
container: {
|
|
1248
|
+
position: "relative",
|
|
1249
|
+
borderRadius: borderRadius,
|
|
1250
|
+
padding: "3px"
|
|
1251
|
+
},
|
|
1252
|
+
btn: {
|
|
1253
|
+
position: "relative",
|
|
1254
|
+
zIndex: 1,
|
|
1255
|
+
display: "flex",
|
|
1256
|
+
justifyContent: "center",
|
|
1257
|
+
alignItems: "center",
|
|
1258
|
+
padding: "2px",
|
|
1259
|
+
borderRadius: borderRadius,
|
|
1260
|
+
backgroundColor: "".concat(first),
|
|
1261
|
+
backgroundImage: "linear-gradient(43deg, ".concat(first, " 0%, ").concat(second, " 100%)"),
|
|
1262
|
+
border: "none",
|
|
1263
|
+
cursor: "pointer"
|
|
1264
|
+
},
|
|
1265
|
+
btnAfter: {
|
|
1266
|
+
position: "absolute",
|
|
1267
|
+
top: 0,
|
|
1268
|
+
left: 0,
|
|
1269
|
+
width: "100%",
|
|
1270
|
+
height: "100%",
|
|
1271
|
+
content: '""',
|
|
1272
|
+
zIndex: 0,
|
|
1273
|
+
backgroundColor: "".concat(first),
|
|
1274
|
+
backgroundImage: "linear-gradient(43deg, ".concat(first, " 0%, ").concat(second, " 100%)"),
|
|
1275
|
+
filter: "blur(10px)"
|
|
1276
|
+
},
|
|
1277
|
+
label: {
|
|
1278
|
+
backgroundColor: "#111723",
|
|
1279
|
+
borderRadius: borderRadius,
|
|
1280
|
+
padding: "0.5rem 2rem",
|
|
1281
|
+
color: "white"
|
|
1282
|
+
},
|
|
1283
|
+
labelBefore: {
|
|
1284
|
+
position: "absolute",
|
|
1285
|
+
top: "20%",
|
|
1286
|
+
right: "50%",
|
|
1287
|
+
width: "50%",
|
|
1288
|
+
height: "50%",
|
|
1289
|
+
content: '""',
|
|
1290
|
+
zIndex: 0,
|
|
1291
|
+
backgroundColor: "".concat(first),
|
|
1292
|
+
filter: "blur(15px)"
|
|
1293
|
+
},
|
|
1294
|
+
labelAfter: {
|
|
1295
|
+
position: "absolute",
|
|
1296
|
+
top: "20%",
|
|
1297
|
+
left: "50%",
|
|
1298
|
+
width: "50%",
|
|
1299
|
+
height: "50%",
|
|
1300
|
+
content: '""',
|
|
1301
|
+
zIndex: 0,
|
|
1302
|
+
backgroundColor: "".concat(second),
|
|
1303
|
+
filter: "blur(20px)"
|
|
1304
|
+
},
|
|
1305
|
+
p: {
|
|
1306
|
+
position: "relative",
|
|
1307
|
+
zIndex: 1,
|
|
1308
|
+
margin: 0
|
|
1309
|
+
},
|
|
1310
|
+
neon: {
|
|
1311
|
+
content: '""',
|
|
1312
|
+
background: "conic-gradient(transparent 270deg, green, transparent)",
|
|
1313
|
+
position: "absolute",
|
|
1314
|
+
top: "50%",
|
|
1315
|
+
left: "50%",
|
|
1316
|
+
transform: "translate(-50%, -50%)",
|
|
1317
|
+
aspectRatio: 1,
|
|
1318
|
+
width: "100%"
|
|
1319
|
+
}
|
|
1320
|
+
};
|
|
1321
|
+
return styles8;
|
|
1322
|
+
};
|
|
1323
|
+
var styles_default6 = styles6;
|
|
1324
|
+
// src/components/Buttons/gradient/Gradient.tsx
|
|
1325
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1326
|
+
var Gradient = function() {
|
|
1327
|
+
var data = useButtonContext();
|
|
1328
|
+
var styles8 = styles_default6(data.first, data.second);
|
|
1329
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", {
|
|
1330
|
+
style: _object_spread_props(_object_spread({}, styles8.container), {
|
|
1331
|
+
overflow: data.isLoading ? "hidden" : ""
|
|
1332
|
+
}),
|
|
1333
|
+
children: [
|
|
1334
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", _object_spread_props(_object_spread({
|
|
1335
|
+
style: styles8.btn
|
|
1336
|
+
}, data.props), {
|
|
1337
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", {
|
|
1338
|
+
style: {
|
|
1339
|
+
position: "relative"
|
|
1340
|
+
},
|
|
1341
|
+
children: [
|
|
1342
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", {
|
|
1343
|
+
style: styles8.labelBefore
|
|
1344
|
+
}),
|
|
1345
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", {
|
|
1346
|
+
style: _object_spread_props(_object_spread({}, styles8.label), {
|
|
1347
|
+
backgroundColor: data.main
|
|
1348
|
+
}),
|
|
1349
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", {
|
|
1350
|
+
style: _object_spread_props(_object_spread({}, styles8.p), {
|
|
1351
|
+
color: "".concat(data.text)
|
|
1352
|
+
}),
|
|
1353
|
+
children: data.content
|
|
1354
|
+
})
|
|
1355
|
+
}),
|
|
1356
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", {
|
|
1357
|
+
style: styles8.labelAfter
|
|
1358
|
+
})
|
|
1359
|
+
]
|
|
1360
|
+
})
|
|
1361
|
+
})),
|
|
1362
|
+
!data.isLoading && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", {
|
|
1363
|
+
style: styles8.btnAfter
|
|
1364
|
+
}),
|
|
1365
|
+
data.isLoading && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_framer_motion.motion.div, {
|
|
1366
|
+
style: styles8.btnAfter,
|
|
1367
|
+
animate: {
|
|
1368
|
+
rotate: 360
|
|
1369
|
+
},
|
|
1370
|
+
transition: {
|
|
1371
|
+
ease: "linear",
|
|
1372
|
+
repeat: Infinity,
|
|
1373
|
+
duration: 3
|
|
1374
|
+
}
|
|
1375
|
+
})
|
|
1376
|
+
]
|
|
1377
|
+
});
|
|
1378
|
+
};
|
|
1379
|
+
var Gradient_default = Gradient;
|
|
1380
|
+
// src/components/Buttons/solid/styles.ts
|
|
1381
|
+
var styles7 = function(first) {
|
|
1382
|
+
var styles8 = {
|
|
1383
|
+
"btn": {
|
|
1384
|
+
cursor: "pointer",
|
|
1385
|
+
position: "relative",
|
|
1386
|
+
zIndex: 0,
|
|
1387
|
+
display: "flex",
|
|
1388
|
+
justifyContent: "center",
|
|
1389
|
+
alignItems: "center",
|
|
1390
|
+
padding: "2px",
|
|
1391
|
+
borderRadius: "0.75rem",
|
|
1392
|
+
backgroundColor: first,
|
|
1393
|
+
border: "none"
|
|
1394
|
+
},
|
|
1395
|
+
"btnAfter": {
|
|
1396
|
+
position: "absolute",
|
|
1397
|
+
top: 0,
|
|
1398
|
+
left: 0,
|
|
1399
|
+
width: "100%",
|
|
1400
|
+
height: "100%",
|
|
1401
|
+
zIndex: -1,
|
|
1402
|
+
backgroundColor: first,
|
|
1403
|
+
filter: "blur(10px)"
|
|
1404
|
+
},
|
|
1405
|
+
"label": {
|
|
1406
|
+
borderRadius: "0.75rem",
|
|
1407
|
+
padding: "0.5rem 2rem",
|
|
1408
|
+
color: "white"
|
|
1409
|
+
},
|
|
1410
|
+
"labelBefore": {
|
|
1411
|
+
position: "absolute",
|
|
1412
|
+
top: "20%",
|
|
1413
|
+
right: "50%",
|
|
1414
|
+
width: "50%",
|
|
1415
|
+
height: "50%",
|
|
1416
|
+
content: '""',
|
|
1417
|
+
// See note below
|
|
1418
|
+
zIndex: 0,
|
|
1419
|
+
backgroundColor: first,
|
|
1420
|
+
filter: "blur(15px)"
|
|
1421
|
+
},
|
|
1422
|
+
"labelAfter": {
|
|
1423
|
+
position: "absolute",
|
|
1424
|
+
top: "20%",
|
|
1425
|
+
left: "50%",
|
|
1426
|
+
width: "50%",
|
|
1427
|
+
height: "50%",
|
|
1428
|
+
content: '""',
|
|
1429
|
+
// See note below
|
|
1430
|
+
zIndex: 0,
|
|
1431
|
+
filter: "blur(20px)"
|
|
1432
|
+
},
|
|
1433
|
+
"p": {
|
|
1434
|
+
zIndex: 1,
|
|
1435
|
+
position: "relative",
|
|
1436
|
+
margin: 0
|
|
1437
|
+
}
|
|
1438
|
+
};
|
|
1439
|
+
return styles8;
|
|
1440
|
+
};
|
|
1441
|
+
var styles_default7 = styles7;
|
|
1442
|
+
// src/components/Buttons/solid/Solid.tsx
|
|
1443
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1444
|
+
var Solid = function() {
|
|
1445
|
+
var data = useButtonContext();
|
|
1446
|
+
var styles8 = styles_default7(data.first);
|
|
1447
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", {
|
|
1448
|
+
style: {
|
|
1449
|
+
position: "relative"
|
|
1450
|
+
},
|
|
1451
|
+
children: [
|
|
1452
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", _object_spread_props(_object_spread({
|
|
1453
|
+
style: styles8.btn
|
|
1454
|
+
}, data.props), {
|
|
1455
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", {
|
|
1456
|
+
style: {
|
|
1457
|
+
position: "relative"
|
|
1458
|
+
},
|
|
1459
|
+
children: [
|
|
1460
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", {
|
|
1461
|
+
style: styles8.labelBefore
|
|
1462
|
+
}),
|
|
1463
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", {
|
|
1464
|
+
style: _object_spread_props(_object_spread({}, styles8.label), {
|
|
1465
|
+
backgroundColor: data.main
|
|
1466
|
+
}),
|
|
1467
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", {
|
|
1468
|
+
style: _object_spread_props(_object_spread({}, styles8.p), {
|
|
1469
|
+
color: "".concat(data.text)
|
|
1470
|
+
}),
|
|
1471
|
+
children: data.content
|
|
1472
|
+
})
|
|
1473
|
+
}),
|
|
1474
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", {
|
|
1475
|
+
style: styles8.labelAfter
|
|
1476
|
+
})
|
|
1477
|
+
]
|
|
1478
|
+
})
|
|
1479
|
+
})),
|
|
1480
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", {
|
|
1481
|
+
style: styles8.btnAfter
|
|
1482
|
+
})
|
|
1483
|
+
]
|
|
1484
|
+
});
|
|
1485
|
+
};
|
|
1486
|
+
var Solid_default = Solid;
|
|
1487
|
+
// src/components/Buttons/Button.tsx
|
|
1488
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1489
|
+
var ButtonContext = (0, import_react9.createContext)(void 0);
|
|
1490
|
+
function useButtonContext() {
|
|
1491
|
+
var data = (0, import_react9.useContext)(ButtonContext);
|
|
1492
|
+
if (data === void 0) {
|
|
1493
|
+
throw new Error("Select Context is undefined");
|
|
1494
|
+
}
|
|
1495
|
+
return data;
|
|
1496
|
+
}
|
|
1497
|
+
var Button = function(_param) {
|
|
1498
|
+
var _param_buttonType = _param.buttonType, buttonType = _param_buttonType === void 0 ? "normal" : _param_buttonType, content = _param.content, _param_main = _param.main, main = _param_main === void 0 ? "#111723" : _param_main, _param_first = _param.first, first = _param_first === void 0 ? "#3e8fbc" : _param_first, _param_second = _param.second, second = _param_second === void 0 ? "#aa6392" : _param_second, _param_text = _param.text, text = _param_text === void 0 ? "#fff" : _param_text, _param_isLoading = _param.isLoading, isLoading = _param_isLoading === void 0 ? false : _param_isLoading, props = _object_without_properties(_param, [
|
|
1499
|
+
"buttonType",
|
|
1500
|
+
"content",
|
|
1501
|
+
"main",
|
|
1502
|
+
"first",
|
|
1503
|
+
"second",
|
|
1504
|
+
"text",
|
|
1505
|
+
"isLoading"
|
|
1506
|
+
]);
|
|
1507
|
+
switch(buttonType){
|
|
1508
|
+
case "gradient":
|
|
1509
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ButtonContext.Provider, {
|
|
1510
|
+
value: {
|
|
1511
|
+
content: content,
|
|
1512
|
+
main: main,
|
|
1513
|
+
first: first,
|
|
1514
|
+
second: second,
|
|
1515
|
+
text: text,
|
|
1516
|
+
props: props,
|
|
1517
|
+
isLoading: isLoading
|
|
1518
|
+
},
|
|
1519
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Gradient_default, {})
|
|
1520
|
+
});
|
|
1521
|
+
case "solid":
|
|
1522
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ButtonContext.Provider, {
|
|
1523
|
+
value: {
|
|
1524
|
+
content: content,
|
|
1525
|
+
main: main,
|
|
1526
|
+
first: first,
|
|
1527
|
+
text: text,
|
|
1528
|
+
props: props,
|
|
1529
|
+
isLoading: isLoading
|
|
1530
|
+
},
|
|
1531
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Solid_default, {})
|
|
1532
|
+
});
|
|
1533
|
+
default:
|
|
1534
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", _object_spread_props(_object_spread({}, props), {
|
|
1535
|
+
children: content
|
|
1536
|
+
}));
|
|
1537
|
+
}
|
|
1538
|
+
};
|
|
1539
|
+
var Button_default = Button;
|
|
900
1540
|
// Annotate the CommonJS export names for ESM import in node:
|
|
901
1541
|
0 && (module.exports = {
|
|
1542
|
+
Button: Button,
|
|
902
1543
|
ColorPickerSlider: ColorPickerSlider,
|
|
903
1544
|
DropdownSelect: DropdownSelect,
|
|
1545
|
+
MultiSelect: MultiSelect,
|
|
904
1546
|
OptionSlider: OptionSlider,
|
|
905
1547
|
RangeSlider: RangeSlider
|
|
906
1548
|
});
|