@vitnode/core 1.2.0-canary.47 → 1.2.0-canary.49

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 (125) hide show
  1. package/dist/scripts/plugin.d.ts.map +1 -1
  2. package/dist/scripts/prepare-database.d.ts.map +1 -1
  3. package/dist/scripts/prepare-plugins-files.d.ts +1 -1
  4. package/dist/scripts/prepare-plugins-files.d.ts.map +1 -1
  5. package/dist/scripts/scripts.js +4 -4
  6. package/dist/src/api/config.d.ts.map +1 -1
  7. package/dist/src/api/config.js +3 -1
  8. package/dist/src/api/lib/check-plugin-id.d.ts.map +1 -1
  9. package/dist/src/api/lib/check-plugin-id.js +2 -0
  10. package/dist/src/api/lib/with-pagination.d.ts +2 -24
  11. package/dist/src/api/lib/with-pagination.d.ts.map +1 -1
  12. package/dist/src/api/middlewares/global.middleware.d.ts +7 -1
  13. package/dist/src/api/middlewares/global.middleware.d.ts.map +1 -1
  14. package/dist/src/api/middlewares/global.middleware.js +6 -2
  15. package/dist/src/api/models/email.d.ts +3 -1
  16. package/dist/src/api/models/email.d.ts.map +1 -1
  17. package/dist/src/api/models/email.js +25 -2
  18. package/dist/src/api/modules/admin/admin.module.d.ts +41 -288
  19. package/dist/src/api/modules/admin/admin.module.d.ts.map +1 -1
  20. package/dist/src/api/modules/admin/debug/debug.admin.module.d.ts +23 -131
  21. package/dist/src/api/modules/admin/debug/debug.admin.module.d.ts.map +1 -1
  22. package/dist/src/api/modules/admin/debug/routes/logs.route.d.ts +23 -131
  23. package/dist/src/api/modules/admin/debug/routes/logs.route.d.ts.map +1 -1
  24. package/dist/src/api/modules/admin/routes/session.route.d.ts +2 -52
  25. package/dist/src/api/modules/admin/routes/session.route.d.ts.map +1 -1
  26. package/dist/src/api/modules/admin/users/routes/list.route.d.ts +16 -105
  27. package/dist/src/api/modules/admin/users/routes/list.route.d.ts.map +1 -1
  28. package/dist/src/api/modules/admin/users/routes/users.route.d.ts +18 -105
  29. package/dist/src/api/modules/admin/users/routes/users.route.d.ts.map +1 -1
  30. package/dist/src/api/modules/admin/users/users.admin.module.d.ts +16 -105
  31. package/dist/src/api/modules/admin/users/users.admin.module.d.ts.map +1 -1
  32. package/dist/src/api/modules/middleware/middleware.module.d.ts +7 -36
  33. package/dist/src/api/modules/middleware/middleware.module.d.ts.map +1 -1
  34. package/dist/src/api/modules/middleware/route.d.ts +14 -72
  35. package/dist/src/api/modules/middleware/route.d.ts.map +1 -1
  36. package/dist/src/api/modules/users/routes/session.route.d.ts +2 -54
  37. package/dist/src/api/modules/users/routes/session.route.d.ts.map +1 -1
  38. package/dist/src/api/modules/users/routes/sign-in.route.d.ts +5 -27
  39. package/dist/src/api/modules/users/routes/sign-in.route.d.ts.map +1 -1
  40. package/dist/src/api/modules/users/routes/sign-in.route.js +1 -1
  41. package/dist/src/api/modules/users/routes/sign-out.route.d.ts +1 -5
  42. package/dist/src/api/modules/users/routes/sign-out.route.d.ts.map +1 -1
  43. package/dist/src/api/modules/users/routes/sign-up.route.d.ts +8 -36
  44. package/dist/src/api/modules/users/routes/sign-up.route.d.ts.map +1 -1
  45. package/dist/src/api/modules/users/routes/sign-up.route.js +2 -2
  46. package/dist/src/api/modules/users/routes/test.route.js +1 -1
  47. package/dist/src/api/modules/users/sso/routes/callback.route.d.ts +3 -19
  48. package/dist/src/api/modules/users/sso/routes/callback.route.d.ts.map +1 -1
  49. package/dist/src/api/modules/users/sso/routes/create-url.route.d.ts +2 -10
  50. package/dist/src/api/modules/users/sso/routes/create-url.route.d.ts.map +1 -1
  51. package/dist/src/api/modules/users/sso/sso.module.d.ts +5 -29
  52. package/dist/src/api/modules/users/sso/sso.module.d.ts.map +1 -1
  53. package/dist/src/api/modules/users/users.module.d.ts +16 -128
  54. package/dist/src/api/modules/users/users.module.d.ts.map +1 -1
  55. package/dist/src/components/form/auto-form.d.ts +28 -6
  56. package/dist/src/components/form/auto-form.d.ts.map +1 -1
  57. package/dist/src/components/form/auto-form.js +46 -12
  58. package/dist/src/components/form/fields/checkbox.d.ts +3 -7
  59. package/dist/src/components/form/fields/checkbox.d.ts.map +1 -1
  60. package/dist/src/components/form/fields/checkbox.js +5 -4
  61. package/dist/src/components/form/fields/combobox-async.d.ts +3 -6
  62. package/dist/src/components/form/fields/combobox-async.d.ts.map +1 -1
  63. package/dist/src/components/form/fields/combobox-async.js +4 -4
  64. package/dist/src/components/form/fields/combobox.d.ts +3 -6
  65. package/dist/src/components/form/fields/combobox.d.ts.map +1 -1
  66. package/dist/src/components/form/fields/combobox.js +4 -5
  67. package/dist/src/components/form/fields/input.d.ts +3 -8
  68. package/dist/src/components/form/fields/input.d.ts.map +1 -1
  69. package/dist/src/components/form/fields/input.js +8 -4
  70. package/dist/src/components/form/fields/radio-group.d.ts +3 -6
  71. package/dist/src/components/form/fields/radio-group.d.ts.map +1 -1
  72. package/dist/src/components/form/fields/radio-group.js +4 -5
  73. package/dist/src/components/form/fields/select.d.ts +3 -6
  74. package/dist/src/components/form/fields/select.d.ts.map +1 -1
  75. package/dist/src/components/form/fields/select.js +4 -5
  76. package/dist/src/components/form/fields/switch.d.ts +2 -6
  77. package/dist/src/components/form/fields/switch.d.ts.map +1 -1
  78. package/dist/src/components/form/fields/switch.js +9 -9
  79. package/dist/src/components/form/fields/textarea.d.ts +3 -4
  80. package/dist/src/components/form/fields/textarea.d.ts.map +1 -1
  81. package/dist/src/components/form/fields/textarea.js +5 -3
  82. package/dist/src/components/ui/button-client.d.ts +3 -0
  83. package/dist/src/components/ui/button-client.d.ts.map +1 -0
  84. package/dist/src/components/ui/button-client.js +57 -0
  85. package/dist/src/components/ui/button.d.ts +2 -3
  86. package/dist/src/components/ui/button.d.ts.map +1 -1
  87. package/dist/src/components/ui/button.js +5 -39
  88. package/dist/src/components/ui/form.d.ts +2 -2
  89. package/dist/src/components/ui/form.d.ts.map +1 -1
  90. package/dist/src/components/ui/form.js +2 -2
  91. package/dist/src/components/ui/loader.js +1 -1
  92. package/dist/src/emails/default-template.d.ts +5 -1
  93. package/dist/src/emails/default-template.d.ts.map +1 -1
  94. package/dist/src/emails/default-template.js +10 -11
  95. package/dist/src/lib/api/get-middleware-api.d.ts +1 -1
  96. package/dist/src/lib/api/get-session-admin-api.d.ts +2 -2
  97. package/dist/src/lib/api/get-session-api.d.ts +2 -2
  98. package/dist/src/lib/helpers/auto-form.d.ts +18 -8
  99. package/dist/src/lib/helpers/auto-form.d.ts.map +1 -1
  100. package/dist/src/lib/helpers/auto-form.js +90 -86
  101. package/dist/src/lib/helpers/auto-form.test.js +299 -138
  102. package/dist/src/lib/navigation.d.ts +5 -5
  103. package/dist/src/views/admin/views/core/debug/system-logs/actions/more/more.d.ts +9 -9
  104. package/dist/src/views/admin/views/core/debug/system-logs/system-logs-view.d.ts +10 -10
  105. package/dist/src/views/admin/views/core/test.d.ts.map +1 -1
  106. package/dist/src/views/admin/views/core/test.js +6 -6
  107. package/dist/src/views/auth/components/password-input.d.ts +2 -1
  108. package/dist/src/views/auth/components/password-input.d.ts.map +1 -1
  109. package/dist/src/views/auth/components/password-input.js +15 -8
  110. package/dist/src/views/auth/sign-in/form/use-form.d.ts +4 -16
  111. package/dist/src/views/auth/sign-in/form/use-form.d.ts.map +1 -1
  112. package/dist/src/views/auth/sign-in/form/use-form.js +1 -1
  113. package/dist/src/views/auth/sign-up/form/form.d.ts.map +1 -1
  114. package/dist/src/views/auth/sign-up/form/form.js +22 -9
  115. package/dist/src/views/auth/sign-up/form/mutation-api.d.ts +1 -1
  116. package/dist/src/views/auth/sign-up/form/use-form.d.ts +18 -36
  117. package/dist/src/views/auth/sign-up/form/use-form.d.ts.map +1 -1
  118. package/dist/src/views/auth/sign-up/form/use-form.js +10 -7
  119. package/dist/src/vitnode.config.d.ts +3 -0
  120. package/dist/src/vitnode.config.d.ts.map +1 -1
  121. package/dist/tsconfig.tsbuildinfo +1 -1
  122. package/package.json +21 -18
  123. package/dist/src/components/form/fields/item.d.ts +0 -14
  124. package/dist/src/components/form/fields/item.d.ts.map +0 -1
  125. package/dist/src/components/form/fields/item.js +0 -22
@@ -6,14 +6,12 @@ import { Button } from "../../ui/button.js";
6
6
  import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "../../ui/command.js";
7
7
  import { FormControl, FormItem, FormMessage } from "../../ui/form.js";
8
8
  import { Popover, PopoverContent, PopoverTrigger } from "../../ui/popover.js";
9
- import { getBaseSchema } from "../../../lib/helpers/auto-form.js";
10
9
  import { cn } from "../../../lib/utils.js";
11
10
  import { AutoFormDesc } from "../common/desc.js";
12
11
  import { AutoFormLabel } from "../common/label.js";
13
- export function AutoFormCombobox({ label, field, description, shape, placeholder, className, labels = [], searchPlaceholder, ...props }) {
12
+ export const AutoFormCombobox = ({ label, field, description, placeholder, className, otherProps: { enum: enumValues = [], isOptional }, labels = [], searchPlaceholder, ...props })=>{
14
13
  const t = useTranslations('core.global');
15
- const baseValues = getBaseSchema(shape, true)._def.values;
16
- const values = baseValues.map((value)=>{
14
+ const values = enumValues.map((value)=>{
17
15
  const label = labels.find((l)=>l.value === value)?.label;
18
16
  return {
19
17
  value,
@@ -24,6 +22,7 @@ export function AutoFormCombobox({ label, field, description, shape, placeholder
24
22
  className: "flex flex-col",
25
23
  children: [
26
24
  label && /*#__PURE__*/ _jsx(AutoFormLabel, {
25
+ isOptional: isOptional,
27
26
  children: label
28
27
  }),
29
28
  /*#__PURE__*/ _jsxs(Popover, {
@@ -85,4 +84,4 @@ export function AutoFormCombobox({ label, field, description, shape, placeholder
85
84
  /*#__PURE__*/ _jsx(FormMessage, {})
86
85
  ]
87
86
  });
88
- }
87
+ };
@@ -1,9 +1,4 @@
1
- import type { z } from 'zod';
2
- import React from 'react';
3
- import { Input } from '../../../components/ui/input';
4
- import type { ItemAutoFormComponentProps } from './item';
5
- export declare function AutoFormInput<T extends z.ZodTypeAny>({ label, field, shape: _, description, ...props }: ItemAutoFormComponentProps<T> & Omit<React.ComponentProps<typeof Input>, 'value'> & {
6
- description?: React.ReactNode;
7
- label?: React.ReactNode;
8
- }): import("react/jsx-runtime").JSX.Element;
1
+ import type { ItemAutoFormComponentProps } from '../auto-form';
2
+ import { Input } from '../../ui/input';
3
+ export declare const AutoFormInput: ({ label, description, otherProps: { isOptional, maxLength, minLength, pattern, type }, field, ...props }: ItemAutoFormComponentProps & Omit<React.ComponentProps<typeof Input>, "value">) => import("react/jsx-runtime").JSX.Element;
9
4
  //# sourceMappingURL=input.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/fields/input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAE9C,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,QAAQ,CAAC;AAKzD,wBAAgB,aAAa,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,EACpD,KAAK,EACL,KAAK,EAEL,KAAK,EAAE,CAAC,EACR,WAAW,EACX,GAAG,KAAK,EACT,EAAE,0BAA0B,CAAC,CAAC,CAAC,GAC9B,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,KAAK,CAAC,EAAE,OAAO,CAAC,GAAG;IAClD,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACzB,2CAwBF"}
1
+ {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/fields/input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAG/D,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAIvC,eAAO,MAAM,aAAa,GAAI,0GAM3B,0BAA0B,GAC3B,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,KAAK,CAAC,EAAE,OAAO,CAAC,4CA4BlD,CAAC"}
@@ -1,18 +1,20 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import React from "react";
3
2
  import { FormControl, FormItem, FormMessage } from "../../ui/form.js";
4
3
  import { Input } from "../../ui/input.js";
5
4
  import { AutoFormDesc } from "../common/desc.js";
6
5
  import { AutoFormLabel } from "../common/label.js";
7
- export function AutoFormInput({ label, field, // eslint-disable-next-line @typescript-eslint/no-unused-vars
8
- shape: _, description, ...props }) {
6
+ export const AutoFormInput = ({ label, description, otherProps: { isOptional, maxLength, minLength, pattern, type }, field, ...props })=>{
9
7
  return /*#__PURE__*/ _jsxs(FormItem, {
10
8
  children: [
11
9
  label && /*#__PURE__*/ _jsx(AutoFormLabel, {
10
+ isOptional: isOptional,
12
11
  children: label
13
12
  }),
14
13
  /*#__PURE__*/ _jsx(FormControl, {
15
14
  children: /*#__PURE__*/ _jsx(Input, {
15
+ ...field,
16
+ maxLength: maxLength,
17
+ minLength: minLength,
16
18
  onBlur: (e)=>{
17
19
  field.onBlur();
18
20
  props.onBlur?.(e);
@@ -21,6 +23,8 @@ shape: _, description, ...props }) {
21
23
  field.onChange(e);
22
24
  props.onChange?.(e);
23
25
  },
26
+ pattern: pattern,
27
+ type: type ?? 'text',
24
28
  value: field.value ?? '',
25
29
  ...props
26
30
  })
@@ -31,4 +35,4 @@ shape: _, description, ...props }) {
31
35
  /*#__PURE__*/ _jsx(FormMessage, {})
32
36
  ]
33
37
  });
34
- }
38
+ };
@@ -1,13 +1,10 @@
1
- import type { z } from 'zod';
2
1
  import React from 'react';
3
2
  import { RadioGroup } from '../../../components/ui/radio-group';
4
- import type { ItemAutoFormComponentProps } from './item';
5
- export declare function AutoFormRadioGroup<T extends z.ZodTypeAny>({ label, field, description, shape, labels, ...props }: ItemAutoFormComponentProps<T> & Omit<React.ComponentProps<typeof RadioGroup>, 'value'> & {
6
- description?: React.ReactNode;
7
- label?: React.ReactNode;
3
+ import type { ItemAutoFormComponentProps } from '../auto-form';
4
+ export declare const AutoFormRadioGroup: ({ label, field, description, otherProps: { enum: enumValues, isOptional }, labels, ...props }: ItemAutoFormComponentProps & Omit<React.ComponentProps<typeof RadioGroup>, "value"> & {
8
5
  labels?: {
9
6
  label: string;
10
7
  value: string;
11
8
  }[];
12
- }): import("react/jsx-runtime").JSX.Element;
9
+ }) => import("react/jsx-runtime").JSX.Element;
13
10
  //# sourceMappingURL=radio-group.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"radio-group.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/fields/radio-group.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,EAAE,UAAU,EAAkB,MAAM,6BAA6B,CAAC;AAGzE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,QAAQ,CAAC;AAKzD,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,EACzD,KAAK,EACL,KAAK,EACL,WAAW,EACX,KAAK,EACL,MAAW,EACX,GAAG,KAAK,EACT,EAAE,0BAA0B,CAAC,CAAC,CAAC,GAC9B,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,UAAU,CAAC,EAAE,OAAO,CAAC,GAAG;IACvD,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC7C,2CA0CF"}
1
+ {"version":3,"file":"radio-group.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/fields/radio-group.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,EAAE,UAAU,EAAkB,MAAM,6BAA6B,CAAC;AAEzE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAK/D,eAAO,MAAM,kBAAkB,GAAI,+FAOhC,0BAA0B,GAC3B,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,UAAU,CAAC,EAAE,OAAO,CAAC,GAAG;IACvD,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC7C,4CAuCF,CAAC"}
@@ -2,12 +2,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React from "react";
3
3
  import { FormControl, FormItem, FormLabel, FormMessage } from "../../ui/form.js";
4
4
  import { RadioGroup, RadioGroupItem } from "../../ui/radio-group.js";
5
- import { getBaseSchema } from "../../../lib/helpers/auto-form.js";
6
5
  import { AutoFormDesc } from "../common/desc.js";
7
6
  import { AutoFormLabel } from "../common/label.js";
8
- export function AutoFormRadioGroup({ label, field, description, shape, labels = [], ...props }) {
9
- const baseValues = getBaseSchema(shape, true)._def.values;
10
- const values = baseValues.map((value)=>{
7
+ export const AutoFormRadioGroup = ({ label, field, description, otherProps: { enum: enumValues = [], isOptional }, labels = [], ...props })=>{
8
+ const values = enumValues.map((value)=>{
11
9
  const label = labels.find((l)=>l.value === value)?.label;
12
10
  return {
13
11
  value,
@@ -18,6 +16,7 @@ export function AutoFormRadioGroup({ label, field, description, shape, labels =
18
16
  className: "space-y-3",
19
17
  children: [
20
18
  label && /*#__PURE__*/ _jsx(AutoFormLabel, {
19
+ isOptional: isOptional,
21
20
  children: label
22
21
  }),
23
22
  /*#__PURE__*/ _jsx(FormControl, {
@@ -48,4 +47,4 @@ export function AutoFormRadioGroup({ label, field, description, shape, labels =
48
47
  /*#__PURE__*/ _jsx(FormMessage, {})
49
48
  ]
50
49
  });
51
- }
50
+ };
@@ -1,14 +1,11 @@
1
- import type { z } from 'zod';
2
1
  import React from 'react';
3
2
  import { Select } from '../../../components/ui/select';
4
- import type { ItemAutoFormComponentProps } from './item';
5
- export declare function AutoFormSelect<T extends z.ZodTypeAny>({ label, field, description, shape, placeholder, labels, ...props }: ItemAutoFormComponentProps<T> & Omit<React.ComponentProps<typeof Select>, 'value'> & {
6
- description?: React.ReactNode;
7
- label?: React.ReactNode;
3
+ import type { ItemAutoFormComponentProps } from '../auto-form';
4
+ export declare const AutoFormSelect: ({ label, field, description, otherProps: { enum: enumValues, isOptional }, placeholder, labels, ...props }: ItemAutoFormComponentProps & Omit<React.ComponentProps<typeof Select>, "value"> & {
8
5
  labels?: {
9
6
  label: string;
10
7
  value: string;
11
8
  }[];
12
9
  placeholder?: string;
13
- }): import("react/jsx-runtime").JSX.Element;
10
+ }) => import("react/jsx-runtime").JSX.Element;
14
11
  //# sourceMappingURL=select.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/fields/select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAG7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EACL,MAAM,EAKP,MAAM,wBAAwB,CAAC;AAGhC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,QAAQ,CAAC;AAKzD,wBAAgB,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,EACrD,KAAK,EACL,KAAK,EACL,WAAW,EACX,KAAK,EACL,WAAW,EACX,MAAW,EACX,GAAG,KAAK,EACT,EAAE,0BAA0B,CAAC,CAAC,CAAC,GAC9B,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,OAAO,CAAC,GAAG;IACnD,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC5C,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,2CAuDF"}
1
+ {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/fields/select.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EACL,MAAM,EAKP,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAK/D,eAAO,MAAM,cAAc,GAAI,4GAQ5B,0BAA0B,GAC3B,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,OAAO,CAAC,GAAG;IACnD,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC5C,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,4CAoDF,CAAC"}
@@ -3,13 +3,11 @@ import { useTranslations } from "next-intl";
3
3
  import React from "react";
4
4
  import { FormControl, FormItem, FormMessage } from "../../ui/form.js";
5
5
  import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../../ui/select.js";
6
- import { getBaseSchema } from "../../../lib/helpers/auto-form.js";
7
6
  import { AutoFormDesc } from "../common/desc.js";
8
7
  import { AutoFormLabel } from "../common/label.js";
9
- export function AutoFormSelect({ label, field, description, shape, placeholder, labels = [], ...props }) {
8
+ export const AutoFormSelect = ({ label, field, description, otherProps: { enum: enumValues = [], isOptional }, placeholder, labels = [], ...props })=>{
10
9
  const t = useTranslations('core.global');
11
- const baseValues = getBaseSchema(shape, true)._def.values;
12
- const values = baseValues.map((value)=>{
10
+ const values = enumValues.map((value)=>{
13
11
  const label = labels.find((l)=>l.value === value)?.label;
14
12
  return {
15
13
  value,
@@ -21,6 +19,7 @@ export function AutoFormSelect({ label, field, description, shape, placeholder,
21
19
  className: "space-y-3",
22
20
  children: [
23
21
  label && /*#__PURE__*/ _jsx(AutoFormLabel, {
22
+ isOptional: isOptional,
24
23
  children: label
25
24
  }),
26
25
  /*#__PURE__*/ _jsx(FormControl, {
@@ -56,4 +55,4 @@ export function AutoFormSelect({ label, field, description, shape, placeholder,
56
55
  /*#__PURE__*/ _jsx(FormMessage, {})
57
56
  ]
58
57
  });
59
- }
58
+ };
@@ -1,8 +1,4 @@
1
- import type { z } from 'zod';
2
1
  import { Switch } from '../../../components/ui/switch';
3
- import type { ItemAutoFormComponentProps } from './item';
4
- export declare function AutoFormSwitch<T extends z.ZodTypeAny>({ label, field, shape: _, description, ...props }: ItemAutoFormComponentProps<T> & Omit<React.ComponentProps<typeof Switch>, 'checked'> & {
5
- description?: React.ReactNode;
6
- label?: React.ReactNode;
7
- }): import("react/jsx-runtime").JSX.Element;
2
+ import type { ItemAutoFormComponentProps } from '../auto-form';
3
+ export declare const AutoFormSwitch: ({ label, field, otherProps: { isOptional }, description, ...props }: ItemAutoFormComponentProps & Omit<React.ComponentProps<typeof Switch>, "checked">) => import("react/jsx-runtime").JSX.Element;
8
4
  //# sourceMappingURL=switch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/fields/switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAG7B,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,QAAQ,CAAC;AAKzD,wBAAgB,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,EACrD,KAAK,EACL,KAAK,EAEL,KAAK,EAAE,CAAC,EACR,WAAW,EACX,GAAG,KAAK,EACT,EAAE,0BAA0B,CAAC,CAAC,CAAC,GAC9B,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,SAAS,CAAC,GAAG;IACrD,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACzB,2CAwBF"}
1
+ {"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/fields/switch.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAK/D,eAAO,MAAM,cAAc,GAAI,qEAM5B,0BAA0B,GAC3B,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,SAAS,CAAC,4CA2BrD,CAAC"}
@@ -3,26 +3,26 @@ import { FormControl, FormItem } from "../../ui/form.js";
3
3
  import { Switch } from "../../ui/switch.js";
4
4
  import { AutoFormDesc } from "../common/desc.js";
5
5
  import { AutoFormLabel } from "../common/label.js";
6
- export function AutoFormSwitch({ label, field, // eslint-disable-next-line @typescript-eslint/no-unused-vars
7
- shape: _, description, ...props }) {
6
+ export const AutoFormSwitch = ({ label, field, otherProps: { isOptional }, description, ...props })=>{
8
7
  return /*#__PURE__*/ _jsxs(FormItem, {
9
8
  className: "flex flex-row items-center justify-between rounded-lg border p-4",
10
9
  children: [
11
- !!(label ?? description) && /*#__PURE__*/ _jsxs("div", {
10
+ (label || description) && /*#__PURE__*/ _jsxs("div", {
12
11
  className: "space-y-0.5",
13
12
  children: [
14
- /*#__PURE__*/ _jsx(AutoFormLabel, {
13
+ label && /*#__PURE__*/ _jsx(AutoFormLabel, {
15
14
  className: "text-base",
16
- children: "Marketing emails"
15
+ isOptional: isOptional,
16
+ children: label
17
17
  }),
18
- /*#__PURE__*/ _jsx(AutoFormDesc, {
19
- children: "Receive emails about new products, features, and more."
18
+ description && /*#__PURE__*/ _jsx(AutoFormDesc, {
19
+ children: description
20
20
  })
21
21
  ]
22
22
  }),
23
23
  /*#__PURE__*/ _jsx(FormControl, {
24
24
  children: /*#__PURE__*/ _jsx(Switch, {
25
- checked: field.value || false,
25
+ checked: field.value ?? false,
26
26
  onCheckedChange: (e)=>{
27
27
  field.onChange(e);
28
28
  props?.onCheckedChange?.(e);
@@ -32,4 +32,4 @@ shape: _, description, ...props }) {
32
32
  })
33
33
  ]
34
34
  });
35
- }
35
+ };
@@ -1,9 +1,8 @@
1
- import type { z } from 'zod';
2
1
  import React from 'react';
3
2
  import { Textarea } from '../../../components/ui/textarea';
4
- import type { ItemAutoFormComponentProps } from './item';
5
- export declare function AutoFormTextarea<T extends z.ZodTypeAny>({ label, field, shape: _, description, ...props }: ItemAutoFormComponentProps<T> & Omit<React.ComponentProps<typeof Textarea>, 'value'> & {
3
+ import type { ItemAutoFormComponentProps } from '../auto-form';
4
+ export declare const AutoFormTextarea: ({ label, description, otherProps: { isOptional, maxLength, minLength }, field, ...props }: ItemAutoFormComponentProps & Omit<React.ComponentProps<typeof Textarea>, "value"> & {
6
5
  description?: React.ReactNode;
7
6
  label?: React.ReactNode;
8
- }): import("react/jsx-runtime").JSX.Element;
7
+ }) => import("react/jsx-runtime").JSX.Element;
9
8
  //# sourceMappingURL=textarea.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/fields/textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,QAAQ,CAAC;AAKzD,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,EACvD,KAAK,EACL,KAAK,EAEL,KAAK,EAAE,CAAC,EACR,WAAW,EACX,GAAG,KAAK,EACT,EAAE,0BAA0B,CAAC,CAAC,CAAC,GAC9B,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,QAAQ,CAAC,EAAE,OAAO,CAAC,GAAG;IACrD,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACzB,2CAwBF"}
1
+ {"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/fields/textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAK/D,eAAO,MAAM,gBAAgB,GAAI,2FAM9B,0BAA0B,GAC3B,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,QAAQ,CAAC,EAAE,OAAO,CAAC,GAAG;IACrD,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACzB,4CA0BF,CAAC"}
@@ -4,15 +4,17 @@ import { FormControl, FormItem, FormMessage } from "../../ui/form.js";
4
4
  import { Textarea } from "../../ui/textarea.js";
5
5
  import { AutoFormDesc } from "../common/desc.js";
6
6
  import { AutoFormLabel } from "../common/label.js";
7
- export function AutoFormTextarea({ label, field, // eslint-disable-next-line @typescript-eslint/no-unused-vars
8
- shape: _, description, ...props }) {
7
+ export const AutoFormTextarea = ({ label, description, otherProps: { isOptional, maxLength, minLength }, field, ...props })=>{
9
8
  return /*#__PURE__*/ _jsxs(FormItem, {
10
9
  children: [
11
10
  label && /*#__PURE__*/ _jsx(AutoFormLabel, {
11
+ isOptional: isOptional,
12
12
  children: label
13
13
  }),
14
14
  /*#__PURE__*/ _jsx(FormControl, {
15
15
  children: /*#__PURE__*/ _jsx(Textarea, {
16
+ maxLength: maxLength,
17
+ minLength: minLength,
16
18
  onBlur: (e)=>{
17
19
  field.onBlur();
18
20
  props.onBlur?.(e);
@@ -31,4 +33,4 @@ shape: _, description, ...props }) {
31
33
  /*#__PURE__*/ _jsx(FormMessage, {})
32
34
  ]
33
35
  });
34
- }
36
+ };
@@ -0,0 +1,3 @@
1
+ import { type ButtonProps } from './button';
2
+ export declare function ClientButton({ className, variant, size, asChild, isLoading, children, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=button-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button-client.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/button-client.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,WAAW,EAAkB,MAAM,UAAU,CAAC;AAG5D,wBAAgB,YAAY,CAAC,EAC3B,SAAS,EACT,OAAO,EACP,IAAI,EACJ,OAAe,EACf,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,WAAW,2CAsCb"}
@@ -0,0 +1,57 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { AnimatePresence, motion } from "motion/react";
4
+ import { useTranslations } from "next-intl";
5
+ import { Slot } from "radix-ui";
6
+ import { cn } from "../../lib/utils.js";
7
+ import { buttonVariants } from "./button.js";
8
+ import { Loader } from "./loader.js";
9
+ export function ClientButton({ className, variant, size, asChild = false, isLoading, children, ...props }) {
10
+ const Comp = asChild ? Slot.Root : 'button';
11
+ const t = useTranslations('core.global');
12
+ return /*#__PURE__*/ _jsx(Comp, {
13
+ "aria-label": isLoading ? t('loading') : props['aria-label'],
14
+ className: cn(buttonVariants({
15
+ variant,
16
+ size,
17
+ className
18
+ })),
19
+ "data-slot": "button",
20
+ disabled: isLoading ?? props.disabled,
21
+ ...props,
22
+ children: /*#__PURE__*/ _jsxs("div", {
23
+ className: "relative flex items-center justify-center",
24
+ children: [
25
+ /*#__PURE__*/ _jsx("div", {
26
+ className: cn('flex items-center justify-center gap-2 transition-opacity duration-300', isLoading ? 'opacity-0' : 'opacity-100'),
27
+ children: children
28
+ }),
29
+ /*#__PURE__*/ _jsx(AnimatePresence, {
30
+ children: isLoading && /*#__PURE__*/ _jsx(motion.div, {
31
+ animate: {
32
+ opacity: 1,
33
+ transform: 'translateY(0px)'
34
+ },
35
+ className: "absolute inset-0 flex items-center justify-center",
36
+ exit: {
37
+ opacity: 0,
38
+ transform: 'translateY(20px)'
39
+ },
40
+ initial: {
41
+ opacity: 0,
42
+ transform: 'translateY(-20px)'
43
+ },
44
+ transition: {
45
+ type: 'spring',
46
+ duration: 0.4,
47
+ bounce: 0
48
+ },
49
+ children: /*#__PURE__*/ _jsx(Loader, {
50
+ small: true
51
+ })
52
+ })
53
+ })
54
+ ]
55
+ })
56
+ });
57
+ }
@@ -4,10 +4,9 @@ declare const buttonVariants: (props?: ({
4
4
  variant?: "link" | "default" | "destructive" | "destructiveGhost" | "outline" | "secondary" | "ghost" | null | undefined;
5
5
  size?: "default" | "sm" | "lg" | "icon" | null | undefined;
6
6
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
- type ButtonProps = React.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
7
+ export type ButtonProps = React.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
8
8
  asChild?: boolean;
9
9
  isLoading?: boolean;
10
- loadingText?: string;
11
10
  } & ({
12
11
  'aria-label': string;
13
12
  size: 'icon';
@@ -15,6 +14,6 @@ type ButtonProps = React.ComponentProps<'button'> & VariantProps<typeof buttonVa
15
14
  'aria-label'?: string;
16
15
  size?: 'default' | 'lg' | 'sm';
17
16
  });
18
- declare function Button({ className, variant, size, asChild, isLoading, loadingText, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
17
+ declare function Button(props: ButtonProps): import("react/jsx-runtime").JSX.Element;
19
18
  export { Button, buttonVariants };
20
19
  //# sourceMappingURL=button.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,QAAA,MAAM,cAAc;;;8EA+BnB,CAAC;AAEF,KAAK,WAAW,GAAG,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,GAC/C,YAAY,CAAC,OAAO,cAAc,CAAC,GAAG;IACpC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,CACA;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACtC;IAAE,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,GAAG,IAAI,CAAA;CAAE,CAC5D,CAAC;AAEJ,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,OAAO,EACP,IAAI,EACJ,OAAe,EACf,SAAS,EACT,WAAW,EACX,GAAG,KAAK,EACT,EAAE,WAAW,2CA4Bb;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC"}
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,QAAA,MAAM,cAAc;;;8EA+BnB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,GACtD,YAAY,CAAC,OAAO,cAAc,CAAC,GAAG;IACpC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,GAAG,CACA;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACtC;IAAE,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,GAAG,IAAI,CAAA;CAAE,CAC5D,CAAC;AAEJ,iBAAS,MAAM,CAAC,KAAK,EAAE,WAAW,2CAEjC;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC"}
@@ -1,11 +1,8 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { cva } from "class-variance-authority";
3
- import { useTranslations } from "next-intl";
4
- import { Slot } from "radix-ui";
5
3
  import * as React from "react";
6
- import { cn } from "../../lib/utils.js";
7
- import { Loader } from "./loader.js";
8
- const buttonVariants = cva("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 cursor-pointer", {
4
+ import { ClientButton } from "./button-client.js";
5
+ const buttonVariants = cva("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 cursor-pointer overflow-hidden", {
9
6
  variants: {
10
7
  variant: {
11
8
  default: 'bg-primary text-primary-foreground shadow-xs hover:bg-primary/90',
@@ -28,39 +25,8 @@ const buttonVariants = cva("inline-flex items-center justify-center gap-2 whites
28
25
  size: 'default'
29
26
  }
30
27
  });
31
- function Button({ className, variant, size, asChild = false, isLoading, loadingText, ...props }) {
32
- const t = useTranslations('core.global');
33
- const Comp = asChild ? Slot.Root : 'button';
34
- if (isLoading) {
35
- const text = loadingText ?? t('loading');
36
- return /*#__PURE__*/ _jsxs(Comp, {
37
- className: cn(buttonVariants({
38
- variant,
39
- size,
40
- className
41
- })),
42
- ...props,
43
- "aria-label": text,
44
- disabled: true,
45
- type: "button",
46
- children: [
47
- /*#__PURE__*/ _jsx(Loader, {
48
- small: true
49
- }),
50
- /*#__PURE__*/ _jsx("span", {
51
- className: "truncate",
52
- children: size !== 'icon' && text
53
- })
54
- ]
55
- });
56
- }
57
- return /*#__PURE__*/ _jsx(Comp, {
58
- className: cn(buttonVariants({
59
- variant,
60
- size,
61
- className
62
- })),
63
- "data-slot": "button",
28
+ function Button(props) {
29
+ return /*#__PURE__*/ _jsx(ClientButton, {
64
30
  ...props
65
31
  });
66
32
  }
@@ -22,8 +22,8 @@ declare const useFormField: () => {
22
22
  formMessageId: string;
23
23
  };
24
24
  declare function FormItem({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
25
- declare function FormLabel({ className, children, optional, ...props }: React.ComponentProps<typeof LabelPrimitive.Root> & {
26
- optional?: boolean;
25
+ declare function FormLabel({ className, children, isOptional, ...props }: React.ComponentProps<typeof LabelPrimitive.Root> & {
26
+ isOptional?: boolean;
27
27
  }): import("react/jsx-runtime").JSX.Element;
28
28
  declare function FormControl({ ...props }: React.ComponentProps<typeof Slot.Root>): import("react/jsx-runtime").JSX.Element;
29
29
  declare function FormDescription({ className, ...props }: React.ComponentProps<'p'>): import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/form.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,IAAI,cAAc,EAAE,MAAM,UAAU,CAAC;AAGxD,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,C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AAgB,GAAI,yBAGvB,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,4CAYrC,CAAC;AAEF,OAAO,EACL,IAAI,EACJ,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,SAAS,EACT,QAAQ,EACR,SAAS,EACT,WAAW,EACX,YAAY,GACb,CAAC"}
@@ -84,7 +84,7 @@ function FormItem({ className, ...props }) {
84
84
  })
85
85
  });
86
86
  }
87
- function FormLabel({ className, children, optional, ...props }) {
87
+ function FormLabel({ className, children, isOptional, ...props }) {
88
88
  const t = useTranslations('core.global');
89
89
  const { error, formItemId } = useFormField();
90
90
  return /*#__PURE__*/ _jsxs(Label, {
@@ -95,7 +95,7 @@ function FormLabel({ className, children, optional, ...props }) {
95
95
  ...props,
96
96
  children: [
97
97
  children,
98
- optional && /*#__PURE__*/ _jsx("span", {
98
+ isOptional && /*#__PURE__*/ _jsx("span", {
99
99
  className: "text-muted-foreground text-xs",
100
100
  children: t('optional')
101
101
  })
@@ -4,7 +4,7 @@ import { cn } from "../../lib/utils.js";
4
4
  export const Loader = ({ className, small })=>{
5
5
  if (small) {
6
6
  return /*#__PURE__*/ _jsx(Loader2, {
7
- className: cn('size-4 animate-spin', className)
7
+ className: cn('size-5 animate-spin', className)
8
8
  });
9
9
  }
10
10
  return /*#__PURE__*/ _jsx("div", {
@@ -1,10 +1,12 @@
1
1
  interface DefaultTemplateEmailProps {
2
2
  children: React.ReactNode;
3
3
  head?: React.ReactNode;
4
+ locale: string;
4
5
  logo?: {
5
6
  className?: string;
6
7
  src: Blob | string;
7
8
  };
9
+ messages: Record<string, string>;
8
10
  metadata: {
9
11
  shortTitle?: string;
10
12
  title: string;
@@ -12,7 +14,7 @@ interface DefaultTemplateEmailProps {
12
14
  };
13
15
  previewText?: string;
14
16
  }
15
- declare function DefaultTemplateEmail({ previewText, head, children, logo, metadata, }: DefaultTemplateEmailProps): import("react/jsx-runtime").JSX.Element;
17
+ declare function DefaultTemplateEmail({ previewText, head, children, logo, metadata, messages, locale, }: DefaultTemplateEmailProps): import("react/jsx-runtime").JSX.Element;
16
18
  declare namespace DefaultTemplateEmail {
17
19
  var PreviewProps: {
18
20
  children: string;
@@ -24,6 +26,8 @@ declare namespace DefaultTemplateEmail {
24
26
  logo: {
25
27
  src: string;
26
28
  };
29
+ messages: {};
30
+ locale: string;
27
31
  };
28
32
  }
29
33
  export default DefaultTemplateEmail;
@@ -1 +1 @@
1
- {"version":3,"file":"default-template.d.ts","sourceRoot":"","sources":["../../../src/emails/default-template.tsx"],"names":[],"mappings":"AAkBA,UAAU,yBAAyB;IACjC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,IAAI,CAAC,EAAE;QACL,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,GAAG,EAAE,IAAI,GAAG,MAAM,CAAC;KACpB,CAAC;IACF,QAAQ,EAAE;QACR,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,iBAAwB,oBAAoB,CAAC,EAC3C,WAAW,EACX,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,QAAQ,GACT,EAAE,yBAAyB,2CAwE3B;kBA9EuB,oBAAoB;;;;;;;;;;;;;eAApB,oBAAoB"}
1
+ {"version":3,"file":"default-template.d.ts","sourceRoot":"","sources":["../../../src/emails/default-template.tsx"],"names":[],"mappings":"AAkBA,UAAU,yBAAyB;IACjC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE;QACL,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,GAAG,EAAE,IAAI,GAAG,MAAM,CAAC;KACpB,CAAC;IACF,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,QAAQ,EAAE;QACR,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,iBAAwB,oBAAoB,CAAC,EAC3C,WAAW,EACX,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,MAAM,GACP,EAAE,yBAAyB,2CAiE3B;kBAzEuB,oBAAoB;;;;;;;;;;;;;;;eAApB,oBAAoB"}
@@ -1,17 +1,14 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Body, Button, Container, Head, Heading, Html, Img, Link, Preview, Section, Tailwind, Text } from "@react-email/components";
3
- import { createTranslator } from "next-intl";
3
+ import { createTranslator } from "use-intl";
4
4
  import { CONFIG } from "../lib/config.js";
5
- export default function DefaultTemplateEmail({ previewText, head, children, logo, metadata }) {
6
- const intl = createTranslator({
7
- messages: {
8
- email: {
9
- previewText: 'This is a preview text for the email template.'
10
- }
11
- },
12
- locale: 'en'
5
+ export default function DefaultTemplateEmail({ previewText, head, children, logo, metadata, messages, locale }) {
6
+ const t = createTranslator({
7
+ locale,
8
+ messages
13
9
  });
14
10
  return /*#__PURE__*/ _jsxs(Html, {
11
+ lang: locale,
15
12
  children: [
16
13
  /*#__PURE__*/ _jsx(Head, {
17
14
  children: head
@@ -55,7 +52,7 @@ export default function DefaultTemplateEmail({ previewText, head, children, logo
55
52
  className: "mx-0 my-[30px] p-0 text-center text-[24px] font-normal text-black",
56
53
  children: [
57
54
  "Join Us for an Exciting Event! - ",
58
- intl('email.previewText')
55
+ t('core.auth.sign_in.desc')
59
56
  ]
60
57
  }),
61
58
  /*#__PURE__*/ _jsx(Text, {
@@ -102,5 +99,7 @@ DefaultTemplateEmail.PreviewProps = {
102
99
  },
103
100
  logo: {
104
101
  src: 'https://www.reactemailtemplate.com/_next/static/media/reactemailtemplate-logo.b3fb12d9.png'
105
- }
102
+ },
103
+ messages: {},
104
+ locale: 'en'
106
105
  };
@@ -5,8 +5,8 @@ export declare const getMiddlewareApi: () => Promise<{
5
5
  }[];
6
6
  isEmail: boolean;
7
7
  captcha?: {
8
- type: "cloudflare_turnstile" | "recaptcha_v3";
9
8
  siteKey: string;
9
+ type: "cloudflare_turnstile" | "recaptcha_v3";
10
10
  } | undefined;
11
11
  }>;
12
12
  //# sourceMappingURL=get-middleware-api.d.ts.map
@@ -1,10 +1,10 @@
1
1
  export declare const getSessionAdminApi: () => Promise<{
2
2
  user: {
3
- email: string;
4
3
  id: number;
4
+ email: string;
5
5
  name: string;
6
- createdAt: Date;
7
6
  nameCode: string;
7
+ createdAt: Date;
8
8
  newsletter: boolean;
9
9
  avatarColor: string;
10
10
  emailVerified: boolean;