@lobb-js/studio 0.1.31

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.
Files changed (208) hide show
  1. package/.env.example +1 -0
  2. package/.storybook/main.ts +31 -0
  3. package/.storybook/preview.ts +21 -0
  4. package/.storybook/vitest.setup.ts +7 -0
  5. package/README.md +47 -0
  6. package/components.json +16 -0
  7. package/docker-entrypoint.sh +7 -0
  8. package/dockerfile +27 -0
  9. package/index.html +13 -0
  10. package/package.json +77 -0
  11. package/public/lobb.svg +15 -0
  12. package/src/Studio.svelte +150 -0
  13. package/src/app.css +121 -0
  14. package/src/components-export.ts +21 -0
  15. package/src/extensions/extension.types.ts +93 -0
  16. package/src/extensions/extensionUtils.ts +192 -0
  17. package/src/lib/Lobb.ts +241 -0
  18. package/src/lib/components/LlmButton.svelte +136 -0
  19. package/src/lib/components/alertView.svelte +20 -0
  20. package/src/lib/components/breadCrumbs.svelte +60 -0
  21. package/src/lib/components/combobox.svelte +92 -0
  22. package/src/lib/components/confirmationDialog/confirmationDialog.svelte +33 -0
  23. package/src/lib/components/confirmationDialog/store.svelte.ts +28 -0
  24. package/src/lib/components/createManyButton.svelte +107 -0
  25. package/src/lib/components/dataTable/childRecords.svelte +140 -0
  26. package/src/lib/components/dataTable/dataTable.svelte +223 -0
  27. package/src/lib/components/dataTable/fieldCell.svelte +74 -0
  28. package/src/lib/components/dataTable/filter.svelte +282 -0
  29. package/src/lib/components/dataTable/filterButton.svelte +39 -0
  30. package/src/lib/components/dataTable/footer.svelte +84 -0
  31. package/src/lib/components/dataTable/header.svelte +154 -0
  32. package/src/lib/components/dataTable/sort.svelte +171 -0
  33. package/src/lib/components/dataTable/sortButton.svelte +36 -0
  34. package/src/lib/components/dataTable/table.svelte +337 -0
  35. package/src/lib/components/dataTable/utils.ts +127 -0
  36. package/src/lib/components/detailView/create/children.svelte +68 -0
  37. package/src/lib/components/detailView/create/createDetailView.svelte +226 -0
  38. package/src/lib/components/detailView/create/createDetailViewButton.svelte +32 -0
  39. package/src/lib/components/detailView/create/createManyView.svelte +250 -0
  40. package/src/lib/components/detailView/create/subRecords.svelte +48 -0
  41. package/src/lib/components/detailView/detailViewForm.svelte +104 -0
  42. package/src/lib/components/detailView/fieldCustomInput.svelte +23 -0
  43. package/src/lib/components/detailView/fieldInput.svelte +287 -0
  44. package/src/lib/components/detailView/fieldInputReplacement.svelte +199 -0
  45. package/src/lib/components/detailView/store.svelte.ts +61 -0
  46. package/src/lib/components/detailView/update/children.svelte +94 -0
  47. package/src/lib/components/detailView/update/updateDetailView.svelte +175 -0
  48. package/src/lib/components/detailView/update/updateDetailViewButton.svelte +32 -0
  49. package/src/lib/components/detailView/utils.ts +177 -0
  50. package/src/lib/components/diffViewer.svelte +102 -0
  51. package/src/lib/components/drawer.svelte +28 -0
  52. package/src/lib/components/extensionsComponents.svelte +31 -0
  53. package/src/lib/components/foreingKeyInput.svelte +80 -0
  54. package/src/lib/components/header.svelte +45 -0
  55. package/src/lib/components/loadingTypesForMonacoEditor.ts +36 -0
  56. package/src/lib/components/miniSidebar.svelte +238 -0
  57. package/src/lib/components/monacoEditor.svelte +181 -0
  58. package/src/lib/components/rangeCalendarButton.svelte +257 -0
  59. package/src/lib/components/selectRecord.svelte +126 -0
  60. package/src/lib/components/setServerPage.svelte +48 -0
  61. package/src/lib/components/sidebar/index.ts +4 -0
  62. package/src/lib/components/sidebar/sidebar.svelte +149 -0
  63. package/src/lib/components/sidebar/sidebarElements.svelte +144 -0
  64. package/src/lib/components/sidebar/sidebarTrigger.svelte +33 -0
  65. package/src/lib/components/singletone.svelte +69 -0
  66. package/src/lib/components/ui/accordion/accordion-content.svelte +22 -0
  67. package/src/lib/components/ui/accordion/accordion-item.svelte +12 -0
  68. package/src/lib/components/ui/accordion/accordion-trigger.svelte +31 -0
  69. package/src/lib/components/ui/accordion/index.ts +17 -0
  70. package/src/lib/components/ui/alert/alert-description.svelte +16 -0
  71. package/src/lib/components/ui/alert/alert-title.svelte +24 -0
  72. package/src/lib/components/ui/alert/alert.svelte +39 -0
  73. package/src/lib/components/ui/alert/index.ts +14 -0
  74. package/src/lib/components/ui/alert-dialog/alert-dialog-action.svelte +13 -0
  75. package/src/lib/components/ui/alert-dialog/alert-dialog-cancel.svelte +17 -0
  76. package/src/lib/components/ui/alert-dialog/alert-dialog-content.svelte +26 -0
  77. package/src/lib/components/ui/alert-dialog/alert-dialog-description.svelte +16 -0
  78. package/src/lib/components/ui/alert-dialog/alert-dialog-footer.svelte +20 -0
  79. package/src/lib/components/ui/alert-dialog/alert-dialog-header.svelte +20 -0
  80. package/src/lib/components/ui/alert-dialog/alert-dialog-overlay.svelte +19 -0
  81. package/src/lib/components/ui/alert-dialog/alert-dialog-title.svelte +18 -0
  82. package/src/lib/components/ui/alert-dialog/index.ts +40 -0
  83. package/src/lib/components/ui/breadcrumb/breadcrumb-ellipsis.svelte +23 -0
  84. package/src/lib/components/ui/breadcrumb/breadcrumb-item.svelte +16 -0
  85. package/src/lib/components/ui/breadcrumb/breadcrumb-link.svelte +31 -0
  86. package/src/lib/components/ui/breadcrumb/breadcrumb-list.svelte +23 -0
  87. package/src/lib/components/ui/breadcrumb/breadcrumb-page.svelte +23 -0
  88. package/src/lib/components/ui/breadcrumb/breadcrumb-separator.svelte +27 -0
  89. package/src/lib/components/ui/breadcrumb/breadcrumb.svelte +15 -0
  90. package/src/lib/components/ui/breadcrumb/index.ts +25 -0
  91. package/src/lib/components/ui/button/button.svelte +110 -0
  92. package/src/lib/components/ui/button/index.ts +17 -0
  93. package/src/lib/components/ui/checkbox/checkbox.svelte +35 -0
  94. package/src/lib/components/ui/checkbox/index.ts +6 -0
  95. package/src/lib/components/ui/command/command-dialog.svelte +35 -0
  96. package/src/lib/components/ui/command/command-empty.svelte +12 -0
  97. package/src/lib/components/ui/command/command-group.svelte +31 -0
  98. package/src/lib/components/ui/command/command-input.svelte +25 -0
  99. package/src/lib/components/ui/command/command-item.svelte +19 -0
  100. package/src/lib/components/ui/command/command-link-item.svelte +19 -0
  101. package/src/lib/components/ui/command/command-list.svelte +16 -0
  102. package/src/lib/components/ui/command/command-separator.svelte +12 -0
  103. package/src/lib/components/ui/command/command-shortcut.svelte +20 -0
  104. package/src/lib/components/ui/command/command.svelte +21 -0
  105. package/src/lib/components/ui/command/index.ts +40 -0
  106. package/src/lib/components/ui/dialog/dialog-content.svelte +38 -0
  107. package/src/lib/components/ui/dialog/dialog-description.svelte +16 -0
  108. package/src/lib/components/ui/dialog/dialog-footer.svelte +20 -0
  109. package/src/lib/components/ui/dialog/dialog-header.svelte +20 -0
  110. package/src/lib/components/ui/dialog/dialog-overlay.svelte +19 -0
  111. package/src/lib/components/ui/dialog/dialog-title.svelte +16 -0
  112. package/src/lib/components/ui/dialog/index.ts +37 -0
  113. package/src/lib/components/ui/input/index.ts +7 -0
  114. package/src/lib/components/ui/input/input.svelte +46 -0
  115. package/src/lib/components/ui/label/index.ts +7 -0
  116. package/src/lib/components/ui/label/label.svelte +19 -0
  117. package/src/lib/components/ui/popover/index.ts +17 -0
  118. package/src/lib/components/ui/popover/popover-content.svelte +28 -0
  119. package/src/lib/components/ui/range-calendar/index.ts +30 -0
  120. package/src/lib/components/ui/range-calendar/range-calendar-cell.svelte +19 -0
  121. package/src/lib/components/ui/range-calendar/range-calendar-day.svelte +35 -0
  122. package/src/lib/components/ui/range-calendar/range-calendar-grid-body.svelte +12 -0
  123. package/src/lib/components/ui/range-calendar/range-calendar-grid-head.svelte +12 -0
  124. package/src/lib/components/ui/range-calendar/range-calendar-grid-row.svelte +12 -0
  125. package/src/lib/components/ui/range-calendar/range-calendar-grid.svelte +16 -0
  126. package/src/lib/components/ui/range-calendar/range-calendar-head-cell.svelte +16 -0
  127. package/src/lib/components/ui/range-calendar/range-calendar-header.svelte +16 -0
  128. package/src/lib/components/ui/range-calendar/range-calendar-heading.svelte +16 -0
  129. package/src/lib/components/ui/range-calendar/range-calendar-months.svelte +20 -0
  130. package/src/lib/components/ui/range-calendar/range-calendar-next-button.svelte +27 -0
  131. package/src/lib/components/ui/range-calendar/range-calendar-prev-button.svelte +27 -0
  132. package/src/lib/components/ui/range-calendar/range-calendar.svelte +57 -0
  133. package/src/lib/components/ui/select/index.ts +34 -0
  134. package/src/lib/components/ui/select/select-content.svelte +38 -0
  135. package/src/lib/components/ui/select/select-group-heading.svelte +16 -0
  136. package/src/lib/components/ui/select/select-item.svelte +37 -0
  137. package/src/lib/components/ui/select/select-scroll-down-button.svelte +19 -0
  138. package/src/lib/components/ui/select/select-scroll-up-button.svelte +19 -0
  139. package/src/lib/components/ui/select/select-separator.svelte +13 -0
  140. package/src/lib/components/ui/select/select-trigger.svelte +24 -0
  141. package/src/lib/components/ui/separator/index.ts +7 -0
  142. package/src/lib/components/ui/separator/separator.svelte +22 -0
  143. package/src/lib/components/ui/skeleton/index.ts +7 -0
  144. package/src/lib/components/ui/skeleton/skeleton.svelte +22 -0
  145. package/src/lib/components/ui/sonner/index.ts +1 -0
  146. package/src/lib/components/ui/sonner/sonner.svelte +20 -0
  147. package/src/lib/components/ui/switch/index.ts +7 -0
  148. package/src/lib/components/ui/switch/switch.svelte +27 -0
  149. package/src/lib/components/ui/textarea/index.ts +7 -0
  150. package/src/lib/components/ui/textarea/textarea.svelte +22 -0
  151. package/src/lib/components/ui/tooltip/index.ts +18 -0
  152. package/src/lib/components/ui/tooltip/tooltip-content.svelte +21 -0
  153. package/src/lib/components/workflowEditor.svelte +187 -0
  154. package/src/lib/eventSystem.ts +38 -0
  155. package/src/lib/index.ts +40 -0
  156. package/src/lib/store.svelte.ts +21 -0
  157. package/src/lib/store.types.ts +28 -0
  158. package/src/lib/utils.ts +84 -0
  159. package/src/main.ts +18 -0
  160. package/src/routes/collections/collection.svelte +46 -0
  161. package/src/routes/collections/collections.svelte +43 -0
  162. package/src/routes/data_model/dataModel.svelte +40 -0
  163. package/src/routes/data_model/flow.css +22 -0
  164. package/src/routes/data_model/flow.svelte +82 -0
  165. package/src/routes/data_model/syncManager.svelte +93 -0
  166. package/src/routes/data_model/utils.ts +35 -0
  167. package/src/routes/extensions/extension.svelte +16 -0
  168. package/src/routes/home.svelte +36 -0
  169. package/src/routes/workflows/workflows.svelte +135 -0
  170. package/src/stories/Configure.mdx +364 -0
  171. package/src/stories/assets/accessibility.png +0 -0
  172. package/src/stories/assets/accessibility.svg +1 -0
  173. package/src/stories/assets/addon-library.png +0 -0
  174. package/src/stories/assets/assets.png +0 -0
  175. package/src/stories/assets/avif-test-image.avif +0 -0
  176. package/src/stories/assets/context.png +0 -0
  177. package/src/stories/assets/discord.svg +1 -0
  178. package/src/stories/assets/docs.png +0 -0
  179. package/src/stories/assets/figma-plugin.png +0 -0
  180. package/src/stories/assets/github.svg +1 -0
  181. package/src/stories/assets/share.png +0 -0
  182. package/src/stories/assets/styling.png +0 -0
  183. package/src/stories/assets/testing.png +0 -0
  184. package/src/stories/assets/theming.png +0 -0
  185. package/src/stories/assets/tutorials.svg +1 -0
  186. package/src/stories/assets/youtube.svg +1 -0
  187. package/src/stories/detailView/detailViewForm.stories.svelte +79 -0
  188. package/src/stories/examples/Button.stories.svelte +31 -0
  189. package/src/stories/examples/Button.svelte +30 -0
  190. package/src/stories/examples/Header.stories.svelte +26 -0
  191. package/src/stories/examples/Header.svelte +45 -0
  192. package/src/stories/examples/Page.stories.svelte +29 -0
  193. package/src/stories/examples/Page.svelte +70 -0
  194. package/src/stories/examples/button.css +30 -0
  195. package/src/stories/examples/header.css +32 -0
  196. package/src/stories/examples/page.css +68 -0
  197. package/src/vite-env.d.ts +2 -0
  198. package/svelte.config.js +7 -0
  199. package/todo.md +24 -0
  200. package/tsconfig.app.json +25 -0
  201. package/tsconfig.json +14 -0
  202. package/tsconfig.node.json +24 -0
  203. package/vite-plugin-contextual-lib.js +66 -0
  204. package/vite.build.svelte.config.ts +18 -0
  205. package/vite.config.ts +84 -0
  206. package/vite.extension.config.ts +81 -0
  207. package/vite_utils.ts +28 -0
  208. package/vitest.shims.d.ts +1 -0
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ import type { HTMLAttributes } from "svelte/elements";
3
+ import type { WithElementRef } from "bits-ui";
4
+ import { cn } from "$lib/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-1.5 text-center sm:text-left", className)}
17
+ {...restProps}
18
+ >
19
+ {@render children?.()}
20
+ </div>
@@ -0,0 +1,19 @@
1
+ <script lang="ts">
2
+ import { Dialog as DialogPrimitive } from "bits-ui";
3
+ import { cn } from "$lib/utils.js";
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ ...restProps
9
+ }: DialogPrimitive.OverlayProps = $props();
10
+ </script>
11
+
12
+ <DialogPrimitive.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,16 @@
1
+ <script lang="ts">
2
+ import { Dialog as DialogPrimitive } from "bits-ui";
3
+ import { cn } from "$lib/utils.js";
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ ...restProps
9
+ }: DialogPrimitive.TitleProps = $props();
10
+ </script>
11
+
12
+ <DialogPrimitive.Title
13
+ bind:ref
14
+ class={cn("text-lg font-semibold leading-none tracking-tight", className)}
15
+ {...restProps}
16
+ />
@@ -0,0 +1,37 @@
1
+ import { Dialog as DialogPrimitive } from "bits-ui";
2
+
3
+ import Title from "./dialog-title.svelte";
4
+ import Footer from "./dialog-footer.svelte";
5
+ import Header from "./dialog-header.svelte";
6
+ import Overlay from "./dialog-overlay.svelte";
7
+ import Content from "./dialog-content.svelte";
8
+ import Description from "./dialog-description.svelte";
9
+
10
+ const Root: typeof DialogPrimitive.Root = DialogPrimitive.Root;
11
+ const Trigger: typeof DialogPrimitive.Trigger = DialogPrimitive.Trigger;
12
+ const Close: typeof DialogPrimitive.Close = DialogPrimitive.Close;
13
+ const Portal: typeof DialogPrimitive.Portal = DialogPrimitive.Portal;
14
+
15
+ export {
16
+ Root,
17
+ Title,
18
+ Portal,
19
+ Footer,
20
+ Header,
21
+ Trigger,
22
+ Overlay,
23
+ Content,
24
+ Description,
25
+ Close,
26
+ //
27
+ Root as Dialog,
28
+ Title as DialogTitle,
29
+ Portal as DialogPortal,
30
+ Footer as DialogFooter,
31
+ Header as DialogHeader,
32
+ Trigger as DialogTrigger,
33
+ Overlay as DialogOverlay,
34
+ Content as DialogContent,
35
+ Description as DialogDescription,
36
+ Close as DialogClose,
37
+ };
@@ -0,0 +1,7 @@
1
+ import Root from "./input.svelte";
2
+
3
+ export {
4
+ Root,
5
+ //
6
+ Root as Input,
7
+ };
@@ -0,0 +1,46 @@
1
+ <script lang="ts">
2
+ import type { HTMLInputAttributes, HTMLInputTypeAttribute } from "svelte/elements";
3
+ import type { WithElementRef } from "bits-ui";
4
+ import { cn } from "$lib/utils.js";
5
+
6
+ type InputType = Exclude<HTMLInputTypeAttribute, "file">;
7
+
8
+ type Props = WithElementRef<
9
+ Omit<HTMLInputAttributes, "type"> &
10
+ ({ type: "file"; files?: FileList } | { type?: InputType; files?: undefined })
11
+ >;
12
+
13
+ let {
14
+ ref = $bindable(null),
15
+ value = $bindable(),
16
+ type,
17
+ files = $bindable(),
18
+ class: className,
19
+ ...restProps
20
+ }: Props = $props();
21
+ </script>
22
+
23
+ {#if type === "file"}
24
+ <input
25
+ bind:this={ref}
26
+ class={cn(
27
+ "border-input placeholder:text-muted-foreground focus-visible:ring-ring flex h-9 w-full rounded-md border bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
28
+ className
29
+ )}
30
+ type="file"
31
+ bind:files
32
+ bind:value
33
+ {...restProps}
34
+ />
35
+ {:else}
36
+ <input
37
+ bind:this={ref}
38
+ class={cn(
39
+ "border-input placeholder:text-muted-foreground focus-visible:ring-ring flex h-9 w-full rounded-md border bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
40
+ className
41
+ )}
42
+ {type}
43
+ bind:value
44
+ {...restProps}
45
+ />
46
+ {/if}
@@ -0,0 +1,7 @@
1
+ import Root from "./label.svelte";
2
+
3
+ export {
4
+ Root,
5
+ //
6
+ Root as Label,
7
+ };
@@ -0,0 +1,19 @@
1
+ <script lang="ts">
2
+ import { Label as LabelPrimitive } from "bits-ui";
3
+ import { cn } from "$lib/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 "$lib/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 "$lib/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 "$lib/components/ui/button/index.js";
4
+ import { cn } from "$lib/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 "$lib/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 "$lib/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 "$lib/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 "$lib/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 "$lib/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 "$lib/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 "$lib/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 "$lib/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 "$lib/components/ui/button/index.js";
5
+ import { cn } from "$lib/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 "$lib/components/ui/button/index.js";
5
+ import { cn } from "$lib/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 "$lib/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 "$lib/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 shadow-md 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 "$lib/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
+ />