vintasend 0.2.3 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +227 -12
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/next.config.d.ts +1 -1
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/next.config.js +9 -4
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/forgot-password/forgot-password-notification-context.d.ts +6 -6
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/forgot-password/forgot-password-notification-context.js +16 -17
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/forgot-password/route.d.ts +7 -5
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/forgot-password/route.js +105 -79
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/login/route.d.ts +4 -5
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/login/route.js +96 -66
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/reset-password/route.d.ts +7 -5
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/reset-password/route.js +95 -71
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/signup/email-verification-notification-context.d.ts +6 -6
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/signup/email-verification-notification-context.js +18 -18
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/signup/route.d.ts +4 -5
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/signup/route.js +124 -96
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/verify-email/route.d.ts +7 -5
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/api/auth/verify-email/route.js +94 -70
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/auth/login/page.d.ts +1 -1
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/auth/login/page.js +67 -55
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/auth/reset-password/[token]/page.d.ts +1 -1
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/auth/reset-password/[token]/page.js +76 -63
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/auth/signup/page.d.ts +1 -1
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/auth/signup/page.js +87 -63
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/auth/verify-email/[token]/page.d.ts +1 -1
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/auth/verify-email/[token]/page.js +50 -35
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/auth/verify-email-sent/page.d.ts +1 -1
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/auth/verify-email-sent/page.js +12 -12
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/layout.d.ts +7 -5
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/layout.js +15 -16
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/page.d.ts +1 -1
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/app/page.js +65 -21
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/AuthLayout.d.ts +7 -4
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/AuthLayout.js +7 -8
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/accordion.d.ts +18 -6
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/accordion.js +86 -48
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/alert-dialog.d.ts +58 -14
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/alert-dialog.js +135 -53
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/alert.d.ts +21 -7
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/alert.js +85 -49
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/avatar.d.ts +14 -5
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/avatar.js +77 -40
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/button.d.ts +25 -9
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/button.js +80 -58
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/card.d.ts +19 -7
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/card.js +98 -48
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/checkbox.d.ts +6 -3
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/checkbox.js +66 -42
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/collapsible.d.ts +10 -4
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/collapsible.js +48 -35
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/dialog.d.ts +40 -13
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/dialog.js +116 -50
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/dropdown-menu.d.ts +83 -19
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/dropdown-menu.js +170 -68
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/form.d.ts +53 -21
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/form.js +137 -83
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/input.d.ts +8 -2
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/input.js +60 -37
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/label.d.ts +10 -4
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/label.js +61 -40
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/menubar.d.ts +77 -23
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/menubar.js +188 -64
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/select.d.ts +48 -12
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/select.js +148 -66
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/textarea.d.ts +8 -2
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/components/ui/textarea.js +59 -37
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/api-clients/auth.d.ts +10 -10
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/api-clients/auth.js +54 -55
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/api-clients/core.d.ts +14 -11
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/api-clients/core.js +1 -2
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/email.js +0 -1
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/logger.d.ts +3 -3
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/logger.js +9 -10
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/schemas/auth.d.ts +66 -32
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/schemas/auth.js +74 -54
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/services/auth.js +7 -8
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/services/notifications-with-queue.d.ts +14 -4
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/services/notifications-with-queue.js +14 -10
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/services/notifications.d.ts +11 -7
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/services/notifications.js +39 -26
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/services/temporal-queue-service.d.ts +11 -8
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/services/temporal-queue-service.js +14 -15
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/temporal.d.ts +1 -1
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/temporal.js +9 -10
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/utils.d.ts +1 -1
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/lib/utils.js +4 -5
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/workers/notifications/activities.d.ts +6 -5
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/workers/notifications/activities.js +14 -14
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/workers/notifications/config.d.ts +1 -1
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/workers/notifications/config.js +2 -3
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/workers/notifications/constants.d.ts +1 -1
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/workers/notifications/constants.js +1 -2
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/workers/notifications/worker.js +20 -22
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/workers/notifications/workflows.d.ts +3 -2
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/src/workers/notifications/workflows.js +10 -9
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/tailwind.config.d.ts +74 -74
- package/dist/examples/nextjs-prisma-nodemailer-pug-temporal/tailwind.config.js +80 -81
- package/dist/implementations/vintasend-nodemailer/src/index.js +6 -4
- package/dist/implementations/vintasend-nodemailer/src/nodemailer-notification-adapter.d.ts +36 -14
- package/dist/implementations/vintasend-nodemailer/src/nodemailer-notification-adapter.js +26 -28
- package/dist/implementations/vintasend-prisma/src/index.js +6 -4
- package/dist/implementations/vintasend-prisma/src/prisma-notification-backend.d.ts +232 -138
- package/dist/implementations/vintasend-prisma/src/prisma-notification-backend.js +275 -262
- package/dist/implementations/vintasend-pug/src/index.js +6 -4
- package/dist/implementations/vintasend-pug/src/pug-email-template-renderer.d.ts +18 -7
- package/dist/implementations/vintasend-pug/src/pug-email-template-renderer.js +19 -21
- package/dist/implementations/vintasend-winston/src/index.js +6 -4
- package/dist/implementations/vintasend-winston/src/winston-logger.d.ts +6 -6
- package/dist/implementations/vintasend-winston/src/winston-logger.js +65 -50
- package/dist/index.d.ts +13 -5
- package/dist/index.js +13 -1
- package/dist/services/attachment-manager/base-attachment-manager.d.ts +42 -0
- package/dist/services/attachment-manager/base-attachment-manager.js +115 -0
- package/dist/services/attachment-manager/local-file-attachment-manager.d.ts +58 -0
- package/dist/services/attachment-manager/local-file-attachment-manager.js +192 -0
- package/dist/services/notification-adapters/base-notification-adapter.d.ts +36 -4
- package/dist/services/notification-adapters/base-notification-adapter.js +73 -4
- package/dist/services/notification-backends/base-notification-backend.d.ts +54 -11
- package/dist/services/notification-backends/base-notification-backend.js +12 -0
- package/dist/services/notification-context-generators-map.d.ts +1 -1
- package/dist/services/notification-context-registry.d.ts +14 -9
- package/dist/services/notification-context-registry.js +30 -31
- package/dist/services/notification-queue-service/base-notification-queue-service.d.ts +1 -1
- package/dist/services/notification-service.d.ts +73 -13
- package/dist/services/notification-service.js +125 -8
- package/dist/services/notification-template-renderers/base-email-template-renderer.d.ts +3 -3
- package/dist/services/notification-template-renderers/base-notification-template-renderer.d.ts +2 -2
- package/dist/types/attachment.d.ts +42 -0
- package/dist/types/attachment.js +7 -0
- package/dist/types/notification-type-config.d.ts +2 -2
- package/dist/types/notification.d.ts +21 -0
- package/dist/types/one-off-notification.d.ts +72 -0
- package/dist/types/one-off-notification.js +2 -0
- package/package.json +13 -11
|
@@ -1,23 +1,55 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import type * as
|
|
3
|
-
import type { ControllerProps, FieldPath, FieldValues } from
|
|
4
|
-
declare const Form: <
|
|
5
|
-
|
|
1
|
+
import type * as LabelPrimitive from '@radix-ui/react-label';
|
|
2
|
+
import type * as React from 'react';
|
|
3
|
+
import type { ControllerProps, FieldPath, FieldValues } from 'react-hook-form';
|
|
4
|
+
declare const Form: <
|
|
5
|
+
TFieldValues extends FieldValues,
|
|
6
|
+
TContext = any,
|
|
7
|
+
TTransformedValues extends FieldValues | undefined = undefined,
|
|
8
|
+
>(
|
|
9
|
+
props: import('react-hook-form').FormProviderProps<TFieldValues, TContext, TTransformedValues>,
|
|
10
|
+
) => React.JSX.Element;
|
|
11
|
+
declare const FormField: <
|
|
12
|
+
TFieldValues extends FieldValues = FieldValues,
|
|
13
|
+
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
|
|
14
|
+
>({
|
|
15
|
+
...props
|
|
16
|
+
}: ControllerProps<TFieldValues, TName>) => React.JSX.Element;
|
|
6
17
|
declare const useFormField: () => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
18
|
+
invalid: boolean;
|
|
19
|
+
isDirty: boolean;
|
|
20
|
+
isTouched: boolean;
|
|
21
|
+
isValidating: boolean;
|
|
22
|
+
error?: import('react-hook-form').FieldError;
|
|
23
|
+
id: string;
|
|
24
|
+
name: string;
|
|
25
|
+
formItemId: string;
|
|
26
|
+
formDescriptionId: string;
|
|
27
|
+
formMessageId: string;
|
|
28
|
+
};
|
|
29
|
+
declare const FormItem: React.ForwardRefExoticComponent<
|
|
30
|
+
React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>
|
|
31
|
+
>;
|
|
32
|
+
declare const FormLabel: React.ForwardRefExoticComponent<
|
|
33
|
+
Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, 'ref'> &
|
|
34
|
+
React.RefAttributes<HTMLLabelElement>
|
|
35
|
+
>;
|
|
36
|
+
declare const FormControl: React.ForwardRefExoticComponent<
|
|
37
|
+
Omit<import('@radix-ui/react-slot').SlotProps & React.RefAttributes<HTMLElement>, 'ref'> &
|
|
38
|
+
React.RefAttributes<HTMLElement>
|
|
39
|
+
>;
|
|
40
|
+
declare const FormDescription: React.ForwardRefExoticComponent<
|
|
41
|
+
React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>
|
|
42
|
+
>;
|
|
43
|
+
declare const FormMessage: React.ForwardRefExoticComponent<
|
|
44
|
+
React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>
|
|
45
|
+
>;
|
|
46
|
+
export {
|
|
47
|
+
useFormField,
|
|
48
|
+
Form,
|
|
49
|
+
FormItem,
|
|
50
|
+
FormLabel,
|
|
51
|
+
FormControl,
|
|
52
|
+
FormDescription,
|
|
53
|
+
FormMessage,
|
|
54
|
+
FormField,
|
|
17
55
|
};
|
|
18
|
-
declare const FormItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
-
declare const FormLabel: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & React.RefAttributes<HTMLLabelElement>>;
|
|
20
|
-
declare const FormControl: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-slot").SlotProps & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
21
|
-
declare const FormDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
22
|
-
declare const FormMessage: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
23
|
-
export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, };
|
|
@@ -1,111 +1,165 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
var __createBinding =
|
|
3
|
+
(this && this.__createBinding) ||
|
|
4
|
+
(Object.create
|
|
5
|
+
? (o, m, k, k2) => {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: () => m[k] };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}
|
|
13
|
+
: (o, m, k, k2) => {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
});
|
|
17
|
+
var __setModuleDefault =
|
|
18
|
+
(this && this.__setModuleDefault) ||
|
|
19
|
+
(Object.create
|
|
20
|
+
? (o, v) => {
|
|
21
|
+
Object.defineProperty(o, 'default', { enumerable: true, value: v });
|
|
22
|
+
}
|
|
23
|
+
: (o, v) => {
|
|
24
|
+
o['default'] = v;
|
|
25
|
+
});
|
|
26
|
+
var __importStar =
|
|
27
|
+
(this && this.__importStar) ||
|
|
28
|
+
(() => {
|
|
29
|
+
var ownKeys = (o) => {
|
|
30
|
+
ownKeys =
|
|
31
|
+
Object.getOwnPropertyNames ||
|
|
32
|
+
((o) => {
|
|
33
|
+
var ar = [];
|
|
34
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
35
|
+
return ar;
|
|
36
|
+
});
|
|
37
|
+
return ownKeys(o);
|
|
27
38
|
};
|
|
28
|
-
return
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
39
|
+
return (mod) => {
|
|
40
|
+
if (mod && mod.__esModule) return mod;
|
|
41
|
+
var result = {};
|
|
42
|
+
if (mod != null)
|
|
43
|
+
for (var k = ownKeys(mod), i = 0; i < k.length; i++)
|
|
44
|
+
if (k[i] !== 'default') __createBinding(result, mod, k[i]);
|
|
45
|
+
__setModuleDefault(result, mod);
|
|
46
|
+
return result;
|
|
34
47
|
};
|
|
35
|
-
})();
|
|
36
|
-
Object.defineProperty(exports,
|
|
37
|
-
exports.FormField =
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
48
|
+
})();
|
|
49
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
50
|
+
exports.FormField =
|
|
51
|
+
exports.FormMessage =
|
|
52
|
+
exports.FormDescription =
|
|
53
|
+
exports.FormControl =
|
|
54
|
+
exports.FormLabel =
|
|
55
|
+
exports.FormItem =
|
|
56
|
+
exports.Form =
|
|
57
|
+
exports.useFormField =
|
|
58
|
+
void 0;
|
|
59
|
+
const React = __importStar(require('react'));
|
|
60
|
+
const react_slot_1 = require('@radix-ui/react-slot');
|
|
61
|
+
const react_hook_form_1 = require('react-hook-form');
|
|
62
|
+
const utils_1 = require('../../lib/utils');
|
|
63
|
+
const label_1 = require('../../components/ui/label');
|
|
43
64
|
const Form = react_hook_form_1.FormProvider;
|
|
44
65
|
exports.Form = Form;
|
|
45
66
|
const FormFieldContext = React.createContext({});
|
|
46
67
|
const FormField = ({ ...props }) => {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
68
|
+
return (
|
|
69
|
+
<FormFieldContext.Provider value={{ name: props.name }}>
|
|
70
|
+
<react_hook_form_1.Controller {...props} />
|
|
71
|
+
</FormFieldContext.Provider>
|
|
72
|
+
);
|
|
50
73
|
};
|
|
51
74
|
exports.FormField = FormField;
|
|
52
75
|
const useFormField = () => {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
76
|
+
const fieldContext = React.useContext(FormFieldContext);
|
|
77
|
+
const itemContext = React.useContext(FormItemContext);
|
|
78
|
+
const { getFieldState, formState } = (0, react_hook_form_1.useFormContext)();
|
|
79
|
+
const fieldState = getFieldState(fieldContext.name, formState);
|
|
80
|
+
if (!fieldContext) {
|
|
81
|
+
throw new Error('useFormField should be used within <FormField>');
|
|
82
|
+
}
|
|
83
|
+
const { id } = itemContext;
|
|
84
|
+
return {
|
|
85
|
+
id,
|
|
86
|
+
name: fieldContext.name,
|
|
87
|
+
formItemId: `${id}-form-item`,
|
|
88
|
+
formDescriptionId: `${id}-form-item-description`,
|
|
89
|
+
formMessageId: `${id}-form-item-message`,
|
|
90
|
+
...fieldState,
|
|
91
|
+
};
|
|
69
92
|
};
|
|
70
93
|
exports.useFormField = useFormField;
|
|
71
94
|
const FormItemContext = React.createContext({});
|
|
72
95
|
const FormItem = React.forwardRef(({ className, ...props }, ref) => {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
96
|
+
const id = React.useId();
|
|
97
|
+
return (
|
|
98
|
+
<FormItemContext.Provider value={{ id }}>
|
|
99
|
+
<div ref={ref} className={(0, utils_1.cn)('space-y-2', className)} {...props} />
|
|
100
|
+
</FormItemContext.Provider>
|
|
101
|
+
);
|
|
77
102
|
});
|
|
78
103
|
exports.FormItem = FormItem;
|
|
79
|
-
FormItem.displayName =
|
|
104
|
+
FormItem.displayName = 'FormItem';
|
|
80
105
|
const FormLabel = React.forwardRef(({ className, ...props }, ref) => {
|
|
81
|
-
|
|
82
|
-
|
|
106
|
+
const { error, formItemId } = useFormField();
|
|
107
|
+
return (
|
|
108
|
+
<label_1.Label
|
|
109
|
+
ref={ref}
|
|
110
|
+
className={(0, utils_1.cn)(error && 'text-destructive', className)}
|
|
111
|
+
htmlFor={formItemId}
|
|
112
|
+
{...props}
|
|
113
|
+
/>
|
|
114
|
+
);
|
|
83
115
|
});
|
|
84
116
|
exports.FormLabel = FormLabel;
|
|
85
|
-
FormLabel.displayName =
|
|
117
|
+
FormLabel.displayName = 'FormLabel';
|
|
86
118
|
const FormControl = React.forwardRef(({ ...props }, ref) => {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
119
|
+
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
120
|
+
return (
|
|
121
|
+
<react_slot_1.Slot
|
|
122
|
+
ref={ref}
|
|
123
|
+
id={formItemId}
|
|
124
|
+
aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}
|
|
125
|
+
aria-invalid={!!error}
|
|
126
|
+
{...props}
|
|
127
|
+
/>
|
|
128
|
+
);
|
|
91
129
|
});
|
|
92
130
|
exports.FormControl = FormControl;
|
|
93
|
-
FormControl.displayName =
|
|
131
|
+
FormControl.displayName = 'FormControl';
|
|
94
132
|
const FormDescription = React.forwardRef(({ className, ...props }, ref) => {
|
|
95
|
-
|
|
96
|
-
|
|
133
|
+
const { formDescriptionId } = useFormField();
|
|
134
|
+
return (
|
|
135
|
+
<p
|
|
136
|
+
ref={ref}
|
|
137
|
+
id={formDescriptionId}
|
|
138
|
+
className={(0, utils_1.cn)('text-sm text-muted-foreground', className)}
|
|
139
|
+
{...props}
|
|
140
|
+
/>
|
|
141
|
+
);
|
|
97
142
|
});
|
|
98
143
|
exports.FormDescription = FormDescription;
|
|
99
|
-
FormDescription.displayName =
|
|
144
|
+
FormDescription.displayName = 'FormDescription';
|
|
100
145
|
const FormMessage = React.forwardRef(({ className, children, ...props }, ref) => {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
return
|
|
146
|
+
const { error, formMessageId } = useFormField();
|
|
147
|
+
const body = error
|
|
148
|
+
? String(error === null || error === void 0 ? void 0 : error.message)
|
|
149
|
+
: children;
|
|
150
|
+
if (!body) {
|
|
151
|
+
return null;
|
|
152
|
+
}
|
|
153
|
+
return (
|
|
154
|
+
<p
|
|
155
|
+
ref={ref}
|
|
156
|
+
id={formMessageId}
|
|
157
|
+
className={(0, utils_1.cn)('text-sm font-medium text-destructive', className)}
|
|
158
|
+
{...props}
|
|
159
|
+
>
|
|
107
160
|
{body}
|
|
108
|
-
</p>
|
|
161
|
+
</p>
|
|
162
|
+
);
|
|
109
163
|
});
|
|
110
164
|
exports.FormMessage = FormMessage;
|
|
111
|
-
FormMessage.displayName =
|
|
165
|
+
FormMessage.displayName = 'FormMessage';
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
declare const Input: React.ForwardRefExoticComponent<
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
declare const Input: React.ForwardRefExoticComponent<
|
|
3
|
+
Omit<
|
|
4
|
+
React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>,
|
|
5
|
+
'ref'
|
|
6
|
+
> &
|
|
7
|
+
React.RefAttributes<HTMLInputElement>
|
|
8
|
+
>;
|
|
3
9
|
export { Input };
|
|
@@ -1,43 +1,66 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
var __createBinding =
|
|
2
|
+
(this && this.__createBinding) ||
|
|
3
|
+
(Object.create
|
|
4
|
+
? (o, m, k, k2) => {
|
|
5
|
+
if (k2 === undefined) k2 = k;
|
|
6
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7
|
+
if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8
|
+
desc = { enumerable: true, get: () => m[k] };
|
|
9
|
+
}
|
|
10
|
+
Object.defineProperty(o, k2, desc);
|
|
11
|
+
}
|
|
12
|
+
: (o, m, k, k2) => {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
});
|
|
16
|
+
var __setModuleDefault =
|
|
17
|
+
(this && this.__setModuleDefault) ||
|
|
18
|
+
(Object.create
|
|
19
|
+
? (o, v) => {
|
|
20
|
+
Object.defineProperty(o, 'default', { enumerable: true, value: v });
|
|
21
|
+
}
|
|
22
|
+
: (o, v) => {
|
|
23
|
+
o['default'] = v;
|
|
24
|
+
});
|
|
25
|
+
var __importStar =
|
|
26
|
+
(this && this.__importStar) ||
|
|
27
|
+
(() => {
|
|
28
|
+
var ownKeys = (o) => {
|
|
29
|
+
ownKeys =
|
|
30
|
+
Object.getOwnPropertyNames ||
|
|
31
|
+
((o) => {
|
|
32
|
+
var ar = [];
|
|
33
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
34
|
+
return ar;
|
|
35
|
+
});
|
|
36
|
+
return ownKeys(o);
|
|
26
37
|
};
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
38
|
+
return (mod) => {
|
|
39
|
+
if (mod && mod.__esModule) return mod;
|
|
40
|
+
var result = {};
|
|
41
|
+
if (mod != null)
|
|
42
|
+
for (var k = ownKeys(mod), i = 0; i < k.length; i++)
|
|
43
|
+
if (k[i] !== 'default') __createBinding(result, mod, k[i]);
|
|
44
|
+
__setModuleDefault(result, mod);
|
|
45
|
+
return result;
|
|
33
46
|
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports,
|
|
47
|
+
})();
|
|
48
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
36
49
|
exports.Input = void 0;
|
|
37
|
-
const React = __importStar(require(
|
|
38
|
-
const utils_1 = require(
|
|
50
|
+
const React = __importStar(require('react'));
|
|
51
|
+
const utils_1 = require('../../lib/utils');
|
|
39
52
|
const Input = React.forwardRef(({ className, type, ...props }, ref) => {
|
|
40
|
-
|
|
53
|
+
return (
|
|
54
|
+
<input
|
|
55
|
+
type={type}
|
|
56
|
+
className={(0, utils_1.cn)(
|
|
57
|
+
'flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',
|
|
58
|
+
className,
|
|
59
|
+
)}
|
|
60
|
+
ref={ref}
|
|
61
|
+
{...props}
|
|
62
|
+
/>
|
|
63
|
+
);
|
|
41
64
|
});
|
|
42
65
|
exports.Input = Input;
|
|
43
|
-
Input.displayName =
|
|
66
|
+
Input.displayName = 'Input';
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
declare const Label: React.ForwardRefExoticComponent<
|
|
1
|
+
import type * as LabelPrimitive from '@radix-ui/react-label';
|
|
2
|
+
import type { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import type * as React from 'react';
|
|
4
|
+
declare const Label: React.ForwardRefExoticComponent<
|
|
5
|
+
Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, 'ref'> &
|
|
6
|
+
VariantProps<
|
|
7
|
+
(props?: import('class-variance-authority/dist/types').ClassProp | undefined) => string
|
|
8
|
+
> &
|
|
9
|
+
React.RefAttributes<HTMLLabelElement>
|
|
10
|
+
>;
|
|
5
11
|
export { Label };
|
|
@@ -1,45 +1,66 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
var __createBinding =
|
|
3
|
+
(this && this.__createBinding) ||
|
|
4
|
+
(Object.create
|
|
5
|
+
? (o, m, k, k2) => {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: () => m[k] };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}
|
|
13
|
+
: (o, m, k, k2) => {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
});
|
|
17
|
+
var __setModuleDefault =
|
|
18
|
+
(this && this.__setModuleDefault) ||
|
|
19
|
+
(Object.create
|
|
20
|
+
? (o, v) => {
|
|
21
|
+
Object.defineProperty(o, 'default', { enumerable: true, value: v });
|
|
22
|
+
}
|
|
23
|
+
: (o, v) => {
|
|
24
|
+
o['default'] = v;
|
|
25
|
+
});
|
|
26
|
+
var __importStar =
|
|
27
|
+
(this && this.__importStar) ||
|
|
28
|
+
(() => {
|
|
29
|
+
var ownKeys = (o) => {
|
|
30
|
+
ownKeys =
|
|
31
|
+
Object.getOwnPropertyNames ||
|
|
32
|
+
((o) => {
|
|
33
|
+
var ar = [];
|
|
34
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
35
|
+
return ar;
|
|
36
|
+
});
|
|
37
|
+
return ownKeys(o);
|
|
27
38
|
};
|
|
28
|
-
return
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
39
|
+
return (mod) => {
|
|
40
|
+
if (mod && mod.__esModule) return mod;
|
|
41
|
+
var result = {};
|
|
42
|
+
if (mod != null)
|
|
43
|
+
for (var k = ownKeys(mod), i = 0; i < k.length; i++)
|
|
44
|
+
if (k[i] !== 'default') __createBinding(result, mod, k[i]);
|
|
45
|
+
__setModuleDefault(result, mod);
|
|
46
|
+
return result;
|
|
34
47
|
};
|
|
35
|
-
})();
|
|
36
|
-
Object.defineProperty(exports,
|
|
48
|
+
})();
|
|
49
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
37
50
|
exports.Label = void 0;
|
|
38
|
-
const React = __importStar(require(
|
|
39
|
-
const LabelPrimitive = __importStar(require(
|
|
40
|
-
const class_variance_authority_1 = require(
|
|
41
|
-
const utils_1 = require(
|
|
42
|
-
const labelVariants = (0, class_variance_authority_1.cva)(
|
|
43
|
-
|
|
51
|
+
const React = __importStar(require('react'));
|
|
52
|
+
const LabelPrimitive = __importStar(require('@radix-ui/react-label'));
|
|
53
|
+
const class_variance_authority_1 = require('class-variance-authority');
|
|
54
|
+
const utils_1 = require('../../lib/utils');
|
|
55
|
+
const labelVariants = (0, class_variance_authority_1.cva)(
|
|
56
|
+
'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70',
|
|
57
|
+
);
|
|
58
|
+
const Label = React.forwardRef(({ className, ...props }, ref) => (
|
|
59
|
+
<LabelPrimitive.Root
|
|
60
|
+
ref={ref}
|
|
61
|
+
className={(0, utils_1.cn)(labelVariants(), className)}
|
|
62
|
+
{...props}
|
|
63
|
+
/>
|
|
64
|
+
));
|
|
44
65
|
exports.Label = Label;
|
|
45
66
|
Label.displayName = LabelPrimitive.Root.displayName;
|