-
{{ tag.label }}
-
- {{ opt.label }}
-
+
+
Don't see what you're looking for?
@@ -30,32 +24,15 @@ const props = defineProps({
const emit = defineEmits(["update:modelValue", "suggest"]);
-const options = [
- { label: "Can help", value: "help" },
- { label: "Interested", value: "interested" },
- { label: "Need help", value: "seeking" },
-];
-
-function getState(slug) {
- const entry = props.modelValue.find((e) => e.tagSlug === slug);
- return entry ? entry.state : null;
-}
-
-function toggleState(slug, value) {
+function toggle(slug) {
const current = [...props.modelValue];
- const idx = current.findIndex((e) => e.tagSlug === slug);
- const existingState = idx !== -1 ? current[idx].state : null;
-
- if (existingState === value) {
- // clicking active state deselects it
- if (idx !== -1) current.splice(idx, 1);
- } else if (idx !== -1) {
- current[idx] = { tagSlug: slug, state: value };
+ const idx = current.indexOf(slug);
+ if (idx === -1) {
+ emit("update:modelValue", [...current, slug]);
} else {
- current.push({ tagSlug: slug, state: value });
+ current.splice(idx, 1);
+ emit("update:modelValue", current);
}
-
- emit("update:modelValue", current);
}
@@ -63,78 +40,47 @@ function toggleState(slug, value) {
.coop-tag-selector {
display: flex;
flex-direction: column;
- gap: 0;
-}
-
-.coop-row {
- display: flex;
- align-items: center;
- justify-content: space-between;
gap: 8px;
- padding: 4px 0;
- border-bottom: 1px dashed var(--border);
}
-.coop-row:first-child {
- border-top: 1px dashed var(--border);
+.pill-grid {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 4px;
}
-.tag-label {
+.pill {
+ display: inline-flex;
+ align-items: center;
+ padding: 2px 9px;
+ border: 1px dashed var(--border);
+ background: transparent;
+ color: var(--text-faint);
font-size: 11px;
font-family: "Commit Mono", monospace;
- color: var(--text-dim);
- flex: 1;
- min-width: 0;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-.segmented {
- display: inline-flex;
- gap: 0;
- flex-shrink: 0;
-}
-
-.seg-option {
- padding: 2px 7px;
- height: 18px;
- display: flex;
- align-items: center;
- justify-content: center;
- border: 1px dashed var(--border);
- color: var(--text-faint);
- font-size: 9px;
- font-family: "Commit Mono", monospace;
- letter-spacing: 0.02em;
cursor: pointer;
- transition: all 0.12s;
user-select: none;
+ transition: all 0.12s;
white-space: nowrap;
- position: relative;
}
-.seg-option + .seg-option {
- margin-left: -1px;
-}
-
-.seg-option:hover {
+.pill:hover {
color: var(--text-dim);
+ border-color: var(--border-d);
}
-.seg-option.on {
+.pill.selected {
background: var(--surface);
color: var(--text-bright);
border-color: var(--candle);
border-style: solid;
- z-index: 1;
}
.suggest-link {
font-size: 10px;
font-family: "Commit Mono", monospace;
color: var(--text-faint);
- margin-top: 8px;
+ margin-top: 2px;
}
.suggest-link span {