Unify the web UI on shared controls and let pipeline columns be managed on the board.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
<script setup lang="ts" generic="T extends string">
|
||||
defineProps<{
|
||||
options: Array<{ value: T; label: string; icon?: 'grid' | 'list' }>;
|
||||
}>();
|
||||
|
||||
const model = defineModel<T>({ required: true });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="ui-seg" role="group">
|
||||
<button
|
||||
v-for="opt in options"
|
||||
:key="opt.value"
|
||||
type="button"
|
||||
class="seg"
|
||||
:class="{ on: model === opt.value }"
|
||||
:aria-pressed="model === opt.value"
|
||||
@click="model = opt.value"
|
||||
>
|
||||
<slot name="icon" :option="opt" />
|
||||
<span class="seg-label">{{ opt.label }}</span>
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.ui-seg {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
min-height: var(--control-h);
|
||||
padding: 3px;
|
||||
gap: 2px;
|
||||
background: #e8eef1;
|
||||
border-radius: var(--radius);
|
||||
}
|
||||
|
||||
.seg {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 0.35rem;
|
||||
min-height: calc(var(--control-h) - 6px);
|
||||
padding: 0 0.75rem;
|
||||
border: 0;
|
||||
border-radius: calc(var(--radius) - 2px);
|
||||
background: transparent;
|
||||
color: #7b8794;
|
||||
font: inherit;
|
||||
font-weight: 700;
|
||||
font-size: 0.82rem;
|
||||
cursor: pointer;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.seg.on {
|
||||
background: #fff;
|
||||
color: var(--accent-deep);
|
||||
box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
|
||||
}
|
||||
|
||||
.seg:focus-visible {
|
||||
outline: 2px solid var(--accent);
|
||||
outline-offset: 1px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user