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,19 +328,21 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[data-reach-combobox-input] {
|
[data-reach-combobox-input] {
|
||||||
width: 100%;
|
|
||||||
min-width: 50%;
|
|
||||||
max-width: 100%;
|
|
||||||
min-height: 62px;
|
min-height: 62px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
border: solid 1px $border-grey;
|
border: solid 1px $border-grey;
|
||||||
padding: $default-padding;
|
padding: $default-padding;
|
||||||
}
|
|
||||||
|
|
||||||
[data-reach-combobox-input]:focus {
|
&:not([class^='width-']) {
|
||||||
border-color: $blue-france-500;
|
width: 100%;
|
||||||
|
min-width: 50%;
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:focus {
|
||||||
|
border-color: $blue-france-500;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[data-reach-combobox-token-list] {
|
[data-reach-combobox-token-list] {
|
||||||
|
|
|
@ -73,6 +73,12 @@
|
||||||
// sizing
|
// sizing
|
||||||
.width-100 {
|
.width-100 {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
|
@media (max-width: $two-columns-breakpoint) {
|
||||||
|
&-mobile {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.width-33 {
|
.width-33 {
|
||||||
|
|
|
@ -54,8 +54,12 @@ const [placeholderDepartement, placeholderCommune] =
|
||||||
|
|
||||||
export default function ComboCommunesSearch({
|
export default function ComboCommunesSearch({
|
||||||
id,
|
id,
|
||||||
|
classNameDepartement,
|
||||||
...props
|
...props
|
||||||
}: ComboSearchProps<CommuneResult> & { id: string }) {
|
}: ComboSearchProps<CommuneResult> & {
|
||||||
|
id: string;
|
||||||
|
classNameDepartement?: string;
|
||||||
|
}) {
|
||||||
const group = groupId(id);
|
const group = groupId(id);
|
||||||
const [departementValue, setDepartementValue] = useHiddenField(
|
const [departementValue, setDepartementValue] = useHiddenField(
|
||||||
group,
|
group,
|
||||||
|
@ -84,6 +88,7 @@ export default function ComboCommunesSearch({
|
||||||
placeholder={placeholderDepartement}
|
placeholder={placeholderDepartement}
|
||||||
addForeignDepartement={false}
|
addForeignDepartement={false}
|
||||||
value={departementValue}
|
value={departementValue}
|
||||||
|
className={classNameDepartement}
|
||||||
onChange={(_, result) => {
|
onChange={(_, result) => {
|
||||||
setDepartementValue(result?.nom ?? '');
|
setDepartementValue(result?.nom ?? '');
|
||||||
setCodeDepartement(result?.code ?? '');
|
setCodeDepartement(result?.code ?? '');
|
||||||
|
|
|
@ -5,4 +5,6 @@
|
||||||
= react_component("ComboCommunesSearch",
|
= react_component("ComboCommunesSearch",
|
||||||
required: champ.mandatory?,
|
required: champ.mandatory?,
|
||||||
id: champ.input_id,
|
id: champ.input_id,
|
||||||
|
classNameDepartement: "width-33-desktop width-100-mobile",
|
||||||
|
className: "width-66-desktop width-100-mobile",
|
||||||
describedby: champ.describedby_id)
|
describedby: champ.describedby_id)
|
||||||
|
|
|
@ -3,4 +3,5 @@
|
||||||
= react_component("ComboDepartementsSearch",
|
= react_component("ComboDepartementsSearch",
|
||||||
required: champ.mandatory?,
|
required: champ.mandatory?,
|
||||||
id: champ.input_id,
|
id: champ.input_id,
|
||||||
|
className: "width-33-desktop width-100-mobile",
|
||||||
describedby: champ.describedby_id)
|
describedby: champ.describedby_id)
|
||||||
|
|
|
@ -3,4 +3,5 @@
|
||||||
= react_component("ComboPaysSearch",
|
= react_component("ComboPaysSearch",
|
||||||
required: champ.mandatory?,
|
required: champ.mandatory?,
|
||||||
id: champ.input_id,
|
id: champ.input_id,
|
||||||
|
className: "width-33-desktop width-100-mobile",
|
||||||
describedby: champ.describedby_id)
|
describedby: champ.describedby_id)
|
||||||
|
|
|
@ -3,4 +3,5 @@
|
||||||
= react_component("ComboRegionsSearch",
|
= react_component("ComboRegionsSearch",
|
||||||
required: champ.mandatory?,
|
required: champ.mandatory?,
|
||||||
id: champ.input_id,
|
id: champ.input_id,
|
||||||
|
className: "width-33-desktop width-100-mobile",
|
||||||
describedby: champ.describedby_id)
|
describedby: champ.describedby_id)
|
||||||
|
|
Loading…
Add table
Reference in a new issue