style(combo): better inputs sizes for pays/regions/departement/communes champs
This commit is contained in:
parent
71e7f51753
commit
1c96ca59dd
7 changed files with 26 additions and 8 deletions
|
@ -328,20 +328,22 @@
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
[data-reach-combobox-input] {
|
||||
width: 100%;
|
||||
min-width: 50%;
|
||||
max-width: 100%;
|
||||
min-height: 62px;
|
||||
border-radius: 4px;
|
||||
border: solid 1px $border-grey;
|
||||
padding: $default-padding;
|
||||
|
||||
&:not([class^='width-']) {
|
||||
width: 100%;
|
||||
min-width: 50%;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
[data-reach-combobox-input]:focus {
|
||||
&:focus {
|
||||
border-color: $blue-france-500;
|
||||
}
|
||||
}
|
||||
|
||||
[data-reach-combobox-token-list] {
|
||||
padding: $default-spacer;
|
||||
|
|
|
@ -73,6 +73,12 @@
|
|||
// sizing
|
||||
.width-100 {
|
||||
width: 100%;
|
||||
|
||||
@media (max-width: $two-columns-breakpoint) {
|
||||
&-mobile {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.width-33 {
|
||||
|
|
|
@ -54,8 +54,12 @@ const [placeholderDepartement, placeholderCommune] =
|
|||
|
||||
export default function ComboCommunesSearch({
|
||||
id,
|
||||
classNameDepartement,
|
||||
...props
|
||||
}: ComboSearchProps<CommuneResult> & { id: string }) {
|
||||
}: ComboSearchProps<CommuneResult> & {
|
||||
id: string;
|
||||
classNameDepartement?: string;
|
||||
}) {
|
||||
const group = groupId(id);
|
||||
const [departementValue, setDepartementValue] = useHiddenField(
|
||||
group,
|
||||
|
@ -84,6 +88,7 @@ export default function ComboCommunesSearch({
|
|||
placeholder={placeholderDepartement}
|
||||
addForeignDepartement={false}
|
||||
value={departementValue}
|
||||
className={classNameDepartement}
|
||||
onChange={(_, result) => {
|
||||
setDepartementValue(result?.nom ?? '');
|
||||
setCodeDepartement(result?.code ?? '');
|
||||
|
|
|
@ -5,4 +5,6 @@
|
|||
= react_component("ComboCommunesSearch",
|
||||
required: champ.mandatory?,
|
||||
id: champ.input_id,
|
||||
classNameDepartement: "width-33-desktop width-100-mobile",
|
||||
className: "width-66-desktop width-100-mobile",
|
||||
describedby: champ.describedby_id)
|
||||
|
|
|
@ -3,4 +3,5 @@
|
|||
= react_component("ComboDepartementsSearch",
|
||||
required: champ.mandatory?,
|
||||
id: champ.input_id,
|
||||
className: "width-33-desktop width-100-mobile",
|
||||
describedby: champ.describedby_id)
|
||||
|
|
|
@ -3,4 +3,5 @@
|
|||
= react_component("ComboPaysSearch",
|
||||
required: champ.mandatory?,
|
||||
id: champ.input_id,
|
||||
className: "width-33-desktop width-100-mobile",
|
||||
describedby: champ.describedby_id)
|
||||
|
|
|
@ -3,4 +3,5 @@
|
|||
= react_component("ComboRegionsSearch",
|
||||
required: champ.mandatory?,
|
||||
id: champ.input_id,
|
||||
className: "width-33-desktop width-100-mobile",
|
||||
describedby: champ.describedby_id)
|
||||
|
|
Loading…
Reference in a new issue