Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/tauri/src/styles/base.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@import "./tokens.css";
@import "./motion.css";
@import "./glass.css";
@import "./button.css";

*,
*::before,
Expand Down
167 changes: 167 additions & 0 deletions apps/tauri/src/styles/button.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
/**
* QueryaButton — one control, four variants, three sizes (Flutter ui-kit).
* Prefer <QueryaButton> / class="q-btn q-btn--*" over local .btn copies.
*/

:root {
--q-btn-radius: var(--q-radius-control);
--q-btn-h-sm: var(--q-control-h-sm);
--q-btn-h-md: var(--q-control-h-md);
--q-btn-h-lg: var(--q-control-h-lg);
--q-btn-pad-sm: 8px;
--q-btn-pad-md: 12px;
--q-btn-pad-lg: 16px;
--q-btn-font-sm: 12px;
--q-btn-font-md: 13px;
--q-btn-font-lg: 14px;
}

a.q-btn {
text-decoration: none;
}

.q-btn {
appearance: none;
box-sizing: border-box;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 6px;
height: var(--q-btn-h-md);
padding: 0 var(--q-btn-pad-md);
border-radius: var(--q-btn-radius);
border: 1px solid transparent;
background: transparent;
color: var(--q-foreground);
font: inherit;
font-size: var(--q-btn-font-md);
font-weight: 500;
line-height: 1;
white-space: nowrap;
text-overflow: ellipsis;
max-width: 100%;
cursor: pointer;
user-select: none;
transition:
background-color 0.12s ease,
border-color 0.12s ease,
color 0.12s ease,
filter 0.12s ease,
opacity 0.12s ease;
}

.q-btn:focus-visible {
outline: 2px solid var(--q-ring);
outline-offset: 2px;
}

.q-btn:disabled,
.q-btn[aria-disabled="true"] {
opacity: 0.45;
cursor: default;
pointer-events: none;
}

/* Sizes — Flutter QueryaControlSize */
.q-btn--sm {
height: var(--q-btn-h-sm);
padding: 0 var(--q-btn-pad-sm);
font-size: var(--q-btn-font-sm);
gap: 6px;
}

.q-btn--md {
height: var(--q-btn-h-md);
padding: 0 var(--q-btn-pad-md);
font-size: var(--q-btn-font-md);
}

.q-btn--lg {
height: var(--q-btn-h-lg);
padding: 0 var(--q-btn-pad-lg);
font-size: var(--q-btn-font-lg);
gap: 8px;
}

/* primary — filled accent */
.q-btn--primary {
background: var(--q-primary);
border-color: transparent;
color: var(--q-primary-foreground);
font-weight: 600;
}

.q-btn--primary:hover:not(:disabled) {
filter: brightness(1.06);
}

/* secondary — outlined neutral (default .btn in old dialogs) */
.q-btn--secondary {
background: var(--q-surface);
border-color: var(--q-border);
color: var(--q-foreground);
}

.q-btn--secondary:hover:not(:disabled) {
background: var(--q-accent);
}

.q-btn--secondary.q-btn--tone-destructive {
border-color: color-mix(in srgb, var(--q-destructive) 55%, var(--q-border));
color: var(--q-destructive);
}

.q-btn--secondary.q-btn--tone-destructive:hover:not(:disabled) {
background: color-mix(in srgb, var(--q-destructive) 12%, transparent);
}

/* ghost — no fill, no outline (Cancel / Back / tertiary) */
.q-btn--ghost {
background: transparent;
border-color: transparent;
color: var(--q-foreground);
font-weight: 500;
}

.q-btn--ghost:hover:not(:disabled) {
background: var(--q-accent);
}

.q-btn--ghost.q-btn--tone-destructive {
color: var(--q-destructive);
}

.q-btn--ghost.q-btn--tone-destructive:hover:not(:disabled) {
background: color-mix(in srgb, var(--q-destructive) 12%, transparent);
}

/* destructive — filled red */
.q-btn--destructive {
background: var(--q-destructive);
border-color: transparent;
color: var(--q-destructive-foreground);
font-weight: 600;
}

.q-btn--destructive:hover:not(:disabled) {
filter: brightness(1.06);
}

/* icon-only square */
.q-btn--icon {
width: var(--q-btn-h-md);
padding: 0;
}

.q-btn--icon.q-btn--sm {
width: var(--q-btn-h-sm);
}

.q-btn--icon.q-btn--lg {
width: var(--q-btn-h-lg);
}

.q-btn--active:not(.q-btn--primary):not(.q-btn--destructive) {
background: color-mix(in srgb, var(--q-primary) 16%, transparent);
color: var(--q-primary);
}
17 changes: 5 additions & 12 deletions apps/tauri/src/ui/AboutDialog.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script setup lang="ts">
import { onMounted, onUnmounted, ref, watch } from "vue";
import { invoke } from "@tauri-apps/api/core";
import QueryaButton from "./QueryaButton.vue";

const props = defineProps<{ open: boolean }>();
const emit = defineEmits<{ close: [] }>();
Expand Down Expand Up @@ -47,7 +48,9 @@ onUnmounted(() => window.removeEventListener("keydown", onKey));
<p class="ver">Version {{ version }}</p>
<p class="desc">A lightweight desktop SQL/NoSQL client.</p>
<p class="meta">{{ stack }} · Fluid + Liquid Glass · MIT License</p>
<button type="button" class="ok" @click="emit('close')">OK</button>
<QueryaButton variant="primary" size="md" @click="emit('close')">
OK
</QueryaButton>
</div>
</div>
</template>
Expand Down Expand Up @@ -104,18 +107,8 @@ h2 {
margin-top: 4px;
}

.ok {
appearance: none;
.card :deep(.q-btn) {
margin-top: 12px;
height: 30px;
min-width: 88px;
border: 0;
border-radius: var(--q-radius-control);
background: var(--q-primary);
color: var(--q-primary-foreground);
font: inherit;
font-size: 12px;
font-weight: 600;
cursor: pointer;
}
</style>
82 changes: 23 additions & 59 deletions apps/tauri/src/ui/NewConnectionDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { computed, nextTick, onUnmounted, ref, watch } from "vue";
// Must not be named `open` — it would shadow the `open` prop/model in the
// template and make `v-if="open"` always truthy (Save connected, dialog stuck).
import { open as pickSqliteFile } from "@tauri-apps/plugin-dialog";
import QueryaButton from "./QueryaButton.vue";

export type BuiltInDriverId =
| "postgresql"
Expand Down Expand Up @@ -348,17 +349,17 @@ onUnmounted(() => window.removeEventListener("keydown", onKey, true));
</div>

<footer>
<button type="button" class="btn ghost" @click="dismiss">
<QueryaButton variant="ghost" size="lg" @click="dismiss">
Cancel
</button>
<button
type="button"
class="btn primary"
</QueryaButton>
<QueryaButton
variant="primary"
size="lg"
:disabled="!canNext"
@click="goNext"
>
Next
</button>
</QueryaButton>
</footer>
</div>

Expand Down Expand Up @@ -395,9 +396,9 @@ onUnmounted(() => window.removeEventListener("keydown", onKey, true));
placeholder="/path/to/database.db"
spellcheck="false"
/>
<button type="button" class="btn" @click="browseSqlite">
<QueryaButton variant="secondary" size="lg" @click="browseSqlite">
Browse…
</button>
</QueryaButton>
</div>
</label>
<label class="switch">
Expand All @@ -408,18 +409,20 @@ onUnmounted(() => window.removeEventListener("keydown", onKey, true));
</div>

<footer>
<button type="button" class="btn ghost" @click="goBack">Back</button>
<button type="button" class="btn ghost" @click="dismiss">
<QueryaButton variant="ghost" size="lg" @click="goBack">
Back
</QueryaButton>
<QueryaButton variant="ghost" size="lg" @click="dismiss">
Cancel
</button>
<button
type="button"
class="btn primary"
</QueryaButton>
<QueryaButton
variant="primary"
size="lg"
:disabled="!canSaveSqlite"
@click="submitSqlite"
>
Save
</button>
</QueryaButton>
</footer>
</div>

Expand Down Expand Up @@ -454,10 +457,12 @@ onUnmounted(() => window.removeEventListener("keydown", onKey, true));
</p>
</div>
<footer>
<button type="button" class="btn ghost" @click="goBack">Back</button>
<button type="button" class="btn primary" @click="dismiss">
<QueryaButton variant="ghost" size="lg" @click="goBack">
Back
</QueryaButton>
<QueryaButton variant="primary" size="lg" @click="dismiss">
Close
</button>
</QueryaButton>
</footer>
</div>
</div>
Expand Down Expand Up @@ -770,45 +775,4 @@ footer {
border-top: 1px solid color-mix(in srgb, var(--q-border) 30%, transparent);
}

.btn {
appearance: none;
height: 36px;
padding: 0 16px;
border-radius: 8px;
border: 1px solid var(--q-border);
background: var(--q-surface);
color: var(--q-foreground);
font: inherit;
font-size: 13px;
cursor: pointer;
white-space: nowrap;
}

.btn:hover:not(:disabled) {
background: var(--q-accent);
}

.btn:disabled {
opacity: 0.45;
cursor: default;
}

.btn.ghost {
border-color: transparent;
background: transparent;
}

.btn.ghost:hover:not(:disabled) {
background: var(--q-accent);
}

.btn.primary {
background: var(--q-primary);
border-color: transparent;
color: var(--q-primary-foreground);
}

.btn.primary:hover:not(:disabled) {
filter: brightness(1.06);
}
</style>
27 changes: 7 additions & 20 deletions apps/tauri/src/ui/NewFolderDialog.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script setup lang="ts">
import { nextTick, ref, watch } from "vue";
import QueryaButton from "./QueryaButton.vue";

const props = defineProps<{ open: boolean }>();
const emit = defineEmits<{
Expand Down Expand Up @@ -66,8 +67,12 @@ function onKey(e: KeyboardEvent) {
</label>
<p v-if="error" class="err">{{ error }}</p>
<footer>
<button type="button" class="btn" @click="emit('close')">Cancel</button>
<button type="button" class="btn primary" @click="submit">Create</button>
<QueryaButton variant="ghost" size="lg" @click="emit('close')">
Cancel
</QueryaButton>
<QueryaButton variant="primary" size="lg" @click="submit">
Create
</QueryaButton>
</footer>
</div>
</div>
Expand Down Expand Up @@ -134,22 +139,4 @@ footer {
margin-top: 16px;
}

.btn {
appearance: none;
height: 30px;
padding: 0 12px;
border-radius: 6px;
border: 1px solid var(--q-border);
background: var(--q-surface);
color: var(--q-foreground);
font: inherit;
font-size: 12px;
cursor: pointer;
}

.btn.primary {
background: var(--q-primary);
border-color: transparent;
color: var(--q-primary-foreground);
}
</style>
Loading
Loading