-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<script lang="ts"> | ||
import type { Color, Size } from '$lib/types.js'; | ||
import { cleanClass } from '$lib/utils.js'; | ||
import type { Snippet } from 'svelte'; | ||
import type { HTMLAttributes } from 'svelte/elements'; | ||
import { tv } from 'tailwind-variants'; | ||
type Props = { | ||
size?: Size; | ||
color?: Color; | ||
class?: string; | ||
children?: Snippet; | ||
} & HTMLAttributes<HTMLElement>; | ||
const { class: className, size = 'small', children, ...restProps }: Props = $props(); | ||
const styles = tv({ | ||
base: 'flex flex-col rounded-md border border-b-2 bg-subtle px-1 font-mono text-dark shadow', | ||
variants: { | ||
size: { | ||
tiny: 'text-xs', | ||
small: 'text-sm', | ||
medium: 'text-md', | ||
large: 'text-lg', | ||
giant: 'text-xl', | ||
}, | ||
}, | ||
}); | ||
</script> | ||
|
||
<kbd class={cleanClass(styles({ size }), className)} {...restProps}> | ||
{@render children?.()} | ||
</kbd> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<script lang="ts"> | ||
import ComponentExamples from '$docs/components/ComponentExamples.svelte'; | ||
import ComponentPage from '$docs/components/ComponentPage.svelte'; | ||
import BasicExample from './BasicExample.svelte'; | ||
import basicExample from './BasicExample.svelte?raw'; | ||
import SizeExample from './SizeExample.svelte'; | ||
import sizeExample from './SizeExample.svelte?raw'; | ||
</script> | ||
|
||
<ComponentPage name="Kbd"> | ||
<ComponentExamples | ||
examples={[ | ||
{ title: 'Basic', code: basicExample, component: BasicExample }, | ||
{ title: 'Size', code: sizeExample, component: SizeExample }, | ||
]} | ||
/> | ||
</ComponentPage> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<script> | ||
import { Kbd, Stack, Text } from '@immich/ui'; | ||
</script> | ||
|
||
<Stack class="items-start"> | ||
<Kbd class="border-b-2">F12</Kbd> | ||
<Kbd>SHIFT+TAB</Kbd> | ||
<Text>Press <Kbd size="small">CTRL+c</Kbd> to copy highlighted text. it.</Text> | ||
</Stack> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<script lang="ts"> | ||
import { Kbd, Stack } from '@immich/ui'; | ||
</script> | ||
|
||
<Stack class="items-start"> | ||
<Kbd size="tiny">SHIFT+TAB</Kbd> | ||
<Kbd size="small">SHIFT+TAB</Kbd> | ||
<Kbd size="medium">SHIFT+TAB</Kbd> | ||
<Kbd size="large">SHIFT+TAB</Kbd> | ||
<Kbd size="giant">SHIFT+TAB</Kbd> | ||
</Stack> |