InputGroup.vue 640 Bytes
Newer Older
abergavenny's avatar
abergavenny committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<script setup>
const props = defineProps(['min', 'row', 'stretch'])
</script>

<template>
  <div class="input-group" :class="{ min: props.min, row: props.row, stretch: props.stretch }">
    <slot />
  </div>
</template>

<style scoped>
.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-s);
}

.input-group > label {
  font-size: var(--text-s);
  font-weight: bold;
}

.input-group.min {
  width: min-content;
}

.input-group.row {
  flex-direction: column;
}

@media (min-width: 48em) {
  .input-group.row {
    flex-direction: row;
    gap: var(--spacing-l);
  }
}

.input-group.stretch {
  flex: 1;
}
</style>