@lobb-js/studio 0.7.1 → 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -2
- package/src/App.svelte +5 -0
- package/src/app.css +124 -0
- package/src/lib/components/LlmButton.svelte +137 -0
- package/src/lib/components/Studio.svelte +129 -0
- package/src/lib/components/alertView.svelte +20 -0
- package/src/lib/components/breadCrumbs.svelte +60 -0
- package/src/lib/components/codeEditor.svelte +152 -0
- package/src/lib/components/combobox.svelte +92 -0
- package/src/lib/components/confirmationDialog/confirmationDialog.svelte +33 -0
- package/src/lib/components/confirmationDialog/store.svelte.ts +28 -0
- package/src/lib/components/createManyButton.svelte +109 -0
- package/src/lib/components/dataTable/childRecords.svelte +142 -0
- package/src/lib/components/dataTable/dataTable.svelte +225 -0
- package/src/lib/components/dataTable/fieldCell.svelte +77 -0
- package/src/lib/components/dataTable/filter.svelte +284 -0
- package/src/lib/components/dataTable/filterButton.svelte +39 -0
- package/src/lib/components/dataTable/footer.svelte +84 -0
- package/src/lib/components/dataTable/header.svelte +155 -0
- package/src/lib/components/dataTable/sort.svelte +173 -0
- package/src/lib/components/dataTable/sortButton.svelte +36 -0
- package/src/lib/components/dataTable/table.svelte +337 -0
- package/src/lib/components/dataTable/utils.ts +127 -0
- package/src/lib/components/detailView/create/children.svelte +70 -0
- package/src/lib/components/detailView/create/createDetailView.svelte +228 -0
- package/src/lib/components/detailView/create/createDetailViewButton.svelte +37 -0
- package/src/lib/components/detailView/create/createManyView.svelte +252 -0
- package/src/lib/components/detailView/create/subRecords.svelte +50 -0
- package/src/lib/components/detailView/detailViewForm.svelte +104 -0
- package/src/lib/components/detailView/fieldCustomInput.svelte +26 -0
- package/src/lib/components/detailView/fieldInput.svelte +258 -0
- package/src/lib/components/detailView/fieldInputReplacement.svelte +199 -0
- package/src/lib/components/detailView/store.svelte.ts +59 -0
- package/src/lib/components/detailView/update/children.svelte +96 -0
- package/src/lib/components/detailView/update/updateDetailView.svelte +176 -0
- package/src/lib/components/detailView/update/updateDetailViewButton.svelte +56 -0
- package/src/lib/components/detailView/utils.ts +176 -0
- package/src/lib/components/diffViewer.svelte +105 -0
- package/src/lib/components/drawer.svelte +28 -0
- package/src/lib/components/extensionsComponents.svelte +33 -0
- package/src/lib/components/foreingKeyInput.svelte +80 -0
- package/src/lib/components/header.svelte +45 -0
- package/src/lib/components/loadingTypesForMonacoEditor.ts +36 -0
- package/src/lib/components/miniSidebar.svelte +226 -0
- package/src/lib/components/rangeCalendarButton.svelte +257 -0
- package/src/lib/components/richTextEditor.svelte +284 -0
- package/src/lib/components/routes/collections/collection.svelte +57 -0
- package/src/lib/components/routes/collections/collections.svelte +45 -0
- package/src/lib/components/routes/data_model/dataModel.svelte +40 -0
- package/src/lib/components/routes/data_model/flow.css +22 -0
- package/src/lib/components/routes/data_model/flow.svelte +84 -0
- package/src/lib/components/routes/data_model/syncManager.svelte +94 -0
- package/src/lib/components/routes/data_model/utils.ts +35 -0
- package/src/lib/components/routes/extensions/extension.svelte +19 -0
- package/src/lib/components/routes/home.svelte +40 -0
- package/src/lib/components/routes/workflows/workflows.svelte +136 -0
- package/src/lib/components/selectRecord.svelte +130 -0
- package/src/lib/components/setServerPage.svelte +50 -0
- package/src/lib/components/sidebar/index.ts +4 -0
- package/src/lib/components/sidebar/sidebar.svelte +149 -0
- package/src/lib/components/sidebar/sidebarElements.svelte +144 -0
- package/src/lib/components/sidebar/sidebarTrigger.svelte +33 -0
- package/src/lib/components/singletone.svelte +71 -0
- package/src/lib/components/ui/accordion/accordion-content.svelte +22 -0
- package/src/lib/components/ui/accordion/accordion-item.svelte +12 -0
- package/src/lib/components/ui/accordion/accordion-trigger.svelte +31 -0
- package/src/lib/components/ui/accordion/index.ts +17 -0
- package/src/lib/components/ui/alert/alert-description.svelte +16 -0
- package/src/lib/components/ui/alert/alert-title.svelte +24 -0
- package/src/lib/components/ui/alert/alert.svelte +39 -0
- package/src/lib/components/ui/alert/index.ts +14 -0
- package/src/lib/components/ui/alert-dialog/alert-dialog-action.svelte +13 -0
- package/src/lib/components/ui/alert-dialog/alert-dialog-cancel.svelte +17 -0
- package/src/lib/components/ui/alert-dialog/alert-dialog-content.svelte +26 -0
- package/src/lib/components/ui/alert-dialog/alert-dialog-description.svelte +16 -0
- package/src/lib/components/ui/alert-dialog/alert-dialog-footer.svelte +20 -0
- package/src/lib/components/ui/alert-dialog/alert-dialog-header.svelte +20 -0
- package/src/lib/components/ui/alert-dialog/alert-dialog-overlay.svelte +19 -0
- package/src/lib/components/ui/alert-dialog/alert-dialog-title.svelte +18 -0
- package/src/lib/components/ui/alert-dialog/index.ts +40 -0
- package/src/lib/components/ui/breadcrumb/breadcrumb-ellipsis.svelte +23 -0
- package/src/lib/components/ui/breadcrumb/breadcrumb-item.svelte +16 -0
- package/src/lib/components/ui/breadcrumb/breadcrumb-link.svelte +31 -0
- package/src/lib/components/ui/breadcrumb/breadcrumb-list.svelte +23 -0
- package/src/lib/components/ui/breadcrumb/breadcrumb-page.svelte +23 -0
- package/src/lib/components/ui/breadcrumb/breadcrumb-separator.svelte +27 -0
- package/src/lib/components/ui/breadcrumb/breadcrumb.svelte +15 -0
- package/src/lib/components/ui/breadcrumb/index.ts +25 -0
- package/src/lib/components/ui/button/button.svelte +110 -0
- package/src/lib/components/ui/button/index.ts +17 -0
- package/src/lib/components/ui/checkbox/checkbox.svelte +35 -0
- package/src/lib/components/ui/checkbox/index.ts +6 -0
- package/src/lib/components/ui/command/command-dialog.svelte +35 -0
- package/src/lib/components/ui/command/command-empty.svelte +12 -0
- package/src/lib/components/ui/command/command-group.svelte +31 -0
- package/src/lib/components/ui/command/command-input.svelte +25 -0
- package/src/lib/components/ui/command/command-item.svelte +19 -0
- package/src/lib/components/ui/command/command-link-item.svelte +19 -0
- package/src/lib/components/ui/command/command-list.svelte +16 -0
- package/src/lib/components/ui/command/command-separator.svelte +12 -0
- package/src/lib/components/ui/command/command-shortcut.svelte +20 -0
- package/src/lib/components/ui/command/command.svelte +21 -0
- package/src/lib/components/ui/command/index.ts +40 -0
- package/src/lib/components/ui/dialog/dialog-content.svelte +38 -0
- package/src/lib/components/ui/dialog/dialog-description.svelte +16 -0
- package/src/lib/components/ui/dialog/dialog-footer.svelte +20 -0
- package/src/lib/components/ui/dialog/dialog-header.svelte +20 -0
- package/src/lib/components/ui/dialog/dialog-overlay.svelte +19 -0
- package/src/lib/components/ui/dialog/dialog-title.svelte +16 -0
- package/src/lib/components/ui/dialog/index.ts +37 -0
- package/src/lib/components/ui/input/index.ts +7 -0
- package/src/lib/components/ui/input/input.svelte +46 -0
- package/src/lib/components/ui/label/index.ts +7 -0
- package/src/lib/components/ui/label/label.svelte +19 -0
- package/src/lib/components/ui/popover/index.ts +17 -0
- package/src/lib/components/ui/popover/popover-content.svelte +28 -0
- package/src/lib/components/ui/range-calendar/index.ts +30 -0
- package/src/lib/components/ui/range-calendar/range-calendar-cell.svelte +19 -0
- package/src/lib/components/ui/range-calendar/range-calendar-day.svelte +35 -0
- package/src/lib/components/ui/range-calendar/range-calendar-grid-body.svelte +12 -0
- package/src/lib/components/ui/range-calendar/range-calendar-grid-head.svelte +12 -0
- package/src/lib/components/ui/range-calendar/range-calendar-grid-row.svelte +12 -0
- package/src/lib/components/ui/range-calendar/range-calendar-grid.svelte +16 -0
- package/src/lib/components/ui/range-calendar/range-calendar-head-cell.svelte +16 -0
- package/src/lib/components/ui/range-calendar/range-calendar-header.svelte +16 -0
- package/src/lib/components/ui/range-calendar/range-calendar-heading.svelte +16 -0
- package/src/lib/components/ui/range-calendar/range-calendar-months.svelte +20 -0
- package/src/lib/components/ui/range-calendar/range-calendar-next-button.svelte +27 -0
- package/src/lib/components/ui/range-calendar/range-calendar-prev-button.svelte +27 -0
- package/src/lib/components/ui/range-calendar/range-calendar.svelte +57 -0
- package/src/lib/components/ui/select/index.ts +34 -0
- package/src/lib/components/ui/select/select-content.svelte +38 -0
- package/src/lib/components/ui/select/select-group-heading.svelte +16 -0
- package/src/lib/components/ui/select/select-item.svelte +37 -0
- package/src/lib/components/ui/select/select-scroll-down-button.svelte +19 -0
- package/src/lib/components/ui/select/select-scroll-up-button.svelte +19 -0
- package/src/lib/components/ui/select/select-separator.svelte +13 -0
- package/src/lib/components/ui/select/select-trigger.svelte +24 -0
- package/src/lib/components/ui/separator/index.ts +7 -0
- package/src/lib/components/ui/separator/separator.svelte +22 -0
- package/src/lib/components/ui/skeleton/index.ts +7 -0
- package/src/lib/components/ui/skeleton/skeleton.svelte +22 -0
- package/src/lib/components/ui/sonner/index.ts +1 -0
- package/src/lib/components/ui/sonner/sonner.svelte +20 -0
- package/src/lib/components/ui/switch/index.ts +7 -0
- package/src/lib/components/ui/switch/switch.svelte +27 -0
- package/src/lib/components/ui/textarea/index.ts +7 -0
- package/src/lib/components/ui/textarea/textarea.svelte +22 -0
- package/src/lib/components/ui/tooltip/index.ts +18 -0
- package/src/lib/components/ui/tooltip/tooltip-content.svelte +21 -0
- package/src/lib/components/workflowEditor.svelte +188 -0
- package/src/lib/context.ts +22 -0
- package/src/lib/eventSystem.ts +40 -0
- package/src/lib/extensions/extension.types.ts +92 -0
- package/src/lib/extensions/extensionUtils.ts +156 -0
- package/src/lib/index.ts +24 -0
- package/src/lib/store.svelte.ts +13 -0
- package/src/lib/store.types.ts +28 -0
- package/src/lib/utils.ts +68 -0
- package/src/main.ts +18 -0
- package/src/stories/detailView/detailViewForm.stories.svelte +79 -0
- package/src/vite-env.d.ts +2 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Save } from "lucide-svelte";
|
|
3
|
+
import DetailViewForm from "./detailView/detailViewForm.svelte";
|
|
4
|
+
import { getCollectionFields } from "./detailView/utils";
|
|
5
|
+
import SidebarTrigger from "./sidebar/sidebarTrigger.svelte";
|
|
6
|
+
import Button from "./ui/button/button.svelte";
|
|
7
|
+
import { onMount } from "svelte";
|
|
8
|
+
import { getStudioContext } from "../context";
|
|
9
|
+
|
|
10
|
+
const { lobb, ctx } = getStudioContext();
|
|
11
|
+
import { toast } from "svelte-sonner";
|
|
12
|
+
import Skeleton from "./ui/skeleton/skeleton.svelte";
|
|
13
|
+
|
|
14
|
+
interface Props {
|
|
15
|
+
collectionName: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
let {
|
|
19
|
+
collectionName,
|
|
20
|
+
}: Props = $props();
|
|
21
|
+
|
|
22
|
+
let entry = $state({});
|
|
23
|
+
let loading = $state(true);
|
|
24
|
+
let singletonExists = $state(true);
|
|
25
|
+
const formFields = getCollectionFields(ctx, collectionName);
|
|
26
|
+
|
|
27
|
+
onMount(async () => {
|
|
28
|
+
const result = await lobb.readSingleton(collectionName);
|
|
29
|
+
const json = await result.json();
|
|
30
|
+
if (result.status === 404) {
|
|
31
|
+
singletonExists = false;
|
|
32
|
+
} else {
|
|
33
|
+
entry = json.data;
|
|
34
|
+
}
|
|
35
|
+
loading = false;
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
async function handleSave() {
|
|
39
|
+
const response = await lobb.updateSingleton(collectionName, entry);
|
|
40
|
+
if (response.status < 400) {
|
|
41
|
+
toast.success("The Singleton was updated successfully");
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<div>
|
|
47
|
+
<div class="flex justify-between items-center gap-2 p-2 border-b bg-background h-10">
|
|
48
|
+
<div class="flex items-center gap-1">
|
|
49
|
+
<SidebarTrigger />
|
|
50
|
+
</div>
|
|
51
|
+
<div>
|
|
52
|
+
<Button
|
|
53
|
+
class="h-7 px-2 font-normal text-xs"
|
|
54
|
+
Icon={Save}
|
|
55
|
+
onclick={handleSave}
|
|
56
|
+
>
|
|
57
|
+
Save
|
|
58
|
+
</Button>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
{#if loading}
|
|
63
|
+
<div class="flex flex-col gap-2 p-2 w-full">
|
|
64
|
+
<Skeleton class="h-8 w-full" />
|
|
65
|
+
<Skeleton class="h-8 w-[80%]" />
|
|
66
|
+
<Skeleton class="h-8 w-[60%]" />
|
|
67
|
+
</div>
|
|
68
|
+
{:else}
|
|
69
|
+
<DetailViewForm bind:value={entry} fields={formFields} />
|
|
70
|
+
{/if}
|
|
71
|
+
</div>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Accordion as AccordionPrimitive, type WithoutChild } from "bits-ui";
|
|
3
|
+
import { cn } from "../../../utils.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
children,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithoutChild<AccordionPrimitive.ContentProps> = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<AccordionPrimitive.Content
|
|
14
|
+
bind:ref
|
|
15
|
+
class={cn(
|
|
16
|
+
"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",
|
|
17
|
+
className
|
|
18
|
+
)}
|
|
19
|
+
{...restProps}
|
|
20
|
+
>
|
|
21
|
+
{@render children?.()}
|
|
22
|
+
</AccordionPrimitive.Content>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Accordion as AccordionPrimitive } from "bits-ui";
|
|
3
|
+
import { cn } from "../../../utils.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: AccordionPrimitive.ItemProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<AccordionPrimitive.Item bind:ref class={cn("border-b", className)} {...restProps} />
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Accordion as AccordionPrimitive, type WithoutChild } from "bits-ui";
|
|
3
|
+
import ChevronDown from "@lucide/svelte/icons/chevron-down";
|
|
4
|
+
import { cn } from "../../../utils.js";
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
level = 3,
|
|
10
|
+
children,
|
|
11
|
+
...restProps
|
|
12
|
+
}: WithoutChild<AccordionPrimitive.TriggerProps> & {
|
|
13
|
+
level?: AccordionPrimitive.HeaderProps["level"];
|
|
14
|
+
} = $props();
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<AccordionPrimitive.Header {level} class="flex">
|
|
18
|
+
<AccordionPrimitive.Trigger
|
|
19
|
+
bind:ref
|
|
20
|
+
class={cn(
|
|
21
|
+
"flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",
|
|
22
|
+
className
|
|
23
|
+
)}
|
|
24
|
+
{...restProps}
|
|
25
|
+
>
|
|
26
|
+
{@render children?.()}
|
|
27
|
+
<ChevronDown
|
|
28
|
+
class="text-muted-foreground size-4 shrink-0 transition-transform duration-200"
|
|
29
|
+
/>
|
|
30
|
+
</AccordionPrimitive.Trigger>
|
|
31
|
+
</AccordionPrimitive.Header>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Accordion as AccordionPrimitive } from "bits-ui";
|
|
2
|
+
import Content from "./accordion-content.svelte";
|
|
3
|
+
import Item from "./accordion-item.svelte";
|
|
4
|
+
import Trigger from "./accordion-trigger.svelte";
|
|
5
|
+
|
|
6
|
+
const Root = AccordionPrimitive.Root;
|
|
7
|
+
export {
|
|
8
|
+
Root,
|
|
9
|
+
Content,
|
|
10
|
+
Item,
|
|
11
|
+
Trigger,
|
|
12
|
+
//
|
|
13
|
+
Root as Accordion,
|
|
14
|
+
Content as AccordionContent,
|
|
15
|
+
Item as AccordionItem,
|
|
16
|
+
Trigger as AccordionTrigger,
|
|
17
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { WithElementRef } from "bits-ui";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
import { cn } from "../../../utils.js";
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
children,
|
|
10
|
+
...restProps
|
|
11
|
+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<div bind:this={ref} class={cn("text-sm [&_p]:leading-relaxed", className)} {...restProps}>
|
|
15
|
+
{@render children?.()}
|
|
16
|
+
</div>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
+
import type { WithElementRef } from "bits-ui";
|
|
4
|
+
import { cn } from "../../../utils.js";
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
level = 5,
|
|
10
|
+
children,
|
|
11
|
+
...restProps
|
|
12
|
+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> & {
|
|
13
|
+
level?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
14
|
+
} = $props();
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<div
|
|
18
|
+
bind:this={ref}
|
|
19
|
+
aria-level={level}
|
|
20
|
+
class={cn("mb-1 font-medium leading-none tracking-tight", className)}
|
|
21
|
+
{...restProps}
|
|
22
|
+
>
|
|
23
|
+
{@render children?.()}
|
|
24
|
+
</div>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import { type VariantProps, tv } from "tailwind-variants";
|
|
3
|
+
|
|
4
|
+
export const alertVariants = tv({
|
|
5
|
+
base: "[&>svg]:text-foreground relative w-full rounded-lg border px-4 py-3 text-sm [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg~*]:pl-7",
|
|
6
|
+
variants: {
|
|
7
|
+
variant: {
|
|
8
|
+
default: "bg-background text-foreground",
|
|
9
|
+
destructive:
|
|
10
|
+
"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
defaultVariants: {
|
|
14
|
+
variant: "default",
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export type AlertVariant = VariantProps<typeof alertVariants>["variant"];
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<script lang="ts">
|
|
22
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
23
|
+
import type { WithElementRef } from "bits-ui";
|
|
24
|
+
import { cn } from "../../../utils.js";
|
|
25
|
+
|
|
26
|
+
let {
|
|
27
|
+
ref = $bindable(null),
|
|
28
|
+
class: className,
|
|
29
|
+
variant = "default",
|
|
30
|
+
children,
|
|
31
|
+
...restProps
|
|
32
|
+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> & {
|
|
33
|
+
variant?: AlertVariant;
|
|
34
|
+
} = $props();
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<div bind:this={ref} class={cn(alertVariants({ variant }), className)} {...restProps} role="alert">
|
|
38
|
+
{@render children?.()}
|
|
39
|
+
</div>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import Root from "./alert.svelte";
|
|
2
|
+
import Description from "./alert-description.svelte";
|
|
3
|
+
import Title from "./alert-title.svelte";
|
|
4
|
+
export { alertVariants, type AlertVariant } from "./alert.svelte";
|
|
5
|
+
|
|
6
|
+
export {
|
|
7
|
+
Root,
|
|
8
|
+
Description,
|
|
9
|
+
Title,
|
|
10
|
+
//
|
|
11
|
+
Root as Alert,
|
|
12
|
+
Description as AlertDescription,
|
|
13
|
+
Title as AlertTitle,
|
|
14
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
|
|
3
|
+
import { buttonVariants } from "../../../components/ui/button/index.js";
|
|
4
|
+
import { cn } from "../../../utils.js";
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
class: className,
|
|
8
|
+
ref = $bindable(null),
|
|
9
|
+
...restProps
|
|
10
|
+
}: AlertDialogPrimitive.ActionProps = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<AlertDialogPrimitive.Action bind:ref class={cn(buttonVariants(), className)} {...restProps} />
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
|
|
3
|
+
import { buttonVariants } from "../../../components/ui/button/index.js";
|
|
4
|
+
import { cn } from "../../../utils.js";
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
class: className,
|
|
8
|
+
ref = $bindable(null),
|
|
9
|
+
...restProps
|
|
10
|
+
}: AlertDialogPrimitive.CancelProps = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<AlertDialogPrimitive.Cancel
|
|
14
|
+
bind:ref
|
|
15
|
+
class={cn(buttonVariants({ variant: "outline" }), "mt-2 sm:mt-0", className)}
|
|
16
|
+
{...restProps}
|
|
17
|
+
/>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { AlertDialog as AlertDialogPrimitive, type WithoutChild } from "bits-ui";
|
|
3
|
+
import AlertDialogOverlay from "./alert-dialog-overlay.svelte";
|
|
4
|
+
import { cn } from "../../../utils.js";
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
portalProps,
|
|
10
|
+
...restProps
|
|
11
|
+
}: WithoutChild<AlertDialogPrimitive.ContentProps> & {
|
|
12
|
+
portalProps?: AlertDialogPrimitive.PortalProps;
|
|
13
|
+
} = $props();
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<AlertDialogPrimitive.Portal {...portalProps}>
|
|
17
|
+
<AlertDialogOverlay />
|
|
18
|
+
<AlertDialogPrimitive.Content
|
|
19
|
+
bind:ref
|
|
20
|
+
class={cn(
|
|
21
|
+
"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",
|
|
22
|
+
className
|
|
23
|
+
)}
|
|
24
|
+
{...restProps}
|
|
25
|
+
/>
|
|
26
|
+
</AlertDialogPrimitive.Portal>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
|
|
3
|
+
import { cn } from "../../../utils.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
class: className,
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
...restProps
|
|
9
|
+
}: AlertDialogPrimitive.DescriptionProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<AlertDialogPrimitive.Description
|
|
13
|
+
bind:ref
|
|
14
|
+
class={cn("text-muted-foreground text-sm", className)}
|
|
15
|
+
{...restProps}
|
|
16
|
+
/>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { WithElementRef } from "bits-ui";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
import { cn } from "../../../utils.js";
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
children,
|
|
10
|
+
...restProps
|
|
11
|
+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<div
|
|
15
|
+
bind:this={ref}
|
|
16
|
+
class={cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className)}
|
|
17
|
+
{...restProps}
|
|
18
|
+
>
|
|
19
|
+
{@render children?.()}
|
|
20
|
+
</div>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { WithElementRef } from "bits-ui";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
import { cn } from "../../../utils.js";
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
children,
|
|
10
|
+
...restProps
|
|
11
|
+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<div
|
|
15
|
+
bind:this={ref}
|
|
16
|
+
class={cn("flex flex-col space-y-2 text-center sm:text-left", className)}
|
|
17
|
+
{...restProps}
|
|
18
|
+
>
|
|
19
|
+
{@render children?.()}
|
|
20
|
+
</div>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
|
|
3
|
+
import { cn } from "../../../utils.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
class: className,
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
...restProps
|
|
9
|
+
}: AlertDialogPrimitive.OverlayProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<AlertDialogPrimitive.Overlay
|
|
13
|
+
bind:ref
|
|
14
|
+
class={cn(
|
|
15
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80",
|
|
16
|
+
className
|
|
17
|
+
)}
|
|
18
|
+
{...restProps}
|
|
19
|
+
/>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
|
|
3
|
+
import { cn } from "../../../utils.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
class: className,
|
|
7
|
+
level = 3,
|
|
8
|
+
ref = $bindable(null),
|
|
9
|
+
...restProps
|
|
10
|
+
}: AlertDialogPrimitive.TitleProps = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<AlertDialogPrimitive.Title
|
|
14
|
+
bind:ref
|
|
15
|
+
class={cn("text-lg font-semibold", className)}
|
|
16
|
+
{level}
|
|
17
|
+
{...restProps}
|
|
18
|
+
/>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
|
|
2
|
+
|
|
3
|
+
import Title from "./alert-dialog-title.svelte";
|
|
4
|
+
import Action from "./alert-dialog-action.svelte";
|
|
5
|
+
import Cancel from "./alert-dialog-cancel.svelte";
|
|
6
|
+
import Footer from "./alert-dialog-footer.svelte";
|
|
7
|
+
import Header from "./alert-dialog-header.svelte";
|
|
8
|
+
import Overlay from "./alert-dialog-overlay.svelte";
|
|
9
|
+
import Content from "./alert-dialog-content.svelte";
|
|
10
|
+
import Description from "./alert-dialog-description.svelte";
|
|
11
|
+
|
|
12
|
+
const Root = AlertDialogPrimitive.Root;
|
|
13
|
+
const Trigger = AlertDialogPrimitive.Trigger;
|
|
14
|
+
const Portal = AlertDialogPrimitive.Portal;
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
Root,
|
|
18
|
+
Title,
|
|
19
|
+
Action,
|
|
20
|
+
Cancel,
|
|
21
|
+
Portal,
|
|
22
|
+
Footer,
|
|
23
|
+
Header,
|
|
24
|
+
Trigger,
|
|
25
|
+
Overlay,
|
|
26
|
+
Content,
|
|
27
|
+
Description,
|
|
28
|
+
//
|
|
29
|
+
Root as AlertDialog,
|
|
30
|
+
Title as AlertDialogTitle,
|
|
31
|
+
Action as AlertDialogAction,
|
|
32
|
+
Cancel as AlertDialogCancel,
|
|
33
|
+
Portal as AlertDialogPortal,
|
|
34
|
+
Footer as AlertDialogFooter,
|
|
35
|
+
Header as AlertDialogHeader,
|
|
36
|
+
Trigger as AlertDialogTrigger,
|
|
37
|
+
Overlay as AlertDialogOverlay,
|
|
38
|
+
Content as AlertDialogContent,
|
|
39
|
+
Description as AlertDialogDescription,
|
|
40
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Ellipsis from "@lucide/svelte/icons/ellipsis";
|
|
3
|
+
import type { WithElementRef, WithoutChildren } from "bits-ui";
|
|
4
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
5
|
+
import { cn } from "../../../utils.js";
|
|
6
|
+
|
|
7
|
+
let {
|
|
8
|
+
ref = $bindable(null),
|
|
9
|
+
class: className,
|
|
10
|
+
...restProps
|
|
11
|
+
}: WithoutChildren<WithElementRef<HTMLAttributes<HTMLSpanElement>>> = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<span
|
|
15
|
+
bind:this={ref}
|
|
16
|
+
role="presentation"
|
|
17
|
+
aria-hidden="true"
|
|
18
|
+
class={cn("flex size-9 items-center justify-center", className)}
|
|
19
|
+
{...restProps}
|
|
20
|
+
>
|
|
21
|
+
<Ellipsis class="size-4" />
|
|
22
|
+
<span class="sr-only">More</span>
|
|
23
|
+
</span>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { WithElementRef } from "bits-ui";
|
|
3
|
+
import type { HTMLLiAttributes } from "svelte/elements";
|
|
4
|
+
import { cn } from "../../../utils.js";
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
children,
|
|
10
|
+
...restProps
|
|
11
|
+
}: WithElementRef<HTMLLiAttributes> = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<li bind:this={ref} class={cn("inline-flex items-center gap-1.5", className)} {...restProps}>
|
|
15
|
+
{@render children?.()}
|
|
16
|
+
</li>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAnchorAttributes } from "svelte/elements";
|
|
3
|
+
import type { Snippet } from "svelte";
|
|
4
|
+
import type { WithElementRef } from "bits-ui";
|
|
5
|
+
import { cn } from "../../../utils.js";
|
|
6
|
+
|
|
7
|
+
let {
|
|
8
|
+
ref = $bindable(null),
|
|
9
|
+
class: className,
|
|
10
|
+
href = undefined,
|
|
11
|
+
child,
|
|
12
|
+
children,
|
|
13
|
+
...restProps
|
|
14
|
+
}: WithElementRef<HTMLAnchorAttributes> & {
|
|
15
|
+
child?: Snippet<[{ props: HTMLAnchorAttributes }]>;
|
|
16
|
+
} = $props();
|
|
17
|
+
|
|
18
|
+
const attrs = $derived({
|
|
19
|
+
class: cn("hover:text-foreground transition-colors", className),
|
|
20
|
+
href,
|
|
21
|
+
...restProps,
|
|
22
|
+
});
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
{#if child}
|
|
26
|
+
{@render child({ props: attrs })}
|
|
27
|
+
{:else}
|
|
28
|
+
<a bind:this={ref} {...attrs}>
|
|
29
|
+
{@render children?.()}
|
|
30
|
+
</a>
|
|
31
|
+
{/if}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { WithElementRef } from "bits-ui";
|
|
3
|
+
import type { HTMLOlAttributes } from "svelte/elements";
|
|
4
|
+
import { cn } from "../../../utils.js";
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
children,
|
|
10
|
+
...restProps
|
|
11
|
+
}: WithElementRef<HTMLOlAttributes> = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<ol
|
|
15
|
+
bind:this={ref}
|
|
16
|
+
class={cn(
|
|
17
|
+
"text-muted-foreground flex flex-wrap items-center gap-1.5 wrap-break-word text-sm sm:gap-2.5",
|
|
18
|
+
className
|
|
19
|
+
)}
|
|
20
|
+
{...restProps}
|
|
21
|
+
>
|
|
22
|
+
{@render children?.()}
|
|
23
|
+
</ol>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { WithElementRef } from "bits-ui";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
import { cn } from "../../../utils.js";
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
children,
|
|
10
|
+
...restProps
|
|
11
|
+
}: WithElementRef<HTMLAttributes<HTMLSpanElement>> = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<span
|
|
15
|
+
bind:this={ref}
|
|
16
|
+
role="link"
|
|
17
|
+
aria-disabled="true"
|
|
18
|
+
aria-current="page"
|
|
19
|
+
class={cn("text-foreground font-normal", className)}
|
|
20
|
+
{...restProps}
|
|
21
|
+
>
|
|
22
|
+
{@render children?.()}
|
|
23
|
+
</span>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import ChevronRight from "@lucide/svelte/icons/chevron-right";
|
|
3
|
+
import type { WithElementRef } from "bits-ui";
|
|
4
|
+
import type { HTMLLiAttributes } from "svelte/elements";
|
|
5
|
+
import { cn } from "../../../utils.js";
|
|
6
|
+
|
|
7
|
+
let {
|
|
8
|
+
ref = $bindable(null),
|
|
9
|
+
class: className,
|
|
10
|
+
children,
|
|
11
|
+
...restProps
|
|
12
|
+
}: WithElementRef<HTMLLiAttributes> = $props();
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<li
|
|
16
|
+
role="presentation"
|
|
17
|
+
aria-hidden="true"
|
|
18
|
+
class={cn("[&>svg]:size-3.5", className)}
|
|
19
|
+
bind:this={ref}
|
|
20
|
+
{...restProps}
|
|
21
|
+
>
|
|
22
|
+
{#if children}
|
|
23
|
+
{@render children?.()}
|
|
24
|
+
{:else}
|
|
25
|
+
<ChevronRight />
|
|
26
|
+
{/if}
|
|
27
|
+
</li>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { WithElementRef } from "bits-ui";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(),
|
|
7
|
+
class: className,
|
|
8
|
+
children,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithElementRef<HTMLAttributes<HTMLElement>> = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<nav class={className} bind:this={ref} aria-label="breadcrumb" {...restProps}>
|
|
14
|
+
{@render children?.()}
|
|
15
|
+
</nav>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import Root from "./breadcrumb.svelte";
|
|
2
|
+
import Ellipsis from "./breadcrumb-ellipsis.svelte";
|
|
3
|
+
import Item from "./breadcrumb-item.svelte";
|
|
4
|
+
import Separator from "./breadcrumb-separator.svelte";
|
|
5
|
+
import Link from "./breadcrumb-link.svelte";
|
|
6
|
+
import List from "./breadcrumb-list.svelte";
|
|
7
|
+
import Page from "./breadcrumb-page.svelte";
|
|
8
|
+
|
|
9
|
+
export {
|
|
10
|
+
Root,
|
|
11
|
+
Ellipsis,
|
|
12
|
+
Item,
|
|
13
|
+
Separator,
|
|
14
|
+
Link,
|
|
15
|
+
List,
|
|
16
|
+
Page,
|
|
17
|
+
//
|
|
18
|
+
Root as Breadcrumb,
|
|
19
|
+
Ellipsis as BreadcrumbEllipsis,
|
|
20
|
+
Item as BreadcrumbItem,
|
|
21
|
+
Separator as BreadcrumbSeparator,
|
|
22
|
+
Link as BreadcrumbLink,
|
|
23
|
+
List as BreadcrumbList,
|
|
24
|
+
Page as BreadcrumbPage,
|
|
25
|
+
};
|