diff --git a/website/src/lib/components/layer-control/LayerControl.svelte b/website/src/lib/components/layer-control/LayerControl.svelte index ba6965d5..099aff5b 100644 --- a/website/src/lib/components/layer-control/LayerControl.svelte +++ b/website/src/lib/components/layer-control/LayerControl.svelte @@ -3,8 +3,8 @@ import CustomControl from '$lib/components/custom-control/CustomControl.svelte'; import LayerTree from './LayerTree.svelte'; + import LayerControlSettings from './LayerControlSettings.svelte'; - import Label from '$lib/components/ui/label/label.svelte'; import { Separator } from '$lib/components/ui/separator'; import { ScrollArea } from '$lib/components/ui/scroll-area/index.js'; @@ -40,9 +40,9 @@
- { if (map) { @@ -53,9 +53,9 @@
- { @@ -84,7 +84,9 @@ />
-
TODO: Add layer settings
+
+ +
diff --git a/website/src/lib/components/layer-control/LayerControlSettings.svelte b/website/src/lib/components/layer-control/LayerControlSettings.svelte new file mode 100644 index 00000000..f26e730e --- /dev/null +++ b/website/src/lib/components/layer-control/LayerControlSettings.svelte @@ -0,0 +1,68 @@ + + + + + + + + + Layer settings + + Select the map layers you want to show in the interface and adjust their settings. + + + +
+ { + // TODO + }} + /> +
+
+ + +
+ { + // TODO + }} + /> +
+
+ + +
+
diff --git a/website/src/lib/components/layer-control/LayerTree.svelte b/website/src/lib/components/layer-control/LayerTree.svelte index 0c4c8d02..aca0d17f 100644 --- a/website/src/lib/components/layer-control/LayerTree.svelte +++ b/website/src/lib/components/layer-control/LayerTree.svelte @@ -2,13 +2,39 @@ import LayerTreeNode from './LayerTreeNode.svelte'; import { type LayerTreeType } from '$lib/assets/layers'; + import * as Collapsible from '$lib/components/ui/collapsible'; + import { Button } from '$lib/components/ui/button'; + + import Fa from 'svelte-fa'; + import { faChevronDown, faChevronLeft } from '@fortawesome/free-solid-svg-icons'; + export let layerTree: LayerTreeType; + export let label: string; export let name: string; export let multiple: boolean = false; export let onValueChange: (id: string, checked: boolean) => void; + + let open = true;
- + + + + + +
diff --git a/website/src/lib/components/ui/sheet/index.ts b/website/src/lib/components/ui/sheet/index.ts new file mode 100644 index 00000000..1a69032c --- /dev/null +++ b/website/src/lib/components/ui/sheet/index.ts @@ -0,0 +1,106 @@ +import { Dialog as SheetPrimitive } from "bits-ui"; +import { type VariantProps, tv } from "tailwind-variants"; + +import Portal from "./sheet-portal.svelte"; +import Overlay from "./sheet-overlay.svelte"; +import Content from "./sheet-content.svelte"; +import Header from "./sheet-header.svelte"; +import Footer from "./sheet-footer.svelte"; +import Title from "./sheet-title.svelte"; +import Description from "./sheet-description.svelte"; + +const Root = SheetPrimitive.Root; +const Close = SheetPrimitive.Close; +const Trigger = SheetPrimitive.Trigger; + +export { + Root, + Close, + Trigger, + Portal, + Overlay, + Content, + Header, + Footer, + Title, + Description, + // + Root as Sheet, + Close as SheetClose, + Trigger as SheetTrigger, + Portal as SheetPortal, + Overlay as SheetOverlay, + Content as SheetContent, + Header as SheetHeader, + Footer as SheetFooter, + Title as SheetTitle, + Description as SheetDescription, +}; + +export const sheetVariants = tv({ + base: "fixed z-50 gap-4 bg-background p-6 shadow-lg", + variants: { + side: { + top: "inset-x-0 top-0 border-b", + bottom: "inset-x-0 bottom-0 border-t", + left: "inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm", + right: "inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm", + }, + }, + defaultVariants: { + side: "right", + }, +}); + +export const sheetTransitions = { + top: { + in: { + y: "-100%", + duration: 500, + opacity: 1, + }, + out: { + y: "-100%", + duration: 300, + opacity: 1, + }, + }, + bottom: { + in: { + y: "100%", + duration: 500, + opacity: 1, + }, + out: { + y: "100%", + duration: 300, + opacity: 1, + }, + }, + left: { + in: { + x: "-100%", + duration: 500, + opacity: 1, + }, + out: { + x: "-100%", + duration: 300, + opacity: 1, + }, + }, + right: { + in: { + x: "100%", + duration: 500, + opacity: 1, + }, + out: { + x: "100%", + duration: 300, + opacity: 1, + }, + }, +}; + +export type Side = VariantProps["side"]; diff --git a/website/src/lib/components/ui/sheet/sheet-content.svelte b/website/src/lib/components/ui/sheet/sheet-content.svelte new file mode 100644 index 00000000..b545c902 --- /dev/null +++ b/website/src/lib/components/ui/sheet/sheet-content.svelte @@ -0,0 +1,47 @@ + + + + + + + + + Close + + + diff --git a/website/src/lib/components/ui/sheet/sheet-description.svelte b/website/src/lib/components/ui/sheet/sheet-description.svelte new file mode 100644 index 00000000..e1827e1b --- /dev/null +++ b/website/src/lib/components/ui/sheet/sheet-description.svelte @@ -0,0 +1,13 @@ + + + + + diff --git a/website/src/lib/components/ui/sheet/sheet-footer.svelte b/website/src/lib/components/ui/sheet/sheet-footer.svelte new file mode 100644 index 00000000..a235d1f8 --- /dev/null +++ b/website/src/lib/components/ui/sheet/sheet-footer.svelte @@ -0,0 +1,16 @@ + + +
+ +
diff --git a/website/src/lib/components/ui/sheet/sheet-header.svelte b/website/src/lib/components/ui/sheet/sheet-header.svelte new file mode 100644 index 00000000..2650ef9f --- /dev/null +++ b/website/src/lib/components/ui/sheet/sheet-header.svelte @@ -0,0 +1,13 @@ + + +
+ +
diff --git a/website/src/lib/components/ui/sheet/sheet-overlay.svelte b/website/src/lib/components/ui/sheet/sheet-overlay.svelte new file mode 100644 index 00000000..37090922 --- /dev/null +++ b/website/src/lib/components/ui/sheet/sheet-overlay.svelte @@ -0,0 +1,21 @@ + + + diff --git a/website/src/lib/components/ui/sheet/sheet-portal.svelte b/website/src/lib/components/ui/sheet/sheet-portal.svelte new file mode 100644 index 00000000..5543a3b3 --- /dev/null +++ b/website/src/lib/components/ui/sheet/sheet-portal.svelte @@ -0,0 +1,13 @@ + + + + + diff --git a/website/src/lib/components/ui/sheet/sheet-title.svelte b/website/src/lib/components/ui/sheet/sheet-title.svelte new file mode 100644 index 00000000..86314106 --- /dev/null +++ b/website/src/lib/components/ui/sheet/sheet-title.svelte @@ -0,0 +1,16 @@ + + + + +