@valerius_petrini/corekit-ui 0.1.22 → 0.1.24

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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Valerius Petrini
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Valerius Petrini
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,65 +1,65 @@
1
- # Svelte library
2
-
3
- Everything you need to build a Svelte library, powered by [`sv`](https://npmjs.com/package/sv).
4
-
5
- Read more about creating a library [in the docs](https://svelte.dev/docs/kit/packaging).
6
-
7
- ## Creating a project
8
-
9
- If you're seeing this, you've probably already done this step. Congrats!
10
-
11
- ```sh
12
- # create a new project in the current directory
13
- npx sv create
14
-
15
- # create a new project in my-app
16
- npx sv create my-app
17
- ```
18
-
19
- To recreate this project with the same configuration:
20
-
21
- ```sh
22
- # recreate this project
23
- npx sv@0.12.5 create --template library --types ts --add tailwindcss="plugins:typography,forms" --install npm ./
24
- ```
25
-
26
- ## Developing
27
-
28
- Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
29
-
30
- ```sh
31
- npm run dev
32
-
33
- # or start the server and open the app in a new browser tab
34
- npm run dev -- --open
35
- ```
36
-
37
- Everything inside `src/lib` is part of your library, everything inside `src/routes` can be used as a showcase or preview app.
38
-
39
- ## Building
40
-
41
- To build your library:
42
-
43
- ```sh
44
- npm pack
45
- ```
46
-
47
- To create a production version of your showcase app:
48
-
49
- ```sh
50
- npm run build
51
- ```
52
-
53
- You can preview the production build with `npm run preview`.
54
-
55
- > To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
56
-
57
- ## Publishing
58
-
59
- Go into the `package.json` and give your package the desired name through the `"name"` option. Also consider adding a `"license"` field and point it to a `LICENSE` file which you can create from a template (one popular option is the [MIT license](https://opensource.org/license/mit/)).
60
-
61
- To publish your library to [npm](https://www.npmjs.com):
62
-
63
- ```sh
64
- npm publish
65
- ```
1
+ # Svelte library
2
+
3
+ Everything you need to build a Svelte library, powered by [`sv`](https://npmjs.com/package/sv).
4
+
5
+ Read more about creating a library [in the docs](https://svelte.dev/docs/kit/packaging).
6
+
7
+ ## Creating a project
8
+
9
+ If you're seeing this, you've probably already done this step. Congrats!
10
+
11
+ ```sh
12
+ # create a new project in the current directory
13
+ npx sv create
14
+
15
+ # create a new project in my-app
16
+ npx sv create my-app
17
+ ```
18
+
19
+ To recreate this project with the same configuration:
20
+
21
+ ```sh
22
+ # recreate this project
23
+ npx sv@0.12.5 create --template library --types ts --add tailwindcss="plugins:typography,forms" --install npm ./
24
+ ```
25
+
26
+ ## Developing
27
+
28
+ Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
29
+
30
+ ```sh
31
+ npm run dev
32
+
33
+ # or start the server and open the app in a new browser tab
34
+ npm run dev -- --open
35
+ ```
36
+
37
+ Everything inside `src/lib` is part of your library, everything inside `src/routes` can be used as a showcase or preview app.
38
+
39
+ ## Building
40
+
41
+ To build your library:
42
+
43
+ ```sh
44
+ npm pack
45
+ ```
46
+
47
+ To create a production version of your showcase app:
48
+
49
+ ```sh
50
+ npm run build
51
+ ```
52
+
53
+ You can preview the production build with `npm run preview`.
54
+
55
+ > To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
56
+
57
+ ## Publishing
58
+
59
+ Go into the `package.json` and give your package the desired name through the `"name"` option. Also consider adding a `"license"` field and point it to a `LICENSE` file which you can create from a template (one popular option is the [MIT license](https://opensource.org/license/mit/)).
60
+
61
+ To publish your library to [npm](https://www.npmjs.com):
62
+
63
+ ```sh
64
+ npm publish
65
+ ```
@@ -1,72 +1,72 @@
1
- const FBM_VERTEX_SHADER_SOURCE = `
2
- attribute vec4 aVertexPosition;
3
-
4
- void main() {
5
- gl_Position = aVertexPosition;
1
+ const FBM_VERTEX_SHADER_SOURCE = `
2
+ attribute vec4 aVertexPosition;
3
+
4
+ void main() {
5
+ gl_Position = aVertexPosition;
6
6
  }`;
7
- const FBM_FRAGMENT_SHADER_SOURCE = `
8
- precision mediump float;
9
-
10
- uniform vec2 u_resolution;
11
- uniform float u_seed;
12
- uniform float u_scale;
13
- uniform int u_octaves;
14
- uniform int u_warp;
15
-
16
- const int maxOctaves = 20;
17
- const int maxWarps = 5;
18
-
19
- float rand(vec2 n) {
20
- return fract(sin(dot(n.xy + u_seed, vec2(12.9898, 78.233))) * 43758.5453);
21
- }
22
-
23
- float noise(vec2 p){
24
- vec2 i = floor(p);
25
- vec2 f = fract(p);
26
-
27
- // Four corners in 2D of a tile
28
- float a = rand(i);
29
- float b = rand(i + vec2(1.0, 0.0));
30
- float c = rand(i + vec2(0.0, 1.0));
31
- float d = rand(i + vec2(1.0, 1.0));
32
-
33
- vec2 u = f * f * f * (f * (f * 6.0 - 15.0) + 10.0);
34
-
35
- return mix(a, b, u.x) +
36
- (c - a)* u.y * (1.0 - u.x) +
37
- (d - b) * u.x * u.y;
38
- }
39
-
40
- float fbm( in vec2 x, in float H ) {
41
- float v = 00.0000;
42
- float a = 0.5;
43
- vec2 shift = vec2(100);
44
- // Rotate to reduce axial bias
45
- mat2 rot = mat2(0.877, 0.479, -0.479, 0.877);
46
- for (int i = 0; i < maxOctaves; ++i) {
47
- v += a * noise(x);
48
- x = rot * x * 2.0 + shift;
49
- a *= 0.5;
50
- if (i > u_octaves) break;
51
- }
52
- return v;
53
- }
54
-
55
- void main() {
56
- vec2 uv = gl_FragCoord.xy / u_resolution.xy;
57
- uv.x *= u_resolution.x / u_resolution.y;
58
-
59
- float baseNoise = fbm(uv * u_scale, 1.2);
60
-
61
- vec2 warp = uv;
62
- for (int i = 0; i < maxWarps; ++i) {
63
- warp += vec2(fbm(warp * 2.0, 1.0), fbm(warp * 4.0 + vec2(10.2), 1.0));
64
- if (i > u_warp) break;
65
- }
66
-
67
- baseNoise = fbm(warp * u_scale, 1.2);
68
-
69
- gl_FragColor = vec4(vec3(baseNoise), 1.0);
7
+ const FBM_FRAGMENT_SHADER_SOURCE = `
8
+ precision mediump float;
9
+
10
+ uniform vec2 u_resolution;
11
+ uniform float u_seed;
12
+ uniform float u_scale;
13
+ uniform int u_octaves;
14
+ uniform int u_warp;
15
+
16
+ const int maxOctaves = 20;
17
+ const int maxWarps = 5;
18
+
19
+ float rand(vec2 n) {
20
+ return fract(sin(dot(n.xy + u_seed, vec2(12.9898, 78.233))) * 43758.5453);
21
+ }
22
+
23
+ float noise(vec2 p){
24
+ vec2 i = floor(p);
25
+ vec2 f = fract(p);
26
+
27
+ // Four corners in 2D of a tile
28
+ float a = rand(i);
29
+ float b = rand(i + vec2(1.0, 0.0));
30
+ float c = rand(i + vec2(0.0, 1.0));
31
+ float d = rand(i + vec2(1.0, 1.0));
32
+
33
+ vec2 u = f * f * f * (f * (f * 6.0 - 15.0) + 10.0);
34
+
35
+ return mix(a, b, u.x) +
36
+ (c - a)* u.y * (1.0 - u.x) +
37
+ (d - b) * u.x * u.y;
38
+ }
39
+
40
+ float fbm( in vec2 x, in float H ) {
41
+ float v = 00.0000;
42
+ float a = 0.5;
43
+ vec2 shift = vec2(100);
44
+ // Rotate to reduce axial bias
45
+ mat2 rot = mat2(0.877, 0.479, -0.479, 0.877);
46
+ for (int i = 0; i < maxOctaves; ++i) {
47
+ v += a * noise(x);
48
+ x = rot * x * 2.0 + shift;
49
+ a *= 0.5;
50
+ if (i > u_octaves) break;
51
+ }
52
+ return v;
53
+ }
54
+
55
+ void main() {
56
+ vec2 uv = gl_FragCoord.xy / u_resolution.xy;
57
+ uv.x *= u_resolution.x / u_resolution.y;
58
+
59
+ float baseNoise = fbm(uv * u_scale, 1.2);
60
+
61
+ vec2 warp = uv;
62
+ for (int i = 0; i < maxWarps; ++i) {
63
+ warp += vec2(fbm(warp * 2.0, 1.0), fbm(warp * 4.0 + vec2(10.2), 1.0));
64
+ if (i > u_warp) break;
65
+ }
66
+
67
+ baseNoise = fbm(warp * u_scale, 1.2);
68
+
69
+ gl_FragColor = vec4(vec3(baseNoise), 1.0);
70
70
  }`;
71
71
  function loadShaders(gl, type, source) {
72
72
  const shader = gl.createShader(type);
@@ -1,27 +1,27 @@
1
- <script lang="ts">
2
- import { page } from '$app/stores'
3
-
4
- let { measurementId } = $props();
5
-
6
- const ANALYTICS_URL = $derived(`https://www.googletagmanager.com/gtag/js?id=${measurementId}`);
7
-
8
- $effect(() => {
9
- if (typeof gtag !== 'undefined') {
10
- gtag('config', measurementId, {
11
- page_title: document.title,
12
- page_path: $page.url.pathname,
13
- })
14
- }
15
- })
16
- </script>
17
-
18
- <svelte:head>
19
- {#if measurementId}
20
- <script async src={ANALYTICS_URL}></script>
21
- <script>
22
- window.dataLayer = window.dataLayer || [];
23
- function gtag() { dataLayer.push(arguments); }
24
- gtag('js', new Date());
25
- </script>
26
- {/if}
1
+ <script lang="ts">
2
+ import { page } from '$app/state'
3
+
4
+ let { measurementId } = $props();
5
+
6
+ const ANALYTICS_URL = $derived(`https://www.googletagmanager.com/gtag/js?id=${measurementId}`);
7
+
8
+ $effect(() => {
9
+ if (typeof gtag !== 'undefined') {
10
+ gtag('config', measurementId, {
11
+ page_title: document.title,
12
+ page_path: page.url.pathname,
13
+ })
14
+ }
15
+ })
16
+ </script>
17
+
18
+ <svelte:head>
19
+ {#if measurementId}
20
+ <script async src={ANALYTICS_URL}></script>
21
+ <script>
22
+ window.dataLayer = window.dataLayer || [];
23
+ function gtag() { dataLayer.push(arguments); }
24
+ gtag('js', new Date());
25
+ </script>
26
+ {/if}
27
27
  </svelte:head>
@@ -1,28 +1,30 @@
1
- <script lang="ts">
2
- import { twMerge } from "tailwind-merge";
3
-
4
- let {
5
- children,
6
- class: className,
7
- pill = false,
8
- icon = false,
9
- href = undefined,
10
- ...restProps
11
- } = $props();
12
-
13
- let pillClass = "rounded-full";
14
- let iconClass = "rounded-full p-2";
15
- let defaultClass = $derived(twMerge("text-white cursor-pointer px-2 py-1 ", (pill ? pillClass : ""), (icon ? iconClass : "")));
16
-
17
- let combinedClass = $derived(twMerge(defaultClass, className));
18
- </script>
19
-
20
- {#if href}
21
- <a class={combinedClass} {href} {...restProps}>
22
- {@render children?.()}
23
- </a>
24
- {:else}
25
- <button class={combinedClass} {...restProps}>
26
- {@render children?.()}
27
- </button>
1
+ <script lang="ts">
2
+ import { twMerge } from "tailwind-merge";
3
+
4
+ let {
5
+ children = undefined,
6
+ class: className = "",
7
+ pill = false,
8
+ icon = false,
9
+ href = undefined,
10
+ ...restProps
11
+ } = $props();
12
+
13
+ let pillClass = "rounded-full";
14
+ let iconClass = "rounded-full p-2 flex-center";
15
+ let defaultClass = $derived(twMerge(
16
+ "text-white cursor-pointer px-2 py-1 transition-colors ",
17
+ (pill ? pillClass : ""), (icon ? iconClass : "")));
18
+
19
+ let combinedClass = $derived(twMerge(defaultClass, className));
20
+ </script>
21
+
22
+ {#if href}
23
+ <a class={combinedClass} {href} {...restProps}>
24
+ {@render children?.()}
25
+ </a>
26
+ {:else}
27
+ <button class={combinedClass} {...restProps}>
28
+ {@render children?.()}
29
+ </button>
28
30
  {/if}
@@ -1,6 +1,6 @@
1
1
  declare const Button: import("svelte").Component<{
2
- children: any;
3
- class: any;
2
+ children?: any;
3
+ class?: string;
4
4
  pill?: boolean;
5
5
  icon?: boolean;
6
6
  href?: any;
@@ -0,0 +1,17 @@
1
+ <script lang="ts">
2
+ import { twMerge } from "tailwind-merge";
3
+
4
+ let {
5
+ children = undefined,
6
+ class: className = "",
7
+ ...restProps
8
+ } = $props();
9
+
10
+ let defaultClass = "bg-transparent transition-colors duration-300 backdrop-blur-[3px] fixed top-0 left-0 w-full z-50 flex items-center";
11
+
12
+ let combinedClass = $derived(twMerge(defaultClass, className));
13
+ </script>
14
+
15
+ <nav class={combinedClass} {...restProps}>
16
+ {@render children?.()}
17
+ </nav>
@@ -0,0 +1,6 @@
1
+ declare const Navbar: import("svelte").Component<{
2
+ children?: any;
3
+ class?: string;
4
+ } & Record<string, any>, {}, "">;
5
+ type Navbar = ReturnType<typeof Navbar>;
6
+ export default Navbar;
@@ -0,0 +1 @@
1
+ <div class="ml-auto"></div>
@@ -0,0 +1,26 @@
1
+ export default NavbarSeperator;
2
+ type NavbarSeperator = SvelteComponent<{
3
+ [x: string]: never;
4
+ }, {
5
+ [evt: string]: CustomEvent<any>;
6
+ }, {}> & {
7
+ $$bindings?: string | undefined;
8
+ };
9
+ declare const NavbarSeperator: $$__sveltets_2_IsomorphicComponent<{
10
+ [x: string]: never;
11
+ }, {
12
+ [evt: string]: CustomEvent<any>;
13
+ }, {}, {}, string>;
14
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
15
+ new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
16
+ $$bindings?: Bindings;
17
+ } & Exports;
18
+ (internal: unknown, props: {
19
+ $$events?: Events;
20
+ $$slots?: Slots;
21
+ }): Exports & {
22
+ $set?: any;
23
+ $on?: any;
24
+ };
25
+ z_$$bindings?: Bindings;
26
+ }
@@ -1,44 +1,44 @@
1
- <script lang="ts">
2
- import { page } from '$app/state';
3
-
4
- const DEFAULT_TITLE = "My SvelteKit App";
5
- const DEFAULT_DESCRIPTION = "Description of your website.";
6
- const DEFAULT_IMAGE = "/favicon.png";
7
-
8
- interface SEOProps {
9
- websiteName: string;
10
- title?: string;
11
- description?: string;
12
- image?: any;
13
- }
14
-
15
- let { websiteName, title = DEFAULT_TITLE, description = DEFAULT_DESCRIPTION, image = DEFAULT_IMAGE }: SEOProps = $props();
16
-
17
- let fullUrl = $derived(`${websiteName}${page.url.pathname.toString()}`);
18
- </script>
19
-
20
- <svelte:head>
21
- <title>{title}</title>
22
- <meta name="description" content={description}>
23
- <meta property="og_site_name" content={websiteName}>
24
- <meta property="og:url" content={fullUrl}>
25
- <meta property="og:type" content="website">
26
- <meta property="og:title" content="{title}">
27
- <meta property="og:description" content={description}>
28
- <meta property="og:image" content={image}>
29
-
30
- <meta name="twitter:card" content="summary_large_image">
31
- <meta property="twitter:domain" content={websiteName}>
32
- <meta property="twitter:url" content={fullUrl}>
33
- <meta name="twitter:title" content="{title}">
34
- <meta name="twitter:description" content={description}>
35
- <meta name="twitter:image" content={image}>
36
- {@html ` <script type="application/ld+json">{
37
- "@context": "https://schema.org",
38
- "@type": "Website",
39
- "name": "${title}",
40
- "url": "${fullUrl}",
41
- "logo": "${image}" }</script>`}
42
-
43
- <meta name="google-site-verification" content="F6vDzwDyZfebc9kWIZlhzpsAm5zhanaPkOArdCZdDSU" />
1
+ <script lang="ts">
2
+ import { page } from '$app/state';
3
+
4
+ const DEFAULT_TITLE = "My SvelteKit App";
5
+ const DEFAULT_DESCRIPTION = "Description of your website.";
6
+ const DEFAULT_IMAGE = "/favicon.png";
7
+
8
+ interface SEOProps {
9
+ websiteName: string;
10
+ title?: string;
11
+ description?: string;
12
+ image?: any;
13
+ }
14
+
15
+ let { websiteName, title = DEFAULT_TITLE, description = DEFAULT_DESCRIPTION, image = DEFAULT_IMAGE }: SEOProps = $props();
16
+
17
+ let fullUrl = $derived(`${websiteName}${page.url.pathname.toString()}`);
18
+ </script>
19
+
20
+ <svelte:head>
21
+ <title>{title}</title>
22
+ <meta name="description" content={description}>
23
+ <meta property="og_site_name" content={websiteName}>
24
+ <meta property="og:url" content={fullUrl}>
25
+ <meta property="og:type" content="website">
26
+ <meta property="og:title" content="{title}">
27
+ <meta property="og:description" content={description}>
28
+ <meta property="og:image" content={image}>
29
+
30
+ <meta name="twitter:card" content="summary_large_image">
31
+ <meta property="twitter:domain" content={websiteName}>
32
+ <meta property="twitter:url" content={fullUrl}>
33
+ <meta name="twitter:title" content="{title}">
34
+ <meta name="twitter:description" content={description}>
35
+ <meta name="twitter:image" content={image}>
36
+ {@html ` <script type="application/ld+json">{
37
+ "@context": "https://schema.org",
38
+ "@type": "Website",
39
+ "name": "${title}",
40
+ "url": "${fullUrl}",
41
+ "logo": "${image}" }</script>`}
42
+
43
+ <meta name="google-site-verification" content="F6vDzwDyZfebc9kWIZlhzpsAm5zhanaPkOArdCZdDSU" />
44
44
  </svelte:head>
@@ -0,0 +1,76 @@
1
+ <script lang="ts">
2
+ import { twMerge } from "tailwind-merge";
3
+ import { onMount } from "svelte";
4
+
5
+ import type { DisplaySegment, TypewriterAction } from "../types.js";
6
+
7
+ let { actions = [] as TypewriterAction[], class: className = "" } = $props();
8
+
9
+ let displaySegments = $state<DisplaySegment[]>([]);
10
+
11
+ async function execute() {
12
+ for (let i = 0; i < actions.length; i++) {
13
+ const action = actions[i];
14
+ switch (action.type) {
15
+ case "write":
16
+ const segment = { text: "", color: typeof action.color === "function" ? action.color() : action.color, label: action.label };
17
+ displaySegments.push(segment);
18
+
19
+ const segmentProxy = displaySegments[displaySegments.length - 1];
20
+
21
+ const resolvedValue = typeof action.value === "function" ? action.value() : action.value;
22
+ for (const char of resolvedValue) {
23
+ segmentProxy.text += char;
24
+ const speed = Math.random() * ((action.maxspeed || 100) - (action.minspeed || 50)) + (action.minspeed || 50);
25
+ await new Promise(resolve => setTimeout(resolve, speed));
26
+ }
27
+ break;
28
+ case "delete":
29
+ const index = displaySegments.findIndex(s => s.label === action.to);
30
+ if (index === -1) break;
31
+ const deleteSegment = displaySegments[index];
32
+ while (deleteSegment.text.length > 0) {
33
+ deleteSegment.text = deleteSegment.text.slice(0, -1);
34
+ const speed = Math.random() * ((action.maxspeed || 100) - (action.minspeed || 50)) + (action.minspeed || 50);
35
+ await new Promise(resolve => setTimeout(resolve, speed));
36
+ }
37
+ displaySegments.splice(index, 1);
38
+ break;
39
+ case "pause":
40
+ await new Promise(resolve => setTimeout(resolve, action.duration || 1000));
41
+ break;
42
+ case "jump":
43
+ const position = actions.findIndex(a => a.label === action.position);
44
+ if (position !== -1)
45
+ i = position - 1;
46
+ break;
47
+ }
48
+ }
49
+ }
50
+
51
+ onMount(() => {
52
+ execute();
53
+ });
54
+
55
+ let combinedClass = $derived(twMerge("typewriter w-fit", className));
56
+ </script>
57
+
58
+ <div class={combinedClass}>
59
+ {#each displaySegments as segment}
60
+ {#key segment}
61
+ <span style="color: {segment.color}">{segment.text}</span>
62
+ {/key}
63
+ {/each}
64
+ </div>
65
+
66
+ <style>
67
+ .typewriter::after {
68
+ content: "\00a0";
69
+ animation: blink .7s step-start infinite;
70
+ text-decoration: underline;
71
+ }
72
+
73
+ @keyframes blink {
74
+ 50% { opacity: 0; }
75
+ }
76
+ </style>
@@ -0,0 +1,7 @@
1
+ import type { TypewriterAction } from "../types.js";
2
+ declare const Typewriter: import("svelte").Component<{
3
+ actions?: TypewriterAction[];
4
+ class?: string;
5
+ }, {}, "">;
6
+ type Typewriter = ReturnType<typeof Typewriter>;
7
+ export default Typewriter;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,6 @@
1
1
  import Button from "./components/Button.svelte";
2
+ import Typewriter from "./components/Typewriter.svelte";
3
+ import Analytics from "./components/Analytics.svelte";
4
+ import SEO from "./components/SEO.svelte";
2
5
  import { fbmBackground } from "./actions/fbm.ts";
3
- export { Button, fbmBackground };
6
+ export { Button, Typewriter, Analytics, SEO, fbmBackground };
package/dist/index.js CHANGED
@@ -1,4 +1,7 @@
1
1
  // Reexport your entry components here
2
2
  import Button from "./components/Button.svelte";
3
+ import Typewriter from "./components/Typewriter.svelte";
4
+ import Analytics from "./components/Analytics.svelte";
5
+ import SEO from "./components/SEO.svelte";
3
6
  import { fbmBackground } from "./actions/fbm.js";
4
- export { Button, fbmBackground };
7
+ export { Button, Typewriter, Analytics, SEO, fbmBackground };
@@ -0,0 +1,11 @@
1
+ export type TypewriterAction =
2
+ | { type: "write", value: string | (() => string), color?: string | (() => string), minspeed?: number, maxspeed?: number, label?: string }
3
+ | { type: "delete", to: string, minspeed?: number, maxspeed?: number, label?: string }
4
+ | { type: "pause", duration: number, label?: string }
5
+ | { type: "jump", position: string, label?: string };
6
+
7
+ export interface DisplaySegment {
8
+ text: string;
9
+ color?: string;
10
+ label?: string;
11
+ };
package/package.json CHANGED
@@ -1,58 +1,58 @@
1
- {
2
- "name": "@valerius_petrini/corekit-ui",
3
- "version": "0.1.22",
4
- "description": "Component Library used across all my projects",
5
- "author": "Valerius Petrini Jr.",
6
- "license": "MIT",
7
- "scripts": {
8
- "dev": "vite dev",
9
- "build": "vite build && npm run prepack",
10
- "preview": "vite preview",
11
- "prepare": "svelte-kit sync || echo ''",
12
- "prepack": "svelte-kit sync && svelte-package && publint",
13
- "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
14
- "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
15
- },
16
- "files": [
17
- "dist",
18
- "!dist/**/*.test.*",
19
- "!dist/**/*.spec.*"
20
- ],
21
- "sideEffects": [
22
- "**/*.css"
23
- ],
24
- "svelte": "./dist/index.js",
25
- "types": "./dist/index.d.ts",
26
- "type": "module",
27
- "exports": {
28
- ".": {
29
- "types": "./dist/index.d.ts",
30
- "svelte": "./dist/index.js"
31
- }
32
- },
33
- "peerDependencies": {
34
- "svelte": "^5.0.0"
35
- },
36
- "devDependencies": {
37
- "@sveltejs/adapter-auto": "^7.0.0",
38
- "@sveltejs/kit": "^2.50.2",
39
- "@sveltejs/package": "^2.5.7",
40
- "@sveltejs/vite-plugin-svelte": "^6.2.4",
41
- "@tailwindcss/forms": "^0.5.11",
42
- "@tailwindcss/typography": "^0.5.19",
43
- "@tailwindcss/vite": "^4.1.18",
44
- "publint": "^0.3.17",
45
- "svelte": "^5.51.0",
46
- "svelte-check": "^4.4.2",
47
- "tailwindcss": "^4.1.18",
48
- "typescript": "^5.9.3",
49
- "vite": "^7.3.1"
50
- },
51
- "keywords": [
52
- "components",
53
- "svelte"
54
- ],
55
- "dependencies": {
56
- "tailwind-merge": "^3.5.0"
57
- }
58
- }
1
+ {
2
+ "name": "@valerius_petrini/corekit-ui",
3
+ "version": "0.1.24",
4
+ "description": "Component Library used across all my projects",
5
+ "author": "Valerius Petrini Jr.",
6
+ "license": "MIT",
7
+ "scripts": {
8
+ "dev": "vite dev",
9
+ "build": "vite build && npm run prepack",
10
+ "preview": "vite preview",
11
+ "prepare": "svelte-kit sync || echo ''",
12
+ "prepack": "svelte-kit sync && svelte-package && publint",
13
+ "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
14
+ "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
15
+ },
16
+ "files": [
17
+ "dist",
18
+ "!dist/**/*.test.*",
19
+ "!dist/**/*.spec.*"
20
+ ],
21
+ "sideEffects": [
22
+ "**/*.css"
23
+ ],
24
+ "svelte": "./dist/index.js",
25
+ "types": "./dist/index.d.ts",
26
+ "type": "module",
27
+ "exports": {
28
+ ".": {
29
+ "types": "./dist/index.d.ts",
30
+ "svelte": "./dist/index.js"
31
+ }
32
+ },
33
+ "peerDependencies": {
34
+ "svelte": "^5.0.0"
35
+ },
36
+ "devDependencies": {
37
+ "@sveltejs/adapter-auto": "^7.0.0",
38
+ "@sveltejs/kit": "^2.50.2",
39
+ "@sveltejs/package": "^2.5.7",
40
+ "@sveltejs/vite-plugin-svelte": "^6.2.4",
41
+ "@tailwindcss/forms": "^0.5.11",
42
+ "@tailwindcss/typography": "^0.5.19",
43
+ "@tailwindcss/vite": "^4.1.18",
44
+ "publint": "^0.3.17",
45
+ "svelte": "^5.51.0",
46
+ "svelte-check": "^4.4.2",
47
+ "tailwindcss": "^4.1.18",
48
+ "typescript": "^5.9.3",
49
+ "vite": "^7.3.1"
50
+ },
51
+ "keywords": [
52
+ "components",
53
+ "svelte"
54
+ ],
55
+ "dependencies": {
56
+ "tailwind-merge": "^3.5.0"
57
+ }
58
+ }