2024-09-10 10:50:51 +02:00
|
|
|
<template>
|
2024-09-10 15:42:21 +02:00
|
|
|
<!-- TODO: dynamiser la valeur de l'attribut style: url('inspiration.cover') -->
|
2024-09-10 10:50:51 +02:00
|
|
|
<div
|
2024-09-10 18:09:05 +02:00
|
|
|
id="inspirations-dropdown"
|
2024-09-10 10:50:51 +02:00
|
|
|
class="flex"
|
|
|
|
|
style="
|
|
|
|
|
--image: url('https://plus.unsplash.com/premium_photo-1675626791716-7f74187592f1?q=80&w=1974&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D');
|
|
|
|
|
"
|
|
|
|
|
>
|
2024-09-10 18:09:05 +02:00
|
|
|
<label for="inspirations-select" class="text-sm">Choisir une inspiration</label>
|
2024-09-10 16:34:02 +02:00
|
|
|
<Select
|
2024-09-10 18:09:05 +02:00
|
|
|
id="inspirations-select"
|
2024-09-10 16:34:02 +02:00
|
|
|
v-model="selectedInspiration"
|
|
|
|
|
:options="inspirations"
|
|
|
|
|
optionLabel="name"
|
|
|
|
|
optionValue="value"
|
2024-09-10 18:09:05 +02:00
|
|
|
class="font-serif"
|
|
|
|
|
data-icon="chevron-single-down"
|
2024-09-10 18:31:42 +02:00
|
|
|
checkmark
|
2024-09-10 16:34:02 +02:00
|
|
|
/>
|
|
|
|
|
</div>
|
2024-09-10 10:50:51 +02:00
|
|
|
</template>
|
|
|
|
|
|
2024-09-10 15:42:21 +02:00
|
|
|
<script setup>
|
2024-09-10 16:23:09 +02:00
|
|
|
import { ref } from "vue";
|
|
|
|
|
|
2024-09-10 16:34:02 +02:00
|
|
|
const selectedInspiration = ref("shape-of-nature");
|
2024-09-10 16:23:09 +02:00
|
|
|
const inspirations = ref([
|
2024-09-10 16:34:02 +02:00
|
|
|
{ name: "Shape of Nature", value: "shape-of-nature" },
|
|
|
|
|
{ name: "Inspiration Title", value: "inspiration-title" },
|
2024-09-10 16:23:09 +02:00
|
|
|
]);
|
2024-09-10 15:42:21 +02:00
|
|
|
</script>
|
|
|
|
|
|
2024-09-10 18:09:05 +02:00
|
|
|
<style>
|
|
|
|
|
#inspirations-dropdown {
|
2024-09-10 10:50:51 +02:00
|
|
|
--direction: column;
|
|
|
|
|
--items: flex-start;
|
|
|
|
|
--wrap: no-wrap;
|
|
|
|
|
--row-gap: 0;
|
2024-09-10 18:09:05 +02:00
|
|
|
position: absolute;
|
|
|
|
|
top: 0;
|
|
|
|
|
right: 0;
|
2024-09-10 10:50:51 +02:00
|
|
|
background: var(--color-background);
|
2024-09-10 18:09:05 +02:00
|
|
|
border-radius: var(--rounded-lg);
|
2024-09-10 10:50:51 +02:00
|
|
|
height: 3.75rem;
|
2024-09-10 18:09:05 +02:00
|
|
|
width: 20rem;
|
2024-09-10 10:50:51 +02:00
|
|
|
padding: var(--space-8) var(--space-48) var(--space-8) var(--space-64);
|
|
|
|
|
margin-bottom: var(--space-16);
|
|
|
|
|
}
|
2024-09-10 18:09:05 +02:00
|
|
|
#inspirations-dropdown::before {
|
2024-09-10 10:50:51 +02:00
|
|
|
content: "";
|
|
|
|
|
position: absolute;
|
|
|
|
|
left: var(--space-8);
|
|
|
|
|
width: 2.75rem;
|
|
|
|
|
height: 2.75rem;
|
2024-09-10 18:09:05 +02:00
|
|
|
border-radius: var(--rounded-md);
|
|
|
|
|
background-image: var(--image);
|
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
|
background-size: cover;
|
|
|
|
|
background-position: center;
|
|
|
|
|
}
|
|
|
|
|
|
2024-09-10 18:31:42 +02:00
|
|
|
[role="combobox"],
|
2024-09-10 18:09:05 +02:00
|
|
|
#inspirations-select_list {
|
|
|
|
|
border: 1px solid var(--color-grey-200);
|
|
|
|
|
}
|
2024-09-10 18:31:42 +02:00
|
|
|
[role="combobox"]:hover {
|
|
|
|
|
outline: 1px solid var(--color-grey-400);
|
|
|
|
|
border-color: var(--color-background);
|
2024-09-10 18:09:05 +02:00
|
|
|
}
|
|
|
|
|
[role="combobox"][aria-expanded="true"] {
|
|
|
|
|
outline: 2px solid var(--color-focus-ring);
|
2024-09-10 18:31:42 +02:00
|
|
|
outline-offset: -2px;
|
|
|
|
|
border-color: transparent;
|
2024-09-10 18:09:05 +02:00
|
|
|
}
|
|
|
|
|
#inspirations-select,
|
|
|
|
|
[role="combobox"] {
|
|
|
|
|
position: absolute;
|
|
|
|
|
inset: 0;
|
|
|
|
|
border-radius: inherit;
|
|
|
|
|
padding: 1.875rem var(--space-48) var(--space-8) var(--space-64);
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
|
2024-09-10 18:31:42 +02:00
|
|
|
|
2024-09-10 18:09:05 +02:00
|
|
|
/* Icon */
|
|
|
|
|
#inspirations-select svg {
|
|
|
|
|
display: none; /* Hide default component svg */
|
|
|
|
|
}
|
|
|
|
|
#inspirations-select[data-icon]::before {
|
|
|
|
|
--icon-color: var(--color-grey-700);
|
|
|
|
|
position: absolute;
|
|
|
|
|
right: var(--space-8);
|
|
|
|
|
top: .625rem;
|
|
|
|
|
width: 2.5rem;
|
|
|
|
|
height: 2.5rem;
|
|
|
|
|
padding: .625rem;
|
|
|
|
|
}
|
|
|
|
|
#inspirations-dropdown label {
|
|
|
|
|
color: var(--color-grey-700);
|
|
|
|
|
letter-spacing: var(--tracking-wider);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Options */
|
|
|
|
|
#inspirations-select_list {
|
|
|
|
|
margin-top: var(--space-4);
|
|
|
|
|
border-radius: var(--rounded-md);
|
|
|
|
|
background: var(--color-background);
|
|
|
|
|
box-shadow: var(--shadow);
|
|
|
|
|
padding: var(--space-8);
|
|
|
|
|
}
|
|
|
|
|
#inspirations-select_list > * {
|
|
|
|
|
font-family: var(--font-serif);
|
|
|
|
|
padding: var(--space-8) var(--space-8) var(--space-8) var(--space-48);
|
|
|
|
|
border-radius: var(--rounded-sm);
|
|
|
|
|
position: relative;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
height: 2.75rem;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
#inspirations-select_list > * + * {
|
|
|
|
|
margin-top: var(--space-4);
|
|
|
|
|
}
|
|
|
|
|
#inspirations-select_list > *::before {
|
|
|
|
|
content: "";
|
|
|
|
|
position: absolute;
|
|
|
|
|
left: var(--space-8);
|
|
|
|
|
width: 1.75rem;
|
|
|
|
|
height: 1.75rem;
|
|
|
|
|
border-radius: var(--rounded-sm);
|
2024-09-10 10:50:51 +02:00
|
|
|
background-image: var(--image);
|
2024-09-10 18:09:05 +02:00
|
|
|
background-color: var(--color-grey-200);
|
2024-09-10 10:50:51 +02:00
|
|
|
background-repeat: no-repeat;
|
|
|
|
|
background-size: cover;
|
|
|
|
|
background-position: center;
|
|
|
|
|
}
|
2024-09-10 18:09:05 +02:00
|
|
|
#inspirations-select_list > *:hover {
|
|
|
|
|
background-color: var(--color-grey-50);
|
|
|
|
|
}
|
|
|
|
|
#inspirations-select_list > *:focus,
|
|
|
|
|
#inspirations-select_list > *:focus-visible,
|
|
|
|
|
#inspirations-select_list > [data-p-focused="true"] {
|
|
|
|
|
outline: 2px solid var(--color-focus-ring);
|
|
|
|
|
}
|
2024-09-10 18:31:42 +02:00
|
|
|
/* Check */
|
|
|
|
|
#inspirations-select_list > * > svg {
|
|
|
|
|
position: absolute;
|
|
|
|
|
left: .875rem;
|
|
|
|
|
width: 1rem;
|
|
|
|
|
height: 1rem;
|
|
|
|
|
color: var(--color-grey-700);
|
|
|
|
|
}
|
2024-09-10 10:50:51 +02:00
|
|
|
</style>
|