contentoh-components-library 21.6.25 → 21.6.26
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/components/molecules/SingleSelect/index.js +198 -0
- package/dist/components/molecules/SingleSelect/styles.js +74 -0
- package/dist/components/organisms/LinkVariantsModal/index.js +90 -103
- package/dist/components/organisms/LinkVariantsModal/styles.js +1 -1
- package/dist/index.js +43 -30
- package/package.json +1 -1
- package/src/components/molecules/SingleSelect/index.js +183 -0
- package/src/components/molecules/SingleSelect/styles.js +132 -0
- package/src/components/organisms/LinkVariantsModal/index.js +110 -118
- package/src/components/organisms/LinkVariantsModal/styles.js +3 -19
- package/src/index.js +1 -0
package/dist/index.js
CHANGED
|
@@ -862,7 +862,7 @@ Object.keys(_index65).forEach(function (key) {
|
|
|
862
862
|
});
|
|
863
863
|
});
|
|
864
864
|
|
|
865
|
-
var _index66 = require("./components/molecules/
|
|
865
|
+
var _index66 = require("./components/molecules/SingleSelect/index");
|
|
866
866
|
|
|
867
867
|
Object.keys(_index66).forEach(function (key) {
|
|
868
868
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -875,7 +875,7 @@ Object.keys(_index66).forEach(function (key) {
|
|
|
875
875
|
});
|
|
876
876
|
});
|
|
877
877
|
|
|
878
|
-
var _index67 = require("./components/molecules/
|
|
878
|
+
var _index67 = require("./components/molecules/ButtonDownloadFile/index");
|
|
879
879
|
|
|
880
880
|
Object.keys(_index67).forEach(function (key) {
|
|
881
881
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -888,7 +888,7 @@ Object.keys(_index67).forEach(function (key) {
|
|
|
888
888
|
});
|
|
889
889
|
});
|
|
890
890
|
|
|
891
|
-
var _index68 = require("./components/molecules/
|
|
891
|
+
var _index68 = require("./components/molecules/ImageTooltip/index");
|
|
892
892
|
|
|
893
893
|
Object.keys(_index68).forEach(function (key) {
|
|
894
894
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -901,7 +901,7 @@ Object.keys(_index68).forEach(function (key) {
|
|
|
901
901
|
});
|
|
902
902
|
});
|
|
903
903
|
|
|
904
|
-
var _index69 = require("./components/molecules/
|
|
904
|
+
var _index69 = require("./components/molecules/SelectV2/index");
|
|
905
905
|
|
|
906
906
|
Object.keys(_index69).forEach(function (key) {
|
|
907
907
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -914,7 +914,7 @@ Object.keys(_index69).forEach(function (key) {
|
|
|
914
914
|
});
|
|
915
915
|
});
|
|
916
916
|
|
|
917
|
-
var _index70 = require("./components/molecules/
|
|
917
|
+
var _index70 = require("./components/molecules/Dropdown/index");
|
|
918
918
|
|
|
919
919
|
Object.keys(_index70).forEach(function (key) {
|
|
920
920
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -927,7 +927,7 @@ Object.keys(_index70).forEach(function (key) {
|
|
|
927
927
|
});
|
|
928
928
|
});
|
|
929
929
|
|
|
930
|
-
var _index71 = require("./components/molecules/
|
|
930
|
+
var _index71 = require("./components/molecules/StripeCardForm/index");
|
|
931
931
|
|
|
932
932
|
Object.keys(_index71).forEach(function (key) {
|
|
933
933
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -940,7 +940,7 @@ Object.keys(_index71).forEach(function (key) {
|
|
|
940
940
|
});
|
|
941
941
|
});
|
|
942
942
|
|
|
943
|
-
var _index72 = require("./components/molecules/
|
|
943
|
+
var _index72 = require("./components/molecules/StripeCardSelector/index");
|
|
944
944
|
|
|
945
945
|
Object.keys(_index72).forEach(function (key) {
|
|
946
946
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -953,7 +953,7 @@ Object.keys(_index72).forEach(function (key) {
|
|
|
953
953
|
});
|
|
954
954
|
});
|
|
955
955
|
|
|
956
|
-
var _index73 = require("./components/molecules/
|
|
956
|
+
var _index73 = require("./components/molecules/GridItem/index");
|
|
957
957
|
|
|
958
958
|
Object.keys(_index73).forEach(function (key) {
|
|
959
959
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -966,7 +966,7 @@ Object.keys(_index73).forEach(function (key) {
|
|
|
966
966
|
});
|
|
967
967
|
});
|
|
968
968
|
|
|
969
|
-
var _index74 = require("./components/molecules/
|
|
969
|
+
var _index74 = require("./components/molecules/HeaderItem/index");
|
|
970
970
|
|
|
971
971
|
Object.keys(_index74).forEach(function (key) {
|
|
972
972
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -979,7 +979,7 @@ Object.keys(_index74).forEach(function (key) {
|
|
|
979
979
|
});
|
|
980
980
|
});
|
|
981
981
|
|
|
982
|
-
var _index75 = require("./components/
|
|
982
|
+
var _index75 = require("./components/molecules/RowItem/index");
|
|
983
983
|
|
|
984
984
|
Object.keys(_index75).forEach(function (key) {
|
|
985
985
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -992,7 +992,7 @@ Object.keys(_index75).forEach(function (key) {
|
|
|
992
992
|
});
|
|
993
993
|
});
|
|
994
994
|
|
|
995
|
-
var _index76 = require("./components/organisms/
|
|
995
|
+
var _index76 = require("./components/organisms/ChangePassword/index");
|
|
996
996
|
|
|
997
997
|
Object.keys(_index76).forEach(function (key) {
|
|
998
998
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -1005,7 +1005,7 @@ Object.keys(_index76).forEach(function (key) {
|
|
|
1005
1005
|
});
|
|
1006
1006
|
});
|
|
1007
1007
|
|
|
1008
|
-
var _index77 = require("./components/organisms/
|
|
1008
|
+
var _index77 = require("./components/organisms/Fullplan/index");
|
|
1009
1009
|
|
|
1010
1010
|
Object.keys(_index77).forEach(function (key) {
|
|
1011
1011
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -1018,7 +1018,7 @@ Object.keys(_index77).forEach(function (key) {
|
|
|
1018
1018
|
});
|
|
1019
1019
|
});
|
|
1020
1020
|
|
|
1021
|
-
var _index78 = require("./components/organisms/
|
|
1021
|
+
var _index78 = require("./components/organisms/FullProductNameHeader/index");
|
|
1022
1022
|
|
|
1023
1023
|
Object.keys(_index78).forEach(function (key) {
|
|
1024
1024
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -1031,7 +1031,7 @@ Object.keys(_index78).forEach(function (key) {
|
|
|
1031
1031
|
});
|
|
1032
1032
|
});
|
|
1033
1033
|
|
|
1034
|
-
var _index79 = require("./components/organisms/
|
|
1034
|
+
var _index79 = require("./components/organisms/FullTabsMenu/index");
|
|
1035
1035
|
|
|
1036
1036
|
Object.keys(_index79).forEach(function (key) {
|
|
1037
1037
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -1044,7 +1044,7 @@ Object.keys(_index79).forEach(function (key) {
|
|
|
1044
1044
|
});
|
|
1045
1045
|
});
|
|
1046
1046
|
|
|
1047
|
-
var _index80 = require("./components/organisms/
|
|
1047
|
+
var _index80 = require("./components/organisms/ImageDataTable/index");
|
|
1048
1048
|
|
|
1049
1049
|
Object.keys(_index80).forEach(function (key) {
|
|
1050
1050
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -1057,7 +1057,7 @@ Object.keys(_index80).forEach(function (key) {
|
|
|
1057
1057
|
});
|
|
1058
1058
|
});
|
|
1059
1059
|
|
|
1060
|
-
var _index81 = require("./components/organisms/
|
|
1060
|
+
var _index81 = require("./components/organisms/ImagePreviewer/index");
|
|
1061
1061
|
|
|
1062
1062
|
Object.keys(_index81).forEach(function (key) {
|
|
1063
1063
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -1070,7 +1070,7 @@ Object.keys(_index81).forEach(function (key) {
|
|
|
1070
1070
|
});
|
|
1071
1071
|
});
|
|
1072
1072
|
|
|
1073
|
-
var _index82 = require("./components/organisms/
|
|
1073
|
+
var _index82 = require("./components/organisms/ImagesGroup/index");
|
|
1074
1074
|
|
|
1075
1075
|
Object.keys(_index82).forEach(function (key) {
|
|
1076
1076
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -1083,7 +1083,7 @@ Object.keys(_index82).forEach(function (key) {
|
|
|
1083
1083
|
});
|
|
1084
1084
|
});
|
|
1085
1085
|
|
|
1086
|
-
var _index83 = require("./components/organisms/
|
|
1086
|
+
var _index83 = require("./components/organisms/InputGroup/index");
|
|
1087
1087
|
|
|
1088
1088
|
Object.keys(_index83).forEach(function (key) {
|
|
1089
1089
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -1096,7 +1096,7 @@ Object.keys(_index83).forEach(function (key) {
|
|
|
1096
1096
|
});
|
|
1097
1097
|
});
|
|
1098
1098
|
|
|
1099
|
-
var _index84 = require("./components/organisms/
|
|
1099
|
+
var _index84 = require("./components/organisms/LinkVariantsModal/index");
|
|
1100
1100
|
|
|
1101
1101
|
Object.keys(_index84).forEach(function (key) {
|
|
1102
1102
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -1109,7 +1109,7 @@ Object.keys(_index84).forEach(function (key) {
|
|
|
1109
1109
|
});
|
|
1110
1110
|
});
|
|
1111
1111
|
|
|
1112
|
-
var _index85 = require("./components/organisms/
|
|
1112
|
+
var _index85 = require("./components/organisms/ProductImageModal/index");
|
|
1113
1113
|
|
|
1114
1114
|
Object.keys(_index85).forEach(function (key) {
|
|
1115
1115
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -1122,7 +1122,7 @@ Object.keys(_index85).forEach(function (key) {
|
|
|
1122
1122
|
});
|
|
1123
1123
|
});
|
|
1124
1124
|
|
|
1125
|
-
var _index86 = require("./components/organisms/
|
|
1125
|
+
var _index86 = require("./components/organisms/Chat/index");
|
|
1126
1126
|
|
|
1127
1127
|
Object.keys(_index86).forEach(function (key) {
|
|
1128
1128
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -1135,7 +1135,7 @@ Object.keys(_index86).forEach(function (key) {
|
|
|
1135
1135
|
});
|
|
1136
1136
|
});
|
|
1137
1137
|
|
|
1138
|
-
var _index87 = require("./components/organisms/
|
|
1138
|
+
var _index87 = require("./components/organisms/Modal/index");
|
|
1139
1139
|
|
|
1140
1140
|
Object.keys(_index87).forEach(function (key) {
|
|
1141
1141
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -1148,6 +1148,19 @@ Object.keys(_index87).forEach(function (key) {
|
|
|
1148
1148
|
});
|
|
1149
1149
|
});
|
|
1150
1150
|
|
|
1151
|
+
var _index88 = require("./components/organisms/OrderDetail/index");
|
|
1152
|
+
|
|
1153
|
+
Object.keys(_index88).forEach(function (key) {
|
|
1154
|
+
if (key === "default" || key === "__esModule") return;
|
|
1155
|
+
if (key in exports && exports[key] === _index88[key]) return;
|
|
1156
|
+
Object.defineProperty(exports, key, {
|
|
1157
|
+
enumerable: true,
|
|
1158
|
+
get: function get() {
|
|
1159
|
+
return _index88[key];
|
|
1160
|
+
}
|
|
1161
|
+
});
|
|
1162
|
+
});
|
|
1163
|
+
|
|
1151
1164
|
var _RangeCalendar = require("./components/organisms/RangeCalendar");
|
|
1152
1165
|
|
|
1153
1166
|
Object.keys(_RangeCalendar).forEach(function (key) {
|
|
@@ -1174,28 +1187,28 @@ Object.keys(_TableResizable).forEach(function (key) {
|
|
|
1174
1187
|
});
|
|
1175
1188
|
});
|
|
1176
1189
|
|
|
1177
|
-
var
|
|
1190
|
+
var _index89 = require("./components/organisms/SideModal/index");
|
|
1178
1191
|
|
|
1179
|
-
Object.keys(
|
|
1192
|
+
Object.keys(_index89).forEach(function (key) {
|
|
1180
1193
|
if (key === "default" || key === "__esModule") return;
|
|
1181
|
-
if (key in exports && exports[key] ===
|
|
1194
|
+
if (key in exports && exports[key] === _index89[key]) return;
|
|
1182
1195
|
Object.defineProperty(exports, key, {
|
|
1183
1196
|
enumerable: true,
|
|
1184
1197
|
get: function get() {
|
|
1185
|
-
return
|
|
1198
|
+
return _index89[key];
|
|
1186
1199
|
}
|
|
1187
1200
|
});
|
|
1188
1201
|
});
|
|
1189
1202
|
|
|
1190
|
-
var
|
|
1203
|
+
var _index90 = require("./components/organisms/GridProducts/index");
|
|
1191
1204
|
|
|
1192
|
-
Object.keys(
|
|
1205
|
+
Object.keys(_index90).forEach(function (key) {
|
|
1193
1206
|
if (key === "default" || key === "__esModule") return;
|
|
1194
|
-
if (key in exports && exports[key] ===
|
|
1207
|
+
if (key in exports && exports[key] === _index90[key]) return;
|
|
1195
1208
|
Object.defineProperty(exports, key, {
|
|
1196
1209
|
enumerable: true,
|
|
1197
1210
|
get: function get() {
|
|
1198
|
-
return
|
|
1211
|
+
return _index90[key];
|
|
1199
1212
|
}
|
|
1200
1213
|
});
|
|
1201
1214
|
});
|
package/package.json
CHANGED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { useRef, useState, useEffect } from "react";
|
|
2
|
+
import {
|
|
3
|
+
SelectWrapper,
|
|
4
|
+
SelectBase,
|
|
5
|
+
Arrow,
|
|
6
|
+
Options,
|
|
7
|
+
OptionItem,
|
|
8
|
+
SelectedOptionItem,
|
|
9
|
+
} from "./styles";
|
|
10
|
+
|
|
11
|
+
/*
|
|
12
|
+
Select de opción única con búsqueda escribiendo.
|
|
13
|
+
|
|
14
|
+
Es el CustomSelect que la aplicación usa en el alta de productos, traído a la
|
|
15
|
+
librería para que las pantallas que viven aquí no tengan que caer en el <select>
|
|
16
|
+
del sistema, que se ve ajeno al resto de la plataforma.
|
|
17
|
+
|
|
18
|
+
Se llama distinto porque la librería ya exporta un `CustomSelect`: aquel es un
|
|
19
|
+
filtro de selección múltiple con calendario, otra cosa. Compartir nombre habría
|
|
20
|
+
roto el export global.
|
|
21
|
+
|
|
22
|
+
Tres cambios respecto al original, todos porque aquí el entorno es otro:
|
|
23
|
+
el ancho es flexible en vez de 210px fijos —en el modal van tres en fila—, los
|
|
24
|
+
colores salen de las variables de la librería en lugar de `var(--gray)`, y la
|
|
25
|
+
flecha va dibujada porque la fuente de iconos de Material la carga la
|
|
26
|
+
aplicación, no esta librería.
|
|
27
|
+
|
|
28
|
+
props:
|
|
29
|
+
- options: [{ label, value }]
|
|
30
|
+
- value: el value seleccionado
|
|
31
|
+
- onChange: recibe el value elegido, o null al limpiar
|
|
32
|
+
- placeholder, disabled, loading
|
|
33
|
+
*/
|
|
34
|
+
export const SingleSelect = ({
|
|
35
|
+
id,
|
|
36
|
+
className,
|
|
37
|
+
placeholder = "Selecciona una opción",
|
|
38
|
+
options = [],
|
|
39
|
+
onChange,
|
|
40
|
+
loading = false,
|
|
41
|
+
value = "",
|
|
42
|
+
disabled = false,
|
|
43
|
+
}) => {
|
|
44
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
45
|
+
const [selectedValue, setSelectedValue] = useState(value);
|
|
46
|
+
const [inputValue, setInputValue] = useState("");
|
|
47
|
+
|
|
48
|
+
const wrapperRef = useRef(null);
|
|
49
|
+
const inputRef = useRef(null);
|
|
50
|
+
|
|
51
|
+
const selectedOption = options.find(
|
|
52
|
+
(option) => `${option?.value}` === `${selectedValue}`
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
const filteredOptions = loading
|
|
56
|
+
? []
|
|
57
|
+
: options.filter((option) =>
|
|
58
|
+
(option?.label ?? "").toLowerCase().includes(inputValue.toLowerCase())
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
const handleSelect = (option) => {
|
|
62
|
+
setSelectedValue(option?.value);
|
|
63
|
+
setInputValue("");
|
|
64
|
+
onChange?.(option?.value);
|
|
65
|
+
setIsOpen(false);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const clearSelected = () => {
|
|
69
|
+
setSelectedValue("");
|
|
70
|
+
setInputValue("");
|
|
71
|
+
onChange?.(null);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
const handleClickOutside = (event) => {
|
|
76
|
+
if (wrapperRef.current && !wrapperRef.current.contains(event.target)) {
|
|
77
|
+
setIsOpen(false);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
82
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
83
|
+
}, []);
|
|
84
|
+
|
|
85
|
+
// Al deshabilitarse se limpia: un nivel de cascada que se apaga no puede
|
|
86
|
+
// quedarse mostrando la elección anterior, que ya no significa nada.
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
if (disabled) {
|
|
89
|
+
setSelectedValue("");
|
|
90
|
+
setInputValue("");
|
|
91
|
+
}
|
|
92
|
+
}, [disabled]);
|
|
93
|
+
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
setSelectedValue(value);
|
|
96
|
+
}, [value]);
|
|
97
|
+
|
|
98
|
+
return (
|
|
99
|
+
<SelectWrapper id={id} className={className} ref={wrapperRef}>
|
|
100
|
+
<SelectBase
|
|
101
|
+
disabled={disabled}
|
|
102
|
+
className="selectBase"
|
|
103
|
+
onClick={() => {
|
|
104
|
+
if (!disabled && !isOpen) setIsOpen(true);
|
|
105
|
+
}}
|
|
106
|
+
>
|
|
107
|
+
<div>
|
|
108
|
+
{selectedOption ? (
|
|
109
|
+
<SelectedOptionItem title={selectedOption?.label}>
|
|
110
|
+
<p>{selectedOption?.label}</p>
|
|
111
|
+
</SelectedOptionItem>
|
|
112
|
+
) : null}
|
|
113
|
+
|
|
114
|
+
<input
|
|
115
|
+
type="text"
|
|
116
|
+
placeholder={selectedOption ? "" : placeholder}
|
|
117
|
+
value={inputValue}
|
|
118
|
+
disabled={disabled}
|
|
119
|
+
ref={inputRef}
|
|
120
|
+
onChange={(event) => setInputValue(event.target.value)}
|
|
121
|
+
onFocus={() => {
|
|
122
|
+
if (!isOpen) setIsOpen(true);
|
|
123
|
+
}}
|
|
124
|
+
onKeyDown={(event) => {
|
|
125
|
+
const esBorrar = event.key === "Backspace";
|
|
126
|
+
const vacio = (inputRef.current?.value || "") === "";
|
|
127
|
+
|
|
128
|
+
if (!isOpen) setIsOpen(true);
|
|
129
|
+
|
|
130
|
+
// Borrar con el campo vacío deshace la elección, que es lo que
|
|
131
|
+
// espera quien escribe para cambiarla.
|
|
132
|
+
if (esBorrar && vacio && selectedValue !== "") clearSelected();
|
|
133
|
+
|
|
134
|
+
if (event.key === "Enter" && filteredOptions.length > 0) {
|
|
135
|
+
event.preventDefault();
|
|
136
|
+
handleSelect(filteredOptions[0]);
|
|
137
|
+
}
|
|
138
|
+
}}
|
|
139
|
+
onBlur={() => {
|
|
140
|
+
setTimeout(() => {
|
|
141
|
+
if (
|
|
142
|
+
wrapperRef.current &&
|
|
143
|
+
!wrapperRef.current.contains(document.activeElement)
|
|
144
|
+
) {
|
|
145
|
+
setIsOpen(false);
|
|
146
|
+
}
|
|
147
|
+
}, 0);
|
|
148
|
+
}}
|
|
149
|
+
/>
|
|
150
|
+
</div>
|
|
151
|
+
|
|
152
|
+
<Arrow aria-hidden="true">▼</Arrow>
|
|
153
|
+
</SelectBase>
|
|
154
|
+
|
|
155
|
+
<Options open={isOpen} data-testid="options">
|
|
156
|
+
{filteredOptions.length > 0 ? (
|
|
157
|
+
filteredOptions.map((option) => (
|
|
158
|
+
<OptionItem
|
|
159
|
+
key={option?.value}
|
|
160
|
+
selected={`${option?.value}` === `${selectedValue}`}
|
|
161
|
+
onClick={() => handleSelect(option)}
|
|
162
|
+
className={
|
|
163
|
+
inputValue.trim() !== "" && option === filteredOptions[0]
|
|
164
|
+
? "first"
|
|
165
|
+
: ""
|
|
166
|
+
}
|
|
167
|
+
tabIndex={-1}
|
|
168
|
+
>
|
|
169
|
+
{option?.label}
|
|
170
|
+
</OptionItem>
|
|
171
|
+
))
|
|
172
|
+
) : (
|
|
173
|
+
<OptionItem
|
|
174
|
+
disabled
|
|
175
|
+
style={{ pointerEvents: "none", opacity: 0.5 }}
|
|
176
|
+
>
|
|
177
|
+
{loading ? "Cargando…" : "No se encontraron elementos"}
|
|
178
|
+
</OptionItem>
|
|
179
|
+
)}
|
|
180
|
+
</Options>
|
|
181
|
+
</SelectWrapper>
|
|
182
|
+
);
|
|
183
|
+
};
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import "../../../global-files/global-styles.css";
|
|
3
|
+
import { GlobalColors, FontFamily } from "../../../global-files/variables";
|
|
4
|
+
|
|
5
|
+
const PINK = "#E13AA8";
|
|
6
|
+
|
|
7
|
+
export const SelectWrapper = styled.div`
|
|
8
|
+
position: relative;
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
flex: 1 1 0;
|
|
12
|
+
min-width: 0;
|
|
13
|
+
font-family: ${FontFamily.Raleway};
|
|
14
|
+
font-size: 13px;
|
|
15
|
+
user-select: none;
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
`;
|
|
18
|
+
|
|
19
|
+
export const SelectBase = styled.div`
|
|
20
|
+
position: relative;
|
|
21
|
+
width: 100%;
|
|
22
|
+
min-width: 0;
|
|
23
|
+
border-radius: 5px 5px 0 0;
|
|
24
|
+
border-bottom: 1px solid rgba(225, 58, 168, 0.5);
|
|
25
|
+
color: ${GlobalColors.deep_gray};
|
|
26
|
+
display: flex;
|
|
27
|
+
gap: 8px;
|
|
28
|
+
align-items: center;
|
|
29
|
+
white-space: nowrap;
|
|
30
|
+
overflow-x: hidden;
|
|
31
|
+
padding: 0;
|
|
32
|
+
|
|
33
|
+
cursor: ${({ disabled }) => (disabled ? "not-allowed" : "pointer")};
|
|
34
|
+
opacity: ${({ disabled }) => (disabled ? 0.5 : 1)};
|
|
35
|
+
pointer-events: ${({ disabled }) => (disabled ? "none" : "auto")};
|
|
36
|
+
|
|
37
|
+
> div {
|
|
38
|
+
position: relative;
|
|
39
|
+
width: 100%;
|
|
40
|
+
height: 100%;
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
min-width: 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
> div > input {
|
|
47
|
+
width: 100%;
|
|
48
|
+
min-width: 0;
|
|
49
|
+
border: none;
|
|
50
|
+
outline: none;
|
|
51
|
+
padding: 9px 22px 9px 10px;
|
|
52
|
+
border-radius: 5px 5px 0 0;
|
|
53
|
+
font-family: ${FontFamily.Raleway};
|
|
54
|
+
font-size: 13px;
|
|
55
|
+
color: ${GlobalColors.deep_gray};
|
|
56
|
+
background: none;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
> div > input::placeholder {
|
|
60
|
+
color: ${GlobalColors.gray};
|
|
61
|
+
}
|
|
62
|
+
`;
|
|
63
|
+
|
|
64
|
+
export const SelectedOptionItem = styled.div`
|
|
65
|
+
position: relative;
|
|
66
|
+
max-width: 60%;
|
|
67
|
+
display: flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
border-radius: 5px;
|
|
70
|
+
padding: 5px 8px;
|
|
71
|
+
background-color: rgba(225, 58, 168, 0.06);
|
|
72
|
+
color: ${GlobalColors.gray};
|
|
73
|
+
font-size: 12px;
|
|
74
|
+
|
|
75
|
+
> p {
|
|
76
|
+
width: 100%;
|
|
77
|
+
margin: 0;
|
|
78
|
+
overflow: hidden;
|
|
79
|
+
text-overflow: ellipsis;
|
|
80
|
+
}
|
|
81
|
+
`;
|
|
82
|
+
|
|
83
|
+
/*
|
|
84
|
+
Flecha dibujada, no un icono de fuente. El componente original usaba
|
|
85
|
+
material-symbols-outlined, que la aplicación carga y esta librería no: aquí
|
|
86
|
+
habría salido la palabra "arrow_drop_down" escrita donde debería ir el triángulo.
|
|
87
|
+
*/
|
|
88
|
+
export const Arrow = styled.span`
|
|
89
|
+
position: absolute;
|
|
90
|
+
right: 6px;
|
|
91
|
+
pointer-events: none;
|
|
92
|
+
color: ${PINK};
|
|
93
|
+
font-size: 10px;
|
|
94
|
+
line-height: 1;
|
|
95
|
+
`;
|
|
96
|
+
|
|
97
|
+
export const Options = styled.ul`
|
|
98
|
+
position: absolute;
|
|
99
|
+
top: 100%;
|
|
100
|
+
left: 0;
|
|
101
|
+
width: 100%;
|
|
102
|
+
max-height: 180px;
|
|
103
|
+
overflow-y: auto;
|
|
104
|
+
background-color: ${GlobalColors.white};
|
|
105
|
+
border-radius: 8px;
|
|
106
|
+
border: 1px solid ${GlobalColors.s2};
|
|
107
|
+
box-shadow: 0 4px 8px rgb(0 0 0 / 18%);
|
|
108
|
+
margin: 0;
|
|
109
|
+
padding: 0;
|
|
110
|
+
list-style: none;
|
|
111
|
+
display: ${({ open }) => (open ? "block" : "none")};
|
|
112
|
+
z-index: 1000;
|
|
113
|
+
`;
|
|
114
|
+
|
|
115
|
+
export const OptionItem = styled.li`
|
|
116
|
+
padding: 9px 12px;
|
|
117
|
+
cursor: pointer;
|
|
118
|
+
font-size: 12px;
|
|
119
|
+
white-space: normal;
|
|
120
|
+
background-color: ${({ selected }) => (selected ? PINK : GlobalColors.white)};
|
|
121
|
+
color: ${({ selected }) => (selected ? GlobalColors.white : GlobalColors.gray)};
|
|
122
|
+
|
|
123
|
+
&.first {
|
|
124
|
+
background-color: ${({ selected }) =>
|
|
125
|
+
selected ? PINK : "rgba(225, 58, 168, 0.1)"};
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
&:hover {
|
|
129
|
+
background-color: ${({ selected }) =>
|
|
130
|
+
selected ? PINK : "rgba(225, 58, 168, 0.06)"};
|
|
131
|
+
}
|
|
132
|
+
`;
|