@valerius_petrini/corekit-ui 0.1.30 → 0.1.32

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,4 +1,5 @@
1
1
  <script lang="ts">
2
+ import type { NavbarProps } from "../types/Navbar.js";
2
3
  import { onMount } from "svelte";
3
4
  import { twMerge } from "tailwind-merge";
4
5
 
@@ -7,16 +8,18 @@
7
8
  class: className = "",
8
9
  classTop = "",
9
10
  ...restProps
10
- } = $props();
11
+ }: NavbarProps = $props();
11
12
 
12
13
  let defaultClass = "transition-colors duration-300 fixed top-0 left-0 w-full h-14 z-50 flex items-center";
13
14
 
14
- let combinedClass = $derived(twMerge(defaultClass, className));
15
+ let scrollY = $state(0);
16
+
17
+ let combinedClass = $derived(scrollY === 0
18
+ ? twMerge(defaultClass, className, classTop)
19
+ : twMerge(defaultClass, className));
15
20
 
16
21
  function onScroll() {
17
- combinedClass = window.scrollY === 0
18
- ? twMerge(defaultClass, className, classTop)
19
- : twMerge(defaultClass, className);
22
+ scrollY = window.scrollY;
20
23
  }
21
24
 
22
25
  onMount(() => {
@@ -1,7 +1,4 @@
1
- declare const Navbar: import("svelte").Component<{
2
- children?: any;
3
- class?: string;
4
- classTop?: string;
5
- } & Record<string, any>, {}, "">;
1
+ import type { NavbarProps } from "../types/Navbar.js";
2
+ declare const Navbar: import("svelte").Component<NavbarProps, {}, "">;
6
3
  type Navbar = ReturnType<typeof Navbar>;
7
4
  export default Navbar;
@@ -2,6 +2,7 @@
2
2
  import { twMerge } from "tailwind-merge";
3
3
  import Button from "./Button.svelte";
4
4
  import { onMount } from "svelte";
5
+ import type { NavbarElementProps } from "../types/Navbar.js";
5
6
 
6
7
  let {
7
8
  children = undefined,
@@ -9,16 +10,18 @@
9
10
  classTop = "",
10
11
  href = undefined,
11
12
  ...restProps
12
- } = $props();
13
+ }: NavbarElementProps = $props();
13
14
 
14
15
  let defaultClass = "navbar-element w-fit h-full flex items-center px-5 py-0";
15
16
 
16
- let combinedClass = $derived(twMerge(defaultClass, className));
17
+ let scrollY = $state(0);
18
+
19
+ let combinedClass = $derived(scrollY === 0
20
+ ? twMerge(defaultClass, className, classTop)
21
+ : twMerge(defaultClass, className));
17
22
 
18
23
  function onScroll() {
19
- combinedClass = window.scrollY === 0
20
- ? twMerge(defaultClass, className, classTop)
21
- : twMerge(defaultClass, className);
24
+ scrollY = window.scrollY;
22
25
  }
23
26
 
24
27
  onMount(() => {
@@ -1,8 +1,4 @@
1
- declare const NavbarElement: import("svelte").Component<{
2
- children?: any;
3
- class?: string;
4
- classTop?: string;
5
- href?: any;
6
- } & Record<string, any>, {}, "">;
1
+ import type { NavbarElementProps } from "../types/Navbar.js";
2
+ declare const NavbarElement: import("svelte").Component<NavbarElementProps, {}, "">;
7
3
  type NavbarElement = ReturnType<typeof NavbarElement>;
8
4
  export default NavbarElement;
@@ -1,12 +1,12 @@
1
- export default NavbarSeperator;
2
- type NavbarSeperator = SvelteComponent<{
1
+ export default NavbarSeparator;
2
+ type NavbarSeparator = SvelteComponent<{
3
3
  [x: string]: never;
4
4
  }, {
5
5
  [evt: string]: CustomEvent<any>;
6
6
  }, {}> & {
7
7
  $$bindings?: string | undefined;
8
8
  };
9
- declare const NavbarSeperator: $$__sveltets_2_IsomorphicComponent<{
9
+ declare const NavbarSeparator: $$__sveltets_2_IsomorphicComponent<{
10
10
  [x: string]: never;
11
11
  }, {
12
12
  [evt: string]: CustomEvent<any>;
package/dist/index.d.ts CHANGED
@@ -2,5 +2,8 @@ export { default as Button } from "./components/Button.svelte";
2
2
  export { default as Typewriter } from "./components/Typewriter.svelte";
3
3
  export { default as Analytics } from "./components/Analytics.svelte";
4
4
  export { default as SEO } from "./components/SEO.svelte";
5
+ export { default as Navbar } from "./components/Navbar.svelte";
6
+ export { default as NavbarSeparator } from "./components/NavbarSeparator.svelte";
7
+ export { default as NavbarElement } from "./components/NavbarElement.svelte";
5
8
  export { fbmBackground } from "./actions/fbm.ts";
6
9
  export type { TypewriterAction, DisplaySegment } from "./types/Typewriter.d.ts";
package/dist/index.js CHANGED
@@ -2,4 +2,7 @@ export { default as Button } from "./components/Button.svelte";
2
2
  export { default as Typewriter } from "./components/Typewriter.svelte";
3
3
  export { default as Analytics } from "./components/Analytics.svelte";
4
4
  export { default as SEO } from "./components/SEO.svelte";
5
+ export { default as Navbar } from "./components/Navbar.svelte";
6
+ export { default as NavbarSeparator } from "./components/NavbarSeparator.svelte";
7
+ export { default as NavbarElement } from "./components/NavbarElement.svelte";
5
8
  export { fbmBackground } from "./actions/fbm.js";
@@ -0,0 +1,14 @@
1
+ export interface NavbarProps {
2
+ children?: any;
3
+ class?: string;
4
+ classTop?: string;
5
+ [key: string]: any;
6
+ };
7
+
8
+ export interface NavbarElementProps {
9
+ children?: any;
10
+ class?: string;
11
+ classTop?: string;
12
+ href?: string;
13
+ [key: string]: any;
14
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valerius_petrini/corekit-ui",
3
- "version": "0.1.30",
3
+ "version": "0.1.32",
4
4
  "description": "Component Library used across all my projects",
5
5
  "author": "Valerius Petrini Jr.",
6
6
  "license": "MIT",