fix(ui/topbar): replace Jump to with a command palette, drop filler chrome (#1650)

* fix(ui/topbar): replace Jump to with a command palette, drop filler chrome

Jump to opens a shadcn-vue Command dialog that finds pages, tasks and
workflows by name. The connection indicator shows only when the stream is
lost, the dead documentation link is gone, and the profile menu label has
no stray whitespace.

* fix(ui): trim stray whitespace from template text and drop em dashes from copy

Element text that started or ended with a line break rendered with leading
and trailing spaces. Also removes the unused 'soon' nav state and the nav
group components no route reaches.

* fix(ui): drop the space a hidden spinner left before button text

* fix(ui/status): one dense Status page, full-width settings, problems-only apply status

Status drops its tabs and the duplicate health card; services list only
what is wrong. Settings pages use the full width, the resizable sidebar
handle is gone, and apply status shows only processes that have not
applied a change. PageHeader puts the title and actions on one line.

* refactor(ui): use shadcn ToggleGroup and Badge, drop SegmentedControl and StatusPill

Status badges show only when a state needs attention: no Running, Enabled,
Active, Listening or live pills next to healthy rows. Removes the unused
pagination, radio-group and scroll-area components.

* fix(ui/history): use the shadcn Table with fixed columns so nothing is clipped

* fix(ui/workflows): apply ?workflow= only once the workflow is listed

Selecting it before the definitions loaded opened an empty canvas.

* refactor(ui/workflows): use shadcn Input, NativeSelect, Checkbox and Button in editors

Replaces hand-rolled inputs, selects, the repository mode switch and icon
buttons in the workflow editor, bind dialog, harness page, sources panel
and review gate. Adds the upstream shadcn-vue NativeSelect.

* style(ui): rounded-rectangle controls instead of pills

Halves the radius scale so inputs, selects and buttons stop reading as
pills, and badges and chips lose their full rounding.

* fix(ui/alerts): centre the bell's failed state and stop it contradicting Needs you

* fix(ui/tasks): one header line, aligned columns, no placeholder issue numbers

Tasks puts its filters beside the title and drops the stat tiles the
dashboard already shows. Sort headers align with their cells, chat tasks
no longer show their synthetic issue number, and Logs and the task
not-found page use the shared header.

* fix(ui/dashboard): shared header and cards, empty cards stay silent

Needs you uses the shadcn Card and drops its duplicate Open button; quality
gates and token outlook render only when there is something to show; the
throughput strip moves into the dashboard, its only user.

* refactor(ui/stores): one Pinia store per feature

Splits the site-wide control-plane store and the module-level refs into
settings, workflows, tasks, events, org and session stores. Identity
requests move into lib/api. Drops store fields nothing read: per-resource
stream state, the states map and loadApplyStatus.

* fix(ui/org): one header for the org area, sections drop their repeated titles

The org name is the page title with the admin's org switcher and New org
beside it; Members and Workspaces tables sit in cards like other pages.

* fix(ui/events): shadcn Tabs for the capture, map and bind steps

Replaces the numbered step strip with line tabs that carry each step's
count; the Listening pill is gone and Capture off shows only when it is.

* fix(ui/workflows): confirm a workflow delete in an AlertDialog, not window.confirm

* style(ui/settings): denser setting rows
This commit is contained in:
sam authored and GitHub committed 2026-10-12 04:40:21 +11:00
1 parent 94d2f98cc0
commit 3bf64933b0
209 files changed
+2158 -3175

No files matched your search

@@ -1,226 +1,139 @@
<script setup lang="ts">
import { computed, nextTick, onMounted, onUnmounted, ref, watch } from "vue";
import { computed, onMounted, onUnmounted, ref, watch } from "vue";
import { useRouter } from "vue-router";
import { Search } from "@lucide/vue";
import { navEntries, type NavEntry } from "@/lib/nav";
import { Button } from "@/components/ui/button";
import {
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
} from "@/components/ui/command";
import { Kbd } from "@/components/ui/kbd";
import { api } from "@/lib/api";
import { navEntries } from "@/lib/nav";
import { statusLabel } from "@/lib/task-meta";
/**
* The command palette: every section the nav can reach, opened with Cmd/Ctrl+K
* or '/' from anywhere. It is a jump list, not a data search -- the topbar's
* SearchBar owns the same list with prefix matching from a visible field; this
* one adds substring matching and arrow-key selection from a shortcut.
*
* Styling and keyboard handling mirror ChatSlashPalette, the in-app palette
* precedent: a bordered popover surface, mousedown prevented on the options so
* choosing with the pointer never steals focus from the filter, and the list
* scrolled so the highlighted row stays visible. Nothing here animates, so the
* shell's prefers-reduced-motion rule has nothing to quiet.
* Jump to a page, a task or a workflow by name. Opened from the top bar, with
* Cmd/Ctrl+K, or with '/' when no field has focus. Tasks and workflows are
* read when the palette opens, so it never shows a stale list for long.
*/
const props = defineProps<{ hidden: string[] }>();
const router = useRouter();
const open = ref(false);
const query = ref("");
const selection = ref(0);
const field = ref<HTMLInputElement | null>(null);
const list = ref<HTMLElement | null>(null);
// The same list the topbar's SearchBar and Nav read: navEntries flattens the
// nav tree and drops what this composition cannot back, so the palette can
// never offer a destination the server cannot serve.
const allEntries = computed(() =>
navEntries(props.hidden).filter((entry) => !entry.soon),
);
// Substring, not prefix: an operator who remembers "where do channels live"
// types a word from the description, not the start of the label.
const matches = computed(() => {
const needle = query.value.trim().toLowerCase();
if (!needle) return allEntries.value;
return allEntries.value.filter((entry) =>
`${entry.label} ${entry.description} ${entry.path}`
.toLowerCase()
.includes(needle),
);
});
watch(query, () => {
selection.value = 0;
});
// Capabilities can land while the palette is open and shrink the list; the
// highlight must not point past the last row.
watch(matches, () => {
if (selection.value >= matches.value.length) selection.value = 0;
});
function optionId(index: number): string {
return `command-palette-option-${index}`;
interface TaskEntry {
id: number | string;
title?: string;
status?: string;
}
async function show(): Promise<void> {
query.value = "";
selection.value = 0;
open.value = true;
await nextTick();
field.value?.focus();
const pages = computed(() => navEntries(props.hidden));
const tasks = ref<TaskEntry[]>([]);
const workflows = ref<string[]>([]);
const shortcut = navigator.platform.startsWith("Mac") ? "⌘K" : "Ctrl K";
const showWorkflows = computed(() => !props.hidden.includes("/workflows"));
// A failed read leaves that group empty: the pages still work, and the
// palette is not the place to report a broken task list.
async function loadEntries(): Promise<void> {
const [taskPage, workflowList] = await Promise.all([
api.taskPage<TaskEntry>({ limit: 100 }).catch(() => null),
showWorkflows.value
? api.workflows<{ definitions?: { id: string }[] }>().catch(() => null)
: null,
]);
tasks.value = taskPage?.tasks ?? [];
workflows.value = (workflowList?.definitions ?? []).map(({ id }) => id);
}
function close(): void {
watch(open, (value) => {
if (value) void loadEntries();
});
function go(path: string): void {
open.value = false;
field.value?.blur();
void router.push(path);
}
function toggle(): void {
if (open.value) close();
else void show();
}
// '/' opens only when the keystroke was meant for a field, not for the page:
// typing a slash into the composer or the topbar search must stay typing.
// '/' opens only when the keystroke was not meant for a field.
function isEditableTarget(event: KeyboardEvent): boolean {
const el = event.target;
return (
el instanceof HTMLElement &&
(el.isContentEditable ||
el.tagName === "INPUT" ||
el.tagName === "TEXTAREA" ||
el.tagName === "SELECT")
(el.isContentEditable || ["INPUT", "TEXTAREA", "SELECT"].includes(el.tagName))
);
}
// Registered on document in the bubble phase (capture: false): the palette is
// the last thing that should see a keystroke, after any focused field has had
// its turn.
function onGlobalKeydown(event: KeyboardEvent): void {
if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === "k") {
event.preventDefault();
toggle();
return;
}
if (event.key === "/" && !open.value && !isEditableTarget(event)) {
open.value = !open.value;
} else if (event.key === "/" && !open.value && !isEditableTarget(event)) {
event.preventDefault();
void show();
open.value = true;
}
}
onMounted(() => document.addEventListener("keydown", onGlobalKeydown));
onUnmounted(() => document.removeEventListener("keydown", onGlobalKeydown));
function onKeydown(event: KeyboardEvent): void {
if (event.key === "Escape") {
// Consumed here so closing the palette is not also read as a dismissal of
// whatever is open behind it (ChatLauncher watches defaultPrevented).
event.preventDefault();
close();
return;
}
if (event.key === "ArrowDown") {
event.preventDefault();
if (matches.value.length)
selection.value = Math.min(selection.value + 1, matches.value.length - 1);
return;
}
if (event.key === "ArrowUp") {
event.preventDefault();
selection.value = Math.max(selection.value - 1, 0);
return;
}
if (event.key === "Enter") {
event.preventDefault();
const entry = matches.value[selection.value];
if (entry) choose(entry);
}
}
function choose(entry: NavEntry): void {
void router.push(entry.path);
close();
}
// The pointer and the keyboard share one highlight, so a scroll must never
// move it: when the list scrolls under a stationary pointer (including the
// scrollIntoView below) the browser reports a move with no delta, and
// letting it steal selection puts the highlight on the wrong row.
function onHover(index: number, event: MouseEvent): void {
if (event.movementX === 0 && event.movementY === 0) return;
selection.value = index;
}
// Keep the highlighted row visible once matches run past the rows that fit.
// block: 'nearest' scrolls the minimum distance and never animates, so reduced
// motion needs no handling here. Optional call: not every environment
// implements scrollIntoView.
watch([selection, matches], async () => {
if (!open.value) return;
await nextTick();
list.value
?.querySelector('[aria-selected="true"]')
?.scrollIntoView?.({ block: "nearest" });
});
</script>
<template>
<div v-if="open" class="fixed inset-0 isolate z-50" @mousedown.self="close">
<div
class="bg-black/10 supports-backdrop-filter:backdrop-blur-xs absolute inset-0"
aria-hidden="true"
/>
<div
role="dialog"
aria-label="Command palette"
class="bg-popover text-popover-foreground border-border-strong shadow-md relative mx-auto mt-[15vh] w-[calc(100%-2rem)] max-w-lg overflow-hidden rounded-xl border"
>
<div class="border-border flex items-center gap-2 border-b px-3">
<Search :size="15" class="text-muted-foreground shrink-0" />
<input
ref="field"
v-model="query"
type="text"
role="combobox"
aria-label="Filter sections"
aria-expanded="true"
aria-controls="command-palette-list"
:aria-activedescendant="
matches[selection] ? optionId(selection) : undefined
"
class="h-11 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"
placeholder="Jump to a section…"
@keydown="onKeydown"
/>
</div>
<div
id="command-palette-list"
ref="list"
role="listbox"
aria-label="Sections"
class="max-h-72 overflow-x-hidden overflow-y-auto p-1.5"
>
<button
v-for="(entry, index) in matches"
:id="optionId(index)"
<Button
variant="outline"
size="sm"
class="text-muted-foreground w-44 justify-start max-lg:w-auto"
aria-label="Jump to"
@click="open = true"
>
<Search data-icon="inline-start" />
<span class="max-lg:hidden">Jump to</span>
<Kbd class="ml-auto max-lg:hidden">{{ shortcut }}</Kbd>
</Button>
<CommandDialog v-model:open="open" title="Jump to" description="Find a page, task or workflow.">
<CommandInput placeholder="Find a page, task or workflow" />
<CommandList>
<CommandEmpty>No matches.</CommandEmpty>
<CommandGroup heading="Pages">
<CommandItem
v-for="entry in pages"
:key="entry.path"
type="button"
role="option"
:aria-selected="index === selection"
class="hover:bg-muted aria-selected:bg-muted flex flex-col gap-0.5 rounded-md px-2.5 py-2 text-left outline-none"
@mousedown.prevent
@mousemove="onHover(index, $event)"
@click="choose(entry)"
:value="`page:${entry.path}`"
@select="go(entry.path)"
>
<span class="truncate text-sm text-foreground min-w-0">{{
entry.label
{{ entry.label }}
</CommandItem>
</CommandGroup>
<CommandGroup v-if="workflows.length" heading="Workflows">
<CommandItem
v-for="id in workflows"
:key="id"
:value="`workflow:${id}`"
@select="go(`/workflows?workflow=${encodeURIComponent(id)}`)"
>
{{ id }}
</CommandItem>
</CommandGroup>
<CommandGroup v-if="tasks.length" heading="Tasks">
<CommandItem
v-for="task in tasks"
:key="task.id"
:value="`task:${task.id}`"
@select="go(`/tasks/${task.id}`)"
>
<span class="text-muted-foreground shrink-0 tabular-nums">#{{ task.id }}</span>
<span class="truncate">{{ task.title }}</span>
<span v-if="task.status" class="text-muted-foreground ml-auto shrink-0 text-xs">{{
statusLabel(task.status)
}}</span>
<span
v-if="entry.description"
class="text-fg-muted truncate text-xs min-w-0"
>{{ entry.description }}</span
>
</button>
<p v-if="!matches.length" class="text-fg-muted px-2.5 py-3 text-sm">
No matching section.
</p>
</div>
</div>
</div>
</CommandItem>
</CommandGroup>
</CommandList>
</CommandDialog>
</template>
+16 -13
View File
@@ -1,22 +1,25 @@
<script setup lang="ts">
import { computed } from "vue";
import { storeToRefs } from "pinia";
import { connectionStatus } from "@/lib/connection";
import { useLiveUpdatesStore } from "@/stores/live-updates";
import { useSessionStore } from "@/stores/session";
const { streamState } = storeToRefs(useLiveUpdatesStore());
const status = computed(() => connectionStatus(streamState.value));
const look = {
ok: { dot: "bg-primary", text: "text-fg-subtle" },
warn: { dot: "bg-warn", text: "text-warn" },
danger: { dot: "bg-danger", text: "text-danger" },
} as const;
// Silent while the stream is live or opening for the first time; only a lost
// stream is worth the operator's attention.
const { streamState } = storeToRefs(useSessionStore());
</script>
<template>
<span role="status" class="inline-flex items-center gap-1.5 px-1 text-xs max-sm:hidden" :class="look[status.tone].text">
<span class="size-1.5 rounded-full" :class="look[status.tone].dot" aria-hidden="true" />
{{ status.label }}
<span
v-if="streamState === 'reconnecting' || streamState === 'unavailable'"
role="status"
class="inline-flex items-center gap-1.5 px-1 text-xs max-sm:hidden"
:class="streamState === 'unavailable' ? 'text-danger' : 'text-warn'"
>
<span
class="size-1.5 rounded-full"
:class="streamState === 'unavailable' ? 'bg-danger' : 'bg-warn'"
aria-hidden="true"
/>
{{ streamState === "unavailable" ? "Disconnected" : "Reconnecting" }}
</span>
</template>
+12 -21
View File
@@ -2,14 +2,14 @@
import { computed } from "vue";
import { useRoute } from "vue-router";
import { activeNavPath, navTree } from "@/lib/nav";
import NavGroup from "./NavGroup.vue";
import NavTrigger from "./NavTrigger.vue";
import { activeNavPath, navTree, type NavEntry } from "@/lib/nav";
const props = defineProps<{ hidden: string[] }>();
const route = useRoute();
const tree = computed(() => navTree(props.hidden));
const links = computed(() =>
navTree(props.hidden).flatMap((node): NavEntry[] => (node.kind === "link" ? [node.entry] : [])),
);
const activePath = computed(() => activeNavPath(route.path));
</script>
@@ -18,23 +18,14 @@ const activePath = computed(() => activeNavPath(route.path));
aria-label="Sections"
class="flex min-w-0 flex-1 items-center gap-0.5 overflow-x-auto [scrollbar-width:none]"
>
<template
v-for="node in tree"
:key="node.kind === 'link' ? node.entry.path : node.label"
<RouterLink
v-for="entry in links"
:key="entry.path"
:to="entry.path"
:aria-current="activePath === entry.path ? 'page' : undefined"
:data-current="activePath === entry.path ? '' : undefined"
class="text-muted-foreground hover:text-foreground hover:bg-accent data-current:text-foreground data-current:bg-accent focus-visible:ring-ring/50 inline-flex h-8 shrink-0 items-center rounded-md px-2.5 text-sm font-medium whitespace-nowrap transition-colors outline-none focus-visible:ring-[3px]"
>{{ entry.label }}</RouterLink
>
<NavTrigger
v-if="node.kind === 'link'"
:to="node.entry.path"
:current="activePath === node.entry.path"
>
{{ node.entry.label }}
</NavTrigger>
<NavGroup
v-else
:label="node.label"
:items="node.items"
:active-path="activePath"
/>
</template>
</nav>
</template>
-75
View File
@@ -1,75 +0,0 @@
<script setup lang="ts">
import { ref } from "vue";
import { ChevronDown } from "@lucide/vue";
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuLabel,
DropdownMenuSeparator,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
import type { NavEntry } from "@/lib/nav";
import NavItem from "./NavItem.vue";
import NavTrigger from "./NavTrigger.vue";
const props = defineProps<{
label: string;
items: NavEntry[];
activePath: string;
}>();
const holds = (path: string) => props.activePath === path;
/**
* Hover-open, click-toggling menu.
*
* Pointing at the group opens it; leaving it closes it after a short grace
* period, so the move from trigger to content cannot close what you are
* moving towards (the content carries its own enter/leave handlers, and the
* delay covers the gap between two teleported elements). The trigger keeps
* its click and keyboard semantics: reka still emits update:open on
* activation, this only controls how long the menu stays open.
*/
const open = ref(false);
let closeTimer: ReturnType<typeof setTimeout> | undefined;
function openMenu() {
clearTimeout(closeTimer);
open.value = true;
}
function closeMenuSoon() {
clearTimeout(closeTimer);
closeTimer = setTimeout(() => {
open.value = false;
}, 140);
}
</script>
<template>
<DropdownMenu :open="open" @update:open="open = $event">
<div class="flex" @pointerenter="openMenu" @pointerleave="closeMenuSoon">
<DropdownMenuTrigger as-child>
<NavTrigger :current="items.some((item) => holds(item.path))">
{{ props.label }}
<ChevronDown :size="14" class="opacity-60" />
</NavTrigger>
</DropdownMenuTrigger>
</div>
<DropdownMenuContent
align="start"
class="w-52"
@pointerenter="openMenu"
@pointerleave="closeMenuSoon"
>
<template v-for="(item, index) in items" :key="item.path">
<DropdownMenuSeparator v-if="item.dividerBefore && index > 0" />
<DropdownMenuLabel v-if="item.dividerBefore">{{
item.dividerBefore
}}</DropdownMenuLabel>
<NavItem :entry="item" :current="holds(item.path)" />
</template>
</DropdownMenuContent>
</DropdownMenu>
</template>
-24
View File
@@ -1,24 +0,0 @@
<script setup lang="ts">
import { DropdownMenuItem } from "@/components/ui/dropdown-menu";
import type { NavEntry } from "@/lib/nav";
defineProps<{ entry: NavEntry; current: boolean }>();
</script>
<template>
<DropdownMenuItem
as-child
:data-current="current ? '' : undefined"
:disabled="entry.soon"
class="data-current:text-foreground data-current:bg-accent/60 px-2 py-1.5"
>
<RouterLink :to="entry.path" class="w-full cursor-pointer">
<span class="flex-1">{{ entry.label }}</span>
<span
v-if="entry.soon"
class="text-muted-foreground text-[11px] tracking-wide uppercase"
>soon</span
>
</RouterLink>
</DropdownMenuItem>
</template>
-16
View File
@@ -1,16 +0,0 @@
<script setup lang="ts">
defineProps<{ to?: string; current?: boolean }>();
</script>
<template>
<component
:is="to ? 'RouterLink' : 'button'"
:to="to"
:type="to ? undefined : 'button'"
:aria-current="to && current ? 'page' : undefined"
:data-current="current ? '' : undefined"
class="text-muted-foreground hover:text-foreground hover:bg-accent data-current:text-foreground data-current:bg-accent focus-visible:ring-ring/50 inline-flex h-8 shrink-0 items-center gap-1 rounded-md px-2.5 text-sm font-medium whitespace-nowrap transition-colors outline-none focus-visible:ring-[3px]"
>
<slot />
</component>
</template>
+5 -6
View File
@@ -21,14 +21,13 @@ import {
</Avatar>
</DropdownMenuTrigger>
<DropdownMenuContent align="end" class="w-48">
<DropdownMenuLabel class="text-muted-foreground text-xs font-normal">
Signed in locally
</DropdownMenuLabel>
<DropdownMenuLabel class="text-muted-foreground text-xs font-normal">Signed in locally</DropdownMenuLabel>
<DropdownMenuSeparator />
<DropdownMenuItem as-child>
<RouterLink to="/settings/appearance" class="w-full cursor-pointer"
>Appearance</RouterLink
>
<RouterLink to="/settings/appearance" class="w-full cursor-pointer">Appearance</RouterLink>
</DropdownMenuItem>
<DropdownMenuItem as-child>
<RouterLink to="/logs" class="w-full cursor-pointer">Logs</RouterLink>
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
-84
View File
@@ -1,84 +0,0 @@
<script setup lang="ts">
import { computed, nextTick, ref } from "vue";
import { useRouter } from "vue-router";
import { Search } from "@lucide/vue";
import { Input } from "@/components/ui/input";
import { navEntries } from "@/lib/nav";
const props = defineProps<{ hidden: string[] }>();
const router = useRouter();
const field = ref<{ $el: HTMLInputElement } | null>(null);
const query = ref("");
const open = ref(false);
const entries = computed(() =>
navEntries(props.hidden).filter((entry) => !entry.soon),
);
// Jumping between sections, deliberately not a data search: each section owns
// its own filtering, and one box that means something different on every page
// is worse than none.
const hit = computed(() => {
const wanted = query.value.trim().toLowerCase();
if (!wanted) return undefined;
return entries.value.find((entry) =>
entry.label.toLowerCase().startsWith(wanted),
);
});
async function toggle() {
open.value = !open.value;
if (!open.value) return;
await nextTick();
field.value?.$el.focus();
}
function onKeydown(event: KeyboardEvent) {
const input = event.target as HTMLInputElement;
if (event.key === "Escape") {
// Consumed here so a dismissal of the field is not also read as a
// dismissal of whatever is open behind it.
event.preventDefault();
query.value = "";
open.value = false;
input.blur();
return;
}
if (event.key !== "Enter" || !hit.value) return;
void router.push(hit.value.path);
query.value = "";
open.value = false;
input.blur();
}
</script>
<template>
<div class="flex items-center">
<button
type="button"
class="text-muted-foreground hover:text-foreground hover:bg-accent focus-visible:ring-ring/50 inline-flex size-8 items-center justify-center rounded-md outline-none focus-visible:ring-[3px] lg:hidden"
aria-label="Jump to a section"
:aria-expanded="open"
@click="toggle()"
>
<Search :size="16" />
</button>
<div class="relative" :class="open ? 'block' : 'hidden lg:block'">
<Search
:size="15"
class="text-muted-foreground pointer-events-none absolute top-1/2 left-2.5 -translate-y-1/2"
/>
<Input
ref="field"
v-model="query"
type="search"
class="h-8 w-44 pl-8 text-sm"
placeholder="Jump to…"
aria-label="Jump to a section"
@keydown="onKeydown"
/>
</div>
</div>
</template>
-26
View File
@@ -1,26 +0,0 @@
<script setup lang="ts">
import { CircleQuestionMark } from "@lucide/vue";
import {
Tooltip,
TooltipContent,
TooltipTrigger,
} from "@/components/ui/tooltip";
</script>
<template>
<Tooltip>
<TooltipTrigger as-child>
<a
href="https://github.com/samcharles93/archie-core/tree/main/docs"
target="_blank"
rel="noreferrer noopener"
class="text-muted-foreground hover:text-foreground hover:bg-accent focus-visible:ring-ring/50 inline-flex size-8 items-center justify-center rounded-md outline-none focus-visible:ring-[3px]"
aria-label="Documentation"
>
<CircleQuestionMark :size="16" />
</a>
</TooltipTrigger>
<TooltipContent :side-offset="8">Documentation</TooltipContent>
</Tooltip>
</template>
+3 -5
View File
@@ -1,12 +1,11 @@
<script setup lang="ts">
import AlertsBell from "@/alerts/AlertsBell.vue";
import CommandPalette from "@/components/command-palette/CommandPalette.vue";
import NewTaskButton from "@/tasks/NewTaskButton.vue";
import Brand from "./Brand.vue";
import ConnectionPill from "./ConnectionPill.vue";
import Nav from "./Nav.vue";
import ProfileDropdown from "./ProfileDropdown.vue";
import SearchBar from "./SearchBar.vue";
import SupportLink from "./SupportLink.vue";
const props = defineProps<{ hidden: string[] }>();
</script>
@@ -18,11 +17,10 @@ const props = defineProps<{ hidden: string[] }>();
<Brand />
<Nav :hidden="props.hidden" />
<div class="flex shrink-0 items-center gap-2">
<SearchBar :hidden="props.hidden" />
<ConnectionPill />
<CommandPalette :hidden="props.hidden" />
<NewTaskButton v-if="!props.hidden.includes('/workflows')" />
<AlertsBell />
<ConnectionPill />
<SupportLink />
<ProfileDropdown />
</div>
</header>
+1 -1
View File
@@ -4,7 +4,7 @@ import { cva } from "class-variance-authority";
export { default as Badge } from "./Badge.vue";
export const badgeVariants = cva(
"h-5 gap-1 rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! group/badge inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none",
"h-5 gap-1 rounded-sm border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! group/badge inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none",
{
variants: {
variant: {
+88
View File
@@ -0,0 +1,88 @@
<script setup lang="ts">
import type { ListboxRootEmits, ListboxRootProps } from 'reka-ui'
import type { HTMLAttributes } from 'vue'
import { reactiveOmit } from '@vueuse/core'
import { ListboxRoot, useFilter, useForwardPropsEmits } from 'reka-ui'
import { reactive, ref, watch } from 'vue'
import { cn } from '@/lib/utils'
import { provideCommandContext } from '.'
const props = withDefaults(defineProps<ListboxRootProps & { class?: HTMLAttributes['class'] }>(), {
modelValue: '',
highlightOnHover: true,
})
const emits = defineEmits<ListboxRootEmits>()
const delegatedProps = reactiveOmit(props, 'class')
const forwarded = useForwardPropsEmits(delegatedProps, emits)
const allItems = ref<Map<string, string>>(new Map())
const allGroups = ref<Map<string, Set<string>>>(new Map())
const { contains } = useFilter({ sensitivity: 'base' })
const filterState = reactive({
search: '',
filtered: {
/** The count of all visible items. */
count: 0,
/** Map from visible item id to its search score. */
items: new Map() as Map<string, number>,
/** Set of groups with at least one visible item. */
groups: new Set() as Set<string>,
},
})
function filterItems() {
if (!filterState.search) {
filterState.filtered.count = allItems.value.size
// Do nothing, each item will know to show itself because search is empty
return
}
// Reset the groups
filterState.filtered.groups = new Set()
let itemCount = 0
// Check which items should be included
for (const [id, value] of allItems.value) {
const score = contains(value, filterState.search)
filterState.filtered.items.set(id, score ? 1 : 0)
if (score)
itemCount++
}
// Check which groups have at least 1 item shown
for (const [groupId, group] of allGroups.value) {
for (const itemId of group) {
if (filterState.filtered.items.get(itemId)! > 0) {
filterState.filtered.groups.add(groupId)
break
}
}
}
filterState.filtered.count = itemCount
}
watch(() => filterState.search, () => {
filterItems()
})
provideCommandContext({
allItems,
allGroups,
filterState,
})
</script>
<template>
<ListboxRoot
data-slot="command"
v-bind="forwarded"
:class="cn('bg-popover text-popover-foreground rounded-xl! p-1 flex size-full flex-col overflow-hidden', props.class)"
>
<slot />
</ListboxRoot>
</template>
@@ -0,0 +1,39 @@
<script setup lang="ts">
import type { DialogRootEmits, DialogRootProps } from 'reka-ui'
import type { HTMLAttributes } from 'vue'
import { useForwardPropsEmits } from 'reka-ui'
import { cn } from '@/lib/utils'
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '@/components/ui/dialog'
import Command from './Command.vue'
const props = withDefaults(defineProps<DialogRootProps & {
title?: string
description?: string
class?: HTMLAttributes['class']
showCloseButton?: boolean
}>(), {
title: 'Command Palette',
description: 'Search for a command to run...',
showCloseButton: false,
})
const emits = defineEmits<DialogRootEmits>()
const forwarded = useForwardPropsEmits(props, emits)
</script>
<template>
<Dialog v-slot="slotProps" v-bind="forwarded">
<DialogContent
:class="cn('rounded-xl! top-1/3 translate-y-0 overflow-hidden p-0', props.class)"
:show-close-button="showCloseButton"
>
<DialogHeader class="sr-only">
<DialogTitle>{{ title }}</DialogTitle>
<DialogDescription>{{ description }}</DialogDescription>
</DialogHeader>
<Command>
<slot v-bind="slotProps" />
</Command>
</DialogContent>
</Dialog>
</template>
@@ -0,0 +1,28 @@
<script setup lang="ts">
import type { PrimitiveProps } from 'reka-ui'
import type { HTMLAttributes } from 'vue'
import { reactiveOmit } from '@vueuse/core'
import { Primitive } from 'reka-ui'
import { computed } from 'vue'
import { cn } from '@/lib/utils'
import { useCommand } from '.'
const props = defineProps<PrimitiveProps & { class?: HTMLAttributes['class'] }>()
const delegatedProps = reactiveOmit(props, 'class')
const { filterState } = useCommand()
const isRender = computed(() => !!filterState.search && filterState.filtered.count === 0,
)
</script>
<template>
<Primitive
v-if="isRender"
data-slot="command-empty"
v-bind="delegatedProps"
:class="cn('py-6 text-center text-sm', props.class)"
>
<slot />
</Primitive>
</template>
@@ -0,0 +1,45 @@
<script setup lang="ts">
import type { ListboxGroupProps } from 'reka-ui'
import type { HTMLAttributes } from 'vue'
import { reactiveOmit } from '@vueuse/core'
import { ListboxGroup, ListboxGroupLabel, useId } from 'reka-ui'
import { computed, onMounted, onUnmounted } from 'vue'
import { cn } from '@/lib/utils'
import { provideCommandGroupContext, useCommand } from '.'
const props = defineProps<ListboxGroupProps & {
class?: HTMLAttributes['class']
heading?: string
}>()
const delegatedProps = reactiveOmit(props, 'class')
const { allGroups, filterState } = useCommand()
const id = useId()
const isRender = computed(() => !filterState.search ? true : filterState.filtered.groups.has(id))
provideCommandGroupContext({ id })
onMounted(() => {
if (!allGroups.value.has(id))
allGroups.value.set(id, new Set())
})
onUnmounted(() => {
allGroups.value.delete(id)
})
</script>
<template>
<ListboxGroup
v-bind="delegatedProps"
:id="id"
data-slot="command-group"
:class="cn('text-foreground **:[[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium', props.class)"
:hidden="isRender ? undefined : true"
>
<ListboxGroupLabel v-if="heading" data-slot="command-group-heading" class="">
{{ heading }}
</ListboxGroupLabel>
<slot />
</ListboxGroup>
</template>
@@ -0,0 +1,45 @@
<script setup lang="ts">
import type { ListboxFilterProps } from 'reka-ui'
import type { HTMLAttributes } from 'vue'
import { SearchIcon } from '@lucide/vue'
import { reactiveOmit } from '@vueuse/core'
import { ListboxFilter, useForwardProps } from 'reka-ui'
import { cn } from '@/lib/utils'
import { InputGroup, InputGroupAddon } from '@/components/ui/input-group'
import { useCommand } from '.'
defineOptions({
inheritAttrs: false,
})
const props = defineProps<ListboxFilterProps & {
class?: HTMLAttributes['class']
}>()
const delegatedProps = reactiveOmit(props, 'class')
const forwardedProps = useForwardProps(delegatedProps)
const { filterState } = useCommand()
</script>
<template>
<div
data-slot="command-input-wrapper"
class="p-1 pb-0"
>
<InputGroup class="bg-input/30 border-input/30 h-8! rounded-lg! shadow-none! *:data-[slot=input-group-addon]:pl-2!">
<ListboxFilter
v-bind="{ ...forwardedProps, ...$attrs }"
v-model="filterState.search"
data-slot="command-input"
auto-focus
:class="cn('w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50', props.class)"
/>
<InputGroupAddon>
<SearchIcon class="size-4 shrink-0 opacity-50" />
</InputGroupAddon>
</InputGroup>
</div>
</template>
@@ -0,0 +1,79 @@
<script setup lang="ts">
import type { ListboxItemEmits, ListboxItemProps } from 'reka-ui'
import type { HTMLAttributes } from 'vue'
import { CheckIcon } from '@lucide/vue'
import { reactiveOmit, useCurrentElement } from '@vueuse/core'
import { ListboxItem, useForwardPropsEmits, useId } from 'reka-ui'
import { computed, onMounted, onUnmounted, ref } from 'vue'
import { cn } from '@/lib/utils'
import { useCommand, useCommandGroup } from '.'
const props = defineProps<ListboxItemProps & { class?: HTMLAttributes['class'] }>()
const emits = defineEmits<ListboxItemEmits>()
const delegatedProps = reactiveOmit(props, 'class')
const forwarded = useForwardPropsEmits(delegatedProps, emits)
const id = useId()
const { filterState, allItems, allGroups } = useCommand()
const groupContext = useCommandGroup()
const isRender = computed(() => {
if (!filterState.search) {
return true
}
else {
const filteredCurrentItem = filterState.filtered.items.get(id)
// If the filtered items is undefined means not in the all times map yet
// Do the first render to add into the map
if (filteredCurrentItem === undefined) {
return true
}
// Check with filter
return filteredCurrentItem > 0
}
})
const itemRef = ref()
const currentElement = useCurrentElement(itemRef)
onMounted(() => {
if (!(currentElement.value instanceof HTMLElement))
return
// textValue to perform filter
allItems.value.set(id, currentElement.value.textContent ?? (props.value?.toString() ?? ''))
const groupId = groupContext?.id
if (groupId) {
if (!allGroups.value.has(groupId)) {
allGroups.value.set(groupId, new Set([id]))
}
else {
allGroups.value.get(groupId)?.add(id)
}
}
})
onUnmounted(() => {
allItems.value.delete(id)
})
</script>
<template>
<ListboxItem
v-if="isRender"
v-bind="forwarded"
:id="id"
ref="itemRef"
data-slot="command-item"
:class="cn('data-highlighted:bg-muted data-highlighted:text-foreground data-highlighted:*:[svg]:text-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! [&_svg:not([class*=size-])]:size-4 group/command-item data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0', props.class)"
@select="() => {
filterState.search = ''
}"
>
<slot />
<CheckIcon class="ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100" />
</ListboxItem>
</template>
@@ -0,0 +1,25 @@
<script setup lang="ts">
import type { ListboxContentProps } from 'reka-ui'
import type { HTMLAttributes } from 'vue'
import { reactiveOmit } from '@vueuse/core'
import { ListboxContent, useForwardProps } from 'reka-ui'
import { cn } from '@/lib/utils'
const props = defineProps<ListboxContentProps & { class?: HTMLAttributes['class'] }>()
const delegatedProps = reactiveOmit(props, 'class')
const forwarded = useForwardProps(delegatedProps)
</script>
<template>
<ListboxContent
data-slot="command-list"
v-bind="forwarded"
:class="cn('no-scrollbar max-h-72 scroll-py-1 outline-none overflow-x-hidden overflow-y-auto', props.class)"
>
<div role="presentation">
<slot />
</div>
</ListboxContent>
</template>
@@ -0,0 +1,21 @@
<script setup lang="ts">
import type { SeparatorProps } from 'reka-ui'
import type { HTMLAttributes } from 'vue'
import { reactiveOmit } from '@vueuse/core'
import { Separator } from 'reka-ui'
import { cn } from '@/lib/utils'
const props = defineProps<SeparatorProps & { class?: HTMLAttributes['class'] }>()
const delegatedProps = reactiveOmit(props, 'class')
</script>
<template>
<Separator
data-slot="command-separator"
v-bind="delegatedProps"
:class="cn('bg-border -mx-1 h-px', props.class)"
>
<slot />
</Separator>
</template>
@@ -0,0 +1,17 @@
<script setup lang="ts">
import type { HTMLAttributes } from 'vue'
import { cn } from '@/lib/utils'
const props = defineProps<{
class?: HTMLAttributes['class']
}>()
</script>
<template>
<span
data-slot="command-shortcut"
:class="cn('text-muted-foreground group-data-highlighted/command-item:text-foreground ml-auto text-xs tracking-widest', props.class)"
>
<slot />
</span>
</template>
+25
View File
@@ -0,0 +1,25 @@
import type { Ref } from 'vue'
import { createContext } from 'reka-ui'
export { default as Command } from './Command.vue'
export { default as CommandDialog } from './CommandDialog.vue'
export { default as CommandEmpty } from './CommandEmpty.vue'
export { default as CommandGroup } from './CommandGroup.vue'
export { default as CommandInput } from './CommandInput.vue'
export { default as CommandItem } from './CommandItem.vue'
export { default as CommandList } from './CommandList.vue'
export { default as CommandSeparator } from './CommandSeparator.vue'
export { default as CommandShortcut } from './CommandShortcut.vue'
export const [useCommand, provideCommandContext] = createContext<{
allItems: Ref<Map<string, string>>
allGroups: Ref<Map<string, Set<string>>>
filterState: {
search: string
filtered: { count: number, items: Map<string, number>, groups: Set<string> }
}
}>('Command')
export const [useCommandGroup, provideCommandGroupContext] = createContext<{
id?: string
}>('CommandGroup')
+1 -1
View File
@@ -27,7 +27,7 @@ const props = withDefaults(
>
<slot />
<DialogClose v-if="showCloseButton" as-child>
<Button variant="outline"> Close </Button>
<Button variant="outline">Close</Button>
</DialogClose>
</div>
</template>
@@ -0,0 +1,48 @@
<script setup lang="ts">
import type { AcceptableValue } from 'reka-ui'
import type { HTMLAttributes } from 'vue'
import { ChevronDownIcon } from '@lucide/vue'
import { reactiveOmit, useVModel } from '@vueuse/core'
import { cn } from '@/lib/utils'
defineOptions({
inheritAttrs: false,
})
const props = defineProps<{
modelValue?: AcceptableValue | AcceptableValue[]
class?: HTMLAttributes['class']
size?: 'sm' | 'default'
}>()
const emit = defineEmits<{
'update:modelValue': [value: AcceptableValue]
}>()
const modelValue = useVModel(props, 'modelValue', emit, {
passive: true,
defaultValue: '',
})
const delegatedProps = reactiveOmit(props, 'class', 'size')
</script>
<template>
<div
:class="cn('group/native-select relative w-fit has-[select:disabled]:opacity-50', props.class)"
data-slot="native-select-wrapper"
:data-size="props.size ?? 'default'"
>
<select
v-bind="{ ...$attrs, ...delegatedProps }"
v-model="modelValue"
data-slot="native-select"
class="border-input placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 h-8 w-full min-w-0 appearance-none rounded-lg border bg-transparent py-1 pr-8 pl-2.5 text-sm transition-colors select-none focus-visible:ring-3 aria-invalid:ring-3 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-[size=sm]:py-0.5 outline-none disabled:pointer-events-none disabled:cursor-not-allowed"
:data-size="props.size ?? 'default'"
>
<slot />
</select>
<ChevronDownIcon class="text-muted-foreground top-1/2 right-2.5 size-4 -translate-y-1/2 pointer-events-none absolute select-none" aria-hidden="true" data-slot="native-select-icon" />
</div>
</template>
@@ -0,0 +1,12 @@
<script setup lang="ts">
import type { HTMLAttributes } from 'vue'
import { cn } from '@/lib/utils'
const props = defineProps<{ class?: HTMLAttributes['class'] }>()
</script>
<template>
<optgroup data-slot="native-select-optgroup" :class="cn('bg-[Canvas] text-[CanvasText]', props.class)">
<slot />
</optgroup>
</template>
@@ -0,0 +1,12 @@
<script setup lang="ts">
import type { HTMLAttributes } from 'vue'
import { cn } from '@/lib/utils'
const props = defineProps<{ class?: HTMLAttributes['class'] }>()
</script>
<template>
<option data-slot="native-select-option" :class="cn('bg-[Canvas] text-[CanvasText]', props.class)">
<slot />
</option>
</template>
@@ -0,0 +1,3 @@
export { default as NativeSelect } from './NativeSelect.vue'
export { default as NativeSelectOptGroup } from './NativeSelectOptGroup.vue'
export { default as NativeSelectOption } from './NativeSelectOption.vue'
@@ -1,28 +0,0 @@
<script setup lang="ts">
import type { PaginationRootEmits, PaginationRootProps } from "reka-ui";
import type { HTMLAttributes } from "vue";
import { reactiveOmit } from "@vueuse/core";
import { PaginationRoot, useForwardPropsEmits } from "reka-ui";
import { cn } from "@/lib/utils";
const props = defineProps<
PaginationRootProps & {
class?: HTMLAttributes["class"];
}
>();
const emits = defineEmits<PaginationRootEmits>();
const delegatedProps = reactiveOmit(props, "class");
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<PaginationRoot
v-slot="slotProps"
data-slot="pagination"
v-bind="forwarded"
:class="cn('mx-auto flex w-full justify-center', props.class)"
>
<slot v-bind="slotProps" />
</PaginationRoot>
</template>
@@ -1,24 +0,0 @@
<script setup lang="ts">
import type { PaginationListProps } from "reka-ui";
import type { HTMLAttributes } from "vue";
import { reactiveOmit } from "@vueuse/core";
import { PaginationList } from "reka-ui";
import { cn } from "@/lib/utils";
const props = defineProps<
PaginationListProps & { class?: HTMLAttributes["class"] }
>();
const delegatedProps = reactiveOmit(props, "class");
</script>
<template>
<PaginationList
v-slot="slotProps"
data-slot="pagination-content"
v-bind="delegatedProps"
:class="cn('gap-0.5 flex items-center', props.class)"
>
<slot v-bind="slotProps" />
</PaginationList>
</template>
@@ -1,33 +0,0 @@
<script setup lang="ts">
import type { PaginationEllipsisProps } from "reka-ui";
import type { HTMLAttributes } from "vue";
import { MoreHorizontalIcon } from "@lucide/vue";
import { reactiveOmit } from "@vueuse/core";
import { PaginationEllipsis } from "reka-ui";
import { cn } from "@/lib/utils";
const props = defineProps<
PaginationEllipsisProps & { class?: HTMLAttributes["class"] }
>();
const delegatedProps = reactiveOmit(props, "class");
</script>
<template>
<PaginationEllipsis
data-slot="pagination-ellipsis"
v-bind="delegatedProps"
:class="
cn(
'size-8 [&_svg:not([class*=size-])]:size-4 flex items-center justify-center',
props.class,
)
"
>
<slot>
<MoreHorizontalIcon />
<span class="sr-only">More pages</span>
</slot>
</PaginationEllipsis>
</template>
@@ -1,39 +0,0 @@
<script setup lang="ts">
import type { PaginationFirstProps } from "reka-ui";
import type { HTMLAttributes } from "vue";
import type { ButtonVariants } from "@/components/ui/button";
import { ChevronsLeftIcon } from "@lucide/vue";
import { reactiveOmit } from "@vueuse/core";
import { PaginationFirst, useForwardProps } from "reka-ui";
import { cn } from "@/lib/utils";
import { buttonVariants } from "@/components/ui/button";
const props = withDefaults(
defineProps<
PaginationFirstProps & {
size?: ButtonVariants["size"];
class?: HTMLAttributes["class"];
}
>(),
{
size: "default",
},
);
const delegatedProps = reactiveOmit(props, "class", "size");
const forwarded = useForwardProps(delegatedProps);
</script>
<template>
<PaginationFirst
data-slot="pagination-first"
:class="cn(buttonVariants({ variant: 'ghost', size }), '', props.class)"
v-bind="forwarded"
>
<slot>
<ChevronsLeftIcon data-icon="inline-start" />
<span class="hidden sm:block">First</span>
</slot>
</PaginationFirst>
</template>
@@ -1,42 +0,0 @@
<script setup lang="ts">
import type { PaginationListItemProps } from "reka-ui";
import type { HTMLAttributes } from "vue";
import type { ButtonVariants } from "@/components/ui/button";
import { reactiveOmit } from "@vueuse/core";
import { PaginationListItem } from "reka-ui";
import { cn } from "@/lib/utils";
import { buttonVariants } from "@/components/ui/button";
const props = withDefaults(
defineProps<
PaginationListItemProps & {
size?: ButtonVariants["size"];
class?: HTMLAttributes["class"];
isActive?: boolean;
}
>(),
{
size: "icon",
},
);
const delegatedProps = reactiveOmit(props, "class", "size", "isActive");
</script>
<template>
<PaginationListItem
data-slot="pagination-item"
v-bind="delegatedProps"
:class="
cn(
buttonVariants({
variant: isActive ? 'outline' : 'ghost',
size,
}),
props.class,
)
"
>
<slot />
</PaginationListItem>
</template>
@@ -1,39 +0,0 @@
<script setup lang="ts">
import type { PaginationLastProps } from "reka-ui";
import type { HTMLAttributes } from "vue";
import type { ButtonVariants } from "@/components/ui/button";
import { ChevronsRightIcon } from "@lucide/vue";
import { reactiveOmit } from "@vueuse/core";
import { PaginationLast, useForwardProps } from "reka-ui";
import { cn } from "@/lib/utils";
import { buttonVariants } from "@/components/ui/button";
const props = withDefaults(
defineProps<
PaginationLastProps & {
size?: ButtonVariants["size"];
class?: HTMLAttributes["class"];
}
>(),
{
size: "default",
},
);
const delegatedProps = reactiveOmit(props, "class", "size");
const forwarded = useForwardProps(delegatedProps);
</script>
<template>
<PaginationLast
data-slot="pagination-last"
:class="cn(buttonVariants({ variant: 'ghost', size }), '', props.class)"
v-bind="forwarded"
>
<slot>
<span class="hidden sm:block">Last</span>
<ChevronsRightIcon data-icon="inline-end" />
</slot>
</PaginationLast>
</template>
@@ -1,40 +0,0 @@
<script setup lang="ts">
import type { HTMLAttributes } from "vue";
import type { ButtonVariants } from "@/components/ui/button";
import { cn } from "@/lib/utils";
import { buttonVariants } from "@/components/ui/button";
const props = withDefaults(
defineProps<{
href?: string;
size?: ButtonVariants["size"];
isActive?: boolean;
class?: HTMLAttributes["class"];
}>(),
{
size: "icon",
isActive: false,
},
);
</script>
<template>
<a
:href="href"
data-slot="pagination-link"
:data-active="isActive ? '' : undefined"
:aria-current="isActive ? 'page' : undefined"
:class="
cn(
buttonVariants({
variant: isActive ? 'outline' : 'ghost',
size,
}),
'',
props.class,
)
"
>
<slot />
</a>
</template>
@@ -1,41 +0,0 @@
<script setup lang="ts">
import type { PaginationNextProps } from "reka-ui";
import type { HTMLAttributes } from "vue";
import type { ButtonVariants } from "@/components/ui/button";
import { ChevronRightIcon } from "@lucide/vue";
import { reactiveOmit } from "@vueuse/core";
import { PaginationNext, useForwardProps } from "reka-ui";
import { cn } from "@/lib/utils";
import { buttonVariants } from "@/components/ui/button";
const props = withDefaults(
defineProps<
PaginationNextProps & {
size?: ButtonVariants["size"];
class?: HTMLAttributes["class"];
}
>(),
{
size: "default",
},
);
const delegatedProps = reactiveOmit(props, "class", "size");
const forwarded = useForwardProps(delegatedProps);
</script>
<template>
<PaginationNext
data-slot="pagination-next"
:class="
cn(buttonVariants({ variant: 'ghost', size }), 'pr-1.5!', props.class)
"
v-bind="forwarded"
>
<slot>
<ChevronRightIcon data-icon="inline-start" class="cn-rtl-flip" />
<span class="sr-only">Next attempt</span>
</slot>
</PaginationNext>
</template>
@@ -1,41 +0,0 @@
<script setup lang="ts">
import type { PaginationPrevProps } from "reka-ui";
import type { HTMLAttributes } from "vue";
import type { ButtonVariants } from "@/components/ui/button";
import { ChevronLeftIcon } from "@lucide/vue";
import { reactiveOmit } from "@vueuse/core";
import { PaginationPrev, useForwardProps } from "reka-ui";
import { cn } from "@/lib/utils";
import { buttonVariants } from "@/components/ui/button";
const props = withDefaults(
defineProps<
PaginationPrevProps & {
size?: ButtonVariants["size"];
class?: HTMLAttributes["class"];
}
>(),
{
size: "default",
},
);
const delegatedProps = reactiveOmit(props, "class", "size");
const forwarded = useForwardProps(delegatedProps);
</script>
<template>
<PaginationPrev
data-slot="pagination-previous"
:class="
cn(buttonVariants({ variant: 'ghost', size }), 'pl-1.5!', props.class)
"
v-bind="forwarded"
>
<slot>
<ChevronLeftIcon data-icon="inline-start" class="cn-rtl-flip" />
<span class="sr-only">Previous attempt</span>
</slot>
</PaginationPrev>
</template>
-9
View File
@@ -1,9 +0,0 @@
export { default as Pagination } from "./Pagination.vue";
export { default as PaginationContent } from "./PaginationContent.vue";
export { default as PaginationEllipsis } from "./PaginationEllipsis.vue";
export { default as PaginationFirst } from "./PaginationFirst.vue";
export { default as PaginationItem } from "./PaginationItem.vue";
export { default as PaginationLast } from "./PaginationLast.vue";
export { default as PaginationLink } from "./PaginationLink.vue";
export { default as PaginationNext } from "./PaginationNext.vue";
export { default as PaginationPrevious } from "./PaginationPrevious.vue";
@@ -1,25 +0,0 @@
<script setup lang="ts">
import type { RadioGroupRootEmits, RadioGroupRootProps } from 'reka-ui'
import type { HTMLAttributes } from 'vue'
import { reactiveOmit } from '@vueuse/core'
import { RadioGroupRoot, useForwardPropsEmits } from 'reka-ui'
import { cn } from '@/lib/utils'
const props = defineProps<RadioGroupRootProps & { class?: HTMLAttributes['class'] }>()
const emits = defineEmits<RadioGroupRootEmits>()
const delegatedProps = reactiveOmit(props, 'class')
const forwarded = useForwardPropsEmits(delegatedProps, emits)
</script>
<template>
<RadioGroupRoot
v-slot="slotProps"
data-slot="radio-group"
:class="cn('grid gap-2 w-full', props.class)"
v-bind="forwarded"
>
<slot v-bind="slotProps" />
</RadioGroupRoot>
</template>
@@ -1,41 +0,0 @@
<script setup lang="ts">
import type { RadioGroupItemProps } from 'reka-ui'
import type { HTMLAttributes } from 'vue'
import { CircleIcon } from '@lucide/vue'
import { reactiveOmit } from '@vueuse/core'
import {
RadioGroupIndicator,
RadioGroupItem,
useForwardProps,
} from 'reka-ui'
import { cn } from '@/lib/utils'
const props = defineProps<RadioGroupItemProps & { class?: HTMLAttributes['class'] }>()
const delegatedProps = reactiveOmit(props, 'class')
const forwardedProps = useForwardProps(delegatedProps)
</script>
<template>
<RadioGroupItem
data-slot="radio-group-item"
v-bind="forwardedProps"
:class="
cn(
'border-input dark:bg-input/30 data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary data-checked:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 dark:aria-invalid:border-destructive/50 flex size-4 rounded-full focus-visible:ring-3 aria-invalid:ring-3 group/radio-group-item peer relative aspect-square shrink-0 border outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50',
props.class,
)
"
>
<RadioGroupIndicator
data-slot="radio-group-indicator"
class="flex size-4 items-center justify-center"
>
<slot>
<CircleIcon class="bg-primary-foreground absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full" />
</slot>
</RadioGroupIndicator>
</RadioGroupItem>
</template>
@@ -1,2 +0,0 @@
export { default as RadioGroup } from './RadioGroup.vue'
export { default as RadioGroupItem } from './RadioGroupItem.vue'
@@ -1,31 +0,0 @@
<script setup lang="ts">
import type { ScrollAreaRootProps } from "reka-ui";
import type { HTMLAttributes } from "vue";
import { reactiveOmit } from "@vueuse/core";
import { ScrollAreaCorner, ScrollAreaRoot, ScrollAreaViewport } from "reka-ui";
import { cn } from "@/lib/utils";
import ScrollBar from "./ScrollBar.vue";
const props = defineProps<
ScrollAreaRootProps & { class?: HTMLAttributes["class"] }
>();
const delegatedProps = reactiveOmit(props, "class");
</script>
<template>
<ScrollAreaRoot
data-slot="scroll-area"
v-bind="delegatedProps"
:class="cn('relative', props.class)"
>
<ScrollAreaViewport
data-slot="scroll-area-viewport"
class="size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-1"
>
<slot />
</ScrollAreaViewport>
<ScrollBar />
<ScrollAreaCorner />
</ScrollAreaRoot>
</template>
@@ -1,35 +0,0 @@
<script setup lang="ts">
import type { ScrollAreaScrollbarProps } from "reka-ui";
import type { HTMLAttributes } from "vue";
import { reactiveOmit } from "@vueuse/core";
import { ScrollAreaScrollbar, ScrollAreaThumb } from "reka-ui";
import { cn } from "@/lib/utils";
const props = withDefaults(
defineProps<ScrollAreaScrollbarProps & { class?: HTMLAttributes["class"] }>(),
{
orientation: "vertical",
},
);
const delegatedProps = reactiveOmit(props, "class");
</script>
<template>
<ScrollAreaScrollbar
data-slot="scroll-area-scrollbar"
:data-orientation="orientation"
v-bind="delegatedProps"
:class="
cn(
'data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent flex touch-none p-px transition-colors select-none',
props.class,
)
"
>
<ScrollAreaThumb
data-slot="scroll-area-thumb"
class="rounded-full relative flex-1 bg-border"
/>
</ScrollAreaScrollbar>
</template>
@@ -1,2 +0,0 @@
export { default as ScrollArea } from "./ScrollArea.vue";
export { default as ScrollBar } from "./ScrollBar.vue";
@@ -24,15 +24,11 @@ defineEmits<{ change: [] }>();
<span class="text-muted-foreground">{{ engine }}</span>
<span class="text-muted-foreground" aria-hidden="true">/</span>
<span class="min-w-0 flex-1 truncate">{{ secretKey }}</span>
<Button variant="ghost" size="sm" class="h-7" :disabled="disabled" @click="$emit('change')">
Change
</Button>
<Button variant="ghost" size="sm" class="h-7" :disabled="disabled" @click="$emit('change')">Change</Button>
</div>
<p v-if="resolved === true" class="flex items-center gap-1.5 text-xs text-ok">
<CircleCheck class="size-3.5" aria-hidden="true" /> Credential resolved
</p>
<CircleCheck class="size-3.5" aria-hidden="true" /> Credential resolved</p>
<p v-else-if="resolved === false" class="flex items-center gap-1.5 text-xs text-danger">
<CircleAlert class="size-3.5" aria-hidden="true" /> Credential not found
</p>
<CircleAlert class="size-3.5" aria-hidden="true" /> Credential not found</p>
</div>
</template>
@@ -1,32 +0,0 @@
<script setup lang="ts" generic="T extends string">
import { RadioGroupItem, RadioGroupRoot } from "reka-ui";
import { cn } from "@/lib/utils";
defineProps<{
options: { value: T; label: string }[];
label: string;
disabled?: boolean;
class?: string;
}>();
const model = defineModel<T>({ required: true });
</script>
<template>
<RadioGroupRoot
v-model="model"
:aria-label="label"
:disabled="disabled"
orientation="horizontal"
loop
:class="cn('inline-flex h-9 items-center gap-0.5 rounded-md border border-input bg-background p-0.5', $props.class)"
>
<RadioGroupItem
v-for="option in options"
:key="option.value"
:value="option.value"
class="h-full rounded-sm px-3 text-[13px] font-medium text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring data-[state=checked]:bg-secondary data-[state=checked]:text-foreground disabled:opacity-50"
>
{{ option.label }}
</RadioGroupItem>
</RadioGroupRoot>
</template>
@@ -1 +0,0 @@
export { default as SegmentedControl } from "./SegmentedControl.vue";
@@ -16,7 +16,7 @@ defineProps<{
<div
:class="
cn(
'grid gap-2 border-t border-border py-4 md:grid-cols-[17rem_1fr] md:gap-8',
'grid gap-2 border-t border-border py-3 md:grid-cols-[17rem_1fr] md:gap-8',
tone === 'danger' && 'rounded-md border border-danger/40 bg-danger-soft px-4',
$props.class,
)
@@ -1,30 +0,0 @@
<script setup lang="ts">
import { cn } from "@/lib/utils";
defineProps<{
cells: { label: string; value: string | number; sub?: string; tone?: "default" | "warn" | "danger" }[];
class?: string;
}>();
</script>
<template>
<dl
:class="cn('grid auto-cols-fr grid-flow-col divide-x divide-border rounded-lg border border-border bg-card max-md:grid-flow-row max-md:divide-x-0 max-md:divide-y', $props.class)"
>
<div v-for="cell in cells" :key="cell.label" class="min-w-0 px-5 py-4">
<dt class="truncate text-xs text-fg-subtle">{{ cell.label }}</dt>
<dd
:class="
cn(
'mt-1 truncate text-3xl font-semibold tabular-nums',
cell.tone === 'warn' && 'text-warn',
cell.tone === 'danger' && 'text-danger',
)
"
>
{{ cell.value }}
</dd>
<dd v-if="cell.sub" class="mt-1 truncate text-xs text-fg-subtle">{{ cell.sub }}</dd>
</div>
</dl>
</template>
-1
View File
@@ -1 +0,0 @@
export { default as StatStrip } from "./StatStrip.vue";
@@ -1,33 +0,0 @@
<script setup lang="ts">
import { cva, type VariantProps } from "class-variance-authority";
import { cn } from "@/lib/utils";
const pill = cva(
"inline-flex h-6 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-full border px-2.5 text-xs font-medium",
{
variants: {
tone: {
neutral: "border-border bg-secondary text-muted-foreground",
accent: "border-primary/50 bg-transparent text-primary",
warn: "border-warn/40 bg-warn-soft text-warn",
danger: "border-danger/40 bg-danger-soft text-danger",
},
dot: {
none: "",
live: "before:size-1.5 before:rounded-full before:bg-primary",
warn: "before:size-1.5 before:rounded-full before:bg-warn",
danger: "before:size-1.5 before:rounded-full before:bg-danger",
idle: "before:size-1.5 before:rounded-full before:bg-idle",
},
},
defaultVariants: { tone: "neutral", dot: "none" },
},
);
type PillVariants = VariantProps<typeof pill>;
defineProps<{ tone?: PillVariants["tone"]; dot?: PillVariants["dot"]; class?: string }>();
</script>
<template>
<span :class="cn(pill({ tone, dot }), $props.class)"><slot /></span>
</template>
@@ -1 +0,0 @@
export { default as StatusPill } from "./StatusPill.vue";