2020-01-30 11:59:10 +13:00
|
|
|
<script>
|
2020-02-03 22:50:30 +13:00
|
|
|
import getIcon from "./icon"
|
2020-03-13 03:23:29 +13:00
|
|
|
|
|
|
|
export let icon
|
2020-02-03 22:50:30 +13:00
|
|
|
export let value
|
2020-01-30 11:59:10 +13:00
|
|
|
</script>
|
|
|
|
|
2020-02-03 22:50:30 +13:00
|
|
|
<div class="select-container">
|
2020-03-13 03:23:29 +13:00
|
|
|
{#if icon}
|
|
|
|
<i class={icon} />
|
|
|
|
{/if}
|
2020-03-28 05:58:32 +13:00
|
|
|
<select class:adjusted={icon} on:change bind:value>
|
2020-02-03 22:50:30 +13:00
|
|
|
<slot />
|
|
|
|
</select>
|
|
|
|
<span class="arrow">
|
|
|
|
{@html getIcon('chevron-down', '24')}
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
|
2020-01-30 11:59:10 +13:00
|
|
|
<style>
|
|
|
|
.select-container {
|
2020-04-03 03:11:27 +13:00
|
|
|
font-size: 14px;
|
2020-01-30 11:59:10 +13:00
|
|
|
position: relative;
|
2020-06-03 07:55:15 +12:00
|
|
|
border: var(--grey-dark) 1px solid;
|
2020-01-30 11:59:10 +13:00
|
|
|
}
|
|
|
|
|
2020-03-13 03:23:29 +13:00
|
|
|
.adjusted {
|
2020-04-03 03:11:27 +13:00
|
|
|
padding-left: 30px;
|
2020-03-13 03:23:29 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
i {
|
|
|
|
position: absolute;
|
2020-04-03 03:11:27 +13:00
|
|
|
left: 10px;
|
|
|
|
top: 10px;
|
2020-03-13 03:23:29 +13:00
|
|
|
}
|
|
|
|
|
2020-01-30 11:59:10 +13:00
|
|
|
select {
|
2020-03-24 23:56:48 +13:00
|
|
|
height: 40px;
|
2020-01-30 11:59:10 +13:00
|
|
|
display: block;
|
|
|
|
font-family: sans-serif;
|
2020-03-24 23:56:48 +13:00
|
|
|
font-weight: 400;
|
2020-04-03 03:11:27 +13:00
|
|
|
font-size: 14px;
|
2020-06-03 07:55:15 +12:00
|
|
|
color: var(--ink);
|
2020-04-03 03:11:27 +13:00
|
|
|
padding: 0 40px 0px 20px;
|
2020-01-30 11:59:10 +13:00
|
|
|
width: 100%;
|
|
|
|
max-width: 100%;
|
|
|
|
box-sizing: border-box;
|
|
|
|
margin: 0;
|
|
|
|
-moz-appearance: none;
|
|
|
|
-webkit-appearance: none;
|
|
|
|
appearance: none;
|
2020-04-03 03:11:27 +13:00
|
|
|
background: var(--white);
|
2020-01-30 11:59:10 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
.arrow {
|
|
|
|
position: absolute;
|
|
|
|
right: 10px;
|
|
|
|
bottom: 0;
|
|
|
|
margin: auto;
|
|
|
|
width: 30px;
|
|
|
|
height: 30px;
|
|
|
|
pointer-events: none;
|
2020-06-03 07:55:15 +12:00
|
|
|
color: var(--ink);
|
2020-01-30 11:59:10 +13:00
|
|
|
}
|
|
|
|
</style>
|