abckit 0.0.2 → 0.0.5

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.
Files changed (78) hide show
  1. package/dist/module.d.mts +50 -6
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +10 -4
  4. package/dist/runtime/components/app/AppImage.vue +1 -1
  5. package/dist/runtime/components/app/AppNavMain.vue +3 -1
  6. package/dist/runtime/components/ui/auto-form/AutoFormFieldBoolean.d.vue.ts +0 -14
  7. package/dist/runtime/components/ui/auto-form/AutoFormFieldBoolean.vue.d.ts +0 -14
  8. package/dist/runtime/components/ui/auto-form/AutoFormFieldDate.d.vue.ts +0 -14
  9. package/dist/runtime/components/ui/auto-form/AutoFormFieldDate.vue.d.ts +0 -14
  10. package/dist/runtime/components/ui/auto-form/AutoFormFieldEnum.d.vue.ts +0 -17
  11. package/dist/runtime/components/ui/auto-form/AutoFormFieldEnum.vue.d.ts +0 -17
  12. package/dist/runtime/components/ui/auto-form/AutoFormFieldFile.d.vue.ts +0 -14
  13. package/dist/runtime/components/ui/auto-form/AutoFormFieldFile.vue.d.ts +0 -14
  14. package/dist/runtime/components/ui/auto-form/AutoFormFieldInput.d.vue.ts +0 -17
  15. package/dist/runtime/components/ui/auto-form/AutoFormFieldInput.vue.d.ts +0 -17
  16. package/dist/runtime/components/ui/auto-form/AutoFormFieldNumber.d.vue.ts +0 -14
  17. package/dist/runtime/components/ui/auto-form/AutoFormFieldNumber.vue.d.ts +0 -14
  18. package/dist/runtime/components/ui/badge/index.d.ts +1 -1
  19. package/dist/runtime/components/ui/button/ThemeToggle.vue +2 -2
  20. package/dist/runtime/components/ui/button/index.d.ts +2 -2
  21. package/dist/runtime/components/ui/calendar/Calendar.vue +1 -0
  22. package/dist/runtime/components/ui/chart/ChartContainer.vue +1 -1
  23. package/dist/runtime/components/ui/chart/ChartLegendContent.vue +3 -3
  24. package/dist/runtime/components/ui/chart/ChartTooltipContent.vue +1 -0
  25. package/dist/runtime/components/ui/chart/index.d.ts +0 -1
  26. package/dist/runtime/components/ui/chart/index.js +0 -1
  27. package/dist/runtime/components/ui/chart/utils.js +1 -0
  28. package/dist/runtime/components/ui/combobox/Combobox.d.vue.ts +2 -2
  29. package/dist/runtime/components/ui/combobox/Combobox.vue.d.ts +2 -2
  30. package/dist/runtime/components/ui/command/CommandDialog.d.vue.ts +4 -1
  31. package/dist/runtime/components/ui/command/CommandDialog.vue.d.ts +4 -1
  32. package/dist/runtime/components/ui/drawer/Drawer.d.vue.ts +4 -4
  33. package/dist/runtime/components/ui/drawer/Drawer.vue.d.ts +4 -4
  34. package/dist/runtime/components/ui/file/FileGrid.vue +2 -0
  35. package/dist/runtime/components/ui/file/FileTable.vue +8 -4
  36. package/dist/runtime/components/ui/input-otp/InputOTP.d.vue.ts +8 -8
  37. package/dist/runtime/components/ui/input-otp/InputOTP.vue.d.ts +8 -8
  38. package/dist/runtime/components/ui/input-otp/InputOTPSlot.vue +1 -0
  39. package/dist/runtime/components/ui/item/index.d.ts +1 -1
  40. package/dist/runtime/components/ui/native-select/NativeSelect.d.vue.ts +7 -1
  41. package/dist/runtime/components/ui/native-select/NativeSelect.vue +9 -2
  42. package/dist/runtime/components/ui/native-select/NativeSelect.vue.d.ts +7 -1
  43. package/dist/runtime/components/ui/native-select/NativeSelectOptGroup.d.vue.ts +389 -1
  44. package/dist/runtime/components/ui/native-select/NativeSelectOptGroup.vue +6 -3
  45. package/dist/runtime/components/ui/native-select/NativeSelectOptGroup.vue.d.ts +389 -1
  46. package/dist/runtime/components/ui/native-select/NativeSelectOption.d.vue.ts +393 -1
  47. package/dist/runtime/components/ui/native-select/NativeSelectOption.vue +6 -3
  48. package/dist/runtime/components/ui/native-select/NativeSelectOption.vue.d.ts +393 -1
  49. package/dist/runtime/components/ui/navigation-menu/NavigationMenuLink.vue +1 -1
  50. package/dist/runtime/components/ui/select/Select.d.vue.ts +2 -2
  51. package/dist/runtime/components/ui/select/Select.vue.d.ts +2 -2
  52. package/dist/runtime/components/ui/sidebar/index.d.ts +1 -1
  53. package/dist/runtime/components/ui/sonner/Sonner.d.vue.ts +4 -0
  54. package/dist/runtime/components/ui/sonner/Sonner.vue +62 -0
  55. package/dist/runtime/components/ui/sonner/Sonner.vue.d.ts +4 -0
  56. package/dist/runtime/components/ui/sonner/index.d.ts +1 -0
  57. package/dist/runtime/components/ui/sonner/index.js +1 -0
  58. package/dist/runtime/components/ui/storage/StorageActionBar.d.vue.ts +2 -2
  59. package/dist/runtime/components/ui/storage/StorageActionBar.vue +1 -1
  60. package/dist/runtime/components/ui/storage/StorageActionBar.vue.d.ts +2 -2
  61. package/dist/runtime/components/ui/storage/StorageGrid.vue +2 -0
  62. package/dist/runtime/components/ui/storage/StorageTable.vue +8 -4
  63. package/dist/runtime/components/ui/tags-input/TagsInput.vue +8 -1
  64. package/dist/runtime/components/ui/timezone-select/useTimezone.d.ts +2 -2
  65. package/dist/runtime/components/ui/timezone-select/useTimezone.js +3 -3
  66. package/dist/runtime/components/ui/toggle/index.d.ts +1 -1
  67. package/dist/runtime/composables/useAuth.d.ts +15 -3
  68. package/dist/runtime/composables/useAuth.js +19 -1
  69. package/dist/runtime/composables/useBreadcrumbItems.js +1 -1
  70. package/dist/runtime/composables/useImageUrl.js +1 -0
  71. package/dist/runtime/error.vue +12 -4
  72. package/dist/runtime/graphql/organization.d.ts +5 -0
  73. package/dist/runtime/graphql/organization.js +11 -0
  74. package/dist/runtime/shared/constants/r2.d.ts +12 -0
  75. package/dist/runtime/shared/constants/r2.js +18 -0
  76. package/dist/runtime/types/nitro-graphql-client.d.ts +7 -1
  77. package/dist/types.d.mts +1 -7
  78. package/package.json +9 -3
@@ -3,8 +3,8 @@ interface TimezoneOption {
3
3
  label: string;
4
4
  offset: string;
5
5
  region: string;
6
- country?: string;
7
- popular?: boolean;
6
+ country: string | undefined;
7
+ popular: boolean;
8
8
  searchText: string;
9
9
  }
10
10
  interface TimezoneGroup {
@@ -140,13 +140,13 @@ export function useTimezone(labels = {}) {
140
140
  }).sort((a, b) => {
141
141
  if (a.popular && !b.popular) return -1;
142
142
  if (!a.popular && b.popular) return 1;
143
- if (a.region !== b.region) return a.region.localeCompare(b.region);
143
+ if (a.region !== b.region) return (a.region || "").localeCompare(b.region || "");
144
144
  return a.label.localeCompare(b.label);
145
145
  });
146
146
  } catch {
147
147
  return [
148
- { value: "UTC", label: "UTC", offset: "UTC+00:00", region: "UTC", popular: true, searchText: "utc" },
149
- { value: "Europe/Istanbul", label: "Istanbul", offset: "UTC+03:00", region: "Europe", country: "T\xFCrkiye", popular: true, searchText: "europe/istanbul istanbul t\xFCrkiye utc+03:00 avrupa" }
148
+ { value: "UTC", label: "UTC", offset: "UTC+00:00", region: "UTC", country: void 0, popular: true, searchText: "utc" },
149
+ { value: "Europe/Istanbul", label: "Istanbul", offset: "UTC+03:00", region: "Europe", country: "Turkey", popular: true, searchText: "europe/istanbul istanbul turkey utc+03:00 europe" }
150
150
  ];
151
151
  }
152
152
  };
@@ -2,6 +2,6 @@ import type { VariantProps } from "class-variance-authority";
2
2
  export { default as Toggle } from "./Toggle.vue.js";
3
3
  export declare const toggleVariants: (props?: ({
4
4
  variant?: "default" | "outline" | null | undefined;
5
- size?: "lg" | "default" | "sm" | null | undefined;
5
+ size?: "default" | "sm" | "lg" | null | undefined;
6
6
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
7
  export type ToggleVariants = VariantProps<typeof toggleVariants>;
@@ -1214,9 +1214,21 @@ export declare function useAuth(): {
1214
1214
  readonly isRefetching: boolean;
1215
1215
  readonly error: import("better-auth/vue").BetterFetchError | null;
1216
1216
  }>>;
1217
- isLoading: any;
1218
- isAuthenticated: any;
1219
- user: any;
1217
+ isLoading: import("vue").ComputedRef<boolean>;
1218
+ isAuthenticated: import("vue").ComputedRef<boolean>;
1219
+ user: import("vue").ComputedRef<{
1220
+ readonly id: string;
1221
+ readonly createdAt: Date;
1222
+ readonly updatedAt: Date;
1223
+ readonly email: string;
1224
+ readonly emailVerified: boolean;
1225
+ readonly name: string;
1226
+ readonly image?: string | null | undefined;
1227
+ readonly banned: boolean | null | undefined;
1228
+ readonly role?: string | null | undefined;
1229
+ readonly banReason?: string | null | undefined;
1230
+ readonly banExpires?: Date | null | undefined;
1231
+ } | null>;
1220
1232
  login: (returnTo?: string) => void;
1221
1233
  register: (returnTo?: string) => void;
1222
1234
  logout: () => Promise<void>;
@@ -1,14 +1,32 @@
1
- import { navigateTo } from "#app";
1
+ import { navigateTo, useRuntimeConfig } from "#app";
2
2
  import { adminClient } from "better-auth/client/plugins";
3
3
  import { createAuthClient } from "better-auth/vue";
4
+ import { computed, watch } from "vue";
4
5
  const authClient = createAuthClient({
5
6
  plugins: [adminClient()]
6
7
  });
8
+ function setSentryUser(user) {
9
+ const config = useRuntimeConfig();
10
+ if (!config.public.abckit?.sentry) {
11
+ return;
12
+ }
13
+ import("@sentry/nuxt").then((Sentry) => {
14
+ Sentry.setUser(user);
15
+ }).catch(() => {
16
+ });
17
+ }
7
18
  export function useAuth() {
8
19
  const session = authClient.useSession();
9
20
  const isLoading = computed(() => session.value.isPending);
10
21
  const isAuthenticated = computed(() => !!session.value.data?.user);
11
22
  const user = computed(() => session.value.data?.user || null);
23
+ watch(user, (currentUser) => {
24
+ if (currentUser) {
25
+ setSentryUser({ id: currentUser.id });
26
+ } else {
27
+ setSentryUser(null);
28
+ }
29
+ }, { immediate: true });
12
30
  function login(returnTo) {
13
31
  const query = returnTo ? `?return_to=${encodeURIComponent(returnTo)}` : "";
14
32
  navigateTo(`/auth/login${query}`);
@@ -84,7 +84,7 @@ export function pathBreadcrumbSegments(path, rootNode = "/") {
84
84
  return stepNode(startNode).reverse();
85
85
  }
86
86
  function withoutQuery(path) {
87
- return path.split("?")[0];
87
+ return path.split("?")[0] ?? "";
88
88
  }
89
89
  function titleCase(s) {
90
90
  return s.replaceAll("-", " ").replace(/\w\S*/g, (w) => w.charAt(0).toUpperCase() + w.substr(1).toLowerCase());
@@ -1,3 +1,4 @@
1
+ import { useRuntimeConfig } from "#app";
1
2
  const imageSizes = {
2
3
  "raw": {
3
4
  path: "skip_processing:jpg:png:gif,default=resizing_type:fit",
@@ -211,12 +211,20 @@ function switchUser() {
211
211
  <!-- Quick Info -->
212
212
  <div class="grid grid-cols-2 gap-4 p-3 bg-slate-50 dark:bg-slate-900 rounded-lg">
213
213
  <div>
214
- <div class="font-medium text-slate-500 dark:text-slate-400 text-xs mb-1">Status Code</div>
215
- <div class="font-mono text-slate-900 dark:text-slate-100">{{ error.statusCode }}</div>
214
+ <div class="font-medium text-slate-500 dark:text-slate-400 text-xs mb-1">
215
+ Status Code
216
+ </div>
217
+ <div class="font-mono text-slate-900 dark:text-slate-100">
218
+ {{ error.statusCode }}
219
+ </div>
216
220
  </div>
217
221
  <div>
218
- <div class="font-medium text-slate-500 dark:text-slate-400 text-xs mb-1">Timestamp</div>
219
- <div class="font-mono text-slate-900 dark:text-slate-100 text-xs">{{ (/* @__PURE__ */ new Date()).toLocaleString() }}</div>
222
+ <div class="font-medium text-slate-500 dark:text-slate-400 text-xs mb-1">
223
+ Timestamp
224
+ </div>
225
+ <div class="font-mono text-slate-900 dark:text-slate-100 text-xs">
226
+ {{ (/* @__PURE__ */ new Date()).toLocaleString() }}
227
+ </div>
220
228
  </div>
221
229
  </div>
222
230
 
@@ -0,0 +1,5 @@
1
+ export declare function useFiles(_page?: number, _limit?: number, _search?: string, _folderId?: string): {
2
+ data: import("vue").Ref<any, any>;
3
+ loading: import("vue").Ref<boolean, boolean>;
4
+ error: import("vue").Ref<Error | null, Error | null>;
5
+ };
@@ -0,0 +1,11 @@
1
+ import { ref } from "vue";
2
+ export function useFiles(_page, _limit, _search, _folderId) {
3
+ const data = ref(null);
4
+ const loading = ref(false);
5
+ const error = ref(null);
6
+ return {
7
+ data,
8
+ loading,
9
+ error
10
+ };
11
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Convert bytes to human-readable size string
3
+ */
4
+ export declare function bytesToSize(bytes: number): string;
5
+ /**
6
+ * Get file extension from filename
7
+ */
8
+ export declare function getFileExtension(filename: string): string;
9
+ /**
10
+ * Get MIME type category
11
+ */
12
+ export declare function getMimeTypeCategory(mimeType: string): 'image' | 'video' | 'audio' | 'document' | 'archive' | 'other';
@@ -0,0 +1,18 @@
1
+ export function bytesToSize(bytes) {
2
+ if (bytes === 0) return "0 B";
3
+ const k = 1024;
4
+ const sizes = ["B", "KB", "MB", "GB", "TB"];
5
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
6
+ return `${Number.parseFloat((bytes / k ** i).toFixed(2))} ${sizes[i]}`;
7
+ }
8
+ export function getFileExtension(filename) {
9
+ return filename.slice((filename.lastIndexOf(".") - 1 >>> 0) + 2);
10
+ }
11
+ export function getMimeTypeCategory(mimeType) {
12
+ if (mimeType.startsWith("image/")) return "image";
13
+ if (mimeType.startsWith("video/")) return "video";
14
+ if (mimeType.startsWith("audio/")) return "audio";
15
+ if (mimeType.includes("pdf") || mimeType.includes("document") || mimeType.includes("text/")) return "document";
16
+ if (mimeType.includes("zip") || mimeType.includes("tar") || mimeType.includes("rar") || mimeType.includes("7z")) return "archive";
17
+ return "other";
18
+ }
@@ -1,2 +1,8 @@
1
1
  // GraphQL client types - populated by nitro-graphql codegen
2
- export {}
2
+
3
+ // File type enum for storage components
4
+ export type FileType = 'IMAGE' | 'VIDEO' | 'AUDIO' | 'DOCUMENT' | 'ARCHIVE' | 'OTHER'
5
+
6
+ // Re-export for convenience
7
+ export type { FileType as StorageFileType }
8
+
package/dist/types.d.mts CHANGED
@@ -1,9 +1,3 @@
1
- import type { NuxtModule } from '@nuxt/schema'
2
-
3
- import type { default as Module } from './module.mjs'
4
-
5
- export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
6
-
7
1
  export { default } from './module.mjs'
8
2
 
9
- export { type BreadcrumbsConfig, type SetupConfig } from './module.mjs'
3
+ export { type BreadcrumbsConfig, type ModuleOptions, type SetupConfig } from './module.mjs'
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "abckit",
3
3
  "type": "module",
4
- "version": "0.0.2",
4
+ "version": "0.0.5",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {
@@ -40,7 +40,6 @@
40
40
  "import": "./dist/runtime/colada.options.js"
41
41
  }
42
42
  },
43
- "main": "./dist/module.mjs",
44
43
  "types": "./dist/module.d.mts",
45
44
  "files": [
46
45
  "dist"
@@ -56,10 +55,12 @@
56
55
  "@pinia/colada-nuxt": "^0.2.4",
57
56
  "@pinia/nuxt": "^0.11.3",
58
57
  "@polar-sh/sdk": "^0.41.5",
58
+ "@sentry/nuxt": "^10.29.0",
59
59
  "@sindresorhus/slugify": "^3.0.0",
60
60
  "@tailwindcss/typography": "^0.5.19",
61
61
  "@tanstack/vue-table": "^8.21.3",
62
62
  "@vee-validate/nuxt": "^4.15.1",
63
+ "@vee-validate/zod": "^4.15.1",
63
64
  "@vueuse/core": "^14.1.0",
64
65
  "@vueuse/nuxt": "^14.1.0",
65
66
  "@vueuse/router": "^14.1.0",
@@ -99,10 +100,12 @@
99
100
  "vue": "^3.5.25",
100
101
  "vue-input-otp": "^0.3.2",
101
102
  "vue-router": "^4.6.3",
103
+ "vue-sonner": "^2.0.9",
102
104
  "vue-tsc": "^3.1.5",
103
105
  "zod": "^4.1.13"
104
106
  },
105
107
  "devDependencies": {
108
+ "@antfu/eslint-config": "^6.4.1",
106
109
  "@nuxt/eslint": "latest",
107
110
  "@nuxt/module-builder": "^1.0.2",
108
111
  "@types/node": "^24.10.1",
@@ -117,10 +120,13 @@
117
120
  "abckit": "workspace:*"
118
121
  },
119
122
  "scripts": {
123
+ "build": "nuxt-module-build build",
120
124
  "dev": "nuxt dev playground",
121
125
  "dev:build": "nuxi build playground",
122
126
  "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
123
127
  "lint": "eslint .",
124
- "test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
128
+ "lint:fix": "eslint . --fix",
129
+ "test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit",
130
+ "release": "pnpm publish --no-git-checks --access public"
125
131
  }
126
132
  }