una-nuxt-module 2.1.0 → 2.1.2

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 (73) hide show
  1. package/.nuxt/unaxt/button.ts +36 -0
  2. package/.nuxt/unaxt.css +3 -0
  3. package/dist/module.json +4 -4
  4. package/dist/module.mjs +145 -48
  5. package/dist/runtime/components/ui/button/Button.vue +23 -0
  6. package/dist/runtime/components/ui/button/Button.vue.d.ts +47 -0
  7. package/dist/runtime/components/ui/button/index.d.ts +7 -0
  8. package/dist/runtime/components/ui/button/index.js +27 -0
  9. package/dist/runtime/enums/index.d.ts +0 -1
  10. package/dist/runtime/enums/index.js +0 -1
  11. package/dist/runtime/index.css +1 -0
  12. package/dist/runtime/lib/utils.d.ts +2 -0
  13. package/dist/runtime/lib/utils.js +5 -0
  14. package/dist/runtime/pages/401.vue +2 -3
  15. package/dist/runtime/pages/401.vue.d.ts +2 -0
  16. package/dist/runtime/pages/403.vue +2 -3
  17. package/dist/runtime/pages/403.vue.d.ts +2 -0
  18. package/dist/runtime/pages/ssoCallback.vue +5 -5
  19. package/dist/runtime/pages/ssoCallback.vue.d.ts +2 -0
  20. package/dist/runtime/types/index.d.ts +9 -38
  21. package/dist/types.d.mts +2 -2
  22. package/package.json +59 -24
  23. package/dist/module.cjs +0 -5
  24. package/dist/module.d.ts +0 -14
  25. package/dist/runtime/assets/scss/styles.css +0 -1016
  26. package/dist/runtime/components/layout/footer/Footer.vue +0 -16
  27. package/dist/runtime/components/layout/header/BtnExtendMenu.vue +0 -29
  28. package/dist/runtime/components/layout/header/Header.vue +0 -7
  29. package/dist/runtime/components/layout/header/HeaderMenu.vue +0 -41
  30. package/dist/runtime/components/layout/header/HeaderMenuTabs.vue +0 -102
  31. package/dist/runtime/components/layout/sidebar/NavCollapse.vue +0 -38
  32. package/dist/runtime/components/layout/sidebar/NavGroup.vue +0 -9
  33. package/dist/runtime/components/layout/sidebar/NavItem.vue +0 -25
  34. package/dist/runtime/components/layout/sidebar/SideBar.vue +0 -74
  35. package/dist/runtime/components/layout/sidebar/SideBarFooter.vue +0 -69
  36. package/dist/runtime/components/layout/sidebar/TopSideBarLogo.vue +0 -25
  37. package/dist/runtime/components/shared/authorization/AuthorizedRenderer.vue +0 -43
  38. package/dist/runtime/components/shared/buttons/BtnBack.vue +0 -19
  39. package/dist/runtime/components/shared/buttons/BtnCancel.vue +0 -13
  40. package/dist/runtime/components/shared/buttons/BtnConfirm.vue +0 -14
  41. package/dist/runtime/components/shared/containers/JsonViewer.vue +0 -13
  42. package/dist/runtime/components/shared/dates/DatePicker.vue +0 -91
  43. package/dist/runtime/components/shared/dialogs/DialogConfirmDelete.vue +0 -32
  44. package/dist/runtime/components/shared/dialogs/DialogExportTable.vue +0 -44
  45. package/dist/runtime/components/shared/feedback/LoadingSession.vue +0 -17
  46. package/dist/runtime/components/shared/feedback/SnackBar.vue +0 -40
  47. package/dist/runtime/components/shared/forms/FormBuilder/FieldBuilder.vue +0 -251
  48. package/dist/runtime/components/shared/forms/FormBuilder/FieldSlotMissed.vue +0 -20
  49. package/dist/runtime/components/shared/forms/FormBuilder/FormBuilder.vue +0 -213
  50. package/dist/runtime/components/shared/forms/FormBuilder/SteppersBuilder.vue +0 -32
  51. package/dist/runtime/components/shared/forms/FormBuilder/TabsBuilder.vue +0 -30
  52. package/dist/runtime/components/shared/forms/FormDialogWrapper.vue +0 -48
  53. package/dist/runtime/components/shared/forms/FormPageWrapper.vue +0 -19
  54. package/dist/runtime/components/shared/forms/FormSubmitSection.vue +0 -48
  55. package/dist/runtime/components/shared/navigation/BreadCrumbs.vue +0 -21
  56. package/dist/runtime/components/shared/tables/CustomTable.vue +0 -261
  57. package/dist/runtime/components/shared/tables/CustomTableHeader.vue +0 -25
  58. package/dist/runtime/components/shared/tables/NoDataMessage.vue +0 -12
  59. package/dist/runtime/components/shared/tables/TableSearchBar.vue +0 -22
  60. package/dist/runtime/components/shared/tables/buttons/BtnAdd.vue +0 -25
  61. package/dist/runtime/components/shared/tables/buttons/BtnDelete.vue +0 -32
  62. package/dist/runtime/components/shared/tables/buttons/BtnEdit.vue +0 -30
  63. package/dist/runtime/components/shared/tables/buttons/BtnExport.vue +0 -17
  64. package/dist/runtime/components/shared/tables/buttons/BtnFilter.vue +0 -21
  65. package/dist/runtime/components/shared/tables/pagination/ItemsPerPageCombo.vue +0 -24
  66. package/dist/runtime/components/shared/tables/pagination/ItemsPerPageLabel.vue +0 -5
  67. package/dist/runtime/components/shared/tables/pagination/PageSelector.vue +0 -16
  68. package/dist/runtime/components/shared/tables/pagination/PaginationInfo.vue +0 -31
  69. package/dist/runtime/enums/EVuetifyDateFormats.d.ts +0 -32
  70. package/dist/runtime/enums/EVuetifyDateFormats.js +0 -30
  71. package/dist/runtime/layouts/default.vue +0 -31
  72. package/dist/runtime/layouts/empty.vue +0 -12
  73. package/dist/types.d.ts +0 -7
@@ -0,0 +1,36 @@
1
+ import { cva, type VariantProps } from 'class-variance-authority'
2
+
3
+ export { default as Button } from './Button.vue'
4
+
5
+ export const buttonVariants = cva(
6
+ 'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*=\'size-\'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',
7
+ {
8
+ variants: {
9
+ variant: {
10
+ default:
11
+ 'bg-primary text-primary-foreground shadow-xs hover:bg-primary/90',
12
+ destructive:
13
+ 'bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',
14
+ outline:
15
+ 'border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50',
16
+ secondary:
17
+ 'bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80',
18
+ ghost:
19
+ 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',
20
+ link: 'text-primary underline-offset-4 hover:underline',
21
+ },
22
+ size: {
23
+ default: 'h-9 px-4 py-2 has-[>svg]:px-3',
24
+ sm: 'h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5',
25
+ lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',
26
+ icon: 'size-9',
27
+ },
28
+ },
29
+ defaultVariants: {
30
+ variant: 'default',
31
+ size: 'default',
32
+ },
33
+ },
34
+ )
35
+
36
+ export type ButtonVariants = VariantProps<typeof buttonVariants>
@@ -0,0 +1,3 @@
1
+ @source "./unaxt";
2
+
3
+ @theme default {}
package/dist/module.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "una-nuxt-module",
3
- "version": "2.1.0",
4
- "configKey": "unaNuxtModule",
3
+ "version": "2.1.2",
4
+ "configKey": "unaxt",
5
5
  "builder": {
6
- "@nuxt/module-builder": "0.8.4",
7
- "unbuild": "2.0.0"
6
+ "@nuxt/module-builder": "1.0.1",
7
+ "unbuild": "3.5.0"
8
8
  }
9
9
  }
package/dist/module.mjs CHANGED
@@ -1,48 +1,51 @@
1
- import { createResolver, defineNuxtModule, useLogger, extendPages, addLayout, addComponentsDir, addImportsDir, addPlugin, addRouteMiddleware, hasNuxtModule } from '@nuxt/kit';
1
+ import { createResolver, addTemplate, defineNuxtModule, useLogger, extendPages, addLayout, addComponentsDir, addImportsDir, addPlugin, addVitePlugin, addRouteMiddleware, hasNuxtModule } from '@nuxt/kit';
2
2
  import { defu } from 'defu';
3
+ import * as fs from 'node:fs';
4
+ import * as path from 'node:path';
3
5
 
4
- const name = "una-nuxt-module";
5
- const version = "2.1.0";
6
-
7
- function resolve(path) {
8
- const resolver = createResolver(import.meta.url);
9
- return resolver.resolve(`./runtime/${path}`);
10
- }
11
-
6
+ const { resolve } = createResolver(import.meta.url);
12
7
  const PAGES_CONFIG = [
13
8
  {
14
9
  name: "401",
15
10
  path: "/401",
16
- file: resolve("pages/401.vue")
11
+ file: resolve("./runtime/pages/401.vue")
17
12
  },
18
13
  {
19
14
  name: "403",
20
15
  path: "/403",
21
- file: resolve("pages/403.vue")
16
+ file: resolve("./runtime/pages/403.vue")
22
17
  },
23
18
  {
24
19
  name: "ssoCallback",
25
20
  path: "/auth/sso/login",
26
- file: resolve("pages/ssoCallback.vue")
21
+ file: resolve("./runtime/pages/ssoCallback.vue")
27
22
  }
28
23
  ];
29
24
  const LAYOUTS_CONFIG = {
30
- default: { src: resolve("layouts/default.vue"), name: "default" },
31
- empty: { src: resolve("layouts/empty.vue"), name: "empty" }
25
+ default: { src: resolve("./runtime/layouts/default.vue"), name: "default" },
26
+ empty: { src: resolve("./runtime/layouts/empty.vue"), name: "empty" }
27
+ };
28
+ const AUTH_PLUGIN = {
29
+ name: "auth",
30
+ src: resolve("./runtime/plugins/auth"),
31
+ mode: "client"
32
32
  };
33
33
  const PLUGINS_CONFIG = [
34
- { name: "auth", src: resolve("plugins/auth"), mode: "client" },
35
- { name: "vue-json", src: resolve("plugins/vue-json"), mode: "client" }
34
+ {
35
+ name: "vue-json",
36
+ src: resolve("./runtime/plugins/vue-json"),
37
+ mode: "client"
38
+ }
36
39
  ];
37
- const MIDDLEWARE_CONFIG = [
40
+ const AUTH_MIDDLEWARE_CONFIG = [
38
41
  {
39
42
  name: "authentication",
40
- path: resolve("middleware/authentication"),
43
+ path: resolve("./runtime/middleware/authentication"),
41
44
  global: true
42
45
  },
43
46
  {
44
47
  name: "authorization",
45
- path: resolve("middleware/authorization"),
48
+ path: resolve("./runtime/middleware/authorization"),
46
49
  global: true
47
50
  }
48
51
  ];
@@ -52,42 +55,103 @@ const AUTO_IMPORT_DIRS = [
52
55
  "enums",
53
56
  "stores",
54
57
  "types",
55
- "utils"
58
+ "utils",
59
+ "lib"
56
60
  ];
57
61
 
62
+ function getShadcnComponentsInstalled() {
63
+ try {
64
+ const { resolve } = createResolver(import.meta.url);
65
+ const directoryPath = resolve("./runtime/components/ui");
66
+ const filesAndFolders = fs.readdirSync(directoryPath);
67
+ const folders = filesAndFolders.filter((item) => {
68
+ const fullPath = path.join(directoryPath, item);
69
+ return fs.statSync(fullPath).isDirectory();
70
+ });
71
+ return folders;
72
+ } catch (err) {
73
+ console.error("Error reading directory:", err);
74
+ return [];
75
+ }
76
+ }
77
+ function getTemplates() {
78
+ const { resolve } = createResolver(import.meta.url);
79
+ const templates = [];
80
+ const components = getShadcnComponentsInstalled();
81
+ for (const component of components) {
82
+ try {
83
+ const filePath = resolve(`./runtime/components/ui/${component}/index.ts`);
84
+ const fileContent = fs.readFileSync(filePath, "utf-8");
85
+ templates.push({
86
+ filename: `unaxt/${component}.ts`,
87
+ write: true,
88
+ getContents: () => fileContent
89
+ });
90
+ } catch (error) {
91
+ console.error(
92
+ `Error reading file components/ui/${component}/index.ts:`,
93
+ error
94
+ );
95
+ }
96
+ }
97
+ templates.push({
98
+ filename: "unaxt.css",
99
+ write: true,
100
+ getContents: () => `@source "./unaxt";
101
+
102
+ @theme default {}
103
+ `
104
+ });
105
+ return templates;
106
+ }
107
+ function addTemplates() {
108
+ const templates = getTemplates();
109
+ for (const template of templates) {
110
+ addTemplate(template);
111
+ }
112
+ }
113
+
114
+ const name = "una-nuxt-module";
115
+ const version = "2.1.2";
116
+
58
117
  const module = defineNuxtModule({
59
118
  meta: {
60
- name: name,
61
- version: version,
62
- configKey: "unaNuxtModule"
119
+ name,
120
+ version,
121
+ configKey: "unaxt"
63
122
  },
64
123
  defaults: {
65
124
  use: {
66
125
  layout: {
67
126
  default: false,
68
127
  empty: false
69
- }
128
+ },
129
+ sso: true,
130
+ components: true
70
131
  }
71
132
  },
72
- async setup(_options, _nuxt) {
133
+ async setup(options, nuxt) {
73
134
  const logger = useLogger(name);
74
- const validateIDToken = import.meta.dev ? _nuxt.options.runtimeConfig.public.unaNuxtModule.sso.validateIDToken ?? false : true;
135
+ const { resolve } = createResolver(import.meta.url);
136
+ nuxt.options.unaxt = options;
137
+ nuxt.options.alias["#unaxt"] = resolve("./runtime");
75
138
  const mergeRuntimeConfigWithDefaults = () => {
76
- _nuxt.options.runtimeConfig.public.unaNuxtModule = defu(
77
- _nuxt.options.runtimeConfig.public.unaNuxtModule,
139
+ const validateIDToken = import.meta.dev ? nuxt.options.runtimeConfig.public.unaNuxtModule.sso.validateIDToken ?? false : true;
140
+ nuxt.options.runtimeConfig.public.unaNuxtModule = defu(
141
+ nuxt.options.runtimeConfig.public.unaNuxtModule,
78
142
  {
79
143
  sso: { validateIDToken },
80
144
  use: {
81
145
  layout: {
82
- default: _options.use.layout.default,
83
- empty: _options.use.layout.empty
146
+ default: options.use.layout.default,
147
+ empty: options.use.layout.empty
84
148
  }
85
149
  }
86
150
  }
87
151
  );
88
152
  };
89
153
  const setupPublicAssets = () => {
90
- _nuxt.options.nitro.publicAssets = [{ dir: resolve("public") }];
154
+ nuxt.options.nitro.publicAssets = [{ dir: resolve("./runtime/public") }];
91
155
  logger.success("Public assets added");
92
156
  };
93
157
  const setupPages = () => {
@@ -97,24 +161,33 @@ const module = defineNuxtModule({
97
161
  logger.success("Custom pages added: ['/401', '/403', '/auth/sso/login']");
98
162
  };
99
163
  const setupLayouts = () => {
100
- const addLayoutDefault = _nuxt.options.runtimeConfig.public.unaNuxtModule.use.layout.default;
164
+ const addLayoutDefault = nuxt.options.runtimeConfig.public.unaNuxtModule.use.layout.default;
101
165
  if (addLayoutDefault) {
102
166
  addLayout(LAYOUTS_CONFIG.default, LAYOUTS_CONFIG.default.name);
103
167
  logger.success("Layout added: default");
104
168
  }
105
- const addLayoutEmpty = _nuxt.options.runtimeConfig.public.unaNuxtModule.use.layout.empty;
169
+ const addLayoutEmpty = nuxt.options.runtimeConfig.public.unaNuxtModule.use.layout.empty;
106
170
  if (addLayoutEmpty) {
107
171
  addLayout(LAYOUTS_CONFIG.empty, LAYOUTS_CONFIG.empty.name);
108
172
  logger.success("Layout added: empty");
109
173
  }
110
174
  };
111
175
  const setupComponents = () => {
112
- addComponentsDir({
113
- path: resolve("components"),
114
- pathPrefix: false,
115
- global: true
116
- });
117
- logger.success("Global components added");
176
+ if (nuxt.options.runtimeConfig.public.unaNuxtModule.use.components) {
177
+ addComponentsDir(
178
+ {
179
+ path: resolve("./runtime/components/ui"),
180
+ extensions: [".vue"],
181
+ prefix: "",
182
+ pathPrefix: false,
183
+ global: true
184
+ },
185
+ {
186
+ prepend: true
187
+ }
188
+ );
189
+ logger.success("Global components added");
190
+ }
118
191
  };
119
192
  const setupAutoImports = () => {
120
193
  addImportsDir(AUTO_IMPORT_DIRS.map((dir) => resolve(dir)));
@@ -122,21 +195,42 @@ const module = defineNuxtModule({
122
195
  `Auto-import directories added: [${AUTO_IMPORT_DIRS.join(", ")}]`
123
196
  );
124
197
  };
198
+ const setupSSO = () => {
199
+ if (nuxt.options.runtimeConfig.public.unaNuxtModule.use.sso) {
200
+ addPlugin(AUTH_PLUGIN);
201
+ logger.success("Auth plugin added... SSO configurado");
202
+ }
203
+ };
125
204
  const setupPlugins = () => {
126
205
  PLUGINS_CONFIG.forEach((plugin) => addPlugin(plugin));
127
- logger.success("Plugins added: ['auth', 'vue-json']");
206
+ logger.success("Plugins added: ['vue-json']");
128
207
  };
129
- const setupMiddleware = () => {
130
- MIDDLEWARE_CONFIG.forEach((middleware) => addRouteMiddleware(middleware));
131
- logger.success("Middleware added: ['authentication', 'authorization']");
208
+ const setupTailwindPlugin = async () => {
209
+ if (nuxt.options.builder === "@nuxt/vite-builder") {
210
+ const plugin = await import('@tailwindcss/vite').then((r) => r.default);
211
+ addVitePlugin(plugin());
212
+ } else {
213
+ nuxt.options.postcss.plugins["@tailwindcss/postcss"] = {};
214
+ }
215
+ };
216
+ const setupAuthMiddlewares = () => {
217
+ if (nuxt.options.runtimeConfig.public.unaNuxtModule.use.sso) {
218
+ AUTH_MIDDLEWARE_CONFIG.forEach(
219
+ (middleware) => addRouteMiddleware(middleware)
220
+ );
221
+ logger.success("Middleware added: ['authentication', 'authorization']");
222
+ }
132
223
  };
133
224
  const setupI18n = () => {
134
- if (!hasNuxtModule("@nuxtjs/i18n", _nuxt)) {
135
- throw new Error("@nuxtjs/i18n module is required but not installed");
225
+ if (!hasNuxtModule("@nuxtjs/i18n", nuxt)) {
226
+ console.log(
227
+ "@nuxtjs/i18n module is not installed, i18n extend messages skipped"
228
+ );
229
+ return;
136
230
  }
137
- _nuxt.hook("i18n:registerModule", (register) => {
231
+ nuxt.hook("i18n:registerModule", (register) => {
138
232
  register({
139
- langDir: resolve("i18n/locales"),
233
+ langDir: resolve("./runtime/i18n/locales"),
140
234
  locales: [{ code: "es", file: "es.json" }]
141
235
  });
142
236
  });
@@ -151,9 +245,12 @@ const module = defineNuxtModule({
151
245
  setupLayouts();
152
246
  setupComponents();
153
247
  setupAutoImports();
248
+ setupSSO();
154
249
  setupPlugins();
155
- setupMiddleware();
250
+ await setupTailwindPlugin();
251
+ setupAuthMiddlewares();
156
252
  setupI18n();
253
+ addTemplates();
157
254
  logger.success("Module setup completed successfully\n");
158
255
  } catch (error) {
159
256
  logger.error("Module setup failed");
@@ -0,0 +1,23 @@
1
+ <script setup>
2
+ import { Primitive } from "reka-ui";
3
+ import { cn } from "../../../lib/utils";
4
+ import { buttonVariants } from ".";
5
+ const props = defineProps({
6
+ variant: { type: null, required: false },
7
+ size: { type: null, required: false },
8
+ class: { type: null, required: false },
9
+ asChild: { type: Boolean, required: false },
10
+ as: { type: [String, Object, Function], required: false, default: "button" }
11
+ });
12
+ </script>
13
+
14
+ <template>
15
+ <Primitive
16
+ data-slot="button"
17
+ :as="as"
18
+ :as-child="asChild"
19
+ :class="cn(buttonVariants({ variant, size }), props.class)"
20
+ >
21
+ <slot />
22
+ </Primitive>
23
+ </template>
@@ -0,0 +1,47 @@
1
+ import type { HTMLAttributes } from "vue";
2
+ import { type PrimitiveProps } from "reka-ui";
3
+ import { type ButtonVariants } from ".";
4
+ interface Props extends PrimitiveProps {
5
+ variant?: ButtonVariants["variant"];
6
+ size?: ButtonVariants["size"];
7
+ class?: HTMLAttributes["class"];
8
+ }
9
+ declare function __VLS_template(): {
10
+ slots: {
11
+ default?(_: {}): any;
12
+ };
13
+ refs: {};
14
+ attrs: Partial<{}>;
15
+ };
16
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
17
+ declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
18
+ as: string;
19
+ }>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
20
+ as: string;
21
+ }>>> & Readonly<{}>, {
22
+ as: import("reka-ui").AsTag | import("vue").Component;
23
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
24
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
25
+ export default _default;
26
+ type __VLS_WithDefaults<P, D> = {
27
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
28
+ default: D[K];
29
+ }> : P[K];
30
+ };
31
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
32
+ type __VLS_TypePropsToOption<T> = {
33
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
34
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
35
+ } : {
36
+ type: import('vue').PropType<T[K]>;
37
+ required: true;
38
+ };
39
+ };
40
+ type __VLS_WithTemplateSlots<T, S> = T & {
41
+ new (): {
42
+ $slots: S;
43
+ };
44
+ };
45
+ type __VLS_PrettifyLocal<T> = {
46
+ [K in keyof T]: T[K];
47
+ } & {};
@@ -0,0 +1,7 @@
1
+ import { type VariantProps } from 'class-variance-authority';
2
+ export { default as Button } from './Button.vue.js';
3
+ export declare const buttonVariants: (props?: ({
4
+ variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
5
+ size?: "default" | "sm" | "lg" | "icon" | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ export type ButtonVariants = VariantProps<typeof buttonVariants>;
@@ -0,0 +1,27 @@
1
+ import { cva } from "class-variance-authority";
2
+ export { default as Button } from "./Button.vue";
3
+ export const buttonVariants = cva(
4
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
5
+ {
6
+ variants: {
7
+ variant: {
8
+ default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
9
+ destructive: "bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
10
+ outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
11
+ secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
12
+ ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
13
+ link: "text-primary underline-offset-4 hover:underline"
14
+ },
15
+ size: {
16
+ default: "h-9 px-4 py-2 has-[>svg]:px-3",
17
+ sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
18
+ lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
19
+ icon: "size-9"
20
+ }
21
+ },
22
+ defaultVariants: {
23
+ variant: "default",
24
+ size: "default"
25
+ }
26
+ }
27
+ );
@@ -3,4 +3,3 @@ export * from "./EFormField.js";
3
3
  export * from "./EFormMode.js";
4
4
  export * from "./ERequestMethod.js";
5
5
  export * from "./ETheme.js";
6
- export * from "./EVuetifyDateFormats.js";
@@ -3,4 +3,3 @@ export * from "./EFormField.js";
3
3
  export * from "./EFormMode.js";
4
4
  export * from "./ERequestMethod.js";
5
5
  export * from "./ETheme.js";
6
- export * from "./EVuetifyDateFormats.js";
@@ -0,0 +1 @@
1
+ @import "#build/unaxt.css";@custom-variant dark (&:is(.dark *));@theme inline{--color-background:var(--background);--color-foreground:var(--foreground);--color-card:var(--card);--color-card-foreground:var(--card-foreground);--color-popover:var(--popover);--color-popover-foreground:var(--popover-foreground);--color-primary:var(--primary);--color-primary-foreground:var(--primary-foreground);--color-secondary:var(--secondary);--color-secondary-foreground:var(--secondary-foreground);--color-muted:var(--muted);--color-muted-foreground:var(--muted-foreground);--color-accent:var(--accent);--color-accent-foreground:var(--accent-foreground);--color-destructive:var(--destructive);--color-destructive-foreground:var(--destructive-foreground);--color-border:var(--border);--color-input:var(--input);--color-ring:var(--ring);--color-chart-1:var(--chart-1);--color-chart-2:var(--chart-2);--color-chart-3:var(--chart-3);--color-chart-4:var(--chart-4);--color-chart-5:var(--chart-5);--radius-sm:calc(var(--radius) - 4px);--radius-md:calc(var(--radius) - 2px);--radius-lg:var(--radius);--radius-xl:calc(var(--radius) + 4px);--color-sidebar:var(--sidebar);--color-sidebar-foreground:var(--sidebar-foreground);--color-sidebar-primary:var(--sidebar-primary);--color-sidebar-primary-foreground:var(--sidebar-primary-foreground);--color-sidebar-accent:var(--sidebar-accent);--color-sidebar-accent-foreground:var(--sidebar-accent-foreground);--color-sidebar-border:var(--sidebar-border);--color-sidebar-ring:var(--sidebar-ring);--font-sans:var(--font-sans);--font-mono:var(--font-mono);--font-serif:var(--font-serif)}:root{--background:oklch(0.9856 0.0084 56.3169);--foreground:oklch(0.3325 0.0194 2.7074);--card:oklch(1 0 0);--card-foreground:oklch(0.3325 0.0194 2.7074);--popover:oklch(1 0 0);--popover-foreground:oklch(0.3325 0.0194 2.7074);--primary:oklch(0.7357 0.1641 34.7091);--primary-foreground:oklch(1 0 0);--secondary:oklch(0.9596 0.02 28.9029);--secondary-foreground:oklch(0.5721 0.1749 33.2608);--muted:oklch(0.9656 0.0176 39.4009);--muted-foreground:oklch(0.5547 0.0155 60.3783);--accent:oklch(0.8287 0.1147 58.0523);--accent-foreground:oklch(0.3325 0.0194 2.7074);--destructive:oklch(0.6386 0.2469 25.4429);--destructive-foreground:oklch(1 0 0);--border:oklch(0.9296 0.037 38.6868);--input:oklch(0.9296 0.037 38.6868);--ring:oklch(0.7357 0.1641 34.7091);--chart-1:oklch(0.646 0.222 41.116);--chart-2:oklch(0.6 0.118 184.704);--chart-3:oklch(0.398 0.07 227.392);--chart-4:oklch(0.828 0.189 84.429);--chart-5:oklch(0.769 0.188 70.08);--radius:0.625rem;--sidebar:oklch(0.985 0 0);--sidebar-foreground:oklch(0.145 0 0);--sidebar-primary:oklch(0.205 0 0);--sidebar-primary-foreground:oklch(0.985 0 0);--sidebar-accent:oklch(0.97 0 0);--sidebar-accent-foreground:oklch(0.205 0 0);--sidebar-border:oklch(0.922 0 0);--sidebar-ring:oklch(0.708 0 0);--font-sans:Architects Daughter,sans-serif;--font-serif:Space Grotesk,serif;--font-mono:Ubuntu Mono,monospace}.dark{--background:oklch(0.2546 0.0241 351.484);--foreground:oklch(0.9394 0.017 50.4295);--card:oklch(0.316 0.0244 343.3242);--card-foreground:oklch(0.9394 0.017 50.4295);--popover:oklch(0.316 0.0244 343.3242);--popover-foreground:oklch(0.9394 0.017 50.4295);--primary:oklch(0.7357 0.1641 34.7091);--primary-foreground:oklch(1 0 0);--secondary:oklch(0.3614 0.0268 343.7114);--secondary-foreground:oklch(0.9394 0.017 50.4295);--muted:oklch(0.316 0.0244 343.3242);--muted-foreground:oklch(0.8389 0.0324 53.4183);--accent:oklch(0.8287 0.1147 58.0523);--accent-foreground:oklch(0.2546 0.0241 351.484);--destructive:oklch(0.6386 0.2469 25.4429);--destructive-foreground:oklch(1 0 0);--border:oklch(0.3614 0.0268 343.7114);--input:oklch(0.3614 0.0268 343.7114);--ring:oklch(0.7357 0.1641 34.7091);--chart-1:oklch(0.488 0.243 264.376);--chart-2:oklch(0.696 0.17 162.48);--chart-3:oklch(0.769 0.188 70.08);--chart-4:oklch(0.627 0.265 303.9);--chart-5:oklch(0.645 0.246 16.439);--sidebar:oklch(0.205 0 0);--sidebar-foreground:oklch(0.985 0 0);--sidebar-primary:oklch(0.488 0.243 264.376);--sidebar-primary-foreground:oklch(0.985 0 0);--sidebar-accent:oklch(0.269 0 0);--sidebar-accent-foreground:oklch(0.985 0 0);--sidebar-border:oklch(0.269 0 0);--sidebar-ring:oklch(0.439 0 0);--font-sans:Architects Daughter,sans-serif;--font-serif:Space Grotesk,serif;--font-mono:Ubuntu Mono,monospace}@layer base{*{@apply border-border outline-ring/50}body{@apply bg-background text-foreground}}
@@ -0,0 +1,2 @@
1
+ import { type ClassValue } from 'clsx';
2
+ export declare function cn(...inputs: ClassValue[]): string;
@@ -0,0 +1,5 @@
1
+ import { clsx } from "clsx";
2
+ import { twMerge } from "tailwind-merge";
3
+ export function cn(...inputs) {
4
+ return twMerge(clsx(inputs));
5
+ }
@@ -25,10 +25,9 @@
25
25
  </v-sheet>
26
26
  </template>
27
27
 
28
- <script lang="ts" setup>
28
+ <script setup>
29
29
  import { definePageMeta, navigateTo } from "#imports";
30
-
31
30
  definePageMeta({
32
- layout: "empty",
31
+ layout: "empty"
33
32
  });
34
33
  </script>
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
@@ -26,10 +26,9 @@
26
26
  </v-sheet>
27
27
  </template>
28
28
 
29
- <script lang="ts" setup>
29
+ <script setup>
30
30
  import { definePageMeta, navigateTo } from "#imports";
31
-
32
31
  definePageMeta({
33
- layout: "empty",
32
+ layout: "empty"
34
33
  });
35
34
  </script>
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
@@ -1,13 +1,13 @@
1
- <template></template>
1
+ <template>
2
2
 
3
- <script lang="ts" setup>
3
+ </template>
4
+
5
+ <script setup>
4
6
  import { definePageMeta, navigateTo } from "#imports";
5
7
  import { onMounted } from "vue";
6
-
7
8
  definePageMeta({
8
- layout: "empty",
9
+ layout: "empty"
9
10
  });
10
-
11
11
  onMounted(() => {
12
12
  navigateTo("/");
13
13
  });
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
@@ -1,6 +1,6 @@
1
1
  import type { AsyncData } from "#app";
2
2
  import type { FetchError } from "ofetch";
3
- import type { EAuthorization, EFormField, EFormMode, ERequestMethod, EVuetifyDateFormats } from "../enums/index.js";
3
+ import type { EAuthorization, EFormField, EFormMode, ERequestMethod } from "../enums/index.js";
4
4
  import type { FetchOptions } from "ofetch";
5
5
  export { FetchClient } from "../classes/FetchClient.js";
6
6
  /**
@@ -75,7 +75,7 @@ export interface IUnaNuxtModuleOptions {
75
75
  /**
76
76
  * Páginas que no requieren autenticación.
77
77
  */
78
- unprotectedPages: String[];
78
+ unprotectedPages: string[];
79
79
  /**
80
80
  * Menú de navegación configurado para la aplicación.
81
81
  */
@@ -86,6 +86,8 @@ export interface IUnaNuxtModuleOptions {
86
86
  default: boolean;
87
87
  empty: boolean;
88
88
  };
89
+ sso: boolean;
90
+ components: boolean;
89
91
  };
90
92
  }
91
93
  /** Tipo de autorización. */
@@ -96,8 +98,6 @@ export type TFormField = keyof typeof EFormField;
96
98
  export type TFormMode = keyof typeof EFormMode;
97
99
  /** Tipo de petición */
98
100
  export type TRequestMethod = keyof typeof ERequestMethod;
99
- /** Tipos de formatos de fecha para Vuetify. */
100
- export type TVuetifyDateFormat = keyof typeof EVuetifyDateFormats;
101
101
  /**
102
102
  * Interfaz que define los parámetros necesarios para realizar una petición HTTP.
103
103
  */
@@ -524,39 +524,10 @@ export type TSortValue = boolean | "asc" | "desc";
524
524
  */
525
525
  export interface ISort extends Record<string, TSortValue> {
526
526
  }
527
- /**
528
- * Interfaz para los breadcumbs.
529
- *
530
- * @interface IBreadCumbElement
531
- *
532
- * @property {string} - *title* - Título del breadcumb
533
- * @property {boolean} - *disabled* - Indica si el breadcumb esta deshabilitado
534
- * @property {string} - *href* - Ruta del breadcumb
535
- */
536
- export interface IBreadCumbElement {
537
- /** Título del breadcumb */
538
- title: string;
539
- /** Indica si el breadcumb esta deshabilitado */
540
- disabled: boolean;
541
- /** Ruta del breadcumb */
542
- href: string;
543
- }
544
- /**
545
- * Interfaz para los breadcumbs de los módulos.
546
- *
547
- * @interface IBreadCumbs
548
- *
549
- * @property {IBreadCumbElement[]} - *list* - Breadcumbs para listado
550
- * @property {IBreadCumbElement[]} - *create* - Breadcumbs para creación
551
- * @property {IBreadCumbElement[]} - *edit* - Breadcumbs para edición
552
- */
553
- export interface IBreadCumbs {
554
- /** Breadcumbs para listado */
555
- list: IBreadCumbElement[];
556
- /** Breadcumbs para creación */
557
- create: IBreadCumbElement[];
558
- /** Breadcumbs para edición */
559
- edit: IBreadCumbElement[];
527
+ export interface IBreadcrumb {
528
+ text: string;
529
+ type: "page" | "link";
530
+ to?: string;
560
531
  }
561
532
  export type TFormBuilderField = IFormBuilderFieldText | IFormBuilderFieldTextArea | IFormBuilderFieldNumber | IFormBuilderFieldDate | IFormBuilderFieldSelect | IFormBuilderFieldSlot | IFormBuilderFieldCheckBox | IFormBuilderFieldRadioButton | IFormBuilderFieldSwitch;
562
533
  export interface IFormBuilderConfig {
@@ -610,7 +581,7 @@ export interface IFormBuilderFieldNumber extends IFormBuilderFieldBase {
610
581
  min?: number;
611
582
  }
612
583
  export interface IFormBuilderFieldDate extends IFormBuilderFieldBase {
613
- displayFormat: TVuetifyDateFormat;
584
+ displayFormat: any;
614
585
  }
615
586
  export interface IFormBuilderFieldSelect extends IFormBuilderFieldBase {
616
587
  items: any[];
package/dist/types.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { NuxtModule } from '@nuxt/schema'
2
2
 
3
- import type { default as Module } from './module.js'
3
+ import type { default as Module } from './module.mjs'
4
4
 
5
5
  export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
6
6
 
7
- export { default } from './module.js'
7
+ export { default } from './module.mjs'