@valerius_petrini/corekit-ui 0.1.70 → 0.1.71
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/dist/components/display/Card/index.svelte +2 -0
- package/dist/components/display/Card/index.svelte.d.ts +1 -1
- package/dist/components/display/KBD/index.svelte +2 -1
- package/dist/components/display/KBD/index.svelte.d.ts +1 -1
- package/dist/components/display/Skeleton/index.svelte +2 -1
- package/dist/components/display/Skeleton/index.svelte.d.ts +1 -1
- package/dist/components/display/Table/index.svelte +2 -1
- package/dist/components/display/Table/index.svelte.d.ts +1 -1
- package/dist/components/feedback/Loader/index.svelte +2 -1
- package/dist/components/feedback/Loader/index.svelte.d.ts +1 -1
- package/dist/components/feedback/Modal/index.svelte +2 -1
- package/dist/components/feedback/Modal/index.svelte.d.ts +1 -1
- package/dist/components/feedback/Progress/index.svelte +2 -1
- package/dist/components/feedback/Progress/index.svelte.d.ts +1 -1
- package/dist/components/feedback/Toast/index.svelte +2 -1
- package/dist/components/feedback/Toast/index.svelte.d.ts +1 -1
- package/dist/components/inputs/Button/index.svelte +2 -0
- package/dist/components/inputs/Button/index.svelte.d.ts +1 -1
- package/dist/components/inputs/Checkbox/index.svelte +3 -1
- package/dist/components/inputs/Checkbox/index.svelte.d.ts +1 -1
- package/dist/components/inputs/ColorInput/index.svelte +9 -9
- package/dist/components/inputs/ColorInput/index.svelte.d.ts +1 -1
- package/dist/components/inputs/Combobox/index.svelte +8 -8
- package/dist/components/inputs/Combobox/index.svelte.d.ts +1 -1
- package/dist/components/inputs/FileInput/index.svelte +2 -1
- package/dist/components/inputs/FileInput/index.svelte.d.ts +1 -1
- package/dist/components/inputs/Input/index.svelte +2 -0
- package/dist/components/inputs/Input/index.svelte.d.ts +1 -1
- package/dist/components/inputs/Select/index.svelte +3 -1
- package/dist/components/inputs/Select/index.svelte.d.ts +2 -1
- package/dist/components/navigation/Breadcrumb/BreadcrumbItem.svelte +2 -1
- package/dist/components/navigation/Breadcrumb/BreadcrumbItem.svelte.d.ts +1 -1
- package/dist/components/navigation/Breadcrumb/index.svelte +2 -1
- package/dist/components/navigation/Breadcrumb/index.svelte.d.ts +1 -1
- package/dist/components/navigation/Navbar/NavbarDropdown.svelte +5 -4
- package/dist/components/navigation/Navbar/NavbarDropdown.svelte.d.ts +1 -1
- package/dist/components/navigation/Navbar/NavbarElement.svelte +2 -1
- package/dist/components/navigation/Navbar/NavbarElement.svelte.d.ts +1 -1
- package/dist/components/navigation/Navbar/NavbarSeparator.svelte +2 -1
- package/dist/components/navigation/Navbar/NavbarSeparator.svelte.d.ts +1 -1
- package/dist/components/navigation/Navbar/index.svelte +2 -1
- package/dist/components/navigation/Navbar/index.svelte.d.ts +1 -1
- package/dist/components/navigation/Navbar/types.d.ts +1 -1
- package/dist/components/navigation/SideNavbar/index.svelte +2 -1
- package/dist/components/navigation/SideNavbar/index.svelte.d.ts +1 -1
- package/dist/components/overlay/Tooltip/index.svelte +2 -0
- package/dist/components/overlay/Tooltip/index.svelte.d.ts +1 -1
- package/dist/components/typography/Text/index.svelte +3 -2
- package/dist/components/typography/Text/index.svelte.d.ts +1 -1
- package/dist/components/typography/Typewriter/index.svelte +2 -1
- package/dist/components/typography/Typewriter/index.svelte.d.ts +1 -1
- package/dist/types/BaseComponent.d.ts +1 -0
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
let {
|
|
9
9
|
children = undefined,
|
|
10
10
|
class: className = "",
|
|
11
|
+
element = $bindable(),
|
|
11
12
|
href = undefined,
|
|
12
13
|
external = false,
|
|
13
14
|
variant = "bordered",
|
|
@@ -42,6 +43,7 @@
|
|
|
42
43
|
style={mergedStyle}
|
|
43
44
|
{...anchorProps}
|
|
44
45
|
{...restProps}
|
|
46
|
+
bind:this={element}
|
|
45
47
|
>
|
|
46
48
|
{@render children?.()}
|
|
47
49
|
</svelte:element>
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
let {
|
|
5
5
|
children = undefined,
|
|
6
6
|
class: className = "",
|
|
7
|
+
element = $bindable(),
|
|
7
8
|
subtext = undefined,
|
|
8
9
|
...restProps
|
|
9
10
|
}: any = $props();
|
|
@@ -13,7 +14,7 @@
|
|
|
13
14
|
const combinedClass = $derived(twMerge(defaultClass, className));
|
|
14
15
|
</script>
|
|
15
16
|
|
|
16
|
-
<span class={combinedClass} {...restProps}>
|
|
17
|
+
<span class={combinedClass} {...restProps} bind:this={element}>
|
|
17
18
|
{@render children?.()}
|
|
18
19
|
{#if subtext}
|
|
19
20
|
<span class="text-sub-text text-[10px] mt-0.5">
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
let {
|
|
9
9
|
variant = "text",
|
|
10
10
|
class: className = "",
|
|
11
|
+
element = $bindable(),
|
|
11
12
|
count = 19,
|
|
12
13
|
size = "md"
|
|
13
14
|
}: SkeletonProps = $props();
|
|
@@ -38,7 +39,7 @@
|
|
|
38
39
|
</div>
|
|
39
40
|
{/snippet}
|
|
40
41
|
|
|
41
|
-
<div class={combinedContainerClass}>
|
|
42
|
+
<div class={combinedContainerClass} bind:this={element}>
|
|
42
43
|
{#if variant === "default"}
|
|
43
44
|
<div class="h-4 bg-sub-background rounded w-3/4"></div>
|
|
44
45
|
<div class="h-4 bg-sub-background rounded w-full"></div>
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
let {
|
|
6
6
|
children = undefined,
|
|
7
7
|
class: className = "",
|
|
8
|
+
element = $bindable(),
|
|
8
9
|
tableHeaders = [],
|
|
9
10
|
tableData = [],
|
|
10
11
|
size = "md",
|
|
@@ -25,7 +26,7 @@
|
|
|
25
26
|
const combinedTableHeaderClass = $derived(twMerge(defaultTableHeaderClass, defaultTableCellClass));
|
|
26
27
|
</script>
|
|
27
28
|
|
|
28
|
-
<div class="overflow-auto w-full">
|
|
29
|
+
<div class="overflow-auto w-full" bind:this={element}>
|
|
29
30
|
<table {...restProps} class={combinedTableClass}>
|
|
30
31
|
<thead>
|
|
31
32
|
<tr>
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
let {
|
|
8
8
|
class: className = "",
|
|
9
|
+
element = $bindable(),
|
|
9
10
|
size = "md",
|
|
10
11
|
color = "blue",
|
|
11
12
|
...restProps
|
|
@@ -21,7 +22,7 @@
|
|
|
21
22
|
));
|
|
22
23
|
</script>
|
|
23
24
|
|
|
24
|
-
<div class={sizeClass} {...restProps}></div>
|
|
25
|
+
<div class={sizeClass} {...restProps} bind:this={element}></div>
|
|
25
26
|
|
|
26
27
|
<style>
|
|
27
28
|
.loader {
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
let {
|
|
9
9
|
children = undefined,
|
|
10
10
|
class: className = "",
|
|
11
|
+
element = $bindable(),
|
|
11
12
|
open = $bindable(),
|
|
12
13
|
position = "center",
|
|
13
14
|
...restProps
|
|
@@ -27,7 +28,7 @@
|
|
|
27
28
|
{#if open}
|
|
28
29
|
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
29
30
|
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
30
|
-
<div class={combinedOuterDivClass} transition:fade={{ duration: 200 }} onclick={() => open = false}>
|
|
31
|
+
<div class={combinedOuterDivClass} transition:fade={{ duration: 200 }} onclick={() => open = false} bind:this={element}>
|
|
31
32
|
<div class={combinedInnerDivClass} transition:fly={{ y: -20, duration: 200 }} onclick={(e) => e.stopPropagation()}>
|
|
32
33
|
<Card class={combinedCardClass} {...restProps}>
|
|
33
34
|
{@render children()}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
let {
|
|
9
9
|
children = undefined,
|
|
10
10
|
class: className = "",
|
|
11
|
+
element = $bindable(),
|
|
11
12
|
divClass = "",
|
|
12
13
|
progress = 100,
|
|
13
14
|
animate = undefined,
|
|
@@ -64,6 +65,6 @@
|
|
|
64
65
|
});
|
|
65
66
|
</script>
|
|
66
67
|
|
|
67
|
-
<div class={combinedDivClass} {...restProps} style="--duration: {animate?.duration}ms; {customStyle}">
|
|
68
|
+
<div class={combinedDivClass} {...restProps} style="--duration: {animate?.duration}ms; {customStyle}" bind:this={element}>
|
|
68
69
|
<div class={combinedInnerClass} style="width: {animate ? (mounted ? animate?.to : animate?.from) : progress}%; transition: width var(--duration) linear;"></div>
|
|
69
70
|
</div>
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
size = "md",
|
|
27
27
|
radius = "md",
|
|
28
28
|
onclose = undefined,
|
|
29
|
+
element = $bindable(),
|
|
29
30
|
...restProps
|
|
30
31
|
}: ToastProps = $props();
|
|
31
32
|
|
|
@@ -58,7 +59,7 @@
|
|
|
58
59
|
});
|
|
59
60
|
</script>
|
|
60
61
|
|
|
61
|
-
<div transition:fly={flyParams} class={combinedToastClass} {...restProps}>
|
|
62
|
+
<div transition:fly={flyParams} class={combinedToastClass} {...restProps} bind:this={element}>
|
|
62
63
|
<div class="w-8 h-8 flex-center">
|
|
63
64
|
<Icon class={defualtIconClass}/>
|
|
64
65
|
</div>
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
let {
|
|
15
15
|
children = undefined,
|
|
16
16
|
class: className = "",
|
|
17
|
+
element = $bindable(),
|
|
17
18
|
pill = false,
|
|
18
19
|
icon = false,
|
|
19
20
|
square = false,
|
|
@@ -84,6 +85,7 @@
|
|
|
84
85
|
style={mergedStyle}
|
|
85
86
|
{...anchorProps}
|
|
86
87
|
{...restProps}
|
|
88
|
+
bind:this={element}
|
|
87
89
|
>
|
|
88
90
|
{#if loading}
|
|
89
91
|
<Loader
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
let {
|
|
7
7
|
children = undefined,
|
|
8
8
|
class: className = "",
|
|
9
|
+
element = $bindable(),
|
|
9
10
|
label = "",
|
|
10
11
|
labelClass = "",
|
|
11
12
|
divClass = "",
|
|
@@ -29,7 +30,8 @@
|
|
|
29
30
|
id={id}
|
|
30
31
|
bind:checked={checked}
|
|
31
32
|
class={combinedClass}
|
|
32
|
-
{...restProps}
|
|
33
|
+
{...restProps}
|
|
34
|
+
bind:this={element}/>
|
|
33
35
|
<Text tag="label" for={id} class={combinedLabelClass}>
|
|
34
36
|
{label}
|
|
35
37
|
</Text>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { CheckboxProps } from "./types";
|
|
2
|
-
declare const Index: import("svelte").Component<CheckboxProps, {}, "checked">;
|
|
2
|
+
declare const Index: import("svelte").Component<CheckboxProps, {}, "element" | "checked">;
|
|
3
3
|
type Index = ReturnType<typeof Index>;
|
|
4
4
|
export default Index;
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
let {
|
|
20
20
|
children = undefined,
|
|
21
21
|
class: className = "",
|
|
22
|
+
element = $bindable(),
|
|
22
23
|
label = undefined,
|
|
23
24
|
labelClass = "",
|
|
24
25
|
divClass = "",
|
|
@@ -36,7 +37,6 @@
|
|
|
36
37
|
let inputElement: HTMLInputElement;
|
|
37
38
|
let dropdownX = $state(0);
|
|
38
39
|
let dropdownY = $state(0);
|
|
39
|
-
let referenceEl = $state<HTMLElement>();
|
|
40
40
|
let floatingEl = $state<HTMLDivElement>();
|
|
41
41
|
let canvasEl = $state<HTMLDivElement>();
|
|
42
42
|
let hueEl = $state<HTMLDivElement>();
|
|
@@ -79,11 +79,11 @@
|
|
|
79
79
|
));
|
|
80
80
|
|
|
81
81
|
async function updateDropdownPosition() {
|
|
82
|
-
if (!
|
|
82
|
+
if (!element || !floatingEl) return;
|
|
83
83
|
|
|
84
|
-
referenceWidth =
|
|
84
|
+
referenceWidth = element.offsetWidth;
|
|
85
85
|
|
|
86
|
-
const { x, y } = await computePosition(
|
|
86
|
+
const { x, y } = await computePosition(element, floatingEl, {
|
|
87
87
|
placement: "bottom-start",
|
|
88
88
|
middleware: [
|
|
89
89
|
offset(8),
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
async function handleMouseDown(e: MouseEvent) {
|
|
111
111
|
if (
|
|
112
112
|
isOpen &&
|
|
113
|
-
|
|
113
|
+
element && !element.contains(e.target as Node) &&
|
|
114
114
|
floatingEl && !floatingEl.contains(e.target as Node)
|
|
115
115
|
) {
|
|
116
116
|
isOpen = false;
|
|
@@ -172,9 +172,9 @@
|
|
|
172
172
|
}
|
|
173
173
|
|
|
174
174
|
$effect(() => {
|
|
175
|
-
if (isOpen &&
|
|
175
|
+
if (isOpen && element && floatingEl) {
|
|
176
176
|
const cleanup = autoUpdate(
|
|
177
|
-
|
|
177
|
+
element,
|
|
178
178
|
floatingEl,
|
|
179
179
|
updateDropdownPosition
|
|
180
180
|
);
|
|
@@ -262,7 +262,7 @@
|
|
|
262
262
|
|
|
263
263
|
<svelte:window onmousedown={handleMouseDown}/>
|
|
264
264
|
|
|
265
|
-
<div class={combinedOuterDivClass} bind:this={
|
|
265
|
+
<div class={combinedOuterDivClass} bind:this={element}>
|
|
266
266
|
<Text tag="label" for={id} class={combinedLabelClass} style={getSizeStyle(size, "formLabel")}>
|
|
267
267
|
{label}
|
|
268
268
|
{#if required}
|
|
@@ -310,7 +310,7 @@
|
|
|
310
310
|
<div class="slider absolute w-5 h-1 border border-white shadow" style="top: {(hue / 360) * 100}%"></div>
|
|
311
311
|
</div>
|
|
312
312
|
|
|
313
|
-
<div class="grow flex flex-col gap-2 min-w-
|
|
313
|
+
<div class="grow flex flex-col gap-2 min-w-40">
|
|
314
314
|
<Input
|
|
315
315
|
type="text"
|
|
316
316
|
variant="floating"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ColorInputProps } from "./types";
|
|
2
|
-
declare const Index: import("svelte").Component<ColorInputProps, {}, "value">;
|
|
2
|
+
declare const Index: import("svelte").Component<ColorInputProps, {}, "element" | "value">;
|
|
3
3
|
type Index = ReturnType<typeof Index>;
|
|
4
4
|
export default Index;
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
let {
|
|
14
14
|
children = undefined,
|
|
15
15
|
class: className = "",
|
|
16
|
+
element = $bindable(),
|
|
16
17
|
label = "",
|
|
17
18
|
labelClass = "",
|
|
18
19
|
divClass = "",
|
|
@@ -38,7 +39,6 @@
|
|
|
38
39
|
|
|
39
40
|
let dropdownX = $state(0);
|
|
40
41
|
let dropdownY = $state(0);
|
|
41
|
-
let referenceEl = $state<HTMLElement>();
|
|
42
42
|
let floatingEl = $state<HTMLDivElement>();
|
|
43
43
|
|
|
44
44
|
let debouncedSearch = $state("");
|
|
@@ -81,11 +81,11 @@
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
async function updateDropdownPosition() {
|
|
84
|
-
if (!
|
|
84
|
+
if (!element || !floatingEl) return;
|
|
85
85
|
|
|
86
|
-
referenceWidth =
|
|
86
|
+
referenceWidth = element.offsetWidth;
|
|
87
87
|
|
|
88
|
-
const { x, y } = await computePosition(
|
|
88
|
+
const { x, y } = await computePosition(element, floatingEl, {
|
|
89
89
|
placement: "bottom-start",
|
|
90
90
|
middleware: [
|
|
91
91
|
offset(8),
|
|
@@ -173,9 +173,9 @@
|
|
|
173
173
|
let optionsContainerElement = $state<HTMLDivElement>();
|
|
174
174
|
|
|
175
175
|
$effect(() => {
|
|
176
|
-
if (isFocused &&
|
|
176
|
+
if (isFocused && element && floatingEl) {
|
|
177
177
|
const cleanup = autoUpdate(
|
|
178
|
-
|
|
178
|
+
element,
|
|
179
179
|
floatingEl,
|
|
180
180
|
updateDropdownPosition
|
|
181
181
|
);
|
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
function handleMouseDown(e: MouseEvent) {
|
|
187
187
|
if (
|
|
188
188
|
isFocused &&
|
|
189
|
-
|
|
189
|
+
element && !element.contains(e.target as Node) &&
|
|
190
190
|
floatingEl && !floatingEl.contains(e.target as Node)
|
|
191
191
|
) {
|
|
192
192
|
isFocused = false;
|
|
@@ -213,7 +213,7 @@
|
|
|
213
213
|
{id}
|
|
214
214
|
{isFocused}
|
|
215
215
|
{icon}
|
|
216
|
-
bind:wrapper={
|
|
216
|
+
bind:wrapper={element}>
|
|
217
217
|
|
|
218
218
|
{#snippet innerDivElement()}
|
|
219
219
|
<input
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ComboboxProps } from "./types";
|
|
2
|
-
declare const Index: import("svelte").Component<ComboboxProps, {}, "value">;
|
|
2
|
+
declare const Index: import("svelte").Component<ComboboxProps, {}, "element" | "value">;
|
|
3
3
|
type Index = ReturnType<typeof Index>;
|
|
4
4
|
export default Index;
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
let {
|
|
13
13
|
children = undefined,
|
|
14
14
|
class: className = "",
|
|
15
|
+
element = $bindable(),
|
|
15
16
|
label = undefined,
|
|
16
17
|
labelClass = "",
|
|
17
18
|
divClass = "",
|
|
@@ -75,7 +76,7 @@
|
|
|
75
76
|
}
|
|
76
77
|
</script>
|
|
77
78
|
|
|
78
|
-
<div class={combinedOuterDivClass}>
|
|
79
|
+
<div class={combinedOuterDivClass} bind:this={element}>
|
|
79
80
|
<Text tag="label" for={id} class={combinedLabelClass} style={getSizeStyle(size, "formLabel")}>
|
|
80
81
|
{label}
|
|
81
82
|
{#if required}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { FileInputProps } from "./types";
|
|
2
|
-
declare const Index: import("svelte").Component<FileInputProps, {}, "files">;
|
|
2
|
+
declare const Index: import("svelte").Component<FileInputProps, {}, "element" | "files">;
|
|
3
3
|
type Index = ReturnType<typeof Index>;
|
|
4
4
|
export default Index;
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
let {
|
|
21
21
|
children = undefined,
|
|
22
22
|
class: className = "",
|
|
23
|
+
element = $bindable(),
|
|
23
24
|
label = "",
|
|
24
25
|
labelClass = "",
|
|
25
26
|
divClass = "",
|
|
@@ -128,6 +129,7 @@
|
|
|
128
129
|
{isFocused}
|
|
129
130
|
{id}
|
|
130
131
|
icon={Icon}
|
|
132
|
+
bind:wrapper={element}
|
|
131
133
|
{...restProps}>
|
|
132
134
|
{#snippet outerDivElementAfter()}
|
|
133
135
|
{#if touched && requirements}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { InputProps } from "./types";
|
|
2
2
|
import { type Component } from "svelte";
|
|
3
|
-
declare const Index: Component<InputProps, {}, "value" | "valid">;
|
|
3
|
+
declare const Index: Component<InputProps, {}, "element" | "value" | "valid">;
|
|
4
4
|
type Index = ReturnType<typeof Index>;
|
|
5
5
|
export default Index;
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
import { twMerge } from "tailwind-merge";
|
|
3
3
|
import { getSizeStyleClass } from "../../../styles/size";
|
|
4
4
|
|
|
5
|
-
import type { SelectProps } from "
|
|
5
|
+
import type { SelectProps } from "./types";
|
|
6
6
|
import BaseInput from "../helper/BaseInput.svelte";
|
|
7
7
|
|
|
8
8
|
let {
|
|
9
9
|
children = undefined,
|
|
10
10
|
class: className = "",
|
|
11
|
+
element = $bindable(),
|
|
11
12
|
label = "",
|
|
12
13
|
labelClass = "",
|
|
13
14
|
divClass = "",
|
|
@@ -62,6 +63,7 @@
|
|
|
62
63
|
{radius}
|
|
63
64
|
{isFocused}
|
|
64
65
|
{id}
|
|
66
|
+
bind:wrapper={element}
|
|
65
67
|
{...restProps}>
|
|
66
68
|
{#snippet innerDivElement()}
|
|
67
69
|
<select
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import type { SelectProps } from "./types";
|
|
2
|
+
declare const Index: import("svelte").Component<SelectProps, {}, "element" | "value">;
|
|
2
3
|
type Index = ReturnType<typeof Index>;
|
|
3
4
|
export default Index;
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
let {
|
|
7
7
|
children = undefined,
|
|
8
8
|
class: className = "",
|
|
9
|
+
element = $bindable(),
|
|
9
10
|
href = undefined,
|
|
10
11
|
...restProps
|
|
11
12
|
}: BreadcrumbItemProps = $props();
|
|
@@ -16,7 +17,7 @@
|
|
|
16
17
|
));
|
|
17
18
|
</script>
|
|
18
19
|
|
|
19
|
-
<li class={combinedClass} {...restProps} aria-current={href ? undefined : 'page'}>
|
|
20
|
+
<li class={combinedClass} {...restProps} aria-current={href ? undefined : 'page'} bind:this={element}>
|
|
20
21
|
{#if href}
|
|
21
22
|
<a class="hover:underline hover:text-sub-text transition-colors" href={href}>
|
|
22
23
|
{@render children?.()}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { BreadcrumbItemProps } from "./types";
|
|
2
|
-
declare const BreadcrumbItem: import("svelte").Component<BreadcrumbItemProps, {}, "">;
|
|
2
|
+
declare const BreadcrumbItem: import("svelte").Component<BreadcrumbItemProps, {}, "element">;
|
|
3
3
|
type BreadcrumbItem = ReturnType<typeof BreadcrumbItem>;
|
|
4
4
|
export default BreadcrumbItem;
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
let {
|
|
6
6
|
children = undefined,
|
|
7
7
|
class: className = "",
|
|
8
|
+
element = $bindable(),
|
|
8
9
|
...restProps
|
|
9
10
|
}: BreadcrumbProps = $props();
|
|
10
11
|
|
|
@@ -14,7 +15,7 @@
|
|
|
14
15
|
));
|
|
15
16
|
</script>
|
|
16
17
|
|
|
17
|
-
<nav aria-label="Breadcrumb" class={combinedClass} {...restProps}>
|
|
18
|
+
<nav aria-label="Breadcrumb" class={combinedClass} {...restProps} bind:this={element}>
|
|
18
19
|
<ol class="flex flex-wrap items-center">
|
|
19
20
|
{@render children?.()}
|
|
20
21
|
</ol>
|
|
@@ -7,9 +7,10 @@
|
|
|
7
7
|
let {
|
|
8
8
|
children = undefined,
|
|
9
9
|
class: className = "",
|
|
10
|
+
element = $bindable(),
|
|
10
11
|
wrapperClass = "",
|
|
11
12
|
label = "",
|
|
12
|
-
|
|
13
|
+
navelement = undefined,
|
|
13
14
|
...restProps
|
|
14
15
|
}: NavbarDropdownProps = $props();
|
|
15
16
|
|
|
@@ -58,11 +59,11 @@
|
|
|
58
59
|
|
|
59
60
|
<svelte:window onclick={handleClickOutside}/>
|
|
60
61
|
|
|
61
|
-
<div class="relative" bind:this={wrapperRef}>
|
|
62
|
+
<div class="relative" bind:this={wrapperRef} bind:this={element}>
|
|
62
63
|
<NavbarElement onclick={toggle} class={className} {...restProps} aria-haspopup="true" aria-expanded={open}>
|
|
63
64
|
{label}
|
|
64
|
-
{#if
|
|
65
|
-
{@render
|
|
65
|
+
{#if navelement}
|
|
66
|
+
{@render navelement()}
|
|
66
67
|
{/if}
|
|
67
68
|
</NavbarElement>
|
|
68
69
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { NavbarDropdownProps } from "./types.js";
|
|
2
|
-
declare const NavbarDropdown: import("svelte").Component<NavbarDropdownProps, {}, "">;
|
|
2
|
+
declare const NavbarDropdown: import("svelte").Component<NavbarDropdownProps, {}, "element">;
|
|
3
3
|
type NavbarDropdown = ReturnType<typeof NavbarDropdown>;
|
|
4
4
|
export default NavbarDropdown;
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
let {
|
|
8
8
|
children = undefined,
|
|
9
9
|
class: className = "",
|
|
10
|
+
element = $bindable(),
|
|
10
11
|
classTop = "",
|
|
11
12
|
activeClass = "",
|
|
12
13
|
href = undefined,
|
|
@@ -30,6 +31,6 @@
|
|
|
30
31
|
|
|
31
32
|
<svelte:window bind:scrollY={scrollY}/>
|
|
32
33
|
|
|
33
|
-
<Button radius="none" {href} color="none" class={combinedClass} {...restProps} aria-current={isActive ? 'page' : undefined}>
|
|
34
|
+
<Button bind:element radius="none" {href} color="none" class={combinedClass} {...restProps} aria-current={isActive ? 'page' : undefined}>
|
|
34
35
|
{@render children?.()}
|
|
35
36
|
</Button>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { NavbarElementProps } from "./types";
|
|
2
|
-
declare const NavbarElement: import("svelte").Component<NavbarElementProps, {}, "">;
|
|
2
|
+
declare const NavbarElement: import("svelte").Component<NavbarElementProps, {}, "element">;
|
|
3
3
|
type NavbarElement = ReturnType<typeof NavbarElement>;
|
|
4
4
|
export default NavbarElement;
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
let {
|
|
5
5
|
variant = "dynamic",
|
|
6
6
|
class: className = "",
|
|
7
|
+
element = $bindable(),
|
|
7
8
|
...restProps
|
|
8
9
|
}: NavbarSeparatorProps = $props();
|
|
9
10
|
</script>
|
|
10
11
|
|
|
11
|
-
<div class={NavbarSeparatorClasses[variant]} {...restProps}></div>
|
|
12
|
+
<div bind:this={element} class={NavbarSeparatorClasses[variant]} {...restProps}></div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type NavbarSeparatorProps } from "./types.js";
|
|
2
|
-
declare const NavbarSeparator: import("svelte").Component<NavbarSeparatorProps, {}, "">;
|
|
2
|
+
declare const NavbarSeparator: import("svelte").Component<NavbarSeparatorProps, {}, "element">;
|
|
3
3
|
type NavbarSeparator = ReturnType<typeof NavbarSeparator>;
|
|
4
4
|
export default NavbarSeparator;
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
class: className = "",
|
|
8
8
|
classTop = "",
|
|
9
9
|
threshold = 10,
|
|
10
|
+
element = $bindable(),
|
|
10
11
|
...restProps
|
|
11
12
|
}: NavbarProps = $props();
|
|
12
13
|
|
|
@@ -24,6 +25,6 @@
|
|
|
24
25
|
|
|
25
26
|
<svelte:window bind:scrollY={scrollY}/>
|
|
26
27
|
|
|
27
|
-
<nav class={combinedClass} {...restProps}>
|
|
28
|
+
<nav class={combinedClass} {...restProps} bind:this={element}>
|
|
28
29
|
{@render children?.()}
|
|
29
30
|
</nav>
|
|
@@ -17,7 +17,7 @@ export interface NavbarSeparatorProps extends BaseComponentProps {
|
|
|
17
17
|
}
|
|
18
18
|
export interface NavbarDropdownProps extends BaseComponentProps {
|
|
19
19
|
label?: string;
|
|
20
|
-
|
|
20
|
+
navelement?: Snippet;
|
|
21
21
|
classTop?: string;
|
|
22
22
|
wrapperClass?: string;
|
|
23
23
|
activeClass?: string;
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
let {
|
|
9
9
|
children = undefined,
|
|
10
10
|
class: className = "",
|
|
11
|
+
element = $bindable(),
|
|
11
12
|
items = [],
|
|
12
13
|
...restProps
|
|
13
14
|
}: SideNavbarProps = $props();
|
|
@@ -24,7 +25,7 @@
|
|
|
24
25
|
));
|
|
25
26
|
</script>
|
|
26
27
|
|
|
27
|
-
<nav class={combinedClass} {...restProps} onmouseenter={() => expanded = true} onmouseleave={() => expanded = false}>
|
|
28
|
+
<nav class={combinedClass} {...restProps} onmouseenter={() => expanded = true} onmouseleave={() => expanded = false} bind:this={element}>
|
|
28
29
|
{#each items as item}
|
|
29
30
|
{@const isActive = page.url.pathname === item.href}
|
|
30
31
|
<Button size="xs" class="{isActive ? 'bg-form-background text-main-text' : 'text-sub-text'} hover:text-main-text py-1 text-nowrap flex justify-start gap-2 overflow-hidden mx-1 w-[calc(100%-16px)] hover:bg-form-background px-1.5" href={item.href}>
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
let {
|
|
20
20
|
text,
|
|
21
21
|
position = "top",
|
|
22
|
+
element = $bindable(),
|
|
22
23
|
delay = 150,
|
|
23
24
|
interactive = false,
|
|
24
25
|
children,
|
|
@@ -160,6 +161,7 @@
|
|
|
160
161
|
class="z-999999 {interactive ? 'pointer-events-auto' : 'pointer-events-none'}"
|
|
161
162
|
onmouseenter={onTooltipEnter}
|
|
162
163
|
onmouseleave={onTooltipLeave}
|
|
164
|
+
bind:this={element}
|
|
163
165
|
>
|
|
164
166
|
<div
|
|
165
167
|
bind:this={arrowEl}
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
let {
|
|
7
7
|
children = undefined,
|
|
8
|
-
class: className = "",
|
|
8
|
+
class: className = "",
|
|
9
|
+
element = $bindable(),
|
|
9
10
|
tag = "p",
|
|
10
11
|
shrink = undefined,
|
|
11
12
|
size = "none",
|
|
@@ -60,6 +61,6 @@
|
|
|
60
61
|
));
|
|
61
62
|
</script>
|
|
62
63
|
|
|
63
|
-
<svelte:element this={tag} style={shrinkStyle} class={combinedClass} {...restProps}>
|
|
64
|
+
<svelte:element bind:this={element} this={tag} style={shrinkStyle} class={combinedClass} {...restProps}>
|
|
64
65
|
{@render children?.()}
|
|
65
66
|
</svelte:element>
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
let {
|
|
9
9
|
actions,
|
|
10
10
|
class: className = "",
|
|
11
|
+
element = $bindable(),
|
|
11
12
|
textClass = "",
|
|
12
13
|
...restProps
|
|
13
14
|
}: TypewriterProps = $props();
|
|
@@ -65,7 +66,7 @@
|
|
|
65
66
|
let combinedClass = $derived(twMerge("typewriter w-fit text-main-text", className));
|
|
66
67
|
</script>
|
|
67
68
|
|
|
68
|
-
<div class={combinedClass} {...restProps}>
|
|
69
|
+
<div class={combinedClass} {...restProps} bind:this={element}>
|
|
69
70
|
{#each displaySegments as segment}
|
|
70
71
|
{#key segment}
|
|
71
72
|
<Text tag="span" class={textClass} style="color: {segment.color}">{segment.text}</Text>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { TypewriterProps } from "./types.ts";
|
|
2
|
-
declare const Index: import("svelte").Component<TypewriterProps, {}, "">;
|
|
2
|
+
declare const Index: import("svelte").Component<TypewriterProps, {}, "element">;
|
|
3
3
|
type Index = ReturnType<typeof Index>;
|
|
4
4
|
export default Index;
|