@kayord/ui 0.0.14 → 0.0.16
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/theme-switch/ThemeSwitch.svelte +4 -46
- package/dist/components/ui/dropdown-menu/dropdown-menu-item.svelte.d.ts +2 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-radio-group.svelte.d.ts +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte.d.ts +2 -2
- package/dist/components/ui/dropdown-menu/dropdown-menu-separator.svelte.d.ts +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte.d.ts +2 -2
- package/dist/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte.d.ts +1 -1
- package/dist/components/ui/toggle/toggle.svelte.d.ts +1 -1
- package/package.json +21 -15
- package/dist/components/ui/alert-dialog/alert-dialog-action.svelte.d.ts +0 -17
- package/dist/components/ui/alert-dialog/alert-dialog-cancel.svelte.d.ts +0 -17
- package/dist/components/ui/select/select-trigger.svelte.d.ts +0 -17
|
@@ -1,51 +1,9 @@
|
|
|
1
|
-
<script>import {
|
|
2
|
-
import {
|
|
3
|
-
let dark;
|
|
4
|
-
let hidden = true;
|
|
5
|
-
onMount(() => {
|
|
6
|
-
dark = document.documentElement.classList.contains("dark");
|
|
7
|
-
hidden = false;
|
|
8
|
-
const matcher = window.matchMedia("(prefers-color-scheme: dark)");
|
|
9
|
-
matcher.addEventListener("change", handleChange);
|
|
10
|
-
return () => matcher.removeEventListener("change", handleChange);
|
|
11
|
-
});
|
|
12
|
-
function handleChange({ matches: dark2 }) {
|
|
13
|
-
if (!localStorage.theme) {
|
|
14
|
-
setMode(dark2);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
function toggle() {
|
|
18
|
-
setMode(!dark);
|
|
19
|
-
}
|
|
20
|
-
function setMode(value) {
|
|
21
|
-
dark = value;
|
|
22
|
-
if (dark) {
|
|
23
|
-
document.documentElement.classList.add("dark");
|
|
24
|
-
} else {
|
|
25
|
-
document.documentElement.classList.remove("dark");
|
|
26
|
-
}
|
|
27
|
-
localStorage.theme = dark ? "dark" : "light";
|
|
28
|
-
if (window.matchMedia(`(prefers-color-scheme: ${localStorage.theme})`).matches) {
|
|
29
|
-
localStorage.removeItem("theme");
|
|
30
|
-
}
|
|
31
|
-
}
|
|
1
|
+
<script>import { toggleMode, mode } from "mode-watcher";
|
|
2
|
+
import { Moon, Sun } from "lucide-svelte";
|
|
32
3
|
</script>
|
|
33
4
|
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
if (
|
|
37
|
-
localStorage.theme === "dark" ||
|
|
38
|
-
(!localStorage.theme && window.matchMedia("(prefers-color-scheme: dark)").matches)
|
|
39
|
-
) {
|
|
40
|
-
document.documentElement.classList.add("dark");
|
|
41
|
-
} else {
|
|
42
|
-
document.documentElement.classList.remove("dark");
|
|
43
|
-
}
|
|
44
|
-
</script>
|
|
45
|
-
</svelte:head>
|
|
46
|
-
|
|
47
|
-
<button on:click={toggle} class="text-primary">
|
|
48
|
-
{#if dark}
|
|
5
|
+
<button on:click={toggleMode} class="text-primary">
|
|
6
|
+
{#if $mode == "dark"}
|
|
49
7
|
<Moon />
|
|
50
8
|
{:else}
|
|
51
9
|
<Sun />
|
|
@@ -3,6 +3,7 @@ import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui";
|
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
disabled?: boolean | undefined;
|
|
6
|
+
href?: string | null | undefined;
|
|
6
7
|
asChild?: boolean | undefined;
|
|
7
8
|
} & import("bits-ui/dist/internal").HTMLDivAttributes & {
|
|
8
9
|
inset?: boolean | undefined;
|
|
@@ -10,7 +11,7 @@ declare const __propDef: {
|
|
|
10
11
|
slots: {
|
|
11
12
|
default: {};
|
|
12
13
|
};
|
|
13
|
-
events: DropdownMenuPrimitive.
|
|
14
|
+
events: DropdownMenuPrimitive.DropdownMenuItemEvents;
|
|
14
15
|
};
|
|
15
16
|
export type DropdownMenuItemProps = typeof __propDef.props;
|
|
16
17
|
export type DropdownMenuItemEvents = typeof __propDef.events;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
2
|
import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui";
|
|
3
3
|
declare const __propDef: {
|
|
4
|
-
props: DropdownMenuPrimitive.
|
|
4
|
+
props: DropdownMenuPrimitive.DropdownMenuRadioGroupProps;
|
|
5
5
|
events: {
|
|
6
6
|
[evt: string]: CustomEvent<any>;
|
|
7
7
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
2
|
import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui";
|
|
3
3
|
declare const __propDef: {
|
|
4
|
-
props: DropdownMenuPrimitive.
|
|
4
|
+
props: DropdownMenuPrimitive.DropdownMenuRadioItemProps;
|
|
5
5
|
slots: {
|
|
6
6
|
default: {};
|
|
7
7
|
};
|
|
8
|
-
events: DropdownMenuPrimitive.
|
|
8
|
+
events: DropdownMenuPrimitive.DropdownMenuRadioItemEvents;
|
|
9
9
|
};
|
|
10
10
|
export type DropdownMenuRadioItemProps = typeof __propDef.props;
|
|
11
11
|
export type DropdownMenuRadioItemEvents = typeof __propDef.events;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
2
|
import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui";
|
|
3
3
|
declare const __propDef: {
|
|
4
|
-
props: DropdownMenuPrimitive.
|
|
4
|
+
props: DropdownMenuPrimitive.DropdownMenuSeparatorProps;
|
|
5
5
|
events: {
|
|
6
6
|
[evt: string]: CustomEvent<any>;
|
|
7
7
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
2
|
import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui";
|
|
3
3
|
declare const __propDef: {
|
|
4
|
-
props: DropdownMenuPrimitive.
|
|
4
|
+
props: DropdownMenuPrimitive.DropdownMenuSubContentProps;
|
|
5
5
|
slots: {
|
|
6
6
|
default: {};
|
|
7
7
|
};
|
|
8
|
-
events: DropdownMenuPrimitive.
|
|
8
|
+
events: DropdownMenuPrimitive.DropdownMenuSubContentEvents;
|
|
9
9
|
};
|
|
10
10
|
export type DropdownMenuSubContentProps = typeof __propDef.props;
|
|
11
11
|
export type DropdownMenuSubContentEvents = typeof __propDef.events;
|
|
@@ -10,7 +10,7 @@ declare const __propDef: {
|
|
|
10
10
|
slots: {
|
|
11
11
|
default: {};
|
|
12
12
|
};
|
|
13
|
-
events: DropdownMenuPrimitive.
|
|
13
|
+
events: DropdownMenuPrimitive.DropdownMenuSubTriggerEvents;
|
|
14
14
|
};
|
|
15
15
|
export type DropdownMenuSubTriggerProps = typeof __propDef.props;
|
|
16
16
|
export type DropdownMenuSubTriggerEvents = typeof __propDef.events;
|
|
@@ -5,7 +5,7 @@ declare const __propDef: {
|
|
|
5
5
|
props: {
|
|
6
6
|
disabled?: boolean | undefined;
|
|
7
7
|
pressed?: boolean | undefined;
|
|
8
|
-
onPressedChange?: import("bits-ui/dist/internal").OnChangeFn<boolean
|
|
8
|
+
onPressedChange?: import("bits-ui/dist/internal").OnChangeFn<boolean> | undefined;
|
|
9
9
|
asChild?: boolean | undefined;
|
|
10
10
|
} & import("svelte/elements").HTMLButtonAttributes & {
|
|
11
11
|
variant?: Variant;
|
package/package.json
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kayord/ui",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.16",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
8
|
"svelte": "./dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"./utils/*": {
|
|
11
|
+
"types": "./dist/utils/*.d.ts",
|
|
12
|
+
"svelte": "./dist/utils/*.js"
|
|
9
13
|
}
|
|
10
14
|
},
|
|
11
15
|
"files": [
|
|
@@ -17,41 +21,43 @@
|
|
|
17
21
|
"svelte": "^4.0.0"
|
|
18
22
|
},
|
|
19
23
|
"dependencies": {
|
|
20
|
-
"bits-ui": "^0.
|
|
24
|
+
"bits-ui": "^0.9.0",
|
|
21
25
|
"clsx": "^2.0.0",
|
|
22
|
-
"formsnap": "^0.1
|
|
23
|
-
"lucide-svelte": "^0.
|
|
26
|
+
"formsnap": "^0.2.1",
|
|
27
|
+
"lucide-svelte": "^0.290.0",
|
|
24
28
|
"sveltekit-superforms": "^1.8.0",
|
|
25
|
-
"tailwind-merge": "^
|
|
26
|
-
"tailwind-variants": "^0.1.
|
|
29
|
+
"tailwind-merge": "^2.0.0",
|
|
30
|
+
"tailwind-variants": "^0.1.18",
|
|
27
31
|
"zod": "^3.22.4"
|
|
28
32
|
},
|
|
29
33
|
"devDependencies": {
|
|
30
|
-
"@playwright/test": "^1.
|
|
34
|
+
"@playwright/test": "^1.39.0",
|
|
31
35
|
"@sveltejs/adapter-auto": "^2.1.0",
|
|
32
|
-
"@sveltejs/kit": "^1.
|
|
36
|
+
"@sveltejs/kit": "^1.27.2",
|
|
33
37
|
"@sveltejs/package": "^2.2.2",
|
|
34
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
35
|
-
"@typescript-eslint/parser": "^6.
|
|
38
|
+
"@typescript-eslint/eslint-plugin": "^6.9.1",
|
|
39
|
+
"@typescript-eslint/parser": "^6.9.1",
|
|
36
40
|
"autoprefixer": "^10.4.16",
|
|
37
|
-
"eslint": "^8.
|
|
41
|
+
"eslint": "^8.52.0",
|
|
38
42
|
"eslint-config-prettier": "^9.0.0",
|
|
39
43
|
"eslint-plugin-svelte": "^2.34.0",
|
|
44
|
+
"mode-watcher": "^0.0.5",
|
|
40
45
|
"postcss": "^8.4.31",
|
|
41
46
|
"postcss-load-config": "^4.0.1",
|
|
42
47
|
"prettier": "^3.0.3",
|
|
43
48
|
"prettier-plugin-svelte": "^3.0.3",
|
|
44
|
-
"publint": "^0.2.
|
|
45
|
-
"svelte": "^4.2.
|
|
49
|
+
"publint": "^0.2.5",
|
|
50
|
+
"svelte": "^4.2.2",
|
|
46
51
|
"svelte-check": "^3.5.2",
|
|
47
|
-
"tailwindcss": "^3.3.
|
|
52
|
+
"tailwindcss": "^3.3.5",
|
|
48
53
|
"tslib": "^2.6.2",
|
|
49
54
|
"typescript": "^5.2.2",
|
|
50
|
-
"vite": "^4.
|
|
55
|
+
"vite": "^4.5.0",
|
|
51
56
|
"vitest": "^0.34.6"
|
|
52
57
|
},
|
|
53
58
|
"svelte": "./dist/index.js",
|
|
54
59
|
"types": "./dist/index.d.ts",
|
|
60
|
+
"main": "./dist/index.js",
|
|
55
61
|
"type": "module",
|
|
56
62
|
"scripts": {
|
|
57
63
|
"dev": "vite dev",
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
|
-
import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
|
|
3
|
-
declare const __propDef: {
|
|
4
|
-
props: AlertDialogPrimitive.TriggerProps;
|
|
5
|
-
slots: {
|
|
6
|
-
default: {
|
|
7
|
-
builder: any;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
events: AlertDialogPrimitive.ActionEvents;
|
|
11
|
-
};
|
|
12
|
-
export type AlertDialogActionProps = typeof __propDef.props;
|
|
13
|
-
export type AlertDialogActionEvents = typeof __propDef.events;
|
|
14
|
-
export type AlertDialogActionSlots = typeof __propDef.slots;
|
|
15
|
-
export default class AlertDialogAction extends SvelteComponent<AlertDialogActionProps, AlertDialogActionEvents, AlertDialogActionSlots> {
|
|
16
|
-
}
|
|
17
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
|
-
import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
|
|
3
|
-
declare const __propDef: {
|
|
4
|
-
props: AlertDialogPrimitive.TriggerProps;
|
|
5
|
-
slots: {
|
|
6
|
-
default: {
|
|
7
|
-
builder: any;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
events: AlertDialogPrimitive.CancelEvents;
|
|
11
|
-
};
|
|
12
|
-
export type AlertDialogCancelProps = typeof __propDef.props;
|
|
13
|
-
export type AlertDialogCancelEvents = typeof __propDef.events;
|
|
14
|
-
export type AlertDialogCancelSlots = typeof __propDef.slots;
|
|
15
|
-
export default class AlertDialogCancel extends SvelteComponent<AlertDialogCancelProps, AlertDialogCancelEvents, AlertDialogCancelSlots> {
|
|
16
|
-
}
|
|
17
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
|
-
import { Select as SelectPrimitive } from "bits-ui";
|
|
3
|
-
declare const __propDef: {
|
|
4
|
-
props: SelectPrimitive.TriggerProps;
|
|
5
|
-
slots: {
|
|
6
|
-
default: {
|
|
7
|
-
builder: any;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
events: SelectPrimitive.TriggerEvents;
|
|
11
|
-
};
|
|
12
|
-
export type SelectTriggerProps = typeof __propDef.props;
|
|
13
|
-
export type SelectTriggerEvents = typeof __propDef.events;
|
|
14
|
-
export type SelectTriggerSlots = typeof __propDef.slots;
|
|
15
|
-
export default class SelectTrigger extends SvelteComponent<SelectTriggerProps, SelectTriggerEvents, SelectTriggerSlots> {
|
|
16
|
-
}
|
|
17
|
-
export {};
|