-
Notifications
You must be signed in to change notification settings - Fork 35
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
1 parent
1fecb11
commit 55bd7b4
Showing
20 changed files
with
309 additions
and
425 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,77 +1,77 @@ | ||
<script context="module"> | ||
import { writable } from 'svelte/store'; | ||
// Store to control the dialog's open state | ||
const open = writable(false); | ||
// Function to open the dialog | ||
export function openShortcutsDialog() { | ||
open.set(true); | ||
} | ||
</script> | ||
|
||
<script lang="ts"> | ||
import * as Table from '@/components/ui/table'; | ||
import * as Dialog from '@/components/ui/dialog'; | ||
import * as Menubar from '@/components/ui/menubar'; | ||
const shortcuts = { | ||
New: 'Ctrl + Alt + N', | ||
Open: 'Ctrl + O', | ||
Save: 'Ctrl + S', | ||
Print: 'Ctrl + P', | ||
Undo: 'Ctrl + Z', | ||
Redo: 'Ctrl + Y', | ||
Cut: 'Ctrl + X', | ||
Copy: 'Ctrl + C', | ||
Paste: 'Ctrl + V', | ||
'Select All': 'Ctrl + A', | ||
'Find/Replace': 'Ctrl + F', | ||
'Go To': 'Ctrl + G', | ||
'Full Screen': 'F11' | ||
}; | ||
</script> | ||
|
||
<Dialog.Root open={$open} onOpenChange={open.set}> | ||
<Dialog.Trigger /> | ||
|
||
<Dialog.Content> | ||
<Dialog.Header> | ||
<Dialog.Title>Shortcuts</Dialog.Title> | ||
<Dialog.Description> | ||
Here is a list of keyboard shortcuts that you can use to quickly perform actions in this | ||
application. | ||
</Dialog.Description> | ||
</Dialog.Header> | ||
|
||
<div class="w-full"> | ||
<div class="sticky top-0 bg-muted"> | ||
<Table.Root class="table w-full"> | ||
<Table.Header> | ||
<Table.Row> | ||
<Table.Head class="text-center">Function</Table.Head> | ||
<Table.Head class="text-center">Shortcuts</Table.Head> | ||
</Table.Row> | ||
</Table.Header> | ||
</Table.Root> | ||
</div> | ||
|
||
<div class="max-h-[60vh] overflow-y-auto"> | ||
<Table.Root class="table w-full"> | ||
<Table.Body> | ||
{#each Object.entries(shortcuts) as [action, shortcut]} | ||
<Table.Row> | ||
<Table.Cell class="text-center">{action}</Table.Cell> | ||
<Table.Cell class="text-center"> | ||
<Menubar.Shortcut> | ||
{shortcut} | ||
</Menubar.Shortcut> | ||
</Table.Cell> | ||
</Table.Row> | ||
{/each} | ||
</Table.Body> | ||
</Table.Root> | ||
</div> | ||
</div> | ||
</Dialog.Content> | ||
</Dialog.Root> | ||
<script context="module"> | ||
import { writable } from 'svelte/store'; | ||
// Store to control the dialog's open state | ||
const open = writable(false); | ||
// Function to open the dialog | ||
export function openShortcutsDialog() { | ||
open.set(true); | ||
} | ||
</script> | ||
|
||
<script lang="ts"> | ||
import * as Table from '@/components/ui/table'; | ||
import * as Dialog from '@/components/ui/dialog'; | ||
import * as Menubar from '@/components/ui/menubar'; | ||
const shortcuts = { | ||
New: 'Ctrl + Alt + N', | ||
Open: 'Ctrl + O', | ||
Save: 'Ctrl + S', | ||
Print: 'Ctrl + P', | ||
Undo: 'Ctrl + Z', | ||
Redo: 'Ctrl + Y', | ||
Cut: 'Ctrl + X', | ||
Copy: 'Ctrl + C', | ||
Paste: 'Ctrl + V', | ||
'Select All': 'Ctrl + A', | ||
'Find/Replace': 'Ctrl + F', | ||
'Go To': 'Ctrl + G', | ||
'Full Screen': 'F11' | ||
}; | ||
</script> | ||
|
||
<Dialog.Root open={$open} onOpenChange={open.set}> | ||
<Dialog.Trigger /> | ||
|
||
<Dialog.Content> | ||
<Dialog.Header> | ||
<Dialog.Title>Shortcuts</Dialog.Title> | ||
<Dialog.Description> | ||
Here is a list of keyboard shortcuts that you can use to quickly perform actions in this | ||
application. | ||
</Dialog.Description> | ||
</Dialog.Header> | ||
|
||
<div class="w-full"> | ||
<div class="sticky top-0 bg-muted"> | ||
<Table.Root class="table w-full"> | ||
<Table.Header> | ||
<Table.Row> | ||
<Table.Head class="text-center">Function</Table.Head> | ||
<Table.Head class="text-center">Shortcuts</Table.Head> | ||
</Table.Row> | ||
</Table.Header> | ||
</Table.Root> | ||
</div> | ||
|
||
<div class="max-h-[60vh] overflow-y-auto"> | ||
<Table.Root class="table w-full"> | ||
<Table.Body> | ||
{#each Object.entries(shortcuts) as [action, shortcut]} | ||
<Table.Row> | ||
<Table.Cell class="text-center">{action}</Table.Cell> | ||
<Table.Cell class="text-center"> | ||
<Menubar.Shortcut> | ||
{shortcut} | ||
</Menubar.Shortcut> | ||
</Table.Cell> | ||
</Table.Row> | ||
{/each} | ||
</Table.Body> | ||
</Table.Root> | ||
</div> | ||
</div> | ||
</Dialog.Content> | ||
</Dialog.Root> |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24" {...$$props}> | ||
<path | ||
fill="currentColor" | ||
d="M4 19q-.825 0-1.412-.587T2 17V7q0-.825.588-1.412T4 5h16q.825 0 1.413.588T22 7v10q0 .825-.587 1.413T20 19zm4-3h8v-2H8zm-3-3h2v-2H5zm3 0h2v-2H8zm3 0h2v-2h-2zm3 0h2v-2h-2zm3 0h2v-2h-2zM5 10h2V8H5zm3 0h2V8H8zm3 0h2V8h-2zm3 0h2V8h-2zm3 0h2V8h-2z" | ||
/> | ||
</svg> | ||
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24" {...$$props}> | ||
<path | ||
fill="currentColor" | ||
d="M4 19q-.825 0-1.412-.587T2 17V7q0-.825.588-1.412T4 5h16q.825 0 1.413.588T22 7v10q0 .825-.587 1.413T20 19zm4-3h8v-2H8zm-3-3h2v-2H5zm3 0h2v-2H8zm3 0h2v-2h-2zm3 0h2v-2h-2zm3 0h2v-2h-2zM5 10h2V8H5zm3 0h2V8H8zm3 0h2V8h-2zm3 0h2V8h-2zm3 0h2V8h-2z" | ||
/> | ||
</svg> |
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 |
---|---|---|
@@ -1,16 +1,16 @@ | ||
<script lang="ts"> | ||
import { Dialog as DialogPrimitive } from "bits-ui"; | ||
import { cn } from "@/utils.js"; | ||
import { Dialog as DialogPrimitive } from 'bits-ui'; | ||
import { cn } from '@/utils.js'; | ||
type $$Props = DialogPrimitive.DescriptionProps; | ||
type $$Props = DialogPrimitive.DescriptionProps; | ||
let className: $$Props["class"] = undefined; | ||
export { className as class }; | ||
let className: $$Props['class'] = undefined; | ||
export { className as class }; | ||
</script> | ||
|
||
<DialogPrimitive.Description | ||
class={cn("text-muted-foreground text-sm", className)} | ||
{...$$restProps} | ||
class={cn('text-sm text-muted-foreground', className)} | ||
{...$$restProps} | ||
> | ||
<slot /> | ||
<slot /> | ||
</DialogPrimitive.Description> |
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 |
---|---|---|
@@ -1,16 +1,16 @@ | ||
<script lang="ts"> | ||
import type { HTMLAttributes } from "svelte/elements"; | ||
import { cn } from "@/utils.js"; | ||
import type { HTMLAttributes } from 'svelte/elements'; | ||
import { cn } from '@/utils.js'; | ||
type $$Props = HTMLAttributes<HTMLDivElement>; | ||
type $$Props = HTMLAttributes<HTMLDivElement>; | ||
let className: $$Props["class"] = undefined; | ||
export { className as class }; | ||
let className: $$Props['class'] = undefined; | ||
export { className as class }; | ||
</script> | ||
|
||
<div | ||
class={cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className)} | ||
{...$$restProps} | ||
class={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)} | ||
{...$$restProps} | ||
> | ||
<slot /> | ||
<slot /> | ||
</div> |
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 |
---|---|---|
@@ -1,21 +1,21 @@ | ||
<script lang="ts"> | ||
import { Dialog as DialogPrimitive } from "bits-ui"; | ||
import { fade } from "svelte/transition"; | ||
import { cn } from "@/utils.js"; | ||
import { Dialog as DialogPrimitive } from 'bits-ui'; | ||
import { fade } from 'svelte/transition'; | ||
import { cn } from '@/utils.js'; | ||
type $$Props = DialogPrimitive.OverlayProps; | ||
type $$Props = DialogPrimitive.OverlayProps; | ||
let className: $$Props["class"] = undefined; | ||
export let transition: $$Props["transition"] = fade; | ||
export let transitionConfig: $$Props["transitionConfig"] = { | ||
duration: 150, | ||
}; | ||
export { className as class }; | ||
let className: $$Props['class'] = undefined; | ||
export let transition: $$Props['transition'] = fade; | ||
export let transitionConfig: $$Props['transitionConfig'] = { | ||
duration: 150 | ||
}; | ||
export { className as class }; | ||
</script> | ||
|
||
<DialogPrimitive.Overlay | ||
{transition} | ||
{transitionConfig} | ||
class={cn("bg-background/80 fixed inset-0 z-50 backdrop-blur-sm ", className)} | ||
{...$$restProps} | ||
{transition} | ||
{transitionConfig} | ||
class={cn('fixed inset-0 z-50 bg-background/80 backdrop-blur-sm ', className)} | ||
{...$$restProps} | ||
/> |
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
<script lang="ts"> | ||
import { Dialog as DialogPrimitive } from "bits-ui"; | ||
import { Dialog as DialogPrimitive } from 'bits-ui'; | ||
type $$Props = DialogPrimitive.PortalProps; | ||
type $$Props = DialogPrimitive.PortalProps; | ||
</script> | ||
|
||
<DialogPrimitive.Portal {...$$restProps}> | ||
<slot /> | ||
<slot /> | ||
</DialogPrimitive.Portal> |
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 |
---|---|---|
@@ -1,16 +1,16 @@ | ||
<script lang="ts"> | ||
import { Dialog as DialogPrimitive } from "bits-ui"; | ||
import { cn } from "@/utils.js"; | ||
import { Dialog as DialogPrimitive } from 'bits-ui'; | ||
import { cn } from '@/utils.js'; | ||
type $$Props = DialogPrimitive.TitleProps; | ||
type $$Props = DialogPrimitive.TitleProps; | ||
let className: $$Props["class"] = undefined; | ||
export { className as class }; | ||
let className: $$Props['class'] = undefined; | ||
export { className as class }; | ||
</script> | ||
|
||
<DialogPrimitive.Title | ||
class={cn("text-lg font-semibold leading-none tracking-tight", className)} | ||
{...$$restProps} | ||
class={cn('text-lg font-semibold leading-none tracking-tight', className)} | ||
{...$$restProps} | ||
> | ||
<slot /> | ||
<slot /> | ||
</DialogPrimitive.Title> |
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 |
---|---|---|
@@ -1,37 +1,37 @@ | ||
import { Dialog as DialogPrimitive } from "bits-ui"; | ||
import { Dialog as DialogPrimitive } from 'bits-ui'; | ||
|
||
import Title from "./dialog-title.svelte"; | ||
import Portal from "./dialog-portal.svelte"; | ||
import Footer from "./dialog-footer.svelte"; | ||
import Header from "./dialog-header.svelte"; | ||
import Overlay from "./dialog-overlay.svelte"; | ||
import Content from "./dialog-content.svelte"; | ||
import Description from "./dialog-description.svelte"; | ||
import Title from './dialog-title.svelte'; | ||
import Portal from './dialog-portal.svelte'; | ||
import Footer from './dialog-footer.svelte'; | ||
import Header from './dialog-header.svelte'; | ||
import Overlay from './dialog-overlay.svelte'; | ||
import Content from './dialog-content.svelte'; | ||
import Description from './dialog-description.svelte'; | ||
|
||
const Root = DialogPrimitive.Root; | ||
const Trigger = DialogPrimitive.Trigger; | ||
const Close = DialogPrimitive.Close; | ||
|
||
export { | ||
Root, | ||
Title, | ||
Portal, | ||
Footer, | ||
Header, | ||
Trigger, | ||
Overlay, | ||
Content, | ||
Description, | ||
Close, | ||
// | ||
Root as Dialog, | ||
Title as DialogTitle, | ||
Portal as DialogPortal, | ||
Footer as DialogFooter, | ||
Header as DialogHeader, | ||
Trigger as DialogTrigger, | ||
Overlay as DialogOverlay, | ||
Content as DialogContent, | ||
Description as DialogDescription, | ||
Close as DialogClose, | ||
Root, | ||
Title, | ||
Portal, | ||
Footer, | ||
Header, | ||
Trigger, | ||
Overlay, | ||
Content, | ||
Description, | ||
Close, | ||
// | ||
Root as Dialog, | ||
Title as DialogTitle, | ||
Portal as DialogPortal, | ||
Footer as DialogFooter, | ||
Header as DialogHeader, | ||
Trigger as DialogTrigger, | ||
Overlay as DialogOverlay, | ||
Content as DialogContent, | ||
Description as DialogDescription, | ||
Close as DialogClose | ||
}; |
Oops, something went wrong.