mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
feat(web,a11y): replace IconButton with CircleIconButton (#9153)
* feat(web,a11y): replace IconButton with CircleIconButton * wip: cleanup * wip: bring back viewbox * fix: add label to search bar
This commit is contained in:
parent
0c9bf2835d
commit
72ce81f0c2
11 changed files with 84 additions and 111 deletions
|
|
@ -2,6 +2,7 @@
|
|||
import Icon from '$lib/components/elements/icon.svelte';
|
||||
type Color = 'transparent' | 'light' | 'dark' | 'gray' | 'primary' | 'opaque';
|
||||
|
||||
export let type: 'button' | 'submit' | 'reset' = 'button';
|
||||
export let icon: string;
|
||||
export let color: Color = 'transparent';
|
||||
export let title: string;
|
||||
|
|
@ -9,6 +10,10 @@
|
|||
export let size = '24';
|
||||
export let hideMobile = false;
|
||||
export let buttonSize: string | undefined = undefined;
|
||||
/**
|
||||
* viewBox attribute for the SVG icon.
|
||||
*/
|
||||
export let viewBox: string | undefined = undefined;
|
||||
|
||||
/**
|
||||
* Override the default styling of the button for specific use cases, such as the icon color.
|
||||
|
|
@ -32,10 +37,11 @@
|
|||
|
||||
<button
|
||||
{title}
|
||||
{type}
|
||||
style:width={buttonSize ? buttonSize + 'px' : ''}
|
||||
style:height={buttonSize ? buttonSize + 'px' : ''}
|
||||
class="flex place-content-center place-items-center rounded-full {colorClass} p-{padding} transition-all hover:dark:text-immich-dark-gray {className} {mobileClass}"
|
||||
on:click
|
||||
>
|
||||
<Icon path={icon} {size} ariaLabel={title} color="currentColor" />
|
||||
<Icon path={icon} {size} ariaLabel={title} {viewBox} color="currentColor" />
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
<script lang="ts" context="module">
|
||||
export type Color = 'transparent-primary' | 'transparent-gray' | 'overlay-primary';
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
import Button from './button.svelte';
|
||||
|
||||
export let color: Color = 'transparent-primary';
|
||||
export let title: string | undefined = undefined;
|
||||
</script>
|
||||
|
||||
<Button size="icon" {color} {title} shadow={false} rounded="full" on:click>
|
||||
<slot />
|
||||
</Button>
|
||||
Loading…
Add table
Add a link
Reference in a new issue