@valerius_petrini/corekit-ui 0.1.64 → 0.1.66
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/Combobox.svelte +1 -1
- package/dist/components/Skeleton.svelte +63 -0
- package/dist/components/Skeleton.svelte.d.ts +4 -0
- package/dist/components/Table.svelte +1 -1
- package/dist/components/Tooltip.svelte +4 -5
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/types/Skeleton.d.ts +6 -0
- package/dist/types/Skeleton.js +1 -0
- package/package.json +2 -1
|
@@ -183,7 +183,7 @@
|
|
|
183
183
|
|
|
184
184
|
{#snippet outerDivElementAfter()}
|
|
185
185
|
{#if isFocused}
|
|
186
|
-
<div transition:fly={{ y: -10, duration: 200 }} class="absolute top-full left-0 right-0 mt-2 border-2 overflow-hidden border-blue-500 bg-sub-background {getSizeStyleClass(radius, "radius")}">
|
|
186
|
+
<div transition:fly={{ y: -10, duration: 200 }} class="absolute z-100 top-full left-0 right-0 mt-2 border-2 overflow-hidden border-blue-500 bg-sub-background {getSizeStyleClass(radius, "radius")}">
|
|
187
187
|
{#if totalMatches > limit}
|
|
188
188
|
<Text class="text-xs py-0.5 px-1 text-sub-text italic sticky top-0 bg-sub-background w-full">
|
|
189
189
|
Showing {limit} of {totalMatches} results for "{value}"
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { getSizeStyleClass } from "../styles/size.js";
|
|
3
|
+
import type { SkeletonProps } from "../types/Skeleton.js";
|
|
4
|
+
import Image from "@lucide/svelte/icons/image";
|
|
5
|
+
import Play from "@lucide/svelte/icons/play";
|
|
6
|
+
import { twMerge } from "tailwind-merge";
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
variant = "text",
|
|
10
|
+
class: className = "",
|
|
11
|
+
count = 19,
|
|
12
|
+
size = "md"
|
|
13
|
+
}: SkeletonProps = $props();
|
|
14
|
+
|
|
15
|
+
const defaultWidths = [21, 19, 24, 15, 10, 30, 22, 17, 26, 20, 28, 10, 22, 45, 16, 23, 37, 25, 25];
|
|
16
|
+
const widths = $derived(Array.from({ length: count }, (_, i) => defaultWidths[i % defaultWidths.length]));
|
|
17
|
+
|
|
18
|
+
const defaultContainerClass = "animate-pulse duration-100 w-lg flex flex-col gap-2";
|
|
19
|
+
const combinedContainerClass = $derived(twMerge(
|
|
20
|
+
defaultContainerClass,
|
|
21
|
+
getSizeStyleClass(size, "card"),
|
|
22
|
+
className
|
|
23
|
+
));
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
{#snippet image()}
|
|
27
|
+
<div class="h-48 bg-sub-background rounded w-full flex-center">
|
|
28
|
+
<Image size={48} class="text-form-border"/>
|
|
29
|
+
</div>
|
|
30
|
+
{/snippet}
|
|
31
|
+
|
|
32
|
+
{#snippet text()}
|
|
33
|
+
<div class="pt-4 flex flex-wrap gap-2">
|
|
34
|
+
{#each widths as width}
|
|
35
|
+
<div class="h-4 rounded even:bg-sub-background odd:bg-sub-background-hover"
|
|
36
|
+
style="width: {width}%;"></div>
|
|
37
|
+
{/each}
|
|
38
|
+
</div>
|
|
39
|
+
{/snippet}
|
|
40
|
+
|
|
41
|
+
<div class={combinedContainerClass}>
|
|
42
|
+
{#if variant === "default"}
|
|
43
|
+
<div class="h-4 bg-sub-background rounded w-3/4"></div>
|
|
44
|
+
<div class="h-4 bg-sub-background rounded w-full"></div>
|
|
45
|
+
<div class="h-4 bg-sub-background rounded w-5/6"></div>
|
|
46
|
+
<div class="h-4 bg-sub-background rounded w-2/3"></div>
|
|
47
|
+
<div class="h-4 bg-sub-background rounded w-5/6"></div>
|
|
48
|
+
<div class="h-4 bg-sub-background rounded w-11/12"></div>
|
|
49
|
+
{:else if variant === "text"}
|
|
50
|
+
{@render text()}
|
|
51
|
+
{:else if variant === "image"}
|
|
52
|
+
{@render image()}
|
|
53
|
+
{:else if variant === "video"}
|
|
54
|
+
<div class="h-48 bg-sub-background rounded w-full flex-center">
|
|
55
|
+
<Play size={48} class="text-form-border"/>
|
|
56
|
+
</div>
|
|
57
|
+
{:else if variant === "card"}
|
|
58
|
+
<div class="w-full h-full border-sub-background border-2 rounded p-4 gap-2">
|
|
59
|
+
{@render image()}
|
|
60
|
+
{@render text()}
|
|
61
|
+
</div>
|
|
62
|
+
{/if}
|
|
63
|
+
</div>
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
const defaultTableClass = "w-full border-collapse text-main-text border border-form-border border-l-0";
|
|
16
16
|
const defaultTableHeaderClass = "text-left border-b border-b-1 border-b-form-border bg-sub-background font-medium";
|
|
17
17
|
const defaultTableCellClass = "p-2 text-sm border-l border-l-[1px] border-l-form-border";
|
|
18
|
-
const defaultTableBodyClass = "even:bg-sub-background odd:bg-
|
|
18
|
+
const defaultTableBodyClass = "even:bg-sub-background odd:bg-sub-background-hover";
|
|
19
19
|
|
|
20
20
|
const combinedTableClass = $derived(twMerge(
|
|
21
21
|
defaultTableClass,
|
|
@@ -109,15 +109,14 @@
|
|
|
109
109
|
bind:this={tooltip}
|
|
110
110
|
style="transform: translateX(calc(-50% + {offsetX}px));"
|
|
111
111
|
class="absolute z-999999 {positionClasses[resolvedPosition || position]} translate-x-0! pointer-events-none">
|
|
112
|
+
|
|
113
|
+
<div class="absolute {arrowClasses[resolvedPosition || position]} border-4 border-transparent w-0 h-0"
|
|
114
|
+
style="transform: translateX(calc(-50% + {arrowX}px));"></div>
|
|
115
|
+
|
|
112
116
|
<div
|
|
113
117
|
transition:fly={flyParams}
|
|
114
118
|
class="px-2 py-1 text-xs text-main-text bg-form-background rounded whitespace-nowrap">
|
|
115
119
|
{text}
|
|
116
|
-
|
|
117
|
-
<div
|
|
118
|
-
class="absolute {arrowClasses[resolvedPosition || position]} border-4 border-transparent w-0 h-0"
|
|
119
|
-
style="transform: translateX(calc(-50% + {arrowX}px));"
|
|
120
|
-
></div>
|
|
121
120
|
</div>
|
|
122
121
|
</div>
|
|
123
122
|
{/if}
|
package/dist/index.d.ts
CHANGED
|
@@ -20,6 +20,8 @@ export { default as Toaster } from "./components/Toaster.svelte";
|
|
|
20
20
|
export { default as SideNavbar } from "./components/SideNavbar.svelte";
|
|
21
21
|
export { default as Tooltip } from "./components/Tooltip.svelte";
|
|
22
22
|
export { default as Loader } from "./components/Loader.svelte";
|
|
23
|
+
export { default as Skeleton } from "./components/Skeleton.svelte";
|
|
24
|
+
export { default as Combobox } from "./components/Combobox.svelte";
|
|
23
25
|
export { fbmBackground } from "./actions/fbm.ts";
|
|
24
26
|
export { toast } from "./actions/toast.svelte.ts";
|
|
25
27
|
export type { TypewriterAction, DisplaySegment } from "./types/Typewriter.ts";
|
package/dist/index.js
CHANGED
|
@@ -20,5 +20,7 @@ export { default as Toaster } from "./components/Toaster.svelte";
|
|
|
20
20
|
export { default as SideNavbar } from "./components/SideNavbar.svelte";
|
|
21
21
|
export { default as Tooltip } from "./components/Tooltip.svelte";
|
|
22
22
|
export { default as Loader } from "./components/Loader.svelte";
|
|
23
|
+
export { default as Skeleton } from "./components/Skeleton.svelte";
|
|
24
|
+
export { default as Combobox } from "./components/Combobox.svelte";
|
|
23
25
|
export { fbmBackground } from "./actions/fbm.js";
|
|
24
26
|
export { toast } from "./actions/toast.svelte.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@valerius_petrini/corekit-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.66",
|
|
4
4
|
"description": "Component Library used across all my projects",
|
|
5
5
|
"author": "Valerius Petrini Jr.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
],
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@lucide/svelte": "^1.3.0",
|
|
59
|
+
"@valerius_petrini/corekit-scripts": "^1.0.0",
|
|
59
60
|
"bytes": "^3.1.2",
|
|
60
61
|
"tailwind-merge": "^3.5.0"
|
|
61
62
|
}
|