@kayord/ui 0.8.10 → 0.8.11

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,6 +1,15 @@
1
1
  import { SvelteComponent } from "svelte";
2
2
  declare const __propDef: {
3
- props: import("lucide-svelte").IconProps & {
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 { setEmblaContex } from "./context.js";
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
- setEmblaContex({
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 setEmblaContex(config: EmblaContext): EmblaContext;
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 setEmblaContex(config) {
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.10",
4
+ "version": "0.8.11",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./dist/index.d.ts",
@@ -30,12 +30,12 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@internationalized/date": "^3.5.2",
33
- "bits-ui": "^0.21.4",
33
+ "bits-ui": "^0.21.6",
34
34
  "clsx": "^2.1.1",
35
35
  "cmdk-sv": "^0.0.17",
36
36
  "embla-carousel-svelte": "8.0.2",
37
37
  "formsnap": "^1.0.0",
38
- "lucide-svelte": "^0.374.0",
38
+ "lucide-svelte": "^0.376.1",
39
39
  "mode-watcher": "^0.3.0",
40
40
  "paneforge": "^0.0.4",
41
41
  "svelte-headless-table": "^0.18.2",
@@ -44,7 +44,7 @@
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.4"
47
+ "zod": "^3.23.5"
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.7.1",
57
- "@typescript-eslint/parser": "^7.7.1",
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.2"
74
+ "vitest": "^1.5.3"
75
75
  },
76
76
  "svelte": "./dist/index.js",
77
77
  "types": "./dist/index.d.ts",