@stubber/ui 1.13.0 → 1.13.2
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.
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
<script>import Command from "./command.svelte";
|
|
2
2
|
import * as Dialog from "../dialog/index.js";
|
|
3
|
+
import { cn } from "../../utils/shadcn-utils";
|
|
3
4
|
export let open = false;
|
|
4
5
|
export let value = void 0;
|
|
6
|
+
export let dialogClass = void 0;
|
|
5
7
|
</script>
|
|
6
8
|
|
|
7
9
|
<Dialog.Root bind:open {...$$restProps}>
|
|
8
|
-
<Dialog.Content class="overflow-hidden p-0 shadow-lg">
|
|
10
|
+
<Dialog.Content class={cn("overflow-hidden p-0 shadow-lg", dialogClass)}>
|
|
9
11
|
<Command
|
|
10
12
|
class="[&_[data-cmdk-group-heading]]:text-muted-foreground [&_[data-cmdk-group-heading]]:px-2 [&_[data-cmdk-group-heading]]:font-medium [&_[data-cmdk-group]:not([hidden])_~[data-cmdk-group]]:pt-0 [&_[data-cmdk-group]]:px-2 [&_[data-cmdk-input-wrapper]_svg]:h-5 [&_[data-cmdk-input-wrapper]_svg]:w-5 [&_[data-cmdk-input]]:h-12 [&_[data-cmdk-item]]:px-2 [&_[data-cmdk-item]]:py-3 [&_[data-cmdk-item]_svg]:h-5 [&_[data-cmdk-item]_svg]:w-5"
|
|
11
13
|
{...$$restProps}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { Dialog as DialogPrimitive } from "bits-ui";
|
|
2
3
|
declare const __propDef: {
|
|
3
4
|
props: {
|
|
4
5
|
preventScroll?: boolean | undefined;
|
|
@@ -22,6 +23,8 @@ declare const __propDef: {
|
|
|
22
23
|
} & import("cmdk-sv/dist/internal").HTMLDivAttributes & {
|
|
23
24
|
onKeydown?: (e: KeyboardEvent) => void;
|
|
24
25
|
asChild?: boolean;
|
|
26
|
+
} & {
|
|
27
|
+
dialogClass?: DialogPrimitive.ContentProps["class"];
|
|
25
28
|
};
|
|
26
29
|
events: {
|
|
27
30
|
[evt: string]: CustomEvent<any>;
|
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
<script>import { Button } from "../../components/button/index";
|
|
2
2
|
import * as Popover from "../../components/popover/index";
|
|
3
|
+
import { onMount } from "svelte";
|
|
3
4
|
export let consoleOrigin = "";
|
|
4
5
|
export let stubsOrigin = "";
|
|
5
6
|
export let builderOrigin = "";
|
|
7
|
+
export let currentOrigin = void 0;
|
|
6
8
|
let stubsUrl = `${stubsOrigin}/_/inbox/assigned`;
|
|
7
9
|
let consoleUrl = `${consoleOrigin}/_/contacts`;
|
|
8
10
|
let builderUrl = `${builderOrigin}/_/drive/folders`;
|
|
11
|
+
let detectedOrigin = "";
|
|
12
|
+
onMount(() => {
|
|
13
|
+
if (currentOrigin === void 0) {
|
|
14
|
+
detectedOrigin = window.location.origin;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
$: activeOrigin = currentOrigin !== void 0 ? currentOrigin : detectedOrigin;
|
|
18
|
+
$: isStubsActive = activeOrigin === stubsOrigin;
|
|
19
|
+
$: isConsoleActive = activeOrigin === consoleOrigin;
|
|
20
|
+
$: isBuilderActive = activeOrigin === builderOrigin;
|
|
9
21
|
</script>
|
|
10
22
|
|
|
11
23
|
<Popover.Root>
|
|
@@ -16,21 +28,33 @@ let builderUrl = `${builderOrigin}/_/drive/folders`;
|
|
|
16
28
|
</Popover.Trigger>
|
|
17
29
|
<Popover.Content class="w-auto p-5 space-y-2 z-[120]">
|
|
18
30
|
<!-- Stubs -->
|
|
19
|
-
<Button
|
|
31
|
+
<Button
|
|
32
|
+
href={stubsUrl}
|
|
33
|
+
class="h-20 w-20 {isStubsActive ? 'bg-surface-100 opacity-40 pointer-events-none' : ''}"
|
|
34
|
+
variant="ghost"
|
|
35
|
+
>
|
|
20
36
|
<div class="flex flex-col items-center space-y-2 text-surface-700">
|
|
21
37
|
<i class="fa-regular fa-list-tree fa-2x" />
|
|
22
38
|
<p class="text-label">Stubs</p>
|
|
23
39
|
</div>
|
|
24
40
|
</Button>
|
|
25
41
|
<!-- Console -->
|
|
26
|
-
<Button
|
|
42
|
+
<Button
|
|
43
|
+
href={consoleUrl}
|
|
44
|
+
class="h-20 w-20 {isConsoleActive ? 'bg-surface-100 opacity-40 pointer-events-none' : ''}"
|
|
45
|
+
variant="ghost"
|
|
46
|
+
>
|
|
27
47
|
<div class="flex flex-col items-center space-y-2 text-surface-700">
|
|
28
48
|
<i class="fa-solid fa-sliders-simple fa-2x" />
|
|
29
49
|
<p class="text-label">Console</p>
|
|
30
50
|
</div>
|
|
31
51
|
</Button>
|
|
32
52
|
<!-- Builder -->
|
|
33
|
-
<Button
|
|
53
|
+
<Button
|
|
54
|
+
href={builderUrl}
|
|
55
|
+
class="h-20 w-20 {isBuilderActive ? 'bg-surface-100 opacity-40 pointer-events-none' : ''}"
|
|
56
|
+
variant="ghost"
|
|
57
|
+
>
|
|
34
58
|
<div class="flex flex-col items-center space-y-2 text-surface-700">
|
|
35
59
|
<i class="fa-regular fa-diagram-subtask fa-2x" />
|
|
36
60
|
<p class="text-label">Builder</p>
|