@kayord/ui 0.0.15 → 0.0.17

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/README.md CHANGED
@@ -9,6 +9,7 @@ Pnpm command to install ui library.
9
9
  ```bash
10
10
  # create a new project in the current directory
11
11
  pnpm add -D @kayord/ui
12
+ pnpm add -D @kayord/tw-plugin
12
13
  ```
13
14
 
14
15
  ### Manual Setup New Project
@@ -16,7 +17,6 @@ pnpm add -D @kayord/ui
16
17
  ```bash
17
18
  # Setup new sveltekit project
18
19
  npm create svelte@latest my-app
19
-
20
20
  npx svelte-add@latest tailwindcss
21
21
  pnpm i
22
22
  ```
@@ -35,63 +35,17 @@ module.exports = {
35
35
  ```
36
36
 
37
37
  ```ts
38
+ // tailwind.config.ts
39
+
38
40
  import type { Config } from "tailwindcss";
39
41
  import { fontFamily } from "tailwindcss/defaultTheme";
40
- import { kayordPlugin } from "@kayord/ui";
41
- // import forms from '@tailwindcss/forms';
42
+ import { kayordPlugin } from '@kayord/tw-plugin';
42
43
 
43
44
  export default {
44
45
  darkMode: ["class"],
45
46
  content: ["./src/**/*.{html,js,svelte,ts}", "./node_modules/@kayord/ui/**/*.{html,js,svelte,ts}"],
46
47
  theme: {
47
- container: {
48
- center: true,
49
- padding: "2rem",
50
- screens: {
51
- "2xl": "1400px",
52
- },
53
- },
54
48
  extend: {
55
- colors: {
56
- border: "hsl(var(--border))",
57
- input: "hsl(var(--input))",
58
- ring: "hsl(var(--ring))",
59
- background: "hsl(var(--background))",
60
- foreground: "hsl(var(--foreground))",
61
- primary: {
62
- DEFAULT: "hsl(var(--primary))",
63
- foreground: "hsl(var(--primary-foreground))",
64
- },
65
- secondary: {
66
- DEFAULT: "hsl(var(--secondary))",
67
- foreground: "hsl(var(--secondary-foreground))",
68
- },
69
- destructive: {
70
- DEFAULT: "hsl(var(--destructive))",
71
- foreground: "hsl(var(--destructive-foreground))",
72
- },
73
- muted: {
74
- DEFAULT: "hsl(var(--muted))",
75
- foreground: "hsl(var(--muted-foreground))",
76
- },
77
- accent: {
78
- DEFAULT: "hsl(var(--accent))",
79
- foreground: "hsl(var(--accent-foreground))",
80
- },
81
- popover: {
82
- DEFAULT: "hsl(var(--popover))",
83
- foreground: "hsl(var(--popover-foreground))",
84
- },
85
- card: {
86
- DEFAULT: "hsl(var(--card))",
87
- foreground: "hsl(var(--card-foreground))",
88
- },
89
- },
90
- borderRadius: {
91
- lg: "var(--radius)",
92
- md: "calc(var(--radius) - 2px)",
93
- sm: "calc(var(--radius) - 4px)",
94
- },
95
49
  fontFamily: {
96
50
  sans: [...fontFamily.sans],
97
51
  },
@@ -1,51 +1,9 @@
1
- <script>import { Moon, Sun } from "lucide-svelte";
2
- import { onMount } from "svelte";
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
- <svelte:head>
35
- <script>
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.ItemEvents;
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.RadioGroupProps;
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.RadioItemProps;
4
+ props: DropdownMenuPrimitive.DropdownMenuRadioItemProps;
5
5
  slots: {
6
6
  default: {};
7
7
  };
8
- events: DropdownMenuPrimitive.RadioItemEvents;
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.SeparatorProps;
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.SubContentProps;
4
+ props: DropdownMenuPrimitive.DropdownMenuSubContentProps;
5
5
  slots: {
6
6
  default: {};
7
7
  };
8
- events: DropdownMenuPrimitive.SubContentEvents;
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.SubTriggerEvents;
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 | undefined> | undefined;
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,7 +1,7 @@
1
1
  {
2
2
  "name": "@kayord/ui",
3
3
  "private": false,
4
- "version": "0.0.15",
4
+ "version": "0.0.17",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./dist/index.d.ts",
@@ -21,37 +21,38 @@
21
21
  "svelte": "^4.0.0"
22
22
  },
23
23
  "dependencies": {
24
- "bits-ui": "^0.5.7",
24
+ "bits-ui": "^0.9.0",
25
25
  "clsx": "^2.0.0",
26
- "formsnap": "^0.1.4",
27
- "lucide-svelte": "^0.284.0",
26
+ "formsnap": "^0.2.1",
27
+ "lucide-svelte": "^0.290.0",
28
+ "mode-watcher": "^0.0.5",
28
29
  "sveltekit-superforms": "^1.8.0",
29
- "tailwind-merge": "^1.14.0",
30
- "tailwind-variants": "^0.1.14",
30
+ "tailwind-merge": "^2.0.0",
31
+ "tailwind-variants": "^0.1.18",
31
32
  "zod": "^3.22.4"
32
33
  },
33
34
  "devDependencies": {
34
- "@playwright/test": "^1.38.1",
35
+ "@playwright/test": "^1.39.0",
35
36
  "@sveltejs/adapter-auto": "^2.1.0",
36
- "@sveltejs/kit": "^1.25.1",
37
+ "@sveltejs/kit": "^1.27.2",
37
38
  "@sveltejs/package": "^2.2.2",
38
- "@typescript-eslint/eslint-plugin": "^6.7.4",
39
- "@typescript-eslint/parser": "^6.7.4",
39
+ "@typescript-eslint/eslint-plugin": "^6.9.1",
40
+ "@typescript-eslint/parser": "^6.9.1",
40
41
  "autoprefixer": "^10.4.16",
41
- "eslint": "^8.51.0",
42
+ "eslint": "^8.52.0",
42
43
  "eslint-config-prettier": "^9.0.0",
43
44
  "eslint-plugin-svelte": "^2.34.0",
44
45
  "postcss": "^8.4.31",
45
46
  "postcss-load-config": "^4.0.1",
46
47
  "prettier": "^3.0.3",
47
48
  "prettier-plugin-svelte": "^3.0.3",
48
- "publint": "^0.2.3",
49
- "svelte": "^4.2.1",
49
+ "publint": "^0.2.5",
50
+ "svelte": "^4.2.2",
50
51
  "svelte-check": "^3.5.2",
51
- "tailwindcss": "^3.3.3",
52
+ "tailwindcss": "^3.3.5",
52
53
  "tslib": "^2.6.2",
53
54
  "typescript": "^5.2.2",
54
- "vite": "^4.4.11",
55
+ "vite": "^4.5.0",
55
56
  "vitest": "^0.34.6"
56
57
  },
57
58
  "svelte": "./dist/index.js",
@@ -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 {};