@kayord/ui 0.8.10 → 0.8.12
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/custom/loader/Loader.svelte.d.ts +10 -1
- package/dist/components/ui/carousel/carousel.svelte +12 -3
- package/dist/components/ui/carousel/context.d.ts +4 -1
- package/dist/components/ui/carousel/context.js +1 -1
- package/dist/components/ui/input/input.svelte +1 -1
- package/package.json +11 -11
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
2
|
declare const __propDef: {
|
|
3
|
-
props:
|
|
3
|
+
props: Omit<{
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
name?: string | undefined;
|
|
6
|
+
color?: string | undefined;
|
|
7
|
+
size?: string | number | undefined;
|
|
8
|
+
strokeWidth?: string | number | undefined;
|
|
9
|
+
absoluteStrokeWidth?: boolean | undefined;
|
|
10
|
+
iconNode: import("lucide-svelte").IconNode;
|
|
11
|
+
mergeClasses?: (<ClassType = string>(...classes: ClassType[]) => string) | undefined;
|
|
12
|
+
}, "iconNode"> & {
|
|
4
13
|
isLoading?: boolean | undefined;
|
|
5
14
|
};
|
|
6
15
|
events: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script>import { writable } from "svelte/store";
|
|
2
2
|
import { onDestroy } from "svelte";
|
|
3
|
-
import {
|
|
3
|
+
import { setEmblaContext } from "./context.js";
|
|
4
4
|
import { cn } from "../../../utils.js";
|
|
5
5
|
export let opts = {};
|
|
6
6
|
export let plugins = [];
|
|
@@ -14,6 +14,8 @@ const canScrollPrev = writable(false);
|
|
|
14
14
|
const canScrollNext = writable(false);
|
|
15
15
|
const optionsStore = writable(opts);
|
|
16
16
|
const pluginStore = writable(plugins);
|
|
17
|
+
const scrollSnapsStore = writable([]);
|
|
18
|
+
const selectedIndexStore = writable(0);
|
|
17
19
|
$:
|
|
18
20
|
orientationStore.set(orientation);
|
|
19
21
|
$:
|
|
@@ -26,6 +28,9 @@ function scrollPrev() {
|
|
|
26
28
|
function scrollNext() {
|
|
27
29
|
api?.scrollNext();
|
|
28
30
|
}
|
|
31
|
+
function scrollTo(index, jump) {
|
|
32
|
+
api?.scrollTo(index, jump);
|
|
33
|
+
}
|
|
29
34
|
function onSelect(api2) {
|
|
30
35
|
if (!api2)
|
|
31
36
|
return;
|
|
@@ -47,7 +52,7 @@ function handleKeyDown(e) {
|
|
|
47
52
|
scrollNext();
|
|
48
53
|
}
|
|
49
54
|
}
|
|
50
|
-
|
|
55
|
+
setEmblaContext({
|
|
51
56
|
api: apiStore,
|
|
52
57
|
scrollPrev,
|
|
53
58
|
scrollNext,
|
|
@@ -57,11 +62,15 @@ setEmblaContex({
|
|
|
57
62
|
handleKeyDown,
|
|
58
63
|
options: optionsStore,
|
|
59
64
|
plugins: pluginStore,
|
|
60
|
-
onInit
|
|
65
|
+
onInit,
|
|
66
|
+
scrollSnaps: scrollSnapsStore,
|
|
67
|
+
selectedIndex: selectedIndexStore,
|
|
68
|
+
scrollTo
|
|
61
69
|
});
|
|
62
70
|
function onInit(event) {
|
|
63
71
|
api = event.detail;
|
|
64
72
|
apiStore.set(api);
|
|
73
|
+
scrollSnapsStore.set(api.scrollSnapList());
|
|
65
74
|
}
|
|
66
75
|
onDestroy(() => {
|
|
67
76
|
api?.off("select", onSelect);
|
|
@@ -24,7 +24,10 @@ type EmblaContext = {
|
|
|
24
24
|
options: Writable<CarouselOptions>;
|
|
25
25
|
plugins: Writable<CarouselPlugins>;
|
|
26
26
|
onInit: (e: CustomEvent<CarouselAPI>) => void;
|
|
27
|
+
scrollTo: (index: number, jump?: boolean) => void;
|
|
28
|
+
scrollSnaps: Readable<number[]>;
|
|
29
|
+
selectedIndex: Readable<number>;
|
|
27
30
|
};
|
|
28
|
-
export declare function
|
|
31
|
+
export declare function setEmblaContext(config: EmblaContext): EmblaContext;
|
|
29
32
|
export declare function getEmblaContext(name?: string): EmblaContext;
|
|
30
33
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getContext, hasContext, setContext } from "svelte";
|
|
2
2
|
const EMBLA_CAROUSEL_CONTEXT = Symbol("EMBLA_CAROUSEL_CONTEXT");
|
|
3
|
-
export function
|
|
3
|
+
export function setEmblaContext(config) {
|
|
4
4
|
setContext(EMBLA_CAROUSEL_CONTEXT, config);
|
|
5
5
|
return config;
|
|
6
6
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kayord/ui",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.8.
|
|
4
|
+
"version": "0.8.12",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -29,22 +29,22 @@
|
|
|
29
29
|
"svelte": "^4.0.0"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@internationalized/date": "^3.5.
|
|
33
|
-
"bits-ui": "^0.21.
|
|
32
|
+
"@internationalized/date": "^3.5.3",
|
|
33
|
+
"bits-ui": "^0.21.7",
|
|
34
34
|
"clsx": "^2.1.1",
|
|
35
35
|
"cmdk-sv": "^0.0.17",
|
|
36
|
-
"embla-carousel-svelte": "8.0.
|
|
36
|
+
"embla-carousel-svelte": "8.0.4",
|
|
37
37
|
"formsnap": "^1.0.0",
|
|
38
|
-
"lucide-svelte": "^0.
|
|
38
|
+
"lucide-svelte": "^0.378.0",
|
|
39
39
|
"mode-watcher": "^0.3.0",
|
|
40
40
|
"paneforge": "^0.0.4",
|
|
41
41
|
"svelte-headless-table": "^0.18.2",
|
|
42
|
-
"svelte-sonner": "^0.3.
|
|
43
|
-
"sveltekit-superforms": "^2.
|
|
42
|
+
"svelte-sonner": "^0.3.23",
|
|
43
|
+
"sveltekit-superforms": "^2.13.0",
|
|
44
44
|
"tailwind-merge": "^2.3.0",
|
|
45
45
|
"tailwind-variants": "^0.2.1",
|
|
46
46
|
"vaul-svelte": "^0.3.0",
|
|
47
|
-
"zod": "^3.23.
|
|
47
|
+
"zod": "^3.23.6"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@sveltejs/adapter-auto": "^3.2.0",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"@sveltejs/vite-plugin-svelte": "^3.1.0",
|
|
54
54
|
"@testing-library/jest-dom": "^6.4.2",
|
|
55
55
|
"@testing-library/svelte": "^5.1.0",
|
|
56
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
57
|
-
"@typescript-eslint/parser": "^7.
|
|
56
|
+
"@typescript-eslint/eslint-plugin": "^7.8.0",
|
|
57
|
+
"@typescript-eslint/parser": "^7.8.0",
|
|
58
58
|
"autoprefixer": "^10.4.19",
|
|
59
59
|
"eslint": "^9.1.1",
|
|
60
60
|
"eslint-config-prettier": "^9.1.0",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"tslib": "^2.6.2",
|
|
72
72
|
"typescript": "^5.4.5",
|
|
73
73
|
"vite": "^5.2.10",
|
|
74
|
-
"vitest": "^1.5.
|
|
74
|
+
"vitest": "^1.5.3"
|
|
75
75
|
},
|
|
76
76
|
"svelte": "./dist/index.js",
|
|
77
77
|
"types": "./dist/index.d.ts",
|