@kayord/ui 0.8.9 → 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
  }
@@ -8,4 +8,5 @@ import Content from "./dialog-content.svelte";
8
8
  import Description from "./dialog-description.svelte";
9
9
  declare const Root: typeof DialogPrimitive.Root;
10
10
  declare const Trigger: typeof DialogPrimitive.Trigger;
11
- export { Root, Title, Portal, Footer, Header, Trigger, Overlay, Content, Description, Root as Dialog, Title as DialogTitle, Portal as DialogPortal, Footer as DialogFooter, Header as DialogHeader, Trigger as DialogTrigger, Overlay as DialogOverlay, Content as DialogContent, Description as DialogDescription, };
11
+ declare const Close: typeof DialogPrimitive.Close;
12
+ export { Root, Title, Portal, Footer, Header, Trigger, Overlay, Content, Description, Close, Root as Dialog, Title as DialogTitle, Portal as DialogPortal, Footer as DialogFooter, Header as DialogHeader, Trigger as DialogTrigger, Overlay as DialogOverlay, Content as DialogContent, Description as DialogDescription, Close as DialogClose, };
@@ -8,6 +8,7 @@ import Content from "./dialog-content.svelte";
8
8
  import Description from "./dialog-description.svelte";
9
9
  const Root = DialogPrimitive.Root;
10
10
  const Trigger = DialogPrimitive.Trigger;
11
- export { Root, Title, Portal, Footer, Header, Trigger, Overlay, Content, Description,
11
+ const Close = DialogPrimitive.Close;
12
+ export { Root, Title, Portal, Footer, Header, Trigger, Overlay, Content, Description, Close,
12
13
  //
13
- Root as Dialog, Title as DialogTitle, Portal as DialogPortal, Footer as DialogFooter, Header as DialogHeader, Trigger as DialogTrigger, Overlay as DialogOverlay, Content as DialogContent, Description as DialogDescription, };
14
+ Root as Dialog, Title as DialogTitle, Portal as DialogPortal, Footer as DialogFooter, Header as DialogHeader, Trigger as DialogTrigger, Overlay as DialogOverlay, Content as DialogContent, Description as DialogDescription, Close as DialogClose, };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kayord/ui",
3
3
  "private": false,
4
- "version": "0.8.9",
4
+ "version": "0.8.11",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./dist/index.d.ts",
@@ -30,35 +30,35 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@internationalized/date": "^3.5.2",
33
- "bits-ui": "^0.21.4",
34
- "clsx": "^2.1.0",
33
+ "bits-ui": "^0.21.6",
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.372.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",
42
42
  "svelte-sonner": "^0.3.22",
43
- "sveltekit-superforms": "^2.12.5",
43
+ "sveltekit-superforms": "^2.12.6",
44
44
  "tailwind-merge": "^2.3.0",
45
45
  "tailwind-variants": "^0.2.1",
46
46
  "vaul-svelte": "^0.3.0",
47
- "zod": "^3.22.5"
47
+ "zod": "^3.23.5"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@sveltejs/adapter-auto": "^3.2.0",
51
- "@sveltejs/kit": "^2.5.6",
51
+ "@sveltejs/kit": "^2.5.7",
52
52
  "@sveltejs/package": "^2.3.1",
53
53
  "@sveltejs/vite-plugin-svelte": "^3.1.0",
54
54
  "@testing-library/jest-dom": "^6.4.2",
55
- "@testing-library/svelte": "^5.0.1",
56
- "@typescript-eslint/eslint-plugin": "^7.7.0",
57
- "@typescript-eslint/parser": "^7.7.0",
55
+ "@testing-library/svelte": "^5.1.0",
56
+ "@typescript-eslint/eslint-plugin": "^7.8.0",
57
+ "@typescript-eslint/parser": "^7.8.0",
58
58
  "autoprefixer": "^10.4.19",
59
- "eslint": "^9.0.0",
59
+ "eslint": "^9.1.1",
60
60
  "eslint-config-prettier": "^9.1.0",
61
- "eslint-plugin-svelte": "^2.37.0",
61
+ "eslint-plugin-svelte": "^2.38.0",
62
62
  "happy-dom": "^14.7.1",
63
63
  "postcss": "^8.4.38",
64
64
  "postcss-load-config": "^5.0.3",
@@ -66,12 +66,12 @@
66
66
  "prettier-plugin-svelte": "^3.2.3",
67
67
  "publint": "^0.2.7",
68
68
  "svelte": "^4.2.15",
69
- "svelte-check": "^3.6.9",
69
+ "svelte-check": "^3.7.0",
70
70
  "tailwindcss": "^3.4.3",
71
71
  "tslib": "^2.6.2",
72
72
  "typescript": "^5.4.5",
73
- "vite": "^5.2.9",
74
- "vitest": "^1.5.0"
73
+ "vite": "^5.2.10",
74
+ "vitest": "^1.5.3"
75
75
  },
76
76
  "svelte": "./dist/index.js",
77
77
  "types": "./dist/index.d.ts",