@valerius_petrini/corekit-ui 0.1.69 → 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.
Files changed (69) hide show
  1. package/dist/components/display/Card/index.svelte +2 -0
  2. package/dist/components/display/Card/index.svelte.d.ts +1 -1
  3. package/dist/components/display/Card/types.d.ts +2 -2
  4. package/dist/components/display/KBD/index.svelte +2 -1
  5. package/dist/components/display/KBD/index.svelte.d.ts +1 -1
  6. package/dist/components/display/Skeleton/index.svelte +2 -1
  7. package/dist/components/display/Skeleton/index.svelte.d.ts +1 -1
  8. package/dist/components/display/Skeleton/types.d.ts +1 -1
  9. package/dist/components/display/Table/index.svelte +2 -1
  10. package/dist/components/display/Table/index.svelte.d.ts +1 -1
  11. package/dist/components/feedback/Loader/index.svelte +4 -3
  12. package/dist/components/feedback/Loader/index.svelte.d.ts +1 -1
  13. package/dist/components/feedback/Loader/types.d.ts +2 -2
  14. package/dist/components/feedback/Modal/index.svelte +2 -1
  15. package/dist/components/feedback/Modal/index.svelte.d.ts +1 -1
  16. package/dist/components/feedback/Progress/index.svelte +2 -1
  17. package/dist/components/feedback/Progress/index.svelte.d.ts +1 -1
  18. package/dist/components/feedback/Toast/index.svelte +2 -1
  19. package/dist/components/feedback/Toast/index.svelte.d.ts +1 -1
  20. package/dist/components/inputs/Button/index.svelte +4 -2
  21. package/dist/components/inputs/Button/index.svelte.d.ts +1 -1
  22. package/dist/components/inputs/Button/size.d.ts +1 -1
  23. package/dist/components/inputs/Button/types.d.ts +3 -3
  24. package/dist/components/inputs/Checkbox/index.svelte +3 -1
  25. package/dist/components/inputs/Checkbox/index.svelte.d.ts +1 -1
  26. package/dist/components/inputs/Checkbox/types.d.ts +1 -1
  27. package/dist/components/inputs/ColorInput/index.svelte +9 -9
  28. package/dist/components/inputs/ColorInput/index.svelte.d.ts +1 -1
  29. package/dist/components/inputs/ColorInput/types.d.ts +2 -2
  30. package/dist/components/inputs/Combobox/index.svelte +9 -9
  31. package/dist/components/inputs/Combobox/index.svelte.d.ts +1 -1
  32. package/dist/components/inputs/Combobox/types.d.ts +1 -1
  33. package/dist/components/inputs/FileInput/index.svelte +2 -1
  34. package/dist/components/inputs/FileInput/index.svelte.d.ts +1 -1
  35. package/dist/components/inputs/FileInput/types.d.ts +2 -2
  36. package/dist/components/inputs/Input/index.svelte +2 -0
  37. package/dist/components/inputs/Input/index.svelte.d.ts +1 -1
  38. package/dist/components/inputs/Input/types.d.ts +1 -1
  39. package/dist/components/inputs/Select/index.svelte +4 -2
  40. package/dist/components/inputs/Select/index.svelte.d.ts +2 -1
  41. package/dist/components/inputs/Select/types.d.ts +1 -1
  42. package/dist/components/inputs/helper/BaseInput.svelte +1 -1
  43. package/dist/components/inputs/helper/BaseInput.svelte.d.ts +1 -1
  44. package/dist/components/navigation/Breadcrumb/BreadcrumbItem.svelte +3 -2
  45. package/dist/components/navigation/Breadcrumb/BreadcrumbItem.svelte.d.ts +1 -1
  46. package/dist/components/navigation/Breadcrumb/index.svelte +2 -1
  47. package/dist/components/navigation/Breadcrumb/index.svelte.d.ts +1 -1
  48. package/dist/components/navigation/Breadcrumb/types.d.ts +1 -1
  49. package/dist/components/navigation/Navbar/NavbarDropdown.svelte +6 -5
  50. package/dist/components/navigation/Navbar/NavbarDropdown.svelte.d.ts +2 -2
  51. package/dist/components/navigation/Navbar/NavbarElement.svelte +2 -1
  52. package/dist/components/navigation/Navbar/NavbarElement.svelte.d.ts +1 -1
  53. package/dist/components/navigation/Navbar/NavbarSeparator.svelte +3 -2
  54. package/dist/components/navigation/Navbar/NavbarSeparator.svelte.d.ts +2 -2
  55. package/dist/components/navigation/Navbar/index.svelte +2 -1
  56. package/dist/components/navigation/Navbar/index.svelte.d.ts +1 -1
  57. package/dist/components/navigation/Navbar/types.d.ts +1 -1
  58. package/dist/components/navigation/SideNavbar/index.svelte +2 -1
  59. package/dist/components/navigation/SideNavbar/index.svelte.d.ts +1 -1
  60. package/dist/components/navigation/SideNavbar/types.d.ts +1 -1
  61. package/dist/components/overlay/Tooltip/index.stories.svelte +1 -1
  62. package/dist/components/overlay/Tooltip/index.svelte +3 -1
  63. package/dist/components/overlay/Tooltip/index.svelte.d.ts +1 -1
  64. package/dist/components/typography/Text/index.svelte +4 -3
  65. package/dist/components/typography/Text/index.svelte.d.ts +1 -1
  66. package/dist/components/typography/Typewriter/index.svelte +2 -1
  67. package/dist/components/typography/Typewriter/index.svelte.d.ts +1 -1
  68. package/dist/types/BaseComponent.d.ts +2 -1
  69. 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>
@@ -1,4 +1,4 @@
1
1
  import { type CardProps } from "./types.ts";
2
- declare const Index: import("svelte").Component<CardProps, {}, "">;
2
+ declare const Index: import("svelte").Component<CardProps, {}, "element">;
3
3
  type Index = ReturnType<typeof Index>;
4
4
  export default Index;
@@ -1,5 +1,5 @@
1
- import type { SizeStyle } from "$styles/size";
2
- import type { BaseComponentProps } from "$types/BaseComponent";
1
+ import type { SizeStyle } from "../../../styles/size";
2
+ import type { BaseComponentProps } from "../../../types/BaseComponent";
3
3
  export type CardVariant = "bordered" | "elevated";
4
4
  export interface CardProps extends BaseComponentProps {
5
5
  href?: string;
@@ -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">
@@ -1,3 +1,3 @@
1
- declare const Index: import("svelte").Component<any, {}, "">;
1
+ declare const Index: import("svelte").Component<any, {}, "element">;
2
2
  type Index = ReturnType<typeof Index>;
3
3
  export default Index;
@@ -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>
@@ -1,4 +1,4 @@
1
1
  import type { SkeletonProps } from "./types";
2
- declare const Index: import("svelte").Component<SkeletonProps, {}, "">;
2
+ declare const Index: import("svelte").Component<SkeletonProps, {}, "element">;
3
3
  type Index = ReturnType<typeof Index>;
4
4
  export default Index;
@@ -1,4 +1,4 @@
1
- import type { BaseComponentProps } from "$types/BaseComponent";
1
+ import type { BaseComponentProps } from "../../../types/BaseComponent";
2
2
  export type SkeletonVariant = "default" | "text" | "image" | "video" | "card";
3
3
  export interface SkeletonProps extends BaseComponentProps {
4
4
  variant?: SkeletonVariant;
@@ -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>
@@ -1,4 +1,4 @@
1
1
  import type { TableProps } from "./types";
2
- declare const Index: import("svelte").Component<TableProps, {}, "">;
2
+ declare const Index: import("svelte").Component<TableProps, {}, "element">;
3
3
  type Index = ReturnType<typeof Index>;
4
4
  export default Index;
@@ -1,11 +1,12 @@
1
1
  <script lang="ts">
2
- import { getSizeStyleClass } from "$styles/size.js";
2
+ import { getSizeStyleClass } from "../../../styles/size.js";
3
3
  import { twMerge } from "tailwind-merge";
4
4
  import type { LoaderProps } from "./types.js";
5
- import { generateColorStyle } from "$styles/color.js";
5
+ import { generateColorStyle } from "../../../styles/color.js";
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 {
@@ -1,4 +1,4 @@
1
1
  import type { LoaderProps } from "./types.ts";
2
- declare const Index: import("svelte").Component<LoaderProps, {}, "">;
2
+ declare const Index: import("svelte").Component<LoaderProps, {}, "element">;
3
3
  type Index = ReturnType<typeof Index>;
4
4
  export default Index;
@@ -1,5 +1,5 @@
1
- import type { ColorStyle } from "$styles/color";
2
- import type { SizeStyle } from "$styles/size";
1
+ import type { ColorStyle } from "../../../styles/color";
2
+ import type { SizeStyle } from "../../../styles/size";
3
3
  import type { BaseComponentProps } from "../../../types/BaseComponent.ts";
4
4
  export interface LoaderProps extends BaseComponentProps {
5
5
  size?: SizeStyle;
@@ -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()}
@@ -1,4 +1,4 @@
1
1
  import type { ModalProps } from "./types";
2
- declare const Index: import("svelte").Component<ModalProps, {}, "open">;
2
+ declare const Index: import("svelte").Component<ModalProps, {}, "element" | "open">;
3
3
  type Index = ReturnType<typeof Index>;
4
4
  export default Index;
@@ -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>
@@ -1,4 +1,4 @@
1
1
  import type { ProgressProps } from "./types.ts";
2
- declare const Index: import("svelte").Component<ProgressProps, {}, "">;
2
+ declare const Index: import("svelte").Component<ProgressProps, {}, "element">;
3
3
  type Index = ReturnType<typeof Index>;
4
4
  export default Index;
@@ -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>
@@ -1,5 +1,5 @@
1
1
  import type { ToastProps } from "./types.ts";
2
2
  import type { Component } from "svelte";
3
- declare const Index: Component<ToastProps, {}, "">;
3
+ declare const Index: Component<ToastProps, {}, "element">;
4
4
  type Index = ReturnType<typeof Index>;
5
5
  export default Index;
@@ -1,10 +1,10 @@
1
1
  <script lang="ts">
2
- import { generateColorStyle } from "$styles/color";
2
+ import { generateColorStyle } from "../../../styles/color";
3
3
  import {
4
4
  getSizeStyle,
5
5
  getSizeStyleClass,
6
6
  getSizeStyleClassRecord,
7
- } from "$styles/size";
7
+ } from "../../../styles/size";
8
8
  import type { ButtonProps } from "./types.js";
9
9
  import { twMerge } from "tailwind-merge";
10
10
  import { getLinkProps } from "../../../utils/link.js";
@@ -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
@@ -1,4 +1,4 @@
1
1
  import type { ButtonProps } from "./types.ts";
2
- declare const Index: import("svelte").Component<ButtonProps, {}, "">;
2
+ declare const Index: import("svelte").Component<ButtonProps, {}, "element">;
3
3
  type Index = ReturnType<typeof Index>;
4
4
  export default Index;
@@ -1,3 +1,3 @@
1
- import type { SizeStyle } from "$styles/size";
1
+ import type { SizeStyle } from "../../../styles/size";
2
2
  export declare const buttonSizeStyles: Record<SizeStyle, string>;
3
3
  export declare const buttonIconSizeStyles: Record<SizeStyle, string>;
@@ -1,6 +1,6 @@
1
- import type { ColorStyle, ButtonColorStyleType } from "$styles/color.js";
2
- import type { SizeStyle } from "$styles/size.js";
3
- import type { BaseComponentProps } from "$types/BaseComponent";
1
+ import type { ColorStyle, ButtonColorStyleType } from "../../../styles/color.js";
2
+ import type { SizeStyle } from "../../../styles/size.js";
3
+ import type { BaseComponentProps } from "../../../types/BaseComponent";
4
4
  export interface ButtonProps extends BaseComponentProps {
5
5
  pill?: boolean;
6
6
  icon?: boolean;
@@ -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;
@@ -1,4 +1,4 @@
1
- import type { BaseComponentProps } from "$types/BaseComponent";
1
+ import type { BaseComponentProps } from "../../../types/BaseComponent";
2
2
  export interface CheckboxProps extends BaseComponentProps {
3
3
  label?: string;
4
4
  labelClass?: string;
@@ -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 (!referenceEl || !floatingEl) return;
82
+ if (!element || !floatingEl) return;
83
83
 
84
- referenceWidth = referenceEl.offsetWidth;
84
+ referenceWidth = element.offsetWidth;
85
85
 
86
- const { x, y } = await computePosition(referenceEl, floatingEl, {
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
- referenceEl && !referenceEl.contains(e.target as Node) &&
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 && referenceEl && floatingEl) {
175
+ if (isOpen && element && floatingEl) {
176
176
  const cleanup = autoUpdate(
177
- referenceEl,
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={referenceEl}>
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-[160px]">
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;
@@ -1,5 +1,5 @@
1
- import type { SizeStyle } from "$styles/size";
2
- import type { BaseComponentProps } from "$types/BaseComponent";
1
+ import type { SizeStyle } from "../../../styles/size";
2
+ import type { BaseComponentProps } from "../../../types/BaseComponent";
3
3
  export type ColorInputVariant = "full" | "compact" | "input";
4
4
  export interface ColorInputProps extends BaseComponentProps {
5
5
  label?: string;
@@ -1,7 +1,7 @@
1
1
  <script lang="ts">
2
2
  import type { ComboboxProps } from "./types";
3
3
  import { twMerge } from "tailwind-merge";
4
- import { getSizeStyleClass } from "$styles/size";
4
+ import { getSizeStyleClass } from "../../../styles/size";
5
5
  import { computePosition, flip, shift, offset, autoUpdate } from "@floating-ui/dom";
6
6
 
7
7
  import BaseInput from "../helper/BaseInput.svelte";
@@ -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 (!referenceEl || !floatingEl) return;
84
+ if (!element || !floatingEl) return;
85
85
 
86
- referenceWidth = referenceEl.offsetWidth;
86
+ referenceWidth = element.offsetWidth;
87
87
 
88
- const { x, y } = await computePosition(referenceEl, floatingEl, {
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 && referenceEl && floatingEl) {
176
+ if (isFocused && element && floatingEl) {
177
177
  const cleanup = autoUpdate(
178
- referenceEl,
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
- referenceEl && !referenceEl.contains(e.target as Node) &&
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={referenceEl}>
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;
@@ -1,4 +1,4 @@
1
- import type { BaseInputProps } from "$types/BaseComponent";
1
+ import type { BaseInputProps } from "../../../types/BaseComponent";
2
2
  export interface ComboboxProps extends BaseInputProps {
3
3
  options?: string[];
4
4
  placeholder?: string;
@@ -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;
@@ -1,5 +1,5 @@
1
- import type { SizeStyle } from "$styles/size";
2
- import type { BaseComponentProps } from "$types/BaseComponent";
1
+ import type { SizeStyle } from "../../../styles/size";
2
+ import type { BaseComponentProps } from "../../../types/BaseComponent";
3
3
  export interface FileInputProps extends BaseComponentProps {
4
4
  label?: string;
5
5
  labelClass?: string;
@@ -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;
@@ -1,4 +1,4 @@
1
- import type { BaseInputProps } from "$types/BaseComponent";
1
+ import type { BaseInputProps } from "../../../types/BaseComponent";
2
2
  export interface InputRequirements {
3
3
  label: string;
4
4
  requirements: RegExp | ((value: any) => boolean);
@@ -1,13 +1,14 @@
1
1
  <script lang="ts">
2
2
  import { twMerge } from "tailwind-merge";
3
- import { getSizeStyleClass } from "$styles/size";
3
+ import { getSizeStyleClass } from "../../../styles/size";
4
4
 
5
- import type { SelectProps } from "../../../types/Input.js";
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
- declare const Index: import("svelte").Component<SelectProps, {}, "value">;
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;
@@ -1,4 +1,4 @@
1
- import type { BaseInputProps } from "$types/BaseComponent";
1
+ import type { BaseInputProps } from "../../../types/BaseComponent";
2
2
  export interface SelectProps extends BaseInputProps {
3
3
  options: {
4
4
  value: any;
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
  import { twMerge } from "tailwind-merge";
3
- import type { BaseInputProps } from "$types/BaseComponent";
3
+ import type { BaseInputProps } from "../../../types/BaseComponent";
4
4
  import Text from "../../typography/Text/index.svelte";
5
5
  import { getSizeStyleClass } from "../../../styles/size.js";
6
6
 
@@ -1,4 +1,4 @@
1
- import type { BaseInputProps } from "$types/BaseComponent";
1
+ import type { BaseInputProps } from "../../../types/BaseComponent";
2
2
  declare const BaseInput: import("svelte").Component<BaseInputProps, {}, "value" | "wrapper">;
3
3
  type BaseInput = ReturnType<typeof BaseInput>;
4
4
  export default BaseInput;
@@ -1,11 +1,12 @@
1
1
  <script lang="ts">
2
2
  import { twMerge } from "tailwind-merge";
3
3
  import type { BreadcrumbItemProps } from "./types";
4
- import { Text } from "$components/typography";
4
+ import { Text } from "../../typography";
5
5
 
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>
@@ -1,4 +1,4 @@
1
1
  import type { BreadcrumbProps } from "./types";
2
- declare const Index: import("svelte").Component<BreadcrumbProps, {}, "">;
2
+ declare const Index: import("svelte").Component<BreadcrumbProps, {}, "element">;
3
3
  type Index = ReturnType<typeof Index>;
4
4
  export default Index;
@@ -1,4 +1,4 @@
1
- import type { BaseComponentProps } from "$types/BaseComponent";
1
+ import type { BaseComponentProps } from "../../../types/BaseComponent";
2
2
  export interface BreadcrumbProps extends BaseComponentProps {
3
3
  }
4
4
  export interface BreadcrumbItemProps extends BaseComponentProps {
@@ -2,14 +2,15 @@
2
2
  import { fly } from "svelte/transition";
3
3
  import NavbarElement from "./NavbarElement.svelte";
4
4
  import { tick } from "svelte";
5
- import type { NavbarDropdownProps } from "$components/navigation/Navbar/types.js";
5
+ import type { NavbarDropdownProps } from "./types.js";
6
6
 
7
7
  let {
8
8
  children = undefined,
9
9
  class: className = "",
10
+ element = $bindable(),
10
11
  wrapperClass = "",
11
12
  label = "",
12
- element = undefined,
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 element}
65
- {@render element()}
65
+ {#if navelement}
66
+ {@render navelement()}
66
67
  {/if}
67
68
  </NavbarElement>
68
69
 
@@ -1,4 +1,4 @@
1
- import type { NavbarDropdownProps } from "$components/navigation/Navbar/types.js";
2
- declare const NavbarDropdown: import("svelte").Component<NavbarDropdownProps, {}, "">;
1
+ import type { NavbarDropdownProps } from "./types.js";
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;
@@ -1,11 +1,12 @@
1
1
  <script lang="ts">
2
- import { NavbarSeparatorClasses, type NavbarSeparatorProps } from "$components/navigation/Navbar/types.js";
2
+ import { NavbarSeparatorClasses, type NavbarSeparatorProps } from "./types.js";
3
3
 
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
- import { type NavbarSeparatorProps } from "$components/navigation/Navbar/types.js";
2
- declare const NavbarSeparator: import("svelte").Component<NavbarSeparatorProps, {}, "">;
1
+ import { type NavbarSeparatorProps } from "./types.js";
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>
@@ -1,4 +1,4 @@
1
1
  import type { NavbarProps } from "./types.ts";
2
- declare const Index: import("svelte").Component<NavbarProps, {}, "">;
2
+ declare const Index: import("svelte").Component<NavbarProps, {}, "element">;
3
3
  type Index = ReturnType<typeof Index>;
4
4
  export default Index;
@@ -17,7 +17,7 @@ export interface NavbarSeparatorProps extends BaseComponentProps {
17
17
  }
18
18
  export interface NavbarDropdownProps extends BaseComponentProps {
19
19
  label?: string;
20
- element?: Snippet;
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}>
@@ -1,4 +1,4 @@
1
1
  import type { SideNavbarProps } from "./types";
2
- declare const Index: import("svelte").Component<SideNavbarProps, {}, "">;
2
+ declare const Index: import("svelte").Component<SideNavbarProps, {}, "element">;
3
3
  type Index = ReturnType<typeof Index>;
4
4
  export default Index;
@@ -1,4 +1,4 @@
1
- import type { BaseComponentProps } from "$types/BaseComponent";
1
+ import type { BaseComponentProps } from "../../../types/BaseComponent";
2
2
  import type { Component } from "svelte";
3
3
  export interface SideNavbarProps extends BaseComponentProps {
4
4
  items?: SideNavbarItem[];
@@ -2,7 +2,7 @@
2
2
  import { defineMeta } from "@storybook/addon-svelte-csf";
3
3
  import Tooltip from "./index.svelte";
4
4
  import Button from "../../inputs/Button/index.svelte";
5
- import { Text } from "$components/typography";
5
+ import { Text } from "../../typography";
6
6
 
7
7
  const { Story } = defineMeta({
8
8
  title: "Components/Overlay/Tooltip",
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import type { TooltipPosition } from "$styles/posititon.js";
2
+ import type { TooltipPosition } from "../../../styles/posititon.js";
3
3
  import type { TooltipProps } from "./types.js";
4
4
  import { onMount, tick, type Snippet } from "svelte";
5
5
  import { fly } from "svelte/transition";
@@ -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}
@@ -1,4 +1,4 @@
1
1
  import type { TooltipProps } from "./types.js";
2
- declare const Index: import("svelte").Component<TooltipProps, {}, "">;
2
+ declare const Index: import("svelte").Component<TooltipProps, {}, "element">;
3
3
  type Index = ReturnType<typeof Index>;
4
4
  export default Index;
@@ -1,11 +1,12 @@
1
1
  <script lang="ts">
2
- import { sizeStyleParts, textStyle, type SizeStyleTheme } from "$styles/size";
2
+ import { sizeStyleParts, textStyle, type SizeStyleTheme } from "../../../styles/size";
3
3
  import type { TextProps } from "./types.js";
4
4
  import { twMerge } from "tailwind-merge";
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>
@@ -1,4 +1,4 @@
1
1
  import type { TextProps } from "./types.ts";
2
- declare const Index: import("svelte").Component<TextProps, {}, "">;
2
+ declare const Index: import("svelte").Component<TextProps, {}, "element">;
3
3
  type Index = ReturnType<typeof Index>;
4
4
  export default Index;
@@ -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;
@@ -1,8 +1,9 @@
1
- import type { SizeStyle } from "$styles/size";
1
+ import type { SizeStyle } from "../styles/size";
2
2
  import type { Component } from "svelte";
3
3
  export interface BaseComponentProps {
4
4
  children?: any;
5
5
  class?: string;
6
+ element?: HTMLElement;
6
7
  [key: string]: any;
7
8
  }
8
9
  export type InputVariant = "default" | "floating";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valerius_petrini/corekit-ui",
3
- "version": "0.1.69",
3
+ "version": "0.1.71",
4
4
  "description": "Component Library used across all my projects",
5
5
  "author": "Valerius Petrini Jr.",
6
6
  "license": "MIT",