@kayord/ui 0.2.3 → 0.2.4

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.
@@ -7,7 +7,8 @@ export let tableViewModel;
7
7
  export let title = "";
8
8
  export let isLoading = false;
9
9
  export let hideHeader = false;
10
- const { headerRows, pageRows, tableAttrs, tableBodyAttrs, pluginStates, rows } = tableViewModel;
10
+ export let noDataMessage = "No Data";
11
+ const { headerRows, pageRows, tableAttrs, tableBodyAttrs, pluginStates, rows, flatColumns } = tableViewModel;
11
12
  const isSortEnabled = pluginStates.sort != void 0;
12
13
  const sortKeys = isSortEnabled ? pluginStates.sort.sortKeys : void 0;
13
14
  const isPagingEnabled = pluginStates.page != void 0;
@@ -69,7 +70,7 @@ const pageSize = isPagingEnabled ? pluginStates.page.pageSize : void 0;
69
70
  {#if isLoading}
70
71
  {#each { length: 5 } as _, i}
71
72
  <Table.Row>
72
- {#each $headerRows[0].cells as cell (cell.id)}
73
+ {#each flatColumns as cell}
73
74
  <Table.Cell>
74
75
  <Skeleton class="h-4" />
75
76
  </Table.Cell>
@@ -77,6 +78,13 @@ const pageSize = isPagingEnabled ? pluginStates.page.pageSize : void 0;
77
78
  </Table.Row>
78
79
  {/each}
79
80
  {:else}
81
+ {#if $rows.length == 0}
82
+ <Table.Row>
83
+ <Table.Cell colspan={flatColumns.length}>
84
+ <div>{noDataMessage}</div>
85
+ </Table.Cell>
86
+ </Table.Row>
87
+ {/if}
80
88
  {#each $pageRows as row (row.id)}
81
89
  <Subscribe rowAttrs={row.attrs()} let:rowAttrs>
82
90
  <Table.Row {...rowAttrs}>
@@ -7,6 +7,7 @@ declare class __sveltets_Render<T extends RowData> {
7
7
  title?: string | undefined;
8
8
  isLoading?: boolean | undefined;
9
9
  hideHeader?: boolean | undefined;
10
+ noDataMessage?: string | undefined;
10
11
  };
11
12
  events(): {} & {
12
13
  [evt: string]: CustomEvent<any>;
@@ -1,3 +1,5 @@
1
+ /// <reference types="svelte" />
2
+ import { Drawer as DrawerPrimitive } from "vaul-svelte";
1
3
  import Root from "./drawer.svelte";
2
4
  import Content from "./drawer-content.svelte";
3
5
  import Description from "./drawer-description.svelte";
@@ -5,7 +7,7 @@ import Overlay from "./drawer-overlay.svelte";
5
7
  import Footer from "./drawer-footer.svelte";
6
8
  import Header from "./drawer-header.svelte";
7
9
  import Title from "./drawer-title.svelte";
8
- declare const Trigger: typeof import("bits-ui/dist/bits/dialog").Trigger;
10
+ declare const Trigger: typeof DrawerPrimitive.Close;
9
11
  declare const Portal: typeof import("bits-ui/dist/bits/dialog").Portal;
10
- declare const Close: typeof import("bits-ui/dist/bits/dialog").Close;
12
+ declare const Close: typeof DrawerPrimitive.Close;
11
13
  export { Root, Content, Description, Overlay, Footer, Header, Title, Trigger, Portal, Close, Root as Drawer, Content as DrawerContent, Description as DrawerDescription, Overlay as DrawerOverlay, Footer as DrawerFooter, Header as DrawerHeader, Title as DrawerTitle, Trigger as DrawerTrigger, Portal as DrawerPortal, Close as DrawerClose };
@@ -7,6 +7,8 @@ export type InputEvents = {
7
7
  change: FormInputEvent<Event>;
8
8
  click: FormInputEvent<MouseEvent>;
9
9
  focus: FormInputEvent<FocusEvent>;
10
+ focusin: FormInputEvent<FocusEvent>;
11
+ focusout: FormInputEvent<FocusEvent>;
10
12
  keydown: FormInputEvent<KeyboardEvent>;
11
13
  keypress: FormInputEvent<KeyboardEvent>;
12
14
  keyup: FormInputEvent<KeyboardEvent>;
@@ -14,6 +14,8 @@ export { className as class };
14
14
  on:change
15
15
  on:click
16
16
  on:focus
17
+ on:focusin
18
+ on:focusout
17
19
  on:keydown
18
20
  on:keypress
19
21
  on:keyup
@@ -9,12 +9,14 @@ export { className as class };
9
9
  <PaginationPrimitive.NextButton asChild let:builder>
10
10
  <Button
11
11
  variant="ghost"
12
- class={cn("gap-1 pl-2.5", className)}
12
+ class={cn("gap-1 pr-2.5", className)}
13
13
  builders={[builder]}
14
14
  on:click
15
15
  {...$$restProps}
16
16
  >
17
- <span>Next</span>
18
- <ChevronRight class="h-4 w-4" />
17
+ <slot>
18
+ <span>Next</span>
19
+ <ChevronRight class="h-4 w-4" />
20
+ </slot>
19
21
  </Button>
20
22
  </PaginationPrimitive.NextButton>
@@ -2,7 +2,9 @@ import { SvelteComponent } from "svelte";
2
2
  import { Pagination as PaginationPrimitive } from "bits-ui";
3
3
  declare const __propDef: {
4
4
  props: PaginationPrimitive.NextButtonProps;
5
- slots: {};
5
+ slots: {
6
+ default: {};
7
+ };
6
8
  events: {
7
9
  click: import("bits-ui").CustomEventHandler<MouseEvent, HTMLDivElement>;
8
10
  };
@@ -14,7 +14,9 @@ export { className as class };
14
14
  on:click
15
15
  {...$$restProps}
16
16
  >
17
- <ChevronLeft class="h-4 w-4" />
18
- <span>Previous</span>
17
+ <slot>
18
+ <ChevronLeft class="h-4 w-4" />
19
+ <span>Previous</span>
20
+ </slot>
19
21
  </Button>
20
22
  </PaginationPrimitive.PrevButton>
@@ -2,7 +2,9 @@ import { SvelteComponent } from "svelte";
2
2
  import { Pagination as PaginationPrimitive } from "bits-ui";
3
3
  declare const __propDef: {
4
4
  props: PaginationPrimitive.PrevButtonProps;
5
- slots: {};
5
+ slots: {
6
+ default: {};
7
+ };
6
8
  events: {
7
9
  click: import("bits-ui").CustomEventHandler<MouseEvent, HTMLDivElement>;
8
10
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kayord/ui",
3
3
  "private": false,
4
- "version": "0.2.3",
4
+ "version": "0.2.4",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./dist/index.d.ts",
@@ -21,28 +21,28 @@
21
21
  "svelte": "^4.0.0"
22
22
  },
23
23
  "dependencies": {
24
- "bits-ui": "^0.13.2",
24
+ "bits-ui": "^0.13.6",
25
25
  "clsx": "^2.1.0",
26
26
  "cmdk-sv": "^0.0.12",
27
27
  "formsnap": "^0.4.2",
28
- "lucide-svelte": "^0.304.0",
28
+ "lucide-svelte": "^0.307.0",
29
29
  "mode-watcher": "^0.1.2",
30
30
  "svelte-headless-table": "^0.18.1",
31
- "svelte-sonner": "^0.3.10",
32
- "sveltekit-superforms": "^1.13.1",
31
+ "svelte-sonner": "^0.3.11",
32
+ "sveltekit-superforms": "^1.13.2",
33
33
  "tailwind-merge": "^2.2.0",
34
34
  "tailwind-variants": "^0.1.20",
35
- "vaul-svelte": "^0.0.4",
35
+ "vaul-svelte": "^0.0.6",
36
36
  "zod": "^3.22.4"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@playwright/test": "^1.40.1",
40
40
  "@sveltejs/adapter-auto": "^3.1.0",
41
- "@sveltejs/kit": "^2.0.6",
41
+ "@sveltejs/kit": "^2.1.0",
42
42
  "@sveltejs/package": "^2.2.5",
43
43
  "@sveltejs/vite-plugin-svelte": "^3.0.1",
44
- "@typescript-eslint/eslint-plugin": "^6.17.0",
45
- "@typescript-eslint/parser": "^6.17.0",
44
+ "@typescript-eslint/eslint-plugin": "^6.18.1",
45
+ "@typescript-eslint/parser": "^6.18.1",
46
46
  "autoprefixer": "^10.4.16",
47
47
  "eslint": "^8.56.0",
48
48
  "eslint-config-prettier": "^9.1.0",
@@ -54,7 +54,7 @@
54
54
  "publint": "^0.2.7",
55
55
  "svelte": "^4.2.8",
56
56
  "svelte-check": "^3.6.2",
57
- "tailwindcss": "^3.4.0",
57
+ "tailwindcss": "^3.4.1",
58
58
  "tslib": "^2.6.2",
59
59
  "typescript": "^5.3.3",
60
60
  "vite": "^5.0.11",