Skip to content

A self-hosted media server and file management system

fix: buttons should have outline on focus

aminnausineb71aedcfa90
diff --git a/resources/css/cedar-theme.css b/resources/css/cedar-theme.css
index 461b40bb..4da6bf2d 100644
--- a/resources/css/cedar-theme.css
+++ b/resources/css/cedar-theme.css
@@ -145,7 +145,7 @@
/* Ring */
--color-r-disabled: var(--color-neutral-700) /* neutral-700 #404040 */;
- --color-r-button: var(--color-neutral-600); /* neutral-600 #525252 */
+ --color-r-button: var(--color-neutral-800); /* neutral-600 #525252 */
--color-r-input: transparent /* to transparent */;
--color-r-default: var(--color-gray-900) /* gray-900 #101828 */;
--color-r-inverse: color-mix(in oklab, var(--color-neutral-800) 50%, transparent); /* neutral-800/50 */
diff --git a/resources/css/theme.css b/resources/css/theme.css
index ab1ded6a..d16ce7c9 100644
--- a/resources/css/theme.css
+++ b/resources/css/theme.css
@@ -240,4 +240,7 @@
.data-card {
@apply bg-surface-2 hover:bg-surface-3 dark:hover:bg-primary-dark-600 dark:bg-surface-2/70;
}
+ .button-base {
+ @apply focus:bg-surface-3 hover:bg-surface-3;
+ }
}
diff --git a/resources/js/components/cards/data/VideoCard.vue b/resources/js/components/cards/data/VideoCard.vue
index 73b35354..5332283e 100644
--- a/resources/js/components/cards/data/VideoCard.vue
+++ b/resources/js/components/cards/data/VideoCard.vue
@@ -57,9 +57,15 @@ const contextMenuItems = computed(() => {
<template>
<RouterLink
- :class="{ 'ring-primary-active ring-2': currentID === videoData.id }"
+ :class="[
+ { 'ring-primary-active focus:ring-foreground-0 ring-2 focus:outline-hidden': currentID === videoData.id },
+ 'dark:hover:bg-primary-active/70',
+ 'dark:bg-primary-dark-800/70 dark:odd:bg-primary-dark-600 hover:bg-primary/5 bg-neutral-50 odd:bg-neutral-100',
+ 'p-3',
+ 'relative flex w-full cursor-pointer flex-col flex-wrap gap-x-8 gap-y-4 rounded-md shadow-sm ring-inset',
+ 'data-card',
+ ]"
:to="encodeURI(`/${stateDirectory.name}/${stateFolder.name}?video=${videoData.id}`)"
- class="dark:bg-primary-dark-800/70 dark:odd:bg-primary-dark-600 dark:hover:bg-primary-active/70 relative flex w-full cursor-pointer flex-col flex-wrap gap-x-8 gap-y-4 rounded-md bg-neutral-50 p-3 shadow-sm ring-inset odd:bg-neutral-100 hover:bg-violet-400/30"
:videoData-id="videoData.id"
:videoData-path="`../${videoData.path}`"
@contextmenu="
diff --git a/resources/js/components/cedar-ui/button/ButtonBase.vue b/resources/js/components/cedar-ui/button/ButtonBase.vue
index 5f85575c..f10a530d 100644
--- a/resources/js/components/cedar-ui/button/ButtonBase.vue
+++ b/resources/js/components/cedar-ui/button/ButtonBase.vue
@@ -50,7 +50,7 @@ defineExpose({
:is="wrapper"
:class="
cn(
- 'transition-input ease-in-out focus:outline-hidden', // Animation
+ 'transition-input ease-in-out', // Animation
{ 'button-disabled-pointer': wrapper === 'button' && disabled }, // Disabled Button
{ 'button-disabled': disabled }, // Disabled
'flex items-center justify-center gap-2', // Layout
diff --git a/resources/js/components/cedar-ui/button/ButtonIcon.vue b/resources/js/components/cedar-ui/button/ButtonIcon.vue
index 9fba4d42..16db6b72 100644
--- a/resources/js/components/cedar-ui/button/ButtonIcon.vue
+++ b/resources/js/components/cedar-ui/button/ButtonIcon.vue
@@ -19,17 +19,6 @@ const props = withDefaults(
},
);
-const variantClass = computed(() => {
- switch (props.variant) {
- case 'ghost':
- return [];
- case 'transparent':
- return ['hover:ring-1 focus:ring-1 hover:ring-surface-1 focus:ring-surface-1 focus:bg-transparent hover:bg-transparent'];
- default:
- return ['shadow-xs', 'ring-1 ring-r-button hover:ring-primary-muted focus:ring-primary hocus:ring-2', 'bg-surface-2'];
- }
-});
-
const wrapperProps = computed(() => {
let wProps = {};
@@ -49,7 +38,13 @@ const wrapperProps = computed(() => {
<template>
<ButtonBase
v-bind="wrapperProps"
- :class="['focus:bg-surface-3 hover:bg-surface-3 aspect-square', ...variantClass]"
+ :class="[
+ 'button-base aspect-square',
+ {
+ 'hover:ring-surface-1 focus:ring-surface-1 hover:bg-transparent hover:ring-1 focus:bg-transparent focus:ring-1 focus:outline-hidden': variant === 'transparent',
+ 'ring-r-button hover:ring-primary-muted focus:ring-primary hocus:ring-2 bg-surface-2 shadow-xs ring-1 focus:outline-hidden': variant === 'default',
+ },
+ ]"
:aria-label="$slots.text ? undefined : title"
:disabled="disabled"
>
diff --git a/resources/js/components/cedar-ui/button/ButtonText.vue b/resources/js/components/cedar-ui/button/ButtonText.vue
index f09b098e..62cdd900 100644
--- a/resources/js/components/cedar-ui/button/ButtonText.vue
+++ b/resources/js/components/cedar-ui/button/ButtonText.vue
@@ -39,15 +39,15 @@ const variantClass = computed(() => {
case 'transparent':
return ['hocus:ring-1 hocus:ring-surface-1 hocus:bg-transparent'];
case 'form':
- return ['inline-flex px-4', 'border border-r-button', 'focus:ring-primary focus:ring-1 focus:ring-offset-1'];
+ return ['inline-flex px-4', 'border border-r-button', 'focus:ring-primary focus:ring-1 focus:ring-offset-1 focus:outline-hidden'];
default:
- return ['shadow-xs', 'ring-1 ring-r-button hover:ring-primary-muted focus:ring-primary hocus:ring-2', 'bg-surface-2'];
+ return ['shadow-xs', 'ring-1 ring-r-button hover:ring-primary-muted focus:ring-primary hocus:ring-2 focus:outline-hidden', 'bg-surface-2'];
}
});
</script>
<template>
- <button-base :class="cn('ring-offset-surface-0 hocus:bg-surface-3', ...variantClass)" v-bind="wrapperProps">
+ <button-base :class="cn('button-base', 'ring-offset-surface-0', ...variantClass)" v-bind="wrapperProps">
<slot>
<p class="line-clamp-1 flex-1 text-left" v-if="text">{{ text }}</p>
</slot>
diff --git a/resources/js/components/cedar-ui/multi-select/InputMultiChip.vue b/resources/js/components/cedar-ui/multi-select/InputMultiChip.vue
index f94a35d6..7f7038e5 100644
--- a/resources/js/components/cedar-ui/multi-select/InputMultiChip.vue
+++ b/resources/js/components/cedar-ui/multi-select/InputMultiChip.vue
@@ -162,11 +162,11 @@ watch(
:title="title ?? 'Make Selection'"
:disabled="disabled"
:class="[
- 'transition duration-(--duration-input) ease-in-out focus:outline-hidden', // Animation
+ 'transition-input ease-in-out focus:outline-hidden', // Animation
'disabled:button-disabled disabled:button-disabled-pointer', // Disabled
'relative flex items-center justify-between gap-2', // Layout
'cursor-pointer rounded-md shadow-xs', // Style
- 'h-10 max-h-full w-full py-2 pr-10 pl-3', // Size
+ 'h-(--input-height) max-h-full w-full py-2 pr-10 pl-3', // Size
'bg-surface-2 dark:bg-neutral-700',
'ring-r-button hocus:ring-2 ring-1',
{ 'hocus:ring-0': select.selectOpen },
diff --git a/resources/js/components/cedar-ui/select/InputSelect.vue b/resources/js/components/cedar-ui/select/InputSelect.vue
index 37e01755..4f2dce76 100644
--- a/resources/js/components/cedar-ui/select/InputSelect.vue
+++ b/resources/js/components/cedar-ui/select/InputSelect.vue
@@ -126,7 +126,7 @@ watch(
'relative flex items-center justify-between gap-2', // Layout
'cursor-pointer rounded-md shadow-xs', // Style
'h-10 max-h-full w-full py-2 pr-10 pl-3', // Size
- 'bg-surface-2 hover:bg-surface-3',
+ 'bg-surface-2 button-base',
'ring-r-button hocus:ring-2 ring-1',
{ 'hocus:ring-0': select.selectOpen },
{ 'text-foreground-3': placeholder && !select.selectedItem },
diff --git a/resources/js/components/inputs/ToggleBase.vue b/resources/js/components/inputs/ToggleBase.vue
index fa522de8..b9c26030 100755
--- a/resources/js/components/inputs/ToggleBase.vue
+++ b/resources/js/components/inputs/ToggleBase.vue
@@ -21,6 +21,7 @@ const props = withDefaults(defineProps<ToggleProps>(), { name: 'toggle', knobHor
'focus-within:bg-primary-dark-600 focus-within:has-[input:checked]:bg-primary-800',
'@container relative inline-flex h-8 w-16 cursor-pointer items-center rounded-lg',
'border-primary-dark-800 bg-primary-dark-800 border-2 transition-colors duration-(--duration-input) has-checked:bg-white',
+ 'outline-foreground-0 focus-within:outline',
props.class,
)
"
diff --git a/resources/js/components/panels/NavBar.vue b/resources/js/components/panels/NavBar.vue
index 8f2b4cac..83a08ab9 100755
--- a/resources/js/components/panels/NavBar.vue
+++ b/resources/js/components/panels/NavBar.vue
@@ -126,7 +126,7 @@ const toggleVideoSidebar = (sidebar: 'folders' | 'history') => {
<CircumMonitor height="24" width="24" />
</NavLink>
</span>
- <ToggleLightMode class="w-[68px] border border-gray-900/5 shadow-lg dark:hover:border-violet-600" />
+ <ToggleLightMode class="dark:hover:border-primary w-[68px] border border-gray-900/5 shadow-lg" />
</section>
<hr class="block w-full shrink-0" />
</nav>