@lobb-js/studio 0.7.2 → 0.8.0
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 +2 -1
- 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
- package/vite-plugins/index.js +2 -0
- package/vite-plugins/lobb-proxy.js +36 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Label as LabelPrimitive } from "bits-ui";
|
|
3
|
+
import { cn } from "../../../utils.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: LabelPrimitive.RootProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<LabelPrimitive.Root
|
|
13
|
+
bind:ref
|
|
14
|
+
class={cn(
|
|
15
|
+
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
16
|
+
className
|
|
17
|
+
)}
|
|
18
|
+
{...restProps}
|
|
19
|
+
/>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Popover as PopoverPrimitive } from "bits-ui";
|
|
2
|
+
import Content from "./popover-content.svelte";
|
|
3
|
+
const Root = PopoverPrimitive.Root;
|
|
4
|
+
const Trigger = PopoverPrimitive.Trigger;
|
|
5
|
+
const Close = PopoverPrimitive.Close;
|
|
6
|
+
|
|
7
|
+
export {
|
|
8
|
+
Root,
|
|
9
|
+
Content,
|
|
10
|
+
Trigger,
|
|
11
|
+
Close,
|
|
12
|
+
//
|
|
13
|
+
Root as Popover,
|
|
14
|
+
Content as PopoverContent,
|
|
15
|
+
Trigger as PopoverTrigger,
|
|
16
|
+
Close as PopoverClose,
|
|
17
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from "../../../utils.js";
|
|
3
|
+
import { Popover as PopoverPrimitive } from "bits-ui";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
align = "center",
|
|
9
|
+
sideOffset = 4,
|
|
10
|
+
portalProps,
|
|
11
|
+
...restProps
|
|
12
|
+
}: PopoverPrimitive.ContentProps & {
|
|
13
|
+
portalProps?: PopoverPrimitive.PortalProps;
|
|
14
|
+
} = $props();
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<PopoverPrimitive.Portal {...portalProps}>
|
|
18
|
+
<PopoverPrimitive.Content
|
|
19
|
+
bind:ref
|
|
20
|
+
{align}
|
|
21
|
+
{sideOffset}
|
|
22
|
+
class={cn(
|
|
23
|
+
"bg-popover text-popover-foreground 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 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border p-4 shadow-md outline-none",
|
|
24
|
+
className
|
|
25
|
+
)}
|
|
26
|
+
{...restProps}
|
|
27
|
+
/>
|
|
28
|
+
</PopoverPrimitive.Portal>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import Root from "./range-calendar.svelte";
|
|
2
|
+
import Cell from "./range-calendar-cell.svelte";
|
|
3
|
+
import Day from "./range-calendar-day.svelte";
|
|
4
|
+
import Grid from "./range-calendar-grid.svelte";
|
|
5
|
+
import Header from "./range-calendar-header.svelte";
|
|
6
|
+
import Months from "./range-calendar-months.svelte";
|
|
7
|
+
import GridRow from "./range-calendar-grid-row.svelte";
|
|
8
|
+
import Heading from "./range-calendar-heading.svelte";
|
|
9
|
+
import GridBody from "./range-calendar-grid-body.svelte";
|
|
10
|
+
import GridHead from "./range-calendar-grid-head.svelte";
|
|
11
|
+
import HeadCell from "./range-calendar-head-cell.svelte";
|
|
12
|
+
import NextButton from "./range-calendar-next-button.svelte";
|
|
13
|
+
import PrevButton from "./range-calendar-prev-button.svelte";
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
Day,
|
|
17
|
+
Cell,
|
|
18
|
+
Grid,
|
|
19
|
+
Header,
|
|
20
|
+
Months,
|
|
21
|
+
GridRow,
|
|
22
|
+
Heading,
|
|
23
|
+
GridBody,
|
|
24
|
+
GridHead,
|
|
25
|
+
HeadCell,
|
|
26
|
+
NextButton,
|
|
27
|
+
PrevButton,
|
|
28
|
+
//
|
|
29
|
+
Root as RangeCalendar,
|
|
30
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { RangeCalendar as RangeCalendarPrimitive } from "bits-ui";
|
|
3
|
+
import { cn } from "../../../utils.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: RangeCalendarPrimitive.CellProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<RangeCalendarPrimitive.Cell
|
|
13
|
+
bind:ref
|
|
14
|
+
class={cn(
|
|
15
|
+
"[&:has([data-selected])]:bg-accent [&:has([data-selected][data-outside-month])]:bg-accent/50 relative p-0 text-center text-sm focus-within:relative focus-within:z-20 first:[&:has([data-selected])]:rounded-l-md last:[&:has([data-selected])]:rounded-r-md [&:has([data-selected][data-selection-end])]:rounded-r-md [&:has([data-selected][data-selection-start])]:rounded-l-md",
|
|
16
|
+
className
|
|
17
|
+
)}
|
|
18
|
+
{...restProps}
|
|
19
|
+
/>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { RangeCalendar as RangeCalendarPrimitive } from "bits-ui";
|
|
3
|
+
import { buttonVariants } from "../../../components/ui/button/index.js";
|
|
4
|
+
import { cn } from "../../../utils.js";
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
...restProps
|
|
10
|
+
}: RangeCalendarPrimitive.DayProps = $props();
|
|
11
|
+
|
|
12
|
+
export { className as class };
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<RangeCalendarPrimitive.Day
|
|
16
|
+
bind:ref
|
|
17
|
+
class={cn(
|
|
18
|
+
buttonVariants({ variant: "ghost" }),
|
|
19
|
+
"size-8 p-0 font-normal data-selected:opacity-100",
|
|
20
|
+
// Today
|
|
21
|
+
"[&[data-today]:not([data-selected])]:bg-accent [&[data-today]:not([data-selected])]:text-accent-foreground",
|
|
22
|
+
// Selection Start
|
|
23
|
+
"data-[selection-start]:bg-primary data-[selection-start]:text-primary-foreground data-[selection-start]:hover:bg-primary data-[selection-start]:hover:text-primary-foreground data-[selection-start]:focus:bg-primary data-[selection-start]:focus:text-primary-foreground",
|
|
24
|
+
// Selection End
|
|
25
|
+
"data-[selection-end]:bg-primary data-[selection-end]:text-primary-foreground data-[selection-end]:hover:bg-primary data-[selection-end]:hover:text-primary-foreground data-[selection-end]:focus:bg-primary data-[selection-end]:focus:text-primary-foreground",
|
|
26
|
+
// Outside months
|
|
27
|
+
"data-[outside-month]:text-muted-foreground [&[data-outside-month][data-selected]]:bg-accent/50 [&[data-outside-month][data-selected]]:text-muted-foreground data-outside-month:pointer-events-none data-outside-month:opacity-50 [&[data-outside-month][data-selected]]:opacity-30",
|
|
28
|
+
// Disabled
|
|
29
|
+
"data-[disabled]:text-muted-foreground data-disabled:opacity-50",
|
|
30
|
+
// Unavailable
|
|
31
|
+
"data-[unavailable]:text-destructive-foreground data-unavailable:line-through",
|
|
32
|
+
className
|
|
33
|
+
)}
|
|
34
|
+
{...restProps}
|
|
35
|
+
/>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { RangeCalendar as RangeCalendarPrimitive } from "bits-ui";
|
|
3
|
+
import { cn } from "../../../utils.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: RangeCalendarPrimitive.GridBodyProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<RangeCalendarPrimitive.GridBody bind:ref class={cn(className)} {...restProps} />
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { RangeCalendar as RangeCalendarPrimitive } from "bits-ui";
|
|
3
|
+
import { cn } from "../../../utils.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: RangeCalendarPrimitive.GridHeadProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<RangeCalendarPrimitive.GridHead bind:ref class={cn(className)} {...restProps} />
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { RangeCalendar as RangeCalendarPrimitive } from "bits-ui";
|
|
3
|
+
import { cn } from "../../../utils.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: RangeCalendarPrimitive.GridRowProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<RangeCalendarPrimitive.GridRow bind:ref class={cn("flex", className)} {...restProps} />
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { RangeCalendar as RangeCalendarPrimitive } from "bits-ui";
|
|
3
|
+
import { cn } from "../../../utils.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: RangeCalendarPrimitive.GridProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<RangeCalendarPrimitive.Grid
|
|
13
|
+
bind:ref
|
|
14
|
+
class={cn("w-full border-collapse space-y-1", className)}
|
|
15
|
+
{...restProps}
|
|
16
|
+
/>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { RangeCalendar as RangeCalendarPrimitive } from "bits-ui";
|
|
3
|
+
import { cn } from "../../../utils.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: RangeCalendarPrimitive.HeadCellProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<RangeCalendarPrimitive.HeadCell
|
|
13
|
+
bind:ref
|
|
14
|
+
class={cn("text-muted-foreground w-8 rounded-md text-[0.8rem] font-normal", className)}
|
|
15
|
+
{...restProps}
|
|
16
|
+
/>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { RangeCalendar as RangeCalendarPrimitive } from "bits-ui";
|
|
3
|
+
import { cn } from "../../../utils.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: RangeCalendarPrimitive.HeaderProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<RangeCalendarPrimitive.Header
|
|
13
|
+
bind:ref
|
|
14
|
+
class={cn("relative flex w-full items-center justify-between pt-1", className)}
|
|
15
|
+
{...restProps}
|
|
16
|
+
/>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { RangeCalendar as RangeCalendarPrimitive } from "bits-ui";
|
|
3
|
+
import { cn } from "../../../utils.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: RangeCalendarPrimitive.HeadingProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<RangeCalendarPrimitive.Heading
|
|
13
|
+
bind:ref
|
|
14
|
+
class={cn("text-sm font-medium", 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("mt-4 flex flex-col space-y-4 sm:flex-row sm:space-x-4 sm:space-y-0", className)}
|
|
17
|
+
{...restProps}
|
|
18
|
+
>
|
|
19
|
+
{@render children?.()}
|
|
20
|
+
</div>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { RangeCalendar as RangeCalendarPrimitive } from "bits-ui";
|
|
3
|
+
import ChevronRight from "@lucide/svelte/icons/chevron-right";
|
|
4
|
+
import { buttonVariants } from "../../../components/ui/button/index.js";
|
|
5
|
+
import { cn } from "../../../utils.js";
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
children,
|
|
10
|
+
...restProps
|
|
11
|
+
}: RangeCalendarPrimitive.NextButtonProps = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
{#snippet Fallback()}
|
|
15
|
+
<ChevronRight />
|
|
16
|
+
{/snippet}
|
|
17
|
+
|
|
18
|
+
<RangeCalendarPrimitive.NextButton
|
|
19
|
+
bind:ref
|
|
20
|
+
class={cn(
|
|
21
|
+
buttonVariants({ variant: "outline" }),
|
|
22
|
+
"size-7 bg-transparent p-0 opacity-50 hover:opacity-100",
|
|
23
|
+
className
|
|
24
|
+
)}
|
|
25
|
+
{...restProps}
|
|
26
|
+
children={children || Fallback}
|
|
27
|
+
/>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { RangeCalendar as RangeCalendarPrimitive } from "bits-ui";
|
|
3
|
+
import ChevronLeft from "@lucide/svelte/icons/chevron-left";
|
|
4
|
+
import { buttonVariants } from "../../../components/ui/button/index.js";
|
|
5
|
+
import { cn } from "../../../utils.js";
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
children,
|
|
10
|
+
...restProps
|
|
11
|
+
}: RangeCalendarPrimitive.PrevButtonProps = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
{#snippet Fallback()}
|
|
15
|
+
<ChevronLeft />
|
|
16
|
+
{/snippet}
|
|
17
|
+
|
|
18
|
+
<RangeCalendarPrimitive.PrevButton
|
|
19
|
+
bind:ref
|
|
20
|
+
class={cn(
|
|
21
|
+
buttonVariants({ variant: "outline" }),
|
|
22
|
+
"size-7 bg-transparent p-0 opacity-50 hover:opacity-100",
|
|
23
|
+
className
|
|
24
|
+
)}
|
|
25
|
+
{...restProps}
|
|
26
|
+
children={children || Fallback}
|
|
27
|
+
/>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { RangeCalendar as RangeCalendarPrimitive, type WithoutChildrenOrChild } from "bits-ui";
|
|
3
|
+
import * as RangeCalendar from "./index.js";
|
|
4
|
+
import { cn } from "../../../utils.js";
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
value = $bindable(),
|
|
9
|
+
placeholder = $bindable(),
|
|
10
|
+
class: className,
|
|
11
|
+
weekdayFormat = "short",
|
|
12
|
+
...restProps
|
|
13
|
+
}: WithoutChildrenOrChild<RangeCalendarPrimitive.RootProps> = $props();
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<RangeCalendarPrimitive.Root
|
|
17
|
+
bind:ref
|
|
18
|
+
bind:value
|
|
19
|
+
bind:placeholder
|
|
20
|
+
{weekdayFormat}
|
|
21
|
+
class={cn("p-3", className)}
|
|
22
|
+
{...restProps}
|
|
23
|
+
>
|
|
24
|
+
{#snippet children({ months, weekdays })}
|
|
25
|
+
<RangeCalendar.Header>
|
|
26
|
+
<RangeCalendar.PrevButton />
|
|
27
|
+
<RangeCalendar.Heading />
|
|
28
|
+
<RangeCalendar.NextButton />
|
|
29
|
+
</RangeCalendar.Header>
|
|
30
|
+
<RangeCalendar.Months>
|
|
31
|
+
{#each months as month (month)}
|
|
32
|
+
<RangeCalendar.Grid>
|
|
33
|
+
<RangeCalendar.GridHead>
|
|
34
|
+
<RangeCalendar.GridRow class="flex">
|
|
35
|
+
{#each weekdays as weekday (weekday)}
|
|
36
|
+
<RangeCalendar.HeadCell>
|
|
37
|
+
{weekday.slice(0, 2)}
|
|
38
|
+
</RangeCalendar.HeadCell>
|
|
39
|
+
{/each}
|
|
40
|
+
</RangeCalendar.GridRow>
|
|
41
|
+
</RangeCalendar.GridHead>
|
|
42
|
+
<RangeCalendar.GridBody>
|
|
43
|
+
{#each month.weeks as weekDates (weekDates)}
|
|
44
|
+
<RangeCalendar.GridRow class="mt-2 w-full">
|
|
45
|
+
{#each weekDates as date (date)}
|
|
46
|
+
<RangeCalendar.Cell {date} month={month.value}>
|
|
47
|
+
<RangeCalendar.Day />
|
|
48
|
+
</RangeCalendar.Cell>
|
|
49
|
+
{/each}
|
|
50
|
+
</RangeCalendar.GridRow>
|
|
51
|
+
{/each}
|
|
52
|
+
</RangeCalendar.GridBody>
|
|
53
|
+
</RangeCalendar.Grid>
|
|
54
|
+
{/each}
|
|
55
|
+
</RangeCalendar.Months>
|
|
56
|
+
{/snippet}
|
|
57
|
+
</RangeCalendarPrimitive.Root>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Select as SelectPrimitive } from "bits-ui";
|
|
2
|
+
|
|
3
|
+
import GroupHeading from "./select-group-heading.svelte";
|
|
4
|
+
import Item from "./select-item.svelte";
|
|
5
|
+
import Content from "./select-content.svelte";
|
|
6
|
+
import Trigger from "./select-trigger.svelte";
|
|
7
|
+
import Separator from "./select-separator.svelte";
|
|
8
|
+
import ScrollDownButton from "./select-scroll-down-button.svelte";
|
|
9
|
+
import ScrollUpButton from "./select-scroll-up-button.svelte";
|
|
10
|
+
|
|
11
|
+
const Root = SelectPrimitive.Root;
|
|
12
|
+
const Group = SelectPrimitive.Group;
|
|
13
|
+
|
|
14
|
+
export {
|
|
15
|
+
Root,
|
|
16
|
+
Item,
|
|
17
|
+
Group,
|
|
18
|
+
GroupHeading,
|
|
19
|
+
Content,
|
|
20
|
+
Trigger,
|
|
21
|
+
Separator,
|
|
22
|
+
ScrollDownButton,
|
|
23
|
+
ScrollUpButton,
|
|
24
|
+
//
|
|
25
|
+
Root as Select,
|
|
26
|
+
Item as SelectItem,
|
|
27
|
+
Group as SelectGroup,
|
|
28
|
+
GroupHeading as SelectGroupHeading,
|
|
29
|
+
Content as SelectContent,
|
|
30
|
+
Trigger as SelectTrigger,
|
|
31
|
+
Separator as SelectSeparator,
|
|
32
|
+
ScrollDownButton as SelectScrollDownButton,
|
|
33
|
+
ScrollUpButton as SelectScrollUpButton,
|
|
34
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Select as SelectPrimitive, type WithoutChild } from "bits-ui";
|
|
3
|
+
import * as Select from "./index.js";
|
|
4
|
+
import { cn } from "../../../utils.js";
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
sideOffset = 4,
|
|
10
|
+
portalProps,
|
|
11
|
+
children,
|
|
12
|
+
...restProps
|
|
13
|
+
}: WithoutChild<SelectPrimitive.ContentProps> & {
|
|
14
|
+
portalProps?: SelectPrimitive.PortalProps;
|
|
15
|
+
} = $props();
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<SelectPrimitive.Portal {...portalProps}>
|
|
19
|
+
<SelectPrimitive.Content
|
|
20
|
+
bind:ref
|
|
21
|
+
{sideOffset}
|
|
22
|
+
class={cn(
|
|
23
|
+
"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 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 bg-popover text-popover-foreground relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
24
|
+
className
|
|
25
|
+
)}
|
|
26
|
+
{...restProps}
|
|
27
|
+
>
|
|
28
|
+
<Select.ScrollUpButton />
|
|
29
|
+
<SelectPrimitive.Viewport
|
|
30
|
+
class={cn(
|
|
31
|
+
"h-(--bits-select-anchor-height) w-full min-w-(--bits-select-anchor-width) p-1"
|
|
32
|
+
)}
|
|
33
|
+
>
|
|
34
|
+
{@render children?.()}
|
|
35
|
+
</SelectPrimitive.Viewport>
|
|
36
|
+
<Select.ScrollDownButton />
|
|
37
|
+
</SelectPrimitive.Content>
|
|
38
|
+
</SelectPrimitive.Portal>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Select as SelectPrimitive } from "bits-ui";
|
|
3
|
+
import { cn } from "../../../utils.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: SelectPrimitive.GroupHeadingProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<SelectPrimitive.GroupHeading
|
|
13
|
+
bind:ref
|
|
14
|
+
class={cn("px-2 py-1.5 text-sm font-semibold", className)}
|
|
15
|
+
{...restProps}
|
|
16
|
+
/>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Select as SelectPrimitive, type WithoutChild } from "bits-ui";
|
|
3
|
+
import Check from "@lucide/svelte/icons/check";
|
|
4
|
+
import { cn } from "../../../utils.js";
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
value,
|
|
10
|
+
label,
|
|
11
|
+
children: childrenProp,
|
|
12
|
+
...restProps
|
|
13
|
+
}: WithoutChild<SelectPrimitive.ItemProps> = $props();
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<SelectPrimitive.Item
|
|
17
|
+
bind:ref
|
|
18
|
+
{value}
|
|
19
|
+
class={cn(
|
|
20
|
+
"data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
21
|
+
className
|
|
22
|
+
)}
|
|
23
|
+
{...restProps}
|
|
24
|
+
>
|
|
25
|
+
{#snippet children({ selected, highlighted })}
|
|
26
|
+
<span class="absolute right-2 flex size-3.5 items-center justify-center">
|
|
27
|
+
{#if selected}
|
|
28
|
+
<Check class="size-4" />
|
|
29
|
+
{/if}
|
|
30
|
+
</span>
|
|
31
|
+
{#if childrenProp}
|
|
32
|
+
{@render childrenProp({ selected, highlighted })}
|
|
33
|
+
{:else}
|
|
34
|
+
{label || value}
|
|
35
|
+
{/if}
|
|
36
|
+
{/snippet}
|
|
37
|
+
</SelectPrimitive.Item>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import ChevronDown from "@lucide/svelte/icons/chevron-down";
|
|
3
|
+
import { Select as SelectPrimitive, type WithoutChildrenOrChild } from "bits-ui";
|
|
4
|
+
import { cn } from "../../../utils.js";
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithoutChildrenOrChild<SelectPrimitive.ScrollDownButtonProps> = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<SelectPrimitive.ScrollDownButton
|
|
14
|
+
bind:ref
|
|
15
|
+
class={cn("flex cursor-default items-center justify-center py-1", className)}
|
|
16
|
+
{...restProps}
|
|
17
|
+
>
|
|
18
|
+
<ChevronDown class="size-4" />
|
|
19
|
+
</SelectPrimitive.ScrollDownButton>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import ChevronUp from "@lucide/svelte/icons/chevron-up";
|
|
3
|
+
import { Select as SelectPrimitive, type WithoutChildrenOrChild } from "bits-ui";
|
|
4
|
+
import { cn } from "../../../utils.js";
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithoutChildrenOrChild<SelectPrimitive.ScrollDownButtonProps> = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<SelectPrimitive.ScrollUpButton
|
|
14
|
+
bind:ref
|
|
15
|
+
class={cn("flex cursor-default items-center justify-center py-1", className)}
|
|
16
|
+
{...restProps}
|
|
17
|
+
>
|
|
18
|
+
<ChevronUp class="size-4" />
|
|
19
|
+
</SelectPrimitive.ScrollUpButton>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Separator as SeparatorPrimitive } from "bits-ui";
|
|
3
|
+
import { Separator } from "../../../components/ui/separator/index.js";
|
|
4
|
+
import { cn } from "../../../utils.js";
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
...restProps
|
|
10
|
+
}: SeparatorPrimitive.RootProps = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<Separator bind:ref class={cn("bg-muted -mx-1 my-1 h-px", className)} {...restProps} />
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Select as SelectPrimitive, 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
|
+
children,
|
|
10
|
+
...restProps
|
|
11
|
+
}: WithoutChild<SelectPrimitive.TriggerProps> = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<SelectPrimitive.Trigger
|
|
15
|
+
bind:ref
|
|
16
|
+
class={cn(
|
|
17
|
+
"border-input ring-offset-background data-[placeholder]:text-muted-foreground focus:ring-ring flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border bg-transparent px-3 py-2 text-sm focus:outline-none focus:ring-1 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
18
|
+
className
|
|
19
|
+
)}
|
|
20
|
+
{...restProps}
|
|
21
|
+
>
|
|
22
|
+
{@render children?.()}
|
|
23
|
+
<ChevronDown class="size-4 opacity-50" />
|
|
24
|
+
</SelectPrimitive.Trigger>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Separator as SeparatorPrimitive } from "bits-ui";
|
|
3
|
+
import { cn } from "../../../utils.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
orientation = "horizontal",
|
|
9
|
+
...restProps
|
|
10
|
+
}: SeparatorPrimitive.RootProps = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<SeparatorPrimitive.Root
|
|
14
|
+
bind:ref
|
|
15
|
+
class={cn(
|
|
16
|
+
"bg-border shrink-0",
|
|
17
|
+
orientation === "horizontal" ? "h-px w-full" : "min-h-full w-px",
|
|
18
|
+
className
|
|
19
|
+
)}
|
|
20
|
+
{orientation}
|
|
21
|
+
{...restProps}
|
|
22
|
+
/>
|